mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Compare commits
74 Commits
feature/te
...
feature/as
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8aa84ef048 | ||
|
|
41bd9ce9bc | ||
|
|
e346170f24 | ||
|
|
430c3de460 | ||
|
|
f25758cc05 | ||
|
|
bb6a44634d | ||
|
|
8a08680a74 | ||
|
|
25670b9620 | ||
|
|
fa09e2e83a | ||
|
|
a9a1413331 | ||
|
|
637cea6a02 | ||
|
|
cc82bfcca0 | ||
|
|
faa216147d | ||
|
|
cbf10216b0 | ||
|
|
bb560f9cdf | ||
|
|
bc2e0607ef | ||
|
|
cd5ca49b32 | ||
|
|
6da6c5c214 | ||
|
|
37a5a7effc | ||
|
|
baad84ee7b | ||
|
|
93476c321a | ||
|
|
ea91185816 | ||
|
|
c0ebbd4ce7 | ||
|
|
818b35a370 | ||
|
|
34947136d4 | ||
|
|
894d932210 | ||
|
|
8032d202e3 | ||
|
|
046c62e710 | ||
|
|
9001972d8b | ||
|
|
0fc8f5accf | ||
|
|
2a34cb582b | ||
|
|
7411013b45 | ||
|
|
0e7f864d4d | ||
|
|
14cdf57bc5 | ||
|
|
41e9fda2de | ||
|
|
e6211dbf54 | ||
|
|
1664aa1bde | ||
|
|
1b54e3e8fb | ||
|
|
5d09053d30 | ||
|
|
1494aec836 | ||
|
|
e964d80f7e | ||
|
|
1e62b2b9f8 | ||
|
|
1732c333c2 | ||
|
|
a01d219607 | ||
|
|
36910e8659 | ||
|
|
230314d7a1 | ||
|
|
7282df4326 | ||
|
|
81034f43d2 | ||
|
|
ddaf49db4a | ||
|
|
3d3d6205b6 | ||
|
|
e72d226263 | ||
|
|
4da838a3c3 | ||
|
|
d63119b1e6 | ||
|
|
6bc98bede6 | ||
|
|
99e05c8a09 | ||
|
|
3e1087ff58 | ||
|
|
43315c349f | ||
|
|
e74b6ad6f8 | ||
|
|
6fe3cf8538 | ||
|
|
db6c25aba2 | ||
|
|
938fd5b827 | ||
|
|
b100634587 | ||
|
|
a071f21f4e | ||
|
|
eed1a9a063 | ||
|
|
0faaa22546 | ||
|
|
0f6fa5844b | ||
|
|
d805c7773d | ||
|
|
18c5b5dfff | ||
|
|
7bbad86eb4 | ||
|
|
0f48019321 | ||
|
|
51a364a184 | ||
|
|
24ee246a34 | ||
|
|
9966e13fa3 | ||
|
|
29042d10f2 |
3
.deployment
Normal file
3
.deployment
Normal file
@@ -0,0 +1,3 @@
|
||||
[config]
|
||||
command = deploy.cmd
|
||||
SCM_COMMAND_IDLE_TIMEOUT = 3600
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -172,6 +172,7 @@ profiling/
|
||||
src/Orchard.Web/Modules-temp/*
|
||||
src/Backup/*
|
||||
src/packages/*
|
||||
src/node_modules
|
||||
src/UpgradeLog.*
|
||||
*.itrace.csdef
|
||||
*.build.csdef
|
||||
@@ -183,9 +184,6 @@ src/Orchard.Web/Orchard.Web.Publish.xml
|
||||
src/TestResults/*
|
||||
src/Orchard.Web/Properties/PublishProfiles
|
||||
src/Orchard.Azure/Orchard.Azure.CloudService/Staging/
|
||||
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/node_modules
|
||||
src/Orchard.Web/Modules/Orchard.Layouts/node_modules
|
||||
src/Orchard.Web/Modules/Orchard.DynamicForms/node_modules
|
||||
|
||||
#enable all /lib artifacts
|
||||
!lib/*/*.*
|
||||
|
||||
@@ -16,8 +16,8 @@ Our mission is to empower our users and foster a dedicated and diverse community
|
||||
There are many ways you can [contribute to Orchard](http://orchardproject.net/contribution): you can [fix bugs](https://github.com/OrchardCMS/Orchard/issues), contribute modules and themes to [our gallery](http://gallery.orchardproject.net/), [write documentation](https://github.com/OrchardCMS/OrchardDoc), [translate Orchard](http://orchardproject.net/localize), or answer questions [on our forums](http://orchard.codeplex.com/discussions) and [on Stack Overflow](http://stackoverflow.com/questions/tagged/orchardcms).
|
||||
|
||||
## Project Status
|
||||
Orchard is currently in version 1.8.1. We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach.
|
||||
Our 1.8.1 release is available from our Downloads page, and is easy to [Install Orchard using the Web Platform Installer](http://www.orchardproject.net/docs/Installing-Orchard.ashx). We encourage interested developers to check out the source code on the Orchard Github site and get involved with the project.
|
||||
Orchard is currently in version 1.9.1. We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach.
|
||||
Our 1.9.1 release is available from our Downloads page, and is easy to [Install Orchard using the Web Platform Installer](http://www.orchardproject.net/docs/Installing-Orchard.ashx). We encourage interested developers to check out the source code on the Orchard Github site and get involved with the project.
|
||||
|
||||
* [Download the latest release](https://github.com/OrchardCMS/Orchard/releases)
|
||||
* [Feature roadmap](http://www.orchardproject.net/docs/feature-roadmap.ashx)
|
||||
|
||||
114
deploy.cmd
Normal file
114
deploy.cmd
Normal file
@@ -0,0 +1,114 @@
|
||||
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
|
||||
|
||||
:: ----------------------
|
||||
:: KUDU Deployment Script
|
||||
:: Version: 0.1.11
|
||||
:: ----------------------
|
||||
|
||||
:: Prerequisites
|
||||
:: -------------
|
||||
|
||||
:: Verify node.js installed
|
||||
where node 2>nul >nul
|
||||
IF %ERRORLEVEL% NEQ 0 (
|
||||
echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
|
||||
goto error
|
||||
)
|
||||
|
||||
:: Setup
|
||||
:: -----
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
SET ARTIFACTS=%~dp0%..\artifacts
|
||||
|
||||
IF NOT DEFINED DEPLOYMENT_SOURCE (
|
||||
SET DEPLOYMENT_SOURCE=%~dp0%.
|
||||
)
|
||||
|
||||
IF NOT DEFINED DEPLOYMENT_TARGET (
|
||||
SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
|
||||
)
|
||||
|
||||
IF NOT DEFINED NEXT_MANIFEST_PATH (
|
||||
SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest
|
||||
|
||||
IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
|
||||
SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
|
||||
)
|
||||
)
|
||||
|
||||
IF NOT DEFINED KUDU_SYNC_CMD (
|
||||
:: Install kudu sync
|
||||
echo Installing Kudu Sync
|
||||
call npm install kudusync -g --silent
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
:: Locally just running "kuduSync" would also work
|
||||
SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
|
||||
)
|
||||
IF NOT DEFINED DEPLOYMENT_TEMP (
|
||||
SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
|
||||
SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
|
||||
)
|
||||
|
||||
IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
|
||||
IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
|
||||
mkdir "%DEPLOYMENT_TEMP%"
|
||||
)
|
||||
|
||||
IF NOT DEFINED MSBUILD_PATH (
|
||||
SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
|
||||
)
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Deployment
|
||||
:: ----------
|
||||
|
||||
echo Handling .NET Web Application deployment.
|
||||
|
||||
:: 1. Restore NuGet packages
|
||||
IF /I "" NEQ "" (
|
||||
call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
)
|
||||
|
||||
:: 2. Build to the temporary path
|
||||
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /t:Precompiled /v:m
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
:: 3. KuduSync
|
||||
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%\build\Precompiled" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:: Post deployment stub
|
||||
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
goto end
|
||||
|
||||
:: Execute command routine that will echo out when error
|
||||
:ExecuteCmd
|
||||
setlocal
|
||||
set _CMD_=%*
|
||||
call %_CMD_%
|
||||
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:error
|
||||
endlocal
|
||||
echo An error has occurred during web site deployment.
|
||||
call :exitSetErrorLevel
|
||||
call :exitFromFunction 2>nul
|
||||
|
||||
:exitSetErrorLevel
|
||||
exit /b 1
|
||||
|
||||
:exitFromFunction
|
||||
()
|
||||
|
||||
:end
|
||||
endlocal
|
||||
echo Finished successfully.
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
165
src/Gulpfile.js
Normal file
165
src/Gulpfile.js
Normal file
@@ -0,0 +1,165 @@
|
||||
var glob = require("glob"),
|
||||
path = require("path-posix"),
|
||||
merge = require("merge-stream"),
|
||||
gulpif = require("gulp-if"),
|
||||
gulp = require("gulp"),
|
||||
newer = require("gulp-newer"),
|
||||
plumber = require("gulp-plumber"),
|
||||
sourcemaps = require("gulp-sourcemaps"),
|
||||
less = require("gulp-less"),
|
||||
autoprefixer = require("gulp-autoprefixer"),
|
||||
minify = require("gulp-minify-css"),
|
||||
typescript = require("gulp-typescript"),
|
||||
uglify = require("gulp-uglify"),
|
||||
rename = require("gulp-rename"),
|
||||
concat = require("gulp-concat"),
|
||||
header = require("gulp-header")
|
||||
|
||||
/*
|
||||
** GULP TASKS
|
||||
*/
|
||||
|
||||
// Incremental build (each asset group is built only if one or more inputs are newer than the output).
|
||||
gulp.task("build", function () {
|
||||
var assetGroupTasks = getAssetGroups().map(function (assetGroup) {
|
||||
var doRebuild = false;
|
||||
return createAssetGroupTask(assetGroup, doRebuild);
|
||||
});
|
||||
return merge(assetGroupTasks);
|
||||
});
|
||||
|
||||
// Full rebuild (all assets groups are built regardless of timestamps).
|
||||
gulp.task("rebuild", function () {
|
||||
var assetGroupTasks = getAssetGroups().map(function (assetGroup) {
|
||||
var doRebuild = true;
|
||||
return createAssetGroupTask(assetGroup, doRebuild);
|
||||
});
|
||||
return merge(assetGroupTasks);
|
||||
});
|
||||
|
||||
// Continuous watch (each asset group is built whenever one of its inputs changes).
|
||||
gulp.task("watch", function () {
|
||||
getAssetGroups().forEach(function (assetGroup) {
|
||||
gulp.watch(assetGroup.inputPaths, function (event) {
|
||||
console.log("Asset file '" + event.path + "' was " + event.type + ", rebuilding output '" + assetGroup.outputPath + "'.");
|
||||
var task = createAssetGroupTask(assetGroup);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
** ASSET GROUPS
|
||||
*/
|
||||
|
||||
function getAssetGroups() {
|
||||
var assetManifestPaths = glob.sync("Orchard.Web/{Core,Modules,Themes}/*/Assets.json");
|
||||
var assetGroups = [];
|
||||
assetManifestPaths.forEach(function (assetManifestPath) {
|
||||
var assetManifest = require("./" + assetManifestPath);
|
||||
assetManifest.forEach(function (assetGroup) {
|
||||
resolveAssetGroupPaths(assetGroup, assetManifestPath);
|
||||
assetGroups.push(assetGroup);
|
||||
});
|
||||
});
|
||||
return assetGroups;
|
||||
}
|
||||
|
||||
function resolveAssetGroupPaths(assetGroup, assetManifestPath) {
|
||||
assetGroup.basePath = path.dirname(assetManifestPath);
|
||||
assetGroup.inputPaths = assetGroup.inputs.map(function (inputPath) {
|
||||
return path.join(assetGroup.basePath, inputPath);
|
||||
});
|
||||
assetGroup.outputPath = path.join(assetGroup.basePath, assetGroup.output);
|
||||
assetGroup.outputDir = path.dirname(assetGroup.outputPath);
|
||||
assetGroup.outputFileName = path.basename(assetGroup.output);
|
||||
}
|
||||
|
||||
function createAssetGroupTask(assetGroup, doRebuild) {
|
||||
var outputExt = path.extname(assetGroup.output).toLowerCase();
|
||||
switch (outputExt) {
|
||||
case ".css":
|
||||
return buildCssPipeline(assetGroup, doRebuild);
|
||||
case ".js":
|
||||
return buildJsPipeline(assetGroup, doRebuild);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** PROCESSING PIPELINES
|
||||
*/
|
||||
|
||||
function buildCssPipeline(assetGroup, doRebuild) {
|
||||
assetGroup.inputPaths.forEach(function (inputPath) {
|
||||
var ext = path.extname(inputPath).toLowerCase();
|
||||
if (ext !== ".less" && ext !== ".css")
|
||||
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
||||
});
|
||||
var doConcat = path.basename(assetGroup.outputFileName, ".css") !== "@";
|
||||
return gulp.src(assetGroup.inputPaths)
|
||||
.pipe(gulpif(!doRebuild,
|
||||
gulpif(doConcat,
|
||||
newer(assetGroup.outputPath),
|
||||
newer({
|
||||
dest: assetGroup.outputDir,
|
||||
ext: ".css"
|
||||
}))))
|
||||
.pipe(plumber())
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(gulpif("*.less", less()))
|
||||
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
|
||||
.pipe(autoprefixer({ browsers: ["last 2 versions"] }))
|
||||
// TODO: Start using below whenever gulp-header supports sourcemaps.
|
||||
//.pipe(header(
|
||||
// "/*\n" +
|
||||
// "** NOTE: This file is generated by Gulp compilation and should not be edited directly!\n" +
|
||||
// "** Any changes made directly to this file will be overwritten next time the Gulp compilation runs.\n" +
|
||||
// "** For more information, see the Readme.txt file in the Gulp solution folder.\n" +
|
||||
// "*/\n\n"))
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest(assetGroup.outputDir))
|
||||
.pipe(minify())
|
||||
.pipe(rename({
|
||||
suffix: ".min"
|
||||
}))
|
||||
.pipe(gulp.dest(assetGroup.outputDir));
|
||||
}
|
||||
|
||||
function buildJsPipeline(assetGroup, doRebuild) {
|
||||
assetGroup.inputPaths.forEach(function (inputPath) {
|
||||
var ext = path.extname(inputPath).toLowerCase();
|
||||
if (ext !== ".ts" && ext !== ".js")
|
||||
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
||||
});
|
||||
var doConcat = path.basename(assetGroup.outputFileName, ".js") !== "@";
|
||||
return gulp.src(assetGroup.inputPaths)
|
||||
.pipe(gulpif(!doRebuild,
|
||||
gulpif(doConcat,
|
||||
newer(assetGroup.outputPath),
|
||||
newer({
|
||||
dest: assetGroup.outputDir,
|
||||
ext: ".js"
|
||||
}))))
|
||||
.pipe(plumber())
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(gulpif("*.ts", typescript({
|
||||
declaration: false,
|
||||
//noImplicitAny: true,
|
||||
noEmitOnError: true,
|
||||
sortOutput: true,
|
||||
}).js))
|
||||
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
|
||||
// TODO: Start using below whenever gulp-header supports sourcemaps.
|
||||
//.pipe(header(
|
||||
// "/*\n" +
|
||||
// "** NOTE: This file is generated by Gulp compilation and should not be edited directly!\n" +
|
||||
// "** Any changes made directly to this file will be overwritten next time the Gulp compilation runs.\n" +
|
||||
// "** For more information, see the Readme.txt file in the Gulp solution folder.\n" +
|
||||
// "*/\n\n"))
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest(assetGroup.outputDir))
|
||||
.pipe(uglify())
|
||||
.pipe(rename({
|
||||
suffix: ".min"
|
||||
}))
|
||||
.pipe(gulp.dest(assetGroup.outputDir));
|
||||
}
|
||||
@@ -147,7 +147,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.0.0"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
|
||||
|
||||
@@ -20,6 +20,7 @@ using Orchard.DisplayManagement.Implementation;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Security;
|
||||
using Orchard.Tests.ContentManagement;
|
||||
using Orchard.Tests.Modules;
|
||||
using Orchard.Tests.Stubs;
|
||||
using Orchard.UI.Notify;
|
||||
@@ -35,7 +36,6 @@ namespace Orchard.Core.Tests.Body {
|
||||
builder.RegisterType<Signals>().As<ISignals>();
|
||||
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
|
||||
builder.RegisterInstance(new Mock<IContentDefinitionManager>().Object);
|
||||
builder.RegisterInstance(new Mock<ITransactionManager>().Object);
|
||||
builder.RegisterInstance(new Mock<IAuthorizer>().Object);
|
||||
builder.RegisterInstance(new Mock<INotifier>().Object);
|
||||
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\lib\sqlce\System.Data.SqlServerCe.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace Orchard.Core.Tests.Scheduling {
|
||||
public override void Register(ContainerBuilder builder) {
|
||||
_handler = new StubTaskHandler();
|
||||
builder.RegisterInstance(new Mock<IOrchardServices>().Object);
|
||||
builder.RegisterInstance(new Mock<ITransactionManager>().Object);
|
||||
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
builder.RegisterType<Signals>().As<ISignals>();
|
||||
|
||||
@@ -13,6 +13,7 @@ using Orchard.Core.Settings.Metadata;
|
||||
using Orchard.Core.Settings.Metadata.Records;
|
||||
using Orchard.Data;
|
||||
using Orchard.Tests;
|
||||
using Orchard.Tests.ContentManagement;
|
||||
using Orchard.Tests.Stubs;
|
||||
using Orchard.Tests.Utility;
|
||||
|
||||
@@ -23,6 +24,7 @@ namespace Orchard.Core.Tests.Settings.Metadata {
|
||||
private ISessionFactory _sessionFactory;
|
||||
private ISession _session;
|
||||
private IContainer _container;
|
||||
private ITransactionManager _transactionManager;
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void InitFixture() {
|
||||
@@ -39,6 +41,17 @@ namespace Orchard.Core.Tests.Settings.Metadata {
|
||||
|
||||
[SetUp]
|
||||
public void Init() {
|
||||
_session = _sessionFactory.OpenSession();
|
||||
foreach (var killType in new[] { typeof(ContentTypeDefinitionRecord), typeof(ContentPartDefinitionRecord), typeof(ContentFieldDefinitionRecord) }) {
|
||||
foreach (var killRecord in _session.CreateCriteria(killType).List()) {
|
||||
_session.Delete(killRecord);
|
||||
}
|
||||
}
|
||||
_session.Flush();
|
||||
_session.Close();
|
||||
_session.Dispose();
|
||||
_session = _sessionFactory.OpenSession();
|
||||
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterAutoMocking();
|
||||
builder.RegisterType<ContentDefinitionManager>().As<IContentDefinitionManager>();
|
||||
@@ -48,25 +61,15 @@ namespace Orchard.Core.Tests.Settings.Metadata {
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
builder.RegisterType<StubParallelCacheContext>().As<IParallelCacheContext>();
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(_transactionManager = new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
|
||||
_container = builder.Build();
|
||||
|
||||
_container.Mock<ISessionLocator>()
|
||||
.Setup(x => x.For(It.IsAny<Type>()))
|
||||
.Returns(() => _session);
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
foreach (var killType in new[] { typeof(ContentTypeDefinitionRecord), typeof(ContentPartDefinitionRecord), typeof(ContentFieldDefinitionRecord) }) {
|
||||
foreach (var killRecord in _session.CreateCriteria(killType).List()) {
|
||||
_session.Delete(killRecord);
|
||||
}
|
||||
}
|
||||
_session.Flush();
|
||||
}
|
||||
|
||||
void ResetSession() {
|
||||
_session.Flush();
|
||||
_session.Dispose();
|
||||
_session = _sessionFactory.OpenSession();
|
||||
_transactionManager.RequireNew();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
|
||||
@@ -93,13 +93,14 @@ namespace Orchard.Specs.Bindings {
|
||||
_webHost = new WebHost(_orchardTemp);
|
||||
Host.Initialize(siteFolder, virtualDirectory ?? "/", _dynamicCompilationOption);
|
||||
var shuttle = new Shuttle();
|
||||
Host.Execute(() => {
|
||||
log4net.Config.BasicConfigurator.Configure(new CastleAppender());
|
||||
HostingTraceListener.SetHook(msg => shuttle._sink.Receive(msg));
|
||||
});
|
||||
Host.Execute(() => Executor(shuttle));
|
||||
_messages = shuttle._sink;
|
||||
}
|
||||
|
||||
private static void Executor(Shuttle shuttle) {
|
||||
HostingTraceListener.SetHook(msg => shuttle._sink.Receive(msg));
|
||||
}
|
||||
|
||||
private class CastleAppender : IAppender {
|
||||
public void Close() { }
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Orchard.Specs.Hosting {
|
||||
TargetInstance = Activator.CreateInstance(classType);
|
||||
|
||||
foreach (FieldInfo field in classType.GetFields()) {
|
||||
if (typeof (Delegate).IsAssignableFrom(field.FieldType))
|
||||
if (typeof (TDelegate).IsAssignableFrom(field.FieldType))
|
||||
//If the field is a delegate
|
||||
field.SetValue(TargetInstance, ((SerializableDelegate<TDelegate>)info.GetValue(field.Name, typeof(SerializableDelegate<TDelegate>))).Delegate);
|
||||
else if (!field.FieldType.IsSerializable)
|
||||
@@ -86,8 +86,12 @@ namespace Orchard.Specs.Hosting {
|
||||
|
||||
foreach (FieldInfo field in targetType.GetFields()) {
|
||||
//See corresponding comments above
|
||||
if (typeof (Delegate).IsAssignableFrom(field.FieldType))
|
||||
info.AddValue(field.Name, new SerializableDelegate<TDelegate>((TDelegate)field.GetValue(TargetInstance)));
|
||||
if (typeof (TDelegate).IsAssignableFrom(field.FieldType)) {
|
||||
var value = (TDelegate)field.GetValue(TargetInstance);
|
||||
if (value != null) {
|
||||
info.AddValue(field.Name, new SerializableDelegate<TDelegate>(value));
|
||||
}
|
||||
}
|
||||
else if (!field.FieldType.IsSerializable)
|
||||
info.AddValue(field.Name, new AnonymousClassWrapper(field.FieldType, field.GetValue(TargetInstance)));
|
||||
else
|
||||
|
||||
@@ -51,7 +51,6 @@ namespace Orchard.Tests.Modules.Comments.Services {
|
||||
builder.RegisterType<Signals>().As<ISignals>();
|
||||
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
|
||||
builder.RegisterInstance(new Mock<IContentDefinitionManager>().Object);
|
||||
builder.RegisterInstance(new Mock<ITransactionManager>().Object);
|
||||
builder.RegisterInstance(new Mock<IAuthorizer>().Object);
|
||||
builder.RegisterInstance(new Mock<INotifier>().Object);
|
||||
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
|
||||
|
||||
@@ -12,6 +12,7 @@ using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Data;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.Services;
|
||||
using Orchard.Tests.ContentManagement;
|
||||
using Orchard.Tests.Data;
|
||||
using Orchard.Tests.Stubs;
|
||||
|
||||
@@ -52,6 +53,7 @@ namespace Orchard.Tests.Modules {
|
||||
builder.RegisterInstance(_clock).As<IClock>();
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" });
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
Register(builder);
|
||||
_container = builder.Build();
|
||||
|
||||
@@ -61,11 +63,6 @@ namespace Orchard.Tests.Modules {
|
||||
public void Cleanup() {
|
||||
if(_container != null)
|
||||
_container.Dispose();
|
||||
|
||||
_transaction.Commit();
|
||||
|
||||
if(_session != null)
|
||||
_session.Close();
|
||||
}
|
||||
|
||||
public abstract void Register(ContainerBuilder builder);
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Orchard.Tests.Modules.ImportExport.Services {
|
||||
builder.RegisterInstance(new Mock<ISettingsFormatter>().Object);
|
||||
builder.RegisterInstance(new Mock<IRecipeExecuteEventHandler>().Object);
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
|
||||
_container = builder.Build();
|
||||
_importExportService = _container.Resolve<IImportExportService>();
|
||||
|
||||
@@ -75,7 +75,6 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
|
||||
|
||||
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
|
||||
builder.RegisterInstance(new Mock<ITransactionManager>().Object);
|
||||
builder.RegisterInstance(new Mock<IAuthorizer>().Object);
|
||||
builder.RegisterType<OrchardServices>().As<IOrchardServices>();
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Orchard.Tests.Modules.Migrations {
|
||||
builder.RegisterType<StubHostEnvironment>().As<IHostEnvironment>();
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
|
||||
builder.RegisterInstance(new ShellBlueprint());
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ namespace Orchard.Tests.Modules.Users.Controllers {
|
||||
builder.RegisterType<UserPartHandler>().As<IContentHandler>();
|
||||
builder.RegisterType<OrchardServices>().As<IOrchardServices>();
|
||||
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ITransactionManager>();
|
||||
builder.RegisterInstance(new Work<IEnumerable<IShapeTableEventHandler>>(resolve => _container.Resolve<IEnumerable<IShapeTableEventHandler>>())).AsSelf();
|
||||
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
|
||||
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();
|
||||
|
||||
@@ -30,6 +30,7 @@ using Orchard.UI.PageClass;
|
||||
using Orchard.Users.Handlers;
|
||||
using Orchard.Users.Models;
|
||||
using Orchard.Users.Services;
|
||||
using Orchard.Tests.ContentManagement;
|
||||
|
||||
namespace Orchard.Tests.Modules.Users.Services {
|
||||
[TestFixture]
|
||||
@@ -39,19 +40,6 @@ namespace Orchard.Tests.Modules.Users.Services {
|
||||
private ISession _session;
|
||||
private IContainer _container;
|
||||
|
||||
|
||||
public class TestSessionLocator : ISessionLocator {
|
||||
private readonly ISession _session;
|
||||
|
||||
public TestSessionLocator(ISession session) {
|
||||
_session = session;
|
||||
}
|
||||
|
||||
public ISession For(Type entityType) {
|
||||
return _session;
|
||||
}
|
||||
}
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void InitFixture() {
|
||||
var databaseFileName = System.IO.Path.GetTempFileName();
|
||||
@@ -94,11 +82,18 @@ namespace Orchard.Tests.Modules.Users.Services {
|
||||
builder.RegisterType<InfosetHandler>().As<IContentHandler>();
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
|
||||
_container = builder.Build();
|
||||
_membershipService = _container.Resolve<IMembershipService>();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Cleanup() {
|
||||
if (_container != null)
|
||||
_container.Dispose();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CreateUserShouldAllocateModelAndCreateRecords() {
|
||||
var user = _membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true));
|
||||
|
||||
@@ -34,6 +34,7 @@ using Orchard.Users.Services;
|
||||
using Orchard.Services;
|
||||
using Orchard.Tests.Messaging;
|
||||
using Orchard.Tests.Modules.Stubs;
|
||||
using Orchard.Tests.ContentManagement;
|
||||
|
||||
namespace Orchard.Tests.Modules.Users.Services {
|
||||
[TestFixture]
|
||||
@@ -47,19 +48,6 @@ namespace Orchard.Tests.Modules.Users.Services {
|
||||
private IContainer _container;
|
||||
private CultureInfo _currentCulture;
|
||||
|
||||
|
||||
public class TestSessionLocator : ISessionLocator {
|
||||
private readonly ISession _session;
|
||||
|
||||
public TestSessionLocator(ISession session) {
|
||||
_session = session;
|
||||
}
|
||||
|
||||
public ISession For(Type entityType) {
|
||||
return _session;
|
||||
}
|
||||
}
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void InitFixture() {
|
||||
_currentCulture = Thread.CurrentThread.CurrentCulture;
|
||||
@@ -109,9 +97,8 @@ namespace Orchard.Tests.Modules.Users.Services {
|
||||
builder.RegisterInstance(ShellSettingsUtility.CreateEncryptionEnabled());
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
_session.BeginTransaction();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
|
||||
builder.RegisterInstance(new TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
_container = builder.Build();
|
||||
_membershipService = _container.Resolve<IMembershipService>();
|
||||
_userService = _container.Resolve<IUserService>();
|
||||
@@ -119,8 +106,8 @@ namespace Orchard.Tests.Modules.Users.Services {
|
||||
|
||||
[TearDown]
|
||||
public void TearDown() {
|
||||
_session.Transaction.Commit();
|
||||
_session.Transaction.Dispose();
|
||||
if (_container != null)
|
||||
_container.Dispose();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -93,7 +93,6 @@ namespace Orchard.Tests.Modules.Widgets.Services {
|
||||
builder.RegisterType<Signals>().As<ISignals>();
|
||||
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
|
||||
builder.RegisterInstance(new Mock<IContentDefinitionManager>().Object);
|
||||
builder.RegisterInstance(new Mock<ITransactionManager>().Object);
|
||||
builder.RegisterInstance(new Mock<IAuthorizer>().Object);
|
||||
builder.RegisterInstance(new Mock<INotifier>().Object);
|
||||
builder.RegisterInstance(mockFeatureManager.Object);
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
private IContentManager _manager;
|
||||
private ISessionFactory _sessionFactory;
|
||||
private ISession _session;
|
||||
private ITransactionManager _transactionManager;
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void InitFixture() {
|
||||
@@ -74,7 +75,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
builder.RegisterType<DefaultContentDisplay>().As<IContentDisplay>();
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.RegisterInstance(_transactionManager = new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
|
||||
_session.Delete(string.Format("from {0}", typeof(GammaRecord).FullName));
|
||||
_session.Delete(string.Format("from {0}", typeof(DeltaRecord).FullName));
|
||||
@@ -82,14 +83,19 @@ namespace Orchard.Tests.ContentManagement {
|
||||
_session.Delete(string.Format("from {0}", typeof(ContentItemVersionRecord).FullName));
|
||||
_session.Delete(string.Format("from {0}", typeof(ContentItemRecord).FullName));
|
||||
_session.Delete(string.Format("from {0}", typeof(ContentTypeRecord).FullName));
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
_container = builder.Build();
|
||||
_manager = _container.Resolve<IContentManager>();
|
||||
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Cleanup() {
|
||||
if (_container != null)
|
||||
_container.Dispose();
|
||||
}
|
||||
|
||||
private List<IContent> AddSampleData() {
|
||||
var items = new List<IContent> {
|
||||
_manager.Create<AlphaPart>("alpha", init => { }),
|
||||
@@ -98,7 +104,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
_manager.Create<DeltaPart>("delta", init => { init.Record.Quux = "the quux value"; })
|
||||
};
|
||||
|
||||
_session.Flush();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
return items;
|
||||
}
|
||||
@@ -212,7 +218,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
var twoId = _manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "two"; }).ContentItem.Id;
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "three"; });
|
||||
var fourId = _manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "four"; }).ContentItem.Id;
|
||||
_session.Flush();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
|
||||
var two = _manager.Query()
|
||||
@@ -239,7 +245,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "two"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "three"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "four"; });
|
||||
_session.Flush();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
var twoOrFour = _manager.Query<GammaPart, GammaRecord>()
|
||||
.Where(x => x.Frap == "one" || x.Frap == "four")
|
||||
@@ -271,8 +277,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "two"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "three"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "four"; });
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
var ascending = _manager.Query("gamma")
|
||||
.OrderBy<GammaRecord>(x => x.Frap)
|
||||
@@ -282,7 +287,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
Assert.That(ascending.First().Record.Frap, Is.EqualTo("four"));
|
||||
Assert.That(ascending.Last().Record.Frap, Is.EqualTo("two"));
|
||||
|
||||
_session.Clear();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
var descending = _manager.Query<GammaPart, GammaRecord>()
|
||||
.OrderByDescending(x => x.Frap)
|
||||
@@ -300,7 +305,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "two"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "three"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "four"; });
|
||||
_session.Flush();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
var reverseById = _manager.Query()
|
||||
.OrderByDescending<GammaRecord>(x => x.Id)
|
||||
@@ -346,8 +351,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
init.Record.Frap = "four";
|
||||
init.As<EpsilonPart>().Record.Quad = "4";
|
||||
});
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
var results = _manager.Query<EpsilonPart, EpsilonRecord>()
|
||||
.Where(x => x.Quad == "2" || x.Quad == "3")
|
||||
@@ -365,21 +369,18 @@ namespace Orchard.Tests.ContentManagement {
|
||||
init.As<GammaPart>().Record.Frap = "one";
|
||||
init.As<EpsilonPart>().Record.Quad = "v1";
|
||||
});
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
var gamma2 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired);
|
||||
gamma2.As<GammaPart>().Record.Frap = "two";
|
||||
gamma2.As<EpsilonPart>().Record.Quad = "v2";
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
var gamma3 = _manager.Create<ContentItem>("gamma", init => {
|
||||
init.As<GammaPart>().Record.Frap = "three";
|
||||
init.As<EpsilonPart>().Record.Quad = "v3";
|
||||
});
|
||||
_session.Flush();
|
||||
_session.Clear();
|
||||
_transactionManager.RequireNew();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -562,7 +563,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "two"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "three"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "four"; });
|
||||
_session.Flush();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
var result = _manager.Query<GammaPart, GammaRecord>()
|
||||
.Where(x => x.Frap.StartsWith("t"))
|
||||
@@ -579,7 +580,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "two"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "three"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "four"; });
|
||||
_session.Flush();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
var result = _manager.Query<GammaPart, GammaRecord>()
|
||||
.Where(x => x.Frap.EndsWith("e"))
|
||||
@@ -596,7 +597,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "two"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "three"; });
|
||||
_manager.Create<GammaPart>("gamma", init => { init.Record.Frap = "four"; });
|
||||
_session.Flush();
|
||||
_transactionManager.RequireNew();
|
||||
|
||||
var result = _manager.Query<GammaPart, GammaRecord>()
|
||||
.Where(x => x.Frap.Contains("o"))
|
||||
|
||||
@@ -86,84 +86,16 @@ namespace Orchard.Tests.ContentManagement {
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
|
||||
_container = builder.Build();
|
||||
_manager = _container.Resolve<IContentManager>();
|
||||
}
|
||||
|
||||
public class TestSessionLocator : ISessionLocator, ITransactionManager, IDisposable {
|
||||
private readonly ISession _session;
|
||||
private ITransaction _transaction;
|
||||
private bool _cancelled;
|
||||
|
||||
public TestSessionLocator(ISession session) {
|
||||
_session = session;
|
||||
}
|
||||
|
||||
public ISession For(Type entityType) {
|
||||
return _session;
|
||||
}
|
||||
|
||||
void ITransactionManager.Demand() {
|
||||
EnsureSession();
|
||||
|
||||
if (_transaction == null) {
|
||||
_transaction = _session.BeginTransaction(IsolationLevel.ReadCommitted);
|
||||
}
|
||||
}
|
||||
|
||||
void ITransactionManager.RequireNew() {
|
||||
((ITransactionManager)this).RequireNew(IsolationLevel.ReadCommitted);
|
||||
}
|
||||
|
||||
void ITransactionManager.RequireNew(IsolationLevel level) {
|
||||
EnsureSession();
|
||||
|
||||
if (_cancelled) {
|
||||
_transaction.Rollback();
|
||||
_transaction.Dispose();
|
||||
_transaction = null;
|
||||
}
|
||||
else {
|
||||
if (_transaction != null) {
|
||||
_transaction.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
_transaction = _session.BeginTransaction(level);
|
||||
}
|
||||
|
||||
void ITransactionManager.Cancel() {
|
||||
_cancelled = true;
|
||||
}
|
||||
|
||||
void IDisposable.Dispose() {
|
||||
if (_transaction != null) {
|
||||
try {
|
||||
if (!_cancelled) {
|
||||
_transaction.Commit();
|
||||
}
|
||||
else {
|
||||
_transaction.Rollback();
|
||||
}
|
||||
|
||||
_transaction.Dispose();
|
||||
}
|
||||
catch {
|
||||
}
|
||||
finally {
|
||||
_transaction = null;
|
||||
_cancelled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void EnsureSession() {
|
||||
if (_session != null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
[TearDown]
|
||||
public void Cleanup() {
|
||||
if (_container != null)
|
||||
_container.Dispose();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
builder.RegisterType<DefaultContentDisplay>().As<IContentDisplay>();
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
|
||||
_session.Delete(string.Format("from {0}", typeof(GammaRecord).FullName));
|
||||
_session.Delete(string.Format("from {0}", typeof(DeltaRecord).FullName));
|
||||
@@ -88,6 +88,12 @@ namespace Orchard.Tests.ContentManagement {
|
||||
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Cleanup() {
|
||||
if (_container != null)
|
||||
_container.Dispose();
|
||||
}
|
||||
|
||||
private void AddSampleData() {
|
||||
_manager.Create<AlphaPart>("alpha", init => { });
|
||||
_manager.Create<BetaPart>("beta", init => { });
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
builder.RegisterType<DefaultContentDisplay>().As<IContentDisplay>();
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
|
||||
_session.Delete(string.Format("from {0}", typeof(GammaRecord).FullName));
|
||||
_session.Delete(string.Format("from {0}", typeof(DeltaRecord).FullName));
|
||||
@@ -97,6 +97,12 @@ namespace Orchard.Tests.ContentManagement {
|
||||
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Cleanup() {
|
||||
if (_container != null)
|
||||
_container.Dispose();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AllDataTypesCanBeQueried() {
|
||||
var dt = DateTime.Now;
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using NHibernate;
|
||||
using Orchard.Data;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement {
|
||||
public class TestTransactionManager : ITransactionManager, IDisposable {
|
||||
private ISession _session;
|
||||
private ITransaction _transaction;
|
||||
private bool _cancelled;
|
||||
|
||||
public TestTransactionManager(ISession session) {
|
||||
_session = session;
|
||||
RequireNew();
|
||||
}
|
||||
|
||||
public void Demand() {
|
||||
EnsureSession();
|
||||
}
|
||||
|
||||
public void RequireNew() {
|
||||
RequireNew(IsolationLevel.ReadCommitted);
|
||||
}
|
||||
|
||||
public void RequireNew(IsolationLevel level) {
|
||||
EnsureSession();
|
||||
|
||||
if (_cancelled) {
|
||||
_transaction.Rollback();
|
||||
_transaction.Dispose();
|
||||
_transaction = null;
|
||||
}
|
||||
else {
|
||||
if (_transaction != null) {
|
||||
_transaction.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
_transaction = _session.BeginTransaction(level);
|
||||
}
|
||||
|
||||
public void Cancel() {
|
||||
_cancelled = true;
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
if (_transaction != null) {
|
||||
try {
|
||||
if (!_cancelled) {
|
||||
_transaction.Commit();
|
||||
}
|
||||
else {
|
||||
_transaction.Rollback();
|
||||
}
|
||||
|
||||
_transaction.Dispose();
|
||||
}
|
||||
catch {
|
||||
}
|
||||
finally {
|
||||
_transaction = null;
|
||||
_cancelled = false;
|
||||
}
|
||||
}
|
||||
|
||||
_session.Close();
|
||||
_session.Dispose();
|
||||
_session = null;
|
||||
}
|
||||
|
||||
private void EnsureSession() {
|
||||
if (_session == null) {
|
||||
throw new ArgumentNullException("Session can't be null, ever");
|
||||
}
|
||||
}
|
||||
|
||||
public ISession GetSession() {
|
||||
EnsureSession();
|
||||
|
||||
return _session;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
using NHibernate;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Data;
|
||||
using Orchard.Tests.ContentManagement;
|
||||
using Orchard.Tests.Records;
|
||||
|
||||
namespace Orchard.Tests.Data {
|
||||
@@ -22,7 +23,7 @@ namespace Orchard.Tests.Data {
|
||||
_databaseFilePath = Path.GetTempFileName();
|
||||
_sessionFactory = DataUtility.CreateSessionFactory(_databaseFilePath, typeof(FooRecord));
|
||||
_session = _sessionFactory.OpenSession();
|
||||
_fooRepos = new Repository<FooRecord>(new StubLocator(_session));
|
||||
_fooRepos = new Repository<FooRecord>(new TestTransactionManager(_session));
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
|
||||
@@ -45,16 +45,22 @@ namespace Orchard.Tests.DataMigration {
|
||||
typeof(ContentTypeRecord));
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void InitDb() {
|
||||
foreach ( var record in _repository.Fetch(m => m != null) ) {
|
||||
_repository.Delete(record);
|
||||
}
|
||||
_repository.Flush();
|
||||
|
||||
_transactionManager.RequireNew();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void CleanUp() {
|
||||
if (_container != null)
|
||||
_container.Dispose();
|
||||
}
|
||||
|
||||
public void Init(IEnumerable<Type> dataMigrations) {
|
||||
|
||||
|
||||
var builder = new ContainerBuilder();
|
||||
_folders = new StubFolders();
|
||||
var contentDefinitionManager = new Mock<IContentDefinitionManager>().Object;
|
||||
@@ -73,7 +79,7 @@ namespace Orchard.Tests.DataMigration {
|
||||
builder.RegisterType<StubParallelCacheContext>().As<IParallelCacheContext>();
|
||||
builder.RegisterType<StubAsyncTokenProvider>().As<IAsyncTokenProvider>();
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>().As<ITransactionManager>();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
foreach(var type in dataMigrations) {
|
||||
builder.RegisterType(type).As<IDataMigration>();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Orchard.Tests.DataMigration {
|
||||
builder.RegisterType<SessionFactoryHolder>().As<ISessionFactoryHolder>();
|
||||
builder.RegisterType<DefaultDatabaseCacheConfiguration>().As<IDatabaseCacheConfiguration>();
|
||||
builder.RegisterType<StubHostEnvironment>().As<IHostEnvironment>();
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty<RecordBlueprint>() }).As<ShellBlueprint>();
|
||||
builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST" }).As<ShellSettings>();
|
||||
builder.RegisterModule(new DataModule());
|
||||
|
||||
@@ -11,6 +11,7 @@ using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Data;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.Services;
|
||||
using Orchard.Tests.ContentManagement;
|
||||
using Orchard.Tests.Data;
|
||||
using Orchard.Tests.Stubs;
|
||||
|
||||
@@ -48,7 +49,8 @@ namespace Orchard.Tests {
|
||||
builder.RegisterInstance(_clock).As<IClock>();
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" });
|
||||
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
|
||||
Register(builder);
|
||||
_container = builder.Build();
|
||||
}
|
||||
@@ -57,9 +59,6 @@ namespace Orchard.Tests {
|
||||
public void Cleanup() {
|
||||
if(_container != null)
|
||||
_container.Dispose();
|
||||
|
||||
if(_session != null)
|
||||
_session.Close();
|
||||
}
|
||||
|
||||
public abstract void Register(ContainerBuilder builder);
|
||||
|
||||
@@ -160,6 +160,38 @@ namespace Orchard.Tests.Environment.ShellBuilders {
|
||||
public class TestDependency : ITestDependency {
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ComponentsImplementingMultipleContractsAreResolvableOnce() {
|
||||
var settings = CreateSettings();
|
||||
var blueprint = CreateBlueprint(
|
||||
WithDependency<MultipleDependency>()
|
||||
);
|
||||
|
||||
var factory = _container.Resolve<IShellContainerFactory>();
|
||||
var shellContainer = factory.CreateContainer(settings, blueprint);
|
||||
|
||||
var multipleDependency1 = shellContainer.Resolve<IMultipleDependency1>();
|
||||
var multipleDependency2 = shellContainer.Resolve<IMultipleDependency2>();
|
||||
|
||||
Assert.That(multipleDependency1, Is.Not.Null);
|
||||
Assert.That(multipleDependency2, Is.Not.Null);
|
||||
|
||||
Assert.That(multipleDependency1, Is.InstanceOf<MultipleDependency>());
|
||||
Assert.That(multipleDependency2, Is.InstanceOf<MultipleDependency>());
|
||||
|
||||
Assert.True(multipleDependency1 == multipleDependency2);
|
||||
}
|
||||
|
||||
public interface IMultipleDependency1 : IDependency {
|
||||
|
||||
}
|
||||
public interface IMultipleDependency2 : IDependency {
|
||||
|
||||
}
|
||||
public class MultipleDependency : IMultipleDependency1, IMultipleDependency2 {
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ExtraInformationCanDropIntoProperties() {
|
||||
var settings = CreateSettings();
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace Orchard.Tests.Localization {
|
||||
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
|
||||
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();
|
||||
builder.RegisterInstance(new Mock<IContentDefinitionManager>().Object);
|
||||
builder.RegisterInstance(new Mock<ITransactionManager>().Object);
|
||||
builder.RegisterInstance(new Mock<IAuthorizer>().Object);
|
||||
builder.RegisterInstance(new Mock<INotifier>().Object);
|
||||
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
|
||||
@@ -60,7 +59,7 @@ namespace Orchard.Tests.Localization {
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
_container = builder.Build();
|
||||
_cultureManager = _container.Resolve<ICultureManager>();
|
||||
}
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Autofac;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Localization.Models;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Services;
|
||||
|
||||
namespace Orchard.Tests.Localization {
|
||||
|
||||
@@ -217,6 +209,17 @@ namespace Orchard.Tests.Localization {
|
||||
Assert.AreEqual(dateTimeLocal, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Description("DateTime which is DateTimeKind.Local is converted to DateTimeKind.Utc.")]
|
||||
public void ConvertFromLocalizedDateStringTest01() {
|
||||
var container = TestHelpers.InitializeContainer("en-US", "GregorianCalendar", TimeZoneInfo.Utc);
|
||||
var target = container.Resolve<IDateLocalizationServices>();
|
||||
var dateTimeLocal = new DateTime(1998, 1, 15);
|
||||
var dateTimeLocalString = target.ConvertToLocalizedDateString(dateTimeLocal);
|
||||
var result = target.ConvertFromLocalizedDateString(dateTimeLocalString);
|
||||
Assert.AreEqual(DateTimeKind.Utc, result.Value.Kind);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Description("Converting to Gregorian calendar yields a DateTimeParts instance equivalent to the original DateTime.")]
|
||||
public void ConvertToSiteCalendarTest01() {
|
||||
|
||||
@@ -208,6 +208,7 @@
|
||||
<Compile Include="ContentManagement\Records\GammaRecord.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ContentManagement\TestTransactionManager.cs" />
|
||||
<Compile Include="ContentManagement\XmlHelperTests.cs" />
|
||||
<Compile Include="DatabaseEnabledTestsBase.cs" />
|
||||
<Compile Include="DataMigration\SchemaBuilderTests.cs" />
|
||||
|
||||
@@ -87,6 +87,13 @@
|
||||
<Property Name="Disabled" Value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
|
||||
<Component Type="Orchard.Environment.Descriptor.ShellDescriptorCache">
|
||||
<Properties>
|
||||
<!-- Set Value="true" to disable shell descriptors cache (cache.dat). Recommended when using multiple instances. -->
|
||||
<Property Name="Disabled" Value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
|
||||
<Component Type="Orchard.Services.ClientAddressAccessor">
|
||||
<Properties>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<ul class="menu-items-zone">
|
||||
@foreach (var descriptor in Model.MenuItemDescriptors.OrderBy(x => x.DisplayName)) {
|
||||
<li>
|
||||
<div class="menu-item-description"><h2>@T(descriptor.DisplayName.CamelFriendly())</h2>
|
||||
<div class="menu-item-description"><h2>@T(descriptor.DisplayName)</h2>
|
||||
@if (!string.IsNullOrWhiteSpace(descriptor.Description)) {
|
||||
<span class="hint">@T(descriptor.Description)</span>
|
||||
}
|
||||
|
||||
@@ -456,10 +456,10 @@ namespace Orchard.Core.Shapes {
|
||||
|
||||
var totalPageCount = pageSize > 0 ? (int)Math.Ceiling(TotalItemCount / pageSize) : 1;
|
||||
|
||||
var firstText = FirstText ?? T("<<");
|
||||
var previousText = PreviousText ?? T("<");
|
||||
var nextText = NextText ?? T(">");
|
||||
var lastText = LastText ?? T(">>");
|
||||
var firstText = FirstText ?? T("<<");
|
||||
var previousText = PreviousText ?? T("<");
|
||||
var nextText = NextText ?? T(">");
|
||||
var lastText = LastText ?? T(">>");
|
||||
var gapText = GapText ?? T("...");
|
||||
|
||||
var routeData = new RouteValueDictionary(Html.ViewContext.RouteData.Values);
|
||||
|
||||
@@ -11,11 +11,11 @@ using Orchard.Environment.Extensions;
|
||||
namespace Orchard.AuditTrail.Services {
|
||||
[OrchardFeature("Orchard.AuditTrail.RecycleBin")]
|
||||
public class RecycleBin : IRecycleBin {
|
||||
private readonly ISessionLocator _sessionLocator;
|
||||
private readonly ITransactionManager _transactionManager;
|
||||
private readonly IContentManager _contentManager;
|
||||
|
||||
public RecycleBin(ISessionLocator sessionLocator, IContentManager contentManager) {
|
||||
_sessionLocator = sessionLocator;
|
||||
public RecycleBin(ITransactionManager transactionManager, IContentManager contentManager) {
|
||||
_transactionManager = transactionManager;
|
||||
_contentManager = contentManager;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Orchard.AuditTrail.Services {
|
||||
}
|
||||
|
||||
private IQuery GetDeletedVersionsQuery(IEnumerable<int> contentItemIds = null) {
|
||||
var session = _sessionLocator.For(typeof(ContentItemVersionRecord));
|
||||
var session = _transactionManager.GetSession();
|
||||
|
||||
// Select only the highest versions where both Published and Latest are false.
|
||||
var select =
|
||||
|
||||
@@ -66,6 +66,10 @@ namespace Orchard.Autoroute.Handlers {
|
||||
if (current != null) {
|
||||
current.CustomPattern = String.Empty; // force the regeneration
|
||||
current.DisplayAlias = _autorouteService.Value.GenerateAlias(current);
|
||||
|
||||
// we changed the alias of the previous homepage, so publish this change if the content item was published.
|
||||
if(current.IsPublished())
|
||||
_orchardServices.ContentManager.Publish(current.ContentItem);
|
||||
}
|
||||
_autorouteService.Value.PublishAlias(current);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"inputs": [ "Assets/Less/*.less" ],
|
||||
"output": "Styles/@.css"
|
||||
},
|
||||
{
|
||||
"inputs": [ "Assets/TypeScript/*.ts" ],
|
||||
"output": "Scripts/@.js"
|
||||
},
|
||||
{
|
||||
"inputs": [ "Assets/JavaScript/Lib/*.js" ],
|
||||
"output": "Scripts/Lib/@.js"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,213 @@
|
||||
/**
|
||||
* @preserve console-shim 1.0.2
|
||||
* https://github.com/kayahr/console-shim
|
||||
* Copyright (C) 2011 Klaus Reimer <k@ailis.de>
|
||||
* Licensed under the MIT license
|
||||
* (See http://www.opensource.org/licenses/mit-license)
|
||||
*/
|
||||
|
||||
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Returns a function which calls the specified function in the specified
|
||||
* scope.
|
||||
*
|
||||
* @param {Function} func
|
||||
* The function to call.
|
||||
* @param {Object} scope
|
||||
* The scope to call the function in.
|
||||
* @param {...*} args
|
||||
* Additional arguments to pass to the bound function.
|
||||
* @returns {function(...[*]): undefined}
|
||||
* The bound function.
|
||||
*/
|
||||
var bind = function(func, scope, args)
|
||||
{
|
||||
var fixedArgs = Array.prototype.slice.call(arguments, 2);
|
||||
return function()
|
||||
{
|
||||
var args = fixedArgs.concat(Array.prototype.slice.call(arguments, 0));
|
||||
(/** @type {Function} */ func).apply(scope, args);
|
||||
};
|
||||
};
|
||||
|
||||
// Create console if not present
|
||||
if (!window["console"]) window.console = /** @type {Console} */ ({});
|
||||
var console = (/** @type {Object} */ window.console);
|
||||
|
||||
// Implement console log if needed
|
||||
if (!console["log"])
|
||||
{
|
||||
// Use log4javascript if present
|
||||
if (window["log4javascript"])
|
||||
{
|
||||
var log = log4javascript.getDefaultLogger();
|
||||
console.log = bind(log.info, log);
|
||||
console.debug = bind(log.debug, log);
|
||||
console.info = bind(log.info, log);
|
||||
console.warn = bind(log.warn, log);
|
||||
console.error = bind(log.error, log);
|
||||
}
|
||||
|
||||
// Use empty dummy implementation to ignore logging
|
||||
else
|
||||
{
|
||||
console.log = (/** @param {...*} args */ function(args) {});
|
||||
}
|
||||
}
|
||||
|
||||
// Implement other log levels to console.log if missing
|
||||
if (!console["debug"]) console.debug = console.log;
|
||||
if (!console["info"]) console.info = console.log;
|
||||
if (!console["warn"]) console.warn = console.log;
|
||||
if (!console["error"]) console.error = console.log;
|
||||
|
||||
// Wrap the log methods in IE (<=9) because their argument handling is wrong
|
||||
// This wrapping is also done if the __consoleShimTest__ symbol is set. This
|
||||
// is needed for unit testing.
|
||||
if (window["__consoleShimTest__"] != null ||
|
||||
eval("/*@cc_on @_jscript_version <= 9@*/"))
|
||||
{
|
||||
/**
|
||||
* Wraps the call to a real IE logging method. Modifies the arguments so
|
||||
* parameters which are not represented by a placeholder are properly
|
||||
* printed with a space character as separator.
|
||||
*
|
||||
* @param {...*} args
|
||||
* The function arguments. First argument is the log function
|
||||
* to call, the other arguments are the log arguments.
|
||||
*/
|
||||
var wrap = function(args)
|
||||
{
|
||||
var i, max, match, log;
|
||||
|
||||
// Convert argument list to real array
|
||||
args = Array.prototype.slice.call(arguments, 0);
|
||||
|
||||
// First argument is the log method to call
|
||||
log = args.shift();
|
||||
|
||||
max = args.length;
|
||||
if (max > 1 && window["__consoleShimTest__"] !== false)
|
||||
{
|
||||
// When first parameter is not a string then add a format string to
|
||||
// the argument list so we are able to modify it in the next stop
|
||||
if (typeof(args[0]) != "string")
|
||||
{
|
||||
args.unshift("%o");
|
||||
max += 1;
|
||||
}
|
||||
|
||||
// For each additional parameter which has no placeholder in the
|
||||
// format string we add another placeholder separated with a
|
||||
// space character.
|
||||
match = args[0].match(/%[a-z]/g);
|
||||
for (i = match ? match.length + 1 : 1; i < max; i += 1)
|
||||
{
|
||||
args[0] += " %o";
|
||||
}
|
||||
}
|
||||
Function.apply.call(log, console, args);
|
||||
};
|
||||
|
||||
// Wrap the native log methods of IE to fix argument output problems
|
||||
console.log = bind(wrap, window, console.log);
|
||||
console.debug = bind(wrap, window, console.debug);
|
||||
console.info = bind(wrap, window, console.info);
|
||||
console.warn = bind(wrap, window, console.warn);
|
||||
console.error = bind(wrap, window, console.error);
|
||||
}
|
||||
|
||||
// Implement console.assert if missing
|
||||
if (!console["assert"])
|
||||
{
|
||||
console["assert"] = function()
|
||||
{
|
||||
var args = Array.prototype.slice.call(arguments, 0);
|
||||
var expr = args.shift();
|
||||
if (!expr)
|
||||
{
|
||||
args[0] = "Assertion failed: " + args[0];
|
||||
console.error.apply(console, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Linking console.dir and console.dirxml to the console.log method if
|
||||
// missing. Hopefully the browser already logs objects and DOM nodes as a
|
||||
// tree.
|
||||
if (!console["dir"]) console["dir"] = console.log;
|
||||
if (!console["dirxml"]) console["dirxml"] = console.log;
|
||||
|
||||
// Linking console.exception to console.error. This is not the same but
|
||||
// at least some error message is displayed.
|
||||
if (!console["exception"]) console["exception"] = console.error;
|
||||
|
||||
// Implement console.time and console.timeEnd if one of them is missing
|
||||
if (!console["time"] || !console["timeEnd"])
|
||||
{
|
||||
var timers = {};
|
||||
console["time"] = function(id)
|
||||
{
|
||||
timers[id] = new Date().getTime();
|
||||
};
|
||||
console["timeEnd"] = function(id)
|
||||
{
|
||||
var start = timers[id];
|
||||
if (start)
|
||||
{
|
||||
console.log(id + ": " + (new Date().getTime() - start) + "ms");
|
||||
delete timers[id];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Implement console.table if missing
|
||||
if (!console["table"])
|
||||
{
|
||||
console["table"] = function(data, columns)
|
||||
{
|
||||
var i, iMax, row, j, jMax, k;
|
||||
|
||||
// Do nothing if data has wrong type or no data was specified
|
||||
if (!data || !(data instanceof Array) || !data.length) return;
|
||||
|
||||
// Auto-calculate columns array if not set
|
||||
if (!columns || !(columns instanceof Array))
|
||||
{
|
||||
columns = [];
|
||||
for (k in data[0])
|
||||
{
|
||||
if (!data[0].hasOwnProperty(k)) continue;
|
||||
columns.push(k);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0, iMax = data.length; i < iMax; i += 1)
|
||||
{
|
||||
row = [];
|
||||
for (j = 0, jMax = columns.length; j < jMax; j += 1)
|
||||
{
|
||||
row.push(data[i][columns[j]]);
|
||||
}
|
||||
|
||||
Function.apply.call(console.log, console, row);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Dummy implementations of other console features to prevent error messages
|
||||
// in browsers not supporting it.
|
||||
if (!console["clear"]) console["clear"] = function() {};
|
||||
if (!console["trace"]) console["trace"] = function() {};
|
||||
if (!console["group"]) console["group"] = function() {};
|
||||
if (!console["groupCollapsed"]) console["groupCollapsed"] = function() {};
|
||||
if (!console["groupEnd"]) console["groupEnd"] = function() {};
|
||||
if (!console["timeStamp"]) console["timeStamp"] = function() {};
|
||||
if (!console["profile"]) console["profile"] = function() {};
|
||||
if (!console["profileEnd"]) console["profileEnd"] = function() {};
|
||||
if (!console["count"]) console["count"] = function() {};
|
||||
|
||||
})();
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,619 @@
|
||||
/*!
|
||||
* jQuery blockUI plugin
|
||||
* Version 2.66.0-2013.10.09
|
||||
* Requires jQuery v1.7 or later
|
||||
*
|
||||
* Examples at: http://malsup.com/jquery/block/
|
||||
* Copyright (c) 2007-2013 M. Alsup
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Thanks to Amir-Hossein Sobhi for some excellent contributions!
|
||||
*/
|
||||
|
||||
;(function() {
|
||||
/*jshint eqeqeq:false curly:false latedef:false */
|
||||
"use strict";
|
||||
|
||||
function setup($) {
|
||||
$.fn._fadeIn = $.fn.fadeIn;
|
||||
|
||||
var noOp = $.noop || function() {};
|
||||
|
||||
// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
|
||||
// confusing userAgent strings on Vista)
|
||||
var msie = /MSIE/.test(navigator.userAgent);
|
||||
var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
|
||||
var mode = document.documentMode || 0;
|
||||
var setExpr = $.isFunction( document.createElement('div').style.setExpression );
|
||||
|
||||
// global $ methods for blocking/unblocking the entire page
|
||||
$.blockUI = function(opts) { install(window, opts); };
|
||||
$.unblockUI = function(opts) { remove(window, opts); };
|
||||
|
||||
// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
|
||||
$.growlUI = function(title, message, timeout, onClose) {
|
||||
var $m = $('<div class="growlUI"></div>');
|
||||
if (title) $m.append('<h1>'+title+'</h1>');
|
||||
if (message) $m.append('<h2>'+message+'</h2>');
|
||||
if (timeout === undefined) timeout = 3000;
|
||||
|
||||
// Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
|
||||
var callBlock = function(opts) {
|
||||
opts = opts || {};
|
||||
|
||||
$.blockUI({
|
||||
message: $m,
|
||||
fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
|
||||
fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
|
||||
timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
|
||||
centerY: false,
|
||||
showOverlay: false,
|
||||
onUnblock: onClose,
|
||||
css: $.blockUI.defaults.growlCSS
|
||||
});
|
||||
};
|
||||
|
||||
callBlock();
|
||||
var nonmousedOpacity = $m.css('opacity');
|
||||
$m.mouseover(function() {
|
||||
callBlock({
|
||||
fadeIn: 0,
|
||||
timeout: 30000
|
||||
});
|
||||
|
||||
var displayBlock = $('.blockMsg');
|
||||
displayBlock.stop(); // cancel fadeout if it has started
|
||||
displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
|
||||
}).mouseout(function() {
|
||||
$('.blockMsg').fadeOut(1000);
|
||||
});
|
||||
// End konapun additions
|
||||
};
|
||||
|
||||
// plugin method for blocking element content
|
||||
$.fn.block = function(opts) {
|
||||
if ( this[0] === window ) {
|
||||
$.blockUI( opts );
|
||||
return this;
|
||||
}
|
||||
var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
this.each(function() {
|
||||
var $el = $(this);
|
||||
if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
|
||||
return;
|
||||
$el.unblock({ fadeOut: 0 });
|
||||
});
|
||||
|
||||
return this.each(function() {
|
||||
if ($.css(this,'position') == 'static') {
|
||||
this.style.position = 'relative';
|
||||
$(this).data('blockUI.static', true);
|
||||
}
|
||||
this.style.zoom = 1; // force 'hasLayout' in ie
|
||||
install(this, opts);
|
||||
});
|
||||
};
|
||||
|
||||
// plugin method for unblocking element content
|
||||
$.fn.unblock = function(opts) {
|
||||
if ( this[0] === window ) {
|
||||
$.unblockUI( opts );
|
||||
return this;
|
||||
}
|
||||
return this.each(function() {
|
||||
remove(this, opts);
|
||||
});
|
||||
};
|
||||
|
||||
$.blockUI.version = 2.66; // 2nd generation blocking at no extra cost!
|
||||
|
||||
// override these in your code to change the default behavior and style
|
||||
$.blockUI.defaults = {
|
||||
// message displayed when blocking (use null for no message)
|
||||
message: '<h1>Please wait...</h1>',
|
||||
|
||||
title: null, // title string; only used when theme == true
|
||||
draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
|
||||
|
||||
theme: false, // set to true to use with jQuery UI themes
|
||||
|
||||
// styles for the message when blocking; if you wish to disable
|
||||
// these and use an external stylesheet then do this in your code:
|
||||
// $.blockUI.defaults.css = {};
|
||||
css: {
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
width: '30%',
|
||||
top: '40%',
|
||||
left: '35%',
|
||||
textAlign: 'center',
|
||||
color: '#000',
|
||||
border: '3px solid #aaa',
|
||||
backgroundColor:'#fff',
|
||||
cursor: 'wait'
|
||||
},
|
||||
|
||||
// minimal style set used when themes are used
|
||||
themedCSS: {
|
||||
width: '30%',
|
||||
top: '40%',
|
||||
left: '35%'
|
||||
},
|
||||
|
||||
// styles for the overlay
|
||||
overlayCSS: {
|
||||
backgroundColor: '#000',
|
||||
opacity: 0.6,
|
||||
cursor: 'wait'
|
||||
},
|
||||
|
||||
// style to replace wait cursor before unblocking to correct issue
|
||||
// of lingering wait cursor
|
||||
cursorReset: 'default',
|
||||
|
||||
// styles applied when using $.growlUI
|
||||
growlCSS: {
|
||||
width: '350px',
|
||||
top: '10px',
|
||||
left: '',
|
||||
right: '10px',
|
||||
border: 'none',
|
||||
padding: '5px',
|
||||
opacity: 0.6,
|
||||
cursor: 'default',
|
||||
color: '#fff',
|
||||
backgroundColor: '#000',
|
||||
'-webkit-border-radius':'10px',
|
||||
'-moz-border-radius': '10px',
|
||||
'border-radius': '10px'
|
||||
},
|
||||
|
||||
// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
|
||||
// (hat tip to Jorge H. N. de Vasconcelos)
|
||||
/*jshint scripturl:true */
|
||||
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
|
||||
|
||||
// force usage of iframe in non-IE browsers (handy for blocking applets)
|
||||
forceIframe: false,
|
||||
|
||||
// z-index for the blocking overlay
|
||||
baseZ: 1000,
|
||||
|
||||
// set these to true to have the message automatically centered
|
||||
centerX: true, // <-- only effects element blocking (page block controlled via css above)
|
||||
centerY: true,
|
||||
|
||||
// allow body element to be stetched in ie6; this makes blocking look better
|
||||
// on "short" pages. disable if you wish to prevent changes to the body height
|
||||
allowBodyStretch: true,
|
||||
|
||||
// enable if you want key and mouse events to be disabled for content that is blocked
|
||||
bindEvents: true,
|
||||
|
||||
// be default blockUI will supress tab navigation from leaving blocking content
|
||||
// (if bindEvents is true)
|
||||
constrainTabKey: true,
|
||||
|
||||
// fadeIn time in millis; set to 0 to disable fadeIn on block
|
||||
fadeIn: 200,
|
||||
|
||||
// fadeOut time in millis; set to 0 to disable fadeOut on unblock
|
||||
fadeOut: 400,
|
||||
|
||||
// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
|
||||
timeout: 0,
|
||||
|
||||
// disable if you don't want to show the overlay
|
||||
showOverlay: true,
|
||||
|
||||
// if true, focus will be placed in the first available input field when
|
||||
// page blocking
|
||||
focusInput: true,
|
||||
|
||||
// elements that can receive focus
|
||||
focusableElements: ':input:enabled:visible',
|
||||
|
||||
// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
|
||||
// no longer needed in 2012
|
||||
// applyPlatformOpacityRules: true,
|
||||
|
||||
// callback method invoked when fadeIn has completed and blocking message is visible
|
||||
onBlock: null,
|
||||
|
||||
// callback method invoked when unblocking has completed; the callback is
|
||||
// passed the element that has been unblocked (which is the window object for page
|
||||
// blocks) and the options that were passed to the unblock call:
|
||||
// onUnblock(element, options)
|
||||
onUnblock: null,
|
||||
|
||||
// callback method invoked when the overlay area is clicked.
|
||||
// setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
|
||||
onOverlayClick: null,
|
||||
|
||||
// don't ask; if you really must know: http://groups.google.com/requiredUploads/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
|
||||
quirksmodeOffsetHack: 4,
|
||||
|
||||
// class name of the message block
|
||||
blockMsgClass: 'blockMsg',
|
||||
|
||||
// if it is already blocked, then ignore it (don't unblock and reblock)
|
||||
ignoreIfBlocked: false
|
||||
};
|
||||
|
||||
// private data and functions follow...
|
||||
|
||||
var pageBlock = null;
|
||||
var pageBlockEls = [];
|
||||
|
||||
function install(el, opts) {
|
||||
var css, themedCSS;
|
||||
var full = (el == window);
|
||||
var msg = (opts && opts.message !== undefined ? opts.message : undefined);
|
||||
opts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
|
||||
if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
|
||||
return;
|
||||
|
||||
opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
|
||||
css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
|
||||
if (opts.onOverlayClick)
|
||||
opts.overlayCSS.cursor = 'pointer';
|
||||
|
||||
themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
|
||||
msg = msg === undefined ? opts.message : msg;
|
||||
|
||||
// remove the current block (if there is one)
|
||||
if (full && pageBlock)
|
||||
remove(window, {fadeOut:0});
|
||||
|
||||
// if an existing element is being used as the blocking content then we capture
|
||||
// its current place in the DOM (and current display style) so we can restore
|
||||
// it when we unblock
|
||||
if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
|
||||
var node = msg.jquery ? msg[0] : msg;
|
||||
var data = {};
|
||||
$(el).data('blockUI.history', data);
|
||||
data.el = node;
|
||||
data.parent = node.parentNode;
|
||||
data.display = node.style.display;
|
||||
data.position = node.style.position;
|
||||
if (data.parent)
|
||||
data.parent.removeChild(node);
|
||||
}
|
||||
|
||||
$(el).data('blockUI.onUnblock', opts.onUnblock);
|
||||
var z = opts.baseZ;
|
||||
|
||||
// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
|
||||
// layer1 is the iframe layer which is used to supress bleed through of underlying content
|
||||
// layer2 is the overlay layer which has opacity and a wait cursor (by default)
|
||||
// layer3 is the message content that is displayed while blocking
|
||||
var lyr1, lyr2, lyr3, s;
|
||||
if (msie || opts.forceIframe)
|
||||
lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
|
||||
else
|
||||
lyr1 = $('<div class="blockUI" style="display:none"></div>');
|
||||
|
||||
if (opts.theme)
|
||||
lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
|
||||
else
|
||||
lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
|
||||
|
||||
if (opts.theme && full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
else if (opts.theme) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
else if (full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
|
||||
}
|
||||
else {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
|
||||
}
|
||||
lyr3 = $(s);
|
||||
|
||||
// if we have a message, style it
|
||||
if (msg) {
|
||||
if (opts.theme) {
|
||||
lyr3.css(themedCSS);
|
||||
lyr3.addClass('ui-widget-content');
|
||||
}
|
||||
else
|
||||
lyr3.css(css);
|
||||
}
|
||||
|
||||
// style the overlay
|
||||
if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
|
||||
lyr2.css(opts.overlayCSS);
|
||||
lyr2.css('position', full ? 'fixed' : 'absolute');
|
||||
|
||||
// make iframe layer transparent in IE
|
||||
if (msie || opts.forceIframe)
|
||||
lyr1.css('opacity',0.0);
|
||||
|
||||
//$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
|
||||
var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
|
||||
$.each(layers, function() {
|
||||
this.appendTo($par);
|
||||
});
|
||||
|
||||
if (opts.theme && opts.draggable && $.fn.draggable) {
|
||||
lyr3.draggable({
|
||||
handle: '.ui-dialog-titlebar',
|
||||
cancel: 'li'
|
||||
});
|
||||
}
|
||||
|
||||
// ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
|
||||
var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
|
||||
if (ie6 || expr) {
|
||||
// give body 100% height
|
||||
if (full && opts.allowBodyStretch && $.support.boxModel)
|
||||
$('html,body').css('height','100%');
|
||||
|
||||
// fix ie6 issue when blocked element has a border width
|
||||
if ((ie6 || !$.support.boxModel) && !full) {
|
||||
var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
|
||||
var fixT = t ? '(0 - '+t+')' : 0;
|
||||
var fixL = l ? '(0 - '+l+')' : 0;
|
||||
}
|
||||
|
||||
// simulate fixed position
|
||||
$.each(layers, function(i,o) {
|
||||
var s = o[0].style;
|
||||
s.position = 'absolute';
|
||||
if (i < 2) {
|
||||
if (full)
|
||||
s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
|
||||
else
|
||||
s.setExpression('height','this.parentNode.offsetHeight + "px"');
|
||||
if (full)
|
||||
s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
|
||||
else
|
||||
s.setExpression('width','this.parentNode.offsetWidth + "px"');
|
||||
if (fixL) s.setExpression('left', fixL);
|
||||
if (fixT) s.setExpression('top', fixT);
|
||||
}
|
||||
else if (opts.centerY) {
|
||||
if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
|
||||
s.marginTop = 0;
|
||||
}
|
||||
else if (!opts.centerY && full) {
|
||||
var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
|
||||
var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
|
||||
s.setExpression('top',expression);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// show the message
|
||||
if (msg) {
|
||||
if (opts.theme)
|
||||
lyr3.find('.ui-widget-content').append(msg);
|
||||
else
|
||||
lyr3.append(msg);
|
||||
if (msg.jquery || msg.nodeType)
|
||||
$(msg).show();
|
||||
}
|
||||
|
||||
if ((msie || opts.forceIframe) && opts.showOverlay)
|
||||
lyr1.show(); // opacity is zero
|
||||
if (opts.fadeIn) {
|
||||
var cb = opts.onBlock ? opts.onBlock : noOp;
|
||||
var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
|
||||
var cb2 = msg ? cb : noOp;
|
||||
if (opts.showOverlay)
|
||||
lyr2._fadeIn(opts.fadeIn, cb1);
|
||||
if (msg)
|
||||
lyr3._fadeIn(opts.fadeIn, cb2);
|
||||
}
|
||||
else {
|
||||
if (opts.showOverlay)
|
||||
lyr2.show();
|
||||
if (msg)
|
||||
lyr3.show();
|
||||
if (opts.onBlock)
|
||||
opts.onBlock();
|
||||
}
|
||||
|
||||
// bind key and mouse events
|
||||
bind(1, el, opts);
|
||||
|
||||
if (full) {
|
||||
pageBlock = lyr3[0];
|
||||
pageBlockEls = $(opts.focusableElements,pageBlock);
|
||||
if (opts.focusInput)
|
||||
setTimeout(focus, 20);
|
||||
}
|
||||
else
|
||||
center(lyr3[0], opts.centerX, opts.centerY);
|
||||
|
||||
if (opts.timeout) {
|
||||
// auto-unblock
|
||||
var to = setTimeout(function() {
|
||||
if (full)
|
||||
$.unblockUI(opts);
|
||||
else
|
||||
$(el).unblock(opts);
|
||||
}, opts.timeout);
|
||||
$(el).data('blockUI.timeout', to);
|
||||
}
|
||||
}
|
||||
|
||||
// remove the block
|
||||
function remove(el, opts) {
|
||||
var count;
|
||||
var full = (el == window);
|
||||
var $el = $(el);
|
||||
var data = $el.data('blockUI.history');
|
||||
var to = $el.data('blockUI.timeout');
|
||||
if (to) {
|
||||
clearTimeout(to);
|
||||
$el.removeData('blockUI.timeout');
|
||||
}
|
||||
opts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
bind(0, el, opts); // unbind events
|
||||
|
||||
if (opts.onUnblock === null) {
|
||||
opts.onUnblock = $el.data('blockUI.onUnblock');
|
||||
$el.removeData('blockUI.onUnblock');
|
||||
}
|
||||
|
||||
var els;
|
||||
if (full) // crazy selector to handle odd field errors in ie6/7
|
||||
els = $('body').children().filter('.blockUI').add('body > .blockUI');
|
||||
else
|
||||
els = $el.find('>.blockUI');
|
||||
|
||||
// fix cursor issue
|
||||
if ( opts.cursorReset ) {
|
||||
if ( els.length > 1 )
|
||||
els[1].style.cursor = opts.cursorReset;
|
||||
if ( els.length > 2 )
|
||||
els[2].style.cursor = opts.cursorReset;
|
||||
}
|
||||
|
||||
if (full)
|
||||
pageBlock = pageBlockEls = null;
|
||||
|
||||
if (opts.fadeOut) {
|
||||
count = els.length;
|
||||
els.stop().fadeOut(opts.fadeOut, function() {
|
||||
if ( --count === 0)
|
||||
reset(els,data,opts,el);
|
||||
});
|
||||
}
|
||||
else
|
||||
reset(els, data, opts, el);
|
||||
}
|
||||
|
||||
// move blocking element back into the DOM where it started
|
||||
function reset(els,data,opts,el) {
|
||||
var $el = $(el);
|
||||
if ( $el.data('blockUI.isBlocked') )
|
||||
return;
|
||||
|
||||
els.each(function(i,o) {
|
||||
// remove via DOM calls so we don't lose event handlers
|
||||
if (this.parentNode)
|
||||
this.parentNode.removeChild(this);
|
||||
});
|
||||
|
||||
if (data && data.el) {
|
||||
data.el.style.display = data.display;
|
||||
data.el.style.position = data.position;
|
||||
if (data.parent)
|
||||
data.parent.appendChild(data.el);
|
||||
$el.removeData('blockUI.history');
|
||||
}
|
||||
|
||||
if ($el.data('blockUI.static')) {
|
||||
$el.css('position', 'static'); // #22
|
||||
}
|
||||
|
||||
if (typeof opts.onUnblock == 'function')
|
||||
opts.onUnblock(el,opts);
|
||||
|
||||
// fix issue in Safari 6 where block artifacts remain until reflow
|
||||
var body = $(document.body), w = body.width(), cssW = body[0].style.width;
|
||||
body.width(w-1).width(w);
|
||||
body[0].style.width = cssW;
|
||||
}
|
||||
|
||||
// bind/unbind the handler
|
||||
function bind(b, el, opts) {
|
||||
var full = el == window, $el = $(el);
|
||||
|
||||
// don't bother unbinding if there is nothing to unbind
|
||||
if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
|
||||
return;
|
||||
|
||||
$el.data('blockUI.isBlocked', b);
|
||||
|
||||
// don't bind events when overlay is not in use or if bindEvents is false
|
||||
if (!full || !opts.bindEvents || (b && !opts.showOverlay))
|
||||
return;
|
||||
|
||||
// bind anchors and inputs for mouse and key events
|
||||
var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
|
||||
if (b)
|
||||
$(document).bind(events, opts, handler);
|
||||
else
|
||||
$(document).unbind(events, handler);
|
||||
|
||||
// former impl...
|
||||
// var $e = $('a,:input');
|
||||
// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
|
||||
}
|
||||
|
||||
// event handler to suppress keyboard/mouse events when blocking
|
||||
function handler(e) {
|
||||
// allow tab navigation (conditionally)
|
||||
if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
|
||||
if (pageBlock && e.data.constrainTabKey) {
|
||||
var els = pageBlockEls;
|
||||
var fwd = !e.shiftKey && e.target === els[els.length-1];
|
||||
var back = e.shiftKey && e.target === els[0];
|
||||
if (fwd || back) {
|
||||
setTimeout(function(){focus(back);},10);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
var opts = e.data;
|
||||
var target = $(e.target);
|
||||
if (target.hasClass('blockOverlay') && opts.onOverlayClick)
|
||||
opts.onOverlayClick(e);
|
||||
|
||||
// allow events within the message content
|
||||
if (target.parents('div.' + opts.blockMsgClass).length > 0)
|
||||
return true;
|
||||
|
||||
// allow events for content that is not being blocked
|
||||
return target.parents().children().filter('div.blockUI').length === 0;
|
||||
}
|
||||
|
||||
function focus(back) {
|
||||
if (!pageBlockEls)
|
||||
return;
|
||||
var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
|
||||
if (e)
|
||||
e.focus();
|
||||
}
|
||||
|
||||
function center(el, x, y) {
|
||||
var p = el.parentNode, s = el.style;
|
||||
var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
|
||||
var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
|
||||
if (x) s.left = l > 0 ? (l+'px') : '0';
|
||||
if (y) s.top = t > 0 ? (t+'px') : '0';
|
||||
}
|
||||
|
||||
function sz(el, p) {
|
||||
return parseInt($.css(el,p),10)||0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*global define:true */
|
||||
if (typeof define === 'function' && define.amd && define.amd.jQuery) {
|
||||
define(['jquery'], setup);
|
||||
} else {
|
||||
setup(jQuery);
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* jQuery File Upload Processing Plugin 1.3.0
|
||||
* https://github.com/blueimp/jQuery-File-Upload
|
||||
*
|
||||
* Copyright 2012, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* jshint nomen:false */
|
||||
/* global define, window */
|
||||
|
||||
(function (factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define([
|
||||
'jquery',
|
||||
'./jquery.fileupload'
|
||||
], factory);
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(
|
||||
window.jQuery
|
||||
);
|
||||
}
|
||||
}(function ($) {
|
||||
'use strict';
|
||||
|
||||
var originalAdd = $.blueimp.fileupload.prototype.options.add;
|
||||
|
||||
// The File Upload Processing plugin extends the fileupload widget
|
||||
// with file processing functionality:
|
||||
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
||||
|
||||
options: {
|
||||
// The list of processing actions:
|
||||
processQueue: [
|
||||
/*
|
||||
{
|
||||
action: 'log',
|
||||
type: 'debug'
|
||||
}
|
||||
*/
|
||||
],
|
||||
add: function (e, data) {
|
||||
var $this = $(this);
|
||||
data.process(function () {
|
||||
return $this.fileupload('process', data);
|
||||
});
|
||||
originalAdd.call(this, e, data);
|
||||
}
|
||||
},
|
||||
|
||||
processActions: {
|
||||
/*
|
||||
log: function (data, options) {
|
||||
console[options.type](
|
||||
'Processing "' + data.files[data.index].name + '"'
|
||||
);
|
||||
}
|
||||
*/
|
||||
},
|
||||
|
||||
_processFile: function (data, originalData) {
|
||||
var that = this,
|
||||
dfd = $.Deferred().resolveWith(that, [data]),
|
||||
chain = dfd.promise();
|
||||
this._trigger('process', null, data);
|
||||
$.each(data.processQueue, function (i, settings) {
|
||||
var func = function (data) {
|
||||
if (originalData.errorThrown) {
|
||||
return $.Deferred()
|
||||
.rejectWith(that, [originalData]).promise();
|
||||
}
|
||||
return that.processActions[settings.action].call(
|
||||
that,
|
||||
data,
|
||||
settings
|
||||
);
|
||||
};
|
||||
chain = chain.pipe(func, settings.always && func);
|
||||
});
|
||||
chain
|
||||
.done(function () {
|
||||
that._trigger('processdone', null, data);
|
||||
that._trigger('processalways', null, data);
|
||||
})
|
||||
.fail(function () {
|
||||
that._trigger('processfail', null, data);
|
||||
that._trigger('processalways', null, data);
|
||||
});
|
||||
return chain;
|
||||
},
|
||||
|
||||
// Replaces the settings of each processQueue item that
|
||||
// are strings starting with an "@", using the remaining
|
||||
// substring as key for the option map,
|
||||
// e.g. "@autoUpload" is replaced with options.autoUpload:
|
||||
_transformProcessQueue: function (options) {
|
||||
var processQueue = [];
|
||||
$.each(options.processQueue, function () {
|
||||
var settings = {},
|
||||
action = this.action,
|
||||
prefix = this.prefix === true ? action : this.prefix;
|
||||
$.each(this, function (key, value) {
|
||||
if ($.type(value) === 'string' &&
|
||||
value.charAt(0) === '@') {
|
||||
settings[key] = options[
|
||||
value.slice(1) || (prefix ? prefix +
|
||||
key.charAt(0).toUpperCase() + key.slice(1) : key)
|
||||
];
|
||||
} else {
|
||||
settings[key] = value;
|
||||
}
|
||||
|
||||
});
|
||||
processQueue.push(settings);
|
||||
});
|
||||
options.processQueue = processQueue;
|
||||
},
|
||||
|
||||
// Returns the number of files currently in the processsing queue:
|
||||
processing: function () {
|
||||
return this._processing;
|
||||
},
|
||||
|
||||
// Processes the files given as files property of the data parameter,
|
||||
// returns a Promise object that allows to bind callbacks:
|
||||
process: function (data) {
|
||||
var that = this,
|
||||
options = $.extend({}, this.options, data);
|
||||
if (options.processQueue && options.processQueue.length) {
|
||||
this._transformProcessQueue(options);
|
||||
if (this._processing === 0) {
|
||||
this._trigger('processstart');
|
||||
}
|
||||
$.each(data.files, function (index) {
|
||||
var opts = index ? $.extend({}, options) : options,
|
||||
func = function () {
|
||||
if (data.errorThrown) {
|
||||
return $.Deferred()
|
||||
.rejectWith(that, [data]).promise();
|
||||
}
|
||||
return that._processFile(opts, data);
|
||||
};
|
||||
opts.index = index;
|
||||
that._processing += 1;
|
||||
that._processingQueue = that._processingQueue.pipe(func, func)
|
||||
.always(function () {
|
||||
that._processing -= 1;
|
||||
if (that._processing === 0) {
|
||||
that._trigger('processstop');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return this._processingQueue;
|
||||
},
|
||||
|
||||
_create: function () {
|
||||
this._super();
|
||||
this._processing = 0;
|
||||
this._processingQueue = $.Deferred().resolveWith(this)
|
||||
.promise();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}));
|
||||
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* jQuery File Upload Validation Plugin 1.1.2
|
||||
* https://github.com/blueimp/jQuery-File-Upload
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define, window */
|
||||
|
||||
(function (factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define([
|
||||
'jquery',
|
||||
'./jquery.fileupload-process'
|
||||
], factory);
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(
|
||||
window.jQuery
|
||||
);
|
||||
}
|
||||
}(function ($) {
|
||||
'use strict';
|
||||
|
||||
// Append to the default processQueue:
|
||||
$.blueimp.fileupload.prototype.options.processQueue.push(
|
||||
{
|
||||
action: 'validate',
|
||||
// Always trigger this action,
|
||||
// even if the previous action was rejected:
|
||||
always: true,
|
||||
// Options taken from the global options map:
|
||||
acceptFileTypes: '@',
|
||||
maxFileSize: '@',
|
||||
minFileSize: '@',
|
||||
maxNumberOfFiles: '@',
|
||||
disabled: '@disableValidation'
|
||||
}
|
||||
);
|
||||
|
||||
// The File Upload Validation plugin extends the fileupload widget
|
||||
// with file validation functionality:
|
||||
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
||||
|
||||
options: {
|
||||
/*
|
||||
// The regular expression for allowed file types, matches
|
||||
// against either file type or file name:
|
||||
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
||||
// The maximum allowed file size in bytes:
|
||||
maxFileSize: 10000000, // 10 MB
|
||||
// The minimum allowed file size in bytes:
|
||||
minFileSize: undefined, // No minimal file size
|
||||
// The limit of files to be uploaded:
|
||||
maxNumberOfFiles: 10,
|
||||
*/
|
||||
|
||||
// Function returning the current number of files,
|
||||
// has to be overriden for maxNumberOfFiles validation:
|
||||
getNumberOfFiles: $.noop,
|
||||
|
||||
// Error and info messages:
|
||||
messages: {
|
||||
maxNumberOfFiles: 'Maximum number of files exceeded',
|
||||
acceptFileTypes: 'File type not allowed',
|
||||
maxFileSize: 'File is too large',
|
||||
minFileSize: 'File is too small'
|
||||
}
|
||||
},
|
||||
|
||||
processActions: {
|
||||
|
||||
validate: function (data, options) {
|
||||
if (options.disabled) {
|
||||
return data;
|
||||
}
|
||||
var dfd = $.Deferred(),
|
||||
settings = this.options,
|
||||
file = data.files[data.index],
|
||||
fileSize;
|
||||
if (options.minFileSize || options.maxFileSize) {
|
||||
fileSize = file.size;
|
||||
}
|
||||
if ($.type(options.maxNumberOfFiles) === 'number' &&
|
||||
(settings.getNumberOfFiles() || 0) + data.files.length >
|
||||
options.maxNumberOfFiles) {
|
||||
file.error = settings.i18n('maxNumberOfFiles');
|
||||
} else if (options.acceptFileTypes &&
|
||||
!(options.acceptFileTypes.test(file.type) ||
|
||||
options.acceptFileTypes.test(file.name))) {
|
||||
file.error = settings.i18n('acceptFileTypes');
|
||||
} else if (fileSize > options.maxFileSize) {
|
||||
file.error = settings.i18n('maxFileSize');
|
||||
} else if ($.type(fileSize) === 'number' &&
|
||||
fileSize < options.minFileSize) {
|
||||
file.error = settings.i18n('minFileSize');
|
||||
} else {
|
||||
delete file.error;
|
||||
}
|
||||
if (file.error || data.files.error) {
|
||||
data.files.error = true;
|
||||
dfd.rejectWith(this, [data]);
|
||||
} else {
|
||||
dfd.resolveWith(this, [data]);
|
||||
}
|
||||
return dfd.promise();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}));
|
||||
1426
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/jquery.fileupload.js
vendored
Normal file
1426
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/jquery.fileupload.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,53 @@
|
||||
/*! URI.js v1.12.1 http://medialize.github.com/URI.js/ */
|
||||
/* build contains: URI.js */
|
||||
(function(p,r){"object"===typeof exports?module.exports=r(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"===typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],r):p.URI=r(p.punycode,p.IPv6,p.SecondLevelDomains,p)})(this,function(p,r,v,w){function e(a,b){if(!(this instanceof e))return new e(a,b);void 0===a&&(a="undefined"!==typeof location?location.href+"":"");this.href(a);return void 0!==b?this.absoluteTo(b):this}function s(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,
|
||||
"\\$1")}function y(a){return void 0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function l(a){return"Array"===y(a)}function x(a,b){var c,e;if(l(b)){c=0;for(e=b.length;c<e;c++)if(!x(a,b[c]))return!1;return!0}var f=y(b);c=0;for(e=a.length;c<e;c++)if("RegExp"===f){if("string"===typeof a[c]&&a[c].match(b))return!0}else if(a[c]===b)return!0;return!1}function A(a,b){if(!l(a)||!l(b)||a.length!==b.length)return!1;a.sort();b.sort();for(var c=0,e=a.length;c<e;c++)if(a[c]!==b[c])return!1;
|
||||
return!0}function B(a){return escape(a)}function z(a){return encodeURIComponent(a).replace(/[!'()*]/g,B).replace(/\*/g,"%2A")}var C=w&&w.URI;e.version="1.12.1";var d=e.prototype,t=Object.prototype.hasOwnProperty;e._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,duplicateQueryParameters:e.duplicateQueryParameters,escapeQuerySpace:e.escapeQuerySpace}};e.duplicateQueryParameters=!1;e.escapeQuerySpace=!0;e.protocol_expression=
|
||||
/^[a-z][a-z0-9.+-]*$/i;e.idn_expression=/[^a-z0-9\.-]/i;e.punycode_expression=/(xn--)/i;e.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;e.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
|
||||
e.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/ig;e.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/};e.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"};e.invalid_hostname_characters=
|
||||
/[^a-zA-Z0-9\.-]/;e.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src"};e.getDomAttribute=function(a){if(a&&a.nodeName){var b=a.nodeName.toLowerCase();return"input"===b&&"image"!==a.type?void 0:e.domAttributes[b]}};e.encode=z;e.decode=decodeURIComponent;e.iso8859=function(){e.encode=escape;e.decode=unescape};e.unicode=function(){e.encode=z;e.decode=decodeURIComponent};e.characters=
|
||||
{pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}}};e.encodeQuery=
|
||||
function(a,b){var c=e.encode(a+"");void 0===b&&(b=e.escapeQuerySpace);return b?c.replace(/%20/g,"+"):c};e.decodeQuery=function(a,b){a+="";void 0===b&&(b=e.escapeQuerySpace);try{return e.decode(b?a.replace(/\+/g,"%20"):a)}catch(c){return a}};e.recodePath=function(a){a=(a+"").split("/");for(var b=0,c=a.length;b<c;b++)a[b]=e.encodePathSegment(e.decode(a[b]));return a.join("/")};e.decodePath=function(a){a=(a+"").split("/");for(var b=0,c=a.length;b<c;b++)a[b]=e.decodePathSegment(a[b]);return a.join("/")};
|
||||
var q={encode:"encode",decode:"decode"},m,u=function(a,b){return function(c){return e[b](c+"").replace(e.characters[a][b].expression,function(c){return e.characters[a][b].map[c]})}};for(m in q)e[m+"PathSegment"]=u("pathname",q[m]);e.encodeReserved=u("reserved","encode");e.parse=function(a,b){var c;b||(b={});c=a.indexOf("#");-1<c&&(b.fragment=a.substring(c+1)||null,a=a.substring(0,c));c=a.indexOf("?");-1<c&&(b.query=a.substring(c+1)||null,a=a.substring(0,c));"//"===a.substring(0,2)?(b.protocol=null,
|
||||
a=a.substring(2),a=e.parseAuthority(a,b)):(c=a.indexOf(":"),-1<c&&(b.protocol=a.substring(0,c)||null,b.protocol&&!b.protocol.match(e.protocol_expression)?b.protocol=void 0:"file"===b.protocol?a=a.substring(c+3):"//"===a.substring(c+1,c+3)?(a=a.substring(c+3),a=e.parseAuthority(a,b)):(a=a.substring(c+1),b.urn=!0)));b.path=a;return b};e.parseHost=function(a,b){var c=a.indexOf("/"),e;-1===c&&(c=a.length);"["===a.charAt(0)?(e=a.indexOf("]"),b.hostname=a.substring(1,e)||null,b.port=a.substring(e+2,c)||
|
||||
null):a.indexOf(":")!==a.lastIndexOf(":")?(b.hostname=a.substring(0,c)||null,b.port=null):(e=a.substring(0,c).split(":"),b.hostname=e[0]||null,b.port=e[1]||null);b.hostname&&"/"!==a.substring(c).charAt(0)&&(c++,a="/"+a);return a.substring(c)||"/"};e.parseAuthority=function(a,b){a=e.parseUserinfo(a,b);return e.parseHost(a,b)};e.parseUserinfo=function(a,b){var c=a.indexOf("/"),g=-1<c?a.lastIndexOf("@",c):a.indexOf("@");-1<g&&(-1===c||g<c)?(c=a.substring(0,g).split(":"),b.username=c[0]?e.decode(c[0]):
|
||||
null,c.shift(),b.password=c[0]?e.decode(c.join(":")):null,a=a.substring(g+1)):(b.username=null,b.password=null);return a};e.parseQuery=function(a,b){if(!a)return{};a=a.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"");if(!a)return{};for(var c={},g=a.split("&"),f=g.length,d,h,n=0;n<f;n++)d=g[n].split("="),h=e.decodeQuery(d.shift(),b),d=d.length?e.decodeQuery(d.join("="),b):null,c[h]?("string"===typeof c[h]&&(c[h]=[c[h]]),c[h].push(d)):c[h]=d;return c};e.build=function(a){var b="";a.protocol&&(b+=a.protocol+
|
||||
":");a.urn||!b&&!a.hostname||(b+="//");b+=e.buildAuthority(a)||"";"string"===typeof a.path&&("/"!==a.path.charAt(0)&&"string"===typeof a.hostname&&(b+="/"),b+=a.path);"string"===typeof a.query&&a.query&&(b+="?"+a.query);"string"===typeof a.fragment&&a.fragment&&(b+="#"+a.fragment);return b};e.buildHost=function(a){var b="";if(a.hostname)e.ip6_expression.test(a.hostname)?b=a.port?b+("["+a.hostname+"]:"+a.port):b+a.hostname:(b+=a.hostname,a.port&&(b+=":"+a.port));else return"";return b};e.buildAuthority=
|
||||
function(a){return e.buildUserinfo(a)+e.buildHost(a)};e.buildUserinfo=function(a){var b="";a.username&&(b+=e.encode(a.username),a.password&&(b+=":"+e.encode(a.password)),b+="@");return b};e.buildQuery=function(a,b,c){var g="",f,d,h,n;for(d in a)if(t.call(a,d)&&d)if(l(a[d]))for(f={},h=0,n=a[d].length;h<n;h++)void 0!==a[d][h]&&void 0===f[a[d][h]+""]&&(g+="&"+e.buildQueryParameter(d,a[d][h],c),!0!==b&&(f[a[d][h]+""]=!0));else void 0!==a[d]&&(g+="&"+e.buildQueryParameter(d,a[d],c));return g.substring(1)};
|
||||
e.buildQueryParameter=function(a,b,c){return e.encodeQuery(a,c)+(null!==b?"="+e.encodeQuery(b,c):"")};e.addQuery=function(a,b,c){if("object"===typeof b)for(var g in b)t.call(b,g)&&e.addQuery(a,g,b[g]);else if("string"===typeof b)void 0===a[b]?a[b]=c:("string"===typeof a[b]&&(a[b]=[a[b]]),l(c)||(c=[c]),a[b]=a[b].concat(c));else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");};e.removeQuery=function(a,b,c){var g;if(l(b))for(c=0,g=b.length;c<g;c++)a[b[c]]=void 0;
|
||||
else if("object"===typeof b)for(g in b)t.call(b,g)&&e.removeQuery(a,g,b[g]);else if("string"===typeof b)if(void 0!==c)if(a[b]===c)a[b]=void 0;else{if(l(a[b])){g=a[b];var f={},d,h;if(l(c))for(d=0,h=c.length;d<h;d++)f[c[d]]=!0;else f[c]=!0;d=0;for(h=g.length;d<h;d++)void 0!==f[g[d]]&&(g.splice(d,1),h--,d--);a[b]=g}}else a[b]=void 0;else throw new TypeError("URI.addQuery() accepts an object, string as the first parameter");};e.hasQuery=function(a,b,c,g){if("object"===typeof b){for(var d in b)if(t.call(b,
|
||||
d)&&!e.hasQuery(a,d,b[d]))return!1;return!0}if("string"!==typeof b)throw new TypeError("URI.hasQuery() accepts an object, string as the name parameter");switch(y(c)){case "Undefined":return b in a;case "Boolean":return a=Boolean(l(a[b])?a[b].length:a[b]),c===a;case "Function":return!!c(a[b],b,a);case "Array":return l(a[b])?(g?x:A)(a[b],c):!1;case "RegExp":return l(a[b])?g?x(a[b],c):!1:Boolean(a[b]&&a[b].match(c));case "Number":c=String(c);case "String":return l(a[b])?g?x(a[b],c):!1:a[b]===c;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");
|
||||
}};e.commonPath=function(a,b){var c=Math.min(a.length,b.length),e;for(e=0;e<c;e++)if(a.charAt(e)!==b.charAt(e)){e--;break}if(1>e)return a.charAt(0)===b.charAt(0)&&"/"===a.charAt(0)?"/":"";if("/"!==a.charAt(e)||"/"!==b.charAt(e))e=a.substring(0,e).lastIndexOf("/");return a.substring(0,e+1)};e.withinString=function(a,b,c){c||(c={});var g=c.start||e.findUri.start,d=c.end||e.findUri.end,k=c.trim||e.findUri.trim,h=/[a-z0-9-]=["']?$/i;for(g.lastIndex=0;;){var n=g.exec(a);if(!n)break;n=n.index;if(c.ignoreHtml){var l=
|
||||
a.slice(Math.max(n-3,0),n);if(l&&h.test(l))continue}var l=n+a.slice(n).search(d),m=a.slice(n,l).replace(k,"");c.ignore&&c.ignore.test(m)||(l=n+m.length,m=b(m,n,l,a),a=a.slice(0,n)+m+a.slice(l),g.lastIndex=n+m.length)}g.lastIndex=0;return a};e.ensureValidHostname=function(a){if(a.match(e.invalid_hostname_characters)){if(!p)throw new TypeError("Hostname '"+a+"' contains characters other than [A-Z0-9.-] and Punycode.js is not available");if(p.toASCII(a).match(e.invalid_hostname_characters))throw new TypeError("Hostname '"+
|
||||
a+"' contains characters other than [A-Z0-9.-]");}};e.noConflict=function(a){if(a)return a={URI:this.noConflict()},URITemplate&&"function"==typeof URITemplate.noConflict&&(a.URITemplate=URITemplate.noConflict()),r&&"function"==typeof r.noConflict&&(a.IPv6=r.noConflict()),SecondLevelDomains&&"function"==typeof SecondLevelDomains.noConflict&&(a.SecondLevelDomains=SecondLevelDomains.noConflict()),a;w.URI===this&&(w.URI=C);return this};d.build=function(a){if(!0===a)this._deferred_build=!0;else if(void 0===
|
||||
a||this._deferred_build)this._string=e.build(this._parts),this._deferred_build=!1;return this};d.clone=function(){return new e(this)};d.valueOf=d.toString=function(){return this.build(!1)._string};q={protocol:"protocol",username:"username",password:"password",hostname:"hostname",port:"port"};u=function(a){return function(b,c){if(void 0===b)return this._parts[a]||"";this._parts[a]=b||null;this.build(!c);return this}};for(m in q)d[m]=u(q[m]);q={query:"?",fragment:"#"};u=function(a,b){return function(c,
|
||||
e){if(void 0===c)return this._parts[a]||"";null!==c&&(c+="",c.charAt(0)===b&&(c=c.substring(1)));this._parts[a]=c;this.build(!e);return this}};for(m in q)d[m]=u(m,q[m]);q={search:["?","query"],hash:["#","fragment"]};u=function(a,b){return function(c,e){var d=this[a](c,e);return"string"===typeof d&&d.length?b+d:d}};for(m in q)d[m]=u(q[m][1],q[m][0]);d.pathname=function(a,b){if(void 0===a||!0===a){var c=this._parts.path||(this._parts.hostname?"/":"");return a?e.decodePath(c):c}this._parts.path=a?e.recodePath(a):
|
||||
"/";this.build(!b);return this};d.path=d.pathname;d.href=function(a,b){var c;if(void 0===a)return this.toString();this._string="";this._parts=e._parts();var g=a instanceof e,d="object"===typeof a&&(a.hostname||a.path||a.pathname);a.nodeName&&(d=e.getDomAttribute(a),a=a[d]||"",d=!1);!g&&d&&void 0!==a.pathname&&(a=a.toString());if("string"===typeof a)this._parts=e.parse(a,this._parts);else if(g||d)for(c in g=g?a._parts:a,g)t.call(this._parts,c)&&(this._parts[c]=g[c]);else throw new TypeError("invalid input");
|
||||
this.build(!b);return this};d.is=function(a){var b=!1,c=!1,d=!1,f=!1,k=!1,h=!1,l=!1,m=!this._parts.urn;this._parts.hostname&&(m=!1,c=e.ip4_expression.test(this._parts.hostname),d=e.ip6_expression.test(this._parts.hostname),b=c||d,k=(f=!b)&&v&&v.has(this._parts.hostname),h=f&&e.idn_expression.test(this._parts.hostname),l=f&&e.punycode_expression.test(this._parts.hostname));switch(a.toLowerCase()){case "relative":return m;case "absolute":return!m;case "domain":case "name":return f;case "sld":return k;
|
||||
case "ip":return b;case "ip4":case "ipv4":case "inet4":return c;case "ip6":case "ipv6":case "inet6":return d;case "idn":return h;case "url":return!this._parts.urn;case "urn":return!!this._parts.urn;case "punycode":return l}return null};var D=d.protocol,E=d.port,F=d.hostname;d.protocol=function(a,b){if(void 0!==a&&a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(e.protocol_expression)))throw new TypeError("Protocol '"+a+"' contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return D.call(this,
|
||||
a,b)};d.scheme=d.protocol;d.port=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a&&(0===a&&(a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),a.match(/[^0-9]/))))throw new TypeError("Port '"+a+"' contains characters other than [0-9]");return E.call(this,a,b)};d.hostname=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a){var c={};e.parseHost(a,c);a=c.hostname}return F.call(this,a,b)};d.host=function(a,b){if(this._parts.urn)return void 0===a?"":this;
|
||||
if(void 0===a)return this._parts.hostname?e.buildHost(this._parts):"";e.parseHost(a,this._parts);this.build(!b);return this};d.authority=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?e.buildAuthority(this._parts):"";e.parseAuthority(a,this._parts);this.build(!b);return this};d.userinfo=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.username)return"";var c=e.buildUserinfo(this._parts);return c.substring(0,
|
||||
c.length-1)}"@"!==a[a.length-1]&&(a+="@");e.parseUserinfo(a,this._parts);this.build(!b);return this};d.resource=function(a,b){var c;if(void 0===a)return this.path()+this.search()+this.hash();c=e.parse(a);this._parts.path=c.path;this._parts.query=c.query;this._parts.fragment=c.fragment;this.build(!b);return this};d.subdomain=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.length-this.domain().length-
|
||||
1;return this._parts.hostname.substring(0,c)||""}c=this._parts.hostname.length-this.domain().length;c=this._parts.hostname.substring(0,c);c=RegExp("^"+s(c));a&&"."!==a.charAt(a.length-1)&&(a+=".");a&&e.ensureValidHostname(a);this._parts.hostname=this._parts.hostname.replace(c,a);this.build(!b);return this};d.domain=function(a,b){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(b=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.match(/\./g);
|
||||
if(c&&2>c.length)return this._parts.hostname;c=this._parts.hostname.length-this.tld(b).length-1;c=this._parts.hostname.lastIndexOf(".",c-1)+1;return this._parts.hostname.substring(c)||""}if(!a)throw new TypeError("cannot set domain empty");e.ensureValidHostname(a);!this._parts.hostname||this.is("IP")?this._parts.hostname=a:(c=RegExp(s(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(c,a));this.build(!b);return this};d.tld=function(a,b){if(this._parts.urn)return void 0===a?"":
|
||||
this;"boolean"===typeof a&&(b=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.lastIndexOf("."),c=this._parts.hostname.substring(c+1);return!0!==b&&v&&v.list[c.toLowerCase()]?v.get(this._parts.hostname)||c:c}if(a)if(a.match(/[^a-zA-Z0-9-]/))if(v&&v.is(a))c=RegExp(s(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(c,a);else throw new TypeError("TLD '"+a+"' contains characters other than [A-Z0-9]");else{if(!this._parts.hostname||
|
||||
this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");c=RegExp(s(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(c,a)}else throw new TypeError("cannot set TLD empty");this.build(!b);return this};d.directory=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var c=this._parts.path.length-this.filename().length-1,c=this._parts.path.substring(0,
|
||||
c)||(this._parts.hostname?"/":"");return a?e.decodePath(c):c}c=this._parts.path.length-this.filename().length;c=this._parts.path.substring(0,c);c=RegExp("^"+s(c));this.is("relative")||(a||(a="/"),"/"!==a.charAt(0)&&(a="/"+a));a&&"/"!==a.charAt(a.length-1)&&(a+="/");a=e.recodePath(a);this._parts.path=this._parts.path.replace(c,a);this.build(!b);return this};d.filename=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";
|
||||
var c=this._parts.path.lastIndexOf("/"),c=this._parts.path.substring(c+1);return a?e.decodePathSegment(c):c}c=!1;"/"===a.charAt(0)&&(a=a.substring(1));a.match(/\.?\//)&&(c=!0);var d=RegExp(s(this.filename())+"$");a=e.recodePath(a);this._parts.path=this._parts.path.replace(d,a);c?this.normalizePath(b):this.build(!b);return this};d.suffix=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";var c=this.filename(),d=c.lastIndexOf(".");
|
||||
if(-1===d)return"";c=c.substring(d+1);c=/^[a-z0-9%]+$/i.test(c)?c:"";return a?e.decodePathSegment(c):c}"."===a.charAt(0)&&(a=a.substring(1));if(c=this.suffix())d=a?RegExp(s(c)+"$"):RegExp(s("."+c)+"$");else{if(!a)return this;this._parts.path+="."+e.recodePath(a)}d&&(a=e.recodePath(a),this._parts.path=this._parts.path.replace(d,a));this.build(!b);return this};d.segment=function(a,b,c){var e=this._parts.urn?":":"/",d=this.path(),k="/"===d.substring(0,1),d=d.split(e);void 0!==a&&"number"!==typeof a&&
|
||||
(c=b,b=a,a=void 0);if(void 0!==a&&"number"!==typeof a)throw Error("Bad segment '"+a+"', must be 0-based integer");k&&d.shift();0>a&&(a=Math.max(d.length+a,0));if(void 0===b)return void 0===a?d:d[a];if(null===a||void 0===d[a])if(l(b)){d=[];a=0;for(var h=b.length;a<h;a++)if(b[a].length||d.length&&d[d.length-1].length)d.length&&!d[d.length-1].length&&d.pop(),d.push(b[a])}else{if(b||"string"===typeof b)""===d[d.length-1]?d[d.length-1]=b:d.push(b)}else b||"string"===typeof b&&b.length?d[a]=b:d.splice(a,
|
||||
1);k&&d.unshift("");return this.path(d.join(e),c)};d.segmentCoded=function(a,b,c){var d,f;"number"!==typeof a&&(c=b,b=a,a=void 0);if(void 0===b){a=this.segment(a,b,c);if(l(a))for(d=0,f=a.length;d<f;d++)a[d]=e.decode(a[d]);else a=void 0!==a?e.decode(a):void 0;return a}if(l(b))for(d=0,f=b.length;d<f;d++)b[d]=e.decode(b[d]);else b="string"===typeof b?e.encode(b):b;return this.segment(a,b,c)};var G=d.query;d.query=function(a,b){if(!0===a)return e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);
|
||||
if("function"===typeof a){var c=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace),d=a.call(this,c);this._parts.query=e.buildQuery(d||c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);this.build(!b);return this}return void 0!==a&&"string"!==typeof a?(this._parts.query=e.buildQuery(a,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!b),this):G.call(this,a,b)};d.setQuery=function(a,b,c){var d=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);
|
||||
if("object"===typeof a)for(var f in a)t.call(a,f)&&(d[f]=a[f]);else if("string"===typeof a)d[a]=void 0!==b?b:null;else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");this._parts.query=e.buildQuery(d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};d.addQuery=function(a,b,c){var d=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);e.addQuery(d,a,void 0===b?null:b);this._parts.query=
|
||||
e.buildQuery(d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};d.removeQuery=function(a,b,c){var d=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);e.removeQuery(d,a,b);this._parts.query=e.buildQuery(d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(c=b);this.build(!c);return this};d.hasQuery=function(a,b,c){var d=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);
|
||||
return e.hasQuery(d,a,b,c)};d.setSearch=d.setQuery;d.addSearch=d.addQuery;d.removeSearch=d.removeQuery;d.hasSearch=d.hasQuery;d.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()};d.normalizeProtocol=function(a){"string"===typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),
|
||||
this.build(!a));return this};d.normalizeHostname=function(a){this._parts.hostname&&(this.is("IDN")&&p?this._parts.hostname=p.toASCII(this._parts.hostname):this.is("IPv6")&&r&&(this._parts.hostname=r.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!a));return this};d.normalizePort=function(a){"string"===typeof this._parts.protocol&&this._parts.port===e.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a));return this};d.normalizePath=
|
||||
function(a){if(this._parts.urn||!this._parts.path||"/"===this._parts.path)return this;var b,c=this._parts.path,d="",f,k;"/"!==c.charAt(0)&&(b=!0,c="/"+c);c=c.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/");b&&(d=c.substring(1).match(/^(\.\.\/)+/)||"")&&(d=d[0]);for(;;){f=c.indexOf("/..");if(-1===f)break;else if(0===f){c=c.substring(3);continue}k=c.substring(0,f).lastIndexOf("/");-1===k&&(k=f);c=c.substring(0,k)+c.substring(f+3)}b&&this.is("relative")&&(c=d+c.substring(1));c=e.recodePath(c);
|
||||
this._parts.path=c;this.build(!a);return this};d.normalizePathname=d.normalizePath;d.normalizeQuery=function(a){"string"===typeof this._parts.query&&(this._parts.query.length?this.query(e.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!a));return this};d.normalizeFragment=function(a){this._parts.fragment||(this._parts.fragment=null,this.build(!a));return this};d.normalizeSearch=d.normalizeQuery;d.normalizeHash=d.normalizeFragment;d.iso8859=function(){var a=
|
||||
e.encode,b=e.decode;e.encode=escape;e.decode=decodeURIComponent;this.normalize();e.encode=a;e.decode=b;return this};d.unicode=function(){var a=e.encode,b=e.decode;e.encode=z;e.decode=unescape;this.normalize();e.encode=a;e.decode=b;return this};d.readable=function(){var a=this.clone();a.username("").password("").normalize();var b="";a._parts.protocol&&(b+=a._parts.protocol+"://");a._parts.hostname&&(a.is("punycode")&&p?(b+=p.toUnicode(a._parts.hostname),a._parts.port&&(b+=":"+a._parts.port)):b+=a.host());
|
||||
a._parts.hostname&&a._parts.path&&"/"!==a._parts.path.charAt(0)&&(b+="/");b+=a.path(!0);if(a._parts.query){for(var c="",d=0,f=a._parts.query.split("&"),k=f.length;d<k;d++){var h=(f[d]||"").split("="),c=c+("&"+e.decodeQuery(h[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"));void 0!==h[1]&&(c+="="+e.decodeQuery(h[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}b+="?"+c.substring(1)}return b+=e.decodeQuery(a.hash(),!0)};d.absoluteTo=function(a){var b=this.clone(),c=["protocol","username",
|
||||
"password","hostname","port"],d,f;if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a instanceof e||(a=new e(a));b._parts.protocol||(b._parts.protocol=a._parts.protocol);if(this._parts.hostname)return b;for(d=0;f=c[d];d++)b._parts[f]=a._parts[f];b._parts.path?".."===b._parts.path.substring(-2)&&(b._parts.path+="/"):(b._parts.path=a._parts.path,b._parts.query||(b._parts.query=a._parts.query));"/"!==b.path().charAt(0)&&(a=a.directory(),b._parts.path=(a?
|
||||
a+"/":"")+b._parts.path,b.normalizePath());b.build();return b};d.relativeTo=function(a){var b=this.clone().normalize(),c,d,f,k;if(b._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a=(new e(a)).normalize();c=b._parts;d=a._parts;f=b.path();k=a.path();if("/"!==f.charAt(0))throw Error("URI is already relative");if("/"!==k.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");c.protocol===d.protocol&&(c.protocol=null);if(c.username===
|
||||
d.username&&c.password===d.password&&null===c.protocol&&null===c.username&&null===c.password&&c.hostname===d.hostname&&c.port===d.port)c.hostname=null,c.port=null;else return b.build();if(f===k)return c.path="",b.build();a=e.commonPath(b.path(),a.path());if(!a)return b.build();d=d.path.substring(a.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");c.path=d+c.path.substring(a.length);return b.build()};d.equals=function(a){var b=this.clone();a=new e(a);var c={},d={},f={},k;b.normalize();a.normalize();
|
||||
if(b.toString()===a.toString())return!0;c=b.query();d=a.query();b.query("");a.query("");if(b.toString()!==a.toString()||c.length!==d.length)return!1;c=e.parseQuery(c,this._parts.escapeQuerySpace);d=e.parseQuery(d,this._parts.escapeQuerySpace);for(k in c)if(t.call(c,k)){if(!l(c[k])){if(c[k]!==d[k])return!1}else if(!A(c[k],d[k]))return!1;f[k]=!0}for(k in d)if(t.call(d,k)&&!f[k])return!1;return!0};d.duplicateQueryParameters=function(a){this._parts.duplicateQueryParameters=!!a;return this};d.escapeQuerySpace=
|
||||
function(a){this._parts.escapeQuerySpace=!!a;return this};return e});
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.Admin.Common {
|
||||
$(() => {
|
||||
@@ -0,0 +1 @@
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
@@ -1,5 +1,6 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/knockout.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jqueryui.d.ts" />
|
||||
/// <reference path="Typings/knockout.d.ts" />
|
||||
|
||||
declare var initWamsEncodingPresets: any[];
|
||||
declare var initDefaultWamsEncodingPresetIndex: number;
|
||||
@@ -95,4 +96,4 @@ module Orchard.Azure.MediaServices.Admin.Settings {
|
||||
active: localStorage && localStorage.getItem ? localStorage.getItem("selectedCloudMediaSettingsTab") : null
|
||||
}).show();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.AutoRefresh {
|
||||
// Periodically refresh elements.
|
||||
@@ -1,5 +1,5 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/jqueryui.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jqueryui.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.AssetEdit.Video {
|
||||
$(function () {
|
||||
@@ -1,5 +1,5 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/jqueryui.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jqueryui.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.AssetEdit {
|
||||
$(function() {
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/jqueryui.d.ts" />
|
||||
/// <reference path="typings/moment.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jqueryui.d.ts" />
|
||||
/// <reference path="Typings/moment.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.CloudVideoEdit {
|
||||
var requiredUploads: JQuery;
|
||||
@@ -1,5 +1,5 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/jqueryui.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jqueryui.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.CloudVideoEdit {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/jqueryui.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jqueryui.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.CloudVideoEdit {
|
||||
function hasCorsSupport() {
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
|
||||
($=> {
|
||||
var hasFocus = (videoId: number)=> {
|
||||
@@ -1,5 +1,5 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/underscore.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/underscore.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.VideoPlayer.Injectors {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/underscore.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/underscore.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.VideoPlayer.Injectors {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/underscore.d.ts" />
|
||||
/// <reference path="typings/uri.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/underscore.d.ts" />
|
||||
/// <reference path="Typings/uri.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.VideoPlayer.Injectors {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/underscore.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/underscore.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.VideoPlayer.Injectors {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/underscore.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/underscore.d.ts" />
|
||||
|
||||
module Orchard.Azure.MediaServices.VideoPlayer {
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
<Compile Include="Helpers\FileSizeFormatProvider.cs" />
|
||||
<Compile Include="Infrastructure\Assets\AssetDriver.cs" />
|
||||
<Compile Include="Helpers\NamespaceHelper.cs" />
|
||||
<Content Include="gulpfile.js" />
|
||||
<Content Include="Assets.json" />
|
||||
<Content Include="Images\Loader1.GIF" />
|
||||
<Content Include="Images\Thumbnail-Placeholder2.png" />
|
||||
<Content Include="Images\Thumbnail-Placeholder1.png" />
|
||||
@@ -165,136 +165,126 @@
|
||||
</Content>
|
||||
<Content Include="Readme.txt" />
|
||||
<Content Include="Scripts\cloudmedia-admin-common.js" />
|
||||
<Content Include="Scripts\cloudmedia-admin-common.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-admin-job.js" />
|
||||
<Content Include="Scripts\cloudmedia-admin-job.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-admin-settings.js" />
|
||||
<Content Include="Scripts\cloudmedia-admin-settings.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-autorefresh.js" />
|
||||
<Content Include="Scripts\cloudmedia-autorefresh.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-edit-asset-video.js" />
|
||||
<Content Include="Scripts\cloudmedia-edit-asset-video.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-edit-asset.js" />
|
||||
<Content Include="Scripts\cloudmedia-edit-asset.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-edit-cloudvideopart-direct.js" />
|
||||
<Content Include="Scripts\cloudmedia-edit-cloudvideopart-direct.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-edit-cloudvideopart-proxied.js" />
|
||||
<Content Include="Scripts\cloudmedia-edit-cloudvideopart-proxied.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-edit-cloudvideopart.js" />
|
||||
<Content Include="Scripts\cloudmedia-edit-cloudvideopart.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-metadata-cloudvideopart.js" />
|
||||
<Content Include="Scripts\cloudmedia-metadata-cloudvideopart.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-data.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-data.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-alt.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-alt.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-dash.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-dash.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-html5.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-html5.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-smp.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-smp.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors.min.js" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-main.js" />
|
||||
<Content Include="Scripts\lib\console-shim.min.js" />
|
||||
<Content Include="Scripts\lib\console-shim.js" />
|
||||
<Content Include="Scripts\lib\dash.all.js" />
|
||||
<Content Include="Scripts\lib\dash.min.js" />
|
||||
<Content Include="Scripts\lib\jquery.blockui.js" />
|
||||
<Content Include="Scripts\cloudmedia-admin-job.ts" />
|
||||
<Content Include="Scripts\cloudmedia-admin-common.ts" />
|
||||
<Content Include="Scripts\cloudmedia-autorefresh.ts" />
|
||||
<Content Include="Scripts\cloudmedia-edit-asset-video.ts" />
|
||||
<Content Include="Scripts\cloudmedia-edit-asset.ts" />
|
||||
<Content Include="Scripts\cloudmedia-edit-cloudvideopart-direct.ts" />
|
||||
<Content Include="Scripts\cloudmedia-edit-cloudvideopart.ts" />
|
||||
<Content Include="Scripts\cloudmedia-edit-cloudvideopart-proxied.ts" />
|
||||
<Content Include="Scripts\cloudmedia-metadata-cloudvideopart.ts" />
|
||||
<Content Include="Scripts\lib\jquery.fileupload-process.js" />
|
||||
<Content Include="Scripts\lib\jquery.fileupload-validate.js" />
|
||||
<Content Include="Scripts\lib\jquery.fileupload.js" />
|
||||
<Content Include="Scripts\lib\jstree.js" />
|
||||
<Content Include="Scripts\lib\jstree.min.js" />
|
||||
<Content Include="Scripts\lib\moment.js" />
|
||||
<Content Include="Scripts\lib\moment.min.js" />
|
||||
<Content Include="Scripts\lib\swfobject.js" />
|
||||
<Content Include="Scripts\lib\uri.js" />
|
||||
<Content Include="Styles\cloudmedia-admin-asset.css">
|
||||
<DependentUpon>cloudmedia-admin-asset.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-admin-asset.min.css">
|
||||
<DependentUpon>cloudmedia-admin-asset.css</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Scripts\lib\underscore.js" />
|
||||
<Content Include="Scripts\lib\underscore.min.js" />
|
||||
<Content Include="Styles\cloudmedia-admin-job.css">
|
||||
<DependentUpon>cloudmedia-admin-job.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-admin-job.min.css">
|
||||
<DependentUpon>cloudmedia-admin-job.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-admin-selecttask.css">
|
||||
<DependentUpon>cloudmedia-admin-selecttask.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-admin-selecttask.min.css">
|
||||
<DependentUpon>cloudmedia-admin-selecttask.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-admin-settings.css">
|
||||
<DependentUpon>cloudmedia-admin-settings.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-admin-settings.min.css">
|
||||
<DependentUpon>cloudmedia-admin-settings.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-edit-assets.css">
|
||||
<DependentUpon>cloudmedia-edit-assets.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-edit-assets.min.css">
|
||||
<DependentUpon>cloudmedia-edit-assets.css</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-edit-cloudvideopart.css">
|
||||
<DependentUpon>cloudmedia-edit-cloudvideopart.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-edit-cloudvideopart.min.css">
|
||||
<DependentUpon>cloudmedia-edit-cloudvideopart.css</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-edit-jobs.css">
|
||||
<DependentUpon>cloudmedia-edit-jobs.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-edit-jobs.min.css">
|
||||
<DependentUpon>cloudmedia-edit-jobs.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-progress.css">
|
||||
<DependentUpon>cloudmedia-progress.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-progress.min.css">
|
||||
<DependentUpon>cloudmedia-progress.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-tabs.css">
|
||||
<DependentUpon>cloudmedia-tabs.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-tabs.min.css">
|
||||
<DependentUpon>cloudmedia-tabs.css</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-videoplayer.css">
|
||||
<DependentUpon>cloudmedia-videoplayer.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\cloudmedia-videoplayer.min.css">
|
||||
<DependentUpon>cloudmedia-videoplayer.css</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-main.min.js" />
|
||||
<Content Include="Assets\JavaScript\Lib\console-shim.js" />
|
||||
<Content Include="Assets\JavaScript\Lib\dash.all.js" />
|
||||
<Content Include="Assets\JavaScript\Lib\jquery.blockui.js" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-admin-job.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-admin-common.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-autorefresh.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-edit-asset-video.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-edit-asset.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-edit-cloudvideopart-direct.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-edit-cloudvideopart.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-edit-cloudvideopart-proxied.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-metadata-cloudvideopart.ts" />
|
||||
<Content Include="Assets\JavaScript\Lib\jquery.fileupload-process.js" />
|
||||
<Content Include="Assets\JavaScript\Lib\jquery.fileupload-validate.js" />
|
||||
<Content Include="Assets\JavaScript\Lib\jquery.fileupload.js" />
|
||||
<Content Include="Assets\JavaScript\Lib\jstree.js" />
|
||||
<Content Include="Assets\JavaScript\Lib\moment.js" />
|
||||
<Content Include="Assets\JavaScript\Lib\swfobject.js" />
|
||||
<Content Include="Assets\JavaScript\Lib\uri.js" />
|
||||
<Content Include="Scripts\Lib\console-shim.js" />
|
||||
<Content Include="Scripts\Lib\console-shim.min.js" />
|
||||
<Content Include="Scripts\Lib\dash.all.js" />
|
||||
<Content Include="Scripts\Lib\dash.all.min.js" />
|
||||
<Content Include="Scripts\Lib\jquery.blockUI.js" />
|
||||
<Content Include="Scripts\Lib\jquery.blockUI.min.js" />
|
||||
<Content Include="Scripts\Lib\jquery.fileupload-process.js" />
|
||||
<Content Include="Scripts\Lib\jquery.fileupload-process.min.js" />
|
||||
<Content Include="Scripts\Lib\jquery.fileupload-validate.js" />
|
||||
<Content Include="Scripts\Lib\jquery.fileupload-validate.min.js" />
|
||||
<Content Include="Scripts\Lib\jquery.fileupload.js" />
|
||||
<Content Include="Scripts\Lib\jquery.fileupload.min.js" />
|
||||
<Content Include="Scripts\Lib\jstree.js" />
|
||||
<Content Include="Scripts\Lib\jstree.min.js" />
|
||||
<Content Include="Scripts\Lib\moment.js" />
|
||||
<Content Include="Scripts\Lib\moment.min.js" />
|
||||
<Content Include="Scripts\Lib\swfobject.js" />
|
||||
<Content Include="Scripts\Lib\swfobject.min.js" />
|
||||
<Content Include="Scripts\Lib\underscore.js" />
|
||||
<Content Include="Scripts\Lib\underscore.min.js" />
|
||||
<Content Include="Scripts\Lib\uri.js" />
|
||||
<Content Include="Scripts\Lib\uri.min.js" />
|
||||
<Content Include="Assets\JavaScript\Lib\underscore.js" />
|
||||
<Content Include="Styles\cloudmedia-admin-asset.css" />
|
||||
<Content Include="Styles\cloudmedia-admin-asset.min.css" />
|
||||
<Content Include="Styles\cloudmedia-admin-job.css" />
|
||||
<Content Include="Styles\cloudmedia-admin-job.min.css" />
|
||||
<Content Include="Styles\cloudmedia-admin-selecttask.css" />
|
||||
<Content Include="Styles\cloudmedia-admin-selecttask.min.css" />
|
||||
<Content Include="Styles\cloudmedia-admin-settings.css" />
|
||||
<Content Include="Styles\cloudmedia-admin-settings.min.css" />
|
||||
<Content Include="Styles\cloudmedia-edit-assets.css" />
|
||||
<Content Include="Styles\cloudmedia-edit-assets.min.css" />
|
||||
<Content Include="Styles\cloudmedia-edit-cloudvideopart.css" />
|
||||
<Content Include="Styles\cloudmedia-edit-cloudvideopart.min.css" />
|
||||
<Content Include="Styles\cloudmedia-edit-jobs.css" />
|
||||
<Content Include="Styles\cloudmedia-edit-jobs.min.css" />
|
||||
<Content Include="Styles\cloudmedia-progress.css" />
|
||||
<Content Include="Styles\cloudmedia-progress.min.css" />
|
||||
<Content Include="Styles\cloudmedia-tabs.css" />
|
||||
<Content Include="Styles\cloudmedia-tabs.min.css" />
|
||||
<Content Include="Styles\cloudmedia-videoplayer.css" />
|
||||
<Content Include="Styles\cloudmedia-videoplayer.min.css" />
|
||||
<Content Include="Styles\Images\AssetTreeView.png" />
|
||||
<Content Include="Styles\Lib\JsTree\themes\default\32px.png" />
|
||||
<Content Include="Styles\Lib\JsTree\themes\default\40px.png" />
|
||||
<Content Include="Styles\Lib\JsTree\themes\default\style.css" />
|
||||
<Content Include="Styles\Lib\JsTree\themes\default\style.min.css" />
|
||||
<Content Include="Styles\Lib\JsTree\themes\default\throbber.gif" />
|
||||
<Content Include="Styles\menu.cloudmedia-mediaproviders.css">
|
||||
<DependentUpon>menu.cloudmedia-mediaproviders.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\menu.cloudmedia-mediaproviders.less" />
|
||||
<Content Include="Styles\cloudmedia-edit-cloudvideopart.less" />
|
||||
<Content Include="Styles\menu.cloudmedia-mediaproviders.min.css">
|
||||
<DependentUpon>menu.cloudmedia-mediaproviders.css</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Assets\Less\menu.cloudmedia-mediaproviders.less" />
|
||||
<Content Include="Assets\Less\cloudmedia-edit-cloudvideopart.less" />
|
||||
<Content Include="Styles\menu.cloudmedia-mediaproviders.css" />
|
||||
<Content Include="Styles\menu.cloudmedia-mediaproviders.min.css" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Scripts\Web.config" />
|
||||
<Content Include="Styles\Web.config" />
|
||||
<Content Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-data.ts" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-dash.ts" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-html5.ts" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-alt.ts" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors-smp.ts" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-injectors.ts" />
|
||||
<Content Include="Scripts\cloudmedia-videoplayer-main.ts" />
|
||||
<Content Include="Scripts\typings\moment.d.ts" />
|
||||
<Content Include="Scripts\typings\underscore.d.ts" />
|
||||
<Content Include="Scripts\typings\uri.d.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-videoplayer-data.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-videoplayer-injectors-dash.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-videoplayer-injectors-html5.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-videoplayer-injectors-alt.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-videoplayer-injectors-smp.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-videoplayer-injectors.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-videoplayer-main.ts" />
|
||||
<Content Include="Assets\TypeScript\Typings\moment.d.ts" />
|
||||
<Content Include="Assets\TypeScript\Typings\underscore.d.ts" />
|
||||
<Content Include="Assets\TypeScript\Typings\uri.d.ts" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
|
||||
@@ -421,7 +411,7 @@
|
||||
<Content Include="Views\Settings\Index.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\cloudmedia-admin-settings.less" />
|
||||
<Content Include="Assets\Less\cloudmedia-admin-settings.less" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Media\Import.cshtml" />
|
||||
@@ -448,10 +438,10 @@
|
||||
<Content Include="Views\Parts\CloudVideo.SummaryAdmin.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Scripts\typings\jquery.d.ts" />
|
||||
<Content Include="Scripts\typings\jqueryui.d.ts" />
|
||||
<Content Include="Scripts\typings\knockout.d.ts" />
|
||||
<Content Include="Scripts\cloudmedia-admin-settings.ts" />
|
||||
<Content Include="Assets\TypeScript\Typings\jquery.d.ts" />
|
||||
<Content Include="Assets\TypeScript\Typings\jqueryui.d.ts" />
|
||||
<Content Include="Assets\TypeScript\Typings\knockout.d.ts" />
|
||||
<Content Include="Assets\TypeScript\cloudmedia-admin-settings.ts" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\CloudVideo.Edit.Assets.cshtml" />
|
||||
@@ -463,7 +453,7 @@
|
||||
<Content Include="Views\Job\Create.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\cloudmedia-admin-job.less" />
|
||||
<Content Include="Assets\Less\cloudmedia-admin-job.less" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\TaskSettingsEditor.cshtml" />
|
||||
@@ -475,7 +465,7 @@
|
||||
<Content Include="Views\EditorTemplates\TaskSettings\Encrypt.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\cloudmedia-tabs.less" />
|
||||
<Content Include="Assets\Less\cloudmedia-tabs.less" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Images\Web.config" />
|
||||
@@ -499,16 +489,16 @@
|
||||
<Content Include="Views\CloudVideo.Edit.UnpublishButton.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\cloudmedia-progress.less" />
|
||||
<Content Include="Assets\Less\cloudmedia-progress.less" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\cloudmedia-edit-assets.less" />
|
||||
<Content Include="Assets\Less\cloudmedia-edit-assets.less" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\cloudmedia-edit-jobs.less" />
|
||||
<Content Include="Assets\Less\cloudmedia-edit-jobs.less" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\cloudmedia-admin-selecttask.less" />
|
||||
<Content Include="Assets\Less\cloudmedia-admin-selecttask.less" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\CloudVideoEditor.Direct.cshtml" />
|
||||
@@ -526,7 +516,7 @@
|
||||
<Content Include="Views\EditorTemplates\Assets\Video.Files.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\cloudmedia-admin-asset.less" />
|
||||
<Content Include="Assets\Less\cloudmedia-admin-asset.less" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\CloudVideoPlayer.cshtml" />
|
||||
@@ -535,7 +525,7 @@
|
||||
<Content Include="Views\Parts\CloudVideo.Raw.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\cloudmedia-videoplayer.less" />
|
||||
<Content Include="Assets\Less\cloudmedia-videoplayer.less" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\EditorTemplates\Asset.Edit.General.cshtml" />
|
||||
@@ -553,11 +543,9 @@
|
||||
<Content Include="Content\Strobe Media Playback Notice.docx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Scripts\lib\MPEG Dash Notice.docx" />
|
||||
<Content Include="Styles\cloudmedia-admin-settings.css.map">
|
||||
<DependentUpon>cloudmedia-admin-settings.css</DependentUpon>
|
||||
</Content>
|
||||
<None Include="Assets\JavaScript\Lib\MPEG Dash Notice.docx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
||||
6
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/dash.all.min.js
vendored
Normal file
6
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/dash.all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/jquery.blockUI.min.js
vendored
Normal file
1
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/jquery.blockUI.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload"],e):e(window.jQuery)}(function(e){"use strict";var s=e.blueimp.fileupload.prototype.options.add;e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{processQueue:[],add:function(r,i){var o=e(this);i.process(function(){return o.fileupload("process",i)}),s.call(this,r,i)}},processActions:{},_processFile:function(s,r){var i=this,o=e.Deferred().resolveWith(i,[s]),t=o.promise();return this._trigger("process",null,s),e.each(s.processQueue,function(s,o){var n=function(s){return r.errorThrown?e.Deferred().rejectWith(i,[r]).promise():i.processActions[o.action].call(i,s,o)};t=t.pipe(n,o.always&&n)}),t.done(function(){i._trigger("processdone",null,s),i._trigger("processalways",null,s)}).fail(function(){i._trigger("processfail",null,s),i._trigger("processalways",null,s)}),t},_transformProcessQueue:function(s){var r=[];e.each(s.processQueue,function(){var i={},o=this.action,t=this.prefix===!0?o:this.prefix;e.each(this,function(r,o){i[r]="string"===e.type(o)&&"@"===o.charAt(0)?s[o.slice(1)||(t?t+r.charAt(0).toUpperCase()+r.slice(1):r)]:o}),r.push(i)}),s.processQueue=r},processing:function(){return this._processing},process:function(s){var r=this,i=e.extend({},this.options,s);return i.processQueue&&i.processQueue.length&&(this._transformProcessQueue(i),0===this._processing&&this._trigger("processstart"),e.each(s.files,function(o){var t=o?e.extend({},i):i,n=function(){return s.errorThrown?e.Deferred().rejectWith(r,[s]).promise():r._processFile(t,s)};t.index=o,r._processing+=1,r._processingQueue=r._processingQueue.pipe(n,n).always(function(){r._processing-=1,0===r._processing&&r._trigger("processstop")})})),this._processingQueue},_create:function(){this._super(),this._processing=0,this._processingQueue=e.Deferred().resolveWith(this).promise()}})});
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload-process"],e):e(window.jQuery)}(function(e){"use strict";e.blueimp.fileupload.prototype.options.processQueue.push({action:"validate",always:!0,acceptFileTypes:"@",maxFileSize:"@",minFileSize:"@",maxNumberOfFiles:"@",disabled:"@disableValidation"}),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{getNumberOfFiles:e.noop,messages:{maxNumberOfFiles:"Maximum number of files exceeded",acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small"}},processActions:{validate:function(i,l){if(l.disabled)return i;var r,s=e.Deferred(),t=this.options,o=i.files[i.index];return(l.minFileSize||l.maxFileSize)&&(r=o.size),"number"===e.type(l.maxNumberOfFiles)&&(t.getNumberOfFiles()||0)+i.files.length>l.maxNumberOfFiles?o.error=t.i18n("maxNumberOfFiles"):!l.acceptFileTypes||l.acceptFileTypes.test(o.type)||l.acceptFileTypes.test(o.name)?r>l.maxFileSize?o.error=t.i18n("maxFileSize"):"number"===e.type(r)&&r<l.minFileSize?o.error=t.i18n("minFileSize"):delete o.error:o.error=t.i18n("acceptFileTypes"),o.error||i.files.error?(i.files.error=!0,s.rejectWith(this,[i])):s.resolveWith(this,[i]),s.promise()}}})});
|
||||
1
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/jquery.fileupload.min.js
vendored
Normal file
1
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/jquery.fileupload.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/swfobject.min.js
vendored
Normal file
1
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/swfobject.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/uri.min.js
vendored
Normal file
1
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/Lib/uri.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
var Orchard;
|
||||
(function (Orchard) {
|
||||
var Azure;
|
||||
@@ -21,3 +21,5 @@ var Orchard;
|
||||
})(MediaServices = Azure.MediaServices || (Azure.MediaServices = {}));
|
||||
})(Azure = Orchard.Azure || (Orchard.Azure = {}));
|
||||
})(Orchard || (Orchard = {}));
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsb3VkbWVkaWEtYWRtaW4tY29tbW9uLnRzIl0sIm5hbWVzIjpbIk9yY2hhcmQiLCJPcmNoYXJkLkF6dXJlIiwiT3JjaGFyZC5BenVyZS5NZWRpYVNlcnZpY2VzIiwiT3JjaGFyZC5BenVyZS5NZWRpYVNlcnZpY2VzLkFkbWluIiwiT3JjaGFyZC5BenVyZS5NZWRpYVNlcnZpY2VzLkFkbWluLkNvbW1vbiJdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDO0FBRTVDLElBQU8sT0FBTyxDQVNiO0FBVEQsV0FBTyxPQUFPO0lBQUNBLElBQUFBLEtBQUtBLENBU25CQTtJQVRjQSxXQUFBQSxLQUFLQTtRQUFDQyxJQUFBQSxhQUFhQSxDQVNqQ0E7UUFUb0JBLFdBQUFBLGFBQWFBO1lBQUNDLElBQUFBLEtBQUtBLENBU3ZDQTtZQVRrQ0EsV0FBQUEsS0FBS0E7Z0JBQUNDLElBQUFBLE1BQU1BLENBUzlDQTtnQkFUd0NBLFdBQUFBLE1BQU1BLEVBQUNBLENBQUNBO29CQUM3Q0MsQ0FBQ0EsQ0FBQ0E7d0JBQ0VBLENBQUNBLENBQUNBLE1BQU1BLENBQUNBLENBQUNBLEVBQUVBLENBQUNBLE9BQU9BLEVBQUVBLHFDQUFxQ0EsRUFBRUEsVUFBU0EsQ0FBQ0E7NEJBQ25FLElBQUksTUFBTSxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLENBQUM7NEJBRXBDLEVBQUUsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDO2dDQUNqQixDQUFDLENBQUMsY0FBYyxFQUFFLENBQUM7d0JBQzNCLENBQUMsQ0FBQ0EsQ0FBQ0E7b0JBQ1BBLENBQUNBLENBQUNBLENBQUNBO2dCQUNQQSxDQUFDQSxFQVR3Q0QsTUFBTUEsR0FBTkEsWUFBTUEsS0FBTkEsWUFBTUEsUUFTOUNBO1lBQURBLENBQUNBLEVBVGtDRCxLQUFLQSxHQUFMQSxtQkFBS0EsS0FBTEEsbUJBQUtBLFFBU3ZDQTtRQUFEQSxDQUFDQSxFQVRvQkQsYUFBYUEsR0FBYkEsbUJBQWFBLEtBQWJBLG1CQUFhQSxRQVNqQ0E7SUFBREEsQ0FBQ0EsRUFUY0QsS0FBS0EsR0FBTEEsYUFBS0EsS0FBTEEsYUFBS0EsUUFTbkJBO0FBQURBLENBQUNBLEVBVE0sT0FBTyxLQUFQLE9BQU8sUUFTYiIsImZpbGUiOiJjbG91ZG1lZGlhLWFkbWluLWNvbW1vbi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCJUeXBpbmdzL2pxdWVyeS5kLnRzXCIgLz5cclxuXHJcbm1vZHVsZSBPcmNoYXJkLkF6dXJlLk1lZGlhU2VydmljZXMuQWRtaW4uQ29tbW9uIHtcclxuICAgICQoKCkgPT4ge1xyXG4gICAgICAgICQoXCJmb3JtXCIpLm9uKFwiY2xpY2tcIiwgXCJidXR0b25bZGF0YS1wcm9tcHRdLCBhW2RhdGEtcHJvbXB0XVwiLCBmdW5jdGlvbihlKSB7XHJcbiAgICAgICAgICAgIHZhciBwcm9tcHQgPSAkKHRoaXMpLmRhdGEoXCJwcm9tcHRcIik7XHJcblxyXG4gICAgICAgICAgICBpZiAoIWNvbmZpcm0ocHJvbXB0KSlcclxuICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICB9KTtcclxuICAgIH0pO1xyXG59ICJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|
||||
1
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/cloudmedia-admin-common.min.js
vendored
Normal file
1
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Scripts/cloudmedia-admin-common.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var Orchard;!function(n){var r;!function(n){var r;!function(n){var r;!function(n){var r;!function(n){$(function(){$("form").on("click","button[data-prompt], a[data-prompt]",function(n){var r=$(this).data("prompt");confirm(r)||n.preventDefault()})})}(r=n.Common||(n.Common={}))}(r=n.Admin||(n.Admin={}))}(r=n.MediaServices||(n.MediaServices={}))}(r=n.Azure||(n.Azure={}))}(Orchard||(Orchard={}));
|
||||
@@ -1 +1,3 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="Typings/jquery.d.ts" />
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsb3VkbWVkaWEtYWRtaW4tam9iLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QyIsImZpbGUiOiJjbG91ZG1lZGlhLWFkbWluLWpvYi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCJUeXBpbmdzL2pxdWVyeS5kLnRzXCIgLz4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user