mirror of https://github.com/abpframework/abp.git
15 changed files with 16 additions and 281 deletions
@ -1,6 +1,6 @@ |
|||
[ |
|||
{ |
|||
"outputFile": "wwwroot/styles/libs/datatables.css", |
|||
"inputFile": "wwwroot/styles/libs/datatables.scss" |
|||
"outputFile": "wwwroot/libs/abp/aspnetcore.mvc.ui.theme.shared/datatables/datatables.css", |
|||
"inputFile": "wwwroot/libs/abp/aspnetcore.mvc.ui.theme.shared/datatables/datatables.scss" |
|||
} |
|||
] |
|||
@ -1,32 +0,0 @@ |
|||
module.exports = { |
|||
mappings: { |
|||
//jQuery
|
|||
"@node_modules/jquery/dist/jquery.js": "@libs/jquery/dist/", |
|||
|
|||
//jQuery-Form
|
|||
"@node_modules/jquery-form/dist/jquery.form.min.js": "@libs/jquery-form/dist/", |
|||
|
|||
//jQuery-Validation
|
|||
"@node_modules/jquery-validation/dist/jquery.validate.js": "@libs/jquery-validation/dist/", |
|||
"@node_modules/jquery-validation/dist/localization/*.*": "@libs/jquery-validation/dist/localization/", |
|||
|
|||
//jQuery-Validation-Unobtrusive
|
|||
"@node_modules/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.js": "@libs/jquery-validation-unobtrusive/dist/", |
|||
|
|||
//Bootstrap
|
|||
"@node_modules/bootstrap/dist/css/bootstrap.css": "@libs/bootstrap/dist/css/", |
|||
"@node_modules/bootstrap/dist/js/bootstrap.bundle.js": "@libs/bootstrap/dist/js/", |
|||
|
|||
//Font-Awesome
|
|||
"@node_modules/font-awesome/css/font-awesome.css": "@libs/font-awesome/css/", |
|||
"@node_modules/font-awesome/fonts/*.*": "@libs/font-awesome/fonts/", |
|||
|
|||
//Datatables
|
|||
"@node_modules/datatables.net/js/jquery.dataTables.js": "@libs/datatables.net/js/", |
|||
"@node_modules/datatables.net-bs4/css/dataTables.bootstrap4.css": "@libs/datatables.net-bs4/css/", |
|||
"@node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js": "@libs/datatables.net-bs4/js/", |
|||
|
|||
//Vue
|
|||
"@node_modules/vue/dist/vue.js": "@libs/vue/dist/" |
|||
} |
|||
} |
|||
@ -1,17 +0,0 @@ |
|||
{ |
|||
"version": "0.2.0", |
|||
"name": "@abp/aspnetcore.mvc.ui.theme.basic", |
|||
"private": false, |
|||
"dependencies": { |
|||
"@abp/aspnetcore.mvc.ui": "^0.2.0", |
|||
"bootstrap": "^4.1.0", |
|||
"font-awesome": "^4.7.0", |
|||
"jquery": "^3.3.1", |
|||
"jquery-form": "^4.2.2", |
|||
"jquery-validation": "^1.17.0", |
|||
"jquery-validation-unobtrusive": "^3.2.9", |
|||
"vue": "^2.5.16", |
|||
"datatables.net": "^1.10.16", |
|||
"datatables.net-bs4": "^1.10.16" |
|||
} |
|||
} |
|||
@ -1,89 +0,0 @@ |
|||
/** |
|||
* abp.ResourceLoader can be used to load scripts when needed. |
|||
* It ensures that every script is only loaded once. |
|||
* |
|||
* TODO: Add a loadStyle method |
|||
*/ |
|||
var abp = abp || {}; |
|||
(function ($) { |
|||
|
|||
/* UrlStates enum */ |
|||
var UrlStates = { |
|||
LOADING: 'LOADING', |
|||
LOADED: 'LOADED', |
|||
FAILED: 'FAILED' |
|||
}; |
|||
|
|||
/* UrlInfo class */ |
|||
function UrlInfo() { |
|||
this.state = UrlStates.LOADING; |
|||
this.loadCallbacks = []; |
|||
this.failCallbacks = []; |
|||
} |
|||
|
|||
UrlInfo.prototype.succeed = function () { |
|||
this.state = UrlStates.LOADED; |
|||
for (var i = 0; i < this.loadCallbacks.length; i++) { |
|||
this.loadCallbacks[i](); |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.failed = function () { |
|||
this.state = UrlStates.FAILED; |
|||
for (var i = 0; i < this.failCallbacks.length; i++) { |
|||
this.failCallbacks[i](); |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { |
|||
switch (this.state) { |
|||
case UrlStates.LOADED: |
|||
loadCallback && loadCallback(); |
|||
break; |
|||
case UrlStates.FAILED: |
|||
failCallback && failCallback(); |
|||
break; |
|||
case UrlStates.LOADING: |
|||
this.addCallbacks(loadCallback, failCallback); |
|||
break; |
|||
} |
|||
}; |
|||
|
|||
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { |
|||
loadCallback && this.loadCallbacks.push(loadCallback); |
|||
failCallback && this.failCallbacks.push(failCallback); |
|||
}; |
|||
|
|||
/* ResourceLoader API */ |
|||
|
|||
abp.ResourceLoader = (function () { |
|||
|
|||
var _urlInfos = {}; |
|||
|
|||
var _loadScript = function (url, loadCallback, failCallback) { |
|||
|
|||
var urlInfo = _urlInfos[url]; |
|||
|
|||
if (urlInfo) { |
|||
urlInfo.handleCallbacks(loadCallback, failCallback); |
|||
return; |
|||
} |
|||
|
|||
_urlInfos[url] = urlInfo = new UrlInfo(); |
|||
urlInfo.addCallbacks(loadCallback, failCallback); |
|||
|
|||
$.getScript(url) |
|||
.done(function (script, textStatus) { |
|||
urlInfo.succeed(); |
|||
}) |
|||
.fail(function (jqxhr, settings, exception) { |
|||
urlInfo.failed(); |
|||
}); |
|||
}; |
|||
|
|||
return { |
|||
loadScript: _loadScript |
|||
} |
|||
})(); |
|||
|
|||
})(jQuery); |
|||
@ -1,94 +0,0 @@ |
|||
"use strict"; |
|||
|
|||
(function () { |
|||
|
|||
var taskName = 'aspnetcore.mvc.ui.copy-resources'; |
|||
|
|||
var gulp = require("gulp"), |
|||
merge = require("merge-stream"), |
|||
rimraf = require("rimraf"), |
|||
path = require("path"), |
|||
extendObject = require('extend-object'); |
|||
|
|||
function init(rootMappingFilePath) { |
|||
var resourceMapping = buildResourceMapping(rootMappingFilePath); |
|||
|
|||
function replaceAliases(text) { |
|||
if (!resourceMapping.aliases) { |
|||
return text; |
|||
} |
|||
|
|||
for (var alias in resourceMapping.aliases) { |
|||
if (!resourceMapping.aliases.hasOwnProperty(alias)) { |
|||
continue; |
|||
} |
|||
|
|||
text = replaceAll(text, alias, resourceMapping.aliases[alias]); |
|||
} |
|||
|
|||
return text; |
|||
} |
|||
|
|||
function replaceAll(text, search, replacement) { |
|||
return text.replace(new RegExp(search, 'g'), replacement); |
|||
} |
|||
|
|||
function cleanFiles() { |
|||
if (resourceMapping.clean) { |
|||
for (var i = 0; i < resourceMapping.clean.length; i++) { |
|||
rimraf.sync(replaceAliases(resourceMapping.clean[i]) + '/**/*', { force: true }); |
|||
} |
|||
} |
|||
} |
|||
|
|||
function buildResourceMapping(mappingFilePath) { |
|||
var resourcemapping = require(mappingFilePath); |
|||
|
|||
if (resourcemapping.imports && resourcemapping.imports.length) { |
|||
|
|||
var aliases = {}; |
|||
var mappings = {}; |
|||
|
|||
for (var i = 0; i < resourcemapping.imports.length; i++) { |
|||
|
|||
var importedMappingFilePath = path.join(path.dirname(mappingFilePath), resourcemapping.imports[i]); |
|||
var importedResourceMapping = buildResourceMapping(importedMappingFilePath); |
|||
extendObject(aliases, importedResourceMapping.aliases); |
|||
extendObject(mappings, importedResourceMapping.mappings); |
|||
} |
|||
|
|||
extendObject(aliases, resourcemapping.aliases); |
|||
extendObject(mappings, resourcemapping.mappings); |
|||
|
|||
resourcemapping.aliases = aliases; |
|||
resourcemapping.mappings = mappings; |
|||
} |
|||
|
|||
return resourcemapping; |
|||
} |
|||
|
|||
gulp.task(taskName, |
|||
function () { |
|||
cleanFiles(); |
|||
|
|||
var tasks = []; |
|||
|
|||
for (var mapping in resourceMapping.mappings) { |
|||
if (resourceMapping.mappings.hasOwnProperty(mapping)) { |
|||
var source = replaceAliases(mapping); |
|||
var destination = replaceAliases(resourceMapping.mappings[mapping]); |
|||
tasks.push( |
|||
gulp.src(source).pipe(gulp.dest(destination)) |
|||
); |
|||
} |
|||
} |
|||
|
|||
return merge(tasks); |
|||
}); |
|||
} |
|||
|
|||
module.exports = { |
|||
taskName: taskName, |
|||
init: init |
|||
}; |
|||
})(); |
|||
@ -1,13 +0,0 @@ |
|||
{ |
|||
"version": "0.2.0", |
|||
"name": "@abp/aspnetcore.mvc.ui", |
|||
"private": false, |
|||
"dependencies": { |
|||
"ansi-colors": "^1.1.0", |
|||
"gulp": "^3.9.1", |
|||
"merge-stream": "^1.0.1", |
|||
"rimraf": "^2.6.2", |
|||
"extend-object": "^1.0.0", |
|||
"path": "^0.12.7" |
|||
} |
|||
} |
|||
Loading…
Reference in new issue