Skip to content

Commit

Permalink
fix #96
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 11, 2021
1 parent 9de09ad commit 8efba5a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1,271 deletions.
2 changes: 1 addition & 1 deletion js/data.min.json

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var sreach = function(){
this.inputElm.focus()

if(this.boxEml){
this.init();
this.init();
}
}
sreach.prototype = {
Expand Down Expand Up @@ -259,10 +259,14 @@ sreach.prototype = {
:self.createSreachListHTML(val)
)
:self.creatListHTML();
if(window.history&&window.history.replaceState)
val ? history.replaceState({},"jsdig","?kw="+val):
history.replaceState({},"jsdig","/");

if(window.history && window.history.replaceState) {
console.log(window.history)
if (val) {
history.replaceState({},"jsdig","?kw="+val);
} else {
history.replaceState({},"jsdig","?kw=");
}
}
self.isErrorInfo(val);
},
changeKeyworlds:function(val){
Expand Down
2 changes: 1 addition & 1 deletion js/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"test": "echo \"Error: no test specified\" && exit 1",
"build:css": "stylus -u autoprefixer-stylus -u stylus-px2rem styl/index.styl -o css/ -c",
"build": "npm run build:css && npm run build:js",
"watch": "npm run watch:css && npm run watch:js",
"watch": "npm run watch:css & npm run watch:js",
"watch:css": "stylus -u autoprefixer-stylus -w styl/index.styl -o css/ -c",
"watch:js": "onchange 'js/index.js' './data.json' -v -- npm run build:js",
"build:js": "npm run min:js && npm run min:data",
"min:js": "uglifyjs js/index.js -o js/index.min.js",
"min:data": "node js/build.json.js",
"server": "sgo"
"server": "sgo --fallback index.html"
},
"repository": {
"type": "git",
Expand All @@ -24,11 +24,11 @@
"devDependencies": {
"autoprefixer": "10.3.7",
"autoprefixer-stylus": "1.0.0",
"onchange": "^6.1.0",
"onchange": "7.1.0",
"postcss-cli": "^7.1.0",
"sgo": "3.0.1",
"stylus": "0.55.0",
"stylus-px2rem": "1.0.14",
"uglify-js": "^3.8.1"
"uglify-js": "3.14.2"
}
}
Loading

0 comments on commit 8efba5a

Please sign in to comment.