mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge branch '1.9.x' into dev
This commit is contained in:
@@ -13,7 +13,7 @@ var glob = require("glob"),
|
|||||||
uglify = require("gulp-uglify"),
|
uglify = require("gulp-uglify"),
|
||||||
rename = require("gulp-rename"),
|
rename = require("gulp-rename"),
|
||||||
concat = require("gulp-concat"),
|
concat = require("gulp-concat"),
|
||||||
header = require("gulp-header")
|
header = require("gulp-header");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** GULP TASKS
|
** GULP TASKS
|
||||||
@@ -39,10 +39,17 @@ gulp.task("rebuild", function () {
|
|||||||
|
|
||||||
// Continuous watch (each asset group is built whenever one of its inputs changes).
|
// Continuous watch (each asset group is built whenever one of its inputs changes).
|
||||||
gulp.task("watch", function () {
|
gulp.task("watch", function () {
|
||||||
|
var pathWin32 = require("path");
|
||||||
getAssetGroups().forEach(function (assetGroup) {
|
getAssetGroups().forEach(function (assetGroup) {
|
||||||
gulp.watch(assetGroup.inputPaths, function (event) {
|
var watchPaths = assetGroup.inputPaths.concat(assetGroup.watchPaths);
|
||||||
console.log("Asset file '" + event.path + "' was " + event.type + ", rebuilding output '" + assetGroup.outputPath + "'.");
|
gulp.watch(watchPaths, function (event) {
|
||||||
var task = createAssetGroupTask(assetGroup);
|
var isConcat = path.basename(assetGroup.outputFileName, path.extname(assetGroup.outputFileName)) !== "@";
|
||||||
|
if (isConcat)
|
||||||
|
console.log("Asset file '" + event.path + "' was " + event.type + ", rebuilding asset group with output '" + assetGroup.outputPath + "'.");
|
||||||
|
else
|
||||||
|
console.log("Asset file '" + event.path + "' was " + event.type + ", rebuilding asset group.");
|
||||||
|
var doRebuild = true;
|
||||||
|
var task = createAssetGroupTask(assetGroup, doRebuild);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -69,6 +76,12 @@ function resolveAssetGroupPaths(assetGroup, assetManifestPath) {
|
|||||||
assetGroup.inputPaths = assetGroup.inputs.map(function (inputPath) {
|
assetGroup.inputPaths = assetGroup.inputs.map(function (inputPath) {
|
||||||
return path.join(assetGroup.basePath, inputPath);
|
return path.join(assetGroup.basePath, inputPath);
|
||||||
});
|
});
|
||||||
|
assetGroup.watchPaths = [];
|
||||||
|
if (!!assetGroup.watch) {
|
||||||
|
assetGroup.watchPaths = assetGroup.watch.map(function (watchPath) {
|
||||||
|
return path.join(assetGroup.basePath, watchPath);
|
||||||
|
});
|
||||||
|
}
|
||||||
assetGroup.outputPath = path.join(assetGroup.basePath, assetGroup.output);
|
assetGroup.outputPath = path.join(assetGroup.basePath, assetGroup.output);
|
||||||
assetGroup.outputDir = path.dirname(assetGroup.outputPath);
|
assetGroup.outputDir = path.dirname(assetGroup.outputPath);
|
||||||
assetGroup.outputFileName = path.basename(assetGroup.output);
|
assetGroup.outputFileName = path.basename(assetGroup.output);
|
||||||
@@ -95,6 +108,7 @@ function buildCssPipeline(assetGroup, doRebuild) {
|
|||||||
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
||||||
});
|
});
|
||||||
var doConcat = path.basename(assetGroup.outputFileName, ".css") !== "@";
|
var doConcat = path.basename(assetGroup.outputFileName, ".css") !== "@";
|
||||||
|
var generateSourceMaps = assetGroup.hasOwnProperty("generateSourceMaps") ? assetGroup.generateSourceMaps : true;
|
||||||
return gulp.src(assetGroup.inputPaths)
|
return gulp.src(assetGroup.inputPaths)
|
||||||
.pipe(gulpif(!doRebuild,
|
.pipe(gulpif(!doRebuild,
|
||||||
gulpif(doConcat,
|
gulpif(doConcat,
|
||||||
@@ -104,7 +118,7 @@ function buildCssPipeline(assetGroup, doRebuild) {
|
|||||||
ext: ".css"
|
ext: ".css"
|
||||||
}))))
|
}))))
|
||||||
.pipe(plumber())
|
.pipe(plumber())
|
||||||
.pipe(sourcemaps.init())
|
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
|
||||||
.pipe(gulpif("*.less", less()))
|
.pipe(gulpif("*.less", less()))
|
||||||
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
|
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
|
||||||
.pipe(autoprefixer({ browsers: ["last 2 versions"] }))
|
.pipe(autoprefixer({ browsers: ["last 2 versions"] }))
|
||||||
@@ -115,7 +129,7 @@ function buildCssPipeline(assetGroup, doRebuild) {
|
|||||||
// "** Any changes made directly to this file will be overwritten next time the Gulp compilation runs.\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" +
|
// "** For more information, see the Readme.txt file in the Gulp solution folder.\n" +
|
||||||
// "*/\n\n"))
|
// "*/\n\n"))
|
||||||
.pipe(sourcemaps.write())
|
.pipe(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||||
.pipe(gulp.dest(assetGroup.outputDir))
|
.pipe(gulp.dest(assetGroup.outputDir))
|
||||||
.pipe(minify())
|
.pipe(minify())
|
||||||
.pipe(rename({
|
.pipe(rename({
|
||||||
@@ -131,6 +145,7 @@ function buildJsPipeline(assetGroup, doRebuild) {
|
|||||||
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
||||||
});
|
});
|
||||||
var doConcat = path.basename(assetGroup.outputFileName, ".js") !== "@";
|
var doConcat = path.basename(assetGroup.outputFileName, ".js") !== "@";
|
||||||
|
var generateSourceMaps = assetGroup.hasOwnProperty("generateSourceMaps") ? assetGroup.generateSourceMaps : true;
|
||||||
return gulp.src(assetGroup.inputPaths)
|
return gulp.src(assetGroup.inputPaths)
|
||||||
.pipe(gulpif(!doRebuild,
|
.pipe(gulpif(!doRebuild,
|
||||||
gulpif(doConcat,
|
gulpif(doConcat,
|
||||||
@@ -140,7 +155,7 @@ function buildJsPipeline(assetGroup, doRebuild) {
|
|||||||
ext: ".js"
|
ext: ".js"
|
||||||
}))))
|
}))))
|
||||||
.pipe(plumber())
|
.pipe(plumber())
|
||||||
.pipe(sourcemaps.init())
|
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
|
||||||
.pipe(gulpif("*.ts", typescript({
|
.pipe(gulpif("*.ts", typescript({
|
||||||
declaration: false,
|
declaration: false,
|
||||||
//noImplicitAny: true,
|
//noImplicitAny: true,
|
||||||
@@ -155,7 +170,7 @@ function buildJsPipeline(assetGroup, doRebuild) {
|
|||||||
// "** Any changes made directly to this file will be overwritten next time the Gulp compilation runs.\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" +
|
// "** For more information, see the Readme.txt file in the Gulp solution folder.\n" +
|
||||||
// "*/\n\n"))
|
// "*/\n\n"))
|
||||||
.pipe(sourcemaps.write())
|
.pipe(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||||
.pipe(gulp.dest(assetGroup.outputDir))
|
.pipe(gulp.dest(assetGroup.outputDir))
|
||||||
.pipe(uglify())
|
.pipe(uglify())
|
||||||
.pipe(rename({
|
.pipe(rename({
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -20,7 +20,7 @@ namespace Orchard.MediaLibrary.Services {
|
|||||||
private readonly IStorageProvider _storageProvider;
|
private readonly IStorageProvider _storageProvider;
|
||||||
private readonly IEnumerable<IMediaFactorySelector> _mediaFactorySelectors;
|
private readonly IEnumerable<IMediaFactorySelector> _mediaFactorySelectors;
|
||||||
|
|
||||||
private static char[] HttpUnallowed = new char[] { '<', '>', '*', '%', '&', ':', '\\', '?' };
|
private static char[] HttpUnallowed = new char[] { '<', '>', '*', '%', '&', ':', '\\', '?', '#' };
|
||||||
|
|
||||||
public MediaLibraryService(
|
public MediaLibraryService(
|
||||||
IOrchardServices orchardServices,
|
IOrchardServices orchardServices,
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ namespace Orchard.Users.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(String.IsNullOrWhiteSpace(username)){
|
if(String.IsNullOrWhiteSpace(username)){
|
||||||
ModelState.AddModelError("userNameOrEmail", T("Invalid username or E-mail."));
|
ModelState.AddModelError("username", T("You must specify a username or e-mail."));
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user