File tree 2 files changed +26
-19
lines changed
2 files changed +26
-19
lines changed Original file line number Diff line number Diff line change 1
1
( function ( ) {
2
2
var location = window . location . href ;
3
3
var paper_id = location . substr ( location . lastIndexOf ( '/' ) + 1 ) ;
4
- $ . ajax ( {
5
- url : "http://www.shortscience.org/search?term=" + paper_id ,
6
- success : function ( data ) {
7
- // This selector is brittle.
8
- paper_page = $ ( data ) . find ( ".col-md-10 > div > a" ) [ 0 ] . href . substr ( location . lastIndexOf ( '/' ) + 1 ) ;
9
- $ . ajax ( {
10
- url : "http://www.shortscience.org/" + paper_page ,
11
- success : function ( data ) {
12
- // As is this one.
13
- paper_summary = $ ( data ) . find ( ".source.panel-body.entry" ) [ 0 ]
14
- // If there's a summary, open the page.
15
- if ( paper_summary . innerText !== "" ) {
16
- window . open ( "http://www.shortscience.org/" + paper_page , '_blank' ) ;
17
- }
18
- }
19
- } )
20
- }
21
- } ) ;
4
+ //alert(paper_id);
5
+
6
+ // Create box and allow people to click and write summaries
7
+ a = document . createElement ( "div" ) ;
8
+ a . id = "shortscienceorg-box" ;
9
+ a . style . position = "absolute" ;
10
+ a . style . top = "0px" ;
11
+ a . style . right = "0px" ;
12
+
13
+ document . body . appendChild ( a )
14
+ $ ( "#shortscienceorg-box" ) . html ( "<a href='http://www.shortscience.org/paper?bibtexKey=" + paper_id + "'>Write Summary</a>" ) ;
15
+
16
+
17
+ //read rss and show summaries that have already been written
18
+
19
+ // var xml = chrome.extension.getURL('rss-all.xml')
20
+ //
21
+ // $.get(xml, function(data) {
22
+ // alert(jQuery.parseXML( data ))
23
+ // });
24
+ //
25
+
22
26
} ) ( ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"manifest_version" : 2 ,
3
- "name" : " arxiv - shortscience integration " ,
3
+ "name" : " ShortScience.org - Chrome Extension " ,
4
4
"version" : " 0.1" ,
5
5
"permissions" : [
6
6
" http://www.shortscience.org/*"
7
7
],
8
+ "web_accessible_resources" : [
9
+ " rss-all.xml"
10
+ ],
8
11
"content_scripts" : [
9
12
{
10
13
"matches" : [
You can’t perform that action at this time.
0 commit comments