Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ec45bfb1d5 | |||
| 1e5a959f25 | |||
| e1529e7f8f | |||
| 47123a7d0a | |||
| a0f27739b7 | |||
| 93474811f1 | |||
| 6f50fad596 | |||
| 538834dcc3 | |||
| 389ddaabb7 | |||
| c7d2d53902 | |||
| 367a98be56 | |||
| 2128fb883a | |||
| 729da39c87 | |||
| 7e82ea86ec | |||
| ddac31b8bc | |||
| 491b5527ae | |||
| e63a9d4b16 | |||
| 6dac0ad4e8 | |||
| 19a737a770 |
@@ -63,3 +63,4 @@ OurUmbraco.Site/[Aa]ssets/js/app.min.js
|
|||||||
OurUmbraco.Site/App_Data/migrations/*.txt
|
OurUmbraco.Site/App_Data/migrations/*.txt
|
||||||
OurUmbraco.Site/apidocs/
|
OurUmbraco.Site/apidocs/
|
||||||
OurUmbraco.Site/App_Data/Documentation/
|
OurUmbraco.Site/App_Data/Documentation/
|
||||||
|
OurUmbraco.Site/App_Data/NotificationTest/
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
|
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
|
||||||
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
|
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
|
||||||
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
|
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
|
||||||
@@ -1104,8 +1104,8 @@ namespace TestProject.Controllers
|
|||||||
<option class="features" value="1150">our.umb dev forum - Features</option>
|
<option class="features" value="1150">our.umb dev forum - Features</option>
|
||||||
<option class="general" value="5668">Core - General</option>
|
<option class="general" value="5668">Core - General</option>
|
||||||
<option class="4.1feedback" value="5669">Core - 4.1 feedback</option>
|
<option class="4.1feedback" value="5669">Core - 4.1 feedback</option>
|
||||||
<option class="generalquestions" value="73967">Umbraco as a Service - General Questions</option>
|
<option class="generalquestions" value="73967">Umbraco Cloud - General Questions</option>
|
||||||
<option class="issues" value="73968">Umbraco as a Service - Issues</option>
|
<option class="issues" value="73968">Umbraco Cloud - Issues</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
|
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
|
||||||
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
|
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
|
||||||
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
|
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
|
||||||
@@ -624,8 +624,8 @@ grunt</pre>
|
|||||||
<div class="package-compatibility-versions">
|
<div class="package-compatibility-versions">
|
||||||
|
|
||||||
<div class="versions">
|
<div class="versions">
|
||||||
<span class="smiley joyous">Umbraco as a Service (Works)</span>
|
<span class="smiley joyous">Umbraco Cloud (Works)</span>
|
||||||
<span class="smiley untested">Umbraco as a Service (Not working yet)</span>
|
<span class="smiley untested">Umbraco Cloud (Not working yet)</span>
|
||||||
<span class="smiley untested"> 7.2.x (untested)</span>
|
<span class="smiley untested"> 7.2.x (untested)</span>
|
||||||
<span class="smiley happy"> 7.1.x (91%)</span>
|
<span class="smiley happy"> 7.1.x (91%)</span>
|
||||||
<span class="smiley joyous"> 7.0.x (100%)</span>
|
<span class="smiley joyous"> 7.0.x (100%)</span>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\packages\UmbracoCms.7.5.4\build\UmbracoCms.props" Condition="Exists('..\packages\UmbracoCms.7.5.4\build\UmbracoCms.props')" />
|
<Import Project="..\packages\UmbracoCms.7.5.5\build\UmbracoCms.props" Condition="Exists('..\packages\UmbracoCms.7.5.5\build\UmbracoCms.props')" />
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
@@ -55,24 +55,24 @@
|
|||||||
<HintPath>..\packages\AutoMapper.3.3.1\lib\net40\AutoMapper.Net4.dll</HintPath>
|
<HintPath>..\packages\AutoMapper.3.3.1\lib\net40\AutoMapper.Net4.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="businesslogic, Version=1.0.6136.27244, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="businesslogic, Version=1.0.6183.23126, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\businesslogic.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\businesslogic.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="ClientDependency.Core, Version=1.9.1.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="ClientDependency.Core, Version=1.9.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\ClientDependency.1.9.1\lib\net45\ClientDependency.Core.dll</HintPath>
|
<HintPath>..\packages\ClientDependency.1.9.2\lib\net45\ClientDependency.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="ClientDependency.Core.Mvc, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="ClientDependency.Core.Mvc, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\ClientDependency-Mvc5.1.8.0.0\lib\net45\ClientDependency.Core.Mvc.dll</HintPath>
|
<HintPath>..\packages\ClientDependency-Mvc5.1.8.0.0\lib\net45\ClientDependency.Core.Mvc.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="cms, Version=1.0.6136.27244, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="cms, Version=1.0.6183.23126, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\cms.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\cms.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="controls, Version=1.0.6136.27246, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="controls, Version=1.0.6183.23128, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\controls.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\controls.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="CookComputing.XmlRpcV2, Version=2.5.0.0, Culture=neutral, PublicKeyToken=a7d6e17aa302004d, processorArchitecture=MSIL">
|
<Reference Include="CookComputing.XmlRpcV2, Version=2.5.0.0, Culture=neutral, PublicKeyToken=a7d6e17aa302004d, processorArchitecture=MSIL">
|
||||||
@@ -87,8 +87,8 @@
|
|||||||
<HintPath>..\packages\Examine.0.1.70.0\lib\Examine.dll</HintPath>
|
<HintPath>..\packages\Examine.0.1.70.0\lib\Examine.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HtmlAgilityPack, Version=1.4.9.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
|
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\HtmlAgilityPack.1.4.9\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
<HintPath>..\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||||
@@ -107,8 +107,8 @@
|
|||||||
<HintPath>..\packages\UrlTracker.3.11\lib\InfoCaster.Umbraco.UrlTracker.dll</HintPath>
|
<HintPath>..\packages\UrlTracker.3.11\lib\InfoCaster.Umbraco.UrlTracker.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="interfaces, Version=1.0.6136.27240, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="interfaces, Version=1.0.6183.23122, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\interfaces.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\interfaces.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="JsonFx, Version=2.0.1209.2802, Culture=neutral, PublicKeyToken=315052dd637f8a52, processorArchitecture=MSIL">
|
<Reference Include="JsonFx, Version=2.0.1209.2802, Culture=neutral, PublicKeyToken=315052dd637f8a52, processorArchitecture=MSIL">
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
<HintPath>..\packages\JsonFx.2.0.1209.2802\lib\net40\JsonFx.dll</HintPath>
|
<HintPath>..\packages\JsonFx.2.0.1209.2802\lib\net40\JsonFx.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\log4net.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\log4net.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181, processorArchitecture=MSIL">
|
<Reference Include="Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181, processorArchitecture=MSIL">
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral">
|
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.AspNet.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.AspNet.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
@@ -204,8 +204,8 @@
|
|||||||
<HintPath>..\packages\semver.1.1.2\lib\net451\Semver.dll</HintPath>
|
<HintPath>..\packages\semver.1.1.2\lib\net451\Semver.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SQLCE4Umbraco, Version=1.0.6136.27245, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="SQLCE4Umbraco, Version=1.0.6183.23127, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\SQLCE4Umbraco.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\SQLCE4Umbraco.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Collections.Immutable, Version=1.1.36.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Collections.Immutable, Version=1.1.36.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
@@ -214,11 +214,11 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\System.Data.SqlServerCe.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
@@ -282,47 +282,47 @@
|
|||||||
<Reference Include="System.EnterpriseServices" />
|
<Reference Include="System.EnterpriseServices" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="TidyNet, Version=1.0.0.0, Culture=neutral">
|
<Reference Include="TidyNet, Version=1.0.0.0, Culture=neutral">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\TidyNet.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\TidyNet.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="umbraco, Version=1.0.6136.27248, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="umbraco, Version=1.0.6183.23129, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\umbraco.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\umbraco.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Umbraco.Core, Version=1.0.6136.27241, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Umbraco.Core, Version=1.0.6183.23123, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\Umbraco.Core.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\Umbraco.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="umbraco.DataLayer, Version=1.0.6136.27243, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="umbraco.DataLayer, Version=1.0.6183.23126, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\umbraco.DataLayer.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\umbraco.DataLayer.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="umbraco.editorControls, Version=1.0.6136.27251, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="umbraco.editorControls, Version=1.0.6183.23131, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\umbraco.editorControls.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\umbraco.editorControls.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Umbraco.IdentityExtensions, Version=1.0.5779.34109, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Umbraco.IdentityExtensions, Version=1.0.5779.34109, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.IdentityExtensions.1.0.0\lib\net45\Umbraco.IdentityExtensions.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.IdentityExtensions.1.0.0\lib\net45\Umbraco.IdentityExtensions.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="umbraco.MacroEngines, Version=1.0.6136.27252, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="umbraco.MacroEngines, Version=1.0.6183.23132, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\umbraco.MacroEngines.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\umbraco.MacroEngines.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Umbraco.ModelsBuilder, Version=3.0.4.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Umbraco.ModelsBuilder, Version=3.0.5.96, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Umbraco.ModelsBuilder.3.0.4\lib\Umbraco.ModelsBuilder.dll</HintPath>
|
<HintPath>..\packages\Umbraco.ModelsBuilder.3.0.5\lib\Umbraco.ModelsBuilder.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="umbraco.providers, Version=1.0.6136.27246, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="umbraco.providers, Version=1.0.6183.23128, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\umbraco.providers.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\umbraco.providers.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Umbraco.Web.UI, Version=1.0.6136.27253, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Umbraco.Web.UI, Version=1.0.6183.23133, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\Umbraco.Web.UI.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\Umbraco.Web.UI.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UmbracoExamine, Version=0.7.0.27245, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="UmbracoExamine, Version=0.7.0.23127, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\UmbracoCms.Core.7.5.4\lib\UmbracoExamine.dll</HintPath>
|
<HintPath>..\packages\UmbracoCms.Core.7.5.5\lib\UmbracoExamine.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UrlRewritingNet.UrlRewriter, Version=2.0.7.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="UrlRewritingNet.UrlRewriter, Version=2.0.7.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
@@ -1707,7 +1707,6 @@
|
|||||||
<Content Include="Views\MacroPartials\Navigation\TopNavigation.cshtml" />
|
<Content Include="Views\MacroPartials\Navigation\TopNavigation.cshtml" />
|
||||||
<Content Include="masterpages\ForumMaster.master" />
|
<Content Include="masterpages\ForumMaster.master" />
|
||||||
<Content Include="masterpages\DocumentationMaster.master" />
|
<Content Include="masterpages\DocumentationMaster.master" />
|
||||||
<Content Include="masterpages\AddMarkdownProp.master" />
|
|
||||||
<Content Include="masterpages\ComRepositoryFrontpage.master" />
|
<Content Include="masterpages\ComRepositoryFrontpage.master" />
|
||||||
<Content Include="Assets\css\fonts\icomoon\icomoon.eot" />
|
<Content Include="Assets\css\fonts\icomoon\icomoon.eot" />
|
||||||
<Content Include="Assets\css\fonts\icomoon\icomoon.ttf" />
|
<Content Include="Assets\css\fonts\icomoon\icomoon.ttf" />
|
||||||
@@ -4282,7 +4281,6 @@
|
|||||||
<Content Include="masterpages\ManageSpam.master" />
|
<Content Include="masterpages\ManageSpam.master" />
|
||||||
<Content Include="macroScripts\ManageSpam.cshtml" />
|
<Content Include="macroScripts\ManageSpam.cshtml" />
|
||||||
<Content Include="masterpages\ProjectsVersioned.master" />
|
<Content Include="masterpages\ProjectsVersioned.master" />
|
||||||
<Content Include="macroScripts\ProjectsVersioned.cshtml" />
|
|
||||||
<Content Include="macroScripts\ProjectsVersionList.cshtml" />
|
<Content Include="macroScripts\ProjectsVersionList.cshtml" />
|
||||||
<Content Include="masterpages\ProjectCompatibility.master" />
|
<Content Include="masterpages\ProjectCompatibility.master" />
|
||||||
<Content Include="macroScripts\EditProjectCompatibility.cshtml" />
|
<Content Include="macroScripts\EditProjectCompatibility.cshtml" />
|
||||||
@@ -4409,7 +4407,9 @@
|
|||||||
<Content Include="Views\Partials\Grid\Editors\Embed.cshtml" />
|
<Content Include="Views\Partials\Grid\Editors\Embed.cshtml" />
|
||||||
<Content Include="Views\Partials\Grid\Editors\Base.cshtml" />
|
<Content Include="Views\Partials\Grid\Editors\Base.cshtml" />
|
||||||
<Content Include="Views\Partials\Grid\Bootstrap3.cshtml" />
|
<Content Include="Views\Partials\Grid\Bootstrap3.cshtml" />
|
||||||
|
<Content Include="Views\Partials\Grid\Bootstrap3-Fluid.cshtml" />
|
||||||
<Content Include="Views\Partials\Grid\Bootstrap2.cshtml" />
|
<Content Include="Views\Partials\Grid\Bootstrap2.cshtml" />
|
||||||
|
<Content Include="Views\Partials\Grid\Bootstrap2-Fluid.cshtml" />
|
||||||
<None Include="web.Debug.config">
|
<None Include="web.Debug.config">
|
||||||
<DependentUpon>web.config</DependentUpon>
|
<DependentUpon>web.config</DependentUpon>
|
||||||
</None>
|
</None>
|
||||||
@@ -4482,15 +4482,15 @@
|
|||||||
<!-- Only runs if the ClientFiles build folder doesn't yet exist -->
|
<!-- Only runs if the ClientFiles build folder doesn't yet exist -->
|
||||||
<CallTarget Targets="ClientFilesBuild" Condition="!Exists('$(ProjectDir)\..\OurUmbraco.Client\build\assets')" />
|
<CallTarget Targets="ClientFilesBuild" Condition="!Exists('$(ProjectDir)\..\OurUmbraco.Client\build\assets')" />
|
||||||
</Target>
|
</Target>
|
||||||
|
<Import Project="..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets" Condition="Exists('..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>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}.</ErrorText>
|
<ErrorText>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}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\packages\UmbracoCms.7.5.4\build\UmbracoCms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\UmbracoCms.7.5.4\build\UmbracoCms.props'))" />
|
<Error Condition="!Exists('..\packages\UmbracoCms.7.5.5\build\UmbracoCms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\UmbracoCms.7.5.5\build\UmbracoCms.props'))" />
|
||||||
<Error Condition="!Exists('..\packages\UmbracoCms.7.5.4\build\UmbracoCms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\UmbracoCms.7.5.4\build\UmbracoCms.targets'))" />
|
<Error Condition="!Exists('..\packages\UmbracoCms.7.5.5\build\UmbracoCms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\UmbracoCms.7.5.5\build\UmbracoCms.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<Import Project="..\packages\UmbracoCms.7.5.4\build\UmbracoCms.targets" Condition="Exists('..\packages\UmbracoCms.7.5.4\build\UmbracoCms.targets')" />
|
<Import Project="..\packages\UmbracoCms.7.5.5\build\UmbracoCms.targets" Condition="Exists('..\packages\UmbracoCms.7.5.5\build\UmbracoCms.targets')" />
|
||||||
<Import Project="..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets" Condition="Exists('..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="AfterBuild">
|
<Target Name="AfterBuild">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(memberGuid) == false)
|
if (string.IsNullOrWhiteSpace(memberGuid) == false)
|
||||||
{
|
{
|
||||||
var memberService = UmbracoContext.Current.Application.Services.MemberService;
|
var memberService = ApplicationContext.Current.Services.MemberService;
|
||||||
var member = memberService.GetByKey(new Guid(memberGuid));
|
var member = memberService.GetByKey(new Guid(memberGuid));
|
||||||
|
|
||||||
if (member == null)
|
if (member == null)
|
||||||
|
|||||||
@@ -10,5 +10,5 @@
|
|||||||
<h4><a href="?category=@childPage.Name">@childPage.Name</a></h4>
|
<h4><a href="?category=@childPage.Name">@childPage.Name</a></h4>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
<li><h4><a href="?category=uaas">Umbraco as a Service</a></h4></li>
|
<li><h4><a href="?category=uaas">Umbraco Cloud</a></h4></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
if (category != null)
|
if (category != null)
|
||||||
{
|
{
|
||||||
headline = category == "uaas" ? "Umbraco as a Service" : category.ToLowerInvariant();
|
headline = category == "uaas" ? "Umbraco Cloud" : category.ToLowerInvariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
var searchFilters = new SearchFilters(BooleanOperation.And);
|
var searchFilters = new SearchFilters(BooleanOperation.And);
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
@inherits UmbracoViewPage<dynamic>
|
||||||
|
@using Umbraco.Web.Templates
|
||||||
|
@using Newtonsoft.Json.Linq
|
||||||
|
|
||||||
|
@*
|
||||||
|
Razor helpers located at the bottom of this file
|
||||||
|
*@
|
||||||
|
|
||||||
|
@if (Model != null && Model.sections != null)
|
||||||
|
{
|
||||||
|
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
|
||||||
|
|
||||||
|
<div class="umb-grid">
|
||||||
|
@if (oneColumn)
|
||||||
|
{
|
||||||
|
foreach (var section in Model.sections) {
|
||||||
|
<div class="grid-section">
|
||||||
|
@foreach (var row in section.rows) {
|
||||||
|
@renderRow(row, true);
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row-fluid clearfix">
|
||||||
|
@foreach (var s in Model.sections) {
|
||||||
|
<div class="grid-section">
|
||||||
|
<div class="@("span" + s.grid) column">
|
||||||
|
@foreach (var row in s.rows) {
|
||||||
|
@renderRow(row, false);
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@helper renderRow(dynamic row, bool singleColumn){
|
||||||
|
<div @RenderElementAttributes(row)>
|
||||||
|
@Umbraco.If(singleColumn, "<div class='container-fluid'>")
|
||||||
|
<div class="row-fluid clearfix">
|
||||||
|
@foreach ( var area in row.areas ) {
|
||||||
|
<div class="@("span" + area.grid) column">
|
||||||
|
<div @RenderElementAttributes(area)>
|
||||||
|
@foreach (var control in area.controls) {
|
||||||
|
if (control !=null && control.editor != null && control.editor.view != null ) {
|
||||||
|
<text>@Html.Partial("grid/editors/base", (object)control)</text>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>}
|
||||||
|
</div>
|
||||||
|
@Umbraco.If(singleColumn, "</div>")
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@functions {
|
||||||
|
public static MvcHtmlString RenderElementAttributes(dynamic contentItem)
|
||||||
|
{
|
||||||
|
var attrs = new List<string>();
|
||||||
|
JObject cfg = contentItem.config;
|
||||||
|
|
||||||
|
if(cfg != null)
|
||||||
|
foreach (JProperty property in cfg.Properties())
|
||||||
|
{
|
||||||
|
var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString());
|
||||||
|
attrs.Add(property.Name + "=\"" + propertyValue + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
JObject style = contentItem.styles;
|
||||||
|
|
||||||
|
if (style != null) {
|
||||||
|
var cssVals = new List<string>();
|
||||||
|
foreach (JProperty property in style.Properties())
|
||||||
|
{
|
||||||
|
var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString());
|
||||||
|
if (string.IsNullOrWhiteSpace(propertyValue) == false)
|
||||||
|
{
|
||||||
|
cssVals.Add(property.Name + ":" + propertyValue + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cssVals.Any())
|
||||||
|
attrs.Add("style='" + string.Join(" ", cssVals) + "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
return new MvcHtmlString(string.Join(" ", attrs));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -64,21 +64,29 @@
|
|||||||
JObject cfg = contentItem.config;
|
JObject cfg = contentItem.config;
|
||||||
|
|
||||||
if(cfg != null)
|
if(cfg != null)
|
||||||
foreach (JProperty property in cfg.Properties()) {
|
foreach (JProperty property in cfg.Properties())
|
||||||
attrs.Add(property.Name + "=\"" + property.Value.ToString() + "\"");
|
{
|
||||||
|
var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString());
|
||||||
|
attrs.Add(property.Name + "=\"" + propertyValue + "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
JObject style = contentItem.styles;
|
JObject style = contentItem.styles;
|
||||||
|
|
||||||
if (style != null) {
|
if (style != null) {
|
||||||
var cssVals = new List<string>();
|
var cssVals = new List<string>();
|
||||||
foreach (JProperty property in style.Properties())
|
foreach (JProperty property in style.Properties())
|
||||||
cssVals.Add(property.Name + ":" + property.Value.ToString() + ";");
|
{
|
||||||
|
var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString());
|
||||||
|
if (string.IsNullOrWhiteSpace(propertyValue) == false)
|
||||||
|
{
|
||||||
|
cssVals.Add(property.Name + ":" + propertyValue + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cssVals.Any())
|
if (cssVals.Any())
|
||||||
attrs.Add("style=\"" + string.Join(" ", cssVals) + "\"");
|
attrs.Add("style=\"" + string.Join(" ", cssVals) + "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new MvcHtmlString(string.Join(" ", attrs));
|
return new MvcHtmlString(string.Join(" ", attrs));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
@inherits UmbracoViewPage<dynamic>
|
||||||
|
@using Umbraco.Web.Templates
|
||||||
|
@using Newtonsoft.Json.Linq
|
||||||
|
|
||||||
|
@*
|
||||||
|
Razor helpers located at the bottom of this file
|
||||||
|
*@
|
||||||
|
|
||||||
|
@if (Model != null && Model.sections != null)
|
||||||
|
{
|
||||||
|
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
|
||||||
|
|
||||||
|
<div class="umb-grid">
|
||||||
|
@if (oneColumn)
|
||||||
|
{
|
||||||
|
foreach (var section in Model.sections) {
|
||||||
|
<div class="grid-section">
|
||||||
|
@foreach (var row in section.rows) {
|
||||||
|
@renderRow(row);
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
<div class="row clearfix">
|
||||||
|
@foreach (var s in Model.sections) {
|
||||||
|
<div class="grid-section">
|
||||||
|
<div class="col-md-@s.grid column">
|
||||||
|
@foreach (var row in s.rows) {
|
||||||
|
@renderRow(row);
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@helper renderRow(dynamic row){
|
||||||
|
<div @RenderElementAttributes(row)>
|
||||||
|
<div class="row clearfix">
|
||||||
|
@foreach ( var area in row.areas ) {
|
||||||
|
<div class="col-md-@area.grid column">
|
||||||
|
<div @RenderElementAttributes(area)>
|
||||||
|
@foreach (var control in area.controls) {
|
||||||
|
if (control !=null && control.editor != null && control.editor.view != null ) {
|
||||||
|
<text>@Html.Partial("grid/editors/base", (object)control)</text>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@functions {
|
||||||
|
public static MvcHtmlString RenderElementAttributes(dynamic contentItem)
|
||||||
|
{
|
||||||
|
var attrs = new List<string>();
|
||||||
|
JObject cfg = contentItem.config;
|
||||||
|
|
||||||
|
if(cfg != null)
|
||||||
|
foreach (JProperty property in cfg.Properties())
|
||||||
|
{
|
||||||
|
var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString());
|
||||||
|
attrs.Add(property.Name + "=\"" + propertyValue + "\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
JObject style = contentItem.styles;
|
||||||
|
|
||||||
|
if (style != null) {
|
||||||
|
var cssVals = new List<string>();
|
||||||
|
foreach (JProperty property in style.Properties())
|
||||||
|
{
|
||||||
|
var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString());
|
||||||
|
if (string.IsNullOrWhiteSpace(propertyValue) == false)
|
||||||
|
{
|
||||||
|
cssVals.Add(property.Name + ":" + propertyValue + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cssVals.Any())
|
||||||
|
attrs.Add("style='" + string.Join(" ", cssVals) + "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
return new MvcHtmlString(string.Join(" ", attrs));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -64,21 +64,29 @@
|
|||||||
JObject cfg = contentItem.config;
|
JObject cfg = contentItem.config;
|
||||||
|
|
||||||
if(cfg != null)
|
if(cfg != null)
|
||||||
foreach (JProperty property in cfg.Properties()) {
|
foreach (JProperty property in cfg.Properties())
|
||||||
attrs.Add(property.Name + "=\"" + property.Value.ToString() + "\"");
|
{
|
||||||
|
var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString());
|
||||||
|
attrs.Add(property.Name + "=\"" + propertyValue + "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
JObject style = contentItem.styles;
|
JObject style = contentItem.styles;
|
||||||
|
|
||||||
if (style != null) {
|
if (style != null) {
|
||||||
var cssVals = new List<string>();
|
var cssVals = new List<string>();
|
||||||
foreach (JProperty property in style.Properties())
|
foreach (JProperty property in style.Properties())
|
||||||
cssVals.Add(property.Name + ":" + property.Value.ToString() + ";");
|
{
|
||||||
|
var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString());
|
||||||
|
if (string.IsNullOrWhiteSpace(propertyValue) == false)
|
||||||
|
{
|
||||||
|
cssVals.Add(property.Name + ":" + propertyValue + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cssVals.Any())
|
if (cssVals.Any())
|
||||||
attrs.Add("style=\"" + string.Join(" ", cssVals) + "\"");
|
attrs.Add("style=\"" + string.Join(" ", cssVals) + "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new MvcHtmlString(string.Join(" ", attrs));
|
return new MvcHtmlString(string.Join(" ", attrs));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
@model dynamic
|
@model dynamic
|
||||||
@using Umbraco.Web.Templates
|
|
||||||
|
|
||||||
@functions {
|
@functions {
|
||||||
public static string EditorView(dynamic contentItem)
|
public static string EditorView(dynamic contentItem)
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
@model dynamic
|
@model dynamic
|
||||||
@using Umbraco.Web.Templates
|
|
||||||
@Html.Raw(Model.value)
|
@Html.Raw(Model.value)
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
@inherits UmbracoViewPage<dynamic>
|
@inherits UmbracoViewPage<dynamic>
|
||||||
@using Umbraco.Web.Templates
|
|
||||||
|
|
||||||
|
|
||||||
@if (Model.value != null)
|
@if (Model.value != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
@model dynamic
|
@model dynamic
|
||||||
@using Umbraco.Web.Templates
|
|
||||||
|
|
||||||
@if (Model.value != null)
|
@if (Model.value != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,10 +4,9 @@
|
|||||||
@if (Model.editor.config.markup != null)
|
@if (Model.editor.config.markup != null)
|
||||||
{
|
{
|
||||||
string markup = Model.editor.config.markup.ToString();
|
string markup = Model.editor.config.markup.ToString();
|
||||||
|
|
||||||
var UmbracoHelper = new UmbracoHelper(UmbracoContext.Current);
|
var UmbracoHelper = new UmbracoHelper(UmbracoContext.Current);
|
||||||
|
|
||||||
markup = markup.Replace("#value#", UmbracoHelper.ReplaceLineBreaksForHtml(Model.value.ToString()));
|
markup = markup.Replace("#value#", UmbracoHelper.ReplaceLineBreaksForHtml(TemplateUtilities.CleanForXss(Model.value.ToString())));
|
||||||
markup = markup.Replace("#style#", Model.editor.config.style.ToString());
|
markup = markup.Replace("#style#", Model.editor.config.style.ToString());
|
||||||
|
|
||||||
<text>
|
<text>
|
||||||
|
|||||||
@@ -66,11 +66,11 @@
|
|||||||
<div class="versions">
|
<div class="versions">
|
||||||
@if (Model.WorksOnUaaS)
|
@if (Model.WorksOnUaaS)
|
||||||
{
|
{
|
||||||
<span class="smiley joyous">Works on Umbraco as a Service</span>
|
<span class="smiley joyous">Works on Umbraco Cloud</span>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<span class="smiley untested">Untested or doesn't work on Umbraco as a Service</span>
|
<span class="smiley untested">Untested or doesn't work on Umbraco Cloud</span>
|
||||||
}
|
}
|
||||||
@foreach (var ver in Model.VersionCompatibilities)
|
@foreach (var ver in Model.VersionCompatibilities)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,11 +30,6 @@
|
|||||||
<control showOnce="true" addPanel="true" panelCaption="">
|
<control showOnce="true" addPanel="true" panelCaption="">
|
||||||
views/dashboard/developer/developerdashboardvideos.html
|
views/dashboard/developer/developerdashboardvideos.html
|
||||||
</control>
|
</control>
|
||||||
</tab>
|
|
||||||
<tab caption="Examine Management">
|
|
||||||
<control>
|
|
||||||
views/dashboard/developer/examinemanagement.html
|
|
||||||
</control>
|
|
||||||
</tab>
|
</tab>
|
||||||
<tab caption="Health Check">
|
<tab caption="Health Check">
|
||||||
<control>
|
<control>
|
||||||
@@ -46,6 +41,11 @@
|
|||||||
views/dashboard/developer/redirecturls.html
|
views/dashboard/developer/redirecturls.html
|
||||||
</control>
|
</control>
|
||||||
</tab>
|
</tab>
|
||||||
|
<tab caption="Examine Management">
|
||||||
|
<control>
|
||||||
|
views/dashboard/developer/examinemanagement.html
|
||||||
|
</control>
|
||||||
|
</tab>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section alias="StartupMediaDashboardSection">
|
<section alias="StartupMediaDashboardSection">
|
||||||
|
|||||||
@@ -80,7 +80,28 @@ You get this notification because you posted to our forum.
|
|||||||
You can unsubscribe from your profile on our.umbraco.org
|
You can unsubscribe from your profile on our.umbraco.org
|
||||||
</body>
|
</body>
|
||||||
</notification>
|
</notification>
|
||||||
|
|
||||||
|
<notification name="MarkAsSolutionReminderSingle"
|
||||||
|
|
||||||
|
assembly="NotificationsCore"
|
||||||
|
|
||||||
|
type="NotificationsCore.NotificationTypes.MarkAsSolutionReminderSingle">
|
||||||
|
|
||||||
|
<subject>Umbraco community: Solution Reminder</subject>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
We noticed that the topic ‘{0}’ you created in the Umbraco Community Forum does not have a post marked as a solution.
|
||||||
|
|
||||||
|
If one of the replies helped answer your question or resolve your issue please mark it as a solution so others can quickly find it.
|
||||||
|
You can view the topic and replies here: {1}
|
||||||
|
|
||||||
|
Thank You from the Umbraco Community!
|
||||||
|
--------------------------------------------------
|
||||||
|
You get this notification because you posted to our forum.
|
||||||
|
You can unsubscribe from your profile on our.umbraco.org
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</notification>
|
||||||
</instant>
|
</instant>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -1,304 +0,0 @@
|
|||||||
@inherits umbraco.MacroEngines.DynamicNodeContext
|
|
||||||
@using System.Globalization
|
|
||||||
@using System.Text.RegularExpressions
|
|
||||||
@using OurUmbraco.MarketPlace.Models
|
|
||||||
@using OurUmbraco.Our
|
|
||||||
@using uForum.Businesslogic
|
|
||||||
@{
|
|
||||||
var queriedVersion = Request.QueryString["v"];
|
|
||||||
int requestedVersion;
|
|
||||||
int.TryParse(queriedVersion, out requestedVersion);
|
|
||||||
Version properVersion = null;
|
|
||||||
|
|
||||||
if (requestedVersion != 0)
|
|
||||||
{
|
|
||||||
properVersion = GetProperVersion(requestedVersion.ToString(CultureInfo.InvariantCulture));
|
|
||||||
}
|
|
||||||
|
|
||||||
var projectGroups = Model.Children.Where("nodeTypeAlias == \"ProjectGroup\"");
|
|
||||||
var projects = new List<UmbracoProject>();
|
|
||||||
|
|
||||||
foreach (var projectGroup in projectGroups)
|
|
||||||
{
|
|
||||||
foreach (var project in projectGroup.Children)
|
|
||||||
{
|
|
||||||
if (project.projectLive)
|
|
||||||
{
|
|
||||||
var versionsList = new List<int>();
|
|
||||||
var compatibleVersions = project.CompatibleVersions.Split(',');
|
|
||||||
foreach (var compatibleVersion in compatibleVersions)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(compatibleVersion) == false && compatibleVersion != "saved")
|
|
||||||
{
|
|
||||||
int version;
|
|
||||||
if (int.TryParse(compatibleVersion.Substring(1), out version))
|
|
||||||
{
|
|
||||||
versionsList.Add(version);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var umbracoProject = new UmbracoProject
|
|
||||||
{
|
|
||||||
Id = project.Id,
|
|
||||||
Name = project.Name,
|
|
||||||
CreateDate = project.CreateDate,
|
|
||||||
CompatibleVersions = versionsList
|
|
||||||
};
|
|
||||||
|
|
||||||
projects.Add(umbracoProject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (requestedVersion == 0)
|
|
||||||
{
|
|
||||||
<div class="deliPromoBox clearfix">
|
|
||||||
@{
|
|
||||||
var vs = new List<int>();
|
|
||||||
foreach (var project in projects.OrderByDescending(x => x.CreateDate))
|
|
||||||
{
|
|
||||||
foreach (var version in project.CompatibleVersions.Where(version => vs.Contains(version) == false))
|
|
||||||
{
|
|
||||||
vs.Add(version);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var v in vs.OrderBy(x => x).Where(x => x.ToString(CultureInfo.InvariantCulture).StartsWith("3") == false && x.ToString(CultureInfo.InvariantCulture).StartsWith("5") == false).Skip(6))
|
|
||||||
{
|
|
||||||
<a href="/Projects/ProjectsVersioned?v=@v">Umbraco @(GetProperVersion(v.ToString(CultureInfo.InvariantCulture)).ToString(2)).x</a><br />
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<h1 class="deliCatHead">Umbraco @(properVersion.ToString(2)).x compatible projects</h1>
|
|
||||||
<p><strong>Note:</strong> packages higher up in this list are more likely to actually work as they have been reported <br />to be working with Umbraco version @(properVersion.ToString(2)).x.</p>
|
|
||||||
<div class="deliPromoBox clearfix">
|
|
||||||
<div class="deliPromoArea">
|
|
||||||
<div class="deliPromoBox new clearfix">
|
|
||||||
|
|
||||||
@{
|
|
||||||
var vs = new List<int>();
|
|
||||||
foreach (var project in projects.OrderByDescending(x => x.CreateDate))
|
|
||||||
{
|
|
||||||
foreach (var version in project.CompatibleVersions.Where(version => vs.Contains(version) == false))
|
|
||||||
{
|
|
||||||
vs.Add(version);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<ul class="promoOptions">
|
|
||||||
@foreach (var v in vs.OrderBy(x => x).Where(x => x.ToString(CultureInfo.InvariantCulture).StartsWith("3") == false && x.ToString(CultureInfo.InvariantCulture).StartsWith("5") == false).Skip(6))
|
|
||||||
{
|
|
||||||
var itemProperVersion = GetProperVersion(v.ToString(CultureInfo.InvariantCulture)).ToString(2);
|
|
||||||
var currentProperVersion = properVersion.ToString(2);
|
|
||||||
|
|
||||||
<li><a href="?v=@v" class="newnav @(itemProperVersion == currentProperVersion ? "on": null)">@(itemProperVersion).x</a></li>
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
@{
|
|
||||||
var projectIds = projects.Where(x => x.CompatibleVersions.Contains(requestedVersion)).Select(x => x.Id).ToArray();
|
|
||||||
var selection = string.Join(",", projectIds);
|
|
||||||
if (string.IsNullOrWhiteSpace(selection) == false)
|
|
||||||
{
|
|
||||||
var reader = Data.SqlHelper.ExecuteReader("SELECT id, nodeId, downloads FROM wikiFiles WHERE type = 'package' AND nodeId IN (" + selection + ")");
|
|
||||||
|
|
||||||
while (reader.Read())
|
|
||||||
{
|
|
||||||
var project = projects.FirstOrDefault(x => x.Id == reader.GetInt("nodeId"));
|
|
||||||
|
|
||||||
if (project != null)
|
|
||||||
{
|
|
||||||
project.TotalDownloads = project.TotalDownloads + reader.GetInt("downloads");
|
|
||||||
project.FileId = reader.GetInt("id");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reader = Data.SqlHelper.ExecuteReader("SELECT id, SUM([points]) AS Karma FROM powersProject WHERE id IN (" + selection + ") GROUP BY Id");
|
|
||||||
|
|
||||||
while (reader.Read())
|
|
||||||
{
|
|
||||||
var project = projects.FirstOrDefault(x => x.Id == reader.GetInt("id"));
|
|
||||||
|
|
||||||
if (project != null)
|
|
||||||
{
|
|
||||||
project.Karma = reader.GetInt("Karma");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var i = 1;
|
|
||||||
foreach (var project in projects.OrderBy(x => x.TotalDownloads).Where(x => x.CompatibleVersions.Contains(requestedVersion)))
|
|
||||||
{
|
|
||||||
project.TotalDownloadsRank = i + 5;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
i = 1;
|
|
||||||
foreach (var project in projects.OrderBy(x => x.DownloadsCurrentVersion).Where(x => x.CompatibleVersions.Contains(requestedVersion)))
|
|
||||||
{
|
|
||||||
project.CurrentVersionDownloadsRank = i + 10;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
i = 1;
|
|
||||||
foreach (var project in projects.OrderBy(x => x.Karma).Where(x => x.CompatibleVersions.Contains(requestedVersion)))
|
|
||||||
{
|
|
||||||
project.KarmaRank = i + 5;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var project in projects.Where(x => x.CompatibleVersions.Contains(requestedVersion)))
|
|
||||||
{
|
|
||||||
project.TotalRank = project.TotalDownloadsRank + project.CurrentVersionDownloadsRank + project.KarmaRank;
|
|
||||||
}
|
|
||||||
|
|
||||||
var fileIds = projects.Where(x => x.CompatibleVersions.Contains(requestedVersion)).Select(x => x.FileId).ToArray();
|
|
||||||
selection = string.Join(",", fileIds);
|
|
||||||
|
|
||||||
reader = Data.SqlHelper.ExecuteReader("SELECT * FROM DeliVersionCompatibility WHERE fileID IN(" + selection + ") AND version LIKE '" + GetProperVersion(requestedVersion.ToString(CultureInfo.InvariantCulture)).ToString(2) + ".%'");
|
|
||||||
|
|
||||||
while (reader.Read())
|
|
||||||
{
|
|
||||||
var project = projects.FirstOrDefault(x => x.Id == reader.GetInt("projectId"));
|
|
||||||
|
|
||||||
if (project != null)
|
|
||||||
{
|
|
||||||
project.ReportsCount++;
|
|
||||||
|
|
||||||
if (reader.GetBoolean("isCompatible"))
|
|
||||||
{
|
|
||||||
project.CompatibilityCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var totalProjects = projects.Count(x => x.CompatibleVersions.Contains(requestedVersion));
|
|
||||||
foreach (var project in projects.Where(x => x.CompatibleVersions.Contains(requestedVersion)))
|
|
||||||
{
|
|
||||||
if (project.ReportsCount > 0 && project.CompatibilityCount == 0)
|
|
||||||
{
|
|
||||||
project.TotalRank = -30;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (project.ReportsCount > 0)
|
|
||||||
{
|
|
||||||
project.TotalRank = project.TotalRank + (project.CompatibilityCount + totalProjects);
|
|
||||||
|
|
||||||
float compats = project.CompatibilityCount;
|
|
||||||
float numReps = project.ReportsCount;
|
|
||||||
var percentage = compats/numReps;
|
|
||||||
project.CompatibilityScore = percentage;
|
|
||||||
project.TotalRank = (int) (project.TotalRank*percentage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
<p class="viewAll">Showing @totalProjects projects</p>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<ul id="newest-projects">
|
|
||||||
|
|
||||||
@foreach (var project in projects.OrderByDescending(x => x.TotalRank).Where(x => x.CompatibleVersions.Contains(requestedVersion)))
|
|
||||||
{
|
|
||||||
var node = Library.NodeById(project.Id);
|
|
||||||
var description = node.Description.ToString();
|
|
||||||
var category = node.Parent.Name;
|
|
||||||
var screenshot = node.DefaultScreenshotPath.ToString();
|
|
||||||
var icon = string.IsNullOrEmpty(screenshot)
|
|
||||||
? "/css/img/package2.png"
|
|
||||||
: string.Format("image={0}?bgcolor=fff&width=50&height=50&format=png", screenshot);
|
|
||||||
|
|
||||||
<li class="clearfix">
|
|
||||||
<div class="deliPackage">
|
|
||||||
<div class="brief">
|
|
||||||
<a href="@node.Url" class="packageIcon" style="background:url(@icon) no-repeat top left;">Package</a>
|
|
||||||
<h3><a href="@node.Url">@project.Name</a></h3>
|
|
||||||
<div class="category">@category</div>
|
|
||||||
<div class="commercialIndicator @node.ListingType">@node.ListingType</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="hiLite">
|
|
||||||
<p><a href="@node.Url">@(ShortenText(description))</a></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="popularity">
|
|
||||||
<div class="karma">
|
|
||||||
@project.Karma <small>Karma</small>
|
|
||||||
</div>
|
|
||||||
<div class="downloads">
|
|
||||||
@project.TotalDownloads <small>Downloads</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@functions {
|
|
||||||
public Version GetProperVersion(string version)
|
|
||||||
{
|
|
||||||
if (version == "4.1.0")
|
|
||||||
{
|
|
||||||
return new Version(version);
|
|
||||||
}
|
|
||||||
|
|
||||||
version = version.Replace(".", "");
|
|
||||||
|
|
||||||
if (version.EndsWith("x"))
|
|
||||||
{
|
|
||||||
version = version.Substring(0, version.IndexOf("x", StringComparison.Ordinal));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (version == "410" || version == "4100")
|
|
||||||
{
|
|
||||||
return new Version("4.10");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (version == "411" || version == "4110")
|
|
||||||
{
|
|
||||||
return new Version("4.11");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (version.EndsWith("x"))
|
|
||||||
{
|
|
||||||
version = version.Substring(0, version.IndexOf("x", StringComparison.Ordinal) - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
var splitVersion = version.ToCharArray();
|
|
||||||
version = string.Join(".", splitVersion);
|
|
||||||
|
|
||||||
if (version.Length == 1)
|
|
||||||
{
|
|
||||||
version = version + ".0";
|
|
||||||
}
|
|
||||||
|
|
||||||
var tempRevision = new Version(version);
|
|
||||||
|
|
||||||
return tempRevision.Revision == -1 ? new Version(tempRevision.Major, tempRevision.Minor, 0) : tempRevision;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string ShortenText(string text)
|
|
||||||
{
|
|
||||||
text = Utils.StripHTML(text).Replace(" ", "");
|
|
||||||
if (text.Length > 210)
|
|
||||||
{
|
|
||||||
|
|
||||||
text = text.Substring(0, 210);
|
|
||||||
text = text.Substring(0, text.LastIndexOf(' '));
|
|
||||||
}
|
|
||||||
|
|
||||||
text = Regex.Replace(text, @"[^a-zA-Z0-9\s.?!&;]", ""); //strip all crap from the listing such as ======================================= !!!!
|
|
||||||
return text.Trim();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
|
|
||||||
|
|
||||||
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
|
|
||||||
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
|
|
||||||
|
|
||||||
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
|
|
||||||
<body onload="JavaScript:timedRefresh(5000);">
|
|
||||||
|
|
||||||
<umbraco:Macro runat="server" language="cshtml">
|
|
||||||
@using System.Threading
|
|
||||||
@using System.Diagnostics
|
|
||||||
@using uForum.Businesslogic
|
|
||||||
@{
|
|
||||||
var stopwatch1 = new Stopwatch();
|
|
||||||
stopwatch1.Start();
|
|
||||||
|
|
||||||
var records = 10;
|
|
||||||
if (Request.QueryString["records"] != null)
|
|
||||||
{
|
|
||||||
records = int.Parse(Request.QueryString["records"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var sql = string.Format("SELECT TOP {0} contentNodeId, versionId FROM [our.umbraco.org.live].[dbo].[cmsPropertyData] WHERE contentNodeId IN (SELECT NodeId FROM [our.umbraco.org.live].[dbo].[cmsMember]) AND contentNodeId NOT IN (SELECT contentNodeId FROM [our.umbraco.org.live].[dbo].[cmsPropertyData] WHERE propertytypeid = 203) GROUP BY contentNodeId, versionId", records);
|
|
||||||
var reader = Data.SqlHelper.ExecuteReader(sql);
|
|
||||||
|
|
||||||
while (reader.Read())
|
|
||||||
{
|
|
||||||
var contentNodeId = reader.GetInt("contentNodeId");
|
|
||||||
var versionId = reader.GetGuid("versionId").ToString();
|
|
||||||
|
|
||||||
var stopwatch2 = new Stopwatch();
|
|
||||||
stopwatch2.Start();
|
|
||||||
Data.SqlHelper.ExecuteNonQuery("INSERT INTO [our.umbraco.org.live].[dbo].[cmsPropertyData] (contentNodeId, versionId, propertyTypeId) VALUES (@id, @versionId, 203)", Data.SqlHelper.CreateParameter("@id", contentNodeId), Data.SqlHelper.CreateParameter("@versionId", versionId));
|
|
||||||
stopwatch2.Stop();
|
|
||||||
<span style="font-size: 9px;">@contentNodeId - @stopwatch2.Elapsed.Ticks</span>
|
|
||||||
}
|
|
||||||
reader.Close();
|
|
||||||
reader.Dispose();
|
|
||||||
|
|
||||||
stopwatch1.Stop();
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
<p>Updated @records records in @stopwatch1.Elapsed.Seconds seconds</p>
|
|
||||||
|
|
||||||
}
|
|
||||||
</umbraco:Macro>
|
|
||||||
<script type="text/JavaScript">
|
|
||||||
<!--
|
|
||||||
function timedRefresh(timeoutPeriod) {
|
|
||||||
setTimeout("location.reload(true);",timeoutPeriod);
|
|
||||||
}
|
|
||||||
// -->
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</asp:Content>
|
|
||||||
|
|
||||||
</asp:Content>
|
|
||||||
@@ -29,10 +29,12 @@
|
|||||||
currentMember = member.Id;
|
currentMember = member.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
Application.SqlHelper.ExecuteNonQuery(
|
using (var sqlHelper = Application.SqlHelper)
|
||||||
@"insert into projectDownload(projectId,memberId,timestamp) values(@id, @memberId, getdate())",
|
{
|
||||||
Application.SqlHelper.CreateParameter("@id", docId),
|
sqlHelper.ExecuteNonQuery(@"insert into projectDownload(projectId,memberId,timestamp) values(@id, @memberId, getdate())",
|
||||||
Application.SqlHelper.CreateParameter("@memberId", currentMember));
|
sqlHelper.CreateParameter("@id", docId),
|
||||||
|
sqlHelper.CreateParameter("@memberId", currentMember));
|
||||||
|
}
|
||||||
|
|
||||||
Response.Redirect(link, false);
|
Response.Redirect(link, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,32 +149,32 @@ The five people with most votes from 15 March until 15 April 2011 will become 20
|
|||||||
<p><strong>You need to <a href="http://our.umbraco.org/member/login?redirectUrl=http://our.umbraco.org/UmbracoMVP2011">log in</a> before casting your vote.</strong></p>
|
<p><strong>You need to <a href="http://our.umbraco.org/member/login?redirectUrl=http://our.umbraco.org/UmbracoMVP2011">log in</a> before casting your vote.</strong></p>
|
||||||
|
|
||||||
<%}else{
|
<%}else{
|
||||||
|
|
||||||
|
|
||||||
// Umbraco.Forms.Data.Storage.RecordStorage s = new Umbraco.Forms.Data.Storage.RecordStorage();
|
|
||||||
//var all = s.GetAllRecords(new Guid("12c58e28-ca9e-4e05-9849-8ae8ed555109"));
|
|
||||||
|
|
||||||
//var voted = all.Find(r => r.MemberKey.ToString() == umbraco.cms.businesslogic.member.Member.GetCurrentMember().Id.ToString());
|
// Umbraco.Forms.Data.Storage.RecordStorage s = new Umbraco.Forms.Data.Storage.RecordStorage();
|
||||||
|
//var all = s.GetAllRecords(new Guid("12c58e28-ca9e-4e05-9849-8ae8ed555109"));
|
||||||
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.AppSettings["umbracoDbDSN"]);
|
|
||||||
System.Data.SqlClient.SqlCommand comm = new System.Data.SqlClient.SqlCommand(
|
//var voted = all.Find(r => r.MemberKey.ToString() == umbraco.cms.businesslogic.member.Member.GetCurrentMember().Id.ToString());
|
||||||
"SELECT 1 FROM UFRecords where form = '12C58E28-CA9E-4E05-9849-8AE8ED555109' and memberkey = @memberkey",
|
|
||||||
conn);
|
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.AppSettings["umbracoDbDSN"]);
|
||||||
|
System.Data.SqlClient.SqlCommand comm = new System.Data.SqlClient.SqlCommand(
|
||||||
|
"SELECT 1 FROM UFRecords where form = '12C58E28-CA9E-4E05-9849-8AE8ED555109' and memberkey = @memberkey",
|
||||||
|
conn);
|
||||||
comm.Parameters.AddWithValue("@memberkey",umbraco.cms.businesslogic.member.Member.GetCurrentMember().Id);
|
comm.Parameters.AddWithValue("@memberkey",umbraco.cms.businesslogic.member.Member.GetCurrentMember().Id);
|
||||||
|
|
||||||
conn.Open();
|
conn.Open();
|
||||||
bool membervoted = false;
|
bool membervoted = false;
|
||||||
System.Data.SqlClient.SqlDataReader rdr = comm.ExecuteReader();
|
using (var reader = comm.ExecuteReader())
|
||||||
|
|
||||||
while (rdr.Read())
|
|
||||||
{
|
{
|
||||||
membervoted = true;
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
membervoted = true;
|
||||||
|
}
|
||||||
|
conn.Close();
|
||||||
}
|
}
|
||||||
conn.Close();
|
|
||||||
|
if (membervoted == false)
|
||||||
|
{
|
||||||
if (membervoted == false)
|
|
||||||
{
|
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="AspNetMvc" version="3.0.20105.1" targetFramework="net4" />
|
<package id="AspNetMvc" version="3.0.20105.1" targetFramework="net4" />
|
||||||
<package id="AutoMapper" version="3.3.1" targetFramework="net452" />
|
<package id="AutoMapper" version="3.3.1" targetFramework="net452" />
|
||||||
<package id="ClientDependency" version="1.9.1" targetFramework="net452" />
|
<package id="ClientDependency" version="1.9.2" targetFramework="net452" />
|
||||||
<package id="ClientDependency-Mvc" version="1.8.0.0" targetFramework="net451" />
|
<package id="ClientDependency-Mvc" version="1.8.0.0" targetFramework="net451" />
|
||||||
<package id="ClientDependency-Mvc5" version="1.8.0.0" targetFramework="net452" />
|
<package id="ClientDependency-Mvc5" version="1.8.0.0" targetFramework="net452" />
|
||||||
<package id="EasyHttp" version="1.6.29.0" targetFramework="net451" />
|
<package id="EasyHttp" version="1.6.29.0" targetFramework="net451" />
|
||||||
<package id="Examine" version="0.1.70.0" targetFramework="net452" />
|
<package id="Examine" version="0.1.70.0" targetFramework="net452" />
|
||||||
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net452" />
|
<package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net452" />
|
||||||
<package id="ImageProcessor" version="2.4.5.0" targetFramework="net452" />
|
<package id="ImageProcessor" version="2.4.5.0" targetFramework="net452" />
|
||||||
<package id="ImageProcessor.Web" version="4.6.6.0" targetFramework="net452" />
|
<package id="ImageProcessor.Web" version="4.6.6.0" targetFramework="net452" />
|
||||||
<package id="jQuery" version="1.4.1" targetFramework="net451" />
|
<package id="jQuery" version="1.4.1" targetFramework="net451" />
|
||||||
@@ -50,9 +50,9 @@
|
|||||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net452" />
|
<package id="SharpZipLib" version="0.86.0" targetFramework="net452" />
|
||||||
<package id="System.Collections.Immutable" version="1.1.36" targetFramework="net452" />
|
<package id="System.Collections.Immutable" version="1.1.36" targetFramework="net452" />
|
||||||
<package id="System.Reflection.Metadata" version="1.0.21" targetFramework="net452" />
|
<package id="System.Reflection.Metadata" version="1.0.21" targetFramework="net452" />
|
||||||
<package id="Umbraco.ModelsBuilder" version="3.0.4" targetFramework="net452" />
|
<package id="Umbraco.ModelsBuilder" version="3.0.5" targetFramework="net452" />
|
||||||
<package id="UmbracoCms" version="7.5.4" targetFramework="net452" />
|
<package id="UmbracoCms" version="7.5.5" targetFramework="net452" />
|
||||||
<package id="UmbracoCms.Core" version="7.5.4" targetFramework="net452" />
|
<package id="UmbracoCms.Core" version="7.5.5" targetFramework="net452" />
|
||||||
<package id="UmbracoCms.IdentityExtensions" version="1.0.0" targetFramework="net451" />
|
<package id="UmbracoCms.IdentityExtensions" version="1.0.0" targetFramework="net451" />
|
||||||
<package id="UmbracoCms.IdentityExtensions.Google" version="1.0.0" targetFramework="net451" />
|
<package id="UmbracoCms.IdentityExtensions.Google" version="1.0.0" targetFramework="net451" />
|
||||||
<package id="UrlRewritingNet" version="2.0.7" targetFramework="net452" />
|
<package id="UrlRewritingNet" version="2.0.7" targetFramework="net452" />
|
||||||
|
|||||||
@@ -116,8 +116,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="umb-panel-body with-footer">
|
<div class="umb-panel-body with-footer">
|
||||||
|
|
||||||
<umb-file-dropzone
|
<umb-file-dropzone
|
||||||
|
ng-if="acceptedMediatypes.length > 0"
|
||||||
|
accepted-mediatypes="acceptedMediatypes"
|
||||||
hide-dropzone="{{!activeDrag && images.length > 0}}"
|
hide-dropzone="{{!activeDrag && images.length > 0}}"
|
||||||
parent-id="{{currentFolder.id}}"
|
parent-id="{{currentFolder.id}}"
|
||||||
files-uploaded="onUploadComplete"
|
files-uploaded="onUploadComplete"
|
||||||
|
|||||||
@@ -18,18 +18,9 @@
|
|||||||
</umb-control-group>
|
</umb-control-group>
|
||||||
|
|
||||||
<umb-control-group label="@content_target">
|
<umb-control-group label="@content_target">
|
||||||
<select class="umb-editor umb-dropdown" ng-model="model.target.target">
|
<label class="checkbox no-indent">
|
||||||
<option value=""></option>
|
<input type="checkbox" ng-model="model.target.target" ng-true-value="_blank" ng-false-value="" /> <localize key="defaultdialogs_openInNewWindow">Opens the linked document in a new window or tab</localize>
|
||||||
<option value="_blank">
|
</label>
|
||||||
<localize key="defaultdialogs_openInNewWindow">Opens the linked document in a new window or tab</localize>
|
|
||||||
</option>
|
|
||||||
<option value="_top">
|
|
||||||
<localize key="defaultdialogs_openInFullBody">Opens the linked document in the full body of the window</localize>
|
|
||||||
</option>
|
|
||||||
<option value="_parent">
|
|
||||||
<localize key="defaultdialogs_openInParentFrame">Opens the linked document in the parent frame</localize>
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</umb-control-group>
|
</umb-control-group>
|
||||||
|
|
||||||
<div class="umb-control-group">
|
<div class="umb-control-group">
|
||||||
|
|||||||
@@ -63,6 +63,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<umb-file-dropzone
|
<umb-file-dropzone
|
||||||
|
ng-if="acceptedMediatypes.length > 0"
|
||||||
|
accepted-mediatypes="acceptedMediatypes"
|
||||||
parent-id="{{currentFolder.id}}"
|
parent-id="{{currentFolder.id}}"
|
||||||
files-uploaded="onUploadComplete"
|
files-uploaded="onUploadComplete"
|
||||||
files-queued="onFilesQueue"
|
files-queued="onFilesQueue"
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<div ng-controller="Umbraco.Overlays.MediaTypePickerController">
|
||||||
|
|
||||||
|
<ul class="umb-card-grid">
|
||||||
|
<li
|
||||||
|
ng-repeat="mediatype in model.acceptedMediatypes | orderBy:'name'"
|
||||||
|
ng-click="select(mediatype)"
|
||||||
|
class="-three-in-row">
|
||||||
|
<a class="umb-card-grid-item" href="" title="{{mediatype.name}}">
|
||||||
|
<i class="{{ mediatype.icon }}"></i>
|
||||||
|
{{ mediatype.name }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -98,4 +98,11 @@
|
|||||||
|
|
||||||
</ng-form>
|
</ng-form>
|
||||||
|
|
||||||
|
<umb-overlay
|
||||||
|
ng-if="mediatypepickerOverlay.show"
|
||||||
|
model="mediatypepickerOverlay"
|
||||||
|
view="mediatypepickerOverlay.view"
|
||||||
|
position="right">
|
||||||
|
</umb-overlay>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -51,13 +51,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<umb-pane>
|
<umb-pane>
|
||||||
<umb-control-group label="Relate to original">
|
<umb-control-group localize="label" label="@defaultdialogs_relateToOriginalLabel">
|
||||||
<input type="checkbox" ng-model="$parent.$parent.relateToOriginal" />
|
<input type="checkbox" ng-model="$parent.$parent.relateToOriginal"/>
|
||||||
</umb-control-group>
|
</umb-control-group>
|
||||||
|
|
||||||
</umb-pane>
|
</umb-pane>
|
||||||
|
|
||||||
<umb-pane>
|
<umb-pane>
|
||||||
<umb-control-group label="Include descendants">
|
<umb-control-group localize="label" label="@defaultdialogs_includeDescendants">
|
||||||
<input type="checkbox" ng-model="$parent.$parent.recursive" />
|
<input type="checkbox" ng-model="$parent.$parent.recursive" />
|
||||||
</umb-control-group>
|
</umb-control-group>
|
||||||
</umb-pane>
|
</umb-pane>
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
<div class="umb-pane">
|
<div class="umb-pane">
|
||||||
|
|
||||||
<p class="abstract" ng-hide="success">
|
<p class="abstract" ng-hide="success">
|
||||||
Choose where to move <strong>{{currentNode.name}}</strong> to in the tree structure below
|
<localize key="actions_chooseWhereToMove">Choose where to move</localize>
|
||||||
|
<strong>{{currentNode.name}}</strong>
|
||||||
|
<localize key="actions_toInTheTreeStructureBelow">to in the tree structure below</localize>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="umb-loader-wrapper" ng-show="busy">
|
<div class="umb-loader-wrapper" ng-show="busy">
|
||||||
<div class="umb-loader"></div>
|
<div class="umb-loader"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,44 +1,44 @@
|
|||||||
<div class="umb-dashboard-grid" ng-controller="Umbraco.Dashboard.StartUpDynamicContentController as vm">
|
<div class="umb-dashboard-grid" ng-controller="Umbraco.Dashboard.StartUpDynamicContentController as vm">
|
||||||
|
|
||||||
<umb-load-indicator ng-if="vm.loading"></umb-load-indicator>
|
<umb-load-indicator ng-if="vm.loading"></umb-load-indicator>
|
||||||
|
|
||||||
<div class="row clearfix" ng-if="vm.dashboard">
|
<div class="row clearfix" ng-if="vm.dashboard">
|
||||||
<!-- Sections -->
|
<!-- Sections -->
|
||||||
<div class="grid-section" ng-repeat="section in vm.dashboard.sections">
|
<div class="grid-section" ng-repeat="section in vm.dashboard.sections">
|
||||||
<div class="{{'span' + section.grid + ' column dash-section'}}">
|
<div class="{{'span' + section.grid + ' column dash-section'}}">
|
||||||
|
|
||||||
<!-- rows -->
|
<!-- rows -->
|
||||||
<div class="row clearfix dash-row" ng-repeat="row in section.rows">
|
<div class="row clearfix dash-row" ng-repeat="row in section.rows">
|
||||||
<div class="dash-inner-row">
|
<div class="dash-inner-row">
|
||||||
|
|
||||||
<!-- areas -->
|
<!-- areas -->
|
||||||
<div ng-repeat="area in row.areas"
|
<div ng-repeat="area in row.areas"
|
||||||
class="{{'span' + area.grid + ' column dash-area'}}">
|
class="{{'span' + area.grid + ' column dash-area'}}">
|
||||||
<div class="dash-inner-area">
|
<div class="dash-inner-area">
|
||||||
|
|
||||||
<!-- Controls -->
|
<!-- Controls -->
|
||||||
<div ng-repeat="control in area.controls" class="dash-control dash-control-{{control.alias}}">
|
<div ng-repeat="control in area.controls" class="dash-control dash-control-{{control.alias}}">
|
||||||
<div class="dash-inner-control">
|
<div class="dash-inner-control">
|
||||||
<div ng-bind-html-unsafe="control.html"></div>
|
<div ng-bind-html-unsafe="control.html"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Controls end -->
|
<!-- Controls end -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Area end -->
|
<!-- Area end -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Section end -->
|
<!-- Section end -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- grid container end -->
|
<!-- grid container end -->
|
||||||
|
|
||||||
|
|
||||||
<!-- Default content in case we cannot fetch content from the outside -->
|
<!-- Default content in case we cannot fetch content from the outside -->
|
||||||
<div style="max-width: 1200px" ng-if="vm.showDefault">
|
<div style="max-width: 1200px" ng-if="vm.showDefault">
|
||||||
<h3><strong>Welcome to The Friendly CMS</strong></h3>
|
<h3><strong>Welcome to The Friendly CMS</strong></h3>
|
||||||
<p style="font-size: 16px; line-height: 1.5; margin-bottom: 30px; max-width: 760px;">
|
<p style="font-size: 16px; line-height: 1.5; margin-bottom: 30px; max-width: 760px;">
|
||||||
<span>Thank you for choosing Umbraco - we think this could be the beginning of something beautiful. While it may feel overwhelming at first, we've done a lot to make the learning curve as smooth and fast as possible.</span>
|
<span>Thank you for choosing Umbraco - we think this could be the beginning of something beautiful. While it may feel overwhelming at first, we've done a lot to make the learning curve as smooth and fast as possible.</span>
|
||||||
</p>
|
</p>
|
||||||
@@ -50,46 +50,46 @@
|
|||||||
<li>Watch <a href="https://umbraco.tv" class="btn-link-underline">our tutorial videos</a> (some are free, some require a subscription)</li>
|
<li>Watch <a href="https://umbraco.tv" class="btn-link-underline">our tutorial videos</a> (some are free, some require a subscription)</li>
|
||||||
<li>Find out about <a href="https://umbraco.com/products-and-support" target="_blank" class="btn-link-underline">our productivity boosting tools and commercial support</a></li>
|
<li>Find out about <a href="https://umbraco.com/products-and-support" target="_blank" class="btn-link-underline">our productivity boosting tools and commercial support</a></li>
|
||||||
<li>Find out about <a href="https://umbraco.com/products/training" target="_blank" class="btn-link-underline">real-life training and certification opportunities</a></li>
|
<li>Find out about <a href="https://umbraco.com/products/training" target="_blank" class="btn-link-underline">real-life training and certification opportunities</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<a href="http://umbraco.tv/?utm_source=core&utm_medium=dashboard&utm_content=image&utm_campaign=tv" target="_blank" class="nounderline">
|
<a href="https://umbraco.tv/?utm_source=core&utm_medium=dashboard&utm_content=image&utm_campaign=tv" target="_blank" class="nounderline">
|
||||||
<img src="views/dashboard/default/umbracotv.png" alt="Umbraco.TV - Hours of Umbraco Video Tutorials" style="margin: 10px 0 10px 0" />
|
<img src="views/dashboard/default/umbracotv.png" alt="Umbraco.TV - Hours of Umbraco Video Tutorials" style="margin: 10px 0 10px 0" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<a href="http://umbraco.tv/?utm_source=core&utm_medium=dashboard&utm_content=header&utm_campaign=tv" target="_blank" class="btn-link -underline">
|
<a href="https://umbraco.tv/?utm_source=core&utm_medium=dashboard&utm_content=header&utm_campaign=tv" target="_blank" class="btn-link -underline">
|
||||||
<h4> <strong>Umbraco.TV - Learn from the source!</strong> </h4>
|
<h4> <strong>Umbraco.TV - Learn from the source!</strong> </h4>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<p style="line-height: 1.5;">
|
<p style="line-height: 1.5;">
|
||||||
Umbraco.TV will help you go from zero to Umbraco
|
Umbraco.TV will help you go from zero to Umbraco
|
||||||
hero at a pace that suits you. Our easy to follow
|
hero at a pace that suits you. Our easy to follow
|
||||||
online training videos will give you the fundamental
|
online training videos will give you the fundamental
|
||||||
knowledge to start building awesome Umbraco websites.
|
knowledge to start building awesome Umbraco websites.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="span4 offset1">
|
<div class="span4 offset1">
|
||||||
|
|
||||||
<a href="http://our.umbraco.org/?utm_source=core&utm_medium=dashboard&utm_content=image&utm_campaign=our" target="_blank" class="nounderline">
|
<a href="https://our.umbraco.org/?utm_source=core&utm_medium=dashboard&utm_content=image&utm_campaign=our" target="_blank" class="nounderline">
|
||||||
<img src="views/dashboard/default/ourumbraco.png" alt="Our Umbraco" style="margin: 10px 0 10px 0" />
|
<img src="views/dashboard/default/ourumbraco.png" alt="Our Umbraco" style="margin: 10px 0 10px 0" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="http://our.umbraco.org/?utm_source=core&utm_medium=dashboard&utm_content=header&utm_campaign=our" target="_blank" class="btn-link -underline">
|
<a href="https://our.umbraco.org/?utm_source=core&utm_medium=dashboard&utm_content=header&utm_campaign=our" target="_blank" class="btn-link -underline">
|
||||||
<h4><strong>Our Umbraco - The Friendliest Community</strong></h4>
|
<h4><strong>Our Umbraco - The Friendliest Community</strong></h4>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<p style="line-height: 1.5;">
|
<p style="line-height: 1.5;">
|
||||||
Our Umbraco - the official community site is your one
|
Our Umbraco - the official community site is your one
|
||||||
stop for everything Umbraco. Whether you need a
|
stop for everything Umbraco. Whether you need a
|
||||||
question answered or looking for cool plugins, the
|
question answered or looking for cool plugins, the
|
||||||
worlds best community is just a click away.
|
worlds best community is just a click away.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -3,8 +3,10 @@
|
|||||||
<div class="umb-pane">
|
<div class="umb-pane">
|
||||||
|
|
||||||
<p class="abstract" ng-hide="success">
|
<p class="abstract" ng-hide="success">
|
||||||
Choose where to move <strong>{{currentNode.name}}</strong> to in the tree structure below
|
<localize key="actions_chooseWhereToMove">Choose where to move</localize>
|
||||||
</p>
|
<strong>{{currentNode.name}}</strong>
|
||||||
|
<localize key="actions_toInTheTreeStructureBelow">to in the tree structure below</localize>
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="alert alert-error" ng-show="error" ng-cloak>
|
<div class="alert alert-error" ng-show="error" ng-cloak>
|
||||||
<h4>{{error.errorMsg}}</h4>
|
<h4>{{error.errorMsg}}</h4>
|
||||||
|
|||||||
@@ -37,10 +37,8 @@
|
|||||||
- <localize key="media_orClickHereToUpload">or click here to choose files</localize>
|
- <localize key="media_orClickHereToUpload">or click here to choose files</localize>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="umb-info-local-item text-error" ng-if="vm.zipFile.uploadStatus === 'error'">
|
|
||||||
{{vm.zipFile.serverErrorMessage}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -53,6 +51,41 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div ng-if="vm.state === 'uploading'">
|
||||||
|
|
||||||
|
<umb-editor-sub-header>
|
||||||
|
<umb-editor-sub-header-content-left>
|
||||||
|
<a class="umb-package-details__back-link" href="" ng-click="vm.state = 'upload'">← Upload another package</a>
|
||||||
|
</umb-editor-sub-header-content-left>
|
||||||
|
</umb-editor-sub-header>
|
||||||
|
|
||||||
|
<div class="umb-packages-view-wrapper">
|
||||||
|
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<div class="umb-info-local-items">
|
||||||
|
<div class="umb-package-icon">
|
||||||
|
<i ng-if="!vm.localPackage.iconUrl" class="icon-box"></i>
|
||||||
|
</div>
|
||||||
|
<div class="umb-package-info">
|
||||||
|
|
||||||
|
<h4 class="umb-info-local-item"><strong>Uploading package</strong></h4>
|
||||||
|
|
||||||
|
<umb-progress-bar
|
||||||
|
percentage="{{vm.zipFile.uploadProgress}}">
|
||||||
|
</umb-progress-bar>
|
||||||
|
|
||||||
|
<div class="umb-info-local-item text-error mt3" ng-if="vm.zipFile.uploadStatus === 'error'">
|
||||||
|
{{ vm.zipFile.serverErrorMessage }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div ng-if="vm.state === 'packageDetails'">
|
<div ng-if="vm.state === 'packageDetails'">
|
||||||
|
|
||||||
<umb-editor-sub-header>
|
<umb-editor-sub-header>
|
||||||
@@ -126,6 +159,19 @@
|
|||||||
<p>{{vm.installState.status}}</p>
|
<p>{{vm.installState.status}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="umb-info-local-item text-info"
|
||||||
|
ng-show="vm.installCompleted">
|
||||||
|
|
||||||
|
<button type="button"
|
||||||
|
|
||||||
|
class="btn btn-success flex-inline mt3"
|
||||||
|
ng-click="vm.reloadPage()">
|
||||||
|
Finish
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -340,6 +340,16 @@
|
|||||||
<p>{{vm.installState.status}}</p>
|
<p>{{vm.installState.status}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="umb-info-local-item text-info"
|
||||||
|
ng-show="vm.installCompleted">
|
||||||
|
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-success flex-inline mt3"
|
||||||
|
ng-click="vm.reloadPage()">
|
||||||
|
Finish
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,8 @@
|
|||||||
on-drag-enter="vm.dragEnter()">
|
on-drag-enter="vm.dragEnter()">
|
||||||
|
|
||||||
<umb-file-dropzone
|
<umb-file-dropzone
|
||||||
ng-if="!vm.isRecycleBin"
|
ng-if="!vm.isRecycleBin && vm.acceptedMediatypes.length > 0"
|
||||||
|
accepted-mediatypes="vm.acceptedMediatypes"
|
||||||
parent-id="{{vm.nodeId}}"
|
parent-id="{{vm.nodeId}}"
|
||||||
files-uploaded="vm.onUploadComplete"
|
files-uploaded="vm.onUploadComplete"
|
||||||
accept="{{vm.acceptedFileTypes}}"
|
accept="{{vm.acceptedFileTypes}}"
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
on-drag-enter="vm.dragEnter()">
|
on-drag-enter="vm.dragEnter()">
|
||||||
|
|
||||||
<umb-file-dropzone
|
<umb-file-dropzone
|
||||||
ng-if="!vm.isRecycleBin"
|
ng-if="!vm.isRecycleBin && vm.acceptedMediatypes.length > 0"
|
||||||
|
accepted-mediatypes="vm.acceptedMediatypes"
|
||||||
parent-id="{{vm.nodeId}}"
|
parent-id="{{vm.nodeId}}"
|
||||||
files-uploaded="vm.onUploadComplete"
|
files-uploaded="vm.onUploadComplete"
|
||||||
accept="{{vm.acceptedFileTypes}}"
|
accept="{{vm.acceptedFileTypes}}"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<img ng-if="image.extension === 'svg'" ng-src="{{image.file}}" alt="" />
|
<img ng-if="image.extension === 'svg'" ng-src="{{image.file}}" alt="" />
|
||||||
|
|
||||||
<!-- FILE -->
|
<!-- FILE -->
|
||||||
<span class="icon-holder" ng-hide="image.thumbnail || image.metaData.umbracoExtension.Value === 'svg' || image.extension === 'svg'">
|
<span class="umb-icon-holder" ng-hide="image.thumbnail || image.metaData.umbracoExtension.Value === 'svg' || image.extension === 'svg'">
|
||||||
<i class="icon {{image.icon}} large"></i>
|
<i class="icon {{image.icon}} large"></i>
|
||||||
<small>{{image.name}}</small>
|
<small>{{image.name}}</small>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -30,6 +30,9 @@
|
|||||||
<key alias="refreshNode">Genindlæs elementer</key>
|
<key alias="refreshNode">Genindlæs elementer</key>
|
||||||
<key alias="republish">Genudgiv hele sitet</key>
|
<key alias="republish">Genudgiv hele sitet</key>
|
||||||
<key alias="restore" version="7.3.0">Gendan</key>
|
<key alias="restore" version="7.3.0">Gendan</key>
|
||||||
|
<key alias="SetPermissionsForThePage">Sæt rettigheder for siden %0%</key>
|
||||||
|
<key alias="chooseWhereToMove">Hvor vil du flytte</key>
|
||||||
|
<key alias="toInTheTreeStructureBelow">hen til i træstrukturen?</key>
|
||||||
<key alias="rights">Rettigheder</key>
|
<key alias="rights">Rettigheder</key>
|
||||||
<key alias="rollback">Fortryd ændringer</key>
|
<key alias="rollback">Fortryd ændringer</key>
|
||||||
<key alias="sendtopublish">Send til udgivelse</key>
|
<key alias="sendtopublish">Send til udgivelse</key>
|
||||||
@@ -202,12 +205,12 @@
|
|||||||
</area>
|
</area>
|
||||||
<area alias="bulk">
|
<area alias="bulk">
|
||||||
<key alias="done">Færdig</key>
|
<key alias="done">Færdig</key>
|
||||||
|
|
||||||
<key alias="deletedItem">Slettede %0% element</key>
|
<key alias="deletedItem">Slettede %0% element</key>
|
||||||
<key alias="deletedItems">Slettede %0% elementer</key>
|
<key alias="deletedItems">Slettede %0% elementer</key>
|
||||||
<key alias="deletedItemOfItem">Slettede %0% ud af %1% element</key>
|
<key alias="deletedItemOfItem">Slettede %0% ud af %1% element</key>
|
||||||
<key alias="deletedItemOfItems">Slettede %0% ud af %1% elementer</key>
|
<key alias="deletedItemOfItems">Slettede %0% ud af %1% elementer</key>
|
||||||
|
|
||||||
<key alias="publishedItem">Udgav %0% element</key>
|
<key alias="publishedItem">Udgav %0% element</key>
|
||||||
<key alias="publishedItems">Udgav %0% elementer</key>
|
<key alias="publishedItems">Udgav %0% elementer</key>
|
||||||
<key alias="publishedItemOfItem">Udgav %0% ud af %1% element</key>
|
<key alias="publishedItemOfItem">Udgav %0% ud af %1% element</key>
|
||||||
@@ -274,17 +277,11 @@
|
|||||||
<key alias="treepicker">Vælg</key>
|
<key alias="treepicker">Vælg</key>
|
||||||
<key alias="viewCacheItem">Se cache element</key>
|
<key alias="viewCacheItem">Se cache element</key>
|
||||||
<key alias="createFolder">Opret mappe...</key>
|
<key alias="createFolder">Opret mappe...</key>
|
||||||
|
|
||||||
<key alias="relateToOriginalLabel">Relatér til original</key>
|
<key alias="relateToOriginalLabel">Relatér til original</key>
|
||||||
|
<key alias="includeDescendants">Inkludér undersider</key>
|
||||||
<key alias="linkToPage">Link til side</key>
|
<key alias="linkToPage">Link til side</key>
|
||||||
|
<key alias="openInNewWindow">Åben linket i et nyt vindue eller fane</key>
|
||||||
<key alias="openInNewWindow">Åbner det linket dokument i et nyt vindue eller fane</key>
|
|
||||||
<key alias="openInFullBody">Åbner det linket dokument i fuld visning af vinduet</key>
|
|
||||||
<key alias="openInParentFrame">Åbner det linket dokument i "parent frame"</key>
|
|
||||||
|
|
||||||
<key alias="linkToMedia">Link til medie</key>
|
<key alias="linkToMedia">Link til medie</key>
|
||||||
|
|
||||||
<key alias="selectMedia">Vælg medie</key>
|
<key alias="selectMedia">Vælg medie</key>
|
||||||
<key alias="selectIcon">Vælg ikon</key>
|
<key alias="selectIcon">Vælg ikon</key>
|
||||||
<key alias="selectItem">Vælg item</key>
|
<key alias="selectItem">Vælg item</key>
|
||||||
@@ -293,19 +290,25 @@
|
|||||||
<key alias="selectContent">Vælg indhold</key>
|
<key alias="selectContent">Vælg indhold</key>
|
||||||
<key alias="selectMember">Vælg medlem</key>
|
<key alias="selectMember">Vælg medlem</key>
|
||||||
<key alias="selectMemberGroup">Vælg medlemsgruppe</key>
|
<key alias="selectMemberGroup">Vælg medlemsgruppe</key>
|
||||||
|
|
||||||
<key alias="noMacroParams">Der er ingen parametre for denne makro</key>
|
<key alias="noMacroParams">Der er ingen parametre for denne makro</key>
|
||||||
|
|
||||||
<key alias="linkYour">Link dit</key>
|
<key alias="linkYour">Link dit</key>
|
||||||
<key alias="unLinkYour">Fjern link fra dit</key>
|
<key alias="unLinkYour">Fjern link fra dit</key>
|
||||||
|
|
||||||
<key alias="account">konto</key>
|
<key alias="account">konto</key>
|
||||||
|
|
||||||
<key alias="selectEditor">Vælg editor</key>
|
<key alias="selectEditor">Vælg editor</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="dictionaryItem">
|
<area alias="dictionaryItem">
|
||||||
<key alias="description">Rediger de forskellige sprogversioner for ordbogselementet '%0%' herunder. Du tilføjer flere sprog under 'sprog' i menuen til venstre </key>
|
<key alias="description">
|
||||||
|
<![CDATA[
|
||||||
|
Rediger de forskellige sprogversioner for ordbogselementet '%0%' herunder.<br />Du tilføjer flere sprog under 'sprog' i menuen til venstre </key>
|
||||||
|
]]>
|
||||||
|
</key>
|
||||||
<key alias="displayName">Kulturnavn</key>
|
<key alias="displayName">Kulturnavn</key>
|
||||||
|
<key alias="changeKey">Rediger navnet på ordbogselementet.</key>
|
||||||
|
<key alias="changeKeyError">
|
||||||
|
<![CDATA[
|
||||||
|
Navnet '%0%' eksisterer allerede.
|
||||||
|
]]>
|
||||||
|
</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="placeholders">
|
<area alias="placeholders">
|
||||||
<key alias="username">Indtast dit brugernavn</key>
|
<key alias="username">Indtast dit brugernavn</key>
|
||||||
@@ -319,17 +322,17 @@
|
|||||||
<key alias="enterTags">Indtast nøgleord (tryk på Enter efter hvert nøgleord)...</key>
|
<key alias="enterTags">Indtast nøgleord (tryk på Enter efter hvert nøgleord)...</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="editcontenttype">
|
<area alias="editcontenttype">
|
||||||
<key alias="allowAtRoot" version="7.2">Tillad på rodniveau</key>
|
<key alias="allowAtRoot" version="7.2">Tillad på rodniveau</key>
|
||||||
<key alias="allowAtRootDesc" version="7.2">Kun dokumenttyper med denne indstilling aktiveret oprettes i rodniveau under Inhold og Mediearkiv</key>
|
<key alias="allowAtRootDesc" version="7.2">Kun dokumenttyper med denne indstilling aktiveret oprettes i rodniveau under Inhold og Mediearkiv</key>
|
||||||
<key alias="allowedchildnodetypes">Tilladte typer</key>
|
<key alias="allowedchildnodetypes">Tilladte typer</key>
|
||||||
<key alias="contenttypecompositions">Sammensætning af dokumenttyper</key>
|
<key alias="contenttypecompositions">Sammensætning af dokumenttyper</key>
|
||||||
<key alias="create">Opret</key>
|
<key alias="create">Opret</key>
|
||||||
<key alias="deletetab">Slet fane</key>
|
<key alias="deletetab">Slet fane</key>
|
||||||
<key alias="description">Beskrivelse</key>
|
<key alias="description">Beskrivelse</key>
|
||||||
<key alias="newtab">Ny fane</key>
|
<key alias="newtab">Ny fane</key>
|
||||||
<key alias="tab">Fane</key>
|
<key alias="tab">Fane</key>
|
||||||
<key alias="thumbnail">Thumbnail</key>
|
<key alias="thumbnail">Thumbnail</key>
|
||||||
<key alias="hasListView">Aktiver listevisning</key>
|
<key alias="hasListView">Aktiver listevisning</key>
|
||||||
<key alias="hasListViewDesc" version="7.2">Viser undersider i en søgbar liste, undersider vises ikke i indholdstræet</key>
|
<key alias="hasListViewDesc" version="7.2">Viser undersider i en søgbar liste, undersider vises ikke i indholdstræet</key>
|
||||||
<key alias="currentListView" version="7.2">Nuværende listevisning</key>
|
<key alias="currentListView" version="7.2">Nuværende listevisning</key>
|
||||||
<key alias="currentListViewDesc" version="7.2">Den aktive listevisningsdatatype</key>
|
<key alias="currentListViewDesc" version="7.2">Den aktive listevisningsdatatype</key>
|
||||||
@@ -364,7 +367,7 @@
|
|||||||
</area>
|
</area>
|
||||||
<area alias="errors">
|
<area alias="errors">
|
||||||
<key alias="receivedErrorFromServer">Der skete en fejl på severen</key>
|
<key alias="receivedErrorFromServer">Der skete en fejl på severen</key>
|
||||||
<key alias="dissallowedMediaType">Denne filttype er blevet deaktiveret af administratoren</key>
|
<key alias="dissallowedMediaType">Denne filttype er blevet deaktiveret af administratoren</key>
|
||||||
<key alias="codemirroriewarning">OBS! Selvom CodeMirror er slået til i konfigurationen, så er den deaktiveret i Internet Explorer fordi den ikke er stabil nok.</key>
|
<key alias="codemirroriewarning">OBS! Selvom CodeMirror er slået til i konfigurationen, så er den deaktiveret i Internet Explorer fordi den ikke er stabil nok.</key>
|
||||||
<key alias="contentTypeAliasAndNameNotNull">Du skal udfylde både Alias & Navn på den nye egenskabstype!</key>
|
<key alias="contentTypeAliasAndNameNotNull">Du skal udfylde både Alias & Navn på den nye egenskabstype!</key>
|
||||||
<key alias="filePermissionsError">Der mangler læse/skrive rettigheder til bestemte filer og mapper</key>
|
<key alias="filePermissionsError">Der mangler læse/skrive rettigheder til bestemte filer og mapper</key>
|
||||||
@@ -380,7 +383,7 @@
|
|||||||
<key alias="tableSplitNotSplittable">Du kan ikke opdele en celle, som ikke allerede er delt.</key>
|
<key alias="tableSplitNotSplittable">Du kan ikke opdele en celle, som ikke allerede er delt.</key>
|
||||||
<key alias="xsltErrorHeader">Fejl i XSLT kode</key>
|
<key alias="xsltErrorHeader">Fejl i XSLT kode</key>
|
||||||
<key alias="xsltErrorText">Din XSLT er ikke opdateret, da det indeholdt en fejl</key>
|
<key alias="xsltErrorText">Din XSLT er ikke opdateret, da det indeholdt en fejl</key>
|
||||||
<key alias="missingPropertyEditorErrorMessage">Der er et problem med den datatype, der bruges til denn egenskab. Kontroller konfigurationen og prøv igen.</key>
|
<key alias="missingPropertyEditorErrorMessage">Der er et problem med den datatype, der bruges til denn egenskab. Kontroller konfigurationen og prøv igen.</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="general">
|
<area alias="general">
|
||||||
<key alias="about">Om</key>
|
<key alias="about">Om</key>
|
||||||
@@ -466,7 +469,8 @@
|
|||||||
<key alias="showPageOnSend">Hvilken side skal vises efter at formularen er sendt</key>
|
<key alias="showPageOnSend">Hvilken side skal vises efter at formularen er sendt</key>
|
||||||
<key alias="size">Størrelse</key>
|
<key alias="size">Størrelse</key>
|
||||||
<key alias="sort">Sortér</key>
|
<key alias="sort">Sortér</key>
|
||||||
<key alias="submit">Indsend</key> <!-- TODO: Translate this -->
|
<key alias="submit">Indsend</key>
|
||||||
|
<!-- TODO: Translate this -->
|
||||||
<key alias="type">Type</key>
|
<key alias="type">Type</key>
|
||||||
<key alias="typeToSearch">Skriv for at søge...</key>
|
<key alias="typeToSearch">Skriv for at søge...</key>
|
||||||
<key alias="up">Op</key>
|
<key alias="up">Op</key>
|
||||||
@@ -505,22 +509,22 @@
|
|||||||
</area>
|
</area>
|
||||||
|
|
||||||
<area alias="shortcuts">
|
<area alias="shortcuts">
|
||||||
<key alias="addTab">Tilføj fane</key>
|
<key alias="addTab">Tilføj fane</key>
|
||||||
<key alias="addProperty">Tilføj egenskab</key>
|
<key alias="addProperty">Tilføj egenskab</key>
|
||||||
<key alias="addEditor">Tilføj editor</key>
|
<key alias="addEditor">Tilføj editor</key>
|
||||||
<key alias="addTemplate">Tilføj skabelon</key>
|
<key alias="addTemplate">Tilføj skabelon</key>
|
||||||
<key alias="addChildNode">Tilføj child node</key>
|
<key alias="addChildNode">Tilføj child node</key>
|
||||||
<key alias="addChild">Tilføj child</key>
|
<key alias="addChild">Tilføj child</key>
|
||||||
|
|
||||||
<key alias="editDataType">Rediger datatype</key>
|
<key alias="editDataType">Rediger datatype</key>
|
||||||
|
|
||||||
<key alias="navigateSections">Naviger sektioner</key>
|
<key alias="navigateSections">Naviger sektioner</key>
|
||||||
|
|
||||||
<key alias="shortcut">Genveje</key>
|
<key alias="shortcut">Genveje</key>
|
||||||
<key alias="showShortcuts">Vis genveje</key>
|
<key alias="showShortcuts">Vis genveje</key>
|
||||||
|
|
||||||
<key alias="toggleListView">Brug listevisning</key>
|
<key alias="toggleListView">Brug listevisning</key>
|
||||||
<key alias="toggleAllowAsRoot">Tillad på rodniveau</key>
|
<key alias="toggleAllowAsRoot">Tillad på rodniveau</key>
|
||||||
</area>
|
</area>
|
||||||
|
|
||||||
<area alias="graphicheadline">
|
<area alias="graphicheadline">
|
||||||
@@ -538,13 +542,17 @@
|
|||||||
<key alias="databaseErrorWebConfig">Kunne ikke gemme web.config filen. Du bedes venligst manuelt ændre database forbindelses strengen.</key>
|
<key alias="databaseErrorWebConfig">Kunne ikke gemme web.config filen. Du bedes venligst manuelt ændre database forbindelses strengen.</key>
|
||||||
<key alias="databaseFound">Din database er blevet fundet og identificeret som</key>
|
<key alias="databaseFound">Din database er blevet fundet og identificeret som</key>
|
||||||
<key alias="databaseHeader">Database konfiguration</key>
|
<key alias="databaseHeader">Database konfiguration</key>
|
||||||
<key alias="databaseInstall"><![CDATA[
|
<key alias="databaseInstall">
|
||||||
|
<![CDATA[
|
||||||
Klik på <strong>installér</strong> knappen for at installere Umbraco %0% databasen
|
Klik på <strong>installér</strong> knappen for at installere Umbraco %0% databasen
|
||||||
]]></key>
|
]]>
|
||||||
|
</key>
|
||||||
<key alias="databaseInstall"><![CDATA[Tryk på <strong>installér</strong> knappen for at installere Umbraco %0% databasen]]></key>
|
<key alias="databaseInstall"><![CDATA[Tryk på <strong>installér</strong> knappen for at installere Umbraco %0% databasen]]></key>
|
||||||
<key alias="databaseInstallDone"><![CDATA[Umbraco %0% er nu blevet kopieret til din database. Tryk på <string>Næste</strong> for at fortsætte.]]></key>
|
<key alias="databaseInstallDone"><![CDATA[Umbraco %0% er nu blevet kopieret til din database. Tryk på <string>Næste</strong> for at fortsætte.]]></key>
|
||||||
<key alias="databaseNotFound"><![CDATA[<p>Databasen er ikke fundet. Kontrollér venligst at informationen i database forbindelsesstrengen i "web.config" filen er korrekt.</p>
|
<key alias="databaseNotFound">
|
||||||
<p>For at fortsætte bedes du venligst rette "web.config" filen (ved at bruge Visual Studio eller dit favoritprogram), scroll til bunden, tilføj forbindelsesstrengen til din database i feltet som hedder "umbracoDbDSN" og gem filen.</p><p>Klik på <strong>Forsøg igen</strong> knappen når du er færdig.<br/><a href="http://our.umbraco.org/documentation/Using-Umbraco/Config-files/webconfig7" target="_blank">Mere information om at redigere web.config her.</a></p>]]></key>
|
<![CDATA[<p>Databasen er ikke fundet. Kontrollér venligst at informationen i database forbindelsesstrengen i "web.config" filen er korrekt.</p>
|
||||||
|
<p>For at fortsætte bedes du venligst rette "web.config" filen (ved at bruge Visual Studio eller dit favoritprogram), scroll til bunden, tilføj forbindelsesstrengen til din database i feltet som hedder "umbracoDbDSN" og gem filen.</p><p>Klik på <strong>Forsøg igen</strong> knappen når du er færdig.<br/><a href="http://our.umbraco.org/documentation/Using-Umbraco/Config-files/webconfig7" target="_blank">Mere information om at redigere web.config her.</a></p>]]>
|
||||||
|
</key>
|
||||||
<key alias="databaseText"><![CDATA[For at afslutte dette skridt er du nødt til at have nogle informationer om din database parat ("database forbindelsesstrengen").<br/>Kontakt venligst din ISP hvis det er nødvendigt. Hvis du installerer på en lokal maskine eller server kan du muligvis få informationerne fra din systemadministrator.]]></key>
|
<key alias="databaseText"><![CDATA[For at afslutte dette skridt er du nødt til at have nogle informationer om din database parat ("database forbindelsesstrengen").<br/>Kontakt venligst din ISP hvis det er nødvendigt. Hvis du installerer på en lokal maskine eller server kan du muligvis få informationerne fra din systemadministrator.]]></key>
|
||||||
<key alias="databaseUpgrade"><![CDATA[<p>Tryk på <strong>Opgradér</strong> knappen for at opgradere din database til Umbraco %0%</p><p>Bare rolig - intet indhold vil blive slettet og alt vil stadig fungere bagefter!</p>]]></key>
|
<key alias="databaseUpgrade"><![CDATA[<p>Tryk på <strong>Opgradér</strong> knappen for at opgradere din database til Umbraco %0%</p><p>Bare rolig - intet indhold vil blive slettet og alt vil stadig fungere bagefter!</p>]]></key>
|
||||||
<key alias="databaseUpgradeDone"><![CDATA[Din database er blevet opgraderet til den endelige version %0%.<br/>Tryk på <strong>Næste</strong> for at fortsætte.]]></key>
|
<key alias="databaseUpgradeDone"><![CDATA[Din database er blevet opgraderet til den endelige version %0%.<br/>Tryk på <strong>Næste</strong> for at fortsætte.]]></key>
|
||||||
@@ -590,8 +598,10 @@
|
|||||||
<key alias="theEndFurtherHelp"><![CDATA[<h3>Yderligere hjælpe og informationer</h3> Få hjælp fra vores prisvindende fællesskab, gennemse dokumentationen eller se nogle gratis videoer om hvordan du opsætter et simpelt site, hvordan du bruger pakker og en 'quick guide' til Umbraco terminologier]]></key>
|
<key alias="theEndFurtherHelp"><![CDATA[<h3>Yderligere hjælpe og informationer</h3> Få hjælp fra vores prisvindende fællesskab, gennemse dokumentationen eller se nogle gratis videoer om hvordan du opsætter et simpelt site, hvordan du bruger pakker og en 'quick guide' til Umbraco terminologier]]></key>
|
||||||
<key alias="theEndHeader">Umbraco %0% er installeret og klar til brug</key>
|
<key alias="theEndHeader">Umbraco %0% er installeret og klar til brug</key>
|
||||||
<key alias="theEndInstallFailed"><![CDATA[For at afslutte installationen er du nødt til manuelt at rette <strong>/web.config filen</strong> og opdatére 'AppSetting' feltet <strong>UmbracoConfigurationStatus</strong> i bunden til <strong>'%0%'</strong>.]]></key>
|
<key alias="theEndInstallFailed"><![CDATA[For at afslutte installationen er du nødt til manuelt at rette <strong>/web.config filen</strong> og opdatére 'AppSetting' feltet <strong>UmbracoConfigurationStatus</strong> i bunden til <strong>'%0%'</strong>.]]></key>
|
||||||
<key alias="theEndInstallSuccess"><![CDATA[Du kan <strong>komme igang med det samme</strong> ved at klikke på "Start Umbraco" knappen nedenfor.<br/>Hvis du er <strong>ny med Umbraco</strong>, kan du finde masser af ressourcer på vores 'getting started' sider.
|
<key alias="theEndInstallSuccess">
|
||||||
]]></key>
|
<![CDATA[Du kan <strong>komme igang med det samme</strong> ved at klikke på "Start Umbraco" knappen nedenfor.<br/>Hvis du er <strong>ny med Umbraco</strong>, kan du finde masser af ressourcer på vores 'getting started' sider.
|
||||||
|
]]>
|
||||||
|
</key>
|
||||||
<key alias="theEndOpenUmbraco"><![CDATA[<h3>Start Umbraco</h3>For at administrere dit website skal du blot åbne Umbraco administrationen og begynde at tilføje indhold, opdatere skabelonerne og stylesheets'ene eller tilføje ny funktionalitet.]]></key>
|
<key alias="theEndOpenUmbraco"><![CDATA[<h3>Start Umbraco</h3>For at administrere dit website skal du blot åbne Umbraco administrationen og begynde at tilføje indhold, opdatere skabelonerne og stylesheets'ene eller tilføje ny funktionalitet.]]></key>
|
||||||
<key alias="Unavailable">Forbindelse til databasen fejlede.</key>
|
<key alias="Unavailable">Forbindelse til databasen fejlede.</key>
|
||||||
<key alias="Version3">Umbraco Version 3</key>
|
<key alias="Version3">Umbraco Version 3</key>
|
||||||
@@ -666,12 +676,15 @@ Gå til http://%4%/#/content/content/edit/%5% for at redigere.
|
|||||||
Ha' en dejlig dag!
|
Ha' en dejlig dag!
|
||||||
|
|
||||||
Mange hilsner fra Umbraco robotten
|
Mange hilsner fra Umbraco robotten
|
||||||
]]></key>
|
]]>
|
||||||
<key alias="mailBodyHtml"><![CDATA[<p>Hej %0%</p>
|
</key>
|
||||||
|
<key alias="mailBodyHtml">
|
||||||
|
<![CDATA[<p>Hej %0%</p>
|
||||||
<p>Dette er en automatisk mail for at informere dig om at opgaven <strong>'%1%'</strong>
|
<p>Dette er en automatisk mail for at informere dig om at opgaven <strong>'%1%'</strong>
|
||||||
er blevet udførtpå siden <a href="http://%4%/#/content/content/edit/%5%"><strong>'%2%'</strong></a> af brugeren <strong>'%3%'</strong> </p>
|
er blevet udførtpå siden <a href="http://%4%/#/content/content/edit/%5%"><strong>'%2%'</strong></a> af brugeren <strong>'%3%'</strong> </p>
|
||||||
<div style="margin: 8px 0; padding: 8px; display: block;"> <br />
|
<div style="margin: 8px 0; padding: 8px; display: block;"> <br />
|
||||||
<a style="color: white; font-weight: bold; background-color: #5372c3; text-decoration : none; margin-right: 20px; border: 8px solid #5372c3; width: 150px;" href="http://%4%/#/content/content/edit/%5%"> RET </a> <br /> </div> <p> <h3>Opdateringssammendrag:</h3> <table style="width: 100%;"> %6% </table> </p> <div style="margin: 8px 0; padding: 8px; display: block;"> <br /> <a style="color: white; font-weight: bold; background-color: #66cc66; text-decoration : none; margin-right: 20px; border: 8px solid #66cc66; width: 150px;" href="http://%4%/actions/publish.aspx?id=%5%"> PUBLISÉR </a> <a style="color: white; font-weight: bold; background-color: #5372c3; text-decoration : none; margin-right: 20px; border: 8px solid #5372c3; width: 150px;" href="http://%4%/#/content/content/edit/%5%"> RET </a> <a style="color: white; font-weight: bold; background-color: #ca4a4a; text-decoration : none; margin-right: 20px; border: 8px solid #ca4a4a; width: 150px;" href="http://%4%/actions/delete.aspx?id=%5%"> SLET </a> <br /> </div> <p>Hav en fortsat god dag!<br /><br /> De bedste hilsner fra umbraco robotten </p>]]></key>
|
<a style="color: white; font-weight: bold; background-color: #5372c3; text-decoration : none; margin-right: 20px; border: 8px solid #5372c3; width: 150px;" href="http://%4%/#/content/content/edit/%5%"> RET </a> <br /> </div> <p> <h3>Opdateringssammendrag:</h3> <table style="width: 100%;"> %6% </table> </p> <div style="margin: 8px 0; padding: 8px; display: block;"> <br /> <a style="color: white; font-weight: bold; background-color: #66cc66; text-decoration : none; margin-right: 20px; border: 8px solid #66cc66; width: 150px;" href="http://%4%/actions/publish.aspx?id=%5%"> PUBLISÉR </a> <a style="color: white; font-weight: bold; background-color: #5372c3; text-decoration : none; margin-right: 20px; border: 8px solid #5372c3; width: 150px;" href="http://%4%/#/content/content/edit/%5%"> RET </a> <a style="color: white; font-weight: bold; background-color: #ca4a4a; text-decoration : none; margin-right: 20px; border: 8px solid #ca4a4a; width: 150px;" href="http://%4%/actions/delete.aspx?id=%5%"> SLET </a> <br /> </div> <p>Hav en fortsat god dag!<br /><br /> De bedste hilsner fra umbraco robotten </p>]]>
|
||||||
|
</key>
|
||||||
<key alias="mailSubject">[%0%] Notificering om %1% udført på %2%</key>
|
<key alias="mailSubject">[%0%] Notificering om %1% udført på %2%</key>
|
||||||
<key alias="notifications">Notificeringer</key>
|
<key alias="notifications">Notificeringer</key>
|
||||||
</area>
|
</area>
|
||||||
@@ -692,8 +705,10 @@ Mange hilsner fra Umbraco robotten
|
|||||||
<key alias="packageUninstalledHeader">Pakken blev fjernet</key>
|
<key alias="packageUninstalledHeader">Pakken blev fjernet</key>
|
||||||
<key alias="packageUninstalledText">Pakken er på succefuld vis blevet fjernet</key>
|
<key alias="packageUninstalledText">Pakken er på succefuld vis blevet fjernet</key>
|
||||||
<key alias="packageUninstallHeader">Afinstallér pakke</key>
|
<key alias="packageUninstallHeader">Afinstallér pakke</key>
|
||||||
<key alias="packageUninstallText"><![CDATA[Du kan fjerne markeringen på elementer du ikke ønsker at fjerne, på dette tidspunkt, nedenfor. Når du klikker 'bekræft' vil alle afkrydsede elemenet blive fjernet <br/>
|
<key alias="packageUninstallText">
|
||||||
<span style="color: Red; font-weight: bold;">Bemærk:</span> at dokumenter og medier som afhænger af denne pakke vil muligvis holde op med at virke, så vær forsigtig. Hvis i tvivl, kontakt personen som har udviklet pakken.]]></key>
|
<![CDATA[Du kan fjerne markeringen på elementer du ikke ønsker at fjerne, på dette tidspunkt, nedenfor. Når du klikker 'bekræft' vil alle afkrydsede elemenet blive fjernet <br/>
|
||||||
|
<span style="color: Red; font-weight: bold;">Bemærk:</span> at dokumenter og medier som afhænger af denne pakke vil muligvis holde op med at virke, så vær forsigtig. Hvis i tvivl, kontakt personen som har udviklet pakken.]]>
|
||||||
|
</key>
|
||||||
<key alias="packageUpgradeDownload">Download opdatering fra opbevaringsbasen</key>
|
<key alias="packageUpgradeDownload">Download opdatering fra opbevaringsbasen</key>
|
||||||
<key alias="packageUpgradeHeader">Opdatér pakke</key>
|
<key alias="packageUpgradeHeader">Opdatér pakke</key>
|
||||||
<key alias="packageUpgradeInstructions">Opdateringsinstrukser</key>
|
<key alias="packageUpgradeInstructions">Opdateringsinstrukser</key>
|
||||||
@@ -726,6 +741,19 @@ Mange hilsner fra Umbraco robotten
|
|||||||
<key alias="paSimpleHelp">Hvis du blot ønsker at opsætte simpel beskyttelse ved hjælp af et enkelt login og kodeord</key>
|
<key alias="paSimpleHelp">Hvis du blot ønsker at opsætte simpel beskyttelse ved hjælp af et enkelt login og kodeord</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="publish">
|
<area alias="publish">
|
||||||
|
<key alias="contentPublishedFailedAwaitingRelease">Udgivelsen kunne ikke udgives da publiceringsdato er sat</key>
|
||||||
|
<key alias="contentPublishedFailedExpired">
|
||||||
|
<![CDATA[
|
||||||
|
%0% Udgivelsen kunne ikke blive publiceret da publiceringsdatoen er overskredet
|
||||||
|
]]>
|
||||||
|
</key>
|
||||||
|
<key alias="contentPublishedFailedInvalid">
|
||||||
|
<![CDATA[
|
||||||
|
%0% kunne ikke publiceres da følgende egenskaber : %1% ikke overholdte valderingsreglerne.
|
||||||
|
]]>
|
||||||
|
</key>
|
||||||
|
<key alias="editContentPublishedFailedByParent">Udgivelsen fejlede fordi en overordnet side ikke er publiceret</key>
|
||||||
|
|
||||||
<key alias="contentPublishedFailedByEvent">%0% kunne ikke udgives, fordi et 3. parts modul annullerede handlingen</key>
|
<key alias="contentPublishedFailedByEvent">%0% kunne ikke udgives, fordi et 3. parts modul annullerede handlingen</key>
|
||||||
<key alias="includeUnpublished">Medtag ikke-udgivede undersider</key>
|
<key alias="includeUnpublished">Medtag ikke-udgivede undersider</key>
|
||||||
<key alias="inProgress">Publicerer - vent venligst...</key>
|
<key alias="inProgress">Publicerer - vent venligst...</key>
|
||||||
@@ -799,58 +827,58 @@ Mange hilsner fra Umbraco robotten
|
|||||||
|
|
||||||
<area alias="contentTypeEditor">
|
<area alias="contentTypeEditor">
|
||||||
|
|
||||||
<key alias="compositions">Kompositioner</key>
|
<key alias="compositions">Kompositioner</key>
|
||||||
<key alias="noTabs">Du har ikke tilføjet nogle faner</key>
|
<key alias="noTabs">Du har ikke tilføjet nogle faner</key>
|
||||||
<key alias="addNewTab">Tilføj ny fane</key>
|
<key alias="addNewTab">Tilføj ny fane</key>
|
||||||
<key alias="addAnotherTab">Tilføj endnu en fane</key>
|
<key alias="addAnotherTab">Tilføj endnu en fane</key>
|
||||||
<key alias="inheritedFrom">Nedarvet fra</key>
|
<key alias="inheritedFrom">Nedarvet fra</key>
|
||||||
<key alias="addProperty">Tilføj property</key>
|
<key alias="addProperty">Tilføj property</key>
|
||||||
<key alias="requiredLabel">Påkrævet label</key>
|
<key alias="requiredLabel">Påkrævet label</key>
|
||||||
|
|
||||||
<key alias="enableListViewHeading">Aktiver listevisning</key>
|
<key alias="enableListViewHeading">Aktiver listevisning</key>
|
||||||
<key alias="enableListViewDescription">Konfigurer indholdet til at blive vist i en sorterbar og søgbar liste, dens børn vil ikke blive vist i træet</key>
|
<key alias="enableListViewDescription">Konfigurer indholdet til at blive vist i en sorterbar og søgbar liste, dens børn vil ikke blive vist i træet</key>
|
||||||
|
|
||||||
<key alias="allowedTemplatesHeading">Tilladte skabeloner</key>
|
<key alias="allowedTemplatesHeading">Tilladte skabeloner</key>
|
||||||
<key alias="allowedTemplatesDescription">Vælg hvilke skabeloner der er tilladt at bruge på dette indhold</key>
|
<key alias="allowedTemplatesDescription">Vælg hvilke skabeloner der er tilladt at bruge på dette indhold</key>
|
||||||
|
|
||||||
<key alias="allowAsRootHeading">Tillad på rodniveau</key>
|
<key alias="allowAsRootHeading">Tillad på rodniveau</key>
|
||||||
<key alias="allowAsRootDescription">Kun dokumenttyper med denne indstilling aktiveret oprettes i rodniveau under inhold og mediearkiv</key>
|
<key alias="allowAsRootDescription">Kun dokumenttyper med denne indstilling aktiveret oprettes i rodniveau under inhold og mediearkiv</key>
|
||||||
<key alias="allowAsRootCheckbox">Ja – indhold af denne type er tilladt i roden</key>
|
<key alias="allowAsRootCheckbox">Ja – indhold af denne type er tilladt i roden</key>
|
||||||
|
|
||||||
<key alias="childNodesHeading">Tilladte typer</key>
|
<key alias="childNodesHeading">Tilladte typer</key>
|
||||||
<key alias="childNodesDescription">Tillad at oprette indhold af en specifik type under denne</key>
|
<key alias="childNodesDescription">Tillad at oprette indhold af en specifik type under denne</key>
|
||||||
|
|
||||||
<key alias="chooseChildNode">Vælg child node</key>
|
<key alias="chooseChildNode">Vælg child node</key>
|
||||||
|
|
||||||
<key alias="compositionsDescription">Nedarv faner og egenskaber fra en anden dokumenttype. Nye faner vil blive tilføjet den nuværende dokumenttype eller sammenflettet hvis fanenavnene er ens.</key>
|
<key alias="compositionsDescription">Nedarv faner og egenskaber fra en anden dokumenttype. Nye faner vil blive tilføjet den nuværende dokumenttype eller sammenflettet hvis fanenavnene er ens.</key>
|
||||||
<key alias="compositionInUse">Indholdstypen bliver brugt i en komposition og kan derfor ikke blive anvendt som komposition</key>
|
<key alias="compositionInUse">Indholdstypen bliver brugt i en komposition og kan derfor ikke blive anvendt som komposition</key>
|
||||||
<key alias="noAvailableCompositions">Der er ingen indholdstyper tilgængelige at bruge som komposition</key>
|
<key alias="noAvailableCompositions">Der er ingen indholdstyper tilgængelige at bruge som komposition</key>
|
||||||
|
|
||||||
<key alias="availableEditors">Tilgængelige editors</key>
|
<key alias="availableEditors">Tilgængelige editors</key>
|
||||||
<key alias="reuse">Genbrug</key>
|
<key alias="reuse">Genbrug</key>
|
||||||
<key alias="editorSettings">Editor indstillinger</key>
|
<key alias="editorSettings">Editor indstillinger</key>
|
||||||
|
|
||||||
<key alias="configuration">Konfiguration</key>
|
<key alias="configuration">Konfiguration</key>
|
||||||
|
|
||||||
<key alias="yesDelete">Ja, slet</key>
|
<key alias="yesDelete">Ja, slet</key>
|
||||||
|
|
||||||
<key alias="movedUnderneath">blev flyttet til</key>
|
<key alias="movedUnderneath">blev flyttet til</key>
|
||||||
<key alias="folderToMove">Vælg hvor</key>
|
<key alias="folderToMove">Vælg hvor</key>
|
||||||
<key alias="structureBelow">skal flyttes til</key>
|
<key alias="structureBelow">skal flyttes til</key>
|
||||||
|
|
||||||
<key alias="allDocumentTypes">Alle dokumenttyper</key>
|
<key alias="allDocumentTypes">Alle dokumenttyper</key>
|
||||||
<key alias="allDocuments">Alle dokumenter</key>
|
<key alias="allDocuments">Alle dokumenter</key>
|
||||||
<key alias="allMediaItems">Alle medier</key>
|
<key alias="allMediaItems">Alle medier</key>
|
||||||
|
|
||||||
<key alias="usingThisDocument">som benytter denne dokumenttype vil blive slettet permanent. Bekræft at du også vil slette dem.</key>
|
<key alias="usingThisDocument">som benytter denne dokumenttype vil blive slettet permanent. Bekræft at du også vil slette dem.</key>
|
||||||
<key alias="usingThisMedia">som benytter denne medietype vil blive slettet permanent. Bekræft at du også vil slette dem.</key>
|
<key alias="usingThisMedia">som benytter denne medietype vil blive slettet permanent. Bekræft at du også vil slette dem.</key>
|
||||||
<key alias="usingThisMember">som benytter denne medlemstype vil blive slettet permanent. Bekræft at du også vil slette dem.</key>
|
<key alias="usingThisMember">som benytter denne medlemstype vil blive slettet permanent. Bekræft at du også vil slette dem.</key>
|
||||||
|
|
||||||
<key alias="andAllDocuments">og alle dokumenter, som benytter denne type</key>
|
<key alias="andAllDocuments">og alle dokumenter, som benytter denne type</key>
|
||||||
<key alias="andAllMediaItems">og alle medier, som benytter denne type</key>
|
<key alias="andAllMediaItems">og alle medier, som benytter denne type</key>
|
||||||
<key alias="andAllMembers">og alle medlemmer, som benytter denne type</key>
|
<key alias="andAllMembers">og alle medlemmer, som benytter denne type</key>
|
||||||
|
|
||||||
<key alias="thisEditorUpdateSettings">der bruger denne editor vil blive opdateret med de nye indstillinger</key>
|
<key alias="thisEditorUpdateSettings">der bruger denne editor vil blive opdateret med de nye indstillinger</key>
|
||||||
</area>
|
</area>
|
||||||
|
|
||||||
<area alias="rollback">
|
<area alias="rollback">
|
||||||
@@ -914,8 +942,6 @@ Mange hilsner fra Umbraco robotten
|
|||||||
<area alias="speechBubbles">
|
<area alias="speechBubbles">
|
||||||
<key alias="operationCancelledHeader">Annulleret</key>
|
<key alias="operationCancelledHeader">Annulleret</key>
|
||||||
<key alias="operationCancelledText">Handlingen blev annulleret af et 3. part tilføjelsesprogram</key>
|
<key alias="operationCancelledText">Handlingen blev annulleret af et 3. part tilføjelsesprogram</key>
|
||||||
<key alias="contentPublishedFailedByEvent">Udgivelsen blev standset af et 3. parts modul</key>
|
|
||||||
<key alias="contentPublishedFailedAwaitingRelease">Udgivelsen kunne ikke udgives da publiceringsdato er sat</key>
|
|
||||||
<key alias="contentTypeDublicatePropertyType">Property type eksisterer allerede</key>
|
<key alias="contentTypeDublicatePropertyType">Property type eksisterer allerede</key>
|
||||||
<key alias="contentTypePropertyTypeCreated">Egenskabstype oprettet</key>
|
<key alias="contentTypePropertyTypeCreated">Egenskabstype oprettet</key>
|
||||||
<key alias="contentTypePropertyTypeCreatedText"><![CDATA[Navn: %0% <br /> DataType: %1%]]></key>
|
<key alias="contentTypePropertyTypeCreatedText"><![CDATA[Navn: %0% <br /> DataType: %1%]]></key>
|
||||||
@@ -929,7 +955,6 @@ Mange hilsner fra Umbraco robotten
|
|||||||
<key alias="cssSavedText">Stylesheet gemt uden fejl</key>
|
<key alias="cssSavedText">Stylesheet gemt uden fejl</key>
|
||||||
<key alias="dataTypeSaved">Datatype gemt</key>
|
<key alias="dataTypeSaved">Datatype gemt</key>
|
||||||
<key alias="dictionaryItemSaved">Ordbogsnøgle gemt</key>
|
<key alias="dictionaryItemSaved">Ordbogsnøgle gemt</key>
|
||||||
<key alias="editContentPublishedFailedByParent">Udgivelsen fejlede fordi en overordnet side ikke er publiceret</key>
|
|
||||||
<key alias="editContentPublishedHeader">Indhold publiceret</key>
|
<key alias="editContentPublishedHeader">Indhold publiceret</key>
|
||||||
<key alias="editContentPublishedText">og nu synligt for besøgende</key>
|
<key alias="editContentPublishedText">og nu synligt for besøgende</key>
|
||||||
<key alias="editContentSavedHeader">Indhold gemt</key>
|
<key alias="editContentSavedHeader">Indhold gemt</key>
|
||||||
@@ -1131,11 +1156,28 @@ Mange hilsner fra Umbraco robotten
|
|||||||
<key alias="sessionExpires">Session udløber</key>
|
<key alias="sessionExpires">Session udløber</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="validation">
|
<area alias="validation">
|
||||||
<key alias="validation">Validation</key>
|
<key alias="validation">Validation</key>
|
||||||
<key alias="validateAsEmail">Valider som email</key>
|
<key alias="validateAsEmail">Valider som email</key>
|
||||||
<key alias="validateAsNumber">Valider som tal</key>
|
<key alias="validateAsNumber">Valider som tal</key>
|
||||||
<key alias="validateAsUrl">Valider som Url</key>
|
<key alias="validateAsUrl">Valider som Url</key>
|
||||||
<key alias="enterCustomValidation">...eller indtast din egen validering</key>
|
<key alias="enterCustomValidation">...eller indtast din egen validering</key>
|
||||||
<key alias="fieldIsMandatory">Feltet er påkrævet</key>
|
<key alias="fieldIsMandatory">Feltet er påkrævet</key>
|
||||||
|
</area>
|
||||||
|
<area alias="redirectUrls">
|
||||||
|
<key alias="disableUrlTracker">Slå URL tracker fra</key>
|
||||||
|
<key alias="enableUrlTracker">Slå URL tracker til</key>
|
||||||
|
<key alias="originalUrl">Original URL</key>
|
||||||
|
<key alias="redirectedTo">Viderestillet til</key>
|
||||||
|
<key alias="noRedirects">Der er ikke lavet nogen viderestillinger</key>
|
||||||
|
<key alias="noRedirectsDescription">Når en udgivet side bliver omdøbt eller flyttet, vil en viderestilling automatisk blive lavet til den nye side.</key>
|
||||||
|
<key alias="removeButton">Fjern</key>
|
||||||
|
<key alias="confirmRemove">Er du sikker på at du vil fjerne viderestillingen fra '%0%' til '%1%'?</key>
|
||||||
|
<key alias="redirectRemoved">Viderestillings URL fjernet.</key>
|
||||||
|
<key alias="redirectRemoveError">Fejl under fjernelse af viderestillings URL.</key>
|
||||||
|
<key alias="confirmDisable">Er du sikker på at du vil slå URL trackeren fra?</key>
|
||||||
|
<key alias="disabledConfirm">URL tracker er nu slået fra.</key>
|
||||||
|
<key alias="disableError">Der opstod en fejl under forsøget på at slå URL trackeren fra, der findes mere information i logfilen.</key>
|
||||||
|
<key alias="enabledConfirm">URL tracker er nu slået fra.</key>
|
||||||
|
<key alias="enableError">Der opstod en fejl under forsøget på at slå URL trackeren til, der findes mere information i logfilen.</key>
|
||||||
</area>
|
</area>
|
||||||
</language>
|
</language>
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
<key alias="refreshNode">Reload</key>
|
<key alias="refreshNode">Reload</key>
|
||||||
<key alias="republish">Republish entire site</key>
|
<key alias="republish">Republish entire site</key>
|
||||||
<key alias="restore" version="7.3.0">Restore</key>
|
<key alias="restore" version="7.3.0">Restore</key>
|
||||||
|
<key alias="SetPermissionsForThePage">Set permissions for the page %0%</key>
|
||||||
|
<key alias="chooseWhereToMove">Choose where to move</key>
|
||||||
|
<key alias="toInTheTreeStructureBelow">to in the tree structure below</key>
|
||||||
<key alias="rights">Permissions</key>
|
<key alias="rights">Permissions</key>
|
||||||
<key alias="rollback">Rollback</key>
|
<key alias="rollback">Rollback</key>
|
||||||
<key alias="sendtopublish">Send To Publish</key>
|
<key alias="sendtopublish">Send To Publish</key>
|
||||||
@@ -144,7 +147,7 @@
|
|||||||
<key alias="memberrole">Role</key>
|
<key alias="memberrole">Role</key>
|
||||||
<key alias="membertype">Member Type</key>
|
<key alias="membertype">Member Type</key>
|
||||||
<key alias="noDate">No date chosen</key>
|
<key alias="noDate">No date chosen</key>
|
||||||
<key alias="nodeName">Page Title</key>
|
<key alias="nodeName">Link title</key>
|
||||||
<key alias="otherElements">Properties</key>
|
<key alias="otherElements">Properties</key>
|
||||||
<key alias="parentNotPublished">This document is published but is not visible because the parent '%0%' is unpublished</key>
|
<key alias="parentNotPublished">This document is published but is not visible because the parent '%0%' is unpublished</key>
|
||||||
<key alias="parentNotPublishedAnomaly">This document is published but is not in the cache</key>
|
<key alias="parentNotPublishedAnomaly">This document is published but is not in the cache</key>
|
||||||
@@ -286,18 +289,12 @@
|
|||||||
<key alias="treepicker">Pick item</key>
|
<key alias="treepicker">Pick item</key>
|
||||||
<key alias="viewCacheItem">View Cache Item</key>
|
<key alias="viewCacheItem">View Cache Item</key>
|
||||||
<key alias="createFolder">Create folder...</key>
|
<key alias="createFolder">Create folder...</key>
|
||||||
|
|
||||||
<key alias="relateToOriginalLabel">Relate to original</key>
|
<key alias="relateToOriginalLabel">Relate to original</key>
|
||||||
|
<key alias="includeDescendants">Include descendants</key>
|
||||||
<key alias="theFriendliestCommunity">The friendliest community</key>
|
<key alias="theFriendliestCommunity">The friendliest community</key>
|
||||||
|
|
||||||
<key alias="linkToPage">Link to page</key>
|
<key alias="linkToPage">Link to page</key>
|
||||||
|
|
||||||
<key alias="openInNewWindow">Opens the linked document in a new window or tab</key>
|
<key alias="openInNewWindow">Opens the linked document in a new window or tab</key>
|
||||||
<key alias="openInFullBody">Opens the linked document in the full body of the window</key>
|
|
||||||
<key alias="openInParentFrame">Opens the linked document in the parent frame</key>
|
|
||||||
|
|
||||||
<key alias="linkToMedia">Link to media</key>
|
<key alias="linkToMedia">Link to media</key>
|
||||||
|
|
||||||
<key alias="selectMedia">Select media</key>
|
<key alias="selectMedia">Select media</key>
|
||||||
<key alias="selectIcon">Select icon</key>
|
<key alias="selectIcon">Select icon</key>
|
||||||
<key alias="selectItem">Select item</key>
|
<key alias="selectItem">Select item</key>
|
||||||
@@ -307,19 +304,14 @@
|
|||||||
<key alias="selectMember">Select member</key>
|
<key alias="selectMember">Select member</key>
|
||||||
<key alias="selectMemberGroup">Select member group</key>
|
<key alias="selectMemberGroup">Select member group</key>
|
||||||
<key alias="noIconsFound">No icons were found</key>
|
<key alias="noIconsFound">No icons were found</key>
|
||||||
|
|
||||||
<key alias="noMacroParams">There are no parameters for this macro</key>
|
<key alias="noMacroParams">There are no parameters for this macro</key>
|
||||||
|
|
||||||
<key alias="externalLoginProviders">External login providers</key>
|
<key alias="externalLoginProviders">External login providers</key>
|
||||||
<key alias="exceptionDetail">Exception Details</key>
|
<key alias="exceptionDetail">Exception Details</key>
|
||||||
<key alias="stacktrace">Stacktrace</key>
|
<key alias="stacktrace">Stacktrace</key>
|
||||||
<key alias="innerException">Inner Exception</key>
|
<key alias="innerException">Inner Exception</key>
|
||||||
|
|
||||||
<key alias="linkYour">Link your</key>
|
<key alias="linkYour">Link your</key>
|
||||||
<key alias="unLinkYour">Un-Link your</key>
|
<key alias="unLinkYour">Un-Link your</key>
|
||||||
|
|
||||||
<key alias="account">account</key>
|
<key alias="account">account</key>
|
||||||
|
|
||||||
<key alias="selectEditor">Select editor</key>
|
<key alias="selectEditor">Select editor</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="dictionaryItem">
|
<area alias="dictionaryItem">
|
||||||
@@ -327,6 +319,12 @@
|
|||||||
Edit the different language versions for the dictionary item '<em>%0%</em>' below<br/>You can add additional languages under the 'languages' in the menu on the left
|
Edit the different language versions for the dictionary item '<em>%0%</em>' below<br/>You can add additional languages under the 'languages' in the menu on the left
|
||||||
]]></key>
|
]]></key>
|
||||||
<key alias="displayName">Culture Name</key>
|
<key alias="displayName">Culture Name</key>
|
||||||
|
<key alias="changeKey">Edit the key of the dictionary item.</key>
|
||||||
|
<key alias="changeKeyError">
|
||||||
|
<![CDATA[
|
||||||
|
The key '%0%' already exists.
|
||||||
|
]]>
|
||||||
|
</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="placeholders">
|
<area alias="placeholders">
|
||||||
<key alias="username">Enter your username</key>
|
<key alias="username">Enter your username</key>
|
||||||
@@ -819,7 +817,7 @@ To manage your website, simply open the Umbraco back office and start adding con
|
|||||||
<key alias="installStateInstalling">Installing...</key>
|
<key alias="installStateInstalling">Installing...</key>
|
||||||
<key alias="installStateRestarting">Restarting, please wait...</key>
|
<key alias="installStateRestarting">Restarting, please wait...</key>
|
||||||
<key alias="installStateComplete">All done, your browser will now refresh, please wait...</key>
|
<key alias="installStateComplete">All done, your browser will now refresh, please wait...</key>
|
||||||
|
<key alias="installStateCompleted">Please click finish to complete installation and reload page.</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="paste">
|
<area alias="paste">
|
||||||
<key alias="doNothing">Paste with full formatting (Not recommended)</key>
|
<key alias="doNothing">Paste with full formatting (Not recommended)</key>
|
||||||
@@ -1335,7 +1333,7 @@ To manage your website, simply open the Umbraco back office and start adding con
|
|||||||
<key alias="customErrorsCheckRectifySuccessMessage">Custom errors successfully set to '%0%'.</key>
|
<key alias="customErrorsCheckRectifySuccessMessage">Custom errors successfully set to '%0%'.</key>
|
||||||
|
|
||||||
<key alias="macroErrorModeCheckSuccessMessage">MacroErrors are set to '%0%'.</key>
|
<key alias="macroErrorModeCheckSuccessMessage">MacroErrors are set to '%0%'.</key>
|
||||||
<key alias="macroErrorModeCheckErrorMessage">MacroErrors are set to '%0%' which will prevent some or all pages in your site from loading completely when there's any errors in macros. Rectifying this will set the value to '%1%'.</key>
|
<key alias="macroErrorModeCheckErrorMessage">MacroErrors are set to '%0%' which will prevent some or all pages in your site from loading completely if there are any errors in macros. Rectifying this will set the value to '%1%'.</key>
|
||||||
<key alias="macroErrorModeCheckRectifySuccessMessage">MacroErrors are now set to '%0%'.</key>
|
<key alias="macroErrorModeCheckRectifySuccessMessage">MacroErrors are now set to '%0%'.</key>
|
||||||
|
|
||||||
<!-- The following keys get these tokens passed in:
|
<!-- The following keys get these tokens passed in:
|
||||||
@@ -1353,8 +1351,8 @@ To manage your website, simply open the Umbraco back office and start adding con
|
|||||||
<key alias="configurationServiceError">There was an error, check log for full error: %0%.</key>
|
<key alias="configurationServiceError">There was an error, check log for full error: %0%.</key>
|
||||||
|
|
||||||
<key alias="xmlDataIntegrityCheckMembers">Members - Total XML: %0%, Total: %1%, Total invalid: %2%</key>
|
<key alias="xmlDataIntegrityCheckMembers">Members - Total XML: %0%, Total: %1%, Total invalid: %2%</key>
|
||||||
<key alias="xmlDataIntegrityCheckMedia">Media - Total XML: %0%, Total: %1%, Total invalid %2%</key>
|
<key alias="xmlDataIntegrityCheckMedia">Media - Total XML: %0%, Total: %1%, Total invalid: %2%</key>
|
||||||
<key alias="xmlDataIntegrityCheckContent">Content - Total XML: %0%, Total published: %1%, Total invalid %2%</key>
|
<key alias="xmlDataIntegrityCheckContent">Content - Total XML: %0%, Total published: %1%, Total invalid: %2%</key>
|
||||||
|
|
||||||
<key alias="httpsCheckValidCertificate">Your site certificate was marked as valid.</key>
|
<key alias="httpsCheckValidCertificate">Your site certificate was marked as valid.</key>
|
||||||
<key alias="httpsCheckInvalidCertificate">Certificate validation error: '%0%'</key>
|
<key alias="httpsCheckInvalidCertificate">Certificate validation error: '%0%'</key>
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
<key alias="unpublish">Unpublish</key>
|
<key alias="unpublish">Unpublish</key>
|
||||||
<key alias="refreshNode">Reload</key>
|
<key alias="refreshNode">Reload</key>
|
||||||
<key alias="republish">Republish entire site</key>
|
<key alias="republish">Republish entire site</key>
|
||||||
|
<key alias="SetPermissionsForThePage">Set permissions for the page %0%</key>
|
||||||
|
<key alias="chooseWhereToMove">Choose where to move</key>
|
||||||
|
<key alias="toInTheTreeStructureBelow">to in the tree structure below</key>
|
||||||
<key alias="restore" version="7.3.0">Restore</key>
|
<key alias="restore" version="7.3.0">Restore</key>
|
||||||
<key alias="rights">Permissions</key>
|
<key alias="rights">Permissions</key>
|
||||||
<key alias="rollback">Rollback</key>
|
<key alias="rollback">Rollback</key>
|
||||||
@@ -145,7 +148,7 @@
|
|||||||
<key alias="memberrole">Role</key>
|
<key alias="memberrole">Role</key>
|
||||||
<key alias="membertype">Member Type</key>
|
<key alias="membertype">Member Type</key>
|
||||||
<key alias="noDate">No date chosen</key>
|
<key alias="noDate">No date chosen</key>
|
||||||
<key alias="nodeName">Page Title</key>
|
<key alias="nodeName">Link title</key>
|
||||||
<key alias="otherElements">Properties</key>
|
<key alias="otherElements">Properties</key>
|
||||||
<key alias="parentNotPublished">This document is published but is not visible because the parent '%0%' is unpublished</key>
|
<key alias="parentNotPublished">This document is published but is not visible because the parent '%0%' is unpublished</key>
|
||||||
<key alias="parentNotPublishedAnomaly">This document is published but is not in the cache</key>
|
<key alias="parentNotPublishedAnomaly">This document is published but is not in the cache</key>
|
||||||
@@ -288,18 +291,12 @@
|
|||||||
<key alias="treepicker">Pick item</key>
|
<key alias="treepicker">Pick item</key>
|
||||||
<key alias="viewCacheItem">View Cache Item</key>
|
<key alias="viewCacheItem">View Cache Item</key>
|
||||||
<key alias="createFolder">Create folder...</key>
|
<key alias="createFolder">Create folder...</key>
|
||||||
|
|
||||||
<key alias="relateToOriginalLabel">Relate to original</key>
|
<key alias="relateToOriginalLabel">Relate to original</key>
|
||||||
|
<key alias="includeDescendants">Include descendants</key>
|
||||||
<key alias="theFriendliestCommunity">The friendliest community</key>
|
<key alias="theFriendliestCommunity">The friendliest community</key>
|
||||||
|
|
||||||
<key alias="linkToPage">Link to page</key>
|
<key alias="linkToPage">Link to page</key>
|
||||||
|
|
||||||
<key alias="openInNewWindow">Opens the linked document in a new window or tab</key>
|
<key alias="openInNewWindow">Opens the linked document in a new window or tab</key>
|
||||||
<key alias="openInFullBody">Opens the linked document in the full body of the window</key>
|
|
||||||
<key alias="openInParentFrame">Opens the linked document in the parent frame</key>
|
|
||||||
|
|
||||||
<key alias="linkToMedia">Link to media</key>
|
<key alias="linkToMedia">Link to media</key>
|
||||||
|
|
||||||
<key alias="selectMedia">Select media</key>
|
<key alias="selectMedia">Select media</key>
|
||||||
<key alias="selectIcon">Select icon</key>
|
<key alias="selectIcon">Select icon</key>
|
||||||
<key alias="selectItem">Select item</key>
|
<key alias="selectItem">Select item</key>
|
||||||
@@ -308,19 +305,14 @@
|
|||||||
<key alias="selectContent">Select content</key>
|
<key alias="selectContent">Select content</key>
|
||||||
<key alias="selectMember">Select member</key>
|
<key alias="selectMember">Select member</key>
|
||||||
<key alias="selectMemberGroup">Select member group</key>
|
<key alias="selectMemberGroup">Select member group</key>
|
||||||
|
|
||||||
<key alias="noMacroParams">There are no parameters for this macro</key>
|
<key alias="noMacroParams">There are no parameters for this macro</key>
|
||||||
|
|
||||||
<key alias="externalLoginProviders">External login providers</key>
|
<key alias="externalLoginProviders">External login providers</key>
|
||||||
<key alias="exceptionDetail">Exception Details</key>
|
<key alias="exceptionDetail">Exception Details</key>
|
||||||
<key alias="stacktrace">Stacktrace</key>
|
<key alias="stacktrace">Stacktrace</key>
|
||||||
<key alias="innerException">Inner Exception</key>
|
<key alias="innerException">Inner Exception</key>
|
||||||
|
|
||||||
<key alias="linkYour">Link your</key>
|
<key alias="linkYour">Link your</key>
|
||||||
<key alias="unLinkYour">Un-Link your</key>
|
<key alias="unLinkYour">Un-Link your</key>
|
||||||
|
|
||||||
<key alias="account">account</key>
|
<key alias="account">account</key>
|
||||||
|
|
||||||
<key alias="selectEditor">Select editor</key>
|
<key alias="selectEditor">Select editor</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="dictionaryItem">
|
<area alias="dictionaryItem">
|
||||||
@@ -328,6 +320,12 @@
|
|||||||
Edit the different language versions for the dictionary item '<em>%0%</em>' below<br/>You can add additional languages under the 'languages' in the menu on the left
|
Edit the different language versions for the dictionary item '<em>%0%</em>' below<br/>You can add additional languages under the 'languages' in the menu on the left
|
||||||
]]></key>
|
]]></key>
|
||||||
<key alias="displayName">Culture Name</key>
|
<key alias="displayName">Culture Name</key>
|
||||||
|
<key alias="changeKey">Edit the key of the dictionary item.</key>
|
||||||
|
<key alias="changeKeyError">
|
||||||
|
<![CDATA[
|
||||||
|
The key '%0%' already exists.
|
||||||
|
]]>
|
||||||
|
</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="placeholders">
|
<area alias="placeholders">
|
||||||
<key alias="username">Enter your username</key>
|
<key alias="username">Enter your username</key>
|
||||||
@@ -819,6 +817,7 @@ To manage your website, simply open the Umbraco back office and start adding con
|
|||||||
<key alias="installStateInstalling">Installing...</key>
|
<key alias="installStateInstalling">Installing...</key>
|
||||||
<key alias="installStateRestarting">Restarting, please wait...</key>
|
<key alias="installStateRestarting">Restarting, please wait...</key>
|
||||||
<key alias="installStateComplete">All done, your browser will now refresh, please wait...</key>
|
<key alias="installStateComplete">All done, your browser will now refresh, please wait...</key>
|
||||||
|
<key alias="installStateCompleted">Please click finish to complete installation and reload page.</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="paste">
|
<area alias="paste">
|
||||||
<key alias="doNothing">Paste with full formatting (Not recommended)</key>
|
<key alias="doNothing">Paste with full formatting (Not recommended)</key>
|
||||||
@@ -1340,7 +1339,7 @@ To manage your website, simply open the Umbraco back office and start adding con
|
|||||||
<key alias="customErrorsCheckRectifySuccessMessage">Custom errors successfully set to '%0%'.</key>
|
<key alias="customErrorsCheckRectifySuccessMessage">Custom errors successfully set to '%0%'.</key>
|
||||||
|
|
||||||
<key alias="macroErrorModeCheckSuccessMessage">MacroErrors are set to '%0%'.</key>
|
<key alias="macroErrorModeCheckSuccessMessage">MacroErrors are set to '%0%'.</key>
|
||||||
<key alias="macroErrorModeCheckErrorMessage">MacroErrors are set to '%0%' which will prevent some or all pages in your site from loading completely when there's any errors in macros. Rectifying this will set the value to '%1%'.</key>
|
<key alias="macroErrorModeCheckErrorMessage">MacroErrors are set to '%0%' which will prevent some or all pages in your site from loading completely if there are any errors in macros. Rectifying this will set the value to '%1%'.</key>
|
||||||
<key alias="macroErrorModeCheckRectifySuccessMessage">MacroErrors are now set to '%0%'.</key>
|
<key alias="macroErrorModeCheckRectifySuccessMessage">MacroErrors are now set to '%0%'.</key>
|
||||||
|
|
||||||
<!-- The following keys get these tokens passed in:
|
<!-- The following keys get these tokens passed in:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -275,19 +275,12 @@
|
|||||||
<key alias="thumbnailimageclickfororiginal">クリックすると画像がフルサイズで表示されます</key>
|
<key alias="thumbnailimageclickfororiginal">クリックすると画像がフルサイズで表示されます</key>
|
||||||
<key alias="treepicker">項目の選択</key>
|
<key alias="treepicker">項目の選択</key>
|
||||||
<key alias="viewCacheItem">キャッシュされている項目の表示</key>
|
<key alias="viewCacheItem">キャッシュされている項目の表示</key>
|
||||||
<key alias="createFolder">フォルダーの作成...</key>
|
<key alias="createFolder">フォルダーの作成...</key>
|
||||||
|
|
||||||
<key alias="relateToOriginalLabel">オリジナルに関連付ける</key>
|
<key alias="relateToOriginalLabel">オリジナルに関連付ける</key>
|
||||||
<key alias="theFriendliestCommunity">フレンドリーなコミュニティ</key>
|
<key alias="theFriendliestCommunity">フレンドリーなコミュニティ</key>
|
||||||
|
|
||||||
<key alias="linkToPage">ページへリンク</key>
|
<key alias="linkToPage">ページへリンク</key>
|
||||||
|
|
||||||
<key alias="openInNewWindow">リンク ドキュメントを新しいウィンドウまたはタブで開く</key>
|
<key alias="openInNewWindow">リンク ドキュメントを新しいウィンドウまたはタブで開く</key>
|
||||||
<key alias="openInFullBody">リンク ドキュメントをウィンドウ全文表示で開く</key>
|
|
||||||
<key alias="openInParentFrame">親フレームでリンク ドキュメントを開く</key>
|
|
||||||
|
|
||||||
<key alias="linkToMedia">メディアへリンク</key>
|
<key alias="linkToMedia">メディアへリンク</key>
|
||||||
|
|
||||||
<key alias="selectMedia">メディアの選択</key>
|
<key alias="selectMedia">メディアの選択</key>
|
||||||
<key alias="selectIcon">アイコンの選択</key>
|
<key alias="selectIcon">アイコンの選択</key>
|
||||||
<key alias="selectItem">アイテムの選択</key>
|
<key alias="selectItem">アイテムの選択</key>
|
||||||
@@ -296,19 +289,14 @@
|
|||||||
<key alias="selectContent">コンテンツの選択</key>
|
<key alias="selectContent">コンテンツの選択</key>
|
||||||
<key alias="selectMember">メンバーの選択</key>
|
<key alias="selectMember">メンバーの選択</key>
|
||||||
<key alias="selectMemberGroup">メンバー グループの選択</key>
|
<key alias="selectMemberGroup">メンバー グループの選択</key>
|
||||||
|
|
||||||
<key alias="noMacroParams">このマクロのパラメーターはありません</key>
|
<key alias="noMacroParams">このマクロのパラメーターはありません</key>
|
||||||
|
|
||||||
<key alias="externalLoginProviders">外部ログイン プロバイダー</key>
|
<key alias="externalLoginProviders">外部ログイン プロバイダー</key>
|
||||||
<key alias="exceptionDetail">例外の詳細</key>
|
<key alias="exceptionDetail">例外の詳細</key>
|
||||||
<key alias="stacktrace">スタックトレース</key>
|
<key alias="stacktrace">スタックトレース</key>
|
||||||
<key alias="innerException">Inner Exception</key>
|
<key alias="innerException">Inner Exception</key>
|
||||||
|
|
||||||
<key alias="linkYour">次をリンク:</key>
|
<key alias="linkYour">次をリンク:</key>
|
||||||
<key alias="unLinkYour">次をリンク解除:</key>
|
<key alias="unLinkYour">次をリンク解除:</key>
|
||||||
|
|
||||||
<key alias="account">アカウント</key>
|
<key alias="account">アカウント</key>
|
||||||
|
|
||||||
<key alias="selectEditor">エディターの選択</key>
|
<key alias="selectEditor">エディターの選択</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="dictionaryItem">
|
<area alias="dictionaryItem">
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
<key alias="disable">Deaktywuj</key>
|
<key alias="disable">Deaktywuj</key>
|
||||||
<key alias="emptyTrashcan">Opróżnij kosz</key>
|
<key alias="emptyTrashcan">Opróżnij kosz</key>
|
||||||
<key alias="exportDocumentType">Eksportuj typ dokumentu</key>
|
<key alias="exportDocumentType">Eksportuj typ dokumentu</key>
|
||||||
<key alias="exportDocumentTypeAsCode">TRANSLATE ME: 'Export to .NET'</key>
|
<key alias="exportDocumentTypeAsCode">Ekspo .NET'</key>
|
||||||
<key alias="exportDocumentTypeAsCode-Full">TRANSLATE ME: 'Export to .NET'</key>
|
<key alias="exportDocumentTypeAsCode-Full">Eksportuj do .NET'</key>
|
||||||
<key alias="importDocumentType">Importuj typ dokumentu</key>
|
<key alias="importDocumentType">Importuj typ dokumentu</key>
|
||||||
<key alias="importPackage">Importuj zbiór</key>
|
<key alias="importPackage">Importuj zbiór</key>
|
||||||
<key alias="liveEdit">Edytuj na stronie</key>
|
<key alias="liveEdit">Edytuj na stronie</key>
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
</area>
|
</area>
|
||||||
<area alias="dashboard">
|
<area alias="dashboard">
|
||||||
<key alias="browser">Przeglądaj swoją stronę</key>
|
<key alias="browser">Przeglądaj swoją stronę</key>
|
||||||
<key alias="dontShowAgain">TRANSLATE ME: '- Hide'</key>
|
<key alias="dontShowAgain">- Ukryj</key>
|
||||||
<key alias="nothinghappens">Jeśli Umbraco się nie otwiera, prawdopodbnie musisz zezwolić tej stronie na otwieranie wyskakujących okienek</key>
|
<key alias="nothinghappens">Jeśli Umbraco się nie otwiera, prawdopodbnie musisz zezwolić tej stronie na otwieranie wyskakujących okienek</key>
|
||||||
<key alias="openinnew">zostało otwarte w nowym oknie</key>
|
<key alias="openinnew">zostało otwarte w nowym oknie</key>
|
||||||
<key alias="restart">Restartuj</key>
|
<key alias="restart">Restartuj</key>
|
||||||
@@ -168,7 +168,7 @@
|
|||||||
<key alias="confirmEmptyTrashcan">Proszę zaznaczyć, aby potwierdzić usunięcie %0% elementów.</key>
|
<key alias="confirmEmptyTrashcan">Proszę zaznaczyć, aby potwierdzić usunięcie %0% elementów.</key>
|
||||||
<key alias="confirmlogout">Jesteś pewny?</key>
|
<key alias="confirmlogout">Jesteś pewny?</key>
|
||||||
<key alias="confirmSure">Jesteś pewny?</key>
|
<key alias="confirmSure">Jesteś pewny?</key>
|
||||||
<key alias="cut">TRANSLATE ME: 'Cut'</key>
|
<key alias="cut">Wytnij</key>
|
||||||
<key alias="editdictionary">Edytuj element słownika</key>
|
<key alias="editdictionary">Edytuj element słownika</key>
|
||||||
<key alias="editlanguage">Edytuj język</key>
|
<key alias="editlanguage">Edytuj język</key>
|
||||||
<key alias="insertAnchor">Wstaw link wewnętrzny</key>
|
<key alias="insertAnchor">Wstaw link wewnętrzny</key>
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
<key alias="linkinternal">Link wewnętrzny:</key>
|
<key alias="linkinternal">Link wewnętrzny:</key>
|
||||||
<key alias="linklocaltip">Kiedy używasz odnośników lokalnych, wstaw znak "#" na początku linku</key>
|
<key alias="linklocaltip">Kiedy używasz odnośników lokalnych, wstaw znak "#" na początku linku</key>
|
||||||
<key alias="linknewwindow">Otworzyć w nowym oknie?</key>
|
<key alias="linknewwindow">Otworzyć w nowym oknie?</key>
|
||||||
<key alias="macroContainerSettings">TRANSLATE ME: 'Macro Settings'</key>
|
<key alias="macroContainerSettings">Ustawienia Makra</key>
|
||||||
<key alias="macroDoesNotHaveProperties">To makro nie posiada żadnych właściwości, które można edytować</key>
|
<key alias="macroDoesNotHaveProperties">To makro nie posiada żadnych właściwości, które można edytować</key>
|
||||||
<key alias="paste">Wklej</key>
|
<key alias="paste">Wklej</key>
|
||||||
<key alias="permissionsEdit">Edytuj Uprawnienia dla</key>
|
<key alias="permissionsEdit">Edytuj Uprawnienia dla</key>
|
||||||
@@ -192,7 +192,7 @@
|
|||||||
<key alias="recycleBinWarning">Usunięcie elementów z kosza powoduje ich trwałe i nieodwracalne skasowanie</key>
|
<key alias="recycleBinWarning">Usunięcie elementów z kosza powoduje ich trwałe i nieodwracalne skasowanie</key>
|
||||||
<key alias="regexSearchError"><![CDATA[Serwis <a target='_blank' href='http://regexlib.com'>regexlib.com</a> aktulanie nie jest dostępny, na co nie mamy wpływu. Bardzo przepraszamy za te utrudnienia.]]></key>
|
<key alias="regexSearchError"><![CDATA[Serwis <a target='_blank' href='http://regexlib.com'>regexlib.com</a> aktulanie nie jest dostępny, na co nie mamy wpływu. Bardzo przepraszamy za te utrudnienia.]]></key>
|
||||||
<key alias="regexSearchHelp">Przeszukaj dla wyrażeń regularnych aby dodać regułę sprawdzającą do formularza. Np. 'email' 'url'</key>
|
<key alias="regexSearchHelp">Przeszukaj dla wyrażeń regularnych aby dodać regułę sprawdzającą do formularza. Np. 'email' 'url'</key>
|
||||||
<key alias="removeMacro">TRANSLATE ME: 'Remove Macro'</key>
|
<key alias="removeMacro">Usuń Makro</key>
|
||||||
<key alias="requiredField">Pole wymagane</key>
|
<key alias="requiredField">Pole wymagane</key>
|
||||||
<key alias="sitereindexed">Strona została przeindeksowana</key>
|
<key alias="sitereindexed">Strona została przeindeksowana</key>
|
||||||
<key alias="siterepublished">Cache strony zostało odświeżone. Cała opublikowana zawartość jest teraz aktualna. Natomiast cała nieopublikowana zawartość ciągle nie jest widoczna</key>
|
<key alias="siterepublished">Cache strony zostało odświeżone. Cała opublikowana zawartość jest teraz aktualna. Natomiast cała nieopublikowana zawartość ciągle nie jest widoczna</key>
|
||||||
@@ -222,7 +222,7 @@ Możesz dodać dodatkowe języki w menu "Języki" po lewej stronie.]]></key>
|
|||||||
<area alias="editdatatype">
|
<area alias="editdatatype">
|
||||||
<key alias="addPrevalue">Dodaj wartość</key>
|
<key alias="addPrevalue">Dodaj wartość</key>
|
||||||
<key alias="dataBaseDatatype">Typ bazydanych</key>
|
<key alias="dataBaseDatatype">Typ bazydanych</key>
|
||||||
<key alias="guid">TRANSLATE ME: 'Data Editor GUID'</key>
|
<key alias="guid">Edytor GUID</key>
|
||||||
<key alias="renderControl">Renderuj kontrolkę</key>
|
<key alias="renderControl">Renderuj kontrolkę</key>
|
||||||
<key alias="rteButtons">Przyciski</key>
|
<key alias="rteButtons">Przyciski</key>
|
||||||
<key alias="rteEnableAdvancedSettings">Włącz ustawienia zaawansowane dla</key>
|
<key alias="rteEnableAdvancedSettings">Włącz ustawienia zaawansowane dla</key>
|
||||||
@@ -235,7 +235,7 @@ Możesz dodać dodatkowe języki w menu "Języki" po lewej stronie.]]></key>
|
|||||||
<area alias="errorHandling">
|
<area alias="errorHandling">
|
||||||
<key alias="errorButDataWasSaved">Dane zostały zapisane, lecz wystąpiły błędy które musisz poprawić przed publikacją strony:</key>
|
<key alias="errorButDataWasSaved">Dane zostały zapisane, lecz wystąpiły błędy które musisz poprawić przed publikacją strony:</key>
|
||||||
<key alias="errorChangingProviderPassword">Bieżący dostawca Membership nie obsługuje zmiany hasła (EnablePasswordRetrieval musi mieć wartość true)</key>
|
<key alias="errorChangingProviderPassword">Bieżący dostawca Membership nie obsługuje zmiany hasła (EnablePasswordRetrieval musi mieć wartość true)</key>
|
||||||
<key alias="errorExistsWithoutTab">TRANSLATE ME: '%0% already exists'</key>
|
<key alias="errorExistsWithoutTab">%0% już istnieje</key>
|
||||||
<key alias="errorHeader">Wystąpiły błędy:</key>
|
<key alias="errorHeader">Wystąpiły błędy:</key>
|
||||||
<key alias="errorHeaderWithoutTab">Wystąpiły błędy:</key>
|
<key alias="errorHeaderWithoutTab">Wystąpiły błędy:</key>
|
||||||
<key alias="errorInPasswordFormat">Hasło powinno mieć minimum %0% znaków, i zawierać co najmniej %1% niealfanumeryczny znak</key>
|
<key alias="errorInPasswordFormat">Hasło powinno mieć minimum %0% znaków, i zawierać co najmniej %1% niealfanumeryczny znak</key>
|
||||||
@@ -308,7 +308,7 @@ Możesz dodać dodatkowe języki w menu "Języki" po lewej stronie.]]></key>
|
|||||||
<key alias="language">Język</key>
|
<key alias="language">Język</key>
|
||||||
<key alias="layout">układ</key>
|
<key alias="layout">układ</key>
|
||||||
<key alias="loading">Ładowanie</key>
|
<key alias="loading">Ładowanie</key>
|
||||||
<key alias="locked">TRANSLATE ME: 'Locked'</key>
|
<key alias="locked">Zablokowany</key>
|
||||||
<key alias="login">Zaloguj</key>
|
<key alias="login">Zaloguj</key>
|
||||||
<key alias="logoff">Wyloguj</key>
|
<key alias="logoff">Wyloguj</key>
|
||||||
<key alias="logout">Wyloguj</key>
|
<key alias="logout">Wyloguj</key>
|
||||||
@@ -332,7 +332,7 @@ Możesz dodać dodatkowe języki w menu "Języki" po lewej stronie.]]></key>
|
|||||||
<key alias="recycleBin">Kosz</key>
|
<key alias="recycleBin">Kosz</key>
|
||||||
<key alias="remaining">Pozostało</key>
|
<key alias="remaining">Pozostało</key>
|
||||||
<key alias="rename">Zmień nazwę</key>
|
<key alias="rename">Zmień nazwę</key>
|
||||||
<key alias="renew">TRANSLATE ME: 'Renew'</key>
|
<key alias="renew">Odnów</key>
|
||||||
<key alias="retry">Ponów próbę</key>
|
<key alias="retry">Ponów próbę</key>
|
||||||
<key alias="rights">Uprawnienia</key>
|
<key alias="rights">Uprawnienia</key>
|
||||||
<key alias="search">Szukaj</key>
|
<key alias="search">Szukaj</key>
|
||||||
@@ -341,7 +341,7 @@ Możesz dodać dodatkowe języki w menu "Języki" po lewej stronie.]]></key>
|
|||||||
<key alias="showPageOnSend">Pokaż stronę "wyślij"</key>
|
<key alias="showPageOnSend">Pokaż stronę "wyślij"</key>
|
||||||
<key alias="size">Rozmiar</key>
|
<key alias="size">Rozmiar</key>
|
||||||
<key alias="sort">Sortuj</key>
|
<key alias="sort">Sortuj</key>
|
||||||
<key alias="submit">Submit</key> <!-- TODO: Translate this -->
|
<key alias="submit">Zatwierdź</key>
|
||||||
<key alias="type">Typ</key>
|
<key alias="type">Typ</key>
|
||||||
<key alias="typeToSearch">Szukaj</key>
|
<key alias="typeToSearch">Szukaj</key>
|
||||||
<key alias="up">W górę</key>
|
<key alias="up">W górę</key>
|
||||||
@@ -356,8 +356,8 @@ Możesz dodać dodatkowe języki w menu "Języki" po lewej stronie.]]></key>
|
|||||||
<key alias="welcome">Witaj...</key>
|
<key alias="welcome">Witaj...</key>
|
||||||
<key alias="width">Szerokość</key>
|
<key alias="width">Szerokość</key>
|
||||||
<key alias="yes">Tak</key>
|
<key alias="yes">Tak</key>
|
||||||
<key alias="reorder">Reorder</key>
|
<key alias="reorder">Zmień kolejność</key>
|
||||||
<key alias="reorderDone">I am done reordering</key>
|
<key alias="reorderDone">Kolejność została zmieniona</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="graphicheadline">
|
<area alias="graphicheadline">
|
||||||
<key alias="backgroundcolor">Kolor tła</key>
|
<key alias="backgroundcolor">Kolor tła</key>
|
||||||
@@ -786,7 +786,7 @@ Miłego dnia!]]></key>
|
|||||||
<area alias="user">
|
<area alias="user">
|
||||||
<key alias="administrators">Administrator</key>
|
<key alias="administrators">Administrator</key>
|
||||||
<key alias="categoryField">Pole kategorii</key>
|
<key alias="categoryField">Pole kategorii</key>
|
||||||
<key alias="changePassword">TRANSLATE ME: 'Change Your Password'</key>
|
<key alias="changePassword">Zmień hasło!</key>
|
||||||
<key alias="changePasswordDescription">TRANSLATE ME: 'You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button'</key>
|
<key alias="changePasswordDescription">TRANSLATE ME: 'You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button'</key>
|
||||||
<key alias="contentChannel">Zawartość</key>
|
<key alias="contentChannel">Zawartość</key>
|
||||||
<key alias="descriptionField">Opis</key>
|
<key alias="descriptionField">Opis</key>
|
||||||
@@ -800,10 +800,10 @@ Miłego dnia!]]></key>
|
|||||||
<key alias="modules">Sekcje</key>
|
<key alias="modules">Sekcje</key>
|
||||||
<key alias="noConsole">Wyłącz dostęp do Umbraco</key>
|
<key alias="noConsole">Wyłącz dostęp do Umbraco</key>
|
||||||
<key alias="password">Hasło</key>
|
<key alias="password">Hasło</key>
|
||||||
<key alias="passwordChanged">TRANSLATE ME: 'Your password has been changed!'</key>
|
<key alias="passwordChanged">Twoje hasło zostało zmienione!</key>
|
||||||
<key alias="passwordConfirm">TRANSLATE ME: 'Please confirm the new password'</key>
|
<key alias="passwordConfirm">Proszę potwierdź nowe hasło!</key>
|
||||||
<key alias="passwordEnterNew">TRANSLATE ME: 'Enter your new password'</key>
|
<key alias="passwordEnterNew">Wprowadź nowe hasło</key>
|
||||||
<key alias="passwordIsBlank">TRANSLATE ME: 'Your new password cannot be blank!'</key>
|
<key alias="passwordIsBlank">Nowe hasło nie może byc puste!</key>
|
||||||
<key alias="passwordIsDifferent">TRANSLATE ME: 'There was a difference between the new password and the confirmed password. Please try again!'</key>
|
<key alias="passwordIsDifferent">TRANSLATE ME: 'There was a difference between the new password and the confirmed password. Please try again!'</key>
|
||||||
<key alias="passwordMismatch">TRANSLATE ME: 'The confirmed password doesn't match the new password!'</key>
|
<key alias="passwordMismatch">TRANSLATE ME: 'The confirmed password doesn't match the new password!'</key>
|
||||||
<key alias="permissionReplaceChildren">Zastąp prawa dostępu dla węzłów potomnych</key>
|
<key alias="permissionReplaceChildren">Zastąp prawa dostępu dla węzłów potomnych</key>
|
||||||
|
|||||||
@@ -340,18 +340,11 @@
|
|||||||
<key alias="treepicker">Выберите элемент</key>
|
<key alias="treepicker">Выберите элемент</key>
|
||||||
<key alias="viewCacheItem">Просмотр элемента кэша</key>
|
<key alias="viewCacheItem">Просмотр элемента кэша</key>
|
||||||
<key alias="createFolder">Создать папку...</key>
|
<key alias="createFolder">Создать папку...</key>
|
||||||
|
|
||||||
<key alias="relateToOriginalLabel">Связать с оригиналом</key>
|
<key alias="relateToOriginalLabel">Связать с оригиналом</key>
|
||||||
<key alias="theFriendliestCommunity">Самое дружелюбное сообщество</key>
|
<key alias="theFriendliestCommunity">Самое дружелюбное сообщество</key>
|
||||||
|
|
||||||
<key alias="linkToPage">Ссылка на страницу</key>
|
<key alias="linkToPage">Ссылка на страницу</key>
|
||||||
|
|
||||||
<key alias="openInNewWindow">Открывает документ по ссылке в новом окне или вкладке браузера</key>
|
<key alias="openInNewWindow">Открывает документ по ссылке в новом окне или вкладке браузера</key>
|
||||||
<key alias="openInFullBody">Открывает документ по ссылке в полноэкранном режиме</key>
|
|
||||||
<key alias="openInParentFrame">Открывает документ по ссылке в родительском фрейме</key>
|
|
||||||
|
|
||||||
<key alias="linkToMedia">Ссылка на медиа-файл</key>
|
<key alias="linkToMedia">Ссылка на медиа-файл</key>
|
||||||
|
|
||||||
<key alias="selectMedia">Выбрать медиа</key>
|
<key alias="selectMedia">Выбрать медиа</key>
|
||||||
<key alias="selectIcon">Выбрать значок</key>
|
<key alias="selectIcon">Выбрать значок</key>
|
||||||
<key alias="selectItem">Выбрать элемент</key>
|
<key alias="selectItem">Выбрать элемент</key>
|
||||||
@@ -360,19 +353,14 @@
|
|||||||
<key alias="selectContent">Выбрать содержимое</key>
|
<key alias="selectContent">Выбрать содержимое</key>
|
||||||
<key alias="selectMember">Выбрать участника</key>
|
<key alias="selectMember">Выбрать участника</key>
|
||||||
<key alias="selectMemberGroup">Выбрать группу участников</key>
|
<key alias="selectMemberGroup">Выбрать группу участников</key>
|
||||||
|
|
||||||
<key alias="noMacroParams">Это макрос без параметров</key>
|
<key alias="noMacroParams">Это макрос без параметров</key>
|
||||||
|
|
||||||
<key alias="externalLoginProviders">Провайдеры аутентификации</key>
|
<key alias="externalLoginProviders">Провайдеры аутентификации</key>
|
||||||
<key alias="exceptionDetail">Подробное сообщение об ошибке</key>
|
<key alias="exceptionDetail">Подробное сообщение об ошибке</key>
|
||||||
<key alias="stacktrace">Трассировка стека</key>
|
<key alias="stacktrace">Трассировка стека</key>
|
||||||
<key alias="innerException">Внутренняя ошибка</key>
|
<key alias="innerException">Внутренняя ошибка</key>
|
||||||
|
|
||||||
<key alias="linkYour">Связать</key>
|
<key alias="linkYour">Связать</key>
|
||||||
<key alias="unLinkYour">Разорвать связь</key>
|
<key alias="unLinkYour">Разорвать связь</key>
|
||||||
|
|
||||||
<key alias="account">учетную запись</key>
|
<key alias="account">учетную запись</key>
|
||||||
|
|
||||||
<key alias="selectEditor">Выбрать редактор</key>
|
<key alias="selectEditor">Выбрать редактор</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="dictionaryItem">
|
<area alias="dictionaryItem">
|
||||||
@@ -380,6 +368,12 @@
|
|||||||
Ниже Вы можете указать различные переводы данной статьи словаря '<em>%0%</em>'<br/>Добавить другие языки можно, воспользовавшись пунктом 'Языки' в меню слева
|
Ниже Вы можете указать различные переводы данной статьи словаря '<em>%0%</em>'<br/>Добавить другие языки можно, воспользовавшись пунктом 'Языки' в меню слева
|
||||||
]]></key>
|
]]></key>
|
||||||
<key alias="displayName">Название языка (культуры)</key>
|
<key alias="displayName">Название языка (культуры)</key>
|
||||||
|
<key alias="changeKey">Редактировать элемент (ключ) словаря</key>
|
||||||
|
<key alias="changeKeyError">
|
||||||
|
<![CDATA[
|
||||||
|
Ключ '%0%' уже существует в словаре.
|
||||||
|
]]>
|
||||||
|
</key>
|
||||||
</area>
|
</area>
|
||||||
<area alias="editcontenttype">
|
<area alias="editcontenttype">
|
||||||
<key alias="allowAtRoot" version="7.2">Допустим как корневой</key>
|
<key alias="allowAtRoot" version="7.2">Допустим как корневой</key>
|
||||||
@@ -655,7 +649,7 @@
|
|||||||
<key alias="xmlDataIntegrityCheckMedia">Медиа - всего в XML: %0%, всего: %1%Б с ошибками: %2%</key>
|
<key alias="xmlDataIntegrityCheckMedia">Медиа - всего в XML: %0%, всего: %1%Б с ошибками: %2%</key>
|
||||||
<key alias="xmlDataIntegrityCheckContent">Содержимое - всего в XML: %0%, всего опубликовано: %1%, с ошибками: %2%</key>
|
<key alias="xmlDataIntegrityCheckContent">Содержимое - всего в XML: %0%, всего опубликовано: %1%, с ошибками: %2%</key>
|
||||||
|
|
||||||
<key alias="httpsCheckValidCertificate">Сертификат Вашего сайта отмечен как проверенный.</key>
|
<key alias="httpsCheckValidCertificate">Сертификат Вашего веб-сайта отмечен как проверенный.</key>
|
||||||
<key alias="httpsCheckInvalidCertificate">Ошибка проверки сертификата: '%0%'</key>
|
<key alias="httpsCheckInvalidCertificate">Ошибка проверки сертификата: '%0%'</key>
|
||||||
<key alias="httpsCheckInvalidUrl">Ошибка проверки адреса URL %0% - '%1%'</key>
|
<key alias="httpsCheckInvalidUrl">Ошибка проверки адреса URL %0% - '%1%'</key>
|
||||||
<key alias="httpsCheckIsCurrentSchemeHttps">Сейчас Вы %0% просматриваете сайт, используя протокол HTTPS.</key>
|
<key alias="httpsCheckIsCurrentSchemeHttps">Сейчас Вы %0% просматриваете сайт, используя протокол HTTPS.</key>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
ControlToValidate="Email" ValidateEmptyText="false" OnServerValidate="EmailExistsCheck"></asp:CustomValidator>
|
ControlToValidate="Email" ValidateEmptyText="false" OnServerValidate="EmailExistsCheck"></asp:CustomValidator>
|
||||||
<asp:CustomValidator runat="server" ID="EmailValidator" OnServerValidate="EmailValidator_OnServerValidate"
|
<asp:CustomValidator runat="server" ID="EmailValidator" OnServerValidate="EmailValidator_OnServerValidate"
|
||||||
ControlToValidate="Email"
|
ControlToValidate="Email"
|
||||||
ErrorMessage="Invalid email address"
|
ErrorMessage='<%#ui.Text("errorHandling", "errorRegExpWithoutTab", "E-mail", CurrentUser) %>'
|
||||||
Display="None" />
|
Display="None" />
|
||||||
<br />
|
<br />
|
||||||
<asp:TextBox ID="Email" runat="server" Width="350px" CssClass="bigInput"></asp:TextBox>
|
<asp:TextBox ID="Email" runat="server" Width="350px" CssClass="bigInput"></asp:TextBox>
|
||||||
|
|||||||
@@ -1285,7 +1285,7 @@ angular.module("umbraco").controller("Umbraco.Dialogs.MacroPickerController", fu
|
|||||||
//used for the media picker dialog
|
//used for the media picker dialog
|
||||||
angular.module("umbraco")
|
angular.module("umbraco")
|
||||||
.controller("Umbraco.Dialogs.MediaPickerController",
|
.controller("Umbraco.Dialogs.MediaPickerController",
|
||||||
function ($scope, mediaResource, umbRequestHelper, entityResource, $log, mediaHelper, eventsService, treeService, $cookies, $element, $timeout) {
|
function($scope, mediaResource, umbRequestHelper, entityResource, $log, mediaHelper, mediaTypeHelper, eventsService, treeService) {
|
||||||
|
|
||||||
var dialogOptions = $scope.dialogOptions;
|
var dialogOptions = $scope.dialogOptions;
|
||||||
|
|
||||||
@@ -1295,29 +1295,34 @@ angular.module("umbraco")
|
|||||||
$scope.startNodeId = dialogOptions.startNodeId ? dialogOptions.startNodeId : -1;
|
$scope.startNodeId = dialogOptions.startNodeId ? dialogOptions.startNodeId : -1;
|
||||||
$scope.cropSize = dialogOptions.cropSize;
|
$scope.cropSize = dialogOptions.cropSize;
|
||||||
|
|
||||||
|
|
||||||
//preload selected item
|
//preload selected item
|
||||||
$scope.target = undefined;
|
$scope.target = undefined;
|
||||||
if(dialogOptions.currentTarget){
|
if (dialogOptions.currentTarget) {
|
||||||
$scope.target = dialogOptions.currentTarget;
|
$scope.target = dialogOptions.currentTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.upload = function(v){
|
$scope.acceptedMediatypes = [];
|
||||||
angular.element(".umb-file-dropzone-directive .file-select").click();
|
mediaTypeHelper.getAllowedImagetypes($scope.startNodeId)
|
||||||
|
.then(function(types) {
|
||||||
|
$scope.acceptedMediatypes = types;
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.upload = function(v) {
|
||||||
|
angular.element(".umb-file-dropzone-directive .file-select").click();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.dragLeave = function(el, event){
|
$scope.dragLeave = function(el, event) {
|
||||||
$scope.activeDrag = false;
|
$scope.activeDrag = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.dragEnter = function(el, event){
|
$scope.dragEnter = function(el, event) {
|
||||||
$scope.activeDrag = true;
|
$scope.activeDrag = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.submitFolder = function(e) {
|
$scope.submitFolder = function(e) {
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
mediaResource
|
mediaResource
|
||||||
.addFolder($scope.newFolderName, $scope.currentFolder.id)
|
.addFolder($scope.newFolderName, $scope.currentFolder.id)
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
@@ -1336,21 +1341,25 @@ angular.module("umbraco")
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.gotoFolder = function(folder) {
|
$scope.gotoFolder = function(folder) {
|
||||||
|
if (!folder) {
|
||||||
if(!folder){
|
folder = { id: -1, name: "Media", icon: "icon-folder" };
|
||||||
folder = {id: -1, name: "Media", icon: "icon-folder"};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (folder.id > 0) {
|
if (folder.id > 0) {
|
||||||
entityResource.getAncestors(folder.id, "media")
|
entityResource.getAncestors(folder.id, "media")
|
||||||
.then(function(anc) {
|
.then(function(anc) {
|
||||||
// anc.splice(0,1);
|
// anc.splice(0,1);
|
||||||
$scope.path = _.filter(anc, function (f) {
|
$scope.path = _.filter(anc,
|
||||||
return f.path.indexOf($scope.startNodeId) !== -1;
|
function(f) {
|
||||||
});
|
return f.path.indexOf($scope.startNodeId) !== -1;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
else {
|
mediaTypeHelper.getAllowedImagetypes(folder.id)
|
||||||
|
.then(function(types) {
|
||||||
|
$scope.acceptedMediatypes = types;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
$scope.path = [];
|
$scope.path = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1361,50 +1370,50 @@ angular.module("umbraco")
|
|||||||
$scope.images = data.items ? data.items : [];
|
$scope.images = data.items ? data.items : [];
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.currentFolder = folder;
|
$scope.currentFolder = folder;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$scope.clickHandler = function(image, ev, select) {
|
$scope.clickHandler = function(image, ev, select) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
if (image.isFolder && !select) {
|
if (image.isFolder && !select) {
|
||||||
$scope.gotoFolder(image);
|
$scope.gotoFolder(image);
|
||||||
}else{
|
} else {
|
||||||
eventsService.emit("dialogs.mediaPicker.select", image);
|
eventsService.emit("dialogs.mediaPicker.select", image);
|
||||||
|
|
||||||
//we have 3 options add to collection (if multi) show details, or submit it right back to the callback
|
//we have 3 options add to collection (if multi) show details, or submit it right back to the callback
|
||||||
if ($scope.multiPicker) {
|
if ($scope.multiPicker) {
|
||||||
$scope.select(image);
|
$scope.select(image);
|
||||||
image.cssclass = ($scope.dialogData.selection.indexOf(image) > -1) ? "selected" : "";
|
image.cssclass = ($scope.dialogData.selection.indexOf(image) > -1) ? "selected" : "";
|
||||||
}else if($scope.showDetails) {
|
} else if ($scope.showDetails) {
|
||||||
$scope.target= image;
|
$scope.target = image;
|
||||||
$scope.target.url = mediaHelper.resolveFile(image);
|
$scope.target.url = mediaHelper.resolveFile(image);
|
||||||
}else{
|
} else {
|
||||||
$scope.submit(image);
|
$scope.submit(image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.exitDetails = function(){
|
$scope.exitDetails = function() {
|
||||||
if(!$scope.currentFolder){
|
if (!$scope.currentFolder) {
|
||||||
$scope.gotoFolder();
|
$scope.gotoFolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.target = undefined;
|
$scope.target = undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.onUploadComplete = function () {
|
$scope.onUploadComplete = function() {
|
||||||
$scope.gotoFolder($scope.currentFolder);
|
$scope.gotoFolder($scope.currentFolder);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.onFilesQueue = function(){
|
$scope.onFilesQueue = function() {
|
||||||
$scope.activeDrag = false;
|
$scope.activeDrag = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
//default root item
|
//default root item
|
||||||
if(!$scope.target){
|
if (!$scope.target) {
|
||||||
$scope.gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" });
|
$scope.gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//used for the member picker dialog
|
//used for the member picker dialog
|
||||||
@@ -1895,7 +1904,7 @@ angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController",
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var a = dialogOptions.filter.toLowerCase().split(',');
|
var a = dialogOptions.filter.toLowerCase().replace(/\s/g, '').split(',');
|
||||||
angular.forEach(nodes, function (value, key) {
|
angular.forEach(nodes, function (value, key) {
|
||||||
|
|
||||||
var found = a.indexOf(value.metaData.contentType.toLowerCase()) >= 0;
|
var found = a.indexOf(value.metaData.contentType.toLowerCase()) >= 0;
|
||||||
@@ -3386,9 +3395,9 @@ angular.module("umbraco").controller("Umbraco.Overlays.MacroPickerController", M
|
|||||||
//used for the media picker dialog
|
//used for the media picker dialog
|
||||||
angular.module("umbraco")
|
angular.module("umbraco")
|
||||||
.controller("Umbraco.Overlays.MediaPickerController",
|
.controller("Umbraco.Overlays.MediaPickerController",
|
||||||
function ($scope, mediaResource, umbRequestHelper, entityResource, $log, mediaHelper, eventsService, treeService, $element, $timeout, $cookies, $cookieStore, localizationService) {
|
function($scope, mediaResource, umbRequestHelper, entityResource, $log, mediaHelper, mediaTypeHelper, eventsService, treeService, $element, $timeout, $cookies, $cookieStore, localizationService) {
|
||||||
|
|
||||||
if(!$scope.model.title) {
|
if (!$scope.model.title) {
|
||||||
$scope.model.title = localizationService.localize("defaultdialogs_selectMedia");
|
$scope.model.title = localizationService.localize("defaultdialogs_selectMedia");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3401,60 +3410,59 @@ angular.module("umbraco")
|
|||||||
$scope.startNodeId = dialogOptions.startNodeId ? dialogOptions.startNodeId : -1;
|
$scope.startNodeId = dialogOptions.startNodeId ? dialogOptions.startNodeId : -1;
|
||||||
$scope.cropSize = dialogOptions.cropSize;
|
$scope.cropSize = dialogOptions.cropSize;
|
||||||
$scope.lastOpenedNode = $cookieStore.get("umbLastOpenedMediaNodeId");
|
$scope.lastOpenedNode = $cookieStore.get("umbLastOpenedMediaNodeId");
|
||||||
if($scope.onlyImages){
|
if ($scope.onlyImages) {
|
||||||
$scope.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes);
|
$scope.acceptedFileTypes = mediaHelper
|
||||||
}
|
.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes);
|
||||||
else {
|
} else {
|
||||||
$scope.acceptedFileTypes = !mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles);
|
$scope.acceptedFileTypes = !mediaHelper
|
||||||
|
.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles);
|
||||||
}
|
}
|
||||||
$scope.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB";
|
$scope.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB";
|
||||||
|
|
||||||
$scope.model.selectedImages = [];
|
$scope.model.selectedImages = [];
|
||||||
|
|
||||||
|
$scope.acceptedMediatypes = [];
|
||||||
|
mediaTypeHelper.getAllowedImagetypes($scope.startNodeId)
|
||||||
|
.then(function(types) {
|
||||||
|
$scope.acceptedMediatypes = types;
|
||||||
|
});
|
||||||
|
|
||||||
//preload selected item
|
//preload selected item
|
||||||
$scope.target = undefined;
|
$scope.target = undefined;
|
||||||
if(dialogOptions.currentTarget){
|
if (dialogOptions.currentTarget) {
|
||||||
$scope.target = dialogOptions.currentTarget;
|
$scope.target = dialogOptions.currentTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.upload = function(v){
|
$scope.upload = function(v) {
|
||||||
angular.element(".umb-file-dropzone-directive .file-select").click();
|
angular.element(".umb-file-dropzone-directive .file-select").click();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.dragLeave = function(el, event){
|
$scope.dragLeave = function(el, event) {
|
||||||
$scope.activeDrag = false;
|
$scope.activeDrag = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.dragEnter = function(el, event){
|
$scope.dragEnter = function(el, event) {
|
||||||
$scope.activeDrag = true;
|
$scope.activeDrag = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.submitFolder = function() {
|
$scope.submitFolder = function() {
|
||||||
|
if ($scope.newFolderName) {
|
||||||
|
mediaResource
|
||||||
|
.addFolder($scope.newFolderName, $scope.currentFolder.id)
|
||||||
|
.then(function(data) {
|
||||||
|
//we've added a new folder so lets clear the tree cache for that specific item
|
||||||
|
treeService.clearCache({
|
||||||
|
cacheKey: "__media", //this is the main media tree cache key
|
||||||
|
childrenOf: data.parentId //clear the children of the parent
|
||||||
|
});
|
||||||
|
|
||||||
if ($scope.newFolderName) {
|
$scope.gotoFolder(data);
|
||||||
|
$scope.showFolderInput = false;
|
||||||
mediaResource
|
$scope.newFolderName = "";
|
||||||
.addFolder($scope.newFolderName, $scope.currentFolder.id)
|
|
||||||
.then(function(data) {
|
|
||||||
|
|
||||||
//we've added a new folder so lets clear the tree cache for that specific item
|
|
||||||
treeService.clearCache({
|
|
||||||
cacheKey: "__media", //this is the main media tree cache key
|
|
||||||
childrenOf: data.parentId //clear the children of the parent
|
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
$scope.gotoFolder(data);
|
$scope.showFolderInput = false;
|
||||||
|
}
|
||||||
$scope.showFolderInput = false;
|
|
||||||
|
|
||||||
$scope.newFolderName = "";
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$scope.showFolderInput = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.enterSubmitFolder = function(event) {
|
$scope.enterSubmitFolder = function(event) {
|
||||||
@@ -3466,58 +3474,61 @@ angular.module("umbraco")
|
|||||||
|
|
||||||
$scope.gotoFolder = function(folder) {
|
$scope.gotoFolder = function(folder) {
|
||||||
|
|
||||||
if(!$scope.multiPicker) {
|
if (!$scope.multiPicker) {
|
||||||
deselectAllImages($scope.model.selectedImages);
|
deselectAllImages($scope.model.selectedImages);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!folder){
|
if (!folder) {
|
||||||
folder = {id: -1, name: "Media", icon: "icon-folder"};
|
folder = { id: -1, name: "Media", icon: "icon-folder" };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (folder.id > 0) {
|
if (folder.id > 0) {
|
||||||
entityResource.getAncestors(folder.id, "media")
|
entityResource.getAncestors(folder.id, "media")
|
||||||
.then(function(anc) {
|
.then(function(anc) {
|
||||||
// anc.splice(0,1);
|
// anc.splice(0,1);
|
||||||
$scope.path = _.filter(anc, function (f) {
|
$scope.path = _.filter(anc,
|
||||||
return f.path.indexOf($scope.startNodeId) !== -1;
|
function(f) {
|
||||||
});
|
return f.path.indexOf($scope.startNodeId) !== -1;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
else {
|
mediaTypeHelper.getAllowedImagetypes(folder.id)
|
||||||
|
.then(function(types) {
|
||||||
|
$scope.acceptedMediatypes = types;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
$scope.path = [];
|
$scope.path = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
//mediaResource.rootMedia()
|
//mediaResource.rootMedia()
|
||||||
mediaResource.getChildren(folder.id)
|
mediaResource.getChildren(folder.id)
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
$scope.searchTerm = "";
|
$scope.searchTerm = "";
|
||||||
$scope.images = data.items ? data.items : [];
|
$scope.images = data.items ? data.items : [];
|
||||||
|
|
||||||
// set already selected images to selected
|
// set already selected images to selected
|
||||||
for (var folderImageIndex = 0; folderImageIndex < $scope.images.length; folderImageIndex++) {
|
for (var folderImageIndex = 0; folderImageIndex < $scope.images.length; folderImageIndex++) {
|
||||||
|
var folderImage = $scope.images[folderImageIndex];
|
||||||
|
var imageIsSelected = false;
|
||||||
|
|
||||||
var folderImage = $scope.images[folderImageIndex];
|
for (var selectedImageIndex = 0;
|
||||||
var imageIsSelected = false;
|
selectedImageIndex < $scope.model.selectedImages.length;
|
||||||
|
selectedImageIndex++) {
|
||||||
|
var selectedImage = $scope.model.selectedImages[selectedImageIndex];
|
||||||
|
|
||||||
for (var selectedImageIndex = 0; selectedImageIndex < $scope.model.selectedImages.length; selectedImageIndex++) {
|
if (folderImage.key === selectedImage.key) {
|
||||||
var selectedImage = $scope.model.selectedImages[selectedImageIndex];
|
imageIsSelected = true;
|
||||||
|
}
|
||||||
if(folderImage.key === selectedImage.key) {
|
|
||||||
imageIsSelected = true;
|
|
||||||
}
|
}
|
||||||
}
|
if (imageIsSelected) {
|
||||||
|
folderImage.selected = true;
|
||||||
if(imageIsSelected) {
|
}
|
||||||
folderImage.selected = true;
|
}
|
||||||
}
|
});
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.currentFolder = folder;
|
$scope.currentFolder = folder;
|
||||||
|
|
||||||
// for some reason i cannot set cookies with cookieStore
|
// for some reason i cannot set cookies with cookieStore
|
||||||
document.cookie="umbLastOpenedMediaNodeId=" + folder.id;
|
document.cookie = "umbLastOpenedMediaNodeId=" + folder.id;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3529,52 +3540,40 @@ angular.module("umbraco")
|
|||||||
eventsService.emit("dialogs.mediaPicker.select", image);
|
eventsService.emit("dialogs.mediaPicker.select", image);
|
||||||
selectImage(image);
|
selectImage(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
eventsService.emit("dialogs.mediaPicker.select", image);
|
eventsService.emit("dialogs.mediaPicker.select", image);
|
||||||
|
if ($scope.showDetails) {
|
||||||
if($scope.showDetails) {
|
|
||||||
$scope.target = image;
|
$scope.target = image;
|
||||||
$scope.target.url = mediaHelper.resolveFile(image);
|
$scope.target.url = mediaHelper.resolveFile(image);
|
||||||
$scope.openDetailsDialog();
|
$scope.openDetailsDialog();
|
||||||
} else {
|
} else {
|
||||||
selectImage(image);
|
selectImage(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.clickItemName = function(item) {
|
$scope.clickItemName = function(item) {
|
||||||
if(item.isFolder) {
|
if (item.isFolder) {
|
||||||
$scope.gotoFolder(item);
|
$scope.gotoFolder(item);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function selectImage(image) {
|
function selectImage(image) {
|
||||||
|
if (image.selected) {
|
||||||
if(image.selected) {
|
for (var i = 0; $scope.model.selectedImages.length > i; i++) {
|
||||||
|
|
||||||
for(var i = 0; $scope.model.selectedImages.length > i; i++) {
|
|
||||||
|
|
||||||
var imageInSelection = $scope.model.selectedImages[i];
|
var imageInSelection = $scope.model.selectedImages[i];
|
||||||
if(image.key === imageInSelection.key) {
|
if (image.key === imageInSelection.key) {
|
||||||
image.selected = false;
|
image.selected = false;
|
||||||
$scope.model.selectedImages.splice(i, 1);
|
$scope.model.selectedImages.splice(i, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if (!$scope.multiPicker) {
|
||||||
if(!$scope.multiPicker) {
|
|
||||||
deselectAllImages($scope.model.selectedImages);
|
deselectAllImages($scope.model.selectedImages);
|
||||||
}
|
}
|
||||||
|
|
||||||
image.selected = true;
|
image.selected = true;
|
||||||
$scope.model.selectedImages.push(image);
|
$scope.model.selectedImages.push(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function deselectAllImages(images) {
|
function deselectAllImages(images) {
|
||||||
@@ -3585,68 +3584,68 @@ angular.module("umbraco")
|
|||||||
images.length = 0;
|
images.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.onUploadComplete = function () {
|
$scope.onUploadComplete = function() {
|
||||||
$scope.gotoFolder($scope.currentFolder);
|
$scope.gotoFolder($scope.currentFolder);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.onFilesQueue = function(){
|
$scope.onFilesQueue = function() {
|
||||||
$scope.activeDrag = false;
|
$scope.activeDrag = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
//default root item
|
//default root item
|
||||||
if (!$scope.target) {
|
if (!$scope.target) {
|
||||||
|
if ($scope.lastOpenedNode && $scope.lastOpenedNode !== -1) {
|
||||||
|
entityResource.getById($scope.lastOpenedNode, "media")
|
||||||
|
.then(function(node) {
|
||||||
|
// make sure that las opened node is on the same path as start node
|
||||||
|
var nodePath = node.path.split(",");
|
||||||
|
|
||||||
if($scope.lastOpenedNode && $scope.lastOpenedNode !== -1) {
|
if (nodePath.indexOf($scope.startNodeId.toString()) !== -1) {
|
||||||
|
$scope
|
||||||
entityResource.getById($scope.lastOpenedNode, "media")
|
.gotoFolder({ id: $scope.lastOpenedNode, name: "Media", icon: "icon-folder" });
|
||||||
.then(function(node){
|
} else {
|
||||||
|
$scope.gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" });
|
||||||
// make sure that las opened node is on the same path as start node
|
}
|
||||||
var nodePath = node.path.split(",");
|
},
|
||||||
|
function(err) {
|
||||||
if(nodePath.indexOf($scope.startNodeId.toString()) !== -1) {
|
$scope.gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" });
|
||||||
$scope.gotoFolder({id: $scope.lastOpenedNode, name: "Media", icon: "icon-folder"});
|
});
|
||||||
} else {
|
} else {
|
||||||
$scope.gotoFolder({id: $scope.startNodeId, name: "Media", icon: "icon-folder"});
|
$scope.gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" });
|
||||||
}
|
}
|
||||||
|
|
||||||
}, function (err) {
|
|
||||||
$scope.gotoFolder({id: $scope.startNodeId, name: "Media", icon: "icon-folder"});
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$scope.gotoFolder({id: $scope.startNodeId, name: "Media", icon: "icon-folder"});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.openDetailsDialog = function() {
|
$scope.openDetailsDialog = function() {
|
||||||
|
|
||||||
$scope.mediaPickerDetailsOverlay = {};
|
$scope.mediaPickerDetailsOverlay = {};
|
||||||
$scope.mediaPickerDetailsOverlay.show = true;
|
$scope.mediaPickerDetailsOverlay.show = true;
|
||||||
|
|
||||||
$scope.mediaPickerDetailsOverlay.submit = function(model) {
|
$scope.mediaPickerDetailsOverlay.submit = function(model) {
|
||||||
|
$scope.model.selectedImages.push($scope.target);
|
||||||
|
$scope.model.submit($scope.model);
|
||||||
|
|
||||||
$scope.model.selectedImages.push($scope.target);
|
$scope.mediaPickerDetailsOverlay.show = false;
|
||||||
$scope.model.submit($scope.model);
|
$scope.mediaPickerDetailsOverlay = null;
|
||||||
|
};
|
||||||
$scope.mediaPickerDetailsOverlay.show = false;
|
|
||||||
$scope.mediaPickerDetailsOverlay = null;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.mediaPickerDetailsOverlay.close = function(oldModel) {
|
|
||||||
$scope.mediaPickerDetailsOverlay.show = false;
|
|
||||||
$scope.mediaPickerDetailsOverlay = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
$scope.mediaPickerDetailsOverlay.close = function(oldModel) {
|
||||||
|
$scope.mediaPickerDetailsOverlay.show = false;
|
||||||
|
$scope.mediaPickerDetailsOverlay = null;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
angular.module("umbraco").controller("Umbraco.Overlays.MediaTypePickerController",
|
||||||
|
function ($scope) {
|
||||||
|
|
||||||
|
$scope.select = function(mediatype){
|
||||||
|
$scope.model.selectedType = mediatype;
|
||||||
|
$scope.model.submit($scope.model);
|
||||||
|
$scope.model.show = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
//used for the member picker dialog
|
//used for the member picker dialog
|
||||||
angular.module("umbraco").controller("Umbraco.Overlays.MemberGroupPickerController",
|
angular.module("umbraco").controller("Umbraco.Overlays.MemberGroupPickerController",
|
||||||
function($scope, eventsService, entityResource, searchService, $log, localizationService) {
|
function($scope, eventsService, entityResource, searchService, $log, localizationService) {
|
||||||
@@ -4159,7 +4158,7 @@ angular.module("umbraco").controller("Umbraco.Overlays.TreePickerController",
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var a = dialogOptions.filter.toLowerCase().split(',');
|
var a = dialogOptions.filter.toLowerCase().replace(/\s/g, '').split(',');
|
||||||
angular.forEach(nodes, function (value, key) {
|
angular.forEach(nodes, function (value, key) {
|
||||||
|
|
||||||
var found = a.indexOf(value.metaData.contentType.toLowerCase()) >= 0;
|
var found = a.indexOf(value.metaData.contentType.toLowerCase()) >= 0;
|
||||||
@@ -9065,6 +9064,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Packages.DeleteController"
|
|||||||
status: "",
|
status: "",
|
||||||
progress:0
|
progress:0
|
||||||
};
|
};
|
||||||
|
vm.installCompleted = false;
|
||||||
vm.zipFile = {
|
vm.zipFile = {
|
||||||
uploadStatus: "idle",
|
uploadStatus: "idle",
|
||||||
uploadProgress: 0,
|
uploadProgress: 0,
|
||||||
@@ -9087,6 +9087,9 @@ angular.module("umbraco").controller("Umbraco.Editors.Packages.DeleteController"
|
|||||||
file: file
|
file: file
|
||||||
}).progress(function (evt) {
|
}).progress(function (evt) {
|
||||||
|
|
||||||
|
// set view state to uploading
|
||||||
|
vm.state = 'uploading';
|
||||||
|
|
||||||
// calculate progress in percentage
|
// calculate progress in percentage
|
||||||
var progressPercentage = parseInt(100.0 * evt.loaded / evt.total, 10);
|
var progressPercentage = parseInt(100.0 * evt.loaded / evt.total, 10);
|
||||||
|
|
||||||
@@ -9187,10 +9190,10 @@ angular.module("umbraco").controller("Umbraco.Editors.Packages.DeleteController"
|
|||||||
localStorageService.set("packageInstallUri", "installed");
|
localStorageService.set("packageInstallUri", "installed");
|
||||||
}
|
}
|
||||||
|
|
||||||
//reload on next digest (after cookie)
|
vm.installState.status = localizationService.localize("packager_installStateCompleted");
|
||||||
$timeout(function () {
|
vm.installCompleted = true;
|
||||||
$window.location.reload(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
installError);
|
installError);
|
||||||
@@ -9200,6 +9203,13 @@ angular.module("umbraco").controller("Umbraco.Editors.Packages.DeleteController"
|
|||||||
//This will return a rejection meaning that the promise change above will stop
|
//This will return a rejection meaning that the promise change above will stop
|
||||||
return $q.reject();
|
return $q.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vm.reloadPage = function() {
|
||||||
|
//reload on next digest (after cookie)
|
||||||
|
$timeout(function () {
|
||||||
|
$window.location.reload(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
angular.module("umbraco").controller("Umbraco.Editors.Packages.InstallLocalController", PackagesInstallLocalController);
|
angular.module("umbraco").controller("Umbraco.Editors.Packages.InstallLocalController", PackagesInstallLocalController);
|
||||||
@@ -9301,6 +9311,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Packages.DeleteController"
|
|||||||
vm.openLightbox = openLightbox;
|
vm.openLightbox = openLightbox;
|
||||||
vm.closeLightbox = closeLightbox;
|
vm.closeLightbox = closeLightbox;
|
||||||
vm.search = search;
|
vm.search = search;
|
||||||
|
vm.installCompleted = false;
|
||||||
|
|
||||||
var currSort = "Latest";
|
var currSort = "Latest";
|
||||||
//used to cancel any request in progress if another one needs to take it's place
|
//used to cancel any request in progress if another one needs to take it's place
|
||||||
@@ -9486,10 +9497,8 @@ angular.module("umbraco").controller("Umbraco.Editors.Packages.DeleteController"
|
|||||||
localStorageService.set("packageInstallUri", result.postInstallationPath);
|
localStorageService.set("packageInstallUri", result.postInstallationPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
//reload on next digest (after cookie)
|
vm.installState.status = localizationService.localize("packager_installStateCompleted");
|
||||||
$timeout(function() {
|
vm.installCompleted = true;
|
||||||
window.location.reload(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
error);
|
error);
|
||||||
@@ -9548,6 +9557,13 @@ angular.module("umbraco").controller("Umbraco.Editors.Packages.DeleteController"
|
|||||||
searchDebounced();
|
searchDebounced();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vm.reloadPage = function () {
|
||||||
|
//reload on next digest (after cookie)
|
||||||
|
$timeout(function () {
|
||||||
|
window.location.reload(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13232,7 +13248,7 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.IncludePropertiesL
|
|||||||
(function() {
|
(function() {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function ListViewGridLayoutController($scope, $routeParams, mediaHelper, mediaResource, $location, listViewHelper) {
|
function ListViewGridLayoutController($scope, $routeParams, mediaHelper, mediaResource, $location, listViewHelper, mediaTypeHelper) {
|
||||||
|
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
|
||||||
@@ -13244,6 +13260,7 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.IncludePropertiesL
|
|||||||
vm.mediaDetailsTooltip = {};
|
vm.mediaDetailsTooltip = {};
|
||||||
vm.itemsWithoutFolders = [];
|
vm.itemsWithoutFolders = [];
|
||||||
vm.isRecycleBin = $scope.contentId === '-21' || $scope.contentId === '-20';
|
vm.isRecycleBin = $scope.contentId === '-21' || $scope.contentId === '-20';
|
||||||
|
vm.acceptedMediatypes = [];
|
||||||
|
|
||||||
vm.dragEnter = dragEnter;
|
vm.dragEnter = dragEnter;
|
||||||
vm.dragLeave = dragLeave;
|
vm.dragLeave = dragLeave;
|
||||||
@@ -13258,6 +13275,13 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.IncludePropertiesL
|
|||||||
|
|
||||||
function activate() {
|
function activate() {
|
||||||
vm.itemsWithoutFolders = filterOutFolders($scope.items);
|
vm.itemsWithoutFolders = filterOutFolders($scope.items);
|
||||||
|
|
||||||
|
if($scope.entityType === 'media') {
|
||||||
|
mediaTypeHelper.getAllowedImagetypes(vm.nodeId).then(function (types) {
|
||||||
|
vm.acceptedMediatypes = types;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterOutFolders(items) {
|
function filterOutFolders(items) {
|
||||||
@@ -13339,7 +13363,7 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.IncludePropertiesL
|
|||||||
(function () {
|
(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function ListViewListLayoutController($scope, listViewHelper, $location, mediaHelper) {
|
function ListViewListLayoutController($scope, listViewHelper, $location, mediaHelper, mediaTypeHelper) {
|
||||||
|
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
|
||||||
@@ -13349,6 +13373,7 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.IncludePropertiesL
|
|||||||
vm.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB";
|
vm.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB";
|
||||||
vm.activeDrag = false;
|
vm.activeDrag = false;
|
||||||
vm.isRecycleBin = $scope.contentId === '-21' || $scope.contentId === '-20';
|
vm.isRecycleBin = $scope.contentId === '-21' || $scope.contentId === '-20';
|
||||||
|
vm.acceptedMediatypes = [];
|
||||||
|
|
||||||
vm.selectItem = selectItem;
|
vm.selectItem = selectItem;
|
||||||
vm.clickItem = clickItem;
|
vm.clickItem = clickItem;
|
||||||
@@ -13361,38 +13386,49 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.IncludePropertiesL
|
|||||||
vm.onFilesQueue = onFilesQueue;
|
vm.onFilesQueue = onFilesQueue;
|
||||||
vm.onUploadComplete = onUploadComplete;
|
vm.onUploadComplete = onUploadComplete;
|
||||||
|
|
||||||
|
function activate() {
|
||||||
|
|
||||||
|
if ($scope.entityType === 'media') {
|
||||||
|
mediaTypeHelper.getAllowedImagetypes(vm.nodeId).then(function (types) {
|
||||||
|
vm.acceptedMediatypes = types;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function selectAll($event) {
|
function selectAll($event) {
|
||||||
listViewHelper.selectAllItems($scope.items, $scope.selection, $event);
|
listViewHelper.selectAllItems($scope.items, $scope.selection, $event);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSelectedAll() {
|
function isSelectedAll() {
|
||||||
return listViewHelper.isSelectedAll($scope.items, $scope.selection);
|
return listViewHelper.isSelectedAll($scope.items, $scope.selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectItem(selectedItem, $index, $event) {
|
function selectItem(selectedItem, $index, $event) {
|
||||||
listViewHelper.selectHandler(selectedItem, $index, $scope.items, $scope.selection, $event);
|
listViewHelper.selectHandler(selectedItem, $index, $scope.items, $scope.selection, $event);
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickItem(item) {
|
function clickItem(item) {
|
||||||
$location.path($scope.entityType + '/' +$scope.entityType + '/edit/' +item.id);
|
// if item.id is 2147483647 (int.MaxValue) use item.key
|
||||||
}
|
$location.path($scope.entityType + '/' +$scope.entityType + '/edit/' + (item.id === 2147483647 ? item.key : item.id));
|
||||||
|
}
|
||||||
|
|
||||||
function isSortDirection(col, direction) {
|
function isSortDirection(col, direction) {
|
||||||
return listViewHelper.setSortingDirection(col, direction, $scope.options);
|
return listViewHelper.setSortingDirection(col, direction, $scope.options);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sort(field, allow, isSystem) {
|
function sort(field, allow, isSystem) {
|
||||||
if (allow) {
|
if (allow) {
|
||||||
$scope.options.orderBySystemField = isSystem;
|
$scope.options.orderBySystemField = isSystem;
|
||||||
listViewHelper.setSorting(field, allow, $scope.options);
|
listViewHelper.setSorting(field, allow, $scope.options);
|
||||||
$scope.getContent($scope.contentId);
|
$scope.getContent($scope.contentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dropzone upload functions
|
// Dropzone upload functions
|
||||||
function dragEnter(el, event) {
|
function dragEnter(el, event) {
|
||||||
vm.activeDrag = true;
|
vm.activeDrag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function dragLeave(el, event) {
|
function dragLeave(el, event) {
|
||||||
vm.activeDrag = false;
|
vm.activeDrag = false;
|
||||||
@@ -13400,11 +13436,13 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.IncludePropertiesL
|
|||||||
|
|
||||||
function onFilesQueue() {
|
function onFilesQueue() {
|
||||||
vm.activeDrag = false;
|
vm.activeDrag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onUploadComplete() {
|
function onUploadComplete() {
|
||||||
$scope.getContent($scope.contentId);
|
$scope.getContent($scope.contentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
activate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15785,7 +15823,7 @@ function sliderController($scope, $log, $element, assetsService, angularHelper)
|
|||||||
angular.module("umbraco").controller("Umbraco.PropertyEditors.SliderController", sliderController);
|
angular.module("umbraco").controller("Umbraco.PropertyEditors.SliderController", sliderController);
|
||||||
angular.module("umbraco")
|
angular.module("umbraco")
|
||||||
.controller("Umbraco.PropertyEditors.TagsController",
|
.controller("Umbraco.PropertyEditors.TagsController",
|
||||||
function ($rootScope, $scope, $log, assetsService, umbRequestHelper, angularHelper, $timeout, $element) {
|
function ($rootScope, $scope, $log, assetsService, umbRequestHelper, angularHelper, $timeout, $element, $sanitize) {
|
||||||
|
|
||||||
var $typeahead;
|
var $typeahead;
|
||||||
|
|
||||||
@@ -15826,6 +15864,7 @@ angular.module("umbraco")
|
|||||||
|
|
||||||
//Helper method to add a tag on enter or on typeahead select
|
//Helper method to add a tag on enter or on typeahead select
|
||||||
function addTag(tagToAdd) {
|
function addTag(tagToAdd) {
|
||||||
|
tagToAdd = String(tagToAdd).htmlEncode();
|
||||||
if (tagToAdd != null && tagToAdd.length > 0) {
|
if (tagToAdd != null && tagToAdd.length > 0) {
|
||||||
if ($scope.model.value.indexOf(tagToAdd) < 0) {
|
if ($scope.model.value.indexOf(tagToAdd) < 0) {
|
||||||
$scope.model.value.push(tagToAdd);
|
$scope.model.value.push(tagToAdd);
|
||||||
|
|||||||
@@ -9725,215 +9725,226 @@ Use this directive to render a tooltip.
|
|||||||
/*
|
/*
|
||||||
TODO
|
TODO
|
||||||
.directive("umbFileDrop", function ($timeout, $upload, localizationService, umbRequestHelper){
|
.directive("umbFileDrop", function ($timeout, $upload, localizationService, umbRequestHelper){
|
||||||
|
return{
|
||||||
return{
|
restrict: "A",
|
||||||
restrict: "A",
|
link: function(scope, element, attrs){
|
||||||
link: function(scope, element, attrs){
|
//load in the options model
|
||||||
|
}
|
||||||
//load in the options model
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
*/
|
*/
|
||||||
|
|
||||||
angular.module("umbraco.directives")
|
angular.module("umbraco.directives")
|
||||||
|
.directive('umbFileDropzone',
|
||||||
|
function($timeout, Upload, localizationService, umbRequestHelper) {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
replace: true,
|
||||||
|
templateUrl: 'views/components/upload/umb-file-dropzone.html',
|
||||||
|
scope: {
|
||||||
|
parentId: '@',
|
||||||
|
contentTypeAlias: '@',
|
||||||
|
propertyAlias: '@',
|
||||||
|
accept: '@',
|
||||||
|
maxFileSize: '@',
|
||||||
|
|
||||||
.directive('umbFileDropzone', function ($timeout, Upload, localizationService, umbRequestHelper) {
|
compact: '@',
|
||||||
return {
|
hideDropzone: '@',
|
||||||
|
acceptedMediatypes: '=',
|
||||||
|
|
||||||
restrict: 'E',
|
filesQueued: '=',
|
||||||
replace: true,
|
handleFile: '=',
|
||||||
|
filesUploaded: '='
|
||||||
|
},
|
||||||
|
link: function(scope, element, attrs) {
|
||||||
|
scope.queue = [];
|
||||||
|
scope.done = [];
|
||||||
|
scope.rejected = [];
|
||||||
|
scope.currentFile = undefined;
|
||||||
|
|
||||||
templateUrl: 'views/components/upload/umb-file-dropzone.html',
|
function _filterFile(file) {
|
||||||
|
var ignoreFileNames = ['Thumbs.db'];
|
||||||
|
var ignoreFileTypes = ['directory'];
|
||||||
|
|
||||||
scope: {
|
// ignore files with names from the list
|
||||||
parentId: '@',
|
// ignore files with types from the list
|
||||||
contentTypeAlias: '@',
|
// ignore files which starts with "."
|
||||||
propertyAlias: '@',
|
if (ignoreFileNames.indexOf(file.name) === -1 &&
|
||||||
accept: '@',
|
ignoreFileTypes.indexOf(file.type) === -1 &&
|
||||||
maxFileSize: '@',
|
file.name.indexOf(".") !== 0) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
compact: '@',
|
function _filesQueued(files, event) {
|
||||||
hideDropzone: '@',
|
//Push into the queue
|
||||||
|
angular.forEach(files,
|
||||||
|
function(file) {
|
||||||
|
|
||||||
filesQueued: '=',
|
if (_filterFile(file) === true) {
|
||||||
handleFile: '=',
|
|
||||||
filesUploaded: '='
|
|
||||||
},
|
|
||||||
|
|
||||||
link: function(scope, element, attrs) {
|
if (file.$error) {
|
||||||
|
scope.rejected.push(file);
|
||||||
|
} else {
|
||||||
|
scope.queue.push(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
scope.queue = [];
|
//when queue is done, kick the uploader
|
||||||
scope.done = [];
|
if (!scope.working) {
|
||||||
scope.rejected = [];
|
// Upload not allowed
|
||||||
scope.currentFile = undefined;
|
if (!scope.acceptedMediatypes || !scope.acceptedMediatypes.length) {
|
||||||
|
files.map(function(file) {
|
||||||
|
file.uploadStatus = "error";
|
||||||
|
file.serverErrorMessage = "File type is not allowed here";
|
||||||
|
scope.rejected.push(file);
|
||||||
|
});
|
||||||
|
scope.queue = [];
|
||||||
|
}
|
||||||
|
// One allowed type
|
||||||
|
if (scope.acceptedMediatypes && scope.acceptedMediatypes.length === 1) {
|
||||||
|
// Standard setup - set alias to auto select to let the server best decide which media type to use
|
||||||
|
if (scope.acceptedMediatypes[0].alias === 'Image') {
|
||||||
|
scope.contentTypeAlias = "umbracoAutoSelect";
|
||||||
|
} else {
|
||||||
|
scope.contentTypeAlias = scope.acceptedMediatypes[0].alias;
|
||||||
|
}
|
||||||
|
|
||||||
function _filterFile(file) {
|
_processQueueItem();
|
||||||
|
}
|
||||||
|
// More than one, open dialog
|
||||||
|
if (scope.acceptedMediatypes && scope.acceptedMediatypes.length > 1) {
|
||||||
|
_chooseMediaType();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var ignoreFileNames = ['Thumbs.db'];
|
function _processQueueItem() {
|
||||||
var ignoreFileTypes = ['directory'];
|
if (scope.queue.length > 0) {
|
||||||
|
scope.currentFile = scope.queue.shift();
|
||||||
|
_upload(scope.currentFile);
|
||||||
|
} else if (scope.done.length > 0) {
|
||||||
|
if (scope.filesUploaded) {
|
||||||
|
//queue is empty, trigger the done action
|
||||||
|
scope.filesUploaded(scope.done);
|
||||||
|
}
|
||||||
|
|
||||||
// ignore files with names from the list
|
//auto-clear the done queue after 3 secs
|
||||||
// ignore files with types from the list
|
var currentLength = scope.done.length;
|
||||||
// ignore files which starts with "."
|
$timeout(function() {
|
||||||
if(ignoreFileNames.indexOf(file.name) === -1 &&
|
scope.done.splice(0, currentLength);
|
||||||
ignoreFileTypes.indexOf(file.type) === -1 &&
|
},
|
||||||
file.name.indexOf(".") !== 0) {
|
3000);
|
||||||
return true;
|
}
|
||||||
} else {
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
function _upload(file) {
|
||||||
|
|
||||||
function _filesQueued(files, event){
|
scope.propertyAlias = scope.propertyAlias ? scope.propertyAlias : "umbracoFile";
|
||||||
|
scope.contentTypeAlias = scope.contentTypeAlias ? scope.contentTypeAlias : "Image";
|
||||||
|
|
||||||
//Push into the queue
|
Upload.upload({
|
||||||
angular.forEach(files, function(file){
|
url: umbRequestHelper.getApiUrl("mediaApiBaseUrl", "PostAddFile"),
|
||||||
|
fields: {
|
||||||
|
'currentFolder': scope.parentId,
|
||||||
|
'contentTypeAlias': scope.contentTypeAlias,
|
||||||
|
'propertyAlias': scope.propertyAlias,
|
||||||
|
'path': file.path
|
||||||
|
},
|
||||||
|
file: file
|
||||||
|
})
|
||||||
|
.progress(function(evt) {
|
||||||
|
// calculate progress in percentage
|
||||||
|
var progressPercentage = parseInt(100.0 * evt.loaded / evt.total, 10);
|
||||||
|
// set percentage property on file
|
||||||
|
file.uploadProgress = progressPercentage;
|
||||||
|
// set uploading status on file
|
||||||
|
file.uploadStatus = "uploading";
|
||||||
|
})
|
||||||
|
.success(function(data, status, headers, config) {
|
||||||
|
if (data.notifications && data.notifications.length > 0) {
|
||||||
|
// set error status on file
|
||||||
|
file.uploadStatus = "error";
|
||||||
|
// Throw message back to user with the cause of the error
|
||||||
|
file.serverErrorMessage = data.notifications[0].message;
|
||||||
|
// Put the file in the rejected pool
|
||||||
|
scope.rejected.push(file);
|
||||||
|
} else {
|
||||||
|
// set done status on file
|
||||||
|
file.uploadStatus = "done";
|
||||||
|
// set date/time for when done - used for sorting
|
||||||
|
file.doneDate = new Date();
|
||||||
|
// Put the file in the done pool
|
||||||
|
scope.done.push(file);
|
||||||
|
}
|
||||||
|
scope.currentFile = undefined;
|
||||||
|
//after processing, test if everthing is done
|
||||||
|
_processQueueItem();
|
||||||
|
})
|
||||||
|
.error(function(evt, status, headers, config) {
|
||||||
|
// set status done
|
||||||
|
file.uploadStatus = "error";
|
||||||
|
//if the service returns a detailed error
|
||||||
|
if (evt.InnerException) {
|
||||||
|
file.serverErrorMessage = evt.InnerException.ExceptionMessage;
|
||||||
|
//Check if its the common "too large file" exception
|
||||||
|
if (evt.InnerException.StackTrace &&
|
||||||
|
evt.InnerException.StackTrace.indexOf("ValidateRequestEntityLength") > 0) {
|
||||||
|
file.serverErrorMessage = "File too large to upload";
|
||||||
|
}
|
||||||
|
} else if (evt.Message) {
|
||||||
|
file.serverErrorMessage = evt.Message;
|
||||||
|
}
|
||||||
|
// If file not found, server will return a 404 and display this message
|
||||||
|
if (status === 404) {
|
||||||
|
file.serverErrorMessage = "File not found";
|
||||||
|
}
|
||||||
|
//after processing, test if everthing is done
|
||||||
|
scope.rejected.push(file);
|
||||||
|
scope.currentFile = undefined;
|
||||||
|
_processQueueItem();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if(_filterFile(file) === true) {
|
function _chooseMediaType() {
|
||||||
|
scope.mediatypepickerOverlay = {
|
||||||
|
view: "mediatypepicker",
|
||||||
|
title: "Choose media type",
|
||||||
|
acceptedMediatypes: scope.acceptedMediatypes,
|
||||||
|
hideSubmitButton: true,
|
||||||
|
show: true,
|
||||||
|
submit: function(model) {
|
||||||
|
scope.contentTypeAlias = model.selectedType.alias;
|
||||||
|
scope.mediatypepickerOverlay.show = false;
|
||||||
|
scope.mediatypepickerOverlay = null;
|
||||||
|
_processQueueItem();
|
||||||
|
},
|
||||||
|
close: function(oldModel) {
|
||||||
|
|
||||||
if(file.$error) {
|
scope.queue.map(function(file) {
|
||||||
scope.rejected.push(file);
|
file.uploadStatus = "error";
|
||||||
} else {
|
file.serverErrorMessage = "Cannot upload this file, no mediatype selected";
|
||||||
scope.queue.push(file);
|
scope.rejected.push(file);
|
||||||
}
|
});
|
||||||
|
scope.queue = [];
|
||||||
|
scope.mediatypepickerOverlay.show = false;
|
||||||
|
scope.mediatypepickerOverlay = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
scope.handleFiles = function(files, event) {
|
||||||
|
if (scope.filesQueued) {
|
||||||
});
|
scope.filesQueued(files, event);
|
||||||
|
}
|
||||||
//when queue is done, kick the uploader
|
_filesQueued(files, event);
|
||||||
if(!scope.working){
|
};
|
||||||
_processQueueItem();
|
}
|
||||||
}
|
};
|
||||||
}
|
});
|
||||||
|
|
||||||
|
|
||||||
function _processQueueItem(){
|
|
||||||
|
|
||||||
if(scope.queue.length > 0){
|
|
||||||
scope.currentFile = scope.queue.shift();
|
|
||||||
_upload(scope.currentFile);
|
|
||||||
}else if(scope.done.length > 0){
|
|
||||||
|
|
||||||
if(scope.filesUploaded){
|
|
||||||
//queue is empty, trigger the done action
|
|
||||||
scope.filesUploaded(scope.done);
|
|
||||||
}
|
|
||||||
|
|
||||||
//auto-clear the done queue after 3 secs
|
|
||||||
var currentLength = scope.done.length;
|
|
||||||
$timeout(function(){
|
|
||||||
scope.done.splice(0, currentLength);
|
|
||||||
}, 3000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _upload(file) {
|
|
||||||
|
|
||||||
scope.propertyAlias = scope.propertyAlias ? scope.propertyAlias : "umbracoFile";
|
|
||||||
scope.contentTypeAlias = scope.contentTypeAlias ? scope.contentTypeAlias : "Image";
|
|
||||||
|
|
||||||
Upload.upload({
|
|
||||||
url: umbRequestHelper.getApiUrl("mediaApiBaseUrl", "PostAddFile"),
|
|
||||||
fields: {
|
|
||||||
'currentFolder': scope.parentId,
|
|
||||||
'contentTypeAlias': scope.contentTypeAlias,
|
|
||||||
'propertyAlias': scope.propertyAlias,
|
|
||||||
'path': file.path
|
|
||||||
},
|
|
||||||
file: file
|
|
||||||
}).progress(function (evt) {
|
|
||||||
|
|
||||||
// calculate progress in percentage
|
|
||||||
var progressPercentage = parseInt(100.0 * evt.loaded / evt.total, 10);
|
|
||||||
|
|
||||||
// set percentage property on file
|
|
||||||
file.uploadProgress = progressPercentage;
|
|
||||||
|
|
||||||
// set uploading status on file
|
|
||||||
file.uploadStatus = "uploading";
|
|
||||||
|
|
||||||
}).success(function (data, status, headers, config) {
|
|
||||||
|
|
||||||
if(data.notifications && data.notifications.length > 0) {
|
|
||||||
|
|
||||||
// set error status on file
|
|
||||||
file.uploadStatus = "error";
|
|
||||||
|
|
||||||
// Throw message back to user with the cause of the error
|
|
||||||
file.serverErrorMessage = data.notifications[0].message;
|
|
||||||
|
|
||||||
// Put the file in the rejected pool
|
|
||||||
scope.rejected.push(file);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// set done status on file
|
|
||||||
file.uploadStatus = "done";
|
|
||||||
|
|
||||||
// set date/time for when done - used for sorting
|
|
||||||
file.doneDate = new Date();
|
|
||||||
|
|
||||||
// Put the file in the done pool
|
|
||||||
scope.done.push(file);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
scope.currentFile = undefined;
|
|
||||||
|
|
||||||
//after processing, test if everthing is done
|
|
||||||
_processQueueItem();
|
|
||||||
|
|
||||||
}).error( function (evt, status, headers, config) {
|
|
||||||
|
|
||||||
// set status done
|
|
||||||
file.uploadStatus = "error";
|
|
||||||
|
|
||||||
//if the service returns a detailed error
|
|
||||||
if (evt.InnerException) {
|
|
||||||
file.serverErrorMessage = evt.InnerException.ExceptionMessage;
|
|
||||||
|
|
||||||
//Check if its the common "too large file" exception
|
|
||||||
if (evt.InnerException.StackTrace && evt.InnerException.StackTrace.indexOf("ValidateRequestEntityLength") > 0) {
|
|
||||||
file.serverErrorMessage = "File too large to upload";
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (evt.Message) {
|
|
||||||
file.serverErrorMessage = evt.Message;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If file not found, server will return a 404 and display this message
|
|
||||||
if(status === 404 ) {
|
|
||||||
file.serverErrorMessage = "File not found";
|
|
||||||
}
|
|
||||||
|
|
||||||
//after processing, test if everthing is done
|
|
||||||
scope.rejected.push(file);
|
|
||||||
scope.currentFile = undefined;
|
|
||||||
|
|
||||||
_processQueueItem();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scope.handleFiles = function(files, event){
|
|
||||||
if(scope.filesQueued){
|
|
||||||
scope.filesQueued(files, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
_filesQueued(files, event);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc directive
|
* @ngdoc directive
|
||||||
|
|||||||
@@ -4880,6 +4880,65 @@ function mediaHelper(umbRequestHelper) {
|
|||||||
};
|
};
|
||||||
}angular.module('umbraco.services').factory('mediaHelper', mediaHelper);
|
}angular.module('umbraco.services').factory('mediaHelper', mediaHelper);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ngdoc service
|
||||||
|
* @name umbraco.services.mediaTypeHelper
|
||||||
|
* @description A helper service for the media types
|
||||||
|
**/
|
||||||
|
function mediaTypeHelper(mediaTypeResource, $q) {
|
||||||
|
|
||||||
|
var mediaTypeHelperService = {
|
||||||
|
|
||||||
|
getAllowedImagetypes: function (mediaId){
|
||||||
|
|
||||||
|
// Get All allowedTypes
|
||||||
|
return mediaTypeResource.getAllowedTypes(mediaId)
|
||||||
|
.then(function(types){
|
||||||
|
|
||||||
|
var allowedQ = types.map(function(type){
|
||||||
|
return mediaTypeResource.getById(type.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Get full list
|
||||||
|
return $q.all(allowedQ).then(function(fullTypes){
|
||||||
|
|
||||||
|
// Find all the media types with an Image Cropper property editor
|
||||||
|
var filteredTypes = mediaTypeHelperService.getTypeWithEditor(fullTypes, ['Umbraco.ImageCropper']);
|
||||||
|
|
||||||
|
// If there is only one media type with an Image Cropper we will return this one
|
||||||
|
if(filteredTypes.length === 1) {
|
||||||
|
return filteredTypes;
|
||||||
|
// If there is more than one Image cropper, custom media types have been added, and we return all media types with and Image cropper or UploadField
|
||||||
|
} else {
|
||||||
|
return mediaTypeHelperService.getTypeWithEditor(fullTypes, ['Umbraco.ImageCropper', 'Umbraco.UploadField']);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getTypeWithEditor: function (types, editors) {
|
||||||
|
|
||||||
|
return types.filter(function (mediatype) {
|
||||||
|
for (var i = 0; i < mediatype.groups.length; i++) {
|
||||||
|
var group = mediatype.groups[i];
|
||||||
|
for (var j = 0; j < group.properties.length; j++) {
|
||||||
|
var property = group.properties[j];
|
||||||
|
if( editors.indexOf(property.editor) !== -1 ) {
|
||||||
|
return mediatype;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
return mediaTypeHelperService;
|
||||||
|
}
|
||||||
|
angular.module('umbraco.services').factory('mediaTypeHelper', mediaTypeHelper);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc service
|
* @ngdoc service
|
||||||
* @name umbraco.services.umbracoMenuActions
|
* @name umbraco.services.umbracoMenuActions
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Angular Dynamic Locale - 0.1.27
|
* Angular Dynamic Locale - 0.1.27
|
||||||
* https://github.com/lgalfaso/angular-dynamic-locale
|
* https://github.com/lgalfaso/angular-dynamic-locale
|
||||||
* License: MIT
|
* License: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
!function(a,b){"function"==typeof define&&define.amd?define([],function(){return b()}):"object"==typeof exports?module.exports=b():b()}(this,function(){"use strict";return angular.module("tmh.dynamicLocale",[]).config(["$provide",function(a){function b(a){return a.$stateful=!0,a}a.decorator("dateFilter",["$delegate",b]),a.decorator("numberFilter",["$delegate",b]),a.decorator("currencyFilter",["$delegate",b])}]).constant("tmhDynamicLocale.STORAGE_KEY","tmhDynamicLocale.locale").provider("tmhDynamicLocale",["tmhDynamicLocale.STORAGE_KEY",function(a){function b(a,b,c,d){var e=document.createElement("script"),f=document.getElementsByTagName("body")[0],g=!1;e.type="text/javascript",e.readyState?e.onreadystatechange=function(){("complete"===e.readyState||"loaded"===e.readyState)&&(e.onreadystatechange=null,d(function(){g||(g=!0,f.removeChild(e),b())},30,!1))}:(e.onload=function(){g||(g=!0,f.removeChild(e),b())},e.onerror=function(){g||(g=!0,f.removeChild(e),c())}),e.src=a,e.async=!0,f.appendChild(e)}function c(a,c,d,g,h,k,l){function m(a,b){f===d&&(angular.forEach(a,function(c,d){b[d]?angular.isArray(b[d])&&(a[d].length=b[d].length):delete a[d]}),angular.forEach(b,function(c,d){angular.isArray(b[d])||angular.isObject(b[d])?(a[d]||(a[d]=angular.isArray(b[d])?[]:{}),m(a[d],b[d])):a[d]=b[d]}))}if(j[d])return f=d,j[d];var n,o=h.defer();return d===f?o.resolve(c):(n=k.get(d))?(f=d,g.$evalAsync(function(){m(c,n),e.put(i,d),g.$broadcast("$localeChangeSuccess",d,c),o.resolve(c)})):(f=d,j[d]=o.promise,b(a,function(){var a=angular.injector(["ngLocale"]),b=a.get("$locale");m(c,b),k.put(d,b),delete j[d],g.$apply(function(){e.put(i,d),g.$broadcast("$localeChangeSuccess",d,c),o.resolve(c)})},function(){delete j[d],g.$apply(function(){f===d&&(f=c.id),g.$broadcast("$localeChangeError",d),o.reject(d)})},l)),o.promise}var d,e,f,g="angular/i18n/angular-locale_{{locale}}.js",h="tmhDynamicLocaleStorageCache",i=a,j={};this.localeLocationPattern=function(a){return a?(g=a,this):g},this.useStorage=function(a){h=a},this.useCookieStorage=function(){this.useStorage("$cookieStore")},this.defaultLocale=function(a){d=a},this.storageKey=function(a){return a?(i=a,this):i},this.$get=["$rootScope","$injector","$interpolate","$locale","$q","tmhDynamicLocaleCache","$timeout",function(a,b,j,k,l,m,n){function o(b){return c(p({locale:b,angularVersion:angular.version.full}),k,b,a,l,m,n)}var p=j(g);return e=b.get(h),a.$evalAsync(function(){var a;(a=e.get(i)||d)&&o(a)}),{set:o,get:function(){return f}}}]}]).provider("tmhDynamicLocaleCache",function(){this.$get=["$cacheFactory",function(a){return a("tmh.dynamicLocales")}]}).provider("tmhDynamicLocaleStorageCache",function(){this.$get=["$cacheFactory",function(a){return a("tmh.dynamicLocales.store")}]}).run(["tmhDynamicLocale",angular.noop]),"tmh.dynamicLocale"});
|
!function(a,b){"function"==typeof define&&define.amd?define([],function(){return b()}):"object"==typeof exports?module.exports=b():b()}(this,function(){"use strict";return angular.module("tmh.dynamicLocale",[]).config(["$provide",function(a){function b(a){return a.$stateful=!0,a}a.decorator("dateFilter",["$delegate",b]),a.decorator("numberFilter",["$delegate",b]),a.decorator("currencyFilter",["$delegate",b])}]).constant("tmhDynamicLocale.STORAGE_KEY","tmhDynamicLocale.locale").provider("tmhDynamicLocale",["tmhDynamicLocale.STORAGE_KEY",function(a){function b(a,b,c,d){var e=document.createElement("script"),f=document.getElementsByTagName("body")[0],g=!1;e.type="text/javascript",e.readyState?e.onreadystatechange=function(){("complete"===e.readyState||"loaded"===e.readyState)&&(e.onreadystatechange=null,d(function(){g||(g=!0,f.removeChild(e),b())},30,!1))}:(e.onload=function(){g||(g=!0,f.removeChild(e),b())},e.onerror=function(){g||(g=!0,f.removeChild(e),c())}),e.src=a,e.async=!0,f.appendChild(e)}function c(a,c,d,g,h,k,l){function m(a,b){f===d&&(angular.forEach(a,function(c,d){b[d]?angular.isArray(b[d])&&(a[d].length=b[d].length):delete a[d]}),angular.forEach(b,function(c,d){angular.isArray(b[d])||angular.isObject(b[d])?(a[d]||(a[d]=angular.isArray(b[d])?[]:{}),m(a[d],b[d])):a[d]=b[d]}))}if(j[d])return f=d,j[d];var n,o=h.defer();return d===f?o.resolve(c):(n=k.get(d))?(f=d,g.$evalAsync(function(){m(c,n),e.put(i,d),g.$broadcast("$localeChangeSuccess",d,c),o.resolve(c)})):(f=d,j[d]=o.promise,b(a,function(){var a=angular.injector(["ngLocale"]),b=a.get("$locale");m(c,b),k.put(d,b),delete j[d],g.$apply(function(){e.put(i,d),g.$broadcast("$localeChangeSuccess",d,c),o.resolve(c)})},function(){delete j[d],g.$apply(function(){f===d&&(f=c.id),g.$broadcast("$localeChangeError",d),o.reject(d)})},l)),o.promise}var d,e,f,g="angular/i18n/angular-locale_{{locale}}.js",h="tmhDynamicLocaleStorageCache",i=a,j={};this.localeLocationPattern=function(a){return a?(g=a,this):g},this.useStorage=function(a){h=a},this.useCookieStorage=function(){this.useStorage("$cookieStore")},this.defaultLocale=function(a){d=a},this.storageKey=function(a){return a?(i=a,this):i},this.$get=["$rootScope","$injector","$interpolate","$locale","$q","tmhDynamicLocaleCache","$timeout",function(a,b,j,k,l,m,n){function o(b){return c(p({locale:b,angularVersion:angular.version.full}),k,b,a,l,m,n)}var p=j(g);return e=b.get(h),a.$evalAsync(function(){var a;(a=e.get(i)||d)&&o(a)}),{set:o,get:function(){return f}}}]}]).provider("tmhDynamicLocaleCache",function(){this.$get=["$cacheFactory",function(a){return a("tmh.dynamicLocales")}]}).provider("tmhDynamicLocaleStorageCache",function(){this.$get=["$cacheFactory",function(a){return a("tmh.dynamicLocales.store")}]}).run(["tmhDynamicLocale",angular.noop]),"tmh.dynamicLocale"});
|
||||||
//# sourceMappingURL=tmhDynamicLocale.min.js.map
|
//# sourceMappingURL=tmhDynamicLocale.min.js.map
|
||||||
+8
-8
@@ -1,9 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* An Angular module that gives you access to the browsers local storage
|
* An Angular module that gives you access to the browsers local storage
|
||||||
* @version v0.2.6 - 2016-03-16
|
* @version v0.2.6 - 2016-03-16
|
||||||
* @link https://github.com/grevory/angular-local-storage
|
* @link https://github.com/grevory/angular-local-storage
|
||||||
* @author grevory <greg@gregpike.ca>
|
* @author grevory <greg@gregpike.ca>
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
* @license MIT License, http://www.opensource.org/licenses/MIT
|
||||||
*/
|
*/
|
||||||
!function(a,b){var c=b.isDefined,d=b.isUndefined,e=b.isNumber,f=b.isObject,g=b.isArray,h=b.extend,i=b.toJson;b.module("LocalStorageModule",[]).provider("localStorageService",function(){this.prefix="ls",this.storageType="localStorage",this.cookie={expiry:30,path:"/"},this.notify={setItem:!0,removeItem:!1},this.setPrefix=function(a){return this.prefix=a,this},this.setStorageType=function(a){return this.storageType=a,this},this.setStorageCookie=function(a,b){return this.cookie.expiry=a,this.cookie.path=b,this},this.setStorageCookieDomain=function(a){return this.cookie.domain=a,this},this.setNotify=function(a,b){return this.notify={setItem:a,removeItem:b},this},this.$get=["$rootScope","$window","$document","$parse",function(a,b,j,k){var l,m=this,n=m.prefix,o=m.cookie,p=m.notify,q=m.storageType;j?j[0]&&(j=j[0]):j=document,"."!==n.substr(-1)&&(n=n?n+".":"");var r=function(a){return n+a},s=function(){try{var c=q in b&&null!==b[q],d=r("__"+Math.round(1e7*Math.random()));return c&&(l=b[q],l.setItem(d,""),l.removeItem(d)),c}catch(e){return q="cookie",a.$broadcast("LocalStorageModule.notification.error",e.message),!1}}(),t=function(b,c){if(c=d(c)?null:i(c),!s||"cookie"===m.storageType)return s||a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),p.setItem&&a.$broadcast("LocalStorageModule.notification.setitem",{key:b,newvalue:c,storageType:"cookie"}),z(b,c);try{l&&l.setItem(r(b),c),p.setItem&&a.$broadcast("LocalStorageModule.notification.setitem",{key:b,newvalue:c,storageType:m.storageType})}catch(e){return a.$broadcast("LocalStorageModule.notification.error",e.message),z(b,c)}return!0},u=function(b){if(!s||"cookie"===m.storageType)return s||a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),A(b);var c=l?l.getItem(r(b)):null;if(!c||"null"===c)return null;try{return JSON.parse(c)}catch(d){return c}},v=function(){var b,c;for(b=0;b<arguments.length;b++)if(c=arguments[b],s&&"cookie"!==m.storageType)try{l.removeItem(r(c)),p.removeItem&&a.$broadcast("LocalStorageModule.notification.removeitem",{key:c,storageType:m.storageType})}catch(d){a.$broadcast("LocalStorageModule.notification.error",d.message),B(c)}else s||a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),p.removeItem&&a.$broadcast("LocalStorageModule.notification.removeitem",{key:c,storageType:"cookie"}),B(c)},w=function(){if(!s)return a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),[];var b=n.length,c=[];for(var d in l)if(d.substr(0,b)===n)try{c.push(d.substr(b))}catch(e){return a.$broadcast("LocalStorageModule.notification.error",e.Description),[]}return c},x=function(b){var c=n?new RegExp("^"+n):new RegExp,d=b?new RegExp(b):new RegExp;if(!s||"cookie"===m.storageType)return s||a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),C();var e=n.length;for(var f in l)if(c.test(f)&&d.test(f.substr(e)))try{v(f.substr(e))}catch(g){return a.$broadcast("LocalStorageModule.notification.error",g.message),C()}return!0},y=function(){try{return b.navigator.cookieEnabled||"cookie"in j&&(j.cookie.length>0||(j.cookie="test").indexOf.call(j.cookie,"test")>-1)}catch(c){return a.$broadcast("LocalStorageModule.notification.error",c.message),!1}}(),z=function(b,c,h){if(d(c))return!1;if((g(c)||f(c))&&(c=i(c)),!y)return a.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;try{var k="",l=new Date,m="";if(null===c?(l.setTime(l.getTime()+-864e5),k="; expires="+l.toGMTString(),c=""):e(h)&&0!==h?(l.setTime(l.getTime()+24*h*60*60*1e3),k="; expires="+l.toGMTString()):0!==o.expiry&&(l.setTime(l.getTime()+24*o.expiry*60*60*1e3),k="; expires="+l.toGMTString()),b){var n="; path="+o.path;o.domain&&(m="; domain="+o.domain),j.cookie=r(b)+"="+encodeURIComponent(c)+k+n+m}}catch(p){return a.$broadcast("LocalStorageModule.notification.error",p.message),!1}return!0},A=function(b){if(!y)return a.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;for(var c=j.cookie&&j.cookie.split(";")||[],d=0;d<c.length;d++){for(var e=c[d];" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(r(b)+"=")){var f=decodeURIComponent(e.substring(n.length+b.length+1,e.length));try{return JSON.parse(f)}catch(g){return f}}}return null},B=function(a){z(a,null)},C=function(){for(var a=null,b=n.length,c=j.cookie.split(";"),d=0;d<c.length;d++){for(a=c[d];" "===a.charAt(0);)a=a.substring(1,a.length);var e=a.substring(b,a.indexOf("="));B(e)}},D=function(){return q},E=function(a,b,d,e){e=e||b;var g=u(e);return null===g&&c(d)?g=d:f(g)&&f(d)&&(g=h(g,d)),k(b).assign(a,g),a.$watch(b,function(a){t(e,a)},f(a[b]))},F=function(){for(var a=0,c=b[q],d=0;d<c.length;d++)0===c.key(d).indexOf(n)&&a++;return a};return{isSupported:s,getStorageType:D,set:t,add:t,get:u,keys:w,remove:v,clearAll:x,bind:E,deriveKey:r,length:F,cookie:{isSupported:y,set:z,add:z,get:A,remove:B,clearAll:C}}}]})}(window,window.angular);
|
!function(a,b){var c=b.isDefined,d=b.isUndefined,e=b.isNumber,f=b.isObject,g=b.isArray,h=b.extend,i=b.toJson;b.module("LocalStorageModule",[]).provider("localStorageService",function(){this.prefix="ls",this.storageType="localStorage",this.cookie={expiry:30,path:"/"},this.notify={setItem:!0,removeItem:!1},this.setPrefix=function(a){return this.prefix=a,this},this.setStorageType=function(a){return this.storageType=a,this},this.setStorageCookie=function(a,b){return this.cookie.expiry=a,this.cookie.path=b,this},this.setStorageCookieDomain=function(a){return this.cookie.domain=a,this},this.setNotify=function(a,b){return this.notify={setItem:a,removeItem:b},this},this.$get=["$rootScope","$window","$document","$parse",function(a,b,j,k){var l,m=this,n=m.prefix,o=m.cookie,p=m.notify,q=m.storageType;j?j[0]&&(j=j[0]):j=document,"."!==n.substr(-1)&&(n=n?n+".":"");var r=function(a){return n+a},s=function(){try{var c=q in b&&null!==b[q],d=r("__"+Math.round(1e7*Math.random()));return c&&(l=b[q],l.setItem(d,""),l.removeItem(d)),c}catch(e){return q="cookie",a.$broadcast("LocalStorageModule.notification.error",e.message),!1}}(),t=function(b,c){if(c=d(c)?null:i(c),!s||"cookie"===m.storageType)return s||a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),p.setItem&&a.$broadcast("LocalStorageModule.notification.setitem",{key:b,newvalue:c,storageType:"cookie"}),z(b,c);try{l&&l.setItem(r(b),c),p.setItem&&a.$broadcast("LocalStorageModule.notification.setitem",{key:b,newvalue:c,storageType:m.storageType})}catch(e){return a.$broadcast("LocalStorageModule.notification.error",e.message),z(b,c)}return!0},u=function(b){if(!s||"cookie"===m.storageType)return s||a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),A(b);var c=l?l.getItem(r(b)):null;if(!c||"null"===c)return null;try{return JSON.parse(c)}catch(d){return c}},v=function(){var b,c;for(b=0;b<arguments.length;b++)if(c=arguments[b],s&&"cookie"!==m.storageType)try{l.removeItem(r(c)),p.removeItem&&a.$broadcast("LocalStorageModule.notification.removeitem",{key:c,storageType:m.storageType})}catch(d){a.$broadcast("LocalStorageModule.notification.error",d.message),B(c)}else s||a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),p.removeItem&&a.$broadcast("LocalStorageModule.notification.removeitem",{key:c,storageType:"cookie"}),B(c)},w=function(){if(!s)return a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),[];var b=n.length,c=[];for(var d in l)if(d.substr(0,b)===n)try{c.push(d.substr(b))}catch(e){return a.$broadcast("LocalStorageModule.notification.error",e.Description),[]}return c},x=function(b){var c=n?new RegExp("^"+n):new RegExp,d=b?new RegExp(b):new RegExp;if(!s||"cookie"===m.storageType)return s||a.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),C();var e=n.length;for(var f in l)if(c.test(f)&&d.test(f.substr(e)))try{v(f.substr(e))}catch(g){return a.$broadcast("LocalStorageModule.notification.error",g.message),C()}return!0},y=function(){try{return b.navigator.cookieEnabled||"cookie"in j&&(j.cookie.length>0||(j.cookie="test").indexOf.call(j.cookie,"test")>-1)}catch(c){return a.$broadcast("LocalStorageModule.notification.error",c.message),!1}}(),z=function(b,c,h){if(d(c))return!1;if((g(c)||f(c))&&(c=i(c)),!y)return a.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;try{var k="",l=new Date,m="";if(null===c?(l.setTime(l.getTime()+-864e5),k="; expires="+l.toGMTString(),c=""):e(h)&&0!==h?(l.setTime(l.getTime()+24*h*60*60*1e3),k="; expires="+l.toGMTString()):0!==o.expiry&&(l.setTime(l.getTime()+24*o.expiry*60*60*1e3),k="; expires="+l.toGMTString()),b){var n="; path="+o.path;o.domain&&(m="; domain="+o.domain),j.cookie=r(b)+"="+encodeURIComponent(c)+k+n+m}}catch(p){return a.$broadcast("LocalStorageModule.notification.error",p.message),!1}return!0},A=function(b){if(!y)return a.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;for(var c=j.cookie&&j.cookie.split(";")||[],d=0;d<c.length;d++){for(var e=c[d];" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(r(b)+"=")){var f=decodeURIComponent(e.substring(n.length+b.length+1,e.length));try{return JSON.parse(f)}catch(g){return f}}}return null},B=function(a){z(a,null)},C=function(){for(var a=null,b=n.length,c=j.cookie.split(";"),d=0;d<c.length;d++){for(a=c[d];" "===a.charAt(0);)a=a.substring(1,a.length);var e=a.substring(b,a.indexOf("="));B(e)}},D=function(){return q},E=function(a,b,d,e){e=e||b;var g=u(e);return null===g&&c(d)?g=d:f(g)&&f(d)&&(g=h(g,d)),k(b).assign(a,g),a.$watch(b,function(a){t(e,a)},f(a[b]))},F=function(){for(var a=0,c=b[q],d=0;d<c.length;d++)0===c.key(d).indexOf(n)&&a++;return a};return{isSupported:s,getStorageType:D,set:t,add:t,get:u,keys:w,remove:v,clearAll:x,bind:E,deriveKey:r,length:F,cookie:{isSupported:y,set:z,add:z,get:A,remove:B,clearAll:C}}}]})}(window,window.angular);
|
||||||
//# sourceMappingURL=angular-local-storage.min.js.map
|
//# sourceMappingURL=angular-local-storage.min.js.map
|
||||||
+32383
-31767
File diff suppressed because it is too large
Load Diff
+101
-101
@@ -1,101 +1,101 @@
|
|||||||
/*
|
/*
|
||||||
* Social Buttons for Bootstrap
|
* Social Buttons for Bootstrap
|
||||||
*
|
*
|
||||||
* Copyright 2013-2014 Panayiotis Lipiridis
|
* Copyright 2013-2014 Panayiotis Lipiridis
|
||||||
* Licensed under the MIT License
|
* Licensed under the MIT License
|
||||||
*
|
*
|
||||||
* https://github.com/lipis/bootstrap-social
|
* https://github.com/lipis/bootstrap-social
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.btn-social{position:relative;padding-left:44px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.btn-social>:first-child{position:absolute;left:0;top:0;bottom:0;width:32px;line-height:34px;font-size:1.6em;text-align:center;border-right:1px solid rgba(0,0,0,0.2)}
|
.btn-social{position:relative;padding-left:44px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.btn-social>:first-child{position:absolute;left:0;top:0;bottom:0;width:32px;line-height:34px;font-size:1.6em;text-align:center;border-right:1px solid rgba(0,0,0,0.2)}
|
||||||
.btn-social.btn-lg{padding-left:61px}.btn-social.btn-lg :first-child{line-height:45px;width:45px;font-size:1.8em}
|
.btn-social.btn-lg{padding-left:61px}.btn-social.btn-lg :first-child{line-height:45px;width:45px;font-size:1.8em}
|
||||||
.btn-social.btn-sm{padding-left:38px}.btn-social.btn-sm :first-child{line-height:28px;width:28px;font-size:1.4em}
|
.btn-social.btn-sm{padding-left:38px}.btn-social.btn-sm :first-child{line-height:28px;width:28px;font-size:1.4em}
|
||||||
.btn-social.btn-xs{padding-left:30px}.btn-social.btn-xs :first-child{line-height:20px;width:20px;font-size:1.2em}
|
.btn-social.btn-xs{padding-left:30px}.btn-social.btn-xs :first-child{line-height:20px;width:20px;font-size:1.2em}
|
||||||
.btn-social-icon{position:relative;padding-left:44px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:34px;width:34px;padding:0}.btn-social-icon>:first-child{position:absolute;left:0;top:0;bottom:0;width:32px;line-height:34px;font-size:1.6em;text-align:center;border-right:1px solid rgba(0,0,0,0.2)}
|
.btn-social-icon{position:relative;padding-left:44px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:34px;width:34px;padding:0}.btn-social-icon>:first-child{position:absolute;left:0;top:0;bottom:0;width:32px;line-height:34px;font-size:1.6em;text-align:center;border-right:1px solid rgba(0,0,0,0.2)}
|
||||||
.btn-social-icon.btn-lg{padding-left:61px}.btn-social-icon.btn-lg :first-child{line-height:45px;width:45px;font-size:1.8em}
|
.btn-social-icon.btn-lg{padding-left:61px}.btn-social-icon.btn-lg :first-child{line-height:45px;width:45px;font-size:1.8em}
|
||||||
.btn-social-icon.btn-sm{padding-left:38px}.btn-social-icon.btn-sm :first-child{line-height:28px;width:28px;font-size:1.4em}
|
.btn-social-icon.btn-sm{padding-left:38px}.btn-social-icon.btn-sm :first-child{line-height:28px;width:28px;font-size:1.4em}
|
||||||
.btn-social-icon.btn-xs{padding-left:30px}.btn-social-icon.btn-xs :first-child{line-height:20px;width:20px;font-size:1.2em}
|
.btn-social-icon.btn-xs{padding-left:30px}.btn-social-icon.btn-xs :first-child{line-height:20px;width:20px;font-size:1.2em}
|
||||||
.btn-social-icon :first-child{border:none;text-align:center;width:100% !important}
|
.btn-social-icon :first-child{border:none;text-align:center;width:100% !important}
|
||||||
.btn-social-icon.btn-lg{height:45px;width:45px;padding-left:0;padding-right:0}
|
.btn-social-icon.btn-lg{height:45px;width:45px;padding-left:0;padding-right:0}
|
||||||
.btn-social-icon.btn-sm{height:30px;width:30px;padding-left:0;padding-right:0}
|
.btn-social-icon.btn-sm{height:30px;width:30px;padding-left:0;padding-right:0}
|
||||||
.btn-social-icon.btn-xs{height:22px;width:22px;padding-left:0;padding-right:0}
|
.btn-social-icon.btn-xs{height:22px;width:22px;padding-left:0;padding-right:0}
|
||||||
.btn-adn{color:#fff;background-color:#d87a68;border-color:rgba(0,0,0,0.2)}.btn-adn:hover,.btn-adn:focus,.btn-adn:active,.btn-adn.active,.open>.dropdown-toggle.btn-adn{color:#fff;background-color:#ce563f;border-color:rgba(0,0,0,0.2)}
|
.btn-adn{color:#fff;background-color:#d87a68;border-color:rgba(0,0,0,0.2)}.btn-adn:hover,.btn-adn:focus,.btn-adn:active,.btn-adn.active,.open>.dropdown-toggle.btn-adn{color:#fff;background-color:#ce563f;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-adn:active,.btn-adn.active,.open>.dropdown-toggle.btn-adn{background-image:none}
|
.btn-adn:active,.btn-adn.active,.open>.dropdown-toggle.btn-adn{background-image:none}
|
||||||
.btn-adn.disabled,.btn-adn[disabled],fieldset[disabled] .btn-adn,.btn-adn.disabled:hover,.btn-adn[disabled]:hover,fieldset[disabled] .btn-adn:hover,.btn-adn.disabled:focus,.btn-adn[disabled]:focus,fieldset[disabled] .btn-adn:focus,.btn-adn.disabled:active,.btn-adn[disabled]:active,fieldset[disabled] .btn-adn:active,.btn-adn.disabled.active,.btn-adn[disabled].active,fieldset[disabled] .btn-adn.active{background-color:#d87a68;border-color:rgba(0,0,0,0.2)}
|
.btn-adn.disabled,.btn-adn[disabled],fieldset[disabled] .btn-adn,.btn-adn.disabled:hover,.btn-adn[disabled]:hover,fieldset[disabled] .btn-adn:hover,.btn-adn.disabled:focus,.btn-adn[disabled]:focus,fieldset[disabled] .btn-adn:focus,.btn-adn.disabled:active,.btn-adn[disabled]:active,fieldset[disabled] .btn-adn:active,.btn-adn.disabled.active,.btn-adn[disabled].active,fieldset[disabled] .btn-adn.active{background-color:#d87a68;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-adn .badge{color:#d87a68;background-color:#fff}
|
.btn-adn .badge{color:#d87a68;background-color:#fff}
|
||||||
.btn-bitbucket{color:#fff;background-color:#205081;border-color:rgba(0,0,0,0.2)}.btn-bitbucket:hover,.btn-bitbucket:focus,.btn-bitbucket:active,.btn-bitbucket.active,.open>.dropdown-toggle.btn-bitbucket{color:#fff;background-color:#163758;border-color:rgba(0,0,0,0.2)}
|
.btn-bitbucket{color:#fff;background-color:#205081;border-color:rgba(0,0,0,0.2)}.btn-bitbucket:hover,.btn-bitbucket:focus,.btn-bitbucket:active,.btn-bitbucket.active,.open>.dropdown-toggle.btn-bitbucket{color:#fff;background-color:#163758;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-bitbucket:active,.btn-bitbucket.active,.open>.dropdown-toggle.btn-bitbucket{background-image:none}
|
.btn-bitbucket:active,.btn-bitbucket.active,.open>.dropdown-toggle.btn-bitbucket{background-image:none}
|
||||||
.btn-bitbucket.disabled,.btn-bitbucket[disabled],fieldset[disabled] .btn-bitbucket,.btn-bitbucket.disabled:hover,.btn-bitbucket[disabled]:hover,fieldset[disabled] .btn-bitbucket:hover,.btn-bitbucket.disabled:focus,.btn-bitbucket[disabled]:focus,fieldset[disabled] .btn-bitbucket:focus,.btn-bitbucket.disabled:active,.btn-bitbucket[disabled]:active,fieldset[disabled] .btn-bitbucket:active,.btn-bitbucket.disabled.active,.btn-bitbucket[disabled].active,fieldset[disabled] .btn-bitbucket.active{background-color:#205081;border-color:rgba(0,0,0,0.2)}
|
.btn-bitbucket.disabled,.btn-bitbucket[disabled],fieldset[disabled] .btn-bitbucket,.btn-bitbucket.disabled:hover,.btn-bitbucket[disabled]:hover,fieldset[disabled] .btn-bitbucket:hover,.btn-bitbucket.disabled:focus,.btn-bitbucket[disabled]:focus,fieldset[disabled] .btn-bitbucket:focus,.btn-bitbucket.disabled:active,.btn-bitbucket[disabled]:active,fieldset[disabled] .btn-bitbucket:active,.btn-bitbucket.disabled.active,.btn-bitbucket[disabled].active,fieldset[disabled] .btn-bitbucket.active{background-color:#205081;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-bitbucket .badge{color:#205081;background-color:#fff}
|
.btn-bitbucket .badge{color:#205081;background-color:#fff}
|
||||||
.btn-dropbox{color:#fff;background-color:#1087dd;border-color:rgba(0,0,0,0.2)}.btn-dropbox:hover,.btn-dropbox:focus,.btn-dropbox:active,.btn-dropbox.active,.open>.dropdown-toggle.btn-dropbox{color:#fff;background-color:#0d6aad;border-color:rgba(0,0,0,0.2)}
|
.btn-dropbox{color:#fff;background-color:#1087dd;border-color:rgba(0,0,0,0.2)}.btn-dropbox:hover,.btn-dropbox:focus,.btn-dropbox:active,.btn-dropbox.active,.open>.dropdown-toggle.btn-dropbox{color:#fff;background-color:#0d6aad;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-dropbox:active,.btn-dropbox.active,.open>.dropdown-toggle.btn-dropbox{background-image:none}
|
.btn-dropbox:active,.btn-dropbox.active,.open>.dropdown-toggle.btn-dropbox{background-image:none}
|
||||||
.btn-dropbox.disabled,.btn-dropbox[disabled],fieldset[disabled] .btn-dropbox,.btn-dropbox.disabled:hover,.btn-dropbox[disabled]:hover,fieldset[disabled] .btn-dropbox:hover,.btn-dropbox.disabled:focus,.btn-dropbox[disabled]:focus,fieldset[disabled] .btn-dropbox:focus,.btn-dropbox.disabled:active,.btn-dropbox[disabled]:active,fieldset[disabled] .btn-dropbox:active,.btn-dropbox.disabled.active,.btn-dropbox[disabled].active,fieldset[disabled] .btn-dropbox.active{background-color:#1087dd;border-color:rgba(0,0,0,0.2)}
|
.btn-dropbox.disabled,.btn-dropbox[disabled],fieldset[disabled] .btn-dropbox,.btn-dropbox.disabled:hover,.btn-dropbox[disabled]:hover,fieldset[disabled] .btn-dropbox:hover,.btn-dropbox.disabled:focus,.btn-dropbox[disabled]:focus,fieldset[disabled] .btn-dropbox:focus,.btn-dropbox.disabled:active,.btn-dropbox[disabled]:active,fieldset[disabled] .btn-dropbox:active,.btn-dropbox.disabled.active,.btn-dropbox[disabled].active,fieldset[disabled] .btn-dropbox.active{background-color:#1087dd;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-dropbox .badge{color:#1087dd;background-color:#fff}
|
.btn-dropbox .badge{color:#1087dd;background-color:#fff}
|
||||||
.btn-facebook{color:#fff;background-color:#3b5998;border-color:rgba(0,0,0,0.2)}.btn-facebook:hover,.btn-facebook:focus,.btn-facebook:active,.btn-facebook.active,.open>.dropdown-toggle.btn-facebook{color:#fff;background-color:#2d4373;border-color:rgba(0,0,0,0.2)}
|
.btn-facebook{color:#fff;background-color:#3b5998;border-color:rgba(0,0,0,0.2)}.btn-facebook:hover,.btn-facebook:focus,.btn-facebook:active,.btn-facebook.active,.open>.dropdown-toggle.btn-facebook{color:#fff;background-color:#2d4373;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-facebook:active,.btn-facebook.active,.open>.dropdown-toggle.btn-facebook{background-image:none}
|
.btn-facebook:active,.btn-facebook.active,.open>.dropdown-toggle.btn-facebook{background-image:none}
|
||||||
.btn-facebook.disabled,.btn-facebook[disabled],fieldset[disabled] .btn-facebook,.btn-facebook.disabled:hover,.btn-facebook[disabled]:hover,fieldset[disabled] .btn-facebook:hover,.btn-facebook.disabled:focus,.btn-facebook[disabled]:focus,fieldset[disabled] .btn-facebook:focus,.btn-facebook.disabled:active,.btn-facebook[disabled]:active,fieldset[disabled] .btn-facebook:active,.btn-facebook.disabled.active,.btn-facebook[disabled].active,fieldset[disabled] .btn-facebook.active{background-color:#3b5998;border-color:rgba(0,0,0,0.2)}
|
.btn-facebook.disabled,.btn-facebook[disabled],fieldset[disabled] .btn-facebook,.btn-facebook.disabled:hover,.btn-facebook[disabled]:hover,fieldset[disabled] .btn-facebook:hover,.btn-facebook.disabled:focus,.btn-facebook[disabled]:focus,fieldset[disabled] .btn-facebook:focus,.btn-facebook.disabled:active,.btn-facebook[disabled]:active,fieldset[disabled] .btn-facebook:active,.btn-facebook.disabled.active,.btn-facebook[disabled].active,fieldset[disabled] .btn-facebook.active{background-color:#3b5998;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-facebook .badge{color:#3b5998;background-color:#fff}
|
.btn-facebook .badge{color:#3b5998;background-color:#fff}
|
||||||
.btn-flickr{color:#fff;background-color:#ff0084;border-color:rgba(0,0,0,0.2)}.btn-flickr:hover,.btn-flickr:focus,.btn-flickr:active,.btn-flickr.active,.open>.dropdown-toggle.btn-flickr{color:#fff;background-color:#cc006a;border-color:rgba(0,0,0,0.2)}
|
.btn-flickr{color:#fff;background-color:#ff0084;border-color:rgba(0,0,0,0.2)}.btn-flickr:hover,.btn-flickr:focus,.btn-flickr:active,.btn-flickr.active,.open>.dropdown-toggle.btn-flickr{color:#fff;background-color:#cc006a;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-flickr:active,.btn-flickr.active,.open>.dropdown-toggle.btn-flickr{background-image:none}
|
.btn-flickr:active,.btn-flickr.active,.open>.dropdown-toggle.btn-flickr{background-image:none}
|
||||||
.btn-flickr.disabled,.btn-flickr[disabled],fieldset[disabled] .btn-flickr,.btn-flickr.disabled:hover,.btn-flickr[disabled]:hover,fieldset[disabled] .btn-flickr:hover,.btn-flickr.disabled:focus,.btn-flickr[disabled]:focus,fieldset[disabled] .btn-flickr:focus,.btn-flickr.disabled:active,.btn-flickr[disabled]:active,fieldset[disabled] .btn-flickr:active,.btn-flickr.disabled.active,.btn-flickr[disabled].active,fieldset[disabled] .btn-flickr.active{background-color:#ff0084;border-color:rgba(0,0,0,0.2)}
|
.btn-flickr.disabled,.btn-flickr[disabled],fieldset[disabled] .btn-flickr,.btn-flickr.disabled:hover,.btn-flickr[disabled]:hover,fieldset[disabled] .btn-flickr:hover,.btn-flickr.disabled:focus,.btn-flickr[disabled]:focus,fieldset[disabled] .btn-flickr:focus,.btn-flickr.disabled:active,.btn-flickr[disabled]:active,fieldset[disabled] .btn-flickr:active,.btn-flickr.disabled.active,.btn-flickr[disabled].active,fieldset[disabled] .btn-flickr.active{background-color:#ff0084;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-flickr .badge{color:#ff0084;background-color:#fff}
|
.btn-flickr .badge{color:#ff0084;background-color:#fff}
|
||||||
.btn-foursquare{color:#fff;background-color:#f94877;border-color:rgba(0,0,0,0.2)}.btn-foursquare:hover,.btn-foursquare:focus,.btn-foursquare:active,.btn-foursquare.active,.open>.dropdown-toggle.btn-foursquare{color:#fff;background-color:#f71752;border-color:rgba(0,0,0,0.2)}
|
.btn-foursquare{color:#fff;background-color:#f94877;border-color:rgba(0,0,0,0.2)}.btn-foursquare:hover,.btn-foursquare:focus,.btn-foursquare:active,.btn-foursquare.active,.open>.dropdown-toggle.btn-foursquare{color:#fff;background-color:#f71752;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-foursquare:active,.btn-foursquare.active,.open>.dropdown-toggle.btn-foursquare{background-image:none}
|
.btn-foursquare:active,.btn-foursquare.active,.open>.dropdown-toggle.btn-foursquare{background-image:none}
|
||||||
.btn-foursquare.disabled,.btn-foursquare[disabled],fieldset[disabled] .btn-foursquare,.btn-foursquare.disabled:hover,.btn-foursquare[disabled]:hover,fieldset[disabled] .btn-foursquare:hover,.btn-foursquare.disabled:focus,.btn-foursquare[disabled]:focus,fieldset[disabled] .btn-foursquare:focus,.btn-foursquare.disabled:active,.btn-foursquare[disabled]:active,fieldset[disabled] .btn-foursquare:active,.btn-foursquare.disabled.active,.btn-foursquare[disabled].active,fieldset[disabled] .btn-foursquare.active{background-color:#f94877;border-color:rgba(0,0,0,0.2)}
|
.btn-foursquare.disabled,.btn-foursquare[disabled],fieldset[disabled] .btn-foursquare,.btn-foursquare.disabled:hover,.btn-foursquare[disabled]:hover,fieldset[disabled] .btn-foursquare:hover,.btn-foursquare.disabled:focus,.btn-foursquare[disabled]:focus,fieldset[disabled] .btn-foursquare:focus,.btn-foursquare.disabled:active,.btn-foursquare[disabled]:active,fieldset[disabled] .btn-foursquare:active,.btn-foursquare.disabled.active,.btn-foursquare[disabled].active,fieldset[disabled] .btn-foursquare.active{background-color:#f94877;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-foursquare .badge{color:#f94877;background-color:#fff}
|
.btn-foursquare .badge{color:#f94877;background-color:#fff}
|
||||||
.btn-github{color:#fff;background-color:#444;border-color:rgba(0,0,0,0.2)}.btn-github:hover,.btn-github:focus,.btn-github:active,.btn-github.active,.open>.dropdown-toggle.btn-github{color:#fff;background-color:#2b2b2b;border-color:rgba(0,0,0,0.2)}
|
.btn-github{color:#fff;background-color:#444;border-color:rgba(0,0,0,0.2)}.btn-github:hover,.btn-github:focus,.btn-github:active,.btn-github.active,.open>.dropdown-toggle.btn-github{color:#fff;background-color:#2b2b2b;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-github:active,.btn-github.active,.open>.dropdown-toggle.btn-github{background-image:none}
|
.btn-github:active,.btn-github.active,.open>.dropdown-toggle.btn-github{background-image:none}
|
||||||
.btn-github.disabled,.btn-github[disabled],fieldset[disabled] .btn-github,.btn-github.disabled:hover,.btn-github[disabled]:hover,fieldset[disabled] .btn-github:hover,.btn-github.disabled:focus,.btn-github[disabled]:focus,fieldset[disabled] .btn-github:focus,.btn-github.disabled:active,.btn-github[disabled]:active,fieldset[disabled] .btn-github:active,.btn-github.disabled.active,.btn-github[disabled].active,fieldset[disabled] .btn-github.active{background-color:#444;border-color:rgba(0,0,0,0.2)}
|
.btn-github.disabled,.btn-github[disabled],fieldset[disabled] .btn-github,.btn-github.disabled:hover,.btn-github[disabled]:hover,fieldset[disabled] .btn-github:hover,.btn-github.disabled:focus,.btn-github[disabled]:focus,fieldset[disabled] .btn-github:focus,.btn-github.disabled:active,.btn-github[disabled]:active,fieldset[disabled] .btn-github:active,.btn-github.disabled.active,.btn-github[disabled].active,fieldset[disabled] .btn-github.active{background-color:#444;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-github .badge{color:#444;background-color:#fff}
|
.btn-github .badge{color:#444;background-color:#fff}
|
||||||
.btn-google-plus{color:#fff;background-color:#dd4b39;border-color:rgba(0,0,0,0.2)}.btn-google-plus:hover,.btn-google-plus:focus,.btn-google-plus:active,.btn-google-plus.active,.open>.dropdown-toggle.btn-google-plus{color:#fff;background-color:#c23321;border-color:rgba(0,0,0,0.2)}
|
.btn-google-plus{color:#fff;background-color:#dd4b39;border-color:rgba(0,0,0,0.2)}.btn-google-plus:hover,.btn-google-plus:focus,.btn-google-plus:active,.btn-google-plus.active,.open>.dropdown-toggle.btn-google-plus{color:#fff;background-color:#c23321;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-google-plus:active,.btn-google-plus.active,.open>.dropdown-toggle.btn-google-plus{background-image:none}
|
.btn-google-plus:active,.btn-google-plus.active,.open>.dropdown-toggle.btn-google-plus{background-image:none}
|
||||||
.btn-google-plus.disabled,.btn-google-plus[disabled],fieldset[disabled] .btn-google-plus,.btn-google-plus.disabled:hover,.btn-google-plus[disabled]:hover,fieldset[disabled] .btn-google-plus:hover,.btn-google-plus.disabled:focus,.btn-google-plus[disabled]:focus,fieldset[disabled] .btn-google-plus:focus,.btn-google-plus.disabled:active,.btn-google-plus[disabled]:active,fieldset[disabled] .btn-google-plus:active,.btn-google-plus.disabled.active,.btn-google-plus[disabled].active,fieldset[disabled] .btn-google-plus.active{background-color:#dd4b39;border-color:rgba(0,0,0,0.2)}
|
.btn-google-plus.disabled,.btn-google-plus[disabled],fieldset[disabled] .btn-google-plus,.btn-google-plus.disabled:hover,.btn-google-plus[disabled]:hover,fieldset[disabled] .btn-google-plus:hover,.btn-google-plus.disabled:focus,.btn-google-plus[disabled]:focus,fieldset[disabled] .btn-google-plus:focus,.btn-google-plus.disabled:active,.btn-google-plus[disabled]:active,fieldset[disabled] .btn-google-plus:active,.btn-google-plus.disabled.active,.btn-google-plus[disabled].active,fieldset[disabled] .btn-google-plus.active{background-color:#dd4b39;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-google-plus .badge{color:#dd4b39;background-color:#fff}
|
.btn-google-plus .badge{color:#dd4b39;background-color:#fff}
|
||||||
.btn-instagram{color:#fff;background-color:#3f729b;border-color:rgba(0,0,0,0.2)}.btn-instagram:hover,.btn-instagram:focus,.btn-instagram:active,.btn-instagram.active,.open>.dropdown-toggle.btn-instagram{color:#fff;background-color:#305777;border-color:rgba(0,0,0,0.2)}
|
.btn-instagram{color:#fff;background-color:#3f729b;border-color:rgba(0,0,0,0.2)}.btn-instagram:hover,.btn-instagram:focus,.btn-instagram:active,.btn-instagram.active,.open>.dropdown-toggle.btn-instagram{color:#fff;background-color:#305777;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-instagram:active,.btn-instagram.active,.open>.dropdown-toggle.btn-instagram{background-image:none}
|
.btn-instagram:active,.btn-instagram.active,.open>.dropdown-toggle.btn-instagram{background-image:none}
|
||||||
.btn-instagram.disabled,.btn-instagram[disabled],fieldset[disabled] .btn-instagram,.btn-instagram.disabled:hover,.btn-instagram[disabled]:hover,fieldset[disabled] .btn-instagram:hover,.btn-instagram.disabled:focus,.btn-instagram[disabled]:focus,fieldset[disabled] .btn-instagram:focus,.btn-instagram.disabled:active,.btn-instagram[disabled]:active,fieldset[disabled] .btn-instagram:active,.btn-instagram.disabled.active,.btn-instagram[disabled].active,fieldset[disabled] .btn-instagram.active{background-color:#3f729b;border-color:rgba(0,0,0,0.2)}
|
.btn-instagram.disabled,.btn-instagram[disabled],fieldset[disabled] .btn-instagram,.btn-instagram.disabled:hover,.btn-instagram[disabled]:hover,fieldset[disabled] .btn-instagram:hover,.btn-instagram.disabled:focus,.btn-instagram[disabled]:focus,fieldset[disabled] .btn-instagram:focus,.btn-instagram.disabled:active,.btn-instagram[disabled]:active,fieldset[disabled] .btn-instagram:active,.btn-instagram.disabled.active,.btn-instagram[disabled].active,fieldset[disabled] .btn-instagram.active{background-color:#3f729b;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-instagram .badge{color:#3f729b;background-color:#fff}
|
.btn-instagram .badge{color:#3f729b;background-color:#fff}
|
||||||
.btn-linkedin{color:#fff;background-color:#007bb6;border-color:rgba(0,0,0,0.2)}.btn-linkedin:hover,.btn-linkedin:focus,.btn-linkedin:active,.btn-linkedin.active,.open>.dropdown-toggle.btn-linkedin{color:#fff;background-color:#005983;border-color:rgba(0,0,0,0.2)}
|
.btn-linkedin{color:#fff;background-color:#007bb6;border-color:rgba(0,0,0,0.2)}.btn-linkedin:hover,.btn-linkedin:focus,.btn-linkedin:active,.btn-linkedin.active,.open>.dropdown-toggle.btn-linkedin{color:#fff;background-color:#005983;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-linkedin:active,.btn-linkedin.active,.open>.dropdown-toggle.btn-linkedin{background-image:none}
|
.btn-linkedin:active,.btn-linkedin.active,.open>.dropdown-toggle.btn-linkedin{background-image:none}
|
||||||
.btn-linkedin.disabled,.btn-linkedin[disabled],fieldset[disabled] .btn-linkedin,.btn-linkedin.disabled:hover,.btn-linkedin[disabled]:hover,fieldset[disabled] .btn-linkedin:hover,.btn-linkedin.disabled:focus,.btn-linkedin[disabled]:focus,fieldset[disabled] .btn-linkedin:focus,.btn-linkedin.disabled:active,.btn-linkedin[disabled]:active,fieldset[disabled] .btn-linkedin:active,.btn-linkedin.disabled.active,.btn-linkedin[disabled].active,fieldset[disabled] .btn-linkedin.active{background-color:#007bb6;border-color:rgba(0,0,0,0.2)}
|
.btn-linkedin.disabled,.btn-linkedin[disabled],fieldset[disabled] .btn-linkedin,.btn-linkedin.disabled:hover,.btn-linkedin[disabled]:hover,fieldset[disabled] .btn-linkedin:hover,.btn-linkedin.disabled:focus,.btn-linkedin[disabled]:focus,fieldset[disabled] .btn-linkedin:focus,.btn-linkedin.disabled:active,.btn-linkedin[disabled]:active,fieldset[disabled] .btn-linkedin:active,.btn-linkedin.disabled.active,.btn-linkedin[disabled].active,fieldset[disabled] .btn-linkedin.active{background-color:#007bb6;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-linkedin .badge{color:#007bb6;background-color:#fff}
|
.btn-linkedin .badge{color:#007bb6;background-color:#fff}
|
||||||
.btn-microsoft{color:#fff;background-color:#2672ec;border-color:rgba(0,0,0,0.2)}.btn-microsoft:hover,.btn-microsoft:focus,.btn-microsoft:active,.btn-microsoft.active,.open>.dropdown-toggle.btn-microsoft{color:#fff;background-color:#125acd;border-color:rgba(0,0,0,0.2)}
|
.btn-microsoft{color:#fff;background-color:#2672ec;border-color:rgba(0,0,0,0.2)}.btn-microsoft:hover,.btn-microsoft:focus,.btn-microsoft:active,.btn-microsoft.active,.open>.dropdown-toggle.btn-microsoft{color:#fff;background-color:#125acd;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-microsoft:active,.btn-microsoft.active,.open>.dropdown-toggle.btn-microsoft{background-image:none}
|
.btn-microsoft:active,.btn-microsoft.active,.open>.dropdown-toggle.btn-microsoft{background-image:none}
|
||||||
.btn-microsoft.disabled,.btn-microsoft[disabled],fieldset[disabled] .btn-microsoft,.btn-microsoft.disabled:hover,.btn-microsoft[disabled]:hover,fieldset[disabled] .btn-microsoft:hover,.btn-microsoft.disabled:focus,.btn-microsoft[disabled]:focus,fieldset[disabled] .btn-microsoft:focus,.btn-microsoft.disabled:active,.btn-microsoft[disabled]:active,fieldset[disabled] .btn-microsoft:active,.btn-microsoft.disabled.active,.btn-microsoft[disabled].active,fieldset[disabled] .btn-microsoft.active{background-color:#2672ec;border-color:rgba(0,0,0,0.2)}
|
.btn-microsoft.disabled,.btn-microsoft[disabled],fieldset[disabled] .btn-microsoft,.btn-microsoft.disabled:hover,.btn-microsoft[disabled]:hover,fieldset[disabled] .btn-microsoft:hover,.btn-microsoft.disabled:focus,.btn-microsoft[disabled]:focus,fieldset[disabled] .btn-microsoft:focus,.btn-microsoft.disabled:active,.btn-microsoft[disabled]:active,fieldset[disabled] .btn-microsoft:active,.btn-microsoft.disabled.active,.btn-microsoft[disabled].active,fieldset[disabled] .btn-microsoft.active{background-color:#2672ec;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-microsoft .badge{color:#2672ec;background-color:#fff}
|
.btn-microsoft .badge{color:#2672ec;background-color:#fff}
|
||||||
.btn-openid{color:#fff;background-color:#f7931e;border-color:rgba(0,0,0,0.2)}.btn-openid:hover,.btn-openid:focus,.btn-openid:active,.btn-openid.active,.open>.dropdown-toggle.btn-openid{color:#fff;background-color:#da7908;border-color:rgba(0,0,0,0.2)}
|
.btn-openid{color:#fff;background-color:#f7931e;border-color:rgba(0,0,0,0.2)}.btn-openid:hover,.btn-openid:focus,.btn-openid:active,.btn-openid.active,.open>.dropdown-toggle.btn-openid{color:#fff;background-color:#da7908;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-openid:active,.btn-openid.active,.open>.dropdown-toggle.btn-openid{background-image:none}
|
.btn-openid:active,.btn-openid.active,.open>.dropdown-toggle.btn-openid{background-image:none}
|
||||||
.btn-openid.disabled,.btn-openid[disabled],fieldset[disabled] .btn-openid,.btn-openid.disabled:hover,.btn-openid[disabled]:hover,fieldset[disabled] .btn-openid:hover,.btn-openid.disabled:focus,.btn-openid[disabled]:focus,fieldset[disabled] .btn-openid:focus,.btn-openid.disabled:active,.btn-openid[disabled]:active,fieldset[disabled] .btn-openid:active,.btn-openid.disabled.active,.btn-openid[disabled].active,fieldset[disabled] .btn-openid.active{background-color:#f7931e;border-color:rgba(0,0,0,0.2)}
|
.btn-openid.disabled,.btn-openid[disabled],fieldset[disabled] .btn-openid,.btn-openid.disabled:hover,.btn-openid[disabled]:hover,fieldset[disabled] .btn-openid:hover,.btn-openid.disabled:focus,.btn-openid[disabled]:focus,fieldset[disabled] .btn-openid:focus,.btn-openid.disabled:active,.btn-openid[disabled]:active,fieldset[disabled] .btn-openid:active,.btn-openid.disabled.active,.btn-openid[disabled].active,fieldset[disabled] .btn-openid.active{background-color:#f7931e;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-openid .badge{color:#f7931e;background-color:#fff}
|
.btn-openid .badge{color:#f7931e;background-color:#fff}
|
||||||
.btn-pinterest{color:#fff;background-color:#cb2027;border-color:rgba(0,0,0,0.2)}.btn-pinterest:hover,.btn-pinterest:focus,.btn-pinterest:active,.btn-pinterest.active,.open>.dropdown-toggle.btn-pinterest{color:#fff;background-color:#9f191f;border-color:rgba(0,0,0,0.2)}
|
.btn-pinterest{color:#fff;background-color:#cb2027;border-color:rgba(0,0,0,0.2)}.btn-pinterest:hover,.btn-pinterest:focus,.btn-pinterest:active,.btn-pinterest.active,.open>.dropdown-toggle.btn-pinterest{color:#fff;background-color:#9f191f;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-pinterest:active,.btn-pinterest.active,.open>.dropdown-toggle.btn-pinterest{background-image:none}
|
.btn-pinterest:active,.btn-pinterest.active,.open>.dropdown-toggle.btn-pinterest{background-image:none}
|
||||||
.btn-pinterest.disabled,.btn-pinterest[disabled],fieldset[disabled] .btn-pinterest,.btn-pinterest.disabled:hover,.btn-pinterest[disabled]:hover,fieldset[disabled] .btn-pinterest:hover,.btn-pinterest.disabled:focus,.btn-pinterest[disabled]:focus,fieldset[disabled] .btn-pinterest:focus,.btn-pinterest.disabled:active,.btn-pinterest[disabled]:active,fieldset[disabled] .btn-pinterest:active,.btn-pinterest.disabled.active,.btn-pinterest[disabled].active,fieldset[disabled] .btn-pinterest.active{background-color:#cb2027;border-color:rgba(0,0,0,0.2)}
|
.btn-pinterest.disabled,.btn-pinterest[disabled],fieldset[disabled] .btn-pinterest,.btn-pinterest.disabled:hover,.btn-pinterest[disabled]:hover,fieldset[disabled] .btn-pinterest:hover,.btn-pinterest.disabled:focus,.btn-pinterest[disabled]:focus,fieldset[disabled] .btn-pinterest:focus,.btn-pinterest.disabled:active,.btn-pinterest[disabled]:active,fieldset[disabled] .btn-pinterest:active,.btn-pinterest.disabled.active,.btn-pinterest[disabled].active,fieldset[disabled] .btn-pinterest.active{background-color:#cb2027;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-pinterest .badge{color:#cb2027;background-color:#fff}
|
.btn-pinterest .badge{color:#cb2027;background-color:#fff}
|
||||||
.btn-reddit{color:#000;background-color:#eff7ff;border-color:rgba(0,0,0,0.2)}.btn-reddit:hover,.btn-reddit:focus,.btn-reddit:active,.btn-reddit.active,.open>.dropdown-toggle.btn-reddit{color:#000;background-color:#bcddff;border-color:rgba(0,0,0,0.2)}
|
.btn-reddit{color:#000;background-color:#eff7ff;border-color:rgba(0,0,0,0.2)}.btn-reddit:hover,.btn-reddit:focus,.btn-reddit:active,.btn-reddit.active,.open>.dropdown-toggle.btn-reddit{color:#000;background-color:#bcddff;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-reddit:active,.btn-reddit.active,.open>.dropdown-toggle.btn-reddit{background-image:none}
|
.btn-reddit:active,.btn-reddit.active,.open>.dropdown-toggle.btn-reddit{background-image:none}
|
||||||
.btn-reddit.disabled,.btn-reddit[disabled],fieldset[disabled] .btn-reddit,.btn-reddit.disabled:hover,.btn-reddit[disabled]:hover,fieldset[disabled] .btn-reddit:hover,.btn-reddit.disabled:focus,.btn-reddit[disabled]:focus,fieldset[disabled] .btn-reddit:focus,.btn-reddit.disabled:active,.btn-reddit[disabled]:active,fieldset[disabled] .btn-reddit:active,.btn-reddit.disabled.active,.btn-reddit[disabled].active,fieldset[disabled] .btn-reddit.active{background-color:#eff7ff;border-color:rgba(0,0,0,0.2)}
|
.btn-reddit.disabled,.btn-reddit[disabled],fieldset[disabled] .btn-reddit,.btn-reddit.disabled:hover,.btn-reddit[disabled]:hover,fieldset[disabled] .btn-reddit:hover,.btn-reddit.disabled:focus,.btn-reddit[disabled]:focus,fieldset[disabled] .btn-reddit:focus,.btn-reddit.disabled:active,.btn-reddit[disabled]:active,fieldset[disabled] .btn-reddit:active,.btn-reddit.disabled.active,.btn-reddit[disabled].active,fieldset[disabled] .btn-reddit.active{background-color:#eff7ff;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-reddit .badge{color:#eff7ff;background-color:#000}
|
.btn-reddit .badge{color:#eff7ff;background-color:#000}
|
||||||
.btn-soundcloud{color:#fff;background-color:#f50;border-color:rgba(0,0,0,0.2)}.btn-soundcloud:hover,.btn-soundcloud:focus,.btn-soundcloud:active,.btn-soundcloud.active,.open>.dropdown-toggle.btn-soundcloud{color:#fff;background-color:#c40;border-color:rgba(0,0,0,0.2)}
|
.btn-soundcloud{color:#fff;background-color:#f50;border-color:rgba(0,0,0,0.2)}.btn-soundcloud:hover,.btn-soundcloud:focus,.btn-soundcloud:active,.btn-soundcloud.active,.open>.dropdown-toggle.btn-soundcloud{color:#fff;background-color:#c40;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-soundcloud:active,.btn-soundcloud.active,.open>.dropdown-toggle.btn-soundcloud{background-image:none}
|
.btn-soundcloud:active,.btn-soundcloud.active,.open>.dropdown-toggle.btn-soundcloud{background-image:none}
|
||||||
.btn-soundcloud.disabled,.btn-soundcloud[disabled],fieldset[disabled] .btn-soundcloud,.btn-soundcloud.disabled:hover,.btn-soundcloud[disabled]:hover,fieldset[disabled] .btn-soundcloud:hover,.btn-soundcloud.disabled:focus,.btn-soundcloud[disabled]:focus,fieldset[disabled] .btn-soundcloud:focus,.btn-soundcloud.disabled:active,.btn-soundcloud[disabled]:active,fieldset[disabled] .btn-soundcloud:active,.btn-soundcloud.disabled.active,.btn-soundcloud[disabled].active,fieldset[disabled] .btn-soundcloud.active{background-color:#f50;border-color:rgba(0,0,0,0.2)}
|
.btn-soundcloud.disabled,.btn-soundcloud[disabled],fieldset[disabled] .btn-soundcloud,.btn-soundcloud.disabled:hover,.btn-soundcloud[disabled]:hover,fieldset[disabled] .btn-soundcloud:hover,.btn-soundcloud.disabled:focus,.btn-soundcloud[disabled]:focus,fieldset[disabled] .btn-soundcloud:focus,.btn-soundcloud.disabled:active,.btn-soundcloud[disabled]:active,fieldset[disabled] .btn-soundcloud:active,.btn-soundcloud.disabled.active,.btn-soundcloud[disabled].active,fieldset[disabled] .btn-soundcloud.active{background-color:#f50;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-soundcloud .badge{color:#f50;background-color:#fff}
|
.btn-soundcloud .badge{color:#f50;background-color:#fff}
|
||||||
.btn-tumblr{color:#fff;background-color:#2c4762;border-color:rgba(0,0,0,0.2)}.btn-tumblr:hover,.btn-tumblr:focus,.btn-tumblr:active,.btn-tumblr.active,.open>.dropdown-toggle.btn-tumblr{color:#fff;background-color:#1c2d3f;border-color:rgba(0,0,0,0.2)}
|
.btn-tumblr{color:#fff;background-color:#2c4762;border-color:rgba(0,0,0,0.2)}.btn-tumblr:hover,.btn-tumblr:focus,.btn-tumblr:active,.btn-tumblr.active,.open>.dropdown-toggle.btn-tumblr{color:#fff;background-color:#1c2d3f;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-tumblr:active,.btn-tumblr.active,.open>.dropdown-toggle.btn-tumblr{background-image:none}
|
.btn-tumblr:active,.btn-tumblr.active,.open>.dropdown-toggle.btn-tumblr{background-image:none}
|
||||||
.btn-tumblr.disabled,.btn-tumblr[disabled],fieldset[disabled] .btn-tumblr,.btn-tumblr.disabled:hover,.btn-tumblr[disabled]:hover,fieldset[disabled] .btn-tumblr:hover,.btn-tumblr.disabled:focus,.btn-tumblr[disabled]:focus,fieldset[disabled] .btn-tumblr:focus,.btn-tumblr.disabled:active,.btn-tumblr[disabled]:active,fieldset[disabled] .btn-tumblr:active,.btn-tumblr.disabled.active,.btn-tumblr[disabled].active,fieldset[disabled] .btn-tumblr.active{background-color:#2c4762;border-color:rgba(0,0,0,0.2)}
|
.btn-tumblr.disabled,.btn-tumblr[disabled],fieldset[disabled] .btn-tumblr,.btn-tumblr.disabled:hover,.btn-tumblr[disabled]:hover,fieldset[disabled] .btn-tumblr:hover,.btn-tumblr.disabled:focus,.btn-tumblr[disabled]:focus,fieldset[disabled] .btn-tumblr:focus,.btn-tumblr.disabled:active,.btn-tumblr[disabled]:active,fieldset[disabled] .btn-tumblr:active,.btn-tumblr.disabled.active,.btn-tumblr[disabled].active,fieldset[disabled] .btn-tumblr.active{background-color:#2c4762;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-tumblr .badge{color:#2c4762;background-color:#fff}
|
.btn-tumblr .badge{color:#2c4762;background-color:#fff}
|
||||||
.btn-twitter{color:#fff;background-color:#55acee;border-color:rgba(0,0,0,0.2)}.btn-twitter:hover,.btn-twitter:focus,.btn-twitter:active,.btn-twitter.active,.open>.dropdown-toggle.btn-twitter{color:#fff;background-color:#2795e9;border-color:rgba(0,0,0,0.2)}
|
.btn-twitter{color:#fff;background-color:#55acee;border-color:rgba(0,0,0,0.2)}.btn-twitter:hover,.btn-twitter:focus,.btn-twitter:active,.btn-twitter.active,.open>.dropdown-toggle.btn-twitter{color:#fff;background-color:#2795e9;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-twitter:active,.btn-twitter.active,.open>.dropdown-toggle.btn-twitter{background-image:none}
|
.btn-twitter:active,.btn-twitter.active,.open>.dropdown-toggle.btn-twitter{background-image:none}
|
||||||
.btn-twitter.disabled,.btn-twitter[disabled],fieldset[disabled] .btn-twitter,.btn-twitter.disabled:hover,.btn-twitter[disabled]:hover,fieldset[disabled] .btn-twitter:hover,.btn-twitter.disabled:focus,.btn-twitter[disabled]:focus,fieldset[disabled] .btn-twitter:focus,.btn-twitter.disabled:active,.btn-twitter[disabled]:active,fieldset[disabled] .btn-twitter:active,.btn-twitter.disabled.active,.btn-twitter[disabled].active,fieldset[disabled] .btn-twitter.active{background-color:#55acee;border-color:rgba(0,0,0,0.2)}
|
.btn-twitter.disabled,.btn-twitter[disabled],fieldset[disabled] .btn-twitter,.btn-twitter.disabled:hover,.btn-twitter[disabled]:hover,fieldset[disabled] .btn-twitter:hover,.btn-twitter.disabled:focus,.btn-twitter[disabled]:focus,fieldset[disabled] .btn-twitter:focus,.btn-twitter.disabled:active,.btn-twitter[disabled]:active,fieldset[disabled] .btn-twitter:active,.btn-twitter.disabled.active,.btn-twitter[disabled].active,fieldset[disabled] .btn-twitter.active{background-color:#55acee;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-twitter .badge{color:#55acee;background-color:#fff}
|
.btn-twitter .badge{color:#55acee;background-color:#fff}
|
||||||
.btn-vimeo{color:#fff;background-color:#1ab7ea;border-color:rgba(0,0,0,0.2)}.btn-vimeo:hover,.btn-vimeo:focus,.btn-vimeo:active,.btn-vimeo.active,.open>.dropdown-toggle.btn-vimeo{color:#fff;background-color:#1295bf;border-color:rgba(0,0,0,0.2)}
|
.btn-vimeo{color:#fff;background-color:#1ab7ea;border-color:rgba(0,0,0,0.2)}.btn-vimeo:hover,.btn-vimeo:focus,.btn-vimeo:active,.btn-vimeo.active,.open>.dropdown-toggle.btn-vimeo{color:#fff;background-color:#1295bf;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-vimeo:active,.btn-vimeo.active,.open>.dropdown-toggle.btn-vimeo{background-image:none}
|
.btn-vimeo:active,.btn-vimeo.active,.open>.dropdown-toggle.btn-vimeo{background-image:none}
|
||||||
.btn-vimeo.disabled,.btn-vimeo[disabled],fieldset[disabled] .btn-vimeo,.btn-vimeo.disabled:hover,.btn-vimeo[disabled]:hover,fieldset[disabled] .btn-vimeo:hover,.btn-vimeo.disabled:focus,.btn-vimeo[disabled]:focus,fieldset[disabled] .btn-vimeo:focus,.btn-vimeo.disabled:active,.btn-vimeo[disabled]:active,fieldset[disabled] .btn-vimeo:active,.btn-vimeo.disabled.active,.btn-vimeo[disabled].active,fieldset[disabled] .btn-vimeo.active{background-color:#1ab7ea;border-color:rgba(0,0,0,0.2)}
|
.btn-vimeo.disabled,.btn-vimeo[disabled],fieldset[disabled] .btn-vimeo,.btn-vimeo.disabled:hover,.btn-vimeo[disabled]:hover,fieldset[disabled] .btn-vimeo:hover,.btn-vimeo.disabled:focus,.btn-vimeo[disabled]:focus,fieldset[disabled] .btn-vimeo:focus,.btn-vimeo.disabled:active,.btn-vimeo[disabled]:active,fieldset[disabled] .btn-vimeo:active,.btn-vimeo.disabled.active,.btn-vimeo[disabled].active,fieldset[disabled] .btn-vimeo.active{background-color:#1ab7ea;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-vimeo .badge{color:#1ab7ea;background-color:#fff}
|
.btn-vimeo .badge{color:#1ab7ea;background-color:#fff}
|
||||||
.btn-vk{color:#fff;background-color:#587ea3;border-color:rgba(0,0,0,0.2)}.btn-vk:hover,.btn-vk:focus,.btn-vk:active,.btn-vk.active,.open>.dropdown-toggle.btn-vk{color:#fff;background-color:#466482;border-color:rgba(0,0,0,0.2)}
|
.btn-vk{color:#fff;background-color:#587ea3;border-color:rgba(0,0,0,0.2)}.btn-vk:hover,.btn-vk:focus,.btn-vk:active,.btn-vk.active,.open>.dropdown-toggle.btn-vk{color:#fff;background-color:#466482;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-vk:active,.btn-vk.active,.open>.dropdown-toggle.btn-vk{background-image:none}
|
.btn-vk:active,.btn-vk.active,.open>.dropdown-toggle.btn-vk{background-image:none}
|
||||||
.btn-vk.disabled,.btn-vk[disabled],fieldset[disabled] .btn-vk,.btn-vk.disabled:hover,.btn-vk[disabled]:hover,fieldset[disabled] .btn-vk:hover,.btn-vk.disabled:focus,.btn-vk[disabled]:focus,fieldset[disabled] .btn-vk:focus,.btn-vk.disabled:active,.btn-vk[disabled]:active,fieldset[disabled] .btn-vk:active,.btn-vk.disabled.active,.btn-vk[disabled].active,fieldset[disabled] .btn-vk.active{background-color:#587ea3;border-color:rgba(0,0,0,0.2)}
|
.btn-vk.disabled,.btn-vk[disabled],fieldset[disabled] .btn-vk,.btn-vk.disabled:hover,.btn-vk[disabled]:hover,fieldset[disabled] .btn-vk:hover,.btn-vk.disabled:focus,.btn-vk[disabled]:focus,fieldset[disabled] .btn-vk:focus,.btn-vk.disabled:active,.btn-vk[disabled]:active,fieldset[disabled] .btn-vk:active,.btn-vk.disabled.active,.btn-vk[disabled].active,fieldset[disabled] .btn-vk.active{background-color:#587ea3;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-vk .badge{color:#587ea3;background-color:#fff}
|
.btn-vk .badge{color:#587ea3;background-color:#fff}
|
||||||
.btn-yahoo{color:#fff;background-color:#720e9e;border-color:rgba(0,0,0,0.2)}.btn-yahoo:hover,.btn-yahoo:focus,.btn-yahoo:active,.btn-yahoo.active,.open>.dropdown-toggle.btn-yahoo{color:#fff;background-color:#500a6f;border-color:rgba(0,0,0,0.2)}
|
.btn-yahoo{color:#fff;background-color:#720e9e;border-color:rgba(0,0,0,0.2)}.btn-yahoo:hover,.btn-yahoo:focus,.btn-yahoo:active,.btn-yahoo.active,.open>.dropdown-toggle.btn-yahoo{color:#fff;background-color:#500a6f;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-yahoo:active,.btn-yahoo.active,.open>.dropdown-toggle.btn-yahoo{background-image:none}
|
.btn-yahoo:active,.btn-yahoo.active,.open>.dropdown-toggle.btn-yahoo{background-image:none}
|
||||||
.btn-yahoo.disabled,.btn-yahoo[disabled],fieldset[disabled] .btn-yahoo,.btn-yahoo.disabled:hover,.btn-yahoo[disabled]:hover,fieldset[disabled] .btn-yahoo:hover,.btn-yahoo.disabled:focus,.btn-yahoo[disabled]:focus,fieldset[disabled] .btn-yahoo:focus,.btn-yahoo.disabled:active,.btn-yahoo[disabled]:active,fieldset[disabled] .btn-yahoo:active,.btn-yahoo.disabled.active,.btn-yahoo[disabled].active,fieldset[disabled] .btn-yahoo.active{background-color:#720e9e;border-color:rgba(0,0,0,0.2)}
|
.btn-yahoo.disabled,.btn-yahoo[disabled],fieldset[disabled] .btn-yahoo,.btn-yahoo.disabled:hover,.btn-yahoo[disabled]:hover,fieldset[disabled] .btn-yahoo:hover,.btn-yahoo.disabled:focus,.btn-yahoo[disabled]:focus,fieldset[disabled] .btn-yahoo:focus,.btn-yahoo.disabled:active,.btn-yahoo[disabled]:active,fieldset[disabled] .btn-yahoo:active,.btn-yahoo.disabled.active,.btn-yahoo[disabled].active,fieldset[disabled] .btn-yahoo.active{background-color:#720e9e;border-color:rgba(0,0,0,0.2)}
|
||||||
.btn-yahoo .badge{color:#720e9e;background-color:#fff}
|
.btn-yahoo .badge{color:#720e9e;background-color:#fff}
|
||||||
|
|||||||
+32
-32
@@ -1,32 +1,32 @@
|
|||||||
.CodeMirror-dialog {
|
.CodeMirror-dialog {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0; right: 0;
|
left: 0; right: 0;
|
||||||
background: inherit;
|
background: inherit;
|
||||||
z-index: 15;
|
z-index: 15;
|
||||||
padding: .1em .8em;
|
padding: .1em .8em;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-dialog-top {
|
.CodeMirror-dialog-top {
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-dialog-bottom {
|
.CodeMirror-dialog-bottom {
|
||||||
border-top: 1px solid #eee;
|
border-top: 1px solid #eee;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-dialog input {
|
.CodeMirror-dialog input {
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
width: 20em;
|
width: 20em;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-dialog button {
|
.CodeMirror-dialog button {
|
||||||
font-size: 70%;
|
font-size: 70%;
|
||||||
}
|
}
|
||||||
|
|||||||
+157
-157
@@ -1,157 +1,157 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
// Open simple dialogs on top of an editor. Relies on dialog.css.
|
// Open simple dialogs on top of an editor. Relies on dialog.css.
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
function dialogDiv(cm, template, bottom) {
|
function dialogDiv(cm, template, bottom) {
|
||||||
var wrap = cm.getWrapperElement();
|
var wrap = cm.getWrapperElement();
|
||||||
var dialog;
|
var dialog;
|
||||||
dialog = wrap.appendChild(document.createElement("div"));
|
dialog = wrap.appendChild(document.createElement("div"));
|
||||||
if (bottom)
|
if (bottom)
|
||||||
dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
|
dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
|
||||||
else
|
else
|
||||||
dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
|
dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
|
||||||
|
|
||||||
if (typeof template == "string") {
|
if (typeof template == "string") {
|
||||||
dialog.innerHTML = template;
|
dialog.innerHTML = template;
|
||||||
} else { // Assuming it's a detached DOM element.
|
} else { // Assuming it's a detached DOM element.
|
||||||
dialog.appendChild(template);
|
dialog.appendChild(template);
|
||||||
}
|
}
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeNotification(cm, newVal) {
|
function closeNotification(cm, newVal) {
|
||||||
if (cm.state.currentNotificationClose)
|
if (cm.state.currentNotificationClose)
|
||||||
cm.state.currentNotificationClose();
|
cm.state.currentNotificationClose();
|
||||||
cm.state.currentNotificationClose = newVal;
|
cm.state.currentNotificationClose = newVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.defineExtension("openDialog", function(template, callback, options) {
|
CodeMirror.defineExtension("openDialog", function(template, callback, options) {
|
||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
|
|
||||||
closeNotification(this, null);
|
closeNotification(this, null);
|
||||||
|
|
||||||
var dialog = dialogDiv(this, template, options.bottom);
|
var dialog = dialogDiv(this, template, options.bottom);
|
||||||
var closed = false, me = this;
|
var closed = false, me = this;
|
||||||
function close(newVal) {
|
function close(newVal) {
|
||||||
if (typeof newVal == 'string') {
|
if (typeof newVal == 'string') {
|
||||||
inp.value = newVal;
|
inp.value = newVal;
|
||||||
} else {
|
} else {
|
||||||
if (closed) return;
|
if (closed) return;
|
||||||
closed = true;
|
closed = true;
|
||||||
dialog.parentNode.removeChild(dialog);
|
dialog.parentNode.removeChild(dialog);
|
||||||
me.focus();
|
me.focus();
|
||||||
|
|
||||||
if (options.onClose) options.onClose(dialog);
|
if (options.onClose) options.onClose(dialog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var inp = dialog.getElementsByTagName("input")[0], button;
|
var inp = dialog.getElementsByTagName("input")[0], button;
|
||||||
if (inp) {
|
if (inp) {
|
||||||
if (options.value) {
|
if (options.value) {
|
||||||
inp.value = options.value;
|
inp.value = options.value;
|
||||||
if (options.selectValueOnOpen !== false) {
|
if (options.selectValueOnOpen !== false) {
|
||||||
inp.select();
|
inp.select();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.onInput)
|
if (options.onInput)
|
||||||
CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);});
|
CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);});
|
||||||
if (options.onKeyUp)
|
if (options.onKeyUp)
|
||||||
CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
|
CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
|
||||||
|
|
||||||
CodeMirror.on(inp, "keydown", function(e) {
|
CodeMirror.on(inp, "keydown", function(e) {
|
||||||
if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
|
if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
|
||||||
if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {
|
if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {
|
||||||
inp.blur();
|
inp.blur();
|
||||||
CodeMirror.e_stop(e);
|
CodeMirror.e_stop(e);
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
if (e.keyCode == 13) callback(inp.value, e);
|
if (e.keyCode == 13) callback(inp.value, e);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
|
if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
|
||||||
|
|
||||||
inp.focus();
|
inp.focus();
|
||||||
} else if (button = dialog.getElementsByTagName("button")[0]) {
|
} else if (button = dialog.getElementsByTagName("button")[0]) {
|
||||||
CodeMirror.on(button, "click", function() {
|
CodeMirror.on(button, "click", function() {
|
||||||
close();
|
close();
|
||||||
me.focus();
|
me.focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close);
|
if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close);
|
||||||
|
|
||||||
button.focus();
|
button.focus();
|
||||||
}
|
}
|
||||||
return close;
|
return close;
|
||||||
});
|
});
|
||||||
|
|
||||||
CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
|
CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
|
||||||
closeNotification(this, null);
|
closeNotification(this, null);
|
||||||
var dialog = dialogDiv(this, template, options && options.bottom);
|
var dialog = dialogDiv(this, template, options && options.bottom);
|
||||||
var buttons = dialog.getElementsByTagName("button");
|
var buttons = dialog.getElementsByTagName("button");
|
||||||
var closed = false, me = this, blurring = 1;
|
var closed = false, me = this, blurring = 1;
|
||||||
function close() {
|
function close() {
|
||||||
if (closed) return;
|
if (closed) return;
|
||||||
closed = true;
|
closed = true;
|
||||||
dialog.parentNode.removeChild(dialog);
|
dialog.parentNode.removeChild(dialog);
|
||||||
me.focus();
|
me.focus();
|
||||||
}
|
}
|
||||||
buttons[0].focus();
|
buttons[0].focus();
|
||||||
for (var i = 0; i < buttons.length; ++i) {
|
for (var i = 0; i < buttons.length; ++i) {
|
||||||
var b = buttons[i];
|
var b = buttons[i];
|
||||||
(function(callback) {
|
(function(callback) {
|
||||||
CodeMirror.on(b, "click", function(e) {
|
CodeMirror.on(b, "click", function(e) {
|
||||||
CodeMirror.e_preventDefault(e);
|
CodeMirror.e_preventDefault(e);
|
||||||
close();
|
close();
|
||||||
if (callback) callback(me);
|
if (callback) callback(me);
|
||||||
});
|
});
|
||||||
})(callbacks[i]);
|
})(callbacks[i]);
|
||||||
CodeMirror.on(b, "blur", function() {
|
CodeMirror.on(b, "blur", function() {
|
||||||
--blurring;
|
--blurring;
|
||||||
setTimeout(function() { if (blurring <= 0) close(); }, 200);
|
setTimeout(function() { if (blurring <= 0) close(); }, 200);
|
||||||
});
|
});
|
||||||
CodeMirror.on(b, "focus", function() { ++blurring; });
|
CodeMirror.on(b, "focus", function() { ++blurring; });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* openNotification
|
* openNotification
|
||||||
* Opens a notification, that can be closed with an optional timer
|
* Opens a notification, that can be closed with an optional timer
|
||||||
* (default 5000ms timer) and always closes on click.
|
* (default 5000ms timer) and always closes on click.
|
||||||
*
|
*
|
||||||
* If a notification is opened while another is opened, it will close the
|
* If a notification is opened while another is opened, it will close the
|
||||||
* currently opened one and open the new one immediately.
|
* currently opened one and open the new one immediately.
|
||||||
*/
|
*/
|
||||||
CodeMirror.defineExtension("openNotification", function(template, options) {
|
CodeMirror.defineExtension("openNotification", function(template, options) {
|
||||||
closeNotification(this, close);
|
closeNotification(this, close);
|
||||||
var dialog = dialogDiv(this, template, options && options.bottom);
|
var dialog = dialogDiv(this, template, options && options.bottom);
|
||||||
var closed = false, doneTimer;
|
var closed = false, doneTimer;
|
||||||
var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000;
|
var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000;
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
if (closed) return;
|
if (closed) return;
|
||||||
closed = true;
|
closed = true;
|
||||||
clearTimeout(doneTimer);
|
clearTimeout(doneTimer);
|
||||||
dialog.parentNode.removeChild(dialog);
|
dialog.parentNode.removeChild(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.on(dialog, 'click', function(e) {
|
CodeMirror.on(dialog, 'click', function(e) {
|
||||||
CodeMirror.e_preventDefault(e);
|
CodeMirror.e_preventDefault(e);
|
||||||
close();
|
close();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (duration)
|
if (duration)
|
||||||
doneTimer = setTimeout(close, duration);
|
doneTimer = setTimeout(close, duration);
|
||||||
|
|
||||||
return close;
|
return close;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+185
-185
@@ -1,185 +1,185 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
var defaults = {
|
var defaults = {
|
||||||
pairs: "()[]{}''\"\"",
|
pairs: "()[]{}''\"\"",
|
||||||
triples: "",
|
triples: "",
|
||||||
explode: "[]{}"
|
explode: "[]{}"
|
||||||
};
|
};
|
||||||
|
|
||||||
var Pos = CodeMirror.Pos;
|
var Pos = CodeMirror.Pos;
|
||||||
|
|
||||||
CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
|
CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
|
||||||
if (old && old != CodeMirror.Init) {
|
if (old && old != CodeMirror.Init) {
|
||||||
cm.removeKeyMap(keyMap);
|
cm.removeKeyMap(keyMap);
|
||||||
cm.state.closeBrackets = null;
|
cm.state.closeBrackets = null;
|
||||||
}
|
}
|
||||||
if (val) {
|
if (val) {
|
||||||
cm.state.closeBrackets = val;
|
cm.state.closeBrackets = val;
|
||||||
cm.addKeyMap(keyMap);
|
cm.addKeyMap(keyMap);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function getOption(conf, name) {
|
function getOption(conf, name) {
|
||||||
if (name == "pairs" && typeof conf == "string") return conf;
|
if (name == "pairs" && typeof conf == "string") return conf;
|
||||||
if (typeof conf == "object" && conf[name] != null) return conf[name];
|
if (typeof conf == "object" && conf[name] != null) return conf[name];
|
||||||
return defaults[name];
|
return defaults[name];
|
||||||
}
|
}
|
||||||
|
|
||||||
var bind = defaults.pairs + "`";
|
var bind = defaults.pairs + "`";
|
||||||
var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
|
var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
|
||||||
for (var i = 0; i < bind.length; i++)
|
for (var i = 0; i < bind.length; i++)
|
||||||
keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i));
|
keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i));
|
||||||
|
|
||||||
function handler(ch) {
|
function handler(ch) {
|
||||||
return function(cm) { return handleChar(cm, ch); };
|
return function(cm) { return handleChar(cm, ch); };
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConfig(cm) {
|
function getConfig(cm) {
|
||||||
var deflt = cm.state.closeBrackets;
|
var deflt = cm.state.closeBrackets;
|
||||||
if (!deflt) return null;
|
if (!deflt) return null;
|
||||||
var mode = cm.getModeAt(cm.getCursor());
|
var mode = cm.getModeAt(cm.getCursor());
|
||||||
return mode.closeBrackets || deflt;
|
return mode.closeBrackets || deflt;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleBackspace(cm) {
|
function handleBackspace(cm) {
|
||||||
var conf = getConfig(cm);
|
var conf = getConfig(cm);
|
||||||
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
||||||
|
|
||||||
var pairs = getOption(conf, "pairs");
|
var pairs = getOption(conf, "pairs");
|
||||||
var ranges = cm.listSelections();
|
var ranges = cm.listSelections();
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
if (!ranges[i].empty()) return CodeMirror.Pass;
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
||||||
var around = charsAround(cm, ranges[i].head);
|
var around = charsAround(cm, ranges[i].head);
|
||||||
if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
||||||
}
|
}
|
||||||
for (var i = ranges.length - 1; i >= 0; i--) {
|
for (var i = ranges.length - 1; i >= 0; i--) {
|
||||||
var cur = ranges[i].head;
|
var cur = ranges[i].head;
|
||||||
cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1));
|
cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleEnter(cm) {
|
function handleEnter(cm) {
|
||||||
var conf = getConfig(cm);
|
var conf = getConfig(cm);
|
||||||
var explode = conf && getOption(conf, "explode");
|
var explode = conf && getOption(conf, "explode");
|
||||||
if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass;
|
if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass;
|
||||||
|
|
||||||
var ranges = cm.listSelections();
|
var ranges = cm.listSelections();
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
if (!ranges[i].empty()) return CodeMirror.Pass;
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
||||||
var around = charsAround(cm, ranges[i].head);
|
var around = charsAround(cm, ranges[i].head);
|
||||||
if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
||||||
}
|
}
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
cm.replaceSelection("\n\n", null);
|
cm.replaceSelection("\n\n", null);
|
||||||
cm.execCommand("goCharLeft");
|
cm.execCommand("goCharLeft");
|
||||||
ranges = cm.listSelections();
|
ranges = cm.listSelections();
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
var line = ranges[i].head.line;
|
var line = ranges[i].head.line;
|
||||||
cm.indentLine(line, null, true);
|
cm.indentLine(line, null, true);
|
||||||
cm.indentLine(line + 1, null, true);
|
cm.indentLine(line + 1, null, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleChar(cm, ch) {
|
function handleChar(cm, ch) {
|
||||||
var conf = getConfig(cm);
|
var conf = getConfig(cm);
|
||||||
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
||||||
|
|
||||||
var pairs = getOption(conf, "pairs");
|
var pairs = getOption(conf, "pairs");
|
||||||
var pos = pairs.indexOf(ch);
|
var pos = pairs.indexOf(ch);
|
||||||
if (pos == -1) return CodeMirror.Pass;
|
if (pos == -1) return CodeMirror.Pass;
|
||||||
var triples = getOption(conf, "triples");
|
var triples = getOption(conf, "triples");
|
||||||
|
|
||||||
var identical = pairs.charAt(pos + 1) == ch;
|
var identical = pairs.charAt(pos + 1) == ch;
|
||||||
var ranges = cm.listSelections();
|
var ranges = cm.listSelections();
|
||||||
var opening = pos % 2 == 0;
|
var opening = pos % 2 == 0;
|
||||||
|
|
||||||
var type, next;
|
var type, next;
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
var range = ranges[i], cur = range.head, curType;
|
var range = ranges[i], cur = range.head, curType;
|
||||||
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
|
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
|
||||||
if (opening && !range.empty()) {
|
if (opening && !range.empty()) {
|
||||||
curType = "surround";
|
curType = "surround";
|
||||||
} else if ((identical || !opening) && next == ch) {
|
} else if ((identical || !opening) && next == ch) {
|
||||||
if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
|
if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
|
||||||
curType = "skipThree";
|
curType = "skipThree";
|
||||||
else
|
else
|
||||||
curType = "skip";
|
curType = "skip";
|
||||||
} else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
|
} else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
|
||||||
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch &&
|
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch &&
|
||||||
(cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {
|
(cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {
|
||||||
curType = "addFour";
|
curType = "addFour";
|
||||||
} else if (identical) {
|
} else if (identical) {
|
||||||
if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both";
|
if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both";
|
||||||
else return CodeMirror.Pass;
|
else return CodeMirror.Pass;
|
||||||
} else if (opening && (cm.getLine(cur.line).length == cur.ch ||
|
} else if (opening && (cm.getLine(cur.line).length == cur.ch ||
|
||||||
isClosingBracket(next, pairs) ||
|
isClosingBracket(next, pairs) ||
|
||||||
/\s/.test(next))) {
|
/\s/.test(next))) {
|
||||||
curType = "both";
|
curType = "both";
|
||||||
} else {
|
} else {
|
||||||
return CodeMirror.Pass;
|
return CodeMirror.Pass;
|
||||||
}
|
}
|
||||||
if (!type) type = curType;
|
if (!type) type = curType;
|
||||||
else if (type != curType) return CodeMirror.Pass;
|
else if (type != curType) return CodeMirror.Pass;
|
||||||
}
|
}
|
||||||
|
|
||||||
var left = pos % 2 ? pairs.charAt(pos - 1) : ch;
|
var left = pos % 2 ? pairs.charAt(pos - 1) : ch;
|
||||||
var right = pos % 2 ? ch : pairs.charAt(pos + 1);
|
var right = pos % 2 ? ch : pairs.charAt(pos + 1);
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
if (type == "skip") {
|
if (type == "skip") {
|
||||||
cm.execCommand("goCharRight");
|
cm.execCommand("goCharRight");
|
||||||
} else if (type == "skipThree") {
|
} else if (type == "skipThree") {
|
||||||
for (var i = 0; i < 3; i++)
|
for (var i = 0; i < 3; i++)
|
||||||
cm.execCommand("goCharRight");
|
cm.execCommand("goCharRight");
|
||||||
} else if (type == "surround") {
|
} else if (type == "surround") {
|
||||||
var sels = cm.getSelections();
|
var sels = cm.getSelections();
|
||||||
for (var i = 0; i < sels.length; i++)
|
for (var i = 0; i < sels.length; i++)
|
||||||
sels[i] = left + sels[i] + right;
|
sels[i] = left + sels[i] + right;
|
||||||
cm.replaceSelections(sels, "around");
|
cm.replaceSelections(sels, "around");
|
||||||
} else if (type == "both") {
|
} else if (type == "both") {
|
||||||
cm.replaceSelection(left + right, null);
|
cm.replaceSelection(left + right, null);
|
||||||
cm.triggerElectric(left + right);
|
cm.triggerElectric(left + right);
|
||||||
cm.execCommand("goCharLeft");
|
cm.execCommand("goCharLeft");
|
||||||
} else if (type == "addFour") {
|
} else if (type == "addFour") {
|
||||||
cm.replaceSelection(left + left + left + left, "before");
|
cm.replaceSelection(left + left + left + left, "before");
|
||||||
cm.execCommand("goCharRight");
|
cm.execCommand("goCharRight");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function isClosingBracket(ch, pairs) {
|
function isClosingBracket(ch, pairs) {
|
||||||
var pos = pairs.lastIndexOf(ch);
|
var pos = pairs.lastIndexOf(ch);
|
||||||
return pos > -1 && pos % 2 == 1;
|
return pos > -1 && pos % 2 == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function charsAround(cm, pos) {
|
function charsAround(cm, pos) {
|
||||||
var str = cm.getRange(Pos(pos.line, pos.ch - 1),
|
var str = cm.getRange(Pos(pos.line, pos.ch - 1),
|
||||||
Pos(pos.line, pos.ch + 1));
|
Pos(pos.line, pos.ch + 1));
|
||||||
return str.length == 2 ? str : null;
|
return str.length == 2 ? str : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project the token type that will exists after the given char is
|
// Project the token type that will exists after the given char is
|
||||||
// typed, and use it to determine whether it would cause the start
|
// typed, and use it to determine whether it would cause the start
|
||||||
// of a string token.
|
// of a string token.
|
||||||
function enteringString(cm, pos, ch) {
|
function enteringString(cm, pos, ch) {
|
||||||
var line = cm.getLine(pos.line);
|
var line = cm.getLine(pos.line);
|
||||||
var token = cm.getTokenAt(pos);
|
var token = cm.getTokenAt(pos);
|
||||||
if (/\bstring2?\b/.test(token.type)) return false;
|
if (/\bstring2?\b/.test(token.type)) return false;
|
||||||
var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);
|
var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);
|
||||||
stream.pos = stream.start = token.start;
|
stream.pos = stream.start = token.start;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
var type1 = cm.getMode().token(stream, token.state);
|
var type1 = cm.getMode().token(stream, token.state);
|
||||||
if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1);
|
if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1);
|
||||||
stream.start = stream.pos;
|
stream.start = stream.pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+166
-166
@@ -1,166 +1,166 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag-closer extension for CodeMirror.
|
* Tag-closer extension for CodeMirror.
|
||||||
*
|
*
|
||||||
* This extension adds an "autoCloseTags" option that can be set to
|
* This extension adds an "autoCloseTags" option that can be set to
|
||||||
* either true to get the default behavior, or an object to further
|
* either true to get the default behavior, or an object to further
|
||||||
* configure its behavior.
|
* configure its behavior.
|
||||||
*
|
*
|
||||||
* These are supported options:
|
* These are supported options:
|
||||||
*
|
*
|
||||||
* `whenClosing` (default true)
|
* `whenClosing` (default true)
|
||||||
* Whether to autoclose when the '/' of a closing tag is typed.
|
* Whether to autoclose when the '/' of a closing tag is typed.
|
||||||
* `whenOpening` (default true)
|
* `whenOpening` (default true)
|
||||||
* Whether to autoclose the tag when the final '>' of an opening
|
* Whether to autoclose the tag when the final '>' of an opening
|
||||||
* tag is typed.
|
* tag is typed.
|
||||||
* `dontCloseTags` (default is empty tags for HTML, none for XML)
|
* `dontCloseTags` (default is empty tags for HTML, none for XML)
|
||||||
* An array of tag names that should not be autoclosed.
|
* An array of tag names that should not be autoclosed.
|
||||||
* `indentTags` (default is block tags for HTML, none for XML)
|
* `indentTags` (default is block tags for HTML, none for XML)
|
||||||
* An array of tag names that should, when opened, cause a
|
* An array of tag names that should, when opened, cause a
|
||||||
* blank line to be added inside the tag, and the blank line and
|
* blank line to be added inside the tag, and the blank line and
|
||||||
* closing line to be indented.
|
* closing line to be indented.
|
||||||
*
|
*
|
||||||
* See demos/closetag.html for a usage example.
|
* See demos/closetag.html for a usage example.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
|
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
|
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
|
CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
|
||||||
if (old != CodeMirror.Init && old)
|
if (old != CodeMirror.Init && old)
|
||||||
cm.removeKeyMap("autoCloseTags");
|
cm.removeKeyMap("autoCloseTags");
|
||||||
if (!val) return;
|
if (!val) return;
|
||||||
var map = {name: "autoCloseTags"};
|
var map = {name: "autoCloseTags"};
|
||||||
if (typeof val != "object" || val.whenClosing)
|
if (typeof val != "object" || val.whenClosing)
|
||||||
map["'/'"] = function(cm) { return autoCloseSlash(cm); };
|
map["'/'"] = function(cm) { return autoCloseSlash(cm); };
|
||||||
if (typeof val != "object" || val.whenOpening)
|
if (typeof val != "object" || val.whenOpening)
|
||||||
map["'>'"] = function(cm) { return autoCloseGT(cm); };
|
map["'>'"] = function(cm) { return autoCloseGT(cm); };
|
||||||
cm.addKeyMap(map);
|
cm.addKeyMap(map);
|
||||||
});
|
});
|
||||||
|
|
||||||
var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
|
var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
|
||||||
"source", "track", "wbr"];
|
"source", "track", "wbr"];
|
||||||
var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
|
var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
|
||||||
"h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
|
"h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
|
||||||
|
|
||||||
function autoCloseGT(cm) {
|
function autoCloseGT(cm) {
|
||||||
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
||||||
var ranges = cm.listSelections(), replacements = [];
|
var ranges = cm.listSelections(), replacements = [];
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
if (!ranges[i].empty()) return CodeMirror.Pass;
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
||||||
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
||||||
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
||||||
if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass;
|
if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass;
|
||||||
|
|
||||||
var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
|
var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
|
||||||
var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
|
var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
|
||||||
var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
|
var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
|
||||||
|
|
||||||
var tagName = state.tagName;
|
var tagName = state.tagName;
|
||||||
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
|
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
|
||||||
var lowerTagName = tagName.toLowerCase();
|
var lowerTagName = tagName.toLowerCase();
|
||||||
// Don't process the '>' at the end of an end-tag or self-closing tag
|
// Don't process the '>' at the end of an end-tag or self-closing tag
|
||||||
if (!tagName ||
|
if (!tagName ||
|
||||||
tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
|
tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
|
||||||
tok.type == "tag" && state.type == "closeTag" ||
|
tok.type == "tag" && state.type == "closeTag" ||
|
||||||
tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
|
tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
|
||||||
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
|
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
|
||||||
closingTagExists(cm, tagName, pos, state, true))
|
closingTagExists(cm, tagName, pos, state, true))
|
||||||
return CodeMirror.Pass;
|
return CodeMirror.Pass;
|
||||||
|
|
||||||
var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
|
var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
|
||||||
replacements[i] = {indent: indent,
|
replacements[i] = {indent: indent,
|
||||||
text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",
|
text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",
|
||||||
newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
|
newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = ranges.length - 1; i >= 0; i--) {
|
for (var i = ranges.length - 1; i >= 0; i--) {
|
||||||
var info = replacements[i];
|
var info = replacements[i];
|
||||||
cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
|
cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
|
||||||
var sel = cm.listSelections().slice(0);
|
var sel = cm.listSelections().slice(0);
|
||||||
sel[i] = {head: info.newPos, anchor: info.newPos};
|
sel[i] = {head: info.newPos, anchor: info.newPos};
|
||||||
cm.setSelections(sel);
|
cm.setSelections(sel);
|
||||||
if (info.indent) {
|
if (info.indent) {
|
||||||
cm.indentLine(info.newPos.line, null, true);
|
cm.indentLine(info.newPos.line, null, true);
|
||||||
cm.indentLine(info.newPos.line + 1, null, true);
|
cm.indentLine(info.newPos.line + 1, null, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoCloseCurrent(cm, typingSlash) {
|
function autoCloseCurrent(cm, typingSlash) {
|
||||||
var ranges = cm.listSelections(), replacements = [];
|
var ranges = cm.listSelections(), replacements = [];
|
||||||
var head = typingSlash ? "/" : "</";
|
var head = typingSlash ? "/" : "</";
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
if (!ranges[i].empty()) return CodeMirror.Pass;
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
||||||
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
||||||
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
||||||
if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
|
if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
|
||||||
tok.start != pos.ch - 1))
|
tok.start != pos.ch - 1))
|
||||||
return CodeMirror.Pass;
|
return CodeMirror.Pass;
|
||||||
// Kludge to get around the fact that we are not in XML mode
|
// Kludge to get around the fact that we are not in XML mode
|
||||||
// when completing in JS/CSS snippet in htmlmixed mode. Does not
|
// when completing in JS/CSS snippet in htmlmixed mode. Does not
|
||||||
// work for other XML embedded languages (there is no general
|
// work for other XML embedded languages (there is no general
|
||||||
// way to go from a mixed mode to its current XML state).
|
// way to go from a mixed mode to its current XML state).
|
||||||
if (inner.mode.name != "xml") {
|
if (inner.mode.name != "xml") {
|
||||||
if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
|
if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
|
||||||
replacements[i] = head + "script>";
|
replacements[i] = head + "script>";
|
||||||
else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css")
|
else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css")
|
||||||
replacements[i] = head + "style>";
|
replacements[i] = head + "style>";
|
||||||
else
|
else
|
||||||
return CodeMirror.Pass;
|
return CodeMirror.Pass;
|
||||||
} else {
|
} else {
|
||||||
if (!state.context || !state.context.tagName ||
|
if (!state.context || !state.context.tagName ||
|
||||||
closingTagExists(cm, state.context.tagName, pos, state))
|
closingTagExists(cm, state.context.tagName, pos, state))
|
||||||
return CodeMirror.Pass;
|
return CodeMirror.Pass;
|
||||||
replacements[i] = head + state.context.tagName + ">";
|
replacements[i] = head + state.context.tagName + ">";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cm.replaceSelections(replacements);
|
cm.replaceSelections(replacements);
|
||||||
ranges = cm.listSelections();
|
ranges = cm.listSelections();
|
||||||
for (var i = 0; i < ranges.length; i++)
|
for (var i = 0; i < ranges.length; i++)
|
||||||
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
|
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
|
||||||
cm.indentLine(ranges[i].head.line);
|
cm.indentLine(ranges[i].head.line);
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoCloseSlash(cm) {
|
function autoCloseSlash(cm) {
|
||||||
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
||||||
return autoCloseCurrent(cm, true);
|
return autoCloseCurrent(cm, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
|
CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
|
||||||
|
|
||||||
function indexOf(collection, elt) {
|
function indexOf(collection, elt) {
|
||||||
if (collection.indexOf) return collection.indexOf(elt);
|
if (collection.indexOf) return collection.indexOf(elt);
|
||||||
for (var i = 0, e = collection.length; i < e; ++i)
|
for (var i = 0, e = collection.length; i < e; ++i)
|
||||||
if (collection[i] == elt) return i;
|
if (collection[i] == elt) return i;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If xml-fold is loaded, we use its functionality to try and verify
|
// If xml-fold is loaded, we use its functionality to try and verify
|
||||||
// whether a given tag is actually unclosed.
|
// whether a given tag is actually unclosed.
|
||||||
function closingTagExists(cm, tagName, pos, state, newTag) {
|
function closingTagExists(cm, tagName, pos, state, newTag) {
|
||||||
if (!CodeMirror.scanForClosingTag) return false;
|
if (!CodeMirror.scanForClosingTag) return false;
|
||||||
var end = Math.min(cm.lastLine() + 1, pos.line + 500);
|
var end = Math.min(cm.lastLine() + 1, pos.line + 500);
|
||||||
var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
||||||
if (!nextClose || nextClose.tag != tagName) return false;
|
if (!nextClose || nextClose.tag != tagName) return false;
|
||||||
var cx = state.context;
|
var cx = state.context;
|
||||||
// If the immediate wrapping context contains onCx instances of
|
// If the immediate wrapping context contains onCx instances of
|
||||||
// the same tag, a closing tag only exists if there are at least
|
// the same tag, a closing tag only exists if there are at least
|
||||||
// that many closing tags of that type following.
|
// that many closing tags of that type following.
|
||||||
for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx;
|
for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx;
|
||||||
pos = nextClose.to;
|
pos = nextClose.to;
|
||||||
for (var i = 1; i < onCx; i++) {
|
for (var i = 1; i < onCx; i++) {
|
||||||
var next = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
var next = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
||||||
if (!next || next.tag != tagName) return false;
|
if (!next || next.tag != tagName) return false;
|
||||||
pos = next.to;
|
pos = next.to;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,51 +1,51 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\s*)/,
|
var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\s*)/,
|
||||||
emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)\.)(\s*)$/,
|
emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)\.)(\s*)$/,
|
||||||
unorderedListRE = /[*+-]\s/;
|
unorderedListRE = /[*+-]\s/;
|
||||||
|
|
||||||
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
|
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
|
||||||
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
||||||
var ranges = cm.listSelections(), replacements = [];
|
var ranges = cm.listSelections(), replacements = [];
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
var pos = ranges[i].head;
|
var pos = ranges[i].head;
|
||||||
var eolState = cm.getStateAfter(pos.line);
|
var eolState = cm.getStateAfter(pos.line);
|
||||||
var inList = eolState.list !== false;
|
var inList = eolState.list !== false;
|
||||||
var inQuote = eolState.quote !== 0;
|
var inQuote = eolState.quote !== 0;
|
||||||
|
|
||||||
var line = cm.getLine(pos.line), match = listRE.exec(line);
|
var line = cm.getLine(pos.line), match = listRE.exec(line);
|
||||||
if (!ranges[i].empty() || (!inList && !inQuote) || !match) {
|
if (!ranges[i].empty() || (!inList && !inQuote) || !match) {
|
||||||
cm.execCommand("newlineAndIndent");
|
cm.execCommand("newlineAndIndent");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (emptyListRE.test(line)) {
|
if (emptyListRE.test(line)) {
|
||||||
cm.replaceRange("", {
|
cm.replaceRange("", {
|
||||||
line: pos.line, ch: 0
|
line: pos.line, ch: 0
|
||||||
}, {
|
}, {
|
||||||
line: pos.line, ch: pos.ch + 1
|
line: pos.line, ch: pos.ch + 1
|
||||||
});
|
});
|
||||||
replacements[i] = "\n";
|
replacements[i] = "\n";
|
||||||
} else {
|
} else {
|
||||||
var indent = match[1], after = match[4];
|
var indent = match[1], after = match[4];
|
||||||
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
|
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
|
||||||
? match[2]
|
? match[2]
|
||||||
: (parseInt(match[3], 10) + 1) + ".";
|
: (parseInt(match[3], 10) + 1) + ".";
|
||||||
|
|
||||||
replacements[i] = "\n" + indent + bullet + after;
|
replacements[i] = "\n" + indent + bullet + after;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cm.replaceSelections(replacements);
|
cm.replaceSelections(replacements);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
+120
-120
@@ -1,120 +1,120 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
|
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
|
||||||
(document.documentMode == null || document.documentMode < 8);
|
(document.documentMode == null || document.documentMode < 8);
|
||||||
|
|
||||||
var Pos = CodeMirror.Pos;
|
var Pos = CodeMirror.Pos;
|
||||||
|
|
||||||
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
||||||
|
|
||||||
function findMatchingBracket(cm, where, strict, config) {
|
function findMatchingBracket(cm, where, strict, config) {
|
||||||
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
||||||
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
||||||
if (!match) return null;
|
if (!match) return null;
|
||||||
var dir = match.charAt(1) == ">" ? 1 : -1;
|
var dir = match.charAt(1) == ">" ? 1 : -1;
|
||||||
if (strict && (dir > 0) != (pos == where.ch)) return null;
|
if (strict && (dir > 0) != (pos == where.ch)) return null;
|
||||||
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
|
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
|
||||||
|
|
||||||
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
|
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
|
||||||
if (found == null) return null;
|
if (found == null) return null;
|
||||||
return {from: Pos(where.line, pos), to: found && found.pos,
|
return {from: Pos(where.line, pos), to: found && found.pos,
|
||||||
match: found && found.ch == match.charAt(0), forward: dir > 0};
|
match: found && found.ch == match.charAt(0), forward: dir > 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
// bracketRegex is used to specify which type of bracket to scan
|
// bracketRegex is used to specify which type of bracket to scan
|
||||||
// should be a regexp, e.g. /[[\]]/
|
// should be a regexp, e.g. /[[\]]/
|
||||||
//
|
//
|
||||||
// Note: If "where" is on an open bracket, then this bracket is ignored.
|
// Note: If "where" is on an open bracket, then this bracket is ignored.
|
||||||
//
|
//
|
||||||
// Returns false when no bracket was found, null when it reached
|
// Returns false when no bracket was found, null when it reached
|
||||||
// maxScanLines and gave up
|
// maxScanLines and gave up
|
||||||
function scanForBracket(cm, where, dir, style, config) {
|
function scanForBracket(cm, where, dir, style, config) {
|
||||||
var maxScanLen = (config && config.maxScanLineLength) || 10000;
|
var maxScanLen = (config && config.maxScanLineLength) || 10000;
|
||||||
var maxScanLines = (config && config.maxScanLines) || 1000;
|
var maxScanLines = (config && config.maxScanLines) || 1000;
|
||||||
|
|
||||||
var stack = [];
|
var stack = [];
|
||||||
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
|
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
|
||||||
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
|
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
|
||||||
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
|
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
|
||||||
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
|
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
|
||||||
var line = cm.getLine(lineNo);
|
var line = cm.getLine(lineNo);
|
||||||
if (!line) continue;
|
if (!line) continue;
|
||||||
var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
|
var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
|
||||||
if (line.length > maxScanLen) continue;
|
if (line.length > maxScanLen) continue;
|
||||||
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
|
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
|
||||||
for (; pos != end; pos += dir) {
|
for (; pos != end; pos += dir) {
|
||||||
var ch = line.charAt(pos);
|
var ch = line.charAt(pos);
|
||||||
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
|
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
|
||||||
var match = matching[ch];
|
var match = matching[ch];
|
||||||
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
|
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
|
||||||
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
|
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
|
||||||
else stack.pop();
|
else stack.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
|
return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function matchBrackets(cm, autoclear, config) {
|
function matchBrackets(cm, autoclear, config) {
|
||||||
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
||||||
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
||||||
var marks = [], ranges = cm.listSelections();
|
var marks = [], ranges = cm.listSelections();
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);
|
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);
|
||||||
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
|
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
|
||||||
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
||||||
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
|
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
|
||||||
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
|
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
|
||||||
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
|
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (marks.length) {
|
if (marks.length) {
|
||||||
// Kludge to work around the IE bug from issue #1193, where text
|
// Kludge to work around the IE bug from issue #1193, where text
|
||||||
// input stops going to the textare whever this fires.
|
// input stops going to the textare whever this fires.
|
||||||
if (ie_lt8 && cm.state.focused) cm.focus();
|
if (ie_lt8 && cm.state.focused) cm.focus();
|
||||||
|
|
||||||
var clear = function() {
|
var clear = function() {
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
for (var i = 0; i < marks.length; i++) marks[i].clear();
|
for (var i = 0; i < marks.length; i++) marks[i].clear();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
if (autoclear) setTimeout(clear, 800);
|
if (autoclear) setTimeout(clear, 800);
|
||||||
else return clear;
|
else return clear;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentlyHighlighted = null;
|
var currentlyHighlighted = null;
|
||||||
function doMatchBrackets(cm) {
|
function doMatchBrackets(cm) {
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
||||||
currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
|
currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
||||||
if (old && old != CodeMirror.Init)
|
if (old && old != CodeMirror.Init)
|
||||||
cm.off("cursorActivity", doMatchBrackets);
|
cm.off("cursorActivity", doMatchBrackets);
|
||||||
if (val) {
|
if (val) {
|
||||||
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
||||||
cm.on("cursorActivity", doMatchBrackets);
|
cm.on("cursorActivity", doMatchBrackets);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
||||||
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){
|
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){
|
||||||
return findMatchingBracket(this, pos, strict, config);
|
return findMatchingBracket(this, pos, strict, config);
|
||||||
});
|
});
|
||||||
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
|
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
|
||||||
return scanForBracket(this, pos, dir, style, config);
|
return scanForBracket(this, pos, dir, style, config);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+66
-66
@@ -1,66 +1,66 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
|
mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
|
define(["../../lib/codemirror", "../fold/xml-fold"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
CodeMirror.defineOption("matchTags", false, function(cm, val, old) {
|
CodeMirror.defineOption("matchTags", false, function(cm, val, old) {
|
||||||
if (old && old != CodeMirror.Init) {
|
if (old && old != CodeMirror.Init) {
|
||||||
cm.off("cursorActivity", doMatchTags);
|
cm.off("cursorActivity", doMatchTags);
|
||||||
cm.off("viewportChange", maybeUpdateMatch);
|
cm.off("viewportChange", maybeUpdateMatch);
|
||||||
clear(cm);
|
clear(cm);
|
||||||
}
|
}
|
||||||
if (val) {
|
if (val) {
|
||||||
cm.state.matchBothTags = typeof val == "object" && val.bothTags;
|
cm.state.matchBothTags = typeof val == "object" && val.bothTags;
|
||||||
cm.on("cursorActivity", doMatchTags);
|
cm.on("cursorActivity", doMatchTags);
|
||||||
cm.on("viewportChange", maybeUpdateMatch);
|
cm.on("viewportChange", maybeUpdateMatch);
|
||||||
doMatchTags(cm);
|
doMatchTags(cm);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function clear(cm) {
|
function clear(cm) {
|
||||||
if (cm.state.tagHit) cm.state.tagHit.clear();
|
if (cm.state.tagHit) cm.state.tagHit.clear();
|
||||||
if (cm.state.tagOther) cm.state.tagOther.clear();
|
if (cm.state.tagOther) cm.state.tagOther.clear();
|
||||||
cm.state.tagHit = cm.state.tagOther = null;
|
cm.state.tagHit = cm.state.tagOther = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function doMatchTags(cm) {
|
function doMatchTags(cm) {
|
||||||
cm.state.failedTagMatch = false;
|
cm.state.failedTagMatch = false;
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
clear(cm);
|
clear(cm);
|
||||||
if (cm.somethingSelected()) return;
|
if (cm.somethingSelected()) return;
|
||||||
var cur = cm.getCursor(), range = cm.getViewport();
|
var cur = cm.getCursor(), range = cm.getViewport();
|
||||||
range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);
|
range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);
|
||||||
var match = CodeMirror.findMatchingTag(cm, cur, range);
|
var match = CodeMirror.findMatchingTag(cm, cur, range);
|
||||||
if (!match) return;
|
if (!match) return;
|
||||||
if (cm.state.matchBothTags) {
|
if (cm.state.matchBothTags) {
|
||||||
var hit = match.at == "open" ? match.open : match.close;
|
var hit = match.at == "open" ? match.open : match.close;
|
||||||
if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"});
|
if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"});
|
||||||
}
|
}
|
||||||
var other = match.at == "close" ? match.open : match.close;
|
var other = match.at == "close" ? match.open : match.close;
|
||||||
if (other)
|
if (other)
|
||||||
cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"});
|
cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"});
|
||||||
else
|
else
|
||||||
cm.state.failedTagMatch = true;
|
cm.state.failedTagMatch = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function maybeUpdateMatch(cm) {
|
function maybeUpdateMatch(cm) {
|
||||||
if (cm.state.failedTagMatch) doMatchTags(cm);
|
if (cm.state.failedTagMatch) doMatchTags(cm);
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.commands.toMatchingTag = function(cm) {
|
CodeMirror.commands.toMatchingTag = function(cm) {
|
||||||
var found = CodeMirror.findMatchingTag(cm, cm.getCursor());
|
var found = CodeMirror.findMatchingTag(cm, cm.getCursor());
|
||||||
if (found) {
|
if (found) {
|
||||||
var other = found.at == "close" ? found.open : found.close;
|
var other = found.at == "close" ? found.open : found.close;
|
||||||
if (other) cm.extendSelection(other.to, other.from);
|
if (other) cm.extendSelection(other.to, other.from);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
|
CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
|
||||||
if (prev == CodeMirror.Init) prev = false;
|
if (prev == CodeMirror.Init) prev = false;
|
||||||
if (prev && !val)
|
if (prev && !val)
|
||||||
cm.removeOverlay("trailingspace");
|
cm.removeOverlay("trailingspace");
|
||||||
else if (!prev && val)
|
else if (!prev && val)
|
||||||
cm.addOverlay({
|
cm.addOverlay({
|
||||||
token: function(stream) {
|
token: function(stream) {
|
||||||
for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
|
for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
|
||||||
if (i > stream.pos) { stream.pos = i; return null; }
|
if (i > stream.pos) { stream.pos = i; return null; }
|
||||||
stream.pos = l;
|
stream.pos = l;
|
||||||
return "trailingspace";
|
return "trailingspace";
|
||||||
},
|
},
|
||||||
name: "trailingspace"
|
name: "trailingspace"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+128
-128
@@ -1,128 +1,128 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
// Highlighting text that matches the selection
|
// Highlighting text that matches the selection
|
||||||
//
|
//
|
||||||
// Defines an option highlightSelectionMatches, which, when enabled,
|
// Defines an option highlightSelectionMatches, which, when enabled,
|
||||||
// will style strings that match the selection throughout the
|
// will style strings that match the selection throughout the
|
||||||
// document.
|
// document.
|
||||||
//
|
//
|
||||||
// The option can be set to true to simply enable it, or to a
|
// The option can be set to true to simply enable it, or to a
|
||||||
// {minChars, style, wordsOnly, showToken, delay} object to explicitly
|
// {minChars, style, wordsOnly, showToken, delay} object to explicitly
|
||||||
// configure it. minChars is the minimum amount of characters that should be
|
// configure it. minChars is the minimum amount of characters that should be
|
||||||
// selected for the behavior to occur, and style is the token style to
|
// selected for the behavior to occur, and style is the token style to
|
||||||
// apply to the matches. This will be prefixed by "cm-" to create an
|
// apply to the matches. This will be prefixed by "cm-" to create an
|
||||||
// actual CSS class name. If wordsOnly is enabled, the matches will be
|
// actual CSS class name. If wordsOnly is enabled, the matches will be
|
||||||
// highlighted only if the selected text is a word. showToken, when enabled,
|
// highlighted only if the selected text is a word. showToken, when enabled,
|
||||||
// will cause the current token to be highlighted when nothing is selected.
|
// will cause the current token to be highlighted when nothing is selected.
|
||||||
// delay is used to specify how much time to wait, in milliseconds, before
|
// delay is used to specify how much time to wait, in milliseconds, before
|
||||||
// highlighting the matches.
|
// highlighting the matches.
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var DEFAULT_MIN_CHARS = 2;
|
var DEFAULT_MIN_CHARS = 2;
|
||||||
var DEFAULT_TOKEN_STYLE = "matchhighlight";
|
var DEFAULT_TOKEN_STYLE = "matchhighlight";
|
||||||
var DEFAULT_DELAY = 100;
|
var DEFAULT_DELAY = 100;
|
||||||
var DEFAULT_WORDS_ONLY = false;
|
var DEFAULT_WORDS_ONLY = false;
|
||||||
|
|
||||||
function State(options) {
|
function State(options) {
|
||||||
if (typeof options == "object") {
|
if (typeof options == "object") {
|
||||||
this.minChars = options.minChars;
|
this.minChars = options.minChars;
|
||||||
this.style = options.style;
|
this.style = options.style;
|
||||||
this.showToken = options.showToken;
|
this.showToken = options.showToken;
|
||||||
this.delay = options.delay;
|
this.delay = options.delay;
|
||||||
this.wordsOnly = options.wordsOnly;
|
this.wordsOnly = options.wordsOnly;
|
||||||
}
|
}
|
||||||
if (this.style == null) this.style = DEFAULT_TOKEN_STYLE;
|
if (this.style == null) this.style = DEFAULT_TOKEN_STYLE;
|
||||||
if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS;
|
if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS;
|
||||||
if (this.delay == null) this.delay = DEFAULT_DELAY;
|
if (this.delay == null) this.delay = DEFAULT_DELAY;
|
||||||
if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY;
|
if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY;
|
||||||
this.overlay = this.timeout = null;
|
this.overlay = this.timeout = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
|
CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
|
||||||
if (old && old != CodeMirror.Init) {
|
if (old && old != CodeMirror.Init) {
|
||||||
var over = cm.state.matchHighlighter.overlay;
|
var over = cm.state.matchHighlighter.overlay;
|
||||||
if (over) cm.removeOverlay(over);
|
if (over) cm.removeOverlay(over);
|
||||||
clearTimeout(cm.state.matchHighlighter.timeout);
|
clearTimeout(cm.state.matchHighlighter.timeout);
|
||||||
cm.state.matchHighlighter = null;
|
cm.state.matchHighlighter = null;
|
||||||
cm.off("cursorActivity", cursorActivity);
|
cm.off("cursorActivity", cursorActivity);
|
||||||
}
|
}
|
||||||
if (val) {
|
if (val) {
|
||||||
cm.state.matchHighlighter = new State(val);
|
cm.state.matchHighlighter = new State(val);
|
||||||
highlightMatches(cm);
|
highlightMatches(cm);
|
||||||
cm.on("cursorActivity", cursorActivity);
|
cm.on("cursorActivity", cursorActivity);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function cursorActivity(cm) {
|
function cursorActivity(cm) {
|
||||||
var state = cm.state.matchHighlighter;
|
var state = cm.state.matchHighlighter;
|
||||||
clearTimeout(state.timeout);
|
clearTimeout(state.timeout);
|
||||||
state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay);
|
state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
function highlightMatches(cm) {
|
function highlightMatches(cm) {
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
var state = cm.state.matchHighlighter;
|
var state = cm.state.matchHighlighter;
|
||||||
if (state.overlay) {
|
if (state.overlay) {
|
||||||
cm.removeOverlay(state.overlay);
|
cm.removeOverlay(state.overlay);
|
||||||
state.overlay = null;
|
state.overlay = null;
|
||||||
}
|
}
|
||||||
if (!cm.somethingSelected() && state.showToken) {
|
if (!cm.somethingSelected() && state.showToken) {
|
||||||
var re = state.showToken === true ? /[\w$]/ : state.showToken;
|
var re = state.showToken === true ? /[\w$]/ : state.showToken;
|
||||||
var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
|
var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
|
||||||
while (start && re.test(line.charAt(start - 1))) --start;
|
while (start && re.test(line.charAt(start - 1))) --start;
|
||||||
while (end < line.length && re.test(line.charAt(end))) ++end;
|
while (end < line.length && re.test(line.charAt(end))) ++end;
|
||||||
if (start < end)
|
if (start < end)
|
||||||
cm.addOverlay(state.overlay = makeOverlay(line.slice(start, end), re, state.style));
|
cm.addOverlay(state.overlay = makeOverlay(line.slice(start, end), re, state.style));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var from = cm.getCursor("from"), to = cm.getCursor("to");
|
var from = cm.getCursor("from"), to = cm.getCursor("to");
|
||||||
if (from.line != to.line) return;
|
if (from.line != to.line) return;
|
||||||
if (state.wordsOnly && !isWord(cm, from, to)) return;
|
if (state.wordsOnly && !isWord(cm, from, to)) return;
|
||||||
var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, "");
|
var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, "");
|
||||||
if (selection.length >= state.minChars)
|
if (selection.length >= state.minChars)
|
||||||
cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style));
|
cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function isWord(cm, from, to) {
|
function isWord(cm, from, to) {
|
||||||
var str = cm.getRange(from, to);
|
var str = cm.getRange(from, to);
|
||||||
if (str.match(/^\w+$/) !== null) {
|
if (str.match(/^\w+$/) !== null) {
|
||||||
if (from.ch > 0) {
|
if (from.ch > 0) {
|
||||||
var pos = {line: from.line, ch: from.ch - 1};
|
var pos = {line: from.line, ch: from.ch - 1};
|
||||||
var chr = cm.getRange(pos, from);
|
var chr = cm.getRange(pos, from);
|
||||||
if (chr.match(/\W/) === null) return false;
|
if (chr.match(/\W/) === null) return false;
|
||||||
}
|
}
|
||||||
if (to.ch < cm.getLine(from.line).length) {
|
if (to.ch < cm.getLine(from.line).length) {
|
||||||
var pos = {line: to.line, ch: to.ch + 1};
|
var pos = {line: to.line, ch: to.ch + 1};
|
||||||
var chr = cm.getRange(to, pos);
|
var chr = cm.getRange(to, pos);
|
||||||
if (chr.match(/\W/) === null) return false;
|
if (chr.match(/\W/) === null) return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function boundariesAround(stream, re) {
|
function boundariesAround(stream, re) {
|
||||||
return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) &&
|
return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) &&
|
||||||
(stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos)));
|
(stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos)));
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeOverlay(query, hasBoundary, style) {
|
function makeOverlay(query, hasBoundary, style) {
|
||||||
return {token: function(stream) {
|
return {token: function(stream) {
|
||||||
if (stream.match(query) &&
|
if (stream.match(query) &&
|
||||||
(!hasBoundary || boundariesAround(stream, hasBoundary)))
|
(!hasBoundary || boundariesAround(stream, hasBoundary)))
|
||||||
return style;
|
return style;
|
||||||
stream.next();
|
stream.next();
|
||||||
stream.skipTo(query.charAt(0)) || stream.skipToEnd();
|
stream.skipTo(query.charAt(0)) || stream.skipToEnd();
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
.CodeMirror-search-match {
|
.CodeMirror-search-match {
|
||||||
background: gold;
|
background: gold;
|
||||||
border-top: 1px solid orange;
|
border-top: 1px solid orange;
|
||||||
border-bottom: 1px solid orange;
|
border-bottom: 1px solid orange;
|
||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
|
|||||||
+97
-97
@@ -1,97 +1,97 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"), require("./searchcursor"), require("../scroll/annotatescrollbar"));
|
mod(require("../../lib/codemirror"), require("./searchcursor"), require("../scroll/annotatescrollbar"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror", "./searchcursor", "../scroll/annotatescrollbar"], mod);
|
define(["../../lib/codemirror", "./searchcursor", "../scroll/annotatescrollbar"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
CodeMirror.defineExtension("showMatchesOnScrollbar", function(query, caseFold, options) {
|
CodeMirror.defineExtension("showMatchesOnScrollbar", function(query, caseFold, options) {
|
||||||
if (typeof options == "string") options = {className: options};
|
if (typeof options == "string") options = {className: options};
|
||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
return new SearchAnnotation(this, query, caseFold, options);
|
return new SearchAnnotation(this, query, caseFold, options);
|
||||||
});
|
});
|
||||||
|
|
||||||
function SearchAnnotation(cm, query, caseFold, options) {
|
function SearchAnnotation(cm, query, caseFold, options) {
|
||||||
this.cm = cm;
|
this.cm = cm;
|
||||||
this.options = options;
|
this.options = options;
|
||||||
var annotateOptions = {listenForChanges: false};
|
var annotateOptions = {listenForChanges: false};
|
||||||
for (var prop in options) annotateOptions[prop] = options[prop];
|
for (var prop in options) annotateOptions[prop] = options[prop];
|
||||||
if (!annotateOptions.className) annotateOptions.className = "CodeMirror-search-match";
|
if (!annotateOptions.className) annotateOptions.className = "CodeMirror-search-match";
|
||||||
this.annotation = cm.annotateScrollbar(annotateOptions);
|
this.annotation = cm.annotateScrollbar(annotateOptions);
|
||||||
this.query = query;
|
this.query = query;
|
||||||
this.caseFold = caseFold;
|
this.caseFold = caseFold;
|
||||||
this.gap = {from: cm.firstLine(), to: cm.lastLine() + 1};
|
this.gap = {from: cm.firstLine(), to: cm.lastLine() + 1};
|
||||||
this.matches = [];
|
this.matches = [];
|
||||||
this.update = null;
|
this.update = null;
|
||||||
|
|
||||||
this.findMatches();
|
this.findMatches();
|
||||||
this.annotation.update(this.matches);
|
this.annotation.update(this.matches);
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
cm.on("change", this.changeHandler = function(_cm, change) { self.onChange(change); });
|
cm.on("change", this.changeHandler = function(_cm, change) { self.onChange(change); });
|
||||||
}
|
}
|
||||||
|
|
||||||
var MAX_MATCHES = 1000;
|
var MAX_MATCHES = 1000;
|
||||||
|
|
||||||
SearchAnnotation.prototype.findMatches = function() {
|
SearchAnnotation.prototype.findMatches = function() {
|
||||||
if (!this.gap) return;
|
if (!this.gap) return;
|
||||||
for (var i = 0; i < this.matches.length; i++) {
|
for (var i = 0; i < this.matches.length; i++) {
|
||||||
var match = this.matches[i];
|
var match = this.matches[i];
|
||||||
if (match.from.line >= this.gap.to) break;
|
if (match.from.line >= this.gap.to) break;
|
||||||
if (match.to.line >= this.gap.from) this.matches.splice(i--, 1);
|
if (match.to.line >= this.gap.from) this.matches.splice(i--, 1);
|
||||||
}
|
}
|
||||||
var cursor = this.cm.getSearchCursor(this.query, CodeMirror.Pos(this.gap.from, 0), this.caseFold);
|
var cursor = this.cm.getSearchCursor(this.query, CodeMirror.Pos(this.gap.from, 0), this.caseFold);
|
||||||
var maxMatches = this.options && this.options.maxMatches || MAX_MATCHES;
|
var maxMatches = this.options && this.options.maxMatches || MAX_MATCHES;
|
||||||
while (cursor.findNext()) {
|
while (cursor.findNext()) {
|
||||||
var match = {from: cursor.from(), to: cursor.to()};
|
var match = {from: cursor.from(), to: cursor.to()};
|
||||||
if (match.from.line >= this.gap.to) break;
|
if (match.from.line >= this.gap.to) break;
|
||||||
this.matches.splice(i++, 0, match);
|
this.matches.splice(i++, 0, match);
|
||||||
if (this.matches.length > maxMatches) break;
|
if (this.matches.length > maxMatches) break;
|
||||||
}
|
}
|
||||||
this.gap = null;
|
this.gap = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
function offsetLine(line, changeStart, sizeChange) {
|
function offsetLine(line, changeStart, sizeChange) {
|
||||||
if (line <= changeStart) return line;
|
if (line <= changeStart) return line;
|
||||||
return Math.max(changeStart, line + sizeChange);
|
return Math.max(changeStart, line + sizeChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchAnnotation.prototype.onChange = function(change) {
|
SearchAnnotation.prototype.onChange = function(change) {
|
||||||
var startLine = change.from.line;
|
var startLine = change.from.line;
|
||||||
var endLine = CodeMirror.changeEnd(change).line;
|
var endLine = CodeMirror.changeEnd(change).line;
|
||||||
var sizeChange = endLine - change.to.line;
|
var sizeChange = endLine - change.to.line;
|
||||||
if (this.gap) {
|
if (this.gap) {
|
||||||
this.gap.from = Math.min(offsetLine(this.gap.from, startLine, sizeChange), change.from.line);
|
this.gap.from = Math.min(offsetLine(this.gap.from, startLine, sizeChange), change.from.line);
|
||||||
this.gap.to = Math.max(offsetLine(this.gap.to, startLine, sizeChange), change.from.line);
|
this.gap.to = Math.max(offsetLine(this.gap.to, startLine, sizeChange), change.from.line);
|
||||||
} else {
|
} else {
|
||||||
this.gap = {from: change.from.line, to: endLine + 1};
|
this.gap = {from: change.from.line, to: endLine + 1};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizeChange) for (var i = 0; i < this.matches.length; i++) {
|
if (sizeChange) for (var i = 0; i < this.matches.length; i++) {
|
||||||
var match = this.matches[i];
|
var match = this.matches[i];
|
||||||
var newFrom = offsetLine(match.from.line, startLine, sizeChange);
|
var newFrom = offsetLine(match.from.line, startLine, sizeChange);
|
||||||
if (newFrom != match.from.line) match.from = CodeMirror.Pos(newFrom, match.from.ch);
|
if (newFrom != match.from.line) match.from = CodeMirror.Pos(newFrom, match.from.ch);
|
||||||
var newTo = offsetLine(match.to.line, startLine, sizeChange);
|
var newTo = offsetLine(match.to.line, startLine, sizeChange);
|
||||||
if (newTo != match.to.line) match.to = CodeMirror.Pos(newTo, match.to.ch);
|
if (newTo != match.to.line) match.to = CodeMirror.Pos(newTo, match.to.ch);
|
||||||
}
|
}
|
||||||
clearTimeout(this.update);
|
clearTimeout(this.update);
|
||||||
var self = this;
|
var self = this;
|
||||||
this.update = setTimeout(function() { self.updateAfterChange(); }, 250);
|
this.update = setTimeout(function() { self.updateAfterChange(); }, 250);
|
||||||
};
|
};
|
||||||
|
|
||||||
SearchAnnotation.prototype.updateAfterChange = function() {
|
SearchAnnotation.prototype.updateAfterChange = function() {
|
||||||
this.findMatches();
|
this.findMatches();
|
||||||
this.annotation.update(this.matches);
|
this.annotation.update(this.matches);
|
||||||
};
|
};
|
||||||
|
|
||||||
SearchAnnotation.prototype.clear = function() {
|
SearchAnnotation.prototype.clear = function() {
|
||||||
this.cm.off("change", this.changeHandler);
|
this.cm.off("change", this.changeHandler);
|
||||||
this.annotation.clear();
|
this.annotation.clear();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
+167
-167
@@ -1,167 +1,167 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
// Define search commands. Depends on dialog.js or another
|
// Define search commands. Depends on dialog.js or another
|
||||||
// implementation of the openDialog method.
|
// implementation of the openDialog method.
|
||||||
|
|
||||||
// Replace works a little oddly -- it will do the replace on the next
|
// Replace works a little oddly -- it will do the replace on the next
|
||||||
// Ctrl-G (or whatever is bound to findNext) press. You prevent a
|
// Ctrl-G (or whatever is bound to findNext) press. You prevent a
|
||||||
// replace by making sure the match is no longer selected when hitting
|
// replace by making sure the match is no longer selected when hitting
|
||||||
// Ctrl-G.
|
// Ctrl-G.
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"), require("./searchcursor"), require("../dialog/dialog"));
|
mod(require("../../lib/codemirror"), require("./searchcursor"), require("../dialog/dialog"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror", "./searchcursor", "../dialog/dialog"], mod);
|
define(["../../lib/codemirror", "./searchcursor", "../dialog/dialog"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
function searchOverlay(query, caseInsensitive) {
|
function searchOverlay(query, caseInsensitive) {
|
||||||
if (typeof query == "string")
|
if (typeof query == "string")
|
||||||
query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
|
query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
|
||||||
else if (!query.global)
|
else if (!query.global)
|
||||||
query = new RegExp(query.source, query.ignoreCase ? "gi" : "g");
|
query = new RegExp(query.source, query.ignoreCase ? "gi" : "g");
|
||||||
|
|
||||||
return {token: function(stream) {
|
return {token: function(stream) {
|
||||||
query.lastIndex = stream.pos;
|
query.lastIndex = stream.pos;
|
||||||
var match = query.exec(stream.string);
|
var match = query.exec(stream.string);
|
||||||
if (match && match.index == stream.pos) {
|
if (match && match.index == stream.pos) {
|
||||||
stream.pos += match[0].length;
|
stream.pos += match[0].length;
|
||||||
return "searching";
|
return "searching";
|
||||||
} else if (match) {
|
} else if (match) {
|
||||||
stream.pos = match.index;
|
stream.pos = match.index;
|
||||||
} else {
|
} else {
|
||||||
stream.skipToEnd();
|
stream.skipToEnd();
|
||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
function SearchState() {
|
function SearchState() {
|
||||||
this.posFrom = this.posTo = this.lastQuery = this.query = null;
|
this.posFrom = this.posTo = this.lastQuery = this.query = null;
|
||||||
this.overlay = null;
|
this.overlay = null;
|
||||||
}
|
}
|
||||||
function getSearchState(cm) {
|
function getSearchState(cm) {
|
||||||
return cm.state.search || (cm.state.search = new SearchState());
|
return cm.state.search || (cm.state.search = new SearchState());
|
||||||
}
|
}
|
||||||
function queryCaseInsensitive(query) {
|
function queryCaseInsensitive(query) {
|
||||||
return typeof query == "string" && query == query.toLowerCase();
|
return typeof query == "string" && query == query.toLowerCase();
|
||||||
}
|
}
|
||||||
function getSearchCursor(cm, query, pos) {
|
function getSearchCursor(cm, query, pos) {
|
||||||
// Heuristic: if the query string is all lowercase, do a case insensitive search.
|
// Heuristic: if the query string is all lowercase, do a case insensitive search.
|
||||||
return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
|
return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
|
||||||
}
|
}
|
||||||
function dialog(cm, text, shortText, deflt, f) {
|
function dialog(cm, text, shortText, deflt, f) {
|
||||||
if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
|
if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
|
||||||
else f(prompt(shortText, deflt));
|
else f(prompt(shortText, deflt));
|
||||||
}
|
}
|
||||||
function confirmDialog(cm, text, shortText, fs) {
|
function confirmDialog(cm, text, shortText, fs) {
|
||||||
if (cm.openConfirm) cm.openConfirm(text, fs);
|
if (cm.openConfirm) cm.openConfirm(text, fs);
|
||||||
else if (confirm(shortText)) fs[0]();
|
else if (confirm(shortText)) fs[0]();
|
||||||
}
|
}
|
||||||
function parseQuery(query) {
|
function parseQuery(query) {
|
||||||
var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
|
var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
|
||||||
if (isRE) {
|
if (isRE) {
|
||||||
try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); }
|
try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); }
|
||||||
catch(e) {} // Not a regular expression after all, do a string search
|
catch(e) {} // Not a regular expression after all, do a string search
|
||||||
}
|
}
|
||||||
if (typeof query == "string" ? query == "" : query.test(""))
|
if (typeof query == "string" ? query == "" : query.test(""))
|
||||||
query = /x^/;
|
query = /x^/;
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
var queryDialog =
|
var queryDialog =
|
||||||
'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
||||||
function doSearch(cm, rev) {
|
function doSearch(cm, rev) {
|
||||||
var state = getSearchState(cm);
|
var state = getSearchState(cm);
|
||||||
if (state.query) return findNext(cm, rev);
|
if (state.query) return findNext(cm, rev);
|
||||||
var q = cm.getSelection() || state.lastQuery;
|
var q = cm.getSelection() || state.lastQuery;
|
||||||
dialog(cm, queryDialog, "Search for:", q, function(query) {
|
dialog(cm, queryDialog, "Search for:", q, function(query) {
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
if (!query || state.query) return;
|
if (!query || state.query) return;
|
||||||
state.query = parseQuery(query);
|
state.query = parseQuery(query);
|
||||||
cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
|
cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
|
||||||
state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
|
state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
|
||||||
cm.addOverlay(state.overlay);
|
cm.addOverlay(state.overlay);
|
||||||
if (cm.showMatchesOnScrollbar) {
|
if (cm.showMatchesOnScrollbar) {
|
||||||
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
|
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
|
||||||
state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
|
state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
|
||||||
}
|
}
|
||||||
state.posFrom = state.posTo = cm.getCursor();
|
state.posFrom = state.posTo = cm.getCursor();
|
||||||
findNext(cm, rev);
|
findNext(cm, rev);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function findNext(cm, rev) {cm.operation(function() {
|
function findNext(cm, rev) {cm.operation(function() {
|
||||||
var state = getSearchState(cm);
|
var state = getSearchState(cm);
|
||||||
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
|
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
|
||||||
if (!cursor.find(rev)) {
|
if (!cursor.find(rev)) {
|
||||||
cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
|
cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
|
||||||
if (!cursor.find(rev)) return;
|
if (!cursor.find(rev)) return;
|
||||||
}
|
}
|
||||||
cm.setSelection(cursor.from(), cursor.to());
|
cm.setSelection(cursor.from(), cursor.to());
|
||||||
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
|
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
|
||||||
state.posFrom = cursor.from(); state.posTo = cursor.to();
|
state.posFrom = cursor.from(); state.posTo = cursor.to();
|
||||||
});}
|
});}
|
||||||
function clearSearch(cm) {cm.operation(function() {
|
function clearSearch(cm) {cm.operation(function() {
|
||||||
var state = getSearchState(cm);
|
var state = getSearchState(cm);
|
||||||
state.lastQuery = state.query;
|
state.lastQuery = state.query;
|
||||||
if (!state.query) return;
|
if (!state.query) return;
|
||||||
state.query = null;
|
state.query = null;
|
||||||
cm.removeOverlay(state.overlay);
|
cm.removeOverlay(state.overlay);
|
||||||
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
|
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
|
||||||
});}
|
});}
|
||||||
|
|
||||||
var replaceQueryDialog =
|
var replaceQueryDialog =
|
||||||
'Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
'Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
||||||
var replacementQueryDialog = 'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
|
var replacementQueryDialog = 'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
|
||||||
var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";
|
var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";
|
||||||
function replace(cm, all) {
|
function replace(cm, all) {
|
||||||
if (cm.getOption("readOnly")) return;
|
if (cm.getOption("readOnly")) return;
|
||||||
var query = cm.getSelection() || getSearchState(cm).lastQuery;
|
var query = cm.getSelection() || getSearchState(cm).lastQuery;
|
||||||
dialog(cm, replaceQueryDialog, "Replace:", query, function(query) {
|
dialog(cm, replaceQueryDialog, "Replace:", query, function(query) {
|
||||||
if (!query) return;
|
if (!query) return;
|
||||||
query = parseQuery(query);
|
query = parseQuery(query);
|
||||||
dialog(cm, replacementQueryDialog, "Replace with:", "", function(text) {
|
dialog(cm, replacementQueryDialog, "Replace with:", "", function(text) {
|
||||||
if (all) {
|
if (all) {
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
|
for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
|
||||||
if (typeof query != "string") {
|
if (typeof query != "string") {
|
||||||
var match = cm.getRange(cursor.from(), cursor.to()).match(query);
|
var match = cm.getRange(cursor.from(), cursor.to()).match(query);
|
||||||
cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
|
cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
|
||||||
} else cursor.replace(text);
|
} else cursor.replace(text);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
clearSearch(cm);
|
clearSearch(cm);
|
||||||
var cursor = getSearchCursor(cm, query, cm.getCursor());
|
var cursor = getSearchCursor(cm, query, cm.getCursor());
|
||||||
var advance = function() {
|
var advance = function() {
|
||||||
var start = cursor.from(), match;
|
var start = cursor.from(), match;
|
||||||
if (!(match = cursor.findNext())) {
|
if (!(match = cursor.findNext())) {
|
||||||
cursor = getSearchCursor(cm, query);
|
cursor = getSearchCursor(cm, query);
|
||||||
if (!(match = cursor.findNext()) ||
|
if (!(match = cursor.findNext()) ||
|
||||||
(start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
|
(start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
|
||||||
}
|
}
|
||||||
cm.setSelection(cursor.from(), cursor.to());
|
cm.setSelection(cursor.from(), cursor.to());
|
||||||
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
|
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
|
||||||
confirmDialog(cm, doReplaceConfirm, "Replace?",
|
confirmDialog(cm, doReplaceConfirm, "Replace?",
|
||||||
[function() {doReplace(match);}, advance]);
|
[function() {doReplace(match);}, advance]);
|
||||||
};
|
};
|
||||||
var doReplace = function(match) {
|
var doReplace = function(match) {
|
||||||
cursor.replace(typeof query == "string" ? text :
|
cursor.replace(typeof query == "string" ? text :
|
||||||
text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
|
text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
|
||||||
advance();
|
advance();
|
||||||
};
|
};
|
||||||
advance();
|
advance();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
|
CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
|
||||||
CodeMirror.commands.findNext = doSearch;
|
CodeMirror.commands.findNext = doSearch;
|
||||||
CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
|
CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
|
||||||
CodeMirror.commands.clearSearch = clearSearch;
|
CodeMirror.commands.clearSearch = clearSearch;
|
||||||
CodeMirror.commands.replace = replace;
|
CodeMirror.commands.replace = replace;
|
||||||
CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
|
CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
|
||||||
});
|
});
|
||||||
|
|||||||
+189
-189
@@ -1,189 +1,189 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var Pos = CodeMirror.Pos;
|
var Pos = CodeMirror.Pos;
|
||||||
|
|
||||||
function SearchCursor(doc, query, pos, caseFold) {
|
function SearchCursor(doc, query, pos, caseFold) {
|
||||||
this.atOccurrence = false; this.doc = doc;
|
this.atOccurrence = false; this.doc = doc;
|
||||||
if (caseFold == null && typeof query == "string") caseFold = false;
|
if (caseFold == null && typeof query == "string") caseFold = false;
|
||||||
|
|
||||||
pos = pos ? doc.clipPos(pos) : Pos(0, 0);
|
pos = pos ? doc.clipPos(pos) : Pos(0, 0);
|
||||||
this.pos = {from: pos, to: pos};
|
this.pos = {from: pos, to: pos};
|
||||||
|
|
||||||
// The matches method is filled in based on the type of query.
|
// The matches method is filled in based on the type of query.
|
||||||
// It takes a position and a direction, and returns an object
|
// It takes a position and a direction, and returns an object
|
||||||
// describing the next occurrence of the query, or null if no
|
// describing the next occurrence of the query, or null if no
|
||||||
// more matches were found.
|
// more matches were found.
|
||||||
if (typeof query != "string") { // Regexp match
|
if (typeof query != "string") { // Regexp match
|
||||||
if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
|
if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
|
||||||
this.matches = function(reverse, pos) {
|
this.matches = function(reverse, pos) {
|
||||||
if (reverse) {
|
if (reverse) {
|
||||||
query.lastIndex = 0;
|
query.lastIndex = 0;
|
||||||
var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;
|
var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
query.lastIndex = cutOff;
|
query.lastIndex = cutOff;
|
||||||
var newMatch = query.exec(line);
|
var newMatch = query.exec(line);
|
||||||
if (!newMatch) break;
|
if (!newMatch) break;
|
||||||
match = newMatch;
|
match = newMatch;
|
||||||
start = match.index;
|
start = match.index;
|
||||||
cutOff = match.index + (match[0].length || 1);
|
cutOff = match.index + (match[0].length || 1);
|
||||||
if (cutOff == line.length) break;
|
if (cutOff == line.length) break;
|
||||||
}
|
}
|
||||||
var matchLen = (match && match[0].length) || 0;
|
var matchLen = (match && match[0].length) || 0;
|
||||||
if (!matchLen) {
|
if (!matchLen) {
|
||||||
if (start == 0 && line.length == 0) {match = undefined;}
|
if (start == 0 && line.length == 0) {match = undefined;}
|
||||||
else if (start != doc.getLine(pos.line).length) {
|
else if (start != doc.getLine(pos.line).length) {
|
||||||
matchLen++;
|
matchLen++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
query.lastIndex = pos.ch;
|
query.lastIndex = pos.ch;
|
||||||
var line = doc.getLine(pos.line), match = query.exec(line);
|
var line = doc.getLine(pos.line), match = query.exec(line);
|
||||||
var matchLen = (match && match[0].length) || 0;
|
var matchLen = (match && match[0].length) || 0;
|
||||||
var start = match && match.index;
|
var start = match && match.index;
|
||||||
if (start + matchLen != line.length && !matchLen) matchLen = 1;
|
if (start + matchLen != line.length && !matchLen) matchLen = 1;
|
||||||
}
|
}
|
||||||
if (match && matchLen)
|
if (match && matchLen)
|
||||||
return {from: Pos(pos.line, start),
|
return {from: Pos(pos.line, start),
|
||||||
to: Pos(pos.line, start + matchLen),
|
to: Pos(pos.line, start + matchLen),
|
||||||
match: match};
|
match: match};
|
||||||
};
|
};
|
||||||
} else { // String query
|
} else { // String query
|
||||||
var origQuery = query;
|
var origQuery = query;
|
||||||
if (caseFold) query = query.toLowerCase();
|
if (caseFold) query = query.toLowerCase();
|
||||||
var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
|
var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
|
||||||
var target = query.split("\n");
|
var target = query.split("\n");
|
||||||
// Different methods for single-line and multi-line queries
|
// Different methods for single-line and multi-line queries
|
||||||
if (target.length == 1) {
|
if (target.length == 1) {
|
||||||
if (!query.length) {
|
if (!query.length) {
|
||||||
// Empty string would match anything and never progress, so
|
// Empty string would match anything and never progress, so
|
||||||
// we define it to match nothing instead.
|
// we define it to match nothing instead.
|
||||||
this.matches = function() {};
|
this.matches = function() {};
|
||||||
} else {
|
} else {
|
||||||
this.matches = function(reverse, pos) {
|
this.matches = function(reverse, pos) {
|
||||||
if (reverse) {
|
if (reverse) {
|
||||||
var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig);
|
var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig);
|
||||||
var match = line.lastIndexOf(query);
|
var match = line.lastIndexOf(query);
|
||||||
if (match > -1) {
|
if (match > -1) {
|
||||||
match = adjustPos(orig, line, match);
|
match = adjustPos(orig, line, match);
|
||||||
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
|
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig);
|
var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig);
|
||||||
var match = line.indexOf(query);
|
var match = line.indexOf(query);
|
||||||
if (match > -1) {
|
if (match > -1) {
|
||||||
match = adjustPos(orig, line, match) + pos.ch;
|
match = adjustPos(orig, line, match) + pos.ch;
|
||||||
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
|
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var origTarget = origQuery.split("\n");
|
var origTarget = origQuery.split("\n");
|
||||||
this.matches = function(reverse, pos) {
|
this.matches = function(reverse, pos) {
|
||||||
var last = target.length - 1;
|
var last = target.length - 1;
|
||||||
if (reverse) {
|
if (reverse) {
|
||||||
if (pos.line - (target.length - 1) < doc.firstLine()) return;
|
if (pos.line - (target.length - 1) < doc.firstLine()) return;
|
||||||
if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return;
|
if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return;
|
||||||
var to = Pos(pos.line, origTarget[last].length);
|
var to = Pos(pos.line, origTarget[last].length);
|
||||||
for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln)
|
for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln)
|
||||||
if (target[i] != fold(doc.getLine(ln))) return;
|
if (target[i] != fold(doc.getLine(ln))) return;
|
||||||
var line = doc.getLine(ln), cut = line.length - origTarget[0].length;
|
var line = doc.getLine(ln), cut = line.length - origTarget[0].length;
|
||||||
if (fold(line.slice(cut)) != target[0]) return;
|
if (fold(line.slice(cut)) != target[0]) return;
|
||||||
return {from: Pos(ln, cut), to: to};
|
return {from: Pos(ln, cut), to: to};
|
||||||
} else {
|
} else {
|
||||||
if (pos.line + (target.length - 1) > doc.lastLine()) return;
|
if (pos.line + (target.length - 1) > doc.lastLine()) return;
|
||||||
var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length;
|
var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length;
|
||||||
if (fold(line.slice(cut)) != target[0]) return;
|
if (fold(line.slice(cut)) != target[0]) return;
|
||||||
var from = Pos(pos.line, cut);
|
var from = Pos(pos.line, cut);
|
||||||
for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln)
|
for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln)
|
||||||
if (target[i] != fold(doc.getLine(ln))) return;
|
if (target[i] != fold(doc.getLine(ln))) return;
|
||||||
if (fold(doc.getLine(ln).slice(0, origTarget[last].length)) != target[last]) return;
|
if (fold(doc.getLine(ln).slice(0, origTarget[last].length)) != target[last]) return;
|
||||||
return {from: from, to: Pos(ln, origTarget[last].length)};
|
return {from: from, to: Pos(ln, origTarget[last].length)};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchCursor.prototype = {
|
SearchCursor.prototype = {
|
||||||
findNext: function() {return this.find(false);},
|
findNext: function() {return this.find(false);},
|
||||||
findPrevious: function() {return this.find(true);},
|
findPrevious: function() {return this.find(true);},
|
||||||
|
|
||||||
find: function(reverse) {
|
find: function(reverse) {
|
||||||
var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
|
var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
|
||||||
function savePosAndFail(line) {
|
function savePosAndFail(line) {
|
||||||
var pos = Pos(line, 0);
|
var pos = Pos(line, 0);
|
||||||
self.pos = {from: pos, to: pos};
|
self.pos = {from: pos, to: pos};
|
||||||
self.atOccurrence = false;
|
self.atOccurrence = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (this.pos = this.matches(reverse, pos)) {
|
if (this.pos = this.matches(reverse, pos)) {
|
||||||
this.atOccurrence = true;
|
this.atOccurrence = true;
|
||||||
return this.pos.match || true;
|
return this.pos.match || true;
|
||||||
}
|
}
|
||||||
if (reverse) {
|
if (reverse) {
|
||||||
if (!pos.line) return savePosAndFail(0);
|
if (!pos.line) return savePosAndFail(0);
|
||||||
pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);
|
pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var maxLine = this.doc.lineCount();
|
var maxLine = this.doc.lineCount();
|
||||||
if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
|
if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
|
||||||
pos = Pos(pos.line + 1, 0);
|
pos = Pos(pos.line + 1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
from: function() {if (this.atOccurrence) return this.pos.from;},
|
from: function() {if (this.atOccurrence) return this.pos.from;},
|
||||||
to: function() {if (this.atOccurrence) return this.pos.to;},
|
to: function() {if (this.atOccurrence) return this.pos.to;},
|
||||||
|
|
||||||
replace: function(newText, origin) {
|
replace: function(newText, origin) {
|
||||||
if (!this.atOccurrence) return;
|
if (!this.atOccurrence) return;
|
||||||
var lines = CodeMirror.splitLines(newText);
|
var lines = CodeMirror.splitLines(newText);
|
||||||
this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin);
|
this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin);
|
||||||
this.pos.to = Pos(this.pos.from.line + lines.length - 1,
|
this.pos.to = Pos(this.pos.from.line + lines.length - 1,
|
||||||
lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));
|
lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Maps a position in a case-folded line back to a position in the original line
|
// Maps a position in a case-folded line back to a position in the original line
|
||||||
// (compensating for codepoints increasing in number during folding)
|
// (compensating for codepoints increasing in number during folding)
|
||||||
function adjustPos(orig, folded, pos) {
|
function adjustPos(orig, folded, pos) {
|
||||||
if (orig.length == folded.length) return pos;
|
if (orig.length == folded.length) return pos;
|
||||||
for (var pos1 = Math.min(pos, orig.length);;) {
|
for (var pos1 = Math.min(pos, orig.length);;) {
|
||||||
var len1 = orig.slice(0, pos1).toLowerCase().length;
|
var len1 = orig.slice(0, pos1).toLowerCase().length;
|
||||||
if (len1 < pos) ++pos1;
|
if (len1 < pos) ++pos1;
|
||||||
else if (len1 > pos) --pos1;
|
else if (len1 > pos) --pos1;
|
||||||
else return pos1;
|
else return pos1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
|
CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
|
||||||
return new SearchCursor(this.doc, query, pos, caseFold);
|
return new SearchCursor(this.doc, query, pos, caseFold);
|
||||||
});
|
});
|
||||||
CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) {
|
CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) {
|
||||||
return new SearchCursor(this, query, pos, caseFold);
|
return new SearchCursor(this, query, pos, caseFold);
|
||||||
});
|
});
|
||||||
|
|
||||||
CodeMirror.defineExtension("selectMatches", function(query, caseFold) {
|
CodeMirror.defineExtension("selectMatches", function(query, caseFold) {
|
||||||
var ranges = [];
|
var ranges = [];
|
||||||
var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold);
|
var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold);
|
||||||
while (cur.findNext()) {
|
while (cur.findNext()) {
|
||||||
if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break;
|
if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break;
|
||||||
ranges.push({anchor: cur.from(), head: cur.to()});
|
ranges.push({anchor: cur.from(), head: cur.to()});
|
||||||
}
|
}
|
||||||
if (ranges.length)
|
if (ranges.length)
|
||||||
this.setSelections(ranges, 0);
|
this.setSelections(ranges, 0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,71 +1,71 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
// Because sometimes you need to style the cursor's line.
|
// Because sometimes you need to style the cursor's line.
|
||||||
//
|
//
|
||||||
// Adds an option 'styleActiveLine' which, when enabled, gives the
|
// Adds an option 'styleActiveLine' which, when enabled, gives the
|
||||||
// active line's wrapping <div> the CSS class "CodeMirror-activeline",
|
// active line's wrapping <div> the CSS class "CodeMirror-activeline",
|
||||||
// and gives its background <div> the class "CodeMirror-activeline-background".
|
// and gives its background <div> the class "CodeMirror-activeline-background".
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var WRAP_CLASS = "CodeMirror-activeline";
|
var WRAP_CLASS = "CodeMirror-activeline";
|
||||||
var BACK_CLASS = "CodeMirror-activeline-background";
|
var BACK_CLASS = "CodeMirror-activeline-background";
|
||||||
|
|
||||||
CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) {
|
CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) {
|
||||||
var prev = old && old != CodeMirror.Init;
|
var prev = old && old != CodeMirror.Init;
|
||||||
if (val && !prev) {
|
if (val && !prev) {
|
||||||
cm.state.activeLines = [];
|
cm.state.activeLines = [];
|
||||||
updateActiveLines(cm, cm.listSelections());
|
updateActiveLines(cm, cm.listSelections());
|
||||||
cm.on("beforeSelectionChange", selectionChange);
|
cm.on("beforeSelectionChange", selectionChange);
|
||||||
} else if (!val && prev) {
|
} else if (!val && prev) {
|
||||||
cm.off("beforeSelectionChange", selectionChange);
|
cm.off("beforeSelectionChange", selectionChange);
|
||||||
clearActiveLines(cm);
|
clearActiveLines(cm);
|
||||||
delete cm.state.activeLines;
|
delete cm.state.activeLines;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function clearActiveLines(cm) {
|
function clearActiveLines(cm) {
|
||||||
for (var i = 0; i < cm.state.activeLines.length; i++) {
|
for (var i = 0; i < cm.state.activeLines.length; i++) {
|
||||||
cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS);
|
cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS);
|
||||||
cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS);
|
cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sameArray(a, b) {
|
function sameArray(a, b) {
|
||||||
if (a.length != b.length) return false;
|
if (a.length != b.length) return false;
|
||||||
for (var i = 0; i < a.length; i++)
|
for (var i = 0; i < a.length; i++)
|
||||||
if (a[i] != b[i]) return false;
|
if (a[i] != b[i]) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateActiveLines(cm, ranges) {
|
function updateActiveLines(cm, ranges) {
|
||||||
var active = [];
|
var active = [];
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
var range = ranges[i];
|
var range = ranges[i];
|
||||||
if (!range.empty()) continue;
|
if (!range.empty()) continue;
|
||||||
var line = cm.getLineHandleVisualStart(range.head.line);
|
var line = cm.getLineHandleVisualStart(range.head.line);
|
||||||
if (active[active.length - 1] != line) active.push(line);
|
if (active[active.length - 1] != line) active.push(line);
|
||||||
}
|
}
|
||||||
if (sameArray(cm.state.activeLines, active)) return;
|
if (sameArray(cm.state.activeLines, active)) return;
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
clearActiveLines(cm);
|
clearActiveLines(cm);
|
||||||
for (var i = 0; i < active.length; i++) {
|
for (var i = 0; i < active.length; i++) {
|
||||||
cm.addLineClass(active[i], "wrap", WRAP_CLASS);
|
cm.addLineClass(active[i], "wrap", WRAP_CLASS);
|
||||||
cm.addLineClass(active[i], "background", BACK_CLASS);
|
cm.addLineClass(active[i], "background", BACK_CLASS);
|
||||||
}
|
}
|
||||||
cm.state.activeLines = active;
|
cm.state.activeLines = active;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectionChange(cm, sel) {
|
function selectionChange(cm, sel) {
|
||||||
updateActiveLines(cm, sel.ranges);
|
updateActiveLines(cm, sel.ranges);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+118
-118
@@ -1,118 +1,118 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
// Because sometimes you need to mark the selected *text*.
|
// Because sometimes you need to mark the selected *text*.
|
||||||
//
|
//
|
||||||
// Adds an option 'styleSelectedText' which, when enabled, gives
|
// Adds an option 'styleSelectedText' which, when enabled, gives
|
||||||
// selected text the CSS class given as option value, or
|
// selected text the CSS class given as option value, or
|
||||||
// "CodeMirror-selectedtext" when the value is not a string.
|
// "CodeMirror-selectedtext" when the value is not a string.
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
CodeMirror.defineOption("styleSelectedText", false, function(cm, val, old) {
|
CodeMirror.defineOption("styleSelectedText", false, function(cm, val, old) {
|
||||||
var prev = old && old != CodeMirror.Init;
|
var prev = old && old != CodeMirror.Init;
|
||||||
if (val && !prev) {
|
if (val && !prev) {
|
||||||
cm.state.markedSelection = [];
|
cm.state.markedSelection = [];
|
||||||
cm.state.markedSelectionStyle = typeof val == "string" ? val : "CodeMirror-selectedtext";
|
cm.state.markedSelectionStyle = typeof val == "string" ? val : "CodeMirror-selectedtext";
|
||||||
reset(cm);
|
reset(cm);
|
||||||
cm.on("cursorActivity", onCursorActivity);
|
cm.on("cursorActivity", onCursorActivity);
|
||||||
cm.on("change", onChange);
|
cm.on("change", onChange);
|
||||||
} else if (!val && prev) {
|
} else if (!val && prev) {
|
||||||
cm.off("cursorActivity", onCursorActivity);
|
cm.off("cursorActivity", onCursorActivity);
|
||||||
cm.off("change", onChange);
|
cm.off("change", onChange);
|
||||||
clear(cm);
|
clear(cm);
|
||||||
cm.state.markedSelection = cm.state.markedSelectionStyle = null;
|
cm.state.markedSelection = cm.state.markedSelectionStyle = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function onCursorActivity(cm) {
|
function onCursorActivity(cm) {
|
||||||
cm.operation(function() { update(cm); });
|
cm.operation(function() { update(cm); });
|
||||||
}
|
}
|
||||||
|
|
||||||
function onChange(cm) {
|
function onChange(cm) {
|
||||||
if (cm.state.markedSelection.length)
|
if (cm.state.markedSelection.length)
|
||||||
cm.operation(function() { clear(cm); });
|
cm.operation(function() { clear(cm); });
|
||||||
}
|
}
|
||||||
|
|
||||||
var CHUNK_SIZE = 8;
|
var CHUNK_SIZE = 8;
|
||||||
var Pos = CodeMirror.Pos;
|
var Pos = CodeMirror.Pos;
|
||||||
var cmp = CodeMirror.cmpPos;
|
var cmp = CodeMirror.cmpPos;
|
||||||
|
|
||||||
function coverRange(cm, from, to, addAt) {
|
function coverRange(cm, from, to, addAt) {
|
||||||
if (cmp(from, to) == 0) return;
|
if (cmp(from, to) == 0) return;
|
||||||
var array = cm.state.markedSelection;
|
var array = cm.state.markedSelection;
|
||||||
var cls = cm.state.markedSelectionStyle;
|
var cls = cm.state.markedSelectionStyle;
|
||||||
for (var line = from.line;;) {
|
for (var line = from.line;;) {
|
||||||
var start = line == from.line ? from : Pos(line, 0);
|
var start = line == from.line ? from : Pos(line, 0);
|
||||||
var endLine = line + CHUNK_SIZE, atEnd = endLine >= to.line;
|
var endLine = line + CHUNK_SIZE, atEnd = endLine >= to.line;
|
||||||
var end = atEnd ? to : Pos(endLine, 0);
|
var end = atEnd ? to : Pos(endLine, 0);
|
||||||
var mark = cm.markText(start, end, {className: cls});
|
var mark = cm.markText(start, end, {className: cls});
|
||||||
if (addAt == null) array.push(mark);
|
if (addAt == null) array.push(mark);
|
||||||
else array.splice(addAt++, 0, mark);
|
else array.splice(addAt++, 0, mark);
|
||||||
if (atEnd) break;
|
if (atEnd) break;
|
||||||
line = endLine;
|
line = endLine;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clear(cm) {
|
function clear(cm) {
|
||||||
var array = cm.state.markedSelection;
|
var array = cm.state.markedSelection;
|
||||||
for (var i = 0; i < array.length; ++i) array[i].clear();
|
for (var i = 0; i < array.length; ++i) array[i].clear();
|
||||||
array.length = 0;
|
array.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset(cm) {
|
function reset(cm) {
|
||||||
clear(cm);
|
clear(cm);
|
||||||
var ranges = cm.listSelections();
|
var ranges = cm.listSelections();
|
||||||
for (var i = 0; i < ranges.length; i++)
|
for (var i = 0; i < ranges.length; i++)
|
||||||
coverRange(cm, ranges[i].from(), ranges[i].to());
|
coverRange(cm, ranges[i].from(), ranges[i].to());
|
||||||
}
|
}
|
||||||
|
|
||||||
function update(cm) {
|
function update(cm) {
|
||||||
if (!cm.somethingSelected()) return clear(cm);
|
if (!cm.somethingSelected()) return clear(cm);
|
||||||
if (cm.listSelections().length > 1) return reset(cm);
|
if (cm.listSelections().length > 1) return reset(cm);
|
||||||
|
|
||||||
var from = cm.getCursor("start"), to = cm.getCursor("end");
|
var from = cm.getCursor("start"), to = cm.getCursor("end");
|
||||||
|
|
||||||
var array = cm.state.markedSelection;
|
var array = cm.state.markedSelection;
|
||||||
if (!array.length) return coverRange(cm, from, to);
|
if (!array.length) return coverRange(cm, from, to);
|
||||||
|
|
||||||
var coverStart = array[0].find(), coverEnd = array[array.length - 1].find();
|
var coverStart = array[0].find(), coverEnd = array[array.length - 1].find();
|
||||||
if (!coverStart || !coverEnd || to.line - from.line < CHUNK_SIZE ||
|
if (!coverStart || !coverEnd || to.line - from.line < CHUNK_SIZE ||
|
||||||
cmp(from, coverEnd.to) >= 0 || cmp(to, coverStart.from) <= 0)
|
cmp(from, coverEnd.to) >= 0 || cmp(to, coverStart.from) <= 0)
|
||||||
return reset(cm);
|
return reset(cm);
|
||||||
|
|
||||||
while (cmp(from, coverStart.from) > 0) {
|
while (cmp(from, coverStart.from) > 0) {
|
||||||
array.shift().clear();
|
array.shift().clear();
|
||||||
coverStart = array[0].find();
|
coverStart = array[0].find();
|
||||||
}
|
}
|
||||||
if (cmp(from, coverStart.from) < 0) {
|
if (cmp(from, coverStart.from) < 0) {
|
||||||
if (coverStart.to.line - from.line < CHUNK_SIZE) {
|
if (coverStart.to.line - from.line < CHUNK_SIZE) {
|
||||||
array.shift().clear();
|
array.shift().clear();
|
||||||
coverRange(cm, from, coverStart.to, 0);
|
coverRange(cm, from, coverStart.to, 0);
|
||||||
} else {
|
} else {
|
||||||
coverRange(cm, from, coverStart.from, 0);
|
coverRange(cm, from, coverStart.from, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (cmp(to, coverEnd.to) < 0) {
|
while (cmp(to, coverEnd.to) < 0) {
|
||||||
array.pop().clear();
|
array.pop().clear();
|
||||||
coverEnd = array[array.length - 1].find();
|
coverEnd = array[array.length - 1].find();
|
||||||
}
|
}
|
||||||
if (cmp(to, coverEnd.to) > 0) {
|
if (cmp(to, coverEnd.to) > 0) {
|
||||||
if (to.line - coverEnd.from.line < CHUNK_SIZE) {
|
if (to.line - coverEnd.from.line < CHUNK_SIZE) {
|
||||||
array.pop().clear();
|
array.pop().clear();
|
||||||
coverRange(cm, coverEnd.from, to);
|
coverRange(cm, coverEnd.from, to);
|
||||||
} else {
|
} else {
|
||||||
coverRange(cm, coverEnd.to, to);
|
coverRange(cm, coverEnd.to, to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+98
-98
@@ -1,98 +1,98 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
CodeMirror.defineOption("selectionPointer", false, function(cm, val) {
|
CodeMirror.defineOption("selectionPointer", false, function(cm, val) {
|
||||||
var data = cm.state.selectionPointer;
|
var data = cm.state.selectionPointer;
|
||||||
if (data) {
|
if (data) {
|
||||||
CodeMirror.off(cm.getWrapperElement(), "mousemove", data.mousemove);
|
CodeMirror.off(cm.getWrapperElement(), "mousemove", data.mousemove);
|
||||||
CodeMirror.off(cm.getWrapperElement(), "mouseout", data.mouseout);
|
CodeMirror.off(cm.getWrapperElement(), "mouseout", data.mouseout);
|
||||||
CodeMirror.off(window, "scroll", data.windowScroll);
|
CodeMirror.off(window, "scroll", data.windowScroll);
|
||||||
cm.off("cursorActivity", reset);
|
cm.off("cursorActivity", reset);
|
||||||
cm.off("scroll", reset);
|
cm.off("scroll", reset);
|
||||||
cm.state.selectionPointer = null;
|
cm.state.selectionPointer = null;
|
||||||
cm.display.lineDiv.style.cursor = "";
|
cm.display.lineDiv.style.cursor = "";
|
||||||
}
|
}
|
||||||
if (val) {
|
if (val) {
|
||||||
data = cm.state.selectionPointer = {
|
data = cm.state.selectionPointer = {
|
||||||
value: typeof val == "string" ? val : "default",
|
value: typeof val == "string" ? val : "default",
|
||||||
mousemove: function(event) { mousemove(cm, event); },
|
mousemove: function(event) { mousemove(cm, event); },
|
||||||
mouseout: function(event) { mouseout(cm, event); },
|
mouseout: function(event) { mouseout(cm, event); },
|
||||||
windowScroll: function() { reset(cm); },
|
windowScroll: function() { reset(cm); },
|
||||||
rects: null,
|
rects: null,
|
||||||
mouseX: null, mouseY: null,
|
mouseX: null, mouseY: null,
|
||||||
willUpdate: false
|
willUpdate: false
|
||||||
};
|
};
|
||||||
CodeMirror.on(cm.getWrapperElement(), "mousemove", data.mousemove);
|
CodeMirror.on(cm.getWrapperElement(), "mousemove", data.mousemove);
|
||||||
CodeMirror.on(cm.getWrapperElement(), "mouseout", data.mouseout);
|
CodeMirror.on(cm.getWrapperElement(), "mouseout", data.mouseout);
|
||||||
CodeMirror.on(window, "scroll", data.windowScroll);
|
CodeMirror.on(window, "scroll", data.windowScroll);
|
||||||
cm.on("cursorActivity", reset);
|
cm.on("cursorActivity", reset);
|
||||||
cm.on("scroll", reset);
|
cm.on("scroll", reset);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function mousemove(cm, event) {
|
function mousemove(cm, event) {
|
||||||
var data = cm.state.selectionPointer;
|
var data = cm.state.selectionPointer;
|
||||||
if (event.buttons == null ? event.which : event.buttons) {
|
if (event.buttons == null ? event.which : event.buttons) {
|
||||||
data.mouseX = data.mouseY = null;
|
data.mouseX = data.mouseY = null;
|
||||||
} else {
|
} else {
|
||||||
data.mouseX = event.clientX;
|
data.mouseX = event.clientX;
|
||||||
data.mouseY = event.clientY;
|
data.mouseY = event.clientY;
|
||||||
}
|
}
|
||||||
scheduleUpdate(cm);
|
scheduleUpdate(cm);
|
||||||
}
|
}
|
||||||
|
|
||||||
function mouseout(cm, event) {
|
function mouseout(cm, event) {
|
||||||
if (!cm.getWrapperElement().contains(event.relatedTarget)) {
|
if (!cm.getWrapperElement().contains(event.relatedTarget)) {
|
||||||
var data = cm.state.selectionPointer;
|
var data = cm.state.selectionPointer;
|
||||||
data.mouseX = data.mouseY = null;
|
data.mouseX = data.mouseY = null;
|
||||||
scheduleUpdate(cm);
|
scheduleUpdate(cm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset(cm) {
|
function reset(cm) {
|
||||||
cm.state.selectionPointer.rects = null;
|
cm.state.selectionPointer.rects = null;
|
||||||
scheduleUpdate(cm);
|
scheduleUpdate(cm);
|
||||||
}
|
}
|
||||||
|
|
||||||
function scheduleUpdate(cm) {
|
function scheduleUpdate(cm) {
|
||||||
if (!cm.state.selectionPointer.willUpdate) {
|
if (!cm.state.selectionPointer.willUpdate) {
|
||||||
cm.state.selectionPointer.willUpdate = true;
|
cm.state.selectionPointer.willUpdate = true;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
update(cm);
|
update(cm);
|
||||||
cm.state.selectionPointer.willUpdate = false;
|
cm.state.selectionPointer.willUpdate = false;
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function update(cm) {
|
function update(cm) {
|
||||||
var data = cm.state.selectionPointer;
|
var data = cm.state.selectionPointer;
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
if (data.rects == null && data.mouseX != null) {
|
if (data.rects == null && data.mouseX != null) {
|
||||||
data.rects = [];
|
data.rects = [];
|
||||||
if (cm.somethingSelected()) {
|
if (cm.somethingSelected()) {
|
||||||
for (var sel = cm.display.selectionDiv.firstChild; sel; sel = sel.nextSibling)
|
for (var sel = cm.display.selectionDiv.firstChild; sel; sel = sel.nextSibling)
|
||||||
data.rects.push(sel.getBoundingClientRect());
|
data.rects.push(sel.getBoundingClientRect());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var inside = false;
|
var inside = false;
|
||||||
if (data.mouseX != null) for (var i = 0; i < data.rects.length; i++) {
|
if (data.mouseX != null) for (var i = 0; i < data.rects.length; i++) {
|
||||||
var rect = data.rects[i];
|
var rect = data.rects[i];
|
||||||
if (rect.left <= data.mouseX && rect.right >= data.mouseX &&
|
if (rect.left <= data.mouseX && rect.right >= data.mouseX &&
|
||||||
rect.top <= data.mouseY && rect.bottom >= data.mouseY)
|
rect.top <= data.mouseY && rect.bottom >= data.mouseY)
|
||||||
inside = true;
|
inside = true;
|
||||||
}
|
}
|
||||||
var cursor = inside ? data.value : "";
|
var cursor = inside ? data.value : "";
|
||||||
if (cm.display.lineDiv.style.cursor != cursor)
|
if (cm.display.lineDiv.style.cursor != cursor)
|
||||||
cm.display.lineDiv.style.cursor = cursor;
|
cm.display.lineDiv.style.cursor = cursor;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+325
-325
@@ -1,325 +1,325 @@
|
|||||||
/* BASICS */
|
/* BASICS */
|
||||||
|
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
/* Set height, width, borders, and global font properties here */
|
/* Set height, width, borders, and global font properties here */
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PADDING */
|
/* PADDING */
|
||||||
|
|
||||||
.CodeMirror-lines {
|
.CodeMirror-lines {
|
||||||
padding: 4px 0; /* Vertical padding around content */
|
padding: 4px 0; /* Vertical padding around content */
|
||||||
}
|
}
|
||||||
.CodeMirror pre {
|
.CodeMirror pre {
|
||||||
padding: 0 4px; /* Horizontal padding of content */
|
padding: 0 4px; /* Horizontal padding of content */
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||||
background-color: white; /* The little square between H and V scrollbars */
|
background-color: white; /* The little square between H and V scrollbars */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GUTTER */
|
/* GUTTER */
|
||||||
|
|
||||||
.CodeMirror-gutters {
|
.CodeMirror-gutters {
|
||||||
border-right: 1px solid #ddd;
|
border-right: 1px solid #ddd;
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.CodeMirror-linenumbers {}
|
.CodeMirror-linenumbers {}
|
||||||
.CodeMirror-linenumber {
|
.CodeMirror-linenumber {
|
||||||
padding: 0 3px 0 5px;
|
padding: 0 3px 0 5px;
|
||||||
min-width: 20px;
|
min-width: 20px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
color: #999;
|
color: #999;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-guttermarker { color: black; }
|
.CodeMirror-guttermarker { color: black; }
|
||||||
.CodeMirror-guttermarker-subtle { color: #999; }
|
.CodeMirror-guttermarker-subtle { color: #999; }
|
||||||
|
|
||||||
/* CURSOR */
|
/* CURSOR */
|
||||||
|
|
||||||
.CodeMirror div.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
border-left: 1px solid black;
|
border-left: 1px solid black;
|
||||||
}
|
}
|
||||||
/* Shown when moving in bi-directional text */
|
/* Shown when moving in bi-directional text */
|
||||||
.CodeMirror div.CodeMirror-secondarycursor {
|
.CodeMirror div.CodeMirror-secondarycursor {
|
||||||
border-left: 1px solid silver;
|
border-left: 1px solid silver;
|
||||||
}
|
}
|
||||||
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
|
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
|
||||||
width: auto;
|
width: auto;
|
||||||
border: 0;
|
border: 0;
|
||||||
background: #7e7;
|
background: #7e7;
|
||||||
}
|
}
|
||||||
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
|
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cm-animate-fat-cursor {
|
.cm-animate-fat-cursor {
|
||||||
width: auto;
|
width: auto;
|
||||||
border: 0;
|
border: 0;
|
||||||
-webkit-animation: blink 1.06s steps(1) infinite;
|
-webkit-animation: blink 1.06s steps(1) infinite;
|
||||||
-moz-animation: blink 1.06s steps(1) infinite;
|
-moz-animation: blink 1.06s steps(1) infinite;
|
||||||
animation: blink 1.06s steps(1) infinite;
|
animation: blink 1.06s steps(1) infinite;
|
||||||
}
|
}
|
||||||
@-moz-keyframes blink {
|
@-moz-keyframes blink {
|
||||||
0% { background: #7e7; }
|
0% { background: #7e7; }
|
||||||
50% { background: none; }
|
50% { background: none; }
|
||||||
100% { background: #7e7; }
|
100% { background: #7e7; }
|
||||||
}
|
}
|
||||||
@-webkit-keyframes blink {
|
@-webkit-keyframes blink {
|
||||||
0% { background: #7e7; }
|
0% { background: #7e7; }
|
||||||
50% { background: none; }
|
50% { background: none; }
|
||||||
100% { background: #7e7; }
|
100% { background: #7e7; }
|
||||||
}
|
}
|
||||||
@keyframes blink {
|
@keyframes blink {
|
||||||
0% { background: #7e7; }
|
0% { background: #7e7; }
|
||||||
50% { background: none; }
|
50% { background: none; }
|
||||||
100% { background: #7e7; }
|
100% { background: #7e7; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Can style cursor different in overwrite (non-insert) mode */
|
/* Can style cursor different in overwrite (non-insert) mode */
|
||||||
div.CodeMirror-overwrite div.CodeMirror-cursor {}
|
div.CodeMirror-overwrite div.CodeMirror-cursor {}
|
||||||
|
|
||||||
.cm-tab { display: inline-block; text-decoration: inherit; }
|
.cm-tab { display: inline-block; text-decoration: inherit; }
|
||||||
|
|
||||||
.CodeMirror-ruler {
|
.CodeMirror-ruler {
|
||||||
border-left: 1px solid #ccc;
|
border-left: 1px solid #ccc;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DEFAULT THEME */
|
/* DEFAULT THEME */
|
||||||
|
|
||||||
.cm-s-default .cm-keyword {color: #708;}
|
.cm-s-default .cm-keyword {color: #708;}
|
||||||
.cm-s-default .cm-atom {color: #219;}
|
.cm-s-default .cm-atom {color: #219;}
|
||||||
.cm-s-default .cm-number {color: #164;}
|
.cm-s-default .cm-number {color: #164;}
|
||||||
.cm-s-default .cm-def {color: #00f;}
|
.cm-s-default .cm-def {color: #00f;}
|
||||||
.cm-s-default .cm-variable,
|
.cm-s-default .cm-variable,
|
||||||
.cm-s-default .cm-punctuation,
|
.cm-s-default .cm-punctuation,
|
||||||
.cm-s-default .cm-property,
|
.cm-s-default .cm-property,
|
||||||
.cm-s-default .cm-operator {}
|
.cm-s-default .cm-operator {}
|
||||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||||
.cm-s-default .cm-variable-3 {color: #085;}
|
.cm-s-default .cm-variable-3 {color: #085;}
|
||||||
.cm-s-default .cm-comment {color: #a50;}
|
.cm-s-default .cm-comment {color: #a50;}
|
||||||
.cm-s-default .cm-string {color: #a11;}
|
.cm-s-default .cm-string {color: #a11;}
|
||||||
.cm-s-default .cm-string-2 {color: #f50;}
|
.cm-s-default .cm-string-2 {color: #f50;}
|
||||||
.cm-s-default .cm-meta {color: #555;}
|
.cm-s-default .cm-meta {color: #555;}
|
||||||
.cm-s-default .cm-qualifier {color: #555;}
|
.cm-s-default .cm-qualifier {color: #555;}
|
||||||
.cm-s-default .cm-builtin {color: #30a;}
|
.cm-s-default .cm-builtin {color: #30a;}
|
||||||
.cm-s-default .cm-bracket {color: #997;}
|
.cm-s-default .cm-bracket {color: #997;}
|
||||||
.cm-s-default .cm-tag {color: #170;}
|
.cm-s-default .cm-tag {color: #170;}
|
||||||
.cm-s-default .cm-attribute {color: #00c;}
|
.cm-s-default .cm-attribute {color: #00c;}
|
||||||
.cm-s-default .cm-header {color: blue;}
|
.cm-s-default .cm-header {color: blue;}
|
||||||
.cm-s-default .cm-quote {color: #090;}
|
.cm-s-default .cm-quote {color: #090;}
|
||||||
.cm-s-default .cm-hr {color: #999;}
|
.cm-s-default .cm-hr {color: #999;}
|
||||||
.cm-s-default .cm-link {color: #00c;}
|
.cm-s-default .cm-link {color: #00c;}
|
||||||
|
|
||||||
.cm-negative {color: #d44;}
|
.cm-negative {color: #d44;}
|
||||||
.cm-positive {color: #292;}
|
.cm-positive {color: #292;}
|
||||||
.cm-header, .cm-strong {font-weight: bold;}
|
.cm-header, .cm-strong {font-weight: bold;}
|
||||||
.cm-em {font-style: italic;}
|
.cm-em {font-style: italic;}
|
||||||
.cm-link {text-decoration: underline;}
|
.cm-link {text-decoration: underline;}
|
||||||
.cm-strikethrough {text-decoration: line-through;}
|
.cm-strikethrough {text-decoration: line-through;}
|
||||||
|
|
||||||
.cm-s-default .cm-error {color: #f00;}
|
.cm-s-default .cm-error {color: #f00;}
|
||||||
.cm-invalidchar {color: #f00;}
|
.cm-invalidchar {color: #f00;}
|
||||||
|
|
||||||
.CodeMirror-composing { border-bottom: 2px solid; }
|
.CodeMirror-composing { border-bottom: 2px solid; }
|
||||||
|
|
||||||
/* Default styles for common addons */
|
/* Default styles for common addons */
|
||||||
|
|
||||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||||
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
||||||
.CodeMirror-activeline-background {background: #e8f2ff;}
|
.CodeMirror-activeline-background {background: #e8f2ff;}
|
||||||
|
|
||||||
/* STOP */
|
/* STOP */
|
||||||
|
|
||||||
/* The rest of this file contains styles related to the mechanics of
|
/* The rest of this file contains styles related to the mechanics of
|
||||||
the editor. You probably shouldn't touch them. */
|
the editor. You probably shouldn't touch them. */
|
||||||
|
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: white;
|
background: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-scroll {
|
.CodeMirror-scroll {
|
||||||
overflow: scroll !important; /* Things will break if this is overridden */
|
overflow: scroll !important; /* Things will break if this is overridden */
|
||||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||||
/* See overflow: hidden in .CodeMirror */
|
/* See overflow: hidden in .CodeMirror */
|
||||||
margin-bottom: -30px; margin-right: -30px;
|
margin-bottom: -30px; margin-right: -30px;
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
outline: none; /* Prevent dragging from highlighting the element */
|
outline: none; /* Prevent dragging from highlighting the element */
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.CodeMirror-sizer {
|
.CodeMirror-sizer {
|
||||||
position: relative;
|
position: relative;
|
||||||
border-right: 30px solid transparent;
|
border-right: 30px solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||||
before actuall scrolling happens, thus preventing shaking and
|
before actuall scrolling happens, thus preventing shaking and
|
||||||
flickering artifacts. */
|
flickering artifacts. */
|
||||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 6;
|
z-index: 6;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.CodeMirror-vscrollbar {
|
.CodeMirror-vscrollbar {
|
||||||
right: 0; top: 0;
|
right: 0; top: 0;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
.CodeMirror-hscrollbar {
|
.CodeMirror-hscrollbar {
|
||||||
bottom: 0; left: 0;
|
bottom: 0; left: 0;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
}
|
}
|
||||||
.CodeMirror-scrollbar-filler {
|
.CodeMirror-scrollbar-filler {
|
||||||
right: 0; bottom: 0;
|
right: 0; bottom: 0;
|
||||||
}
|
}
|
||||||
.CodeMirror-gutter-filler {
|
.CodeMirror-gutter-filler {
|
||||||
left: 0; bottom: 0;
|
left: 0; bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-gutters {
|
.CodeMirror-gutters {
|
||||||
position: absolute; left: 0; top: 0;
|
position: absolute; left: 0; top: 0;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
.CodeMirror-gutter {
|
.CodeMirror-gutter {
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: -30px;
|
margin-bottom: -30px;
|
||||||
/* Hack to make IE7 behave */
|
/* Hack to make IE7 behave */
|
||||||
*zoom:1;
|
*zoom:1;
|
||||||
*display:inline;
|
*display:inline;
|
||||||
}
|
}
|
||||||
.CodeMirror-gutter-wrapper {
|
.CodeMirror-gutter-wrapper {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.CodeMirror-gutter-elt {
|
.CodeMirror-gutter-elt {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
}
|
}
|
||||||
.CodeMirror-gutter-wrapper {
|
.CodeMirror-gutter-wrapper {
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-lines {
|
.CodeMirror-lines {
|
||||||
cursor: text;
|
cursor: text;
|
||||||
min-height: 1px; /* prevents collapsing before first draw */
|
min-height: 1px; /* prevents collapsing before first draw */
|
||||||
}
|
}
|
||||||
.CodeMirror pre {
|
.CodeMirror pre {
|
||||||
/* Reset some styles that the rest of the page might have set */
|
/* Reset some styles that the rest of the page might have set */
|
||||||
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
||||||
border-width: 0;
|
border-width: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
-webkit-tap-highlight-color: transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
}
|
}
|
||||||
.CodeMirror-wrap pre {
|
.CodeMirror-wrap pre {
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: normal;
|
word-break: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-linebackground {
|
.CodeMirror-linebackground {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0; right: 0; top: 0; bottom: 0;
|
left: 0; right: 0; top: 0; bottom: 0;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-linewidget {
|
.CodeMirror-linewidget {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-widget {}
|
.CodeMirror-widget {}
|
||||||
|
|
||||||
.CodeMirror-code {
|
.CodeMirror-code {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Force content-box sizing for the elements where we expect it */
|
/* Force content-box sizing for the elements where we expect it */
|
||||||
.CodeMirror-scroll,
|
.CodeMirror-scroll,
|
||||||
.CodeMirror-sizer,
|
.CodeMirror-sizer,
|
||||||
.CodeMirror-gutter,
|
.CodeMirror-gutter,
|
||||||
.CodeMirror-gutters,
|
.CodeMirror-gutters,
|
||||||
.CodeMirror-linenumber {
|
.CodeMirror-linenumber {
|
||||||
-moz-box-sizing: content-box;
|
-moz-box-sizing: content-box;
|
||||||
box-sizing: content-box;
|
box-sizing: content-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-measure {
|
.CodeMirror-measure {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 0;
|
height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
.CodeMirror-measure pre { position: static; }
|
.CodeMirror-measure pre { position: static; }
|
||||||
|
|
||||||
.CodeMirror div.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
width: 0;
|
width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.CodeMirror-cursors {
|
div.CodeMirror-cursors {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
.CodeMirror-focused div.CodeMirror-cursors {
|
.CodeMirror-focused div.CodeMirror-cursors {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-selected { background: #d9d9d9; }
|
.CodeMirror-selected { background: #d9d9d9; }
|
||||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||||
.CodeMirror-crosshair { cursor: crosshair; }
|
.CodeMirror-crosshair { cursor: crosshair; }
|
||||||
.CodeMirror ::selection { background: #d7d4f0; }
|
.CodeMirror ::selection { background: #d7d4f0; }
|
||||||
.CodeMirror ::-moz-selection { background: #d7d4f0; }
|
.CodeMirror ::-moz-selection { background: #d7d4f0; }
|
||||||
|
|
||||||
.cm-searching {
|
.cm-searching {
|
||||||
background: #ffa;
|
background: #ffa;
|
||||||
background: rgba(255, 255, 0, .4);
|
background: rgba(255, 255, 0, .4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
||||||
.CodeMirror span { *vertical-align: text-bottom; }
|
.CodeMirror span { *vertical-align: text-bottom; }
|
||||||
|
|
||||||
/* Used to force a border model for a node */
|
/* Used to force a border model for a node */
|
||||||
.cm-force-border { padding-right: .1px; }
|
.cm-force-border { padding-right: .1px; }
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
/* Hide the cursor when printing */
|
/* Hide the cursor when printing */
|
||||||
.CodeMirror div.CodeMirror-cursors {
|
.CodeMirror div.CodeMirror-cursors {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See issue #2901 */
|
/* See issue #2901 */
|
||||||
.cm-tab-wrap-hack:after { content: ''; }
|
.cm-tab-wrap-hack:after { content: ''; }
|
||||||
|
|
||||||
/* Help users use markselection to safely style text background */
|
/* Help users use markselection to safely style text background */
|
||||||
span.CodeMirror-selectedtext { background: none; }
|
span.CodeMirror-selectedtext { background: none; }
|
||||||
|
|||||||
+8745
-8745
File diff suppressed because it is too large
Load Diff
+754
-754
File diff suppressed because it is too large
Load Diff
+121
-121
@@ -1,121 +1,121 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css"));
|
mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod);
|
define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
|
CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
|
||||||
var htmlMode = CodeMirror.getMode(config, {name: "xml",
|
var htmlMode = CodeMirror.getMode(config, {name: "xml",
|
||||||
htmlMode: true,
|
htmlMode: true,
|
||||||
multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
|
multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
|
||||||
multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag});
|
multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag});
|
||||||
var cssMode = CodeMirror.getMode(config, "css");
|
var cssMode = CodeMirror.getMode(config, "css");
|
||||||
|
|
||||||
var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes;
|
var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes;
|
||||||
scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,
|
scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,
|
||||||
mode: CodeMirror.getMode(config, "javascript")});
|
mode: CodeMirror.getMode(config, "javascript")});
|
||||||
if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) {
|
if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) {
|
||||||
var conf = scriptTypesConf[i];
|
var conf = scriptTypesConf[i];
|
||||||
scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)});
|
scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)});
|
||||||
}
|
}
|
||||||
scriptTypes.push({matches: /./,
|
scriptTypes.push({matches: /./,
|
||||||
mode: CodeMirror.getMode(config, "text/plain")});
|
mode: CodeMirror.getMode(config, "text/plain")});
|
||||||
|
|
||||||
function html(stream, state) {
|
function html(stream, state) {
|
||||||
var tagName = state.htmlState.tagName;
|
var tagName = state.htmlState.tagName;
|
||||||
if (tagName) tagName = tagName.toLowerCase();
|
if (tagName) tagName = tagName.toLowerCase();
|
||||||
var style = htmlMode.token(stream, state.htmlState);
|
var style = htmlMode.token(stream, state.htmlState);
|
||||||
if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") {
|
if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") {
|
||||||
// Script block: mode to change to depends on type attribute
|
// Script block: mode to change to depends on type attribute
|
||||||
var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);
|
var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);
|
||||||
scriptType = scriptType ? scriptType[1] : "";
|
scriptType = scriptType ? scriptType[1] : "";
|
||||||
if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1);
|
if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1);
|
||||||
for (var i = 0; i < scriptTypes.length; ++i) {
|
for (var i = 0; i < scriptTypes.length; ++i) {
|
||||||
var tp = scriptTypes[i];
|
var tp = scriptTypes[i];
|
||||||
if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) {
|
if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) {
|
||||||
if (tp.mode) {
|
if (tp.mode) {
|
||||||
state.token = script;
|
state.token = script;
|
||||||
state.localMode = tp.mode;
|
state.localMode = tp.mode;
|
||||||
state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, ""));
|
state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, ""));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") {
|
} else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") {
|
||||||
state.token = css;
|
state.token = css;
|
||||||
state.localMode = cssMode;
|
state.localMode = cssMode;
|
||||||
state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
|
state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
function maybeBackup(stream, pat, style) {
|
function maybeBackup(stream, pat, style) {
|
||||||
var cur = stream.current();
|
var cur = stream.current();
|
||||||
var close = cur.search(pat);
|
var close = cur.search(pat);
|
||||||
if (close > -1) stream.backUp(cur.length - close);
|
if (close > -1) stream.backUp(cur.length - close);
|
||||||
else if (cur.match(/<\/?$/)) {
|
else if (cur.match(/<\/?$/)) {
|
||||||
stream.backUp(cur.length);
|
stream.backUp(cur.length);
|
||||||
if (!stream.match(pat, false)) stream.match(cur);
|
if (!stream.match(pat, false)) stream.match(cur);
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
function script(stream, state) {
|
function script(stream, state) {
|
||||||
if (stream.match(/^<\/\s*script\s*>/i, false)) {
|
if (stream.match(/^<\/\s*script\s*>/i, false)) {
|
||||||
state.token = html;
|
state.token = html;
|
||||||
state.localState = state.localMode = null;
|
state.localState = state.localMode = null;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return maybeBackup(stream, /<\/\s*script\s*>/,
|
return maybeBackup(stream, /<\/\s*script\s*>/,
|
||||||
state.localMode.token(stream, state.localState));
|
state.localMode.token(stream, state.localState));
|
||||||
}
|
}
|
||||||
function css(stream, state) {
|
function css(stream, state) {
|
||||||
if (stream.match(/^<\/\s*style\s*>/i, false)) {
|
if (stream.match(/^<\/\s*style\s*>/i, false)) {
|
||||||
state.token = html;
|
state.token = html;
|
||||||
state.localState = state.localMode = null;
|
state.localState = state.localMode = null;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return maybeBackup(stream, /<\/\s*style\s*>/,
|
return maybeBackup(stream, /<\/\s*style\s*>/,
|
||||||
cssMode.token(stream, state.localState));
|
cssMode.token(stream, state.localState));
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
startState: function() {
|
startState: function() {
|
||||||
var state = htmlMode.startState();
|
var state = htmlMode.startState();
|
||||||
return {token: html, localMode: null, localState: null, htmlState: state};
|
return {token: html, localMode: null, localState: null, htmlState: state};
|
||||||
},
|
},
|
||||||
|
|
||||||
copyState: function(state) {
|
copyState: function(state) {
|
||||||
if (state.localState)
|
if (state.localState)
|
||||||
var local = CodeMirror.copyState(state.localMode, state.localState);
|
var local = CodeMirror.copyState(state.localMode, state.localState);
|
||||||
return {token: state.token, localMode: state.localMode, localState: local,
|
return {token: state.token, localMode: state.localMode, localState: local,
|
||||||
htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
|
htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
|
||||||
},
|
},
|
||||||
|
|
||||||
token: function(stream, state) {
|
token: function(stream, state) {
|
||||||
return state.token(stream, state);
|
return state.token(stream, state);
|
||||||
},
|
},
|
||||||
|
|
||||||
indent: function(state, textAfter) {
|
indent: function(state, textAfter) {
|
||||||
if (!state.localMode || /^\s*<\//.test(textAfter))
|
if (!state.localMode || /^\s*<\//.test(textAfter))
|
||||||
return htmlMode.indent(state.htmlState, textAfter);
|
return htmlMode.indent(state.htmlState, textAfter);
|
||||||
else if (state.localMode.indent)
|
else if (state.localMode.indent)
|
||||||
return state.localMode.indent(state.localState, textAfter);
|
return state.localMode.indent(state.localState, textAfter);
|
||||||
else
|
else
|
||||||
return CodeMirror.Pass;
|
return CodeMirror.Pass;
|
||||||
},
|
},
|
||||||
|
|
||||||
innerMode: function(state) {
|
innerMode: function(state) {
|
||||||
return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
|
return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, "xml", "javascript", "css");
|
}, "xml", "javascript", "css");
|
||||||
|
|
||||||
CodeMirror.defineMIME("text/html", "htmlmixed");
|
CodeMirror.defineMIME("text/html", "htmlmixed");
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
+701
-701
File diff suppressed because it is too large
Load Diff
+384
-384
@@ -1,384 +1,384 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
mod(require("../../lib/codemirror"));
|
mod(require("../../lib/codemirror"));
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
define(["../../lib/codemirror"], mod);
|
define(["../../lib/codemirror"], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
mod(CodeMirror);
|
mod(CodeMirror);
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
CodeMirror.defineMode("xml", function(config, parserConfig) {
|
CodeMirror.defineMode("xml", function(config, parserConfig) {
|
||||||
var indentUnit = config.indentUnit;
|
var indentUnit = config.indentUnit;
|
||||||
var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1;
|
var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1;
|
||||||
var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag;
|
var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag;
|
||||||
if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true;
|
if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true;
|
||||||
|
|
||||||
var Kludges = parserConfig.htmlMode ? {
|
var Kludges = parserConfig.htmlMode ? {
|
||||||
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
||||||
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
||||||
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
||||||
'track': true, 'wbr': true, 'menuitem': true},
|
'track': true, 'wbr': true, 'menuitem': true},
|
||||||
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
||||||
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
||||||
'th': true, 'tr': true},
|
'th': true, 'tr': true},
|
||||||
contextGrabbers: {
|
contextGrabbers: {
|
||||||
'dd': {'dd': true, 'dt': true},
|
'dd': {'dd': true, 'dt': true},
|
||||||
'dt': {'dd': true, 'dt': true},
|
'dt': {'dd': true, 'dt': true},
|
||||||
'li': {'li': true},
|
'li': {'li': true},
|
||||||
'option': {'option': true, 'optgroup': true},
|
'option': {'option': true, 'optgroup': true},
|
||||||
'optgroup': {'optgroup': true},
|
'optgroup': {'optgroup': true},
|
||||||
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
||||||
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
||||||
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
||||||
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
||||||
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
||||||
'rp': {'rp': true, 'rt': true},
|
'rp': {'rp': true, 'rt': true},
|
||||||
'rt': {'rp': true, 'rt': true},
|
'rt': {'rp': true, 'rt': true},
|
||||||
'tbody': {'tbody': true, 'tfoot': true},
|
'tbody': {'tbody': true, 'tfoot': true},
|
||||||
'td': {'td': true, 'th': true},
|
'td': {'td': true, 'th': true},
|
||||||
'tfoot': {'tbody': true},
|
'tfoot': {'tbody': true},
|
||||||
'th': {'td': true, 'th': true},
|
'th': {'td': true, 'th': true},
|
||||||
'thead': {'tbody': true, 'tfoot': true},
|
'thead': {'tbody': true, 'tfoot': true},
|
||||||
'tr': {'tr': true}
|
'tr': {'tr': true}
|
||||||
},
|
},
|
||||||
doNotIndent: {"pre": true},
|
doNotIndent: {"pre": true},
|
||||||
allowUnquoted: true,
|
allowUnquoted: true,
|
||||||
allowMissing: true,
|
allowMissing: true,
|
||||||
caseFold: true
|
caseFold: true
|
||||||
} : {
|
} : {
|
||||||
autoSelfClosers: {},
|
autoSelfClosers: {},
|
||||||
implicitlyClosed: {},
|
implicitlyClosed: {},
|
||||||
contextGrabbers: {},
|
contextGrabbers: {},
|
||||||
doNotIndent: {},
|
doNotIndent: {},
|
||||||
allowUnquoted: false,
|
allowUnquoted: false,
|
||||||
allowMissing: false,
|
allowMissing: false,
|
||||||
caseFold: false
|
caseFold: false
|
||||||
};
|
};
|
||||||
var alignCDATA = parserConfig.alignCDATA;
|
var alignCDATA = parserConfig.alignCDATA;
|
||||||
|
|
||||||
// Return variables for tokenizers
|
// Return variables for tokenizers
|
||||||
var type, setStyle;
|
var type, setStyle;
|
||||||
|
|
||||||
function inText(stream, state) {
|
function inText(stream, state) {
|
||||||
function chain(parser) {
|
function chain(parser) {
|
||||||
state.tokenize = parser;
|
state.tokenize = parser;
|
||||||
return parser(stream, state);
|
return parser(stream, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
var ch = stream.next();
|
var ch = stream.next();
|
||||||
if (ch == "<") {
|
if (ch == "<") {
|
||||||
if (stream.eat("!")) {
|
if (stream.eat("!")) {
|
||||||
if (stream.eat("[")) {
|
if (stream.eat("[")) {
|
||||||
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
||||||
else return null;
|
else return null;
|
||||||
} else if (stream.match("--")) {
|
} else if (stream.match("--")) {
|
||||||
return chain(inBlock("comment", "-->"));
|
return chain(inBlock("comment", "-->"));
|
||||||
} else if (stream.match("DOCTYPE", true, true)) {
|
} else if (stream.match("DOCTYPE", true, true)) {
|
||||||
stream.eatWhile(/[\w\._\-]/);
|
stream.eatWhile(/[\w\._\-]/);
|
||||||
return chain(doctype(1));
|
return chain(doctype(1));
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else if (stream.eat("?")) {
|
} else if (stream.eat("?")) {
|
||||||
stream.eatWhile(/[\w\._\-]/);
|
stream.eatWhile(/[\w\._\-]/);
|
||||||
state.tokenize = inBlock("meta", "?>");
|
state.tokenize = inBlock("meta", "?>");
|
||||||
return "meta";
|
return "meta";
|
||||||
} else {
|
} else {
|
||||||
type = stream.eat("/") ? "closeTag" : "openTag";
|
type = stream.eat("/") ? "closeTag" : "openTag";
|
||||||
state.tokenize = inTag;
|
state.tokenize = inTag;
|
||||||
return "tag bracket";
|
return "tag bracket";
|
||||||
}
|
}
|
||||||
} else if (ch == "&") {
|
} else if (ch == "&") {
|
||||||
var ok;
|
var ok;
|
||||||
if (stream.eat("#")) {
|
if (stream.eat("#")) {
|
||||||
if (stream.eat("x")) {
|
if (stream.eat("x")) {
|
||||||
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
||||||
} else {
|
} else {
|
||||||
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
||||||
}
|
}
|
||||||
return ok ? "atom" : "error";
|
return ok ? "atom" : "error";
|
||||||
} else {
|
} else {
|
||||||
stream.eatWhile(/[^&<]/);
|
stream.eatWhile(/[^&<]/);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function inTag(stream, state) {
|
function inTag(stream, state) {
|
||||||
var ch = stream.next();
|
var ch = stream.next();
|
||||||
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
||||||
state.tokenize = inText;
|
state.tokenize = inText;
|
||||||
type = ch == ">" ? "endTag" : "selfcloseTag";
|
type = ch == ">" ? "endTag" : "selfcloseTag";
|
||||||
return "tag bracket";
|
return "tag bracket";
|
||||||
} else if (ch == "=") {
|
} else if (ch == "=") {
|
||||||
type = "equals";
|
type = "equals";
|
||||||
return null;
|
return null;
|
||||||
} else if (ch == "<") {
|
} else if (ch == "<") {
|
||||||
state.tokenize = inText;
|
state.tokenize = inText;
|
||||||
state.state = baseState;
|
state.state = baseState;
|
||||||
state.tagName = state.tagStart = null;
|
state.tagName = state.tagStart = null;
|
||||||
var next = state.tokenize(stream, state);
|
var next = state.tokenize(stream, state);
|
||||||
return next ? next + " tag error" : "tag error";
|
return next ? next + " tag error" : "tag error";
|
||||||
} else if (/[\'\"]/.test(ch)) {
|
} else if (/[\'\"]/.test(ch)) {
|
||||||
state.tokenize = inAttribute(ch);
|
state.tokenize = inAttribute(ch);
|
||||||
state.stringStartCol = stream.column();
|
state.stringStartCol = stream.column();
|
||||||
return state.tokenize(stream, state);
|
return state.tokenize(stream, state);
|
||||||
} else {
|
} else {
|
||||||
stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
|
stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
|
||||||
return "word";
|
return "word";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function inAttribute(quote) {
|
function inAttribute(quote) {
|
||||||
var closure = function(stream, state) {
|
var closure = function(stream, state) {
|
||||||
while (!stream.eol()) {
|
while (!stream.eol()) {
|
||||||
if (stream.next() == quote) {
|
if (stream.next() == quote) {
|
||||||
state.tokenize = inTag;
|
state.tokenize = inTag;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "string";
|
return "string";
|
||||||
};
|
};
|
||||||
closure.isInAttribute = true;
|
closure.isInAttribute = true;
|
||||||
return closure;
|
return closure;
|
||||||
}
|
}
|
||||||
|
|
||||||
function inBlock(style, terminator) {
|
function inBlock(style, terminator) {
|
||||||
return function(stream, state) {
|
return function(stream, state) {
|
||||||
while (!stream.eol()) {
|
while (!stream.eol()) {
|
||||||
if (stream.match(terminator)) {
|
if (stream.match(terminator)) {
|
||||||
state.tokenize = inText;
|
state.tokenize = inText;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
stream.next();
|
stream.next();
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function doctype(depth) {
|
function doctype(depth) {
|
||||||
return function(stream, state) {
|
return function(stream, state) {
|
||||||
var ch;
|
var ch;
|
||||||
while ((ch = stream.next()) != null) {
|
while ((ch = stream.next()) != null) {
|
||||||
if (ch == "<") {
|
if (ch == "<") {
|
||||||
state.tokenize = doctype(depth + 1);
|
state.tokenize = doctype(depth + 1);
|
||||||
return state.tokenize(stream, state);
|
return state.tokenize(stream, state);
|
||||||
} else if (ch == ">") {
|
} else if (ch == ">") {
|
||||||
if (depth == 1) {
|
if (depth == 1) {
|
||||||
state.tokenize = inText;
|
state.tokenize = inText;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
state.tokenize = doctype(depth - 1);
|
state.tokenize = doctype(depth - 1);
|
||||||
return state.tokenize(stream, state);
|
return state.tokenize(stream, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "meta";
|
return "meta";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function Context(state, tagName, startOfLine) {
|
function Context(state, tagName, startOfLine) {
|
||||||
this.prev = state.context;
|
this.prev = state.context;
|
||||||
this.tagName = tagName;
|
this.tagName = tagName;
|
||||||
this.indent = state.indented;
|
this.indent = state.indented;
|
||||||
this.startOfLine = startOfLine;
|
this.startOfLine = startOfLine;
|
||||||
if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
||||||
this.noIndent = true;
|
this.noIndent = true;
|
||||||
}
|
}
|
||||||
function popContext(state) {
|
function popContext(state) {
|
||||||
if (state.context) state.context = state.context.prev;
|
if (state.context) state.context = state.context.prev;
|
||||||
}
|
}
|
||||||
function maybePopContext(state, nextTagName) {
|
function maybePopContext(state, nextTagName) {
|
||||||
var parentTagName;
|
var parentTagName;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (!state.context) {
|
if (!state.context) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
parentTagName = state.context.tagName;
|
parentTagName = state.context.tagName;
|
||||||
if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
|
if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
|
||||||
!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
popContext(state);
|
popContext(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function baseState(type, stream, state) {
|
function baseState(type, stream, state) {
|
||||||
if (type == "openTag") {
|
if (type == "openTag") {
|
||||||
state.tagStart = stream.column();
|
state.tagStart = stream.column();
|
||||||
return tagNameState;
|
return tagNameState;
|
||||||
} else if (type == "closeTag") {
|
} else if (type == "closeTag") {
|
||||||
return closeTagNameState;
|
return closeTagNameState;
|
||||||
} else {
|
} else {
|
||||||
return baseState;
|
return baseState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function tagNameState(type, stream, state) {
|
function tagNameState(type, stream, state) {
|
||||||
if (type == "word") {
|
if (type == "word") {
|
||||||
state.tagName = stream.current();
|
state.tagName = stream.current();
|
||||||
setStyle = "tag";
|
setStyle = "tag";
|
||||||
return attrState;
|
return attrState;
|
||||||
} else {
|
} else {
|
||||||
setStyle = "error";
|
setStyle = "error";
|
||||||
return tagNameState;
|
return tagNameState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function closeTagNameState(type, stream, state) {
|
function closeTagNameState(type, stream, state) {
|
||||||
if (type == "word") {
|
if (type == "word") {
|
||||||
var tagName = stream.current();
|
var tagName = stream.current();
|
||||||
if (state.context && state.context.tagName != tagName &&
|
if (state.context && state.context.tagName != tagName &&
|
||||||
Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
||||||
popContext(state);
|
popContext(state);
|
||||||
if (state.context && state.context.tagName == tagName) {
|
if (state.context && state.context.tagName == tagName) {
|
||||||
setStyle = "tag";
|
setStyle = "tag";
|
||||||
return closeState;
|
return closeState;
|
||||||
} else {
|
} else {
|
||||||
setStyle = "tag error";
|
setStyle = "tag error";
|
||||||
return closeStateErr;
|
return closeStateErr;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setStyle = "error";
|
setStyle = "error";
|
||||||
return closeStateErr;
|
return closeStateErr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeState(type, _stream, state) {
|
function closeState(type, _stream, state) {
|
||||||
if (type != "endTag") {
|
if (type != "endTag") {
|
||||||
setStyle = "error";
|
setStyle = "error";
|
||||||
return closeState;
|
return closeState;
|
||||||
}
|
}
|
||||||
popContext(state);
|
popContext(state);
|
||||||
return baseState;
|
return baseState;
|
||||||
}
|
}
|
||||||
function closeStateErr(type, stream, state) {
|
function closeStateErr(type, stream, state) {
|
||||||
setStyle = "error";
|
setStyle = "error";
|
||||||
return closeState(type, stream, state);
|
return closeState(type, stream, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
function attrState(type, _stream, state) {
|
function attrState(type, _stream, state) {
|
||||||
if (type == "word") {
|
if (type == "word") {
|
||||||
setStyle = "attribute";
|
setStyle = "attribute";
|
||||||
return attrEqState;
|
return attrEqState;
|
||||||
} else if (type == "endTag" || type == "selfcloseTag") {
|
} else if (type == "endTag" || type == "selfcloseTag") {
|
||||||
var tagName = state.tagName, tagStart = state.tagStart;
|
var tagName = state.tagName, tagStart = state.tagStart;
|
||||||
state.tagName = state.tagStart = null;
|
state.tagName = state.tagStart = null;
|
||||||
if (type == "selfcloseTag" ||
|
if (type == "selfcloseTag" ||
|
||||||
Kludges.autoSelfClosers.hasOwnProperty(tagName)) {
|
Kludges.autoSelfClosers.hasOwnProperty(tagName)) {
|
||||||
maybePopContext(state, tagName);
|
maybePopContext(state, tagName);
|
||||||
} else {
|
} else {
|
||||||
maybePopContext(state, tagName);
|
maybePopContext(state, tagName);
|
||||||
state.context = new Context(state, tagName, tagStart == state.indented);
|
state.context = new Context(state, tagName, tagStart == state.indented);
|
||||||
}
|
}
|
||||||
return baseState;
|
return baseState;
|
||||||
}
|
}
|
||||||
setStyle = "error";
|
setStyle = "error";
|
||||||
return attrState;
|
return attrState;
|
||||||
}
|
}
|
||||||
function attrEqState(type, stream, state) {
|
function attrEqState(type, stream, state) {
|
||||||
if (type == "equals") return attrValueState;
|
if (type == "equals") return attrValueState;
|
||||||
if (!Kludges.allowMissing) setStyle = "error";
|
if (!Kludges.allowMissing) setStyle = "error";
|
||||||
return attrState(type, stream, state);
|
return attrState(type, stream, state);
|
||||||
}
|
}
|
||||||
function attrValueState(type, stream, state) {
|
function attrValueState(type, stream, state) {
|
||||||
if (type == "string") return attrContinuedState;
|
if (type == "string") return attrContinuedState;
|
||||||
if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;}
|
if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;}
|
||||||
setStyle = "error";
|
setStyle = "error";
|
||||||
return attrState(type, stream, state);
|
return attrState(type, stream, state);
|
||||||
}
|
}
|
||||||
function attrContinuedState(type, stream, state) {
|
function attrContinuedState(type, stream, state) {
|
||||||
if (type == "string") return attrContinuedState;
|
if (type == "string") return attrContinuedState;
|
||||||
return attrState(type, stream, state);
|
return attrState(type, stream, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
startState: function() {
|
startState: function() {
|
||||||
return {tokenize: inText,
|
return {tokenize: inText,
|
||||||
state: baseState,
|
state: baseState,
|
||||||
indented: 0,
|
indented: 0,
|
||||||
tagName: null, tagStart: null,
|
tagName: null, tagStart: null,
|
||||||
context: null};
|
context: null};
|
||||||
},
|
},
|
||||||
|
|
||||||
token: function(stream, state) {
|
token: function(stream, state) {
|
||||||
if (!state.tagName && stream.sol())
|
if (!state.tagName && stream.sol())
|
||||||
state.indented = stream.indentation();
|
state.indented = stream.indentation();
|
||||||
|
|
||||||
if (stream.eatSpace()) return null;
|
if (stream.eatSpace()) return null;
|
||||||
type = null;
|
type = null;
|
||||||
var style = state.tokenize(stream, state);
|
var style = state.tokenize(stream, state);
|
||||||
if ((style || type) && style != "comment") {
|
if ((style || type) && style != "comment") {
|
||||||
setStyle = null;
|
setStyle = null;
|
||||||
state.state = state.state(type || style, stream, state);
|
state.state = state.state(type || style, stream, state);
|
||||||
if (setStyle)
|
if (setStyle)
|
||||||
style = setStyle == "error" ? style + " error" : setStyle;
|
style = setStyle == "error" ? style + " error" : setStyle;
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
},
|
},
|
||||||
|
|
||||||
indent: function(state, textAfter, fullLine) {
|
indent: function(state, textAfter, fullLine) {
|
||||||
var context = state.context;
|
var context = state.context;
|
||||||
// Indent multi-line strings (e.g. css).
|
// Indent multi-line strings (e.g. css).
|
||||||
if (state.tokenize.isInAttribute) {
|
if (state.tokenize.isInAttribute) {
|
||||||
if (state.tagStart == state.indented)
|
if (state.tagStart == state.indented)
|
||||||
return state.stringStartCol + 1;
|
return state.stringStartCol + 1;
|
||||||
else
|
else
|
||||||
return state.indented + indentUnit;
|
return state.indented + indentUnit;
|
||||||
}
|
}
|
||||||
if (context && context.noIndent) return CodeMirror.Pass;
|
if (context && context.noIndent) return CodeMirror.Pass;
|
||||||
if (state.tokenize != inTag && state.tokenize != inText)
|
if (state.tokenize != inTag && state.tokenize != inText)
|
||||||
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
||||||
// Indent the starts of attribute names.
|
// Indent the starts of attribute names.
|
||||||
if (state.tagName) {
|
if (state.tagName) {
|
||||||
if (multilineTagIndentPastTag)
|
if (multilineTagIndentPastTag)
|
||||||
return state.tagStart + state.tagName.length + 2;
|
return state.tagStart + state.tagName.length + 2;
|
||||||
else
|
else
|
||||||
return state.tagStart + indentUnit * multilineTagIndentFactor;
|
return state.tagStart + indentUnit * multilineTagIndentFactor;
|
||||||
}
|
}
|
||||||
if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
||||||
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
|
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
|
||||||
if (tagAfter && tagAfter[1]) { // Closing tag spotted
|
if (tagAfter && tagAfter[1]) { // Closing tag spotted
|
||||||
while (context) {
|
while (context) {
|
||||||
if (context.tagName == tagAfter[2]) {
|
if (context.tagName == tagAfter[2]) {
|
||||||
context = context.prev;
|
context = context.prev;
|
||||||
break;
|
break;
|
||||||
} else if (Kludges.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
} else if (Kludges.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
||||||
context = context.prev;
|
context = context.prev;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (tagAfter) { // Opening tag spotted
|
} else if (tagAfter) { // Opening tag spotted
|
||||||
while (context) {
|
while (context) {
|
||||||
var grabbers = Kludges.contextGrabbers[context.tagName];
|
var grabbers = Kludges.contextGrabbers[context.tagName];
|
||||||
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
|
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
|
||||||
context = context.prev;
|
context = context.prev;
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (context && !context.startOfLine)
|
while (context && !context.startOfLine)
|
||||||
context = context.prev;
|
context = context.prev;
|
||||||
if (context) return context.indent + indentUnit;
|
if (context) return context.indent + indentUnit;
|
||||||
else return 0;
|
else return 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
electricInput: /<\/[\s\w:]+>$/,
|
electricInput: /<\/[\s\w:]+>$/,
|
||||||
blockCommentStart: "<!--",
|
blockCommentStart: "<!--",
|
||||||
blockCommentEnd: "-->",
|
blockCommentEnd: "-->",
|
||||||
|
|
||||||
configuration: parserConfig.htmlMode ? "html" : "xml",
|
configuration: parserConfig.htmlMode ? "html" : "xml",
|
||||||
helperType: parserConfig.htmlMode ? "html" : "xml"
|
helperType: parserConfig.htmlMode ? "html" : "xml"
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
CodeMirror.defineMIME("text/xml", "xml");
|
CodeMirror.defineMIME("text/xml", "xml");
|
||||||
CodeMirror.defineMIME("application/xml", "xml");
|
CodeMirror.defineMIME("application/xml", "xml");
|
||||||
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
||||||
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
Before Width: | Height: | Size: 281 KiB After Width: | Height: | Size: 280 KiB |
File diff suppressed because one or more lines are too long
+12
-12
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,97 +1,97 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('advlist', function(editor) {
|
tinymce.PluginManager.add('advlist', function(editor) {
|
||||||
var olMenuItems, ulMenuItems, lastStyles = {};
|
var olMenuItems, ulMenuItems, lastStyles = {};
|
||||||
|
|
||||||
function buildMenuItems(listName, styleValues) {
|
function buildMenuItems(listName, styleValues) {
|
||||||
var items = [];
|
var items = [];
|
||||||
|
|
||||||
tinymce.each(styleValues.split(/[ ,]/), function(styleValue) {
|
tinymce.each(styleValues.split(/[ ,]/), function(styleValue) {
|
||||||
items.push({
|
items.push({
|
||||||
text: styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function(chr) {
|
text: styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function(chr) {
|
||||||
return chr.toUpperCase();
|
return chr.toUpperCase();
|
||||||
}),
|
}),
|
||||||
data: styleValue == 'default' ? '' : styleValue
|
data: styleValue == 'default' ? '' : styleValue
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
olMenuItems = buildMenuItems('OL', editor.getParam(
|
olMenuItems = buildMenuItems('OL', editor.getParam(
|
||||||
"advlist_number_styles",
|
"advlist_number_styles",
|
||||||
"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"
|
"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"
|
||||||
));
|
));
|
||||||
|
|
||||||
ulMenuItems = buildMenuItems('UL', editor.getParam("advlist_bullet_styles", "default,circle,disc,square"));
|
ulMenuItems = buildMenuItems('UL', editor.getParam("advlist_bullet_styles", "default,circle,disc,square"));
|
||||||
|
|
||||||
function applyListFormat(listName, styleValue) {
|
function applyListFormat(listName, styleValue) {
|
||||||
editor.undoManager.transact(function() {
|
editor.undoManager.transact(function() {
|
||||||
var list, dom = editor.dom, sel = editor.selection;
|
var list, dom = editor.dom, sel = editor.selection;
|
||||||
|
|
||||||
// Check for existing list element
|
// Check for existing list element
|
||||||
list = dom.getParent(sel.getNode(), 'ol,ul');
|
list = dom.getParent(sel.getNode(), 'ol,ul');
|
||||||
|
|
||||||
// Switch/add list type if needed
|
// Switch/add list type if needed
|
||||||
if (!list || list.nodeName != listName || styleValue === false) {
|
if (!list || list.nodeName != listName || styleValue === false) {
|
||||||
editor.execCommand(listName == 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList');
|
editor.execCommand(listName == 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set style
|
// Set style
|
||||||
styleValue = styleValue === false ? lastStyles[listName] : styleValue;
|
styleValue = styleValue === false ? lastStyles[listName] : styleValue;
|
||||||
lastStyles[listName] = styleValue;
|
lastStyles[listName] = styleValue;
|
||||||
|
|
||||||
list = dom.getParent(sel.getNode(), 'ol,ul');
|
list = dom.getParent(sel.getNode(), 'ol,ul');
|
||||||
if (list) {
|
if (list) {
|
||||||
dom.setStyle(list, 'listStyleType', styleValue ? styleValue : null);
|
dom.setStyle(list, 'listStyleType', styleValue ? styleValue : null);
|
||||||
list.removeAttribute('data-mce-style');
|
list.removeAttribute('data-mce-style');
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.focus();
|
editor.focus();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSelection(e) {
|
function updateSelection(e) {
|
||||||
var listStyleType = editor.dom.getStyle(editor.dom.getParent(editor.selection.getNode(), 'ol,ul'), 'listStyleType') || '';
|
var listStyleType = editor.dom.getStyle(editor.dom.getParent(editor.selection.getNode(), 'ol,ul'), 'listStyleType') || '';
|
||||||
|
|
||||||
e.control.items().each(function(ctrl) {
|
e.control.items().each(function(ctrl) {
|
||||||
ctrl.active(ctrl.settings.data === listStyleType);
|
ctrl.active(ctrl.settings.data === listStyleType);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.addButton('numlist', {
|
editor.addButton('numlist', {
|
||||||
type: 'splitbutton',
|
type: 'splitbutton',
|
||||||
tooltip: 'Numbered list',
|
tooltip: 'Numbered list',
|
||||||
menu: olMenuItems,
|
menu: olMenuItems,
|
||||||
onshow: updateSelection,
|
onshow: updateSelection,
|
||||||
onselect: function(e) {
|
onselect: function(e) {
|
||||||
applyListFormat('OL', e.control.settings.data);
|
applyListFormat('OL', e.control.settings.data);
|
||||||
},
|
},
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
applyListFormat('OL', false);
|
applyListFormat('OL', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addButton('bullist', {
|
editor.addButton('bullist', {
|
||||||
type: 'splitbutton',
|
type: 'splitbutton',
|
||||||
tooltip: 'Bullet list',
|
tooltip: 'Bullet list',
|
||||||
menu: ulMenuItems,
|
menu: ulMenuItems,
|
||||||
onshow: updateSelection,
|
onshow: updateSelection,
|
||||||
onselect: function(e) {
|
onselect: function(e) {
|
||||||
applyListFormat('UL', e.control.settings.data);
|
applyListFormat('UL', e.control.settings.data);
|
||||||
},
|
},
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
applyListFormat('UL', false);
|
applyListFormat('UL', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,45 +1,45 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('anchor', function(editor) {
|
tinymce.PluginManager.add('anchor', function(editor) {
|
||||||
function showDialog() {
|
function showDialog() {
|
||||||
var selectedNode = editor.selection.getNode(), name = '';
|
var selectedNode = editor.selection.getNode(), name = '';
|
||||||
|
|
||||||
if (selectedNode.tagName == 'A') {
|
if (selectedNode.tagName == 'A') {
|
||||||
name = selectedNode.name || selectedNode.id || '';
|
name = selectedNode.name || selectedNode.id || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.windowManager.open({
|
editor.windowManager.open({
|
||||||
title: 'Anchor',
|
title: 'Anchor',
|
||||||
body: {type: 'textbox', name: 'name', size: 40, label: 'Name', value: name},
|
body: {type: 'textbox', name: 'name', size: 40, label: 'Name', value: name},
|
||||||
onsubmit: function(e) {
|
onsubmit: function(e) {
|
||||||
editor.execCommand('mceInsertContent', false, editor.dom.createHTML('a', {
|
editor.execCommand('mceInsertContent', false, editor.dom.createHTML('a', {
|
||||||
id: e.data.name
|
id: e.data.name
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.addButton('anchor', {
|
editor.addButton('anchor', {
|
||||||
icon: 'anchor',
|
icon: 'anchor',
|
||||||
tooltip: 'Anchor',
|
tooltip: 'Anchor',
|
||||||
onclick: showDialog,
|
onclick: showDialog,
|
||||||
stateSelector: 'a:not([href])'
|
stateSelector: 'a:not([href])'
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addMenuItem('anchor', {
|
editor.addMenuItem('anchor', {
|
||||||
icon: 'anchor',
|
icon: 'anchor',
|
||||||
text: 'Anchor',
|
text: 'Anchor',
|
||||||
context: 'insert',
|
context: 'insert',
|
||||||
onclick: showDialog
|
onclick: showDialog
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,194 +1,194 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright 2011, Moxiecode Systems AB
|
* Copyright 2011, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('autolink', function(editor) {
|
tinymce.PluginManager.add('autolink', function(editor) {
|
||||||
var AutoUrlDetectState;
|
var AutoUrlDetectState;
|
||||||
|
|
||||||
editor.on("keydown", function(e) {
|
editor.on("keydown", function(e) {
|
||||||
if (e.keyCode == 13) {
|
if (e.keyCode == 13) {
|
||||||
return handleEnter(editor);
|
return handleEnter(editor);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Internet Explorer has built-in automatic linking for most cases
|
// Internet Explorer has built-in automatic linking for most cases
|
||||||
if (tinymce.Env.ie) {
|
if (tinymce.Env.ie) {
|
||||||
editor.on("focus", function() {
|
editor.on("focus", function() {
|
||||||
if (!AutoUrlDetectState) {
|
if (!AutoUrlDetectState) {
|
||||||
AutoUrlDetectState = true;
|
AutoUrlDetectState = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
editor.execCommand('AutoUrlDetect', false, true);
|
editor.execCommand('AutoUrlDetect', false, true);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// Ignore
|
// Ignore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.on("keypress", function(e) {
|
editor.on("keypress", function(e) {
|
||||||
if (e.keyCode == 41) {
|
if (e.keyCode == 41) {
|
||||||
return handleEclipse(editor);
|
return handleEclipse(editor);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.on("keyup", function(e) {
|
editor.on("keyup", function(e) {
|
||||||
if (e.keyCode == 32) {
|
if (e.keyCode == 32) {
|
||||||
return handleSpacebar(editor);
|
return handleSpacebar(editor);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleEclipse(editor) {
|
function handleEclipse(editor) {
|
||||||
parseCurrentLine(editor, -1, '(', true);
|
parseCurrentLine(editor, -1, '(', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSpacebar(editor) {
|
function handleSpacebar(editor) {
|
||||||
parseCurrentLine(editor, 0, '', true);
|
parseCurrentLine(editor, 0, '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleEnter(editor) {
|
function handleEnter(editor) {
|
||||||
parseCurrentLine(editor, -1, '', false);
|
parseCurrentLine(editor, -1, '', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseCurrentLine(editor, end_offset, delimiter) {
|
function parseCurrentLine(editor, end_offset, delimiter) {
|
||||||
var rng, end, start, endContainer, bookmark, text, matches, prev, len, rngText;
|
var rng, end, start, endContainer, bookmark, text, matches, prev, len, rngText;
|
||||||
|
|
||||||
function scopeIndex(container, index) {
|
function scopeIndex(container, index) {
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
index = 0;
|
index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (container.nodeType == 3) {
|
if (container.nodeType == 3) {
|
||||||
var len = container.data.length;
|
var len = container.data.length;
|
||||||
|
|
||||||
if (index > len) {
|
if (index > len) {
|
||||||
index = len;
|
index = len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setStart(container, offset) {
|
function setStart(container, offset) {
|
||||||
if (container.nodeType != 1 || container.hasChildNodes()) {
|
if (container.nodeType != 1 || container.hasChildNodes()) {
|
||||||
rng.setStart(container, scopeIndex(container, offset));
|
rng.setStart(container, scopeIndex(container, offset));
|
||||||
} else {
|
} else {
|
||||||
rng.setStartBefore(container);
|
rng.setStartBefore(container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setEnd(container, offset) {
|
function setEnd(container, offset) {
|
||||||
if (container.nodeType != 1 || container.hasChildNodes()) {
|
if (container.nodeType != 1 || container.hasChildNodes()) {
|
||||||
rng.setEnd(container, scopeIndex(container, offset));
|
rng.setEnd(container, scopeIndex(container, offset));
|
||||||
} else {
|
} else {
|
||||||
rng.setEndAfter(container);
|
rng.setEndAfter(container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need at least five characters to form a URL,
|
// We need at least five characters to form a URL,
|
||||||
// hence, at minimum, five characters from the beginning of the line.
|
// hence, at minimum, five characters from the beginning of the line.
|
||||||
rng = editor.selection.getRng(true).cloneRange();
|
rng = editor.selection.getRng(true).cloneRange();
|
||||||
if (rng.startOffset < 5) {
|
if (rng.startOffset < 5) {
|
||||||
// During testing, the caret is placed inbetween two text nodes.
|
// During testing, the caret is placed inbetween two text nodes.
|
||||||
// The previous text node contains the URL.
|
// The previous text node contains the URL.
|
||||||
prev = rng.endContainer.previousSibling;
|
prev = rng.endContainer.previousSibling;
|
||||||
if (!prev) {
|
if (!prev) {
|
||||||
if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) {
|
if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = rng.endContainer.firstChild.nextSibling;
|
prev = rng.endContainer.firstChild.nextSibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = prev.length;
|
len = prev.length;
|
||||||
setStart(prev, len);
|
setStart(prev, len);
|
||||||
setEnd(prev, len);
|
setEnd(prev, len);
|
||||||
|
|
||||||
if (rng.endOffset < 5) {
|
if (rng.endOffset < 5) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
end = rng.endOffset;
|
end = rng.endOffset;
|
||||||
endContainer = prev;
|
endContainer = prev;
|
||||||
} else {
|
} else {
|
||||||
endContainer = rng.endContainer;
|
endContainer = rng.endContainer;
|
||||||
|
|
||||||
// Get a text node
|
// Get a text node
|
||||||
if (endContainer.nodeType != 3 && endContainer.firstChild) {
|
if (endContainer.nodeType != 3 && endContainer.firstChild) {
|
||||||
while (endContainer.nodeType != 3 && endContainer.firstChild) {
|
while (endContainer.nodeType != 3 && endContainer.firstChild) {
|
||||||
endContainer = endContainer.firstChild;
|
endContainer = endContainer.firstChild;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move range to text node
|
// Move range to text node
|
||||||
if (endContainer.nodeType == 3) {
|
if (endContainer.nodeType == 3) {
|
||||||
setStart(endContainer, 0);
|
setStart(endContainer, 0);
|
||||||
setEnd(endContainer, endContainer.nodeValue.length);
|
setEnd(endContainer, endContainer.nodeValue.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rng.endOffset == 1) {
|
if (rng.endOffset == 1) {
|
||||||
end = 2;
|
end = 2;
|
||||||
} else {
|
} else {
|
||||||
end = rng.endOffset - 1 - end_offset;
|
end = rng.endOffset - 1 - end_offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
start = end;
|
start = end;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
// Move the selection one character backwards.
|
// Move the selection one character backwards.
|
||||||
setStart(endContainer, end >= 2 ? end - 2 : 0);
|
setStart(endContainer, end >= 2 ? end - 2 : 0);
|
||||||
setEnd(endContainer, end >= 1 ? end - 1 : 0);
|
setEnd(endContainer, end >= 1 ? end - 1 : 0);
|
||||||
end -= 1;
|
end -= 1;
|
||||||
rngText = rng.toString();
|
rngText = rng.toString();
|
||||||
|
|
||||||
// Loop until one of the following is found: a blank space, , delimiter, (end-2) >= 0
|
// Loop until one of the following is found: a blank space, , delimiter, (end-2) >= 0
|
||||||
} while (rngText != ' ' && rngText !== '' && rngText.charCodeAt(0) != 160 && (end - 2) >= 0 && rngText != delimiter);
|
} while (rngText != ' ' && rngText !== '' && rngText.charCodeAt(0) != 160 && (end - 2) >= 0 && rngText != delimiter);
|
||||||
|
|
||||||
if (rng.toString() == delimiter || rng.toString().charCodeAt(0) == 160) {
|
if (rng.toString() == delimiter || rng.toString().charCodeAt(0) == 160) {
|
||||||
setStart(endContainer, end);
|
setStart(endContainer, end);
|
||||||
setEnd(endContainer, start);
|
setEnd(endContainer, start);
|
||||||
end += 1;
|
end += 1;
|
||||||
} else if (rng.startOffset === 0) {
|
} else if (rng.startOffset === 0) {
|
||||||
setStart(endContainer, 0);
|
setStart(endContainer, 0);
|
||||||
setEnd(endContainer, start);
|
setEnd(endContainer, start);
|
||||||
} else {
|
} else {
|
||||||
setStart(endContainer, end);
|
setStart(endContainer, end);
|
||||||
setEnd(endContainer, start);
|
setEnd(endContainer, start);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exclude last . from word like "www.site.com."
|
// Exclude last . from word like "www.site.com."
|
||||||
text = rng.toString();
|
text = rng.toString();
|
||||||
if (text.charAt(text.length - 1) == '.') {
|
if (text.charAt(text.length - 1) == '.') {
|
||||||
setEnd(endContainer, start - 1);
|
setEnd(endContainer, start - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
text = rng.toString();
|
text = rng.toString();
|
||||||
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i);
|
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i);
|
||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
if (matches[1] == 'www.') {
|
if (matches[1] == 'www.') {
|
||||||
matches[1] = 'http://www.';
|
matches[1] = 'http://www.';
|
||||||
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
|
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
|
||||||
matches[1] = 'mailto:' + matches[1];
|
matches[1] = 'mailto:' + matches[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
bookmark = editor.selection.getBookmark();
|
bookmark = editor.selection.getBookmark();
|
||||||
|
|
||||||
editor.selection.setRng(rng);
|
editor.selection.setRng(rng);
|
||||||
editor.execCommand('createlink', false, matches[1] + matches[2]);
|
editor.execCommand('createlink', false, matches[1] + matches[2]);
|
||||||
editor.selection.moveToBookmark(bookmark);
|
editor.selection.moveToBookmark(bookmark);
|
||||||
editor.nodeChanged();
|
editor.nodeChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,162 +1,162 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
/*eslint no-nested-ternary:0 */
|
/*eslint no-nested-ternary:0 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auto Resize
|
* Auto Resize
|
||||||
*
|
*
|
||||||
* This plugin automatically resizes the content area to fit its content height.
|
* This plugin automatically resizes the content area to fit its content height.
|
||||||
* It will retain a minimum height, which is the height of the content area when
|
* It will retain a minimum height, which is the height of the content area when
|
||||||
* it's initialized.
|
* it's initialized.
|
||||||
*/
|
*/
|
||||||
tinymce.PluginManager.add('autoresize', function(editor) {
|
tinymce.PluginManager.add('autoresize', function(editor) {
|
||||||
var settings = editor.settings, oldSize = 0;
|
var settings = editor.settings, oldSize = 0;
|
||||||
|
|
||||||
function isFullscreen() {
|
function isFullscreen() {
|
||||||
return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
|
return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editor.settings.inline) {
|
if (editor.settings.inline) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method gets executed each time the editor needs to resize.
|
* This method gets executed each time the editor needs to resize.
|
||||||
*/
|
*/
|
||||||
function resize(e) {
|
function resize(e) {
|
||||||
var deltaSize, doc, body, docElm, DOM = tinymce.DOM, resizeHeight, myHeight,
|
var deltaSize, doc, body, docElm, DOM = tinymce.DOM, resizeHeight, myHeight,
|
||||||
marginTop, marginBottom, paddingTop, paddingBottom, borderTop, borderBottom;
|
marginTop, marginBottom, paddingTop, paddingBottom, borderTop, borderBottom;
|
||||||
|
|
||||||
doc = editor.getDoc();
|
doc = editor.getDoc();
|
||||||
if (!doc) {
|
if (!doc) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
body = doc.body;
|
body = doc.body;
|
||||||
docElm = doc.documentElement;
|
docElm = doc.documentElement;
|
||||||
resizeHeight = settings.autoresize_min_height;
|
resizeHeight = settings.autoresize_min_height;
|
||||||
|
|
||||||
if (!body || (e && e.type === "setcontent" && e.initial) || isFullscreen()) {
|
if (!body || (e && e.type === "setcontent" && e.initial) || isFullscreen()) {
|
||||||
if (body && docElm) {
|
if (body && docElm) {
|
||||||
body.style.overflowY = "auto";
|
body.style.overflowY = "auto";
|
||||||
docElm.style.overflowY = "auto"; // Old IE
|
docElm.style.overflowY = "auto"; // Old IE
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate outer height of the body element using CSS styles
|
// Calculate outer height of the body element using CSS styles
|
||||||
marginTop = editor.dom.getStyle(body, 'margin-top', true);
|
marginTop = editor.dom.getStyle(body, 'margin-top', true);
|
||||||
marginBottom = editor.dom.getStyle(body, 'margin-bottom', true);
|
marginBottom = editor.dom.getStyle(body, 'margin-bottom', true);
|
||||||
paddingTop = editor.dom.getStyle(body, 'padding-top', true);
|
paddingTop = editor.dom.getStyle(body, 'padding-top', true);
|
||||||
paddingBottom = editor.dom.getStyle(body, 'padding-bottom', true);
|
paddingBottom = editor.dom.getStyle(body, 'padding-bottom', true);
|
||||||
borderTop = editor.dom.getStyle(body, 'border-top-width', true);
|
borderTop = editor.dom.getStyle(body, 'border-top-width', true);
|
||||||
borderBottom = editor.dom.getStyle(body, 'border-bottom-width', true);
|
borderBottom = editor.dom.getStyle(body, 'border-bottom-width', true);
|
||||||
myHeight = body.offsetHeight + parseInt(marginTop, 10) + parseInt(marginBottom, 10) +
|
myHeight = body.offsetHeight + parseInt(marginTop, 10) + parseInt(marginBottom, 10) +
|
||||||
parseInt(paddingTop, 10) + parseInt(paddingBottom, 10) +
|
parseInt(paddingTop, 10) + parseInt(paddingBottom, 10) +
|
||||||
parseInt(borderTop, 10) + parseInt(borderBottom, 10);
|
parseInt(borderTop, 10) + parseInt(borderBottom, 10);
|
||||||
|
|
||||||
// Make sure we have a valid height
|
// Make sure we have a valid height
|
||||||
if (isNaN(myHeight) || myHeight <= 0) {
|
if (isNaN(myHeight) || myHeight <= 0) {
|
||||||
// Get height differently depending on the browser used
|
// Get height differently depending on the browser used
|
||||||
myHeight = tinymce.Env.ie ? body.scrollHeight : (tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight);
|
myHeight = tinymce.Env.ie ? body.scrollHeight : (tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't make it smaller than the minimum height
|
// Don't make it smaller than the minimum height
|
||||||
if (myHeight > settings.autoresize_min_height) {
|
if (myHeight > settings.autoresize_min_height) {
|
||||||
resizeHeight = myHeight;
|
resizeHeight = myHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a maximum height has been defined don't exceed this height
|
// If a maximum height has been defined don't exceed this height
|
||||||
if (settings.autoresize_max_height && myHeight > settings.autoresize_max_height) {
|
if (settings.autoresize_max_height && myHeight > settings.autoresize_max_height) {
|
||||||
resizeHeight = settings.autoresize_max_height;
|
resizeHeight = settings.autoresize_max_height;
|
||||||
body.style.overflowY = "auto";
|
body.style.overflowY = "auto";
|
||||||
docElm.style.overflowY = "auto"; // Old IE
|
docElm.style.overflowY = "auto"; // Old IE
|
||||||
} else {
|
} else {
|
||||||
body.style.overflowY = "hidden";
|
body.style.overflowY = "hidden";
|
||||||
docElm.style.overflowY = "hidden"; // Old IE
|
docElm.style.overflowY = "hidden"; // Old IE
|
||||||
body.scrollTop = 0;
|
body.scrollTop = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize content element
|
// Resize content element
|
||||||
if (resizeHeight !== oldSize) {
|
if (resizeHeight !== oldSize) {
|
||||||
deltaSize = resizeHeight - oldSize;
|
deltaSize = resizeHeight - oldSize;
|
||||||
DOM.setStyle(editor.iframeElement, 'height', resizeHeight + 'px');
|
DOM.setStyle(editor.iframeElement, 'height', resizeHeight + 'px');
|
||||||
oldSize = resizeHeight;
|
oldSize = resizeHeight;
|
||||||
|
|
||||||
// WebKit doesn't decrease the size of the body element until the iframe gets resized
|
// WebKit doesn't decrease the size of the body element until the iframe gets resized
|
||||||
// So we need to continue to resize the iframe down until the size gets fixed
|
// So we need to continue to resize the iframe down until the size gets fixed
|
||||||
if (tinymce.isWebKit && deltaSize < 0) {
|
if (tinymce.isWebKit && deltaSize < 0) {
|
||||||
resize(e);
|
resize(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls the resize x times in 100ms intervals. We can't wait for load events since
|
* Calls the resize x times in 100ms intervals. We can't wait for load events since
|
||||||
* the CSS files might load async.
|
* the CSS files might load async.
|
||||||
*/
|
*/
|
||||||
function wait(times, interval, callback) {
|
function wait(times, interval, callback) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
resize({});
|
resize({});
|
||||||
|
|
||||||
if (times--) {
|
if (times--) {
|
||||||
wait(times, interval, callback);
|
wait(times, interval, callback);
|
||||||
} else if (callback) {
|
} else if (callback) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
}, interval);
|
}, interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define minimum height
|
// Define minimum height
|
||||||
settings.autoresize_min_height = parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10);
|
settings.autoresize_min_height = parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10);
|
||||||
|
|
||||||
// Define maximum height
|
// Define maximum height
|
||||||
settings.autoresize_max_height = parseInt(editor.getParam('autoresize_max_height', 0), 10);
|
settings.autoresize_max_height = parseInt(editor.getParam('autoresize_max_height', 0), 10);
|
||||||
|
|
||||||
// Add padding at the bottom for better UX
|
// Add padding at the bottom for better UX
|
||||||
editor.on("init", function() {
|
editor.on("init", function() {
|
||||||
var overflowPadding, bottomMargin;
|
var overflowPadding, bottomMargin;
|
||||||
|
|
||||||
overflowPadding = editor.getParam('autoresize_overflow_padding', 1);
|
overflowPadding = editor.getParam('autoresize_overflow_padding', 1);
|
||||||
bottomMargin = editor.getParam('autoresize_bottom_margin', 50);
|
bottomMargin = editor.getParam('autoresize_bottom_margin', 50);
|
||||||
|
|
||||||
if (overflowPadding !== false) {
|
if (overflowPadding !== false) {
|
||||||
editor.dom.setStyles(editor.getBody(), {
|
editor.dom.setStyles(editor.getBody(), {
|
||||||
paddingLeft: overflowPadding,
|
paddingLeft: overflowPadding,
|
||||||
paddingRight: overflowPadding
|
paddingRight: overflowPadding
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bottomMargin !== false) {
|
if (bottomMargin !== false) {
|
||||||
editor.dom.setStyles(editor.getBody(), {
|
editor.dom.setStyles(editor.getBody(), {
|
||||||
paddingBottom: bottomMargin
|
paddingBottom: bottomMargin
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add appropriate listeners for resizing content area
|
// Add appropriate listeners for resizing content area
|
||||||
editor.on("nodechange setcontent keyup FullscreenStateChanged", resize);
|
editor.on("nodechange setcontent keyup FullscreenStateChanged", resize);
|
||||||
|
|
||||||
if (editor.getParam('autoresize_on_init', true)) {
|
if (editor.getParam('autoresize_on_init', true)) {
|
||||||
editor.on('init', function() {
|
editor.on('init', function() {
|
||||||
// Hit it 20 times in 100 ms intervals
|
// Hit it 20 times in 100 ms intervals
|
||||||
wait(20, 100, function() {
|
wait(20, 100, function() {
|
||||||
// Hit it 5 times in 1 sec intervals
|
// Hit it 5 times in 1 sec intervals
|
||||||
wait(5, 1000);
|
wait(5, 1000);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
||||||
editor.addCommand('mceAutoResize', resize);
|
editor.addCommand('mceAutoResize', resize);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,165 +1,165 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
// Internal unload handler will be called before the page is unloaded
|
// Internal unload handler will be called before the page is unloaded
|
||||||
// Needs to be outside the plugin since it would otherwise keep
|
// Needs to be outside the plugin since it would otherwise keep
|
||||||
// a reference to editor in closue scope
|
// a reference to editor in closue scope
|
||||||
/*eslint no-func-assign:0 */
|
/*eslint no-func-assign:0 */
|
||||||
tinymce._beforeUnloadHandler = function() {
|
tinymce._beforeUnloadHandler = function() {
|
||||||
var msg;
|
var msg;
|
||||||
|
|
||||||
tinymce.each(tinymce.editors, function(editor) {
|
tinymce.each(tinymce.editors, function(editor) {
|
||||||
// Store a draft for each editor instance
|
// Store a draft for each editor instance
|
||||||
if (editor.plugins.autosave) {
|
if (editor.plugins.autosave) {
|
||||||
editor.plugins.autosave.storeDraft();
|
editor.plugins.autosave.storeDraft();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup a return message if the editor is dirty
|
// Setup a return message if the editor is dirty
|
||||||
if (!msg && editor.isDirty() && editor.getParam("autosave_ask_before_unload", true)) {
|
if (!msg && editor.isDirty() && editor.getParam("autosave_ask_before_unload", true)) {
|
||||||
msg = editor.translate("You have unsaved changes are you sure you want to navigate away?");
|
msg = editor.translate("You have unsaved changes are you sure you want to navigate away?");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
};
|
};
|
||||||
|
|
||||||
tinymce.PluginManager.add('autosave', function(editor) {
|
tinymce.PluginManager.add('autosave', function(editor) {
|
||||||
var settings = editor.settings, LocalStorage = tinymce.util.LocalStorage, prefix, started;
|
var settings = editor.settings, LocalStorage = tinymce.util.LocalStorage, prefix, started;
|
||||||
|
|
||||||
prefix = settings.autosave_prefix || 'tinymce-autosave-{path}{query}-{id}-';
|
prefix = settings.autosave_prefix || 'tinymce-autosave-{path}{query}-{id}-';
|
||||||
prefix = prefix.replace(/\{path\}/g, document.location.pathname);
|
prefix = prefix.replace(/\{path\}/g, document.location.pathname);
|
||||||
prefix = prefix.replace(/\{query\}/g, document.location.search);
|
prefix = prefix.replace(/\{query\}/g, document.location.search);
|
||||||
prefix = prefix.replace(/\{id\}/g, editor.id);
|
prefix = prefix.replace(/\{id\}/g, editor.id);
|
||||||
|
|
||||||
function parseTime(time, defaultTime) {
|
function parseTime(time, defaultTime) {
|
||||||
var multipels = {
|
var multipels = {
|
||||||
s: 1000,
|
s: 1000,
|
||||||
m: 60000
|
m: 60000
|
||||||
};
|
};
|
||||||
|
|
||||||
time = /^(\d+)([ms]?)$/.exec('' + (time || defaultTime));
|
time = /^(\d+)([ms]?)$/.exec('' + (time || defaultTime));
|
||||||
|
|
||||||
return (time[2] ? multipels[time[2]] : 1) * parseInt(time, 10);
|
return (time[2] ? multipels[time[2]] : 1) * parseInt(time, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hasDraft() {
|
function hasDraft() {
|
||||||
var time = parseInt(LocalStorage.getItem(prefix + "time"), 10) || 0;
|
var time = parseInt(LocalStorage.getItem(prefix + "time"), 10) || 0;
|
||||||
|
|
||||||
if (new Date().getTime() - time > settings.autosave_retention) {
|
if (new Date().getTime() - time > settings.autosave_retention) {
|
||||||
removeDraft(false);
|
removeDraft(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeDraft(fire) {
|
function removeDraft(fire) {
|
||||||
LocalStorage.removeItem(prefix + "draft");
|
LocalStorage.removeItem(prefix + "draft");
|
||||||
LocalStorage.removeItem(prefix + "time");
|
LocalStorage.removeItem(prefix + "time");
|
||||||
|
|
||||||
if (fire !== false) {
|
if (fire !== false) {
|
||||||
editor.fire('RemoveDraft');
|
editor.fire('RemoveDraft');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function storeDraft() {
|
function storeDraft() {
|
||||||
if (!isEmpty() && editor.isDirty()) {
|
if (!isEmpty() && editor.isDirty()) {
|
||||||
LocalStorage.setItem(prefix + "draft", editor.getContent({format: 'raw', no_events: true}));
|
LocalStorage.setItem(prefix + "draft", editor.getContent({format: 'raw', no_events: true}));
|
||||||
LocalStorage.setItem(prefix + "time", new Date().getTime());
|
LocalStorage.setItem(prefix + "time", new Date().getTime());
|
||||||
editor.fire('StoreDraft');
|
editor.fire('StoreDraft');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreDraft() {
|
function restoreDraft() {
|
||||||
if (hasDraft()) {
|
if (hasDraft()) {
|
||||||
editor.setContent(LocalStorage.getItem(prefix + "draft"), {format: 'raw'});
|
editor.setContent(LocalStorage.getItem(prefix + "draft"), {format: 'raw'});
|
||||||
editor.fire('RestoreDraft');
|
editor.fire('RestoreDraft');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function startStoreDraft() {
|
function startStoreDraft() {
|
||||||
if (!started) {
|
if (!started) {
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
if (!editor.removed) {
|
if (!editor.removed) {
|
||||||
storeDraft();
|
storeDraft();
|
||||||
}
|
}
|
||||||
}, settings.autosave_interval);
|
}, settings.autosave_interval);
|
||||||
|
|
||||||
started = true;
|
started = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.autosave_interval = parseTime(settings.autosave_interval, '30s');
|
settings.autosave_interval = parseTime(settings.autosave_interval, '30s');
|
||||||
settings.autosave_retention = parseTime(settings.autosave_retention, '20m');
|
settings.autosave_retention = parseTime(settings.autosave_retention, '20m');
|
||||||
|
|
||||||
function postRender() {
|
function postRender() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self.disabled(!hasDraft());
|
self.disabled(!hasDraft());
|
||||||
|
|
||||||
editor.on('StoreDraft RestoreDraft RemoveDraft', function() {
|
editor.on('StoreDraft RestoreDraft RemoveDraft', function() {
|
||||||
self.disabled(!hasDraft());
|
self.disabled(!hasDraft());
|
||||||
});
|
});
|
||||||
|
|
||||||
startStoreDraft();
|
startStoreDraft();
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreLastDraft() {
|
function restoreLastDraft() {
|
||||||
editor.undoManager.beforeChange();
|
editor.undoManager.beforeChange();
|
||||||
restoreDraft();
|
restoreDraft();
|
||||||
removeDraft();
|
removeDraft();
|
||||||
editor.undoManager.add();
|
editor.undoManager.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.addButton('restoredraft', {
|
editor.addButton('restoredraft', {
|
||||||
title: 'Restore last draft',
|
title: 'Restore last draft',
|
||||||
onclick: restoreLastDraft,
|
onclick: restoreLastDraft,
|
||||||
onPostRender: postRender
|
onPostRender: postRender
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addMenuItem('restoredraft', {
|
editor.addMenuItem('restoredraft', {
|
||||||
text: 'Restore last draft',
|
text: 'Restore last draft',
|
||||||
onclick: restoreLastDraft,
|
onclick: restoreLastDraft,
|
||||||
onPostRender: postRender,
|
onPostRender: postRender,
|
||||||
context: 'file'
|
context: 'file'
|
||||||
});
|
});
|
||||||
|
|
||||||
function isEmpty(html) {
|
function isEmpty(html) {
|
||||||
var forcedRootBlockName = editor.settings.forced_root_block;
|
var forcedRootBlockName = editor.settings.forced_root_block;
|
||||||
|
|
||||||
html = tinymce.trim(typeof html == "undefined" ? editor.getBody().innerHTML : html);
|
html = tinymce.trim(typeof html == "undefined" ? editor.getBody().innerHTML : html);
|
||||||
|
|
||||||
return html === '' || new RegExp(
|
return html === '' || new RegExp(
|
||||||
'^<' + forcedRootBlockName + '[^>]*>((\u00a0| |[ \t]|<br[^>]*>)+?|)<\/' + forcedRootBlockName + '>|<br>$', 'i'
|
'^<' + forcedRootBlockName + '[^>]*>((\u00a0| |[ \t]|<br[^>]*>)+?|)<\/' + forcedRootBlockName + '>|<br>$', 'i'
|
||||||
).test(html);
|
).test(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editor.settings.autosave_restore_when_empty !== false) {
|
if (editor.settings.autosave_restore_when_empty !== false) {
|
||||||
editor.on('init', function() {
|
editor.on('init', function() {
|
||||||
if (hasDraft() && isEmpty()) {
|
if (hasDraft() && isEmpty()) {
|
||||||
restoreDraft();
|
restoreDraft();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.on('saveContent', function() {
|
editor.on('saveContent', function() {
|
||||||
removeDraft();
|
removeDraft();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onbeforeunload = tinymce._beforeUnloadHandler;
|
window.onbeforeunload = tinymce._beforeUnloadHandler;
|
||||||
|
|
||||||
this.hasDraft = hasDraft;
|
this.hasDraft = hasDraft;
|
||||||
this.storeDraft = storeDraft;
|
this.storeDraft = storeDraft;
|
||||||
this.restoreDraft = restoreDraft;
|
this.restoreDraft = restoreDraft;
|
||||||
this.removeDraft = removeDraft;
|
this.removeDraft = removeDraft;
|
||||||
this.isEmpty = isEmpty;
|
this.isEmpty = isEmpty;
|
||||||
});
|
});
|
||||||
@@ -1,123 +1,123 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
||||||
init: function(ed) {
|
init: function(ed) {
|
||||||
var self = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
|
var self = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
|
||||||
|
|
||||||
ed.on('beforeSetContent', function(e) {
|
ed.on('beforeSetContent', function(e) {
|
||||||
e.content = self['_' + dialect + '_bbcode2html'](e.content);
|
e.content = self['_' + dialect + '_bbcode2html'](e.content);
|
||||||
});
|
});
|
||||||
|
|
||||||
ed.on('postProcess', function(e) {
|
ed.on('postProcess', function(e) {
|
||||||
if (e.set) {
|
if (e.set) {
|
||||||
e.content = self['_' + dialect + '_bbcode2html'](e.content);
|
e.content = self['_' + dialect + '_bbcode2html'](e.content);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.get) {
|
if (e.get) {
|
||||||
e.content = self['_' + dialect + '_html2bbcode'](e.content);
|
e.content = self['_' + dialect + '_html2bbcode'](e.content);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getInfo: function() {
|
getInfo: function() {
|
||||||
return {
|
return {
|
||||||
longname: 'BBCode Plugin',
|
longname: 'BBCode Plugin',
|
||||||
author: 'Moxiecode Systems AB',
|
author: 'Moxiecode Systems AB',
|
||||||
authorurl: 'http://www.tinymce.com',
|
authorurl: 'http://www.tinymce.com',
|
||||||
infourl: 'http://www.tinymce.com/wiki.php/Plugin:bbcode'
|
infourl: 'http://www.tinymce.com/wiki.php/Plugin:bbcode'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
// Private methods
|
// Private methods
|
||||||
|
|
||||||
// HTML -> BBCode in PunBB dialect
|
// HTML -> BBCode in PunBB dialect
|
||||||
_punbb_html2bbcode: function(s) {
|
_punbb_html2bbcode: function(s) {
|
||||||
s = tinymce.trim(s);
|
s = tinymce.trim(s);
|
||||||
|
|
||||||
function rep(re, str) {
|
function rep(re, str) {
|
||||||
s = s.replace(re, str);
|
s = s.replace(re, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// example: <strong> to [b]
|
// example: <strong> to [b]
|
||||||
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi, "[url=$1]$2[/url]");
|
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi, "[url=$1]$2[/url]");
|
||||||
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]");
|
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]");
|
||||||
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]");
|
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]");
|
||||||
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]");
|
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]");
|
||||||
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]");
|
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]");
|
||||||
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi, "[color=$1]$2[/color]");
|
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi, "[color=$1]$2[/color]");
|
||||||
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[color=$1]$2[/color]");
|
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[color=$1]$2[/color]");
|
||||||
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi, "[size=$1]$2[/size]");
|
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi, "[size=$1]$2[/size]");
|
||||||
rep(/<font>(.*?)<\/font>/gi, "$1");
|
rep(/<font>(.*?)<\/font>/gi, "$1");
|
||||||
rep(/<img.*?src=\"(.*?)\".*?\/>/gi, "[img]$1[/img]");
|
rep(/<img.*?src=\"(.*?)\".*?\/>/gi, "[img]$1[/img]");
|
||||||
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi, "[code]$1[/code]");
|
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi, "[code]$1[/code]");
|
||||||
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi, "[quote]$1[/quote]");
|
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi, "[quote]$1[/quote]");
|
||||||
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi, "[code][b]$1[/b][/code]");
|
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi, "[code][b]$1[/b][/code]");
|
||||||
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi, "[quote][b]$1[/b][/quote]");
|
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi, "[quote][b]$1[/b][/quote]");
|
||||||
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi, "[code][i]$1[/i][/code]");
|
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi, "[code][i]$1[/i][/code]");
|
||||||
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi, "[quote][i]$1[/i][/quote]");
|
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi, "[quote][i]$1[/i][/quote]");
|
||||||
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi, "[code][u]$1[/u][/code]");
|
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi, "[code][u]$1[/u][/code]");
|
||||||
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi, "[quote][u]$1[/u][/quote]");
|
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi, "[quote][u]$1[/u][/quote]");
|
||||||
rep(/<\/(strong|b)>/gi, "[/b]");
|
rep(/<\/(strong|b)>/gi, "[/b]");
|
||||||
rep(/<(strong|b)>/gi, "[b]");
|
rep(/<(strong|b)>/gi, "[b]");
|
||||||
rep(/<\/(em|i)>/gi, "[/i]");
|
rep(/<\/(em|i)>/gi, "[/i]");
|
||||||
rep(/<(em|i)>/gi, "[i]");
|
rep(/<(em|i)>/gi, "[i]");
|
||||||
rep(/<\/u>/gi, "[/u]");
|
rep(/<\/u>/gi, "[/u]");
|
||||||
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi, "[u]$1[/u]");
|
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi, "[u]$1[/u]");
|
||||||
rep(/<u>/gi, "[u]");
|
rep(/<u>/gi, "[u]");
|
||||||
rep(/<blockquote[^>]*>/gi, "[quote]");
|
rep(/<blockquote[^>]*>/gi, "[quote]");
|
||||||
rep(/<\/blockquote>/gi, "[/quote]");
|
rep(/<\/blockquote>/gi, "[/quote]");
|
||||||
rep(/<br \/>/gi, "\n");
|
rep(/<br \/>/gi, "\n");
|
||||||
rep(/<br\/>/gi, "\n");
|
rep(/<br\/>/gi, "\n");
|
||||||
rep(/<br>/gi, "\n");
|
rep(/<br>/gi, "\n");
|
||||||
rep(/<p>/gi, "");
|
rep(/<p>/gi, "");
|
||||||
rep(/<\/p>/gi, "\n");
|
rep(/<\/p>/gi, "\n");
|
||||||
rep(/ |\u00a0/gi, " ");
|
rep(/ |\u00a0/gi, " ");
|
||||||
rep(/"/gi, "\"");
|
rep(/"/gi, "\"");
|
||||||
rep(/</gi, "<");
|
rep(/</gi, "<");
|
||||||
rep(/>/gi, ">");
|
rep(/>/gi, ">");
|
||||||
rep(/&/gi, "&");
|
rep(/&/gi, "&");
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
},
|
},
|
||||||
|
|
||||||
// BBCode -> HTML from PunBB dialect
|
// BBCode -> HTML from PunBB dialect
|
||||||
_punbb_bbcode2html: function(s) {
|
_punbb_bbcode2html: function(s) {
|
||||||
s = tinymce.trim(s);
|
s = tinymce.trim(s);
|
||||||
|
|
||||||
function rep(re, str) {
|
function rep(re, str) {
|
||||||
s = s.replace(re, str);
|
s = s.replace(re, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// example: [b] to <strong>
|
// example: [b] to <strong>
|
||||||
rep(/\n/gi, "<br />");
|
rep(/\n/gi, "<br />");
|
||||||
rep(/\[b\]/gi, "<strong>");
|
rep(/\[b\]/gi, "<strong>");
|
||||||
rep(/\[\/b\]/gi, "</strong>");
|
rep(/\[\/b\]/gi, "</strong>");
|
||||||
rep(/\[i\]/gi, "<em>");
|
rep(/\[i\]/gi, "<em>");
|
||||||
rep(/\[\/i\]/gi, "</em>");
|
rep(/\[\/i\]/gi, "</em>");
|
||||||
rep(/\[u\]/gi, "<u>");
|
rep(/\[u\]/gi, "<u>");
|
||||||
rep(/\[\/u\]/gi, "</u>");
|
rep(/\[\/u\]/gi, "</u>");
|
||||||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, "<a href=\"$1\">$2</a>");
|
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, "<a href=\"$1\">$2</a>");
|
||||||
rep(/\[url\](.*?)\[\/url\]/gi, "<a href=\"$1\">$1</a>");
|
rep(/\[url\](.*?)\[\/url\]/gi, "<a href=\"$1\">$1</a>");
|
||||||
rep(/\[img\](.*?)\[\/img\]/gi, "<img src=\"$1\" />");
|
rep(/\[img\](.*?)\[\/img\]/gi, "<img src=\"$1\" />");
|
||||||
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, "<font color=\"$1\">$2</font>");
|
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, "<font color=\"$1\">$2</font>");
|
||||||
rep(/\[code\](.*?)\[\/code\]/gi, "<span class=\"codeStyle\">$1</span> ");
|
rep(/\[code\](.*?)\[\/code\]/gi, "<span class=\"codeStyle\">$1</span> ");
|
||||||
rep(/\[quote.*?\](.*?)\[\/quote\]/gi, "<span class=\"quoteStyle\">$1</span> ");
|
rep(/\[quote.*?\](.*?)\[\/quote\]/gi, "<span class=\"quoteStyle\">$1</span> ");
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register plugin
|
// Register plugin
|
||||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||||
})();
|
})();
|
||||||
@@ -1,396 +1,396 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('charmap', function(editor) {
|
tinymce.PluginManager.add('charmap', function(editor) {
|
||||||
var charmap = [
|
var charmap = [
|
||||||
['160', 'no-break space'],
|
['160', 'no-break space'],
|
||||||
['173', 'soft hyphen'],
|
['173', 'soft hyphen'],
|
||||||
['34', 'quotation mark'],
|
['34', 'quotation mark'],
|
||||||
// finance
|
// finance
|
||||||
['162', 'cent sign'],
|
['162', 'cent sign'],
|
||||||
['8364', 'euro sign'],
|
['8364', 'euro sign'],
|
||||||
['163', 'pound sign'],
|
['163', 'pound sign'],
|
||||||
['165', 'yen sign'],
|
['165', 'yen sign'],
|
||||||
// signs
|
// signs
|
||||||
['169', 'copyright sign'],
|
['169', 'copyright sign'],
|
||||||
['174', 'registered sign'],
|
['174', 'registered sign'],
|
||||||
['8482', 'trade mark sign'],
|
['8482', 'trade mark sign'],
|
||||||
['8240', 'per mille sign'],
|
['8240', 'per mille sign'],
|
||||||
['181', 'micro sign'],
|
['181', 'micro sign'],
|
||||||
['183', 'middle dot'],
|
['183', 'middle dot'],
|
||||||
['8226', 'bullet'],
|
['8226', 'bullet'],
|
||||||
['8230', 'three dot leader'],
|
['8230', 'three dot leader'],
|
||||||
['8242', 'minutes / feet'],
|
['8242', 'minutes / feet'],
|
||||||
['8243', 'seconds / inches'],
|
['8243', 'seconds / inches'],
|
||||||
['167', 'section sign'],
|
['167', 'section sign'],
|
||||||
['182', 'paragraph sign'],
|
['182', 'paragraph sign'],
|
||||||
['223', 'sharp s / ess-zed'],
|
['223', 'sharp s / ess-zed'],
|
||||||
// quotations
|
// quotations
|
||||||
['8249', 'single left-pointing angle quotation mark'],
|
['8249', 'single left-pointing angle quotation mark'],
|
||||||
['8250', 'single right-pointing angle quotation mark'],
|
['8250', 'single right-pointing angle quotation mark'],
|
||||||
['171', 'left pointing guillemet'],
|
['171', 'left pointing guillemet'],
|
||||||
['187', 'right pointing guillemet'],
|
['187', 'right pointing guillemet'],
|
||||||
['8216', 'left single quotation mark'],
|
['8216', 'left single quotation mark'],
|
||||||
['8217', 'right single quotation mark'],
|
['8217', 'right single quotation mark'],
|
||||||
['8220', 'left double quotation mark'],
|
['8220', 'left double quotation mark'],
|
||||||
['8221', 'right double quotation mark'],
|
['8221', 'right double quotation mark'],
|
||||||
['8218', 'single low-9 quotation mark'],
|
['8218', 'single low-9 quotation mark'],
|
||||||
['8222', 'double low-9 quotation mark'],
|
['8222', 'double low-9 quotation mark'],
|
||||||
['60', 'less-than sign'],
|
['60', 'less-than sign'],
|
||||||
['62', 'greater-than sign'],
|
['62', 'greater-than sign'],
|
||||||
['8804', 'less-than or equal to'],
|
['8804', 'less-than or equal to'],
|
||||||
['8805', 'greater-than or equal to'],
|
['8805', 'greater-than or equal to'],
|
||||||
['8211', 'en dash'],
|
['8211', 'en dash'],
|
||||||
['8212', 'em dash'],
|
['8212', 'em dash'],
|
||||||
['175', 'macron'],
|
['175', 'macron'],
|
||||||
['8254', 'overline'],
|
['8254', 'overline'],
|
||||||
['164', 'currency sign'],
|
['164', 'currency sign'],
|
||||||
['166', 'broken bar'],
|
['166', 'broken bar'],
|
||||||
['168', 'diaeresis'],
|
['168', 'diaeresis'],
|
||||||
['161', 'inverted exclamation mark'],
|
['161', 'inverted exclamation mark'],
|
||||||
['191', 'turned question mark'],
|
['191', 'turned question mark'],
|
||||||
['710', 'circumflex accent'],
|
['710', 'circumflex accent'],
|
||||||
['732', 'small tilde'],
|
['732', 'small tilde'],
|
||||||
['176', 'degree sign'],
|
['176', 'degree sign'],
|
||||||
['8722', 'minus sign'],
|
['8722', 'minus sign'],
|
||||||
['177', 'plus-minus sign'],
|
['177', 'plus-minus sign'],
|
||||||
['247', 'division sign'],
|
['247', 'division sign'],
|
||||||
['8260', 'fraction slash'],
|
['8260', 'fraction slash'],
|
||||||
['215', 'multiplication sign'],
|
['215', 'multiplication sign'],
|
||||||
['185', 'superscript one'],
|
['185', 'superscript one'],
|
||||||
['178', 'superscript two'],
|
['178', 'superscript two'],
|
||||||
['179', 'superscript three'],
|
['179', 'superscript three'],
|
||||||
['188', 'fraction one quarter'],
|
['188', 'fraction one quarter'],
|
||||||
['189', 'fraction one half'],
|
['189', 'fraction one half'],
|
||||||
['190', 'fraction three quarters'],
|
['190', 'fraction three quarters'],
|
||||||
// math / logical
|
// math / logical
|
||||||
['402', 'function / florin'],
|
['402', 'function / florin'],
|
||||||
['8747', 'integral'],
|
['8747', 'integral'],
|
||||||
['8721', 'n-ary sumation'],
|
['8721', 'n-ary sumation'],
|
||||||
['8734', 'infinity'],
|
['8734', 'infinity'],
|
||||||
['8730', 'square root'],
|
['8730', 'square root'],
|
||||||
['8764', 'similar to'],
|
['8764', 'similar to'],
|
||||||
['8773', 'approximately equal to'],
|
['8773', 'approximately equal to'],
|
||||||
['8776', 'almost equal to'],
|
['8776', 'almost equal to'],
|
||||||
['8800', 'not equal to'],
|
['8800', 'not equal to'],
|
||||||
['8801', 'identical to'],
|
['8801', 'identical to'],
|
||||||
['8712', 'element of'],
|
['8712', 'element of'],
|
||||||
['8713', 'not an element of'],
|
['8713', 'not an element of'],
|
||||||
['8715', 'contains as member'],
|
['8715', 'contains as member'],
|
||||||
['8719', 'n-ary product'],
|
['8719', 'n-ary product'],
|
||||||
['8743', 'logical and'],
|
['8743', 'logical and'],
|
||||||
['8744', 'logical or'],
|
['8744', 'logical or'],
|
||||||
['172', 'not sign'],
|
['172', 'not sign'],
|
||||||
['8745', 'intersection'],
|
['8745', 'intersection'],
|
||||||
['8746', 'union'],
|
['8746', 'union'],
|
||||||
['8706', 'partial differential'],
|
['8706', 'partial differential'],
|
||||||
['8704', 'for all'],
|
['8704', 'for all'],
|
||||||
['8707', 'there exists'],
|
['8707', 'there exists'],
|
||||||
['8709', 'diameter'],
|
['8709', 'diameter'],
|
||||||
['8711', 'backward difference'],
|
['8711', 'backward difference'],
|
||||||
['8727', 'asterisk operator'],
|
['8727', 'asterisk operator'],
|
||||||
['8733', 'proportional to'],
|
['8733', 'proportional to'],
|
||||||
['8736', 'angle'],
|
['8736', 'angle'],
|
||||||
// undefined
|
// undefined
|
||||||
['180', 'acute accent'],
|
['180', 'acute accent'],
|
||||||
['184', 'cedilla'],
|
['184', 'cedilla'],
|
||||||
['170', 'feminine ordinal indicator'],
|
['170', 'feminine ordinal indicator'],
|
||||||
['186', 'masculine ordinal indicator'],
|
['186', 'masculine ordinal indicator'],
|
||||||
['8224', 'dagger'],
|
['8224', 'dagger'],
|
||||||
['8225', 'double dagger'],
|
['8225', 'double dagger'],
|
||||||
// alphabetical special chars
|
// alphabetical special chars
|
||||||
['192', 'A - grave'],
|
['192', 'A - grave'],
|
||||||
['193', 'A - acute'],
|
['193', 'A - acute'],
|
||||||
['194', 'A - circumflex'],
|
['194', 'A - circumflex'],
|
||||||
['195', 'A - tilde'],
|
['195', 'A - tilde'],
|
||||||
['196', 'A - diaeresis'],
|
['196', 'A - diaeresis'],
|
||||||
['197', 'A - ring above'],
|
['197', 'A - ring above'],
|
||||||
['198', 'ligature AE'],
|
['198', 'ligature AE'],
|
||||||
['199', 'C - cedilla'],
|
['199', 'C - cedilla'],
|
||||||
['200', 'E - grave'],
|
['200', 'E - grave'],
|
||||||
['201', 'E - acute'],
|
['201', 'E - acute'],
|
||||||
['202', 'E - circumflex'],
|
['202', 'E - circumflex'],
|
||||||
['203', 'E - diaeresis'],
|
['203', 'E - diaeresis'],
|
||||||
['204', 'I - grave'],
|
['204', 'I - grave'],
|
||||||
['205', 'I - acute'],
|
['205', 'I - acute'],
|
||||||
['206', 'I - circumflex'],
|
['206', 'I - circumflex'],
|
||||||
['207', 'I - diaeresis'],
|
['207', 'I - diaeresis'],
|
||||||
['208', 'ETH'],
|
['208', 'ETH'],
|
||||||
['209', 'N - tilde'],
|
['209', 'N - tilde'],
|
||||||
['210', 'O - grave'],
|
['210', 'O - grave'],
|
||||||
['211', 'O - acute'],
|
['211', 'O - acute'],
|
||||||
['212', 'O - circumflex'],
|
['212', 'O - circumflex'],
|
||||||
['213', 'O - tilde'],
|
['213', 'O - tilde'],
|
||||||
['214', 'O - diaeresis'],
|
['214', 'O - diaeresis'],
|
||||||
['216', 'O - slash'],
|
['216', 'O - slash'],
|
||||||
['338', 'ligature OE'],
|
['338', 'ligature OE'],
|
||||||
['352', 'S - caron'],
|
['352', 'S - caron'],
|
||||||
['217', 'U - grave'],
|
['217', 'U - grave'],
|
||||||
['218', 'U - acute'],
|
['218', 'U - acute'],
|
||||||
['219', 'U - circumflex'],
|
['219', 'U - circumflex'],
|
||||||
['220', 'U - diaeresis'],
|
['220', 'U - diaeresis'],
|
||||||
['221', 'Y - acute'],
|
['221', 'Y - acute'],
|
||||||
['376', 'Y - diaeresis'],
|
['376', 'Y - diaeresis'],
|
||||||
['222', 'THORN'],
|
['222', 'THORN'],
|
||||||
['224', 'a - grave'],
|
['224', 'a - grave'],
|
||||||
['225', 'a - acute'],
|
['225', 'a - acute'],
|
||||||
['226', 'a - circumflex'],
|
['226', 'a - circumflex'],
|
||||||
['227', 'a - tilde'],
|
['227', 'a - tilde'],
|
||||||
['228', 'a - diaeresis'],
|
['228', 'a - diaeresis'],
|
||||||
['229', 'a - ring above'],
|
['229', 'a - ring above'],
|
||||||
['230', 'ligature ae'],
|
['230', 'ligature ae'],
|
||||||
['231', 'c - cedilla'],
|
['231', 'c - cedilla'],
|
||||||
['232', 'e - grave'],
|
['232', 'e - grave'],
|
||||||
['233', 'e - acute'],
|
['233', 'e - acute'],
|
||||||
['234', 'e - circumflex'],
|
['234', 'e - circumflex'],
|
||||||
['235', 'e - diaeresis'],
|
['235', 'e - diaeresis'],
|
||||||
['236', 'i - grave'],
|
['236', 'i - grave'],
|
||||||
['237', 'i - acute'],
|
['237', 'i - acute'],
|
||||||
['238', 'i - circumflex'],
|
['238', 'i - circumflex'],
|
||||||
['239', 'i - diaeresis'],
|
['239', 'i - diaeresis'],
|
||||||
['240', 'eth'],
|
['240', 'eth'],
|
||||||
['241', 'n - tilde'],
|
['241', 'n - tilde'],
|
||||||
['242', 'o - grave'],
|
['242', 'o - grave'],
|
||||||
['243', 'o - acute'],
|
['243', 'o - acute'],
|
||||||
['244', 'o - circumflex'],
|
['244', 'o - circumflex'],
|
||||||
['245', 'o - tilde'],
|
['245', 'o - tilde'],
|
||||||
['246', 'o - diaeresis'],
|
['246', 'o - diaeresis'],
|
||||||
['248', 'o slash'],
|
['248', 'o slash'],
|
||||||
['339', 'ligature oe'],
|
['339', 'ligature oe'],
|
||||||
['353', 's - caron'],
|
['353', 's - caron'],
|
||||||
['249', 'u - grave'],
|
['249', 'u - grave'],
|
||||||
['250', 'u - acute'],
|
['250', 'u - acute'],
|
||||||
['251', 'u - circumflex'],
|
['251', 'u - circumflex'],
|
||||||
['252', 'u - diaeresis'],
|
['252', 'u - diaeresis'],
|
||||||
['253', 'y - acute'],
|
['253', 'y - acute'],
|
||||||
['254', 'thorn'],
|
['254', 'thorn'],
|
||||||
['255', 'y - diaeresis'],
|
['255', 'y - diaeresis'],
|
||||||
['913', 'Alpha'],
|
['913', 'Alpha'],
|
||||||
['914', 'Beta'],
|
['914', 'Beta'],
|
||||||
['915', 'Gamma'],
|
['915', 'Gamma'],
|
||||||
['916', 'Delta'],
|
['916', 'Delta'],
|
||||||
['917', 'Epsilon'],
|
['917', 'Epsilon'],
|
||||||
['918', 'Zeta'],
|
['918', 'Zeta'],
|
||||||
['919', 'Eta'],
|
['919', 'Eta'],
|
||||||
['920', 'Theta'],
|
['920', 'Theta'],
|
||||||
['921', 'Iota'],
|
['921', 'Iota'],
|
||||||
['922', 'Kappa'],
|
['922', 'Kappa'],
|
||||||
['923', 'Lambda'],
|
['923', 'Lambda'],
|
||||||
['924', 'Mu'],
|
['924', 'Mu'],
|
||||||
['925', 'Nu'],
|
['925', 'Nu'],
|
||||||
['926', 'Xi'],
|
['926', 'Xi'],
|
||||||
['927', 'Omicron'],
|
['927', 'Omicron'],
|
||||||
['928', 'Pi'],
|
['928', 'Pi'],
|
||||||
['929', 'Rho'],
|
['929', 'Rho'],
|
||||||
['931', 'Sigma'],
|
['931', 'Sigma'],
|
||||||
['932', 'Tau'],
|
['932', 'Tau'],
|
||||||
['933', 'Upsilon'],
|
['933', 'Upsilon'],
|
||||||
['934', 'Phi'],
|
['934', 'Phi'],
|
||||||
['935', 'Chi'],
|
['935', 'Chi'],
|
||||||
['936', 'Psi'],
|
['936', 'Psi'],
|
||||||
['937', 'Omega'],
|
['937', 'Omega'],
|
||||||
['945', 'alpha'],
|
['945', 'alpha'],
|
||||||
['946', 'beta'],
|
['946', 'beta'],
|
||||||
['947', 'gamma'],
|
['947', 'gamma'],
|
||||||
['948', 'delta'],
|
['948', 'delta'],
|
||||||
['949', 'epsilon'],
|
['949', 'epsilon'],
|
||||||
['950', 'zeta'],
|
['950', 'zeta'],
|
||||||
['951', 'eta'],
|
['951', 'eta'],
|
||||||
['952', 'theta'],
|
['952', 'theta'],
|
||||||
['953', 'iota'],
|
['953', 'iota'],
|
||||||
['954', 'kappa'],
|
['954', 'kappa'],
|
||||||
['955', 'lambda'],
|
['955', 'lambda'],
|
||||||
['956', 'mu'],
|
['956', 'mu'],
|
||||||
['957', 'nu'],
|
['957', 'nu'],
|
||||||
['958', 'xi'],
|
['958', 'xi'],
|
||||||
['959', 'omicron'],
|
['959', 'omicron'],
|
||||||
['960', 'pi'],
|
['960', 'pi'],
|
||||||
['961', 'rho'],
|
['961', 'rho'],
|
||||||
['962', 'final sigma'],
|
['962', 'final sigma'],
|
||||||
['963', 'sigma'],
|
['963', 'sigma'],
|
||||||
['964', 'tau'],
|
['964', 'tau'],
|
||||||
['965', 'upsilon'],
|
['965', 'upsilon'],
|
||||||
['966', 'phi'],
|
['966', 'phi'],
|
||||||
['967', 'chi'],
|
['967', 'chi'],
|
||||||
['968', 'psi'],
|
['968', 'psi'],
|
||||||
['969', 'omega'],
|
['969', 'omega'],
|
||||||
// symbols
|
// symbols
|
||||||
['8501', 'alef symbol'],
|
['8501', 'alef symbol'],
|
||||||
['982', 'pi symbol'],
|
['982', 'pi symbol'],
|
||||||
['8476', 'real part symbol'],
|
['8476', 'real part symbol'],
|
||||||
['978', 'upsilon - hook symbol'],
|
['978', 'upsilon - hook symbol'],
|
||||||
['8472', 'Weierstrass p'],
|
['8472', 'Weierstrass p'],
|
||||||
['8465', 'imaginary part'],
|
['8465', 'imaginary part'],
|
||||||
// arrows
|
// arrows
|
||||||
['8592', 'leftwards arrow'],
|
['8592', 'leftwards arrow'],
|
||||||
['8593', 'upwards arrow'],
|
['8593', 'upwards arrow'],
|
||||||
['8594', 'rightwards arrow'],
|
['8594', 'rightwards arrow'],
|
||||||
['8595', 'downwards arrow'],
|
['8595', 'downwards arrow'],
|
||||||
['8596', 'left right arrow'],
|
['8596', 'left right arrow'],
|
||||||
['8629', 'carriage return'],
|
['8629', 'carriage return'],
|
||||||
['8656', 'leftwards double arrow'],
|
['8656', 'leftwards double arrow'],
|
||||||
['8657', 'upwards double arrow'],
|
['8657', 'upwards double arrow'],
|
||||||
['8658', 'rightwards double arrow'],
|
['8658', 'rightwards double arrow'],
|
||||||
['8659', 'downwards double arrow'],
|
['8659', 'downwards double arrow'],
|
||||||
['8660', 'left right double arrow'],
|
['8660', 'left right double arrow'],
|
||||||
['8756', 'therefore'],
|
['8756', 'therefore'],
|
||||||
['8834', 'subset of'],
|
['8834', 'subset of'],
|
||||||
['8835', 'superset of'],
|
['8835', 'superset of'],
|
||||||
['8836', 'not a subset of'],
|
['8836', 'not a subset of'],
|
||||||
['8838', 'subset of or equal to'],
|
['8838', 'subset of or equal to'],
|
||||||
['8839', 'superset of or equal to'],
|
['8839', 'superset of or equal to'],
|
||||||
['8853', 'circled plus'],
|
['8853', 'circled plus'],
|
||||||
['8855', 'circled times'],
|
['8855', 'circled times'],
|
||||||
['8869', 'perpendicular'],
|
['8869', 'perpendicular'],
|
||||||
['8901', 'dot operator'],
|
['8901', 'dot operator'],
|
||||||
['8968', 'left ceiling'],
|
['8968', 'left ceiling'],
|
||||||
['8969', 'right ceiling'],
|
['8969', 'right ceiling'],
|
||||||
['8970', 'left floor'],
|
['8970', 'left floor'],
|
||||||
['8971', 'right floor'],
|
['8971', 'right floor'],
|
||||||
['9001', 'left-pointing angle bracket'],
|
['9001', 'left-pointing angle bracket'],
|
||||||
['9002', 'right-pointing angle bracket'],
|
['9002', 'right-pointing angle bracket'],
|
||||||
['9674', 'lozenge'],
|
['9674', 'lozenge'],
|
||||||
['9824', 'black spade suit'],
|
['9824', 'black spade suit'],
|
||||||
['9827', 'black club suit'],
|
['9827', 'black club suit'],
|
||||||
['9829', 'black heart suit'],
|
['9829', 'black heart suit'],
|
||||||
['9830', 'black diamond suit'],
|
['9830', 'black diamond suit'],
|
||||||
['8194', 'en space'],
|
['8194', 'en space'],
|
||||||
['8195', 'em space'],
|
['8195', 'em space'],
|
||||||
['8201', 'thin space'],
|
['8201', 'thin space'],
|
||||||
['8204', 'zero width non-joiner'],
|
['8204', 'zero width non-joiner'],
|
||||||
['8205', 'zero width joiner'],
|
['8205', 'zero width joiner'],
|
||||||
['8206', 'left-to-right mark'],
|
['8206', 'left-to-right mark'],
|
||||||
['8207', 'right-to-left mark']
|
['8207', 'right-to-left mark']
|
||||||
];
|
];
|
||||||
|
|
||||||
function showDialog() {
|
function showDialog() {
|
||||||
var gridHtml, x, y, win;
|
var gridHtml, x, y, win;
|
||||||
|
|
||||||
function getParentTd(elm) {
|
function getParentTd(elm) {
|
||||||
while (elm) {
|
while (elm) {
|
||||||
if (elm.nodeName == 'TD') {
|
if (elm.nodeName == 'TD') {
|
||||||
return elm;
|
return elm;
|
||||||
}
|
}
|
||||||
|
|
||||||
elm = elm.parentNode;
|
elm = elm.parentNode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
|
gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
|
||||||
|
|
||||||
var width = 25;
|
var width = 25;
|
||||||
var height = Math.ceil(charmap.length / width);
|
var height = Math.ceil(charmap.length / width);
|
||||||
for (y = 0; y < height; y++) {
|
for (y = 0; y < height; y++) {
|
||||||
gridHtml += '<tr>';
|
gridHtml += '<tr>';
|
||||||
|
|
||||||
for (x = 0; x < width; x++) {
|
for (x = 0; x < width; x++) {
|
||||||
var index = y * width + x;
|
var index = y * width + x;
|
||||||
if (index < charmap.length) {
|
if (index < charmap.length) {
|
||||||
var chr = charmap[index];
|
var chr = charmap[index];
|
||||||
|
|
||||||
gridHtml += '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button">' +
|
gridHtml += '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button">' +
|
||||||
(chr ? String.fromCharCode(parseInt(chr[0], 10)) : ' ') + '</div></td>';
|
(chr ? String.fromCharCode(parseInt(chr[0], 10)) : ' ') + '</div></td>';
|
||||||
} else {
|
} else {
|
||||||
gridHtml += '<td />';
|
gridHtml += '<td />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gridHtml += '</tr>';
|
gridHtml += '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
gridHtml += '</tbody></table>';
|
gridHtml += '</tbody></table>';
|
||||||
|
|
||||||
var charMapPanel = {
|
var charMapPanel = {
|
||||||
type: 'container',
|
type: 'container',
|
||||||
html: gridHtml,
|
html: gridHtml,
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
var target = e.target;
|
var target = e.target;
|
||||||
if (/^(TD|DIV)$/.test(target.nodeName)) {
|
if (/^(TD|DIV)$/.test(target.nodeName)) {
|
||||||
if (getParentTd(target).firstChild) {
|
if (getParentTd(target).firstChild) {
|
||||||
editor.execCommand('mceInsertContent', false, tinymce.trim(target.innerText || target.textContent));
|
editor.execCommand('mceInsertContent', false, tinymce.trim(target.innerText || target.textContent));
|
||||||
|
|
||||||
if (!e.ctrlKey) {
|
if (!e.ctrlKey) {
|
||||||
win.close();
|
win.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onmouseover: function(e) {
|
onmouseover: function(e) {
|
||||||
var td = getParentTd(e.target);
|
var td = getParentTd(e.target);
|
||||||
|
|
||||||
if (td && td.firstChild) {
|
if (td && td.firstChild) {
|
||||||
win.find('#preview').text(td.firstChild.firstChild.data);
|
win.find('#preview').text(td.firstChild.firstChild.data);
|
||||||
win.find('#previewTitle').text(td.title);
|
win.find('#previewTitle').text(td.title);
|
||||||
} else {
|
} else {
|
||||||
win.find('#preview').text(' ');
|
win.find('#preview').text(' ');
|
||||||
win.find('#previewTitle').text(' ');
|
win.find('#previewTitle').text(' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
win = editor.windowManager.open({
|
win = editor.windowManager.open({
|
||||||
title: "Special character",
|
title: "Special character",
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
padding: 10,
|
padding: 10,
|
||||||
items: [
|
items: [
|
||||||
charMapPanel,
|
charMapPanel,
|
||||||
{
|
{
|
||||||
type: 'container',
|
type: 'container',
|
||||||
layout: 'flex',
|
layout: 'flex',
|
||||||
direction: 'column',
|
direction: 'column',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
spacing: 5,
|
spacing: 5,
|
||||||
minWidth: 160,
|
minWidth: 160,
|
||||||
minHeight: 160,
|
minHeight: 160,
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
type: 'label',
|
type: 'label',
|
||||||
name: 'preview',
|
name: 'preview',
|
||||||
text: ' ',
|
text: ' ',
|
||||||
style: 'font-size: 40px; text-align: center',
|
style: 'font-size: 40px; text-align: center',
|
||||||
border: 1,
|
border: 1,
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
minHeight: 80
|
minHeight: 80
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'label',
|
type: 'label',
|
||||||
name: 'previewTitle',
|
name: 'previewTitle',
|
||||||
text: ' ',
|
text: ' ',
|
||||||
style: 'text-align: center',
|
style: 'text-align: center',
|
||||||
border: 1,
|
border: 1,
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
minHeight: 80
|
minHeight: 80
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
buttons: [
|
buttons: [
|
||||||
{text: "Close", onclick: function() {
|
{text: "Close", onclick: function() {
|
||||||
win.close();
|
win.close();
|
||||||
}}
|
}}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.addButton('charmap', {
|
editor.addButton('charmap', {
|
||||||
icon: 'charmap',
|
icon: 'charmap',
|
||||||
tooltip: 'Special character',
|
tooltip: 'Special character',
|
||||||
onclick: showDialog
|
onclick: showDialog
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addMenuItem('charmap', {
|
editor.addMenuItem('charmap', {
|
||||||
icon: 'charmap',
|
icon: 'charmap',
|
||||||
text: 'Special character',
|
text: 'Special character',
|
||||||
onclick: showDialog,
|
onclick: showDialog,
|
||||||
context: 'insert'
|
context: 'insert'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,60 +1,60 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('code', function(editor) {
|
tinymce.PluginManager.add('code', function(editor) {
|
||||||
function showDialog() {
|
function showDialog() {
|
||||||
var win = editor.windowManager.open({
|
var win = editor.windowManager.open({
|
||||||
title: "Source code",
|
title: "Source code",
|
||||||
body: {
|
body: {
|
||||||
type: 'textbox',
|
type: 'textbox',
|
||||||
name: 'code',
|
name: 'code',
|
||||||
multiline: true,
|
multiline: true,
|
||||||
minWidth: editor.getParam("code_dialog_width", 600),
|
minWidth: editor.getParam("code_dialog_width", 600),
|
||||||
minHeight: editor.getParam("code_dialog_height", Math.min(tinymce.DOM.getViewPort().h - 200, 500)),
|
minHeight: editor.getParam("code_dialog_height", Math.min(tinymce.DOM.getViewPort().h - 200, 500)),
|
||||||
spellcheck: false,
|
spellcheck: false,
|
||||||
style: 'direction: ltr; text-align: left'
|
style: 'direction: ltr; text-align: left'
|
||||||
},
|
},
|
||||||
onSubmit: function(e) {
|
onSubmit: function(e) {
|
||||||
// We get a lovely "Wrong document" error in IE 11 if we
|
// We get a lovely "Wrong document" error in IE 11 if we
|
||||||
// don't move the focus to the editor before creating an undo
|
// don't move the focus to the editor before creating an undo
|
||||||
// transation since it tries to make a bookmark for the current selection
|
// transation since it tries to make a bookmark for the current selection
|
||||||
editor.focus();
|
editor.focus();
|
||||||
|
|
||||||
editor.undoManager.transact(function() {
|
editor.undoManager.transact(function() {
|
||||||
editor.setContent(e.data.code);
|
editor.setContent(e.data.code);
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.selection.setCursorLocation();
|
editor.selection.setCursorLocation();
|
||||||
editor.nodeChanged();
|
editor.nodeChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Gecko has a major performance issue with textarea
|
// Gecko has a major performance issue with textarea
|
||||||
// contents so we need to set it when all reflows are done
|
// contents so we need to set it when all reflows are done
|
||||||
win.find('#code').value(editor.getContent({source_view: true}));
|
win.find('#code').value(editor.getContent({source_view: true}));
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.addCommand("mceCodeEditor", showDialog);
|
editor.addCommand("mceCodeEditor", showDialog);
|
||||||
|
|
||||||
editor.addButton('code', {
|
editor.addButton('code', {
|
||||||
icon: 'code',
|
icon: 'code',
|
||||||
tooltip: 'Source code',
|
tooltip: 'Source code',
|
||||||
onclick: showDialog
|
onclick: showDialog
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addMenuItem('code', {
|
editor.addMenuItem('code', {
|
||||||
icon: 'code',
|
icon: 'code',
|
||||||
text: 'Source code',
|
text: 'Source code',
|
||||||
context: 'tools',
|
context: 'tools',
|
||||||
onclick: showDialog
|
onclick: showDialog
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,112 +1,112 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('colorpicker', function(editor) {
|
tinymce.PluginManager.add('colorpicker', function(editor) {
|
||||||
function colorPickerCallback(callback, value) {
|
function colorPickerCallback(callback, value) {
|
||||||
function setColor(value) {
|
function setColor(value) {
|
||||||
var color = new tinymce.util.Color(value), rgb = color.toRgb();
|
var color = new tinymce.util.Color(value), rgb = color.toRgb();
|
||||||
|
|
||||||
win.fromJSON({
|
win.fromJSON({
|
||||||
r: rgb.r,
|
r: rgb.r,
|
||||||
g: rgb.g,
|
g: rgb.g,
|
||||||
b: rgb.b,
|
b: rgb.b,
|
||||||
hex: color.toHex().substr(1)
|
hex: color.toHex().substr(1)
|
||||||
});
|
});
|
||||||
|
|
||||||
showPreview(color.toHex());
|
showPreview(color.toHex());
|
||||||
}
|
}
|
||||||
|
|
||||||
function showPreview(hexColor) {
|
function showPreview(hexColor) {
|
||||||
win.find('#preview')[0].getEl().style.background = hexColor;
|
win.find('#preview')[0].getEl().style.background = hexColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
var win = editor.windowManager.open({
|
var win = editor.windowManager.open({
|
||||||
title: 'Color',
|
title: 'Color',
|
||||||
items: {
|
items: {
|
||||||
type: 'container',
|
type: 'container',
|
||||||
layout: 'flex',
|
layout: 'flex',
|
||||||
direction: 'row',
|
direction: 'row',
|
||||||
align: 'stretch',
|
align: 'stretch',
|
||||||
padding: 5,
|
padding: 5,
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
type: 'colorpicker',
|
type: 'colorpicker',
|
||||||
value: value,
|
value: value,
|
||||||
onchange: function() {
|
onchange: function() {
|
||||||
var rgb = this.rgb();
|
var rgb = this.rgb();
|
||||||
|
|
||||||
if (win) {
|
if (win) {
|
||||||
win.find('#r').value(rgb.r);
|
win.find('#r').value(rgb.r);
|
||||||
win.find('#g').value(rgb.g);
|
win.find('#g').value(rgb.g);
|
||||||
win.find('#b').value(rgb.b);
|
win.find('#b').value(rgb.b);
|
||||||
win.find('#hex').value(this.value().substr(1));
|
win.find('#hex').value(this.value().substr(1));
|
||||||
showPreview(this.value());
|
showPreview(this.value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'form',
|
type: 'form',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
labelGap: 5,
|
labelGap: 5,
|
||||||
defaults: {
|
defaults: {
|
||||||
type: 'textbox',
|
type: 'textbox',
|
||||||
size: 7,
|
size: 7,
|
||||||
value: '0',
|
value: '0',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
spellcheck: false,
|
spellcheck: false,
|
||||||
onchange: function() {
|
onchange: function() {
|
||||||
var colorPickerCtrl = win.find('colorpicker')[0];
|
var colorPickerCtrl = win.find('colorpicker')[0];
|
||||||
var name, value;
|
var name, value;
|
||||||
|
|
||||||
name = this.name();
|
name = this.name();
|
||||||
value = this.value();
|
value = this.value();
|
||||||
|
|
||||||
if (name == "hex") {
|
if (name == "hex") {
|
||||||
value = '#' + value;
|
value = '#' + value;
|
||||||
setColor(value);
|
setColor(value);
|
||||||
colorPickerCtrl.value(value);
|
colorPickerCtrl.value(value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = {
|
value = {
|
||||||
r: win.find('#r').value(),
|
r: win.find('#r').value(),
|
||||||
g: win.find('#g').value(),
|
g: win.find('#g').value(),
|
||||||
b: win.find('#b').value()
|
b: win.find('#b').value()
|
||||||
};
|
};
|
||||||
|
|
||||||
colorPickerCtrl.value(value);
|
colorPickerCtrl.value(value);
|
||||||
setColor(value);
|
setColor(value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
{name: 'r', label: 'R', autofocus: 1},
|
{name: 'r', label: 'R', autofocus: 1},
|
||||||
{name: 'g', label: 'G'},
|
{name: 'g', label: 'G'},
|
||||||
{name: 'b', label: 'B'},
|
{name: 'b', label: 'B'},
|
||||||
{name: 'hex', label: '#', value: '000000'},
|
{name: 'hex', label: '#', value: '000000'},
|
||||||
{name: 'preview', type: 'container', border: 1}
|
{name: 'preview', type: 'container', border: 1}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
onSubmit: function() {
|
onSubmit: function() {
|
||||||
callback('#' + this.toJSON().hex);
|
callback('#' + this.toJSON().hex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setColor(value);
|
setColor(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!editor.settings.color_picker_callback) {
|
if (!editor.settings.color_picker_callback) {
|
||||||
editor.settings.color_picker_callback = colorPickerCallback;
|
editor.settings.color_picker_callback = colorPickerCallback;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1,87 +1,87 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('contextmenu', function(editor) {
|
tinymce.PluginManager.add('contextmenu', function(editor) {
|
||||||
var menu, contextmenuNeverUseNative = editor.settings.contextmenu_never_use_native;
|
var menu, contextmenuNeverUseNative = editor.settings.contextmenu_never_use_native;
|
||||||
|
|
||||||
editor.on('contextmenu', function(e) {
|
editor.on('contextmenu', function(e) {
|
||||||
var contextmenu, doc = editor.getDoc();
|
var contextmenu, doc = editor.getDoc();
|
||||||
|
|
||||||
// Block TinyMCE menu on ctrlKey
|
// Block TinyMCE menu on ctrlKey
|
||||||
if (e.ctrlKey && !contextmenuNeverUseNative) {
|
if (e.ctrlKey && !contextmenuNeverUseNative) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WebKit/Blink on Mac has the odd behavior of selecting the target word or line this causes
|
* WebKit/Blink on Mac has the odd behavior of selecting the target word or line this causes
|
||||||
* issues when for example inserting images see: #7022
|
* issues when for example inserting images see: #7022
|
||||||
*/
|
*/
|
||||||
if (tinymce.Env.mac && tinymce.Env.webkit) {
|
if (tinymce.Env.mac && tinymce.Env.webkit) {
|
||||||
if (e.button == 2 && doc.caretRangeFromPoint) {
|
if (e.button == 2 && doc.caretRangeFromPoint) {
|
||||||
editor.selection.setRng(doc.caretRangeFromPoint(e.x, e.y));
|
editor.selection.setRng(doc.caretRangeFromPoint(e.x, e.y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contextmenu = editor.settings.contextmenu || 'link image inserttable | cell row column deletetable';
|
contextmenu = editor.settings.contextmenu || 'link image inserttable | cell row column deletetable';
|
||||||
|
|
||||||
// Render menu
|
// Render menu
|
||||||
if (!menu) {
|
if (!menu) {
|
||||||
var items = [];
|
var items = [];
|
||||||
|
|
||||||
tinymce.each(contextmenu.split(/[ ,]/), function(name) {
|
tinymce.each(contextmenu.split(/[ ,]/), function(name) {
|
||||||
var item = editor.menuItems[name];
|
var item = editor.menuItems[name];
|
||||||
|
|
||||||
if (name == '|') {
|
if (name == '|') {
|
||||||
item = {text: name};
|
item = {text: name};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
item.shortcut = ''; // Hide shortcuts
|
item.shortcut = ''; // Hide shortcuts
|
||||||
items.push(item);
|
items.push(item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (var i = 0; i < items.length; i++) {
|
for (var i = 0; i < items.length; i++) {
|
||||||
if (items[i].text == '|') {
|
if (items[i].text == '|') {
|
||||||
if (i === 0 || i == items.length - 1) {
|
if (i === 0 || i == items.length - 1) {
|
||||||
items.splice(i, 1);
|
items.splice(i, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
menu = new tinymce.ui.Menu({
|
menu = new tinymce.ui.Menu({
|
||||||
items: items,
|
items: items,
|
||||||
context: 'contextmenu'
|
context: 'contextmenu'
|
||||||
}).addClass('contextmenu').renderTo();
|
}).addClass('contextmenu').renderTo();
|
||||||
|
|
||||||
editor.on('remove', function() {
|
editor.on('remove', function() {
|
||||||
menu.remove();
|
menu.remove();
|
||||||
menu = null;
|
menu = null;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
menu.show();
|
menu.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Position menu
|
// Position menu
|
||||||
var pos = {x: e.pageX, y: e.pageY};
|
var pos = {x: e.pageX, y: e.pageY};
|
||||||
|
|
||||||
if (!editor.inline) {
|
if (!editor.inline) {
|
||||||
pos = tinymce.DOM.getPos(editor.getContentAreaContainer());
|
pos = tinymce.DOM.getPos(editor.getContentAreaContainer());
|
||||||
pos.x += e.clientX;
|
pos.x += e.clientX;
|
||||||
pos.y += e.clientY;
|
pos.y += e.clientY;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.moveTo(pos.x, pos.y);
|
menu.moveTo(pos.x, pos.y);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,64 +1,64 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('directionality', function(editor) {
|
tinymce.PluginManager.add('directionality', function(editor) {
|
||||||
function setDir(dir) {
|
function setDir(dir) {
|
||||||
var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks();
|
var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks();
|
||||||
|
|
||||||
if (blocks.length) {
|
if (blocks.length) {
|
||||||
curDir = dom.getAttrib(blocks[0], "dir");
|
curDir = dom.getAttrib(blocks[0], "dir");
|
||||||
|
|
||||||
tinymce.each(blocks, function(block) {
|
tinymce.each(blocks, function(block) {
|
||||||
// Add dir to block if the parent block doesn't already have that dir
|
// Add dir to block if the parent block doesn't already have that dir
|
||||||
if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
|
if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
|
||||||
if (curDir != dir) {
|
if (curDir != dir) {
|
||||||
dom.setAttrib(block, "dir", dir);
|
dom.setAttrib(block, "dir", dir);
|
||||||
} else {
|
} else {
|
||||||
dom.setAttrib(block, "dir", null);
|
dom.setAttrib(block, "dir", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.nodeChanged();
|
editor.nodeChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateSelector(dir) {
|
function generateSelector(dir) {
|
||||||
var selector = [];
|
var selector = [];
|
||||||
|
|
||||||
tinymce.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function(name) {
|
tinymce.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function(name) {
|
||||||
selector.push(name + '[dir=' + dir + ']');
|
selector.push(name + '[dir=' + dir + ']');
|
||||||
});
|
});
|
||||||
|
|
||||||
return selector.join(',');
|
return selector.join(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.addCommand('mceDirectionLTR', function() {
|
editor.addCommand('mceDirectionLTR', function() {
|
||||||
setDir("ltr");
|
setDir("ltr");
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addCommand('mceDirectionRTL', function() {
|
editor.addCommand('mceDirectionRTL', function() {
|
||||||
setDir("rtl");
|
setDir("rtl");
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addButton('ltr', {
|
editor.addButton('ltr', {
|
||||||
title: 'Left to right',
|
title: 'Left to right',
|
||||||
cmd: 'mceDirectionLTR',
|
cmd: 'mceDirectionLTR',
|
||||||
stateSelector: generateSelector('ltr')
|
stateSelector: generateSelector('ltr')
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addButton('rtl', {
|
editor.addButton('rtl', {
|
||||||
title: 'Right to left',
|
title: 'Right to left',
|
||||||
cmd: 'mceDirectionRTL',
|
cmd: 'mceDirectionRTL',
|
||||||
stateSelector: generateSelector('rtl')
|
stateSelector: generateSelector('rtl')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,65 +1,65 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('emoticons', function(editor, url) {
|
tinymce.PluginManager.add('emoticons', function(editor, url) {
|
||||||
var emoticons = [
|
var emoticons = [
|
||||||
["cool", "cry", "embarassed", "foot-in-mouth"],
|
["cool", "cry", "embarassed", "foot-in-mouth"],
|
||||||
["frown", "innocent", "kiss", "laughing"],
|
["frown", "innocent", "kiss", "laughing"],
|
||||||
["money-mouth", "sealed", "smile", "surprised"],
|
["money-mouth", "sealed", "smile", "surprised"],
|
||||||
["tongue-out", "undecided", "wink", "yell"]
|
["tongue-out", "undecided", "wink", "yell"]
|
||||||
];
|
];
|
||||||
|
|
||||||
function getHtml() {
|
function getHtml() {
|
||||||
var emoticonsHtml;
|
var emoticonsHtml;
|
||||||
|
|
||||||
emoticonsHtml = '<table role="list" class="mce-grid">';
|
emoticonsHtml = '<table role="list" class="mce-grid">';
|
||||||
|
|
||||||
tinymce.each(emoticons, function(row) {
|
tinymce.each(emoticons, function(row) {
|
||||||
emoticonsHtml += '<tr>';
|
emoticonsHtml += '<tr>';
|
||||||
|
|
||||||
tinymce.each(row, function(icon) {
|
tinymce.each(row, function(icon) {
|
||||||
var emoticonUrl = url + '/img/smiley-' + icon + '.gif';
|
var emoticonUrl = url + '/img/smiley-' + icon + '.gif';
|
||||||
|
|
||||||
emoticonsHtml += '<td><a href="#" data-mce-url="' + emoticonUrl + '" data-mce-alt="' + icon + '" tabindex="-1" ' +
|
emoticonsHtml += '<td><a href="#" data-mce-url="' + emoticonUrl + '" data-mce-alt="' + icon + '" tabindex="-1" ' +
|
||||||
'role="option" aria-label="' + icon + '"><img src="' +
|
'role="option" aria-label="' + icon + '"><img src="' +
|
||||||
emoticonUrl + '" style="width: 18px; height: 18px" role="presentation" /></a></td>';
|
emoticonUrl + '" style="width: 18px; height: 18px" role="presentation" /></a></td>';
|
||||||
});
|
});
|
||||||
|
|
||||||
emoticonsHtml += '</tr>';
|
emoticonsHtml += '</tr>';
|
||||||
});
|
});
|
||||||
|
|
||||||
emoticonsHtml += '</table>';
|
emoticonsHtml += '</table>';
|
||||||
|
|
||||||
return emoticonsHtml;
|
return emoticonsHtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.addButton('emoticons', {
|
editor.addButton('emoticons', {
|
||||||
type: 'panelbutton',
|
type: 'panelbutton',
|
||||||
panel: {
|
panel: {
|
||||||
role: 'application',
|
role: 'application',
|
||||||
autohide: true,
|
autohide: true,
|
||||||
html: getHtml,
|
html: getHtml,
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
var linkElm = editor.dom.getParent(e.target, 'a');
|
var linkElm = editor.dom.getParent(e.target, 'a');
|
||||||
|
|
||||||
if (linkElm) {
|
if (linkElm) {
|
||||||
editor.insertContent(
|
editor.insertContent(
|
||||||
'<img src="' + linkElm.getAttribute('data-mce-url') + '" alt="' + linkElm.getAttribute('data-mce-alt') + '" />'
|
'<img src="' + linkElm.getAttribute('data-mce-url') + '" alt="' + linkElm.getAttribute('data-mce-alt') + '" />'
|
||||||
);
|
);
|
||||||
|
|
||||||
this.hide();
|
this.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tooltip: 'Emoticons'
|
tooltip: 'Emoticons'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,490 +1,490 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('fullpage', function(editor) {
|
tinymce.PluginManager.add('fullpage', function(editor) {
|
||||||
var each = tinymce.each, Node = tinymce.html.Node;
|
var each = tinymce.each, Node = tinymce.html.Node;
|
||||||
var head, foot;
|
var head, foot;
|
||||||
|
|
||||||
function showDialog() {
|
function showDialog() {
|
||||||
var data = htmlToData();
|
var data = htmlToData();
|
||||||
|
|
||||||
editor.windowManager.open({
|
editor.windowManager.open({
|
||||||
title: 'Document properties',
|
title: 'Document properties',
|
||||||
data: data,
|
data: data,
|
||||||
defaults: {type: 'textbox', size: 40},
|
defaults: {type: 'textbox', size: 40},
|
||||||
body: [
|
body: [
|
||||||
{name: 'title', label: 'Title'},
|
{name: 'title', label: 'Title'},
|
||||||
{name: 'keywords', label: 'Keywords'},
|
{name: 'keywords', label: 'Keywords'},
|
||||||
{name: 'description', label: 'Description'},
|
{name: 'description', label: 'Description'},
|
||||||
{name: 'robots', label: 'Robots'},
|
{name: 'robots', label: 'Robots'},
|
||||||
{name: 'author', label: 'Author'},
|
{name: 'author', label: 'Author'},
|
||||||
{name: 'docencoding', label: 'Encoding'}
|
{name: 'docencoding', label: 'Encoding'}
|
||||||
],
|
],
|
||||||
onSubmit: function(e) {
|
onSubmit: function(e) {
|
||||||
dataToHtml(tinymce.extend(data, e.data));
|
dataToHtml(tinymce.extend(data, e.data));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function htmlToData() {
|
function htmlToData() {
|
||||||
var headerFragment = parseHeader(), data = {}, elm, matches;
|
var headerFragment = parseHeader(), data = {}, elm, matches;
|
||||||
|
|
||||||
function getAttr(elm, name) {
|
function getAttr(elm, name) {
|
||||||
var value = elm.attr(name);
|
var value = elm.attr(name);
|
||||||
|
|
||||||
return value || '';
|
return value || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default some values
|
// Default some values
|
||||||
data.fontface = editor.getParam("fullpage_default_fontface", "");
|
data.fontface = editor.getParam("fullpage_default_fontface", "");
|
||||||
data.fontsize = editor.getParam("fullpage_default_fontsize", "");
|
data.fontsize = editor.getParam("fullpage_default_fontsize", "");
|
||||||
|
|
||||||
// Parse XML PI
|
// Parse XML PI
|
||||||
elm = headerFragment.firstChild;
|
elm = headerFragment.firstChild;
|
||||||
if (elm.type == 7) {
|
if (elm.type == 7) {
|
||||||
data.xml_pi = true;
|
data.xml_pi = true;
|
||||||
matches = /encoding="([^"]+)"/.exec(elm.value);
|
matches = /encoding="([^"]+)"/.exec(elm.value);
|
||||||
if (matches) {
|
if (matches) {
|
||||||
data.docencoding = matches[1];
|
data.docencoding = matches[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse doctype
|
// Parse doctype
|
||||||
elm = headerFragment.getAll('#doctype')[0];
|
elm = headerFragment.getAll('#doctype')[0];
|
||||||
if (elm) {
|
if (elm) {
|
||||||
data.doctype = '<!DOCTYPE' + elm.value + ">";
|
data.doctype = '<!DOCTYPE' + elm.value + ">";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse title element
|
// Parse title element
|
||||||
elm = headerFragment.getAll('title')[0];
|
elm = headerFragment.getAll('title')[0];
|
||||||
if (elm && elm.firstChild) {
|
if (elm && elm.firstChild) {
|
||||||
data.title = elm.firstChild.value;
|
data.title = elm.firstChild.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse meta elements
|
// Parse meta elements
|
||||||
each(headerFragment.getAll('meta'), function(meta) {
|
each(headerFragment.getAll('meta'), function(meta) {
|
||||||
var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
|
var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
data[name.toLowerCase()] = meta.attr('content');
|
data[name.toLowerCase()] = meta.attr('content');
|
||||||
} else if (httpEquiv == "Content-Type") {
|
} else if (httpEquiv == "Content-Type") {
|
||||||
matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
|
matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
|
||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
data.docencoding = matches[1];
|
data.docencoding = matches[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Parse html attribs
|
// Parse html attribs
|
||||||
elm = headerFragment.getAll('html')[0];
|
elm = headerFragment.getAll('html')[0];
|
||||||
if (elm) {
|
if (elm) {
|
||||||
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
|
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse stylesheets
|
// Parse stylesheets
|
||||||
data.stylesheets = [];
|
data.stylesheets = [];
|
||||||
tinymce.each(headerFragment.getAll('link'), function(link) {
|
tinymce.each(headerFragment.getAll('link'), function(link) {
|
||||||
if (link.attr('rel') == 'stylesheet') {
|
if (link.attr('rel') == 'stylesheet') {
|
||||||
data.stylesheets.push(link.attr('href'));
|
data.stylesheets.push(link.attr('href'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Parse body parts
|
// Parse body parts
|
||||||
elm = headerFragment.getAll('body')[0];
|
elm = headerFragment.getAll('body')[0];
|
||||||
if (elm) {
|
if (elm) {
|
||||||
data.langdir = getAttr(elm, 'dir');
|
data.langdir = getAttr(elm, 'dir');
|
||||||
data.style = getAttr(elm, 'style');
|
data.style = getAttr(elm, 'style');
|
||||||
data.visited_color = getAttr(elm, 'vlink');
|
data.visited_color = getAttr(elm, 'vlink');
|
||||||
data.link_color = getAttr(elm, 'link');
|
data.link_color = getAttr(elm, 'link');
|
||||||
data.active_color = getAttr(elm, 'alink');
|
data.active_color = getAttr(elm, 'alink');
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
function dataToHtml(data) {
|
function dataToHtml(data) {
|
||||||
var headerFragment, headElement, html, elm, value, dom = editor.dom;
|
var headerFragment, headElement, html, elm, value, dom = editor.dom;
|
||||||
|
|
||||||
function setAttr(elm, name, value) {
|
function setAttr(elm, name, value) {
|
||||||
elm.attr(name, value ? value : undefined);
|
elm.attr(name, value ? value : undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addHeadNode(node) {
|
function addHeadNode(node) {
|
||||||
if (headElement.firstChild) {
|
if (headElement.firstChild) {
|
||||||
headElement.insert(node, headElement.firstChild);
|
headElement.insert(node, headElement.firstChild);
|
||||||
} else {
|
} else {
|
||||||
headElement.append(node);
|
headElement.append(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
headerFragment = parseHeader();
|
headerFragment = parseHeader();
|
||||||
headElement = headerFragment.getAll('head')[0];
|
headElement = headerFragment.getAll('head')[0];
|
||||||
if (!headElement) {
|
if (!headElement) {
|
||||||
elm = headerFragment.getAll('html')[0];
|
elm = headerFragment.getAll('html')[0];
|
||||||
headElement = new Node('head', 1);
|
headElement = new Node('head', 1);
|
||||||
|
|
||||||
if (elm.firstChild) {
|
if (elm.firstChild) {
|
||||||
elm.insert(headElement, elm.firstChild, true);
|
elm.insert(headElement, elm.firstChild, true);
|
||||||
} else {
|
} else {
|
||||||
elm.append(headElement);
|
elm.append(headElement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add/update/remove XML-PI
|
// Add/update/remove XML-PI
|
||||||
elm = headerFragment.firstChild;
|
elm = headerFragment.firstChild;
|
||||||
if (data.xml_pi) {
|
if (data.xml_pi) {
|
||||||
value = 'version="1.0"';
|
value = 'version="1.0"';
|
||||||
|
|
||||||
if (data.docencoding) {
|
if (data.docencoding) {
|
||||||
value += ' encoding="' + data.docencoding + '"';
|
value += ' encoding="' + data.docencoding + '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elm.type != 7) {
|
if (elm.type != 7) {
|
||||||
elm = new Node('xml', 7);
|
elm = new Node('xml', 7);
|
||||||
headerFragment.insert(elm, headerFragment.firstChild, true);
|
headerFragment.insert(elm, headerFragment.firstChild, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
elm.value = value;
|
elm.value = value;
|
||||||
} else if (elm && elm.type == 7) {
|
} else if (elm && elm.type == 7) {
|
||||||
elm.remove();
|
elm.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add/update/remove doctype
|
// Add/update/remove doctype
|
||||||
elm = headerFragment.getAll('#doctype')[0];
|
elm = headerFragment.getAll('#doctype')[0];
|
||||||
if (data.doctype) {
|
if (data.doctype) {
|
||||||
if (!elm) {
|
if (!elm) {
|
||||||
elm = new Node('#doctype', 10);
|
elm = new Node('#doctype', 10);
|
||||||
|
|
||||||
if (data.xml_pi) {
|
if (data.xml_pi) {
|
||||||
headerFragment.insert(elm, headerFragment.firstChild);
|
headerFragment.insert(elm, headerFragment.firstChild);
|
||||||
} else {
|
} else {
|
||||||
addHeadNode(elm);
|
addHeadNode(elm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
elm.value = data.doctype.substring(9, data.doctype.length - 1);
|
elm.value = data.doctype.substring(9, data.doctype.length - 1);
|
||||||
} else if (elm) {
|
} else if (elm) {
|
||||||
elm.remove();
|
elm.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add meta encoding
|
// Add meta encoding
|
||||||
elm = null;
|
elm = null;
|
||||||
each(headerFragment.getAll('meta'), function(meta) {
|
each(headerFragment.getAll('meta'), function(meta) {
|
||||||
if (meta.attr('http-equiv') == 'Content-Type') {
|
if (meta.attr('http-equiv') == 'Content-Type') {
|
||||||
elm = meta;
|
elm = meta;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (data.docencoding) {
|
if (data.docencoding) {
|
||||||
if (!elm) {
|
if (!elm) {
|
||||||
elm = new Node('meta', 1);
|
elm = new Node('meta', 1);
|
||||||
elm.attr('http-equiv', 'Content-Type');
|
elm.attr('http-equiv', 'Content-Type');
|
||||||
elm.shortEnded = true;
|
elm.shortEnded = true;
|
||||||
addHeadNode(elm);
|
addHeadNode(elm);
|
||||||
}
|
}
|
||||||
|
|
||||||
elm.attr('content', 'text/html; charset=' + data.docencoding);
|
elm.attr('content', 'text/html; charset=' + data.docencoding);
|
||||||
} else if (elm) {
|
} else if (elm) {
|
||||||
elm.remove();
|
elm.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add/update/remove title
|
// Add/update/remove title
|
||||||
elm = headerFragment.getAll('title')[0];
|
elm = headerFragment.getAll('title')[0];
|
||||||
if (data.title) {
|
if (data.title) {
|
||||||
if (!elm) {
|
if (!elm) {
|
||||||
elm = new Node('title', 1);
|
elm = new Node('title', 1);
|
||||||
addHeadNode(elm);
|
addHeadNode(elm);
|
||||||
} else {
|
} else {
|
||||||
elm.empty();
|
elm.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
elm.append(new Node('#text', 3)).value = data.title;
|
elm.append(new Node('#text', 3)).value = data.title;
|
||||||
} else if (elm) {
|
} else if (elm) {
|
||||||
elm.remove();
|
elm.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add/update/remove meta
|
// Add/update/remove meta
|
||||||
each('keywords,description,author,copyright,robots'.split(','), function(name) {
|
each('keywords,description,author,copyright,robots'.split(','), function(name) {
|
||||||
var nodes = headerFragment.getAll('meta'), i, meta, value = data[name];
|
var nodes = headerFragment.getAll('meta'), i, meta, value = data[name];
|
||||||
|
|
||||||
for (i = 0; i < nodes.length; i++) {
|
for (i = 0; i < nodes.length; i++) {
|
||||||
meta = nodes[i];
|
meta = nodes[i];
|
||||||
|
|
||||||
if (meta.attr('name') == name) {
|
if (meta.attr('name') == name) {
|
||||||
if (value) {
|
if (value) {
|
||||||
meta.attr('content', value);
|
meta.attr('content', value);
|
||||||
} else {
|
} else {
|
||||||
meta.remove();
|
meta.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
elm = new Node('meta', 1);
|
elm = new Node('meta', 1);
|
||||||
elm.attr('name', name);
|
elm.attr('name', name);
|
||||||
elm.attr('content', value);
|
elm.attr('content', value);
|
||||||
elm.shortEnded = true;
|
elm.shortEnded = true;
|
||||||
|
|
||||||
addHeadNode(elm);
|
addHeadNode(elm);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var currentStyleSheetsMap = {};
|
var currentStyleSheetsMap = {};
|
||||||
tinymce.each(headerFragment.getAll('link'), function(stylesheet) {
|
tinymce.each(headerFragment.getAll('link'), function(stylesheet) {
|
||||||
if (stylesheet.attr('rel') == 'stylesheet') {
|
if (stylesheet.attr('rel') == 'stylesheet') {
|
||||||
currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet;
|
currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add new
|
// Add new
|
||||||
tinymce.each(data.stylesheets, function(stylesheet) {
|
tinymce.each(data.stylesheets, function(stylesheet) {
|
||||||
if (!currentStyleSheetsMap[stylesheet]) {
|
if (!currentStyleSheetsMap[stylesheet]) {
|
||||||
elm = new Node('link', 1);
|
elm = new Node('link', 1);
|
||||||
elm.attr({
|
elm.attr({
|
||||||
rel: 'stylesheet',
|
rel: 'stylesheet',
|
||||||
text: 'text/css',
|
text: 'text/css',
|
||||||
href: stylesheet
|
href: stylesheet
|
||||||
});
|
});
|
||||||
elm.shortEnded = true;
|
elm.shortEnded = true;
|
||||||
addHeadNode(elm);
|
addHeadNode(elm);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete currentStyleSheetsMap[stylesheet];
|
delete currentStyleSheetsMap[stylesheet];
|
||||||
});
|
});
|
||||||
|
|
||||||
// Delete old
|
// Delete old
|
||||||
tinymce.each(currentStyleSheetsMap, function(stylesheet) {
|
tinymce.each(currentStyleSheetsMap, function(stylesheet) {
|
||||||
stylesheet.remove();
|
stylesheet.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update body attributes
|
// Update body attributes
|
||||||
elm = headerFragment.getAll('body')[0];
|
elm = headerFragment.getAll('body')[0];
|
||||||
if (elm) {
|
if (elm) {
|
||||||
setAttr(elm, 'dir', data.langdir);
|
setAttr(elm, 'dir', data.langdir);
|
||||||
setAttr(elm, 'style', data.style);
|
setAttr(elm, 'style', data.style);
|
||||||
setAttr(elm, 'vlink', data.visited_color);
|
setAttr(elm, 'vlink', data.visited_color);
|
||||||
setAttr(elm, 'link', data.link_color);
|
setAttr(elm, 'link', data.link_color);
|
||||||
setAttr(elm, 'alink', data.active_color);
|
setAttr(elm, 'alink', data.active_color);
|
||||||
|
|
||||||
// Update iframe body as well
|
// Update iframe body as well
|
||||||
dom.setAttribs(editor.getBody(), {
|
dom.setAttribs(editor.getBody(), {
|
||||||
style: data.style,
|
style: data.style,
|
||||||
dir: data.dir,
|
dir: data.dir,
|
||||||
vLink: data.visited_color,
|
vLink: data.visited_color,
|
||||||
link: data.link_color,
|
link: data.link_color,
|
||||||
aLink: data.active_color
|
aLink: data.active_color
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set html attributes
|
// Set html attributes
|
||||||
elm = headerFragment.getAll('html')[0];
|
elm = headerFragment.getAll('html')[0];
|
||||||
if (elm) {
|
if (elm) {
|
||||||
setAttr(elm, 'lang', data.langcode);
|
setAttr(elm, 'lang', data.langcode);
|
||||||
setAttr(elm, 'xml:lang', data.langcode);
|
setAttr(elm, 'xml:lang', data.langcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// No need for a head element
|
// No need for a head element
|
||||||
if (!headElement.firstChild) {
|
if (!headElement.firstChild) {
|
||||||
headElement.remove();
|
headElement.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serialize header fragment and crop away body part
|
// Serialize header fragment and crop away body part
|
||||||
html = new tinymce.html.Serializer({
|
html = new tinymce.html.Serializer({
|
||||||
validate: false,
|
validate: false,
|
||||||
indent: true,
|
indent: true,
|
||||||
apply_source_formatting: true,
|
apply_source_formatting: true,
|
||||||
indent_before: 'head,html,body,meta,title,script,link,style',
|
indent_before: 'head,html,body,meta,title,script,link,style',
|
||||||
indent_after: 'head,html,body,meta,title,script,link,style'
|
indent_after: 'head,html,body,meta,title,script,link,style'
|
||||||
}).serialize(headerFragment);
|
}).serialize(headerFragment);
|
||||||
|
|
||||||
head = html.substring(0, html.indexOf('</body>'));
|
head = html.substring(0, html.indexOf('</body>'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseHeader() {
|
function parseHeader() {
|
||||||
// Parse the contents with a DOM parser
|
// Parse the contents with a DOM parser
|
||||||
return new tinymce.html.DomParser({
|
return new tinymce.html.DomParser({
|
||||||
validate: false,
|
validate: false,
|
||||||
root_name: '#document'
|
root_name: '#document'
|
||||||
}).parse(head);
|
}).parse(head);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setContent(evt) {
|
function setContent(evt) {
|
||||||
var startPos, endPos, content = evt.content, headerFragment, styles = '', dom = editor.dom, elm;
|
var startPos, endPos, content = evt.content, headerFragment, styles = '', dom = editor.dom, elm;
|
||||||
|
|
||||||
if (evt.selection) {
|
if (evt.selection) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function low(s) {
|
function low(s) {
|
||||||
return s.replace(/<\/?[A-Z]+/g, function(a) {
|
return s.replace(/<\/?[A-Z]+/g, function(a) {
|
||||||
return a.toLowerCase();
|
return a.toLowerCase();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate
|
// 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) {
|
if (evt.format == 'raw' && head) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (evt.source_view && editor.getParam('fullpage_hide_in_source_view')) {
|
if (evt.source_view && editor.getParam('fullpage_hide_in_source_view')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fixed so new document/setContent('') doesn't remove existing header/footer except when it's in source code view
|
// Fixed so new document/setContent('') doesn't remove existing header/footer except when it's in source code view
|
||||||
if (content.length === 0 && !evt.source_view) {
|
if (content.length === 0 && !evt.source_view) {
|
||||||
content = tinymce.trim(head) + '\n' + tinymce.trim(content) + '\n' + tinymce.trim(foot);
|
content = tinymce.trim(head) + '\n' + tinymce.trim(content) + '\n' + tinymce.trim(foot);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse out head, body and footer
|
// Parse out head, body and footer
|
||||||
content = content.replace(/<(\/?)BODY/gi, '<$1body');
|
content = content.replace(/<(\/?)BODY/gi, '<$1body');
|
||||||
startPos = content.indexOf('<body');
|
startPos = content.indexOf('<body');
|
||||||
|
|
||||||
if (startPos != -1) {
|
if (startPos != -1) {
|
||||||
startPos = content.indexOf('>', startPos);
|
startPos = content.indexOf('>', startPos);
|
||||||
head = low(content.substring(0, startPos + 1));
|
head = low(content.substring(0, startPos + 1));
|
||||||
|
|
||||||
endPos = content.indexOf('</body', startPos);
|
endPos = content.indexOf('</body', startPos);
|
||||||
if (endPos == -1) {
|
if (endPos == -1) {
|
||||||
endPos = content.length;
|
endPos = content.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
evt.content = content.substring(startPos + 1, endPos);
|
evt.content = content.substring(startPos + 1, endPos);
|
||||||
foot = low(content.substring(endPos));
|
foot = low(content.substring(endPos));
|
||||||
} else {
|
} else {
|
||||||
head = getDefaultHeader();
|
head = getDefaultHeader();
|
||||||
foot = '\n</body>\n</html>';
|
foot = '\n</body>\n</html>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse header and update iframe
|
// Parse header and update iframe
|
||||||
headerFragment = parseHeader();
|
headerFragment = parseHeader();
|
||||||
each(headerFragment.getAll('style'), function(node) {
|
each(headerFragment.getAll('style'), function(node) {
|
||||||
if (node.firstChild) {
|
if (node.firstChild) {
|
||||||
styles += node.firstChild.value;
|
styles += node.firstChild.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
elm = headerFragment.getAll('body')[0];
|
elm = headerFragment.getAll('body')[0];
|
||||||
if (elm) {
|
if (elm) {
|
||||||
dom.setAttribs(editor.getBody(), {
|
dom.setAttribs(editor.getBody(), {
|
||||||
style: elm.attr('style') || '',
|
style: elm.attr('style') || '',
|
||||||
dir: elm.attr('dir') || '',
|
dir: elm.attr('dir') || '',
|
||||||
vLink: elm.attr('vlink') || '',
|
vLink: elm.attr('vlink') || '',
|
||||||
link: elm.attr('link') || '',
|
link: elm.attr('link') || '',
|
||||||
aLink: elm.attr('alink') || ''
|
aLink: elm.attr('alink') || ''
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
dom.remove('fullpage_styles');
|
dom.remove('fullpage_styles');
|
||||||
|
|
||||||
var headElm = editor.getDoc().getElementsByTagName('head')[0];
|
var headElm = editor.getDoc().getElementsByTagName('head')[0];
|
||||||
|
|
||||||
if (styles) {
|
if (styles) {
|
||||||
dom.add(headElm, 'style', {
|
dom.add(headElm, 'style', {
|
||||||
id: 'fullpage_styles'
|
id: 'fullpage_styles'
|
||||||
}, styles);
|
}, styles);
|
||||||
|
|
||||||
// Needed for IE 6/7
|
// Needed for IE 6/7
|
||||||
elm = dom.get('fullpage_styles');
|
elm = dom.get('fullpage_styles');
|
||||||
if (elm.styleSheet) {
|
if (elm.styleSheet) {
|
||||||
elm.styleSheet.cssText = styles;
|
elm.styleSheet.cssText = styles;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentStyleSheetsMap = {};
|
var currentStyleSheetsMap = {};
|
||||||
tinymce.each(headElm.getElementsByTagName('link'), function(stylesheet) {
|
tinymce.each(headElm.getElementsByTagName('link'), function(stylesheet) {
|
||||||
if (stylesheet.rel == 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) {
|
if (stylesheet.rel == 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) {
|
||||||
currentStyleSheetsMap[stylesheet.href] = stylesheet;
|
currentStyleSheetsMap[stylesheet.href] = stylesheet;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add new
|
// Add new
|
||||||
tinymce.each(headerFragment.getAll('link'), function(stylesheet) {
|
tinymce.each(headerFragment.getAll('link'), function(stylesheet) {
|
||||||
var href = stylesheet.attr('href');
|
var href = stylesheet.attr('href');
|
||||||
|
|
||||||
if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') == 'stylesheet') {
|
if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') == 'stylesheet') {
|
||||||
dom.add(headElm, 'link', {
|
dom.add(headElm, 'link', {
|
||||||
rel: 'stylesheet',
|
rel: 'stylesheet',
|
||||||
text: 'text/css',
|
text: 'text/css',
|
||||||
href: href,
|
href: href,
|
||||||
'data-mce-fullpage': '1'
|
'data-mce-fullpage': '1'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
delete currentStyleSheetsMap[href];
|
delete currentStyleSheetsMap[href];
|
||||||
});
|
});
|
||||||
|
|
||||||
// Delete old
|
// Delete old
|
||||||
tinymce.each(currentStyleSheetsMap, function(stylesheet) {
|
tinymce.each(currentStyleSheetsMap, function(stylesheet) {
|
||||||
stylesheet.parentNode.removeChild(stylesheet);
|
stylesheet.parentNode.removeChild(stylesheet);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDefaultHeader() {
|
function getDefaultHeader() {
|
||||||
var header = '', value, styles = '';
|
var header = '', value, styles = '';
|
||||||
|
|
||||||
if (editor.getParam('fullpage_default_xml_pi')) {
|
if (editor.getParam('fullpage_default_xml_pi')) {
|
||||||
header += '<?xml version="1.0" encoding="' + editor.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
|
header += '<?xml version="1.0" encoding="' + editor.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
header += editor.getParam('fullpage_default_doctype', '<!DOCTYPE html>');
|
header += editor.getParam('fullpage_default_doctype', '<!DOCTYPE html>');
|
||||||
header += '\n<html>\n<head>\n';
|
header += '\n<html>\n<head>\n';
|
||||||
|
|
||||||
if ((value = editor.getParam('fullpage_default_title'))) {
|
if ((value = editor.getParam('fullpage_default_title'))) {
|
||||||
header += '<title>' + value + '</title>\n';
|
header += '<title>' + value + '</title>\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((value = editor.getParam('fullpage_default_encoding'))) {
|
if ((value = editor.getParam('fullpage_default_encoding'))) {
|
||||||
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
|
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((value = editor.getParam('fullpage_default_font_family'))) {
|
if ((value = editor.getParam('fullpage_default_font_family'))) {
|
||||||
styles += 'font-family: ' + value + ';';
|
styles += 'font-family: ' + value + ';';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((value = editor.getParam('fullpage_default_font_size'))) {
|
if ((value = editor.getParam('fullpage_default_font_size'))) {
|
||||||
styles += 'font-size: ' + value + ';';
|
styles += 'font-size: ' + value + ';';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((value = editor.getParam('fullpage_default_text_color'))) {
|
if ((value = editor.getParam('fullpage_default_text_color'))) {
|
||||||
styles += 'color: ' + value + ';';
|
styles += 'color: ' + value + ';';
|
||||||
}
|
}
|
||||||
|
|
||||||
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
|
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
|
||||||
|
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContent(evt) {
|
function getContent(evt) {
|
||||||
if (!evt.selection && (!evt.source_view || !editor.getParam('fullpage_hide_in_source_view'))) {
|
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);
|
evt.content = tinymce.trim(head) + '\n' + tinymce.trim(evt.content) + '\n' + tinymce.trim(foot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.addCommand('mceFullPageProperties', showDialog);
|
editor.addCommand('mceFullPageProperties', showDialog);
|
||||||
|
|
||||||
editor.addButton('fullpage', {
|
editor.addButton('fullpage', {
|
||||||
title: 'Document properties',
|
title: 'Document properties',
|
||||||
cmd: 'mceFullPageProperties'
|
cmd: 'mceFullPageProperties'
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addMenuItem('fullpage', {
|
editor.addMenuItem('fullpage', {
|
||||||
text: 'Document properties',
|
text: 'Document properties',
|
||||||
cmd: 'mceFullPageProperties',
|
cmd: 'mceFullPageProperties',
|
||||||
context: 'file'
|
context: 'file'
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.on('BeforeSetContent', setContent);
|
editor.on('BeforeSetContent', setContent);
|
||||||
editor.on('GetContent', getContent);
|
editor.on('GetContent', getContent);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,136 +1,136 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('fullscreen', function(editor) {
|
tinymce.PluginManager.add('fullscreen', function(editor) {
|
||||||
var fullscreenState = false, DOM = tinymce.DOM, iframeWidth, iframeHeight, resizeHandler;
|
var fullscreenState = false, DOM = tinymce.DOM, iframeWidth, iframeHeight, resizeHandler;
|
||||||
var containerWidth, containerHeight;
|
var containerWidth, containerHeight;
|
||||||
|
|
||||||
if (editor.settings.inline) {
|
if (editor.settings.inline) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWindowSize() {
|
function getWindowSize() {
|
||||||
var w, h, win = window, doc = document;
|
var w, h, win = window, doc = document;
|
||||||
var body = doc.body;
|
var body = doc.body;
|
||||||
|
|
||||||
// Old IE
|
// Old IE
|
||||||
if (body.offsetWidth) {
|
if (body.offsetWidth) {
|
||||||
w = body.offsetWidth;
|
w = body.offsetWidth;
|
||||||
h = body.offsetHeight;
|
h = body.offsetHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modern browsers
|
// Modern browsers
|
||||||
if (win.innerWidth && win.innerHeight) {
|
if (win.innerWidth && win.innerHeight) {
|
||||||
w = win.innerWidth;
|
w = win.innerWidth;
|
||||||
h = win.innerHeight;
|
h = win.innerHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {w: w, h: h};
|
return {w: w, h: h};
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleFullscreen() {
|
function toggleFullscreen() {
|
||||||
var body = document.body, documentElement = document.documentElement, editorContainerStyle;
|
var body = document.body, documentElement = document.documentElement, editorContainerStyle;
|
||||||
var editorContainer, iframe, iframeStyle;
|
var editorContainer, iframe, iframeStyle;
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
|
DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
fullscreenState = !fullscreenState;
|
fullscreenState = !fullscreenState;
|
||||||
|
|
||||||
editorContainer = editor.getContainer();
|
editorContainer = editor.getContainer();
|
||||||
editorContainerStyle = editorContainer.style;
|
editorContainerStyle = editorContainer.style;
|
||||||
iframe = editor.getContentAreaContainer().firstChild;
|
iframe = editor.getContentAreaContainer().firstChild;
|
||||||
iframeStyle = iframe.style;
|
iframeStyle = iframe.style;
|
||||||
|
|
||||||
if (fullscreenState) {
|
if (fullscreenState) {
|
||||||
iframeWidth = iframeStyle.width;
|
iframeWidth = iframeStyle.width;
|
||||||
iframeHeight = iframeStyle.height;
|
iframeHeight = iframeStyle.height;
|
||||||
iframeStyle.width = iframeStyle.height = '100%';
|
iframeStyle.width = iframeStyle.height = '100%';
|
||||||
containerWidth = editorContainerStyle.width;
|
containerWidth = editorContainerStyle.width;
|
||||||
containerHeight = editorContainerStyle.height;
|
containerHeight = editorContainerStyle.height;
|
||||||
editorContainerStyle.width = editorContainerStyle.height = '';
|
editorContainerStyle.width = editorContainerStyle.height = '';
|
||||||
|
|
||||||
DOM.addClass(body, 'mce-fullscreen');
|
DOM.addClass(body, 'mce-fullscreen');
|
||||||
DOM.addClass(documentElement, 'mce-fullscreen');
|
DOM.addClass(documentElement, 'mce-fullscreen');
|
||||||
DOM.addClass(editorContainer, 'mce-fullscreen');
|
DOM.addClass(editorContainer, 'mce-fullscreen');
|
||||||
|
|
||||||
DOM.bind(window, 'resize', resize);
|
DOM.bind(window, 'resize', resize);
|
||||||
resize();
|
resize();
|
||||||
resizeHandler = resize;
|
resizeHandler = resize;
|
||||||
} else {
|
} else {
|
||||||
iframeStyle.width = iframeWidth;
|
iframeStyle.width = iframeWidth;
|
||||||
iframeStyle.height = iframeHeight;
|
iframeStyle.height = iframeHeight;
|
||||||
|
|
||||||
if (containerWidth) {
|
if (containerWidth) {
|
||||||
editorContainerStyle.width = containerWidth;
|
editorContainerStyle.width = containerWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (containerHeight) {
|
if (containerHeight) {
|
||||||
editorContainerStyle.height = containerHeight;
|
editorContainerStyle.height = containerHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
DOM.removeClass(body, 'mce-fullscreen');
|
DOM.removeClass(body, 'mce-fullscreen');
|
||||||
DOM.removeClass(documentElement, 'mce-fullscreen');
|
DOM.removeClass(documentElement, 'mce-fullscreen');
|
||||||
DOM.removeClass(editorContainer, 'mce-fullscreen');
|
DOM.removeClass(editorContainer, 'mce-fullscreen');
|
||||||
DOM.unbind(window, 'resize', resizeHandler);
|
DOM.unbind(window, 'resize', resizeHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.fire('FullscreenStateChanged', {state: fullscreenState});
|
editor.fire('FullscreenStateChanged', {state: fullscreenState});
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.on('init', function() {
|
editor.on('init', function() {
|
||||||
editor.addShortcut('Meta+Alt+F', '', toggleFullscreen);
|
editor.addShortcut('Meta+Alt+F', '', toggleFullscreen);
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.on('remove', function() {
|
editor.on('remove', function() {
|
||||||
if (resizeHandler) {
|
if (resizeHandler) {
|
||||||
DOM.unbind(window, 'resize', resizeHandler);
|
DOM.unbind(window, 'resize', resizeHandler);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addCommand('mceFullScreen', toggleFullscreen);
|
editor.addCommand('mceFullScreen', toggleFullscreen);
|
||||||
|
|
||||||
editor.addMenuItem('fullscreen', {
|
editor.addMenuItem('fullscreen', {
|
||||||
text: 'Fullscreen',
|
text: 'Fullscreen',
|
||||||
shortcut: 'Meta+Alt+F',
|
shortcut: 'Meta+Alt+F',
|
||||||
selectable: true,
|
selectable: true,
|
||||||
onClick: toggleFullscreen,
|
onClick: toggleFullscreen,
|
||||||
onPostRender: function() {
|
onPostRender: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
editor.on('FullscreenStateChanged', function(e) {
|
editor.on('FullscreenStateChanged', function(e) {
|
||||||
self.active(e.state);
|
self.active(e.state);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
context: 'view'
|
context: 'view'
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addButton('fullscreen', {
|
editor.addButton('fullscreen', {
|
||||||
tooltip: 'Fullscreen',
|
tooltip: 'Fullscreen',
|
||||||
shortcut: 'Meta+Alt+F',
|
shortcut: 'Meta+Alt+F',
|
||||||
onClick: toggleFullscreen,
|
onClick: toggleFullscreen,
|
||||||
onPostRender: function() {
|
onPostRender: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
editor.on('FullscreenStateChanged', function(e) {
|
editor.on('FullscreenStateChanged', function(e) {
|
||||||
self.active(e.state);
|
self.active(e.state);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isFullscreen: function() {
|
isFullscreen: function() {
|
||||||
return fullscreenState;
|
return fullscreenState;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -1,30 +1,30 @@
|
|||||||
/**
|
/**
|
||||||
* plugin.js
|
* plugin.js
|
||||||
*
|
*
|
||||||
* Copyright, Moxiecode Systems AB
|
* Copyright, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://www.tinymce.com/license
|
* License: http://www.tinymce.com/license
|
||||||
* Contributing: http://www.tinymce.com/contributing
|
* Contributing: http://www.tinymce.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global tinymce:true */
|
/*global tinymce:true */
|
||||||
|
|
||||||
tinymce.PluginManager.add('hr', function(editor) {
|
tinymce.PluginManager.add('hr', function(editor) {
|
||||||
editor.addCommand('InsertHorizontalRule', function() {
|
editor.addCommand('InsertHorizontalRule', function() {
|
||||||
editor.execCommand('mceInsertContent', false, '<hr />');
|
editor.execCommand('mceInsertContent', false, '<hr />');
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addButton('hr', {
|
editor.addButton('hr', {
|
||||||
icon: 'hr',
|
icon: 'hr',
|
||||||
tooltip: 'Horizontal line',
|
tooltip: 'Horizontal line',
|
||||||
cmd: 'InsertHorizontalRule'
|
cmd: 'InsertHorizontalRule'
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.addMenuItem('hr', {
|
editor.addMenuItem('hr', {
|
||||||
icon: 'hr',
|
icon: 'hr',
|
||||||
text: 'Horizontal line',
|
text: 'Horizontal line',
|
||||||
cmd: 'InsertHorizontalRule',
|
cmd: 'InsertHorizontalRule',
|
||||||
context: 'insert'
|
context: 'insert'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user