Commit 549c60ab by 施宇

del

parents 3e65dc13 62ea9c7b
<!DOCTYPE html>
<html>
<head>
<title>杀毒</title>
<meta charset="UTF-8"/>
<meta name="keywords" content="xxx">
<meta name="description" content="xxx">
<script type="text/javascript">
//JS环境变量
var PUBLICXK=window.location.origin+"/res/";
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/global/global.min.css?v='+new Date().getTime()+'">');
</script>
<script type="text/javascript">
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/index/index.min.css?v='+new Date().getTime()+'">');
</script>
</head>
<body>
<div>头部菜单</div>
<ul>
<li class="act" >
<a href="/">首页</a>
</li>
<li >
<a href="/view/test1">test1</a>
</li>
<li >
<a href="/view/test2">test2</a>
</li>
</ul>
<div class="index">
hello world999!
<h1>我是首页2233</h1>
</div>
<div>底部00</div>
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/global/sea.min.js?v='+new Date().getTime()+'"><\/script\>');
document.write('<script src="'+PUBLICXK+'js/global/main.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/index/index.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
</body>
</html>
\ No newline at end of file
.index{background:red;font-size:15px}
\ No newline at end of file
.index{background:red}.index .div{color:#fff;font-size:14px}.act{color:red}
\ No newline at end of file
This diff could not be displayed because it is too large.
define('common_function',function(require) {
console.log("公共函数!9969966")
});
\ No newline at end of file
seajs.config({
base: PUBLICXK + 'js/global/module',
alias: {
'publicxk':"publicxk.min.js", //包含jq.js director.js
'common_function':"common_function.js", //公共base函数
'router':"router.js", //路由
},
//预加载模块
preload: ['publicxk','common_function']
});
This diff could not be displayed because it is too large.
!function(s,o){if(!s.seajs){var u=s.seajs={version:"2.2.0"},c=u.data={},i=B("Object"),n=B("String"),f=Array.isArray||B("Array"),l=B("Function"),e=0,a=c.events={};u.on=function(e,t){return(a[e]||(a[e]=[])).push(t),u},u.off=function(e,t){if(!e&&!t)return a=c.events={},u;var r=a[e];if(r)if(t)for(var n=r.length-1;0<=n;n--)r[n]===t&&r.splice(n,1);else delete a[e];return u};var t,d=u.emit=function(e,t){var r,n=a[e];if(n)for(n=n.slice();r=n.shift();)r(t);return u},r=/[^?#]*\//,v=/\/\.\//g,h=/\/[^/]+\/\.\.\//,p=/([^:/])\/\//g,g=/^([^/:]+)(\/.+)$/,E=/{([^{]+)}/g,m=/^\/\/.|:\//,y=/^.*?\/\/.*?\//,_=document,b=V(_.URL),A=_.scripts,T=_.getElementById("seajsnode")||A[A.length-1],D=V(((t=T).hasAttribute?t.src:t.getAttribute("src",4))||b);u.resolve=function(e,t){if(!e)return"";var r=H(e=function(e){var t=e.length-1,r=e.charAt(t);return"#"===r?e.substring(0,t):".js"===e.substring(t-2)||0<e.indexOf("?")||".css"===e.substring(t-3)||"/"===r?e:e+".js"}(e=function(e){var r=c.vars;return r&&-1<e.indexOf("{")&&(e=e.replace(E,function(e,t){return n(r[t])?r[t]:e})),e}(e=function(e){var t,r=c.paths;return r&&(t=e.match(g))&&n(r[t[1]])&&(e=r[t[1]]+t[2]),e}(e=function(e){var t=c.alias;return t&&n(t[e])?t[e]:e}(e)))),t);return r=function(e){var t=c.map,r=e;if(t)for(var n=0,a=t.length;n<a;n++){var i=t[n];if((r=l(i)?i(e)||e:e.replace(i[0],i[1]))!==e)break}return r}(r)};var w,S,x=_.head||_.getElementsByTagName("head")[0]||_.documentElement,N=x.getElementsByTagName("base")[0],O=/\.css(?:\?|$)/i,U=+navigator.userAgent.replace(/.*AppleWebKit\/(\d+)\..*/,"$1")<536;u.request=function(e,t,r){var n=O.test(e),a=_.createElement(n?"link":"script");if(r){var i=l(r)?r(e):r;i&&(a.charset=i)}!function(e,t,r,n){var a="onload"in e;if(r&&(U||!a))return setTimeout(function(){!function e(t,r){var n=t.sheet;var a;if(U)n&&(a=!0);else if(n)try{n.cssRules&&(a=!0)}catch(e){"NS_ERROR_DOM_SECURITY_ERR"===e.name&&(a=!0)}setTimeout(function(){a?r():e(t,r)},20)}(e,t)},1);a?(e.onload=i,e.onerror=function(){d("error",{uri:n,node:e}),i()}):e.onreadystatechange=function(){/loaded|complete/.test(e.readyState)&&i()};function i(){e.onload=e.onerror=e.onreadystatechange=null,r||c.debug||x.removeChild(e),e=null,t()}}(a,t,n,e),n?(a.rel="stylesheet",a.href=e):(a.async=!0,a.src=e),w=a,N?x.insertBefore(a,N):x.appendChild(a),w=null};var q,C=/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\/\*[\S\s]*?\*\/|\/(?:\\\/|[^\/\r\n])+\/(?=[^\/])|\/\/.*|\.\s*require|(?:^|[^$])\brequire\s*\(\s*(["'])(.+?)\1\s*\)/g,I=/\\\\/g,j=u.cache={},G={},R={},L={},$=M.STATUS={FETCHING:1,SAVED:2,LOADING:3,LOADED:4,EXECUTING:5,EXECUTED:6};M.prototype.resolve=function(){for(var e=this.dependencies,t=[],r=0,n=e.length;r<n;r++)t[r]=M.resolve(e[r],this.uri);return t},M.prototype.load=function(){var e=this;if(!(e.status>=$.LOADING)){e.status=$.LOADING;var t=e.resolve();d("load",t);for(var r,n=e._remain=t.length,a=0;a<n;a++)(r=M.get(t[a])).status<$.LOADED?r._waitings[e.uri]=(r._waitings[e.uri]||0)+1:e._remain--;if(0!==e._remain){var i={};for(a=0;a<n;a++)(r=j[t[a]]).status<$.FETCHING?r.fetch(i):r.status===$.SAVED&&r.load();for(var s in i)i.hasOwnProperty(s)&&i[s]()}else e.onload()}},M.prototype.onload=function(){var e=this;e.status=$.LOADED,e.callback&&e.callback();var t,r,n=e._waitings;for(t in n)n.hasOwnProperty(t)&&((r=j[t])._remain-=n[t],0===r._remain&&r.onload());delete e._waitings,delete e._remain},M.prototype.fetch=function(e){var t=this,r=t.uri;t.status=$.FETCHING;var n={uri:r};d("fetch",n);var a=n.requestUri||r;function i(){u.request(n.requestUri,n.onRequest,n.charset)}a&&!R[a]?G[a]?L[a].push(t):(G[a]=!0,L[a]=[t],d("request",n={uri:r,requestUri:a,onRequest:function(){delete G[a],R[a]=!0,q&&(M.save(r,q),q=null);var e,t=L[a];delete L[a];for(;e=t.shift();)e.load()},charset:c.charset}),n.requested||(e?e[n.requestUri]=i:i())):t.load()},M.prototype.exec=function(){var e=this;if(e.status>=$.EXECUTING)return e.exports;e.status=$.EXECUTING;var r=e.uri;function n(e){return M.get(n.resolve(e)).exec()}n.resolve=function(e){return M.resolve(e,r)},n.async=function(e,t){return M.use(e,t,r+"_async_"+F()),n};var t=e.factory,a=l(t)?t(n,e.exports={},e):t;return a===o&&(a=e.exports),delete e.factory,e.exports=a,e.status=$.EXECUTED,d("exec",e),a},M.resolve=function(e,t){var r={id:e,refUri:t};return d("resolve",r),r.uri||u.resolve(r.id,t)},M.define=function(e,t,r){var n=arguments.length;1===n?(r=e,e=o):2===n&&(r=t,f(e)?(t=e,e=o):t=o),!f(t)&&l(r)&&(t=function(e){var n=[];return e.replace(I,"").replace(C,function(e,t,r){r&&n.push(r)}),n}(r.toString()));var a={id:e,uri:M.resolve(e),deps:t,factory:r};if(!a.uri&&_.attachEvent){var i=function(){if(w)return w;if(S&&"interactive"===S.readyState)return S;for(var e=x.getElementsByTagName("script"),t=e.length-1;0<=t;t--){var r=e[t];if("interactive"===r.readyState)return S=r}}();i&&(a.uri=i.src)}d("define",a),a.uri?M.save(a.uri,a):q=a},M.save=function(e,t){var r=M.get(e);r.status<$.SAVED&&(r.id=t.id||e,r.dependencies=t.deps||[],r.factory=t.factory,r.status=$.SAVED)},M.get=function(e,t){return j[e]||(j[e]=new M(e,t))},M.use=function(e,a,t){var i=M.get(t,f(e)?e:[e]);i.callback=function(){for(var e=[],t=i.resolve(),r=0,n=t.length;r<n;r++)e[r]=j[t[r]].exec();a&&a.apply(s,e),delete i.callback},i.load()},M.preload=function(e){var t=c.preload,r=t.length;r?M.use(t,function(){t.splice(0,r),M.preload(e)},c.cwd+"_preload_"+F()):e()},u.use=function(e,t){return M.preload(function(){M.use(e,t,c.cwd+"_use_"+F())}),u},M.define.cmd={},s.define=M.define,u.Module=M,c.fetchedList=R,c.cid=F,u.require=function(e){var t=M.get(M.resolve(e));return t.status<$.EXECUTING&&(t.onload(),t.exec()),t.exports};var k,X;c.base=(D.match(/^(.+?\/)(\?\?)?(seajs\/)+/)||["",D])[1],c.dir=D,c.cwd=b,c.charset="utf-8",c.preload=(k=[],X=location.search.replace(/(seajs-\w+)(&|$)/g,"$1=1$2"),(X+=" "+_.cookie).replace(/(seajs-\w+)=1/g,function(e,t){k.push(t)}),k),u.config=function(e){for(var t in e){var r=e[t],n=c[t];if(n&&i(n))for(var a in r)n[a]=r[a];else f(n)?r=n.concat(r):"base"===t&&("/"!==r.slice(-1)&&(r+="/"),r=H(r)),c[t]=r}return d("config",e),u}}function B(t){return function(e){return{}.toString.call(e)=="[object "+t+"]"}}function F(){return e++}function V(e){return e.match(r)[0]}function H(e,t){var r,n=e.charAt(0);if(m.test(e))r=e;else if("."===n)r=function(e){for(e=e.replace(v,"/");e.match(h);)e=e.replace(h,"/");return e=e.replace(p,"$1/")}((t?V(t):c.cwd)+e);else if("/"===n){var a=c.cwd.match(y);r=a?a[0]+e.substring(1):e}else r=c.base+e;return 0===r.indexOf("//")&&(r=location.protocol+r),r}function M(e,t){this.uri=e,this.dependencies=t||[],this.exports=null,this.status=0,this._waitings={},this._remain=0}}(this);
\ No newline at end of file
define("index",[],function(n,i,e){var o={init:function(){console.log("我是首页!asd66699988899")}};e.exports=o}),seajs.use(["index"],function(n){$(function(){n.init()})});
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>杀毒</title>
<meta charset="UTF-8"/>
<meta name="keywords" content="xxx">
<meta name="description" content="xxx">
<script type="text/javascript">
//JS环境变量
var PUBLICXK=window.location.origin+"/res/";
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/global/global.min.css?v='+new Date().getTime()+'">');
</script>
<script type="text/javascript">
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/index/index.min.css?v='+new Date().getTime()+'">');
</script>
</head>
<body>
<div>头部菜单</div>
<ul>
<li class="act" >
<a href="/">首页</a>
</li>
<li >
<a href="/view/test1">test1</a>
</li>
<li >
<a href="/view/test2">test2</a>
</li>
</ul>
<div class="index">
hello world999!
<h1>我是首页2233</h1>
</div>
<div>底部00</div>
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/global/sea.min.js?v='+new Date().getTime()+'"><\/script\>');
document.write('<script src="'+PUBLICXK+'js/global/main.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/index/index.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>首页</title>
<meta charset="UTF-8"/>
<meta name="keywords" content="xxx">
<meta name="description" content="xxx">
<script type="text/javascript">
//JS环境变量
var PUBLICXK=window.location.origin+"/res/";
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/global/global.min.css?v='+new Date().getTime()+'">');
</script>
<script type="text/javascript">
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/index/index.min.css?v='+new Date().getTime()+'">');
</script>
</head>
<body>
<div>头部菜单</div>
<ul>
<li >
<a href="/">首页</a>
</li>
<li class="act" >
<a href="/view/test1">test1</a>
</li>
<li >
<a href="/view/test2">test2</a>
</li>
</ul>
<div>
<h1>我是test1</h1>
</div>
<div>底部00</div>
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/global/sea.min.js?v='+new Date().getTime()+'"><\/script\>');
document.write('<script src="'+PUBLICXK+'js/global/main.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/index/index.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>{$pageconf.title|default='猎芯网-首页'}</title>
<meta charset="UTF-8"/>
<meta name="keywords" content="xxx">
<meta name="description" content="xxx">
<script type="text/javascript">
//JS环境变量
var PUBLICXK=window.location.origin+"/res/";
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/global/global.min.css?v='+new Date().getTime()+'">');
</script>
<script type="text/javascript">
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/index/index.min.css?v='+new Date().getTime()+'">');
</script>
</head>
<body>
<div>头部菜单</div>
<ul>
<li >
<a href="/">首页</a>
</li>
<li >
<a href="/view/test1">test1</a>
</li>
<li class="act" >
<a href="/view/test2">test2</a>
</li>
</ul>
<div>
<h1>我是test2</h1>
</div>
<div>底部00</div>
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/global/sea.min.js?v='+new Date().getTime()+'"><\/script\>');
document.write('<script src="'+PUBLICXK+'js/global/main.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/index/index.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
</body>
</html>
\ No newline at end of file
var gulp = require('gulp');
var fileinclude = require('gulp-file-include');//编译公共HTML文件
var concat=require('gulp-concat'); //合并文件
var sass = require('gulp-sass'); // 编译scss 为 css
var cleanCss = require('gulp-clean-css'); // css压缩
var uglify = require('gulp-uglify');//js压缩
var rename = require('gulp-rename');//重命名
var imagemin = require('gulp-imagemin') //图片压缩
//main.js模块化初始化公共JS
var url_p="./src/";//编译路径
var url_c="./dist/";//输出路径
gulp.task("dev",async ()=>{
//HTML引入公用代码
gulp.watch("./src/view/**/*.html",async ()=>{
gulp.src(['./src/view/**/*.html', '!./src/view/public/**.html'])
.pipe(fileinclude({
prefix: '@@',
basepath: '@file'
}))
.pipe(gulp.dest(url_c+'view'));
});
//首页单独处理
gulp.watch("./src/view/index/index.html",async ()=>{
return gulp.src('./src/view/index/index.html')
.pipe(fileinclude({
prefix: '@@',
basepath: '@file'
}))
.pipe(gulp.dest('./dist'));
});
//合并main.js 公共预加载模块
gulp.watch(url_p+"res/js/global/module/*.js",async ()=>{
return gulp.src([
url_p+'res/js/global/module/config.js',
url_p+'res/js/global/module/publicxk.min.js',
url_p+'res/js/global/module/common_function.js'
])
.pipe(concat('main.js'))
.pipe(rename({suffix: '.min'})) //rename压缩后的文件名
.pipe(uglify()) //压缩
.pipe(gulp.dest(url_c+'res/js/global/'))
});
gulp.watch(url_p+"res/js/global/module/*.js",async ()=>{
return gulp.src([
url_p+'res/js/global/module/config.js',
url_p+'res/js/global/module/publicxk.min.js',
url_p+'res/js/global/module/common_function.js',
url_p+'res/js/global/module/router.js',
])
.pipe(gulp.dest(url_c+'res/js/global/module'))
});
//监听压缩所有JS
gulp.watch([url_p+'res/js/**/*.js','!'+url_p+"res/js/global/module/*.js"],async ()=>{
return gulp.src([url_p+'res/js/**/*.js','!'+url_p+"res/js/global/module/*.js"])
.pipe(rename({suffix: '.min'})) //rename压缩后的文件名
.pipe(uglify()) //压缩
.pipe(gulp.dest(url_c+'res/js'))
});
//css处理 编译并压缩scss输出css
gulp.watch(url_p+"res/css/**/*.scss",async ()=>{
return gulp.src(url_p+"res/css/**/*.scss")
.pipe(sass())
.pipe(rename({suffix: '.min'}))
.pipe(cleanCss())
.pipe(gulp.dest(url_c+"res/css"))
});
//图片压缩处理
gulp.watch(url_p+"res/images/**/*",async ()=>{
return gulp.src(url_p+"res/images/**/*")
.pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
.pipe(gulp.dest(url_c+"res/images"))
});
gulp.watch(url_p+"res/images/**/**/*",async ()=>{
return gulp.src(url_p+"res/images/**/**/*")
.pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
.pipe(gulp.dest(url_c+"res/images"))
});
});
This diff could not be displayed because it is too large.
{
"name": "ic",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-clean-css": "^4.2.0",
"gulp-concat": "^2.6.1",
"gulp-file-include": "^2.0.1",
"gulp-imagemin": "^6.0.0",
"gulp-rename": "^1.4.0",
"gulp-rev": "^9.0.0",
"gulp-rev-collector": "^1.3.1",
"gulp-sass": "^4.0.2",
"gulp-uglify": "^3.0.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
.index{
background:red;
font-size:15px;
}
\ No newline at end of file
.index{
background:red;
.div{color:#fff;font-size:14px;}
}
.act{color:red;}
\ No newline at end of file
define('common_function',function(require) {
console.log("公共函数!9969966666")
});
\ No newline at end of file
seajs.config({
base: PUBLICXK + 'js/global/module',
alias: {
'publicxk':"publicxk.min.js", //包含jq.js director.js
'common_function':"common_function.js" //公共base函数
},
//预加载模块
preload: ['publicxk','common_function']
});
This diff could not be displayed because it is too large.
define('index', [], function(require, exports, module) {
var index={
init:function(){
console.log("我是首页!asd66699988899");
}
}
module.exports = index;
})
seajs.use(['index'], function(index) {
$(function(){
index.init();
})
})
<!DOCTYPE html>
<html>
<head>
<title>杀毒</title>
@@include('../public/meta.html')
@@include('../public/css.html')
<script type="text/javascript">
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/index/index.min.css?v='+new Date().getTime()+'">');
</script>
</head>
<body>
@@include('../public/header.html',{"index": "act"})
<div class="index">
hello world999!
<h1>我是首页2233</h1>
</div>
@@include('../public/footer.html')
@@include('../public/js.html')
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/index/index.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
</body>
</html>
\ No newline at end of file
<script type="text/javascript">
//JS环境变量
var PUBLICXK=window.location.origin+"/res/";
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/global/global.min.css?v='+new Date().getTime()+'">');
</script>
<div>底部00</div>
\ No newline at end of file
<div>头部菜单</div>
<ul>
<li @@if (context.index=='act' ) { class="act" }>
<a href="/">首页</a>
</li>
<li @@if (context.test1=='act' ) { class="act" }>
<a href="/view/test1">test1</a>
</li>
<li @@if (context.test2==='act' ) { class="act" }>
<a href="/view/test2">test2</a>
</li>
</ul>
\ No newline at end of file
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/global/sea.min.js?v='+new Date().getTime()+'"><\/script\>');
document.write('<script src="'+PUBLICXK+'js/global/main.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
<meta charset="UTF-8"/>
<meta name="keywords" content="xxx">
<meta name="description" content="xxx">
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>首页</title>
@@include('../public/meta.html')
@@include('../public/css.html')
<script type="text/javascript">
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/index/index.min.css?v='+new Date().getTime()+'">');
</script>
</head>
<body>
@@include('../public/header.html',{"test1": "act"})
<div>
<h1>我是test1</h1>
</div>
@@include('../public/footer.html')
@@include('../public/js.html')
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/index/index.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>{$pageconf.title|default='猎芯网-首页'}</title>
@@include('../public/meta.html')
@@include('../public/css.html')
<script type="text/javascript">
document.write('<link rel="stylesheet" href="'+PUBLICXK+'css/index/index.min.css?v='+new Date().getTime()+'">');
</script>
</head>
<body>
@@include('../public/header.html',{"test2": "act"})
<div>
<h1>我是test2</h1>
</div>
@@include('../public/footer.html')
@@include('../public/js.html')
<script type="text/javascript">
document.write('<script src="'+PUBLICXK+'js/index/index.min.js?v='+new Date().getTime()+'"><\/script\>');
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment