-
Notifications
You must be signed in to change notification settings - Fork 23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ayuhsya ! Thanks for opening this PR! 😄
Have a look at the changes suggested. Also, typically, the sitemap looks like this -
resources/
images/
js/ or scripts/
css/ or styles/
Change the html files accordingly, to fit this the above sitemap.
add_node.rb
Outdated
@@ -42,7 +42,7 @@ def default today | |||
ARGV.clear | |||
end | |||
|
|||
obj = JSON.parse(File.read("data.json")) | |||
obj = JSON.parse(File.read("./data/data.json")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just obj = JSON.parse(File.read("data/data.json"))
will do.
add_node.rb
Outdated
@@ -117,10 +117,10 @@ def default today | |||
|
|||
if not testing | |||
puts "#{obj.length} papers now." | |||
File.delete("data.json") | |||
File.delete("./data/data.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just File.delete("data/data.json")
will do.
add_node.rb
Outdated
if pretty | ||
File.open("data.json", "w") { |file| file.write(JSON.pretty_generate(obj)) } | ||
File.open("./data/data.json", "w") { |file| file.write(JSON.pretty_generate(obj)) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as above comment.
add_node.rb
Outdated
else | ||
File.open("data.json", "w") { |file| file.write(JSON.generate(obj)) } | ||
File.open("./data/data.json", "w") { |file| file.write(JSON.generate(obj)) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as above comment.
@ayuhsya - No need to move the |
index.html
Outdated
@@ -1,10 +1,11 @@ | |||
<html> | |||
<head> | |||
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> | |||
<script src="string_score.min.js"></script> | |||
<script src="./resources/scripts/string_score.min.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change all the ./resources/
in this file to resources/
. And we're good to go. 👍
index.html
Outdated
|
||
$.getJSON("data.json") | ||
$.getJSON("./data/data.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to $.getJSON("data/data.json")
resources/scripts/worker.js
Outdated
@@ -1,5 +1,3 @@ | |||
importScripts('fuse.min.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that the new Fuse()
function in this file will work without import fuse.min.js
file. We do need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@athityakumar How can I test it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For usual JS testing, you can check out the Console
on your browser (Inspect > Console option appears). However, testing for worker js files would have to be done on server - you can push to your fork, publish that branch in your fork as a gh-pages
website. Then, have a look at ayuhsya.github.io/mfqp/ and check the Console of that website.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayuhsya - Or you can just restore the fuse.min.js
file back, and I'll merge this. Maybe we can work on loading fuse.min.js
from CDN on another PR. 😄
Hmm, why can't you test js workers in the browser locally?
…On Sat, 11 Mar 2017 at 13:43, Athitya Kumar ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In resources/scripts/worker.js
<#21 (comment)>:
> @@ -1,5 +1,3 @@
-importScripts('fuse.min.js');
For usual JS testing, you can check out the Console on your browser
(Inspect > Console option appears). However, testing for worker js files
would have to be done on server - you can push to your fork, publish that
branch in your fork as a gh-pages website. Then, have a look at
ayuhsya.github.io/mfqp/ and check the Console of that website.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#21 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABIZ_yrXeB2h5QB8gq1tKXt4tpuzi1qoks5rkqTsgaJpZM4MaMOL>
.
|
@athityakumar @ayuhsya I think you guys don't know about You can test everything (including JavaScript) by running:
from the @amrav This should fix their problem. |
@icyflame I was using I just can't find any usage of the file |
You can also use node's http-server, which is async and gives slightly
nicer output IMO. (npm install -g http-server)
I think worker.js is unused. This whole thing was hacked together in a
night or two, so code quality went out of the window - please
reactor/rewrite liberally :)
…On Sat, 11 Mar 2017 at 20:22, Ayushya Anand ***@***.***> wrote:
@icyflame <https://github.com/icyflame> I was using SimpleHTTPServer
itself to test the HTML all this while, there's some Apache thing to create
local server too, but I find it inconvenient to use.
I just can't find any usage of the file worker.js in the project that's
why I asked how to test it. I'll just restore the fuse script for this PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABIZ_7ihYRwTvan4kxuK02aqc9_sLIieks5rkwKUgaJpZM4MaMOL>
.
|
@athityakumar refactor looks good. repo looks pretty now. Thanks! 😄 |
/resources
/scripts
/data
/styles
fuse.min.js
now loads from CDN instead of local storage