Skip to content

Commit

Permalink
fixing sidebyside problem with URL
Browse files Browse the repository at this point in the history
  • Loading branch information
houshuang committed Nov 26, 2011
1 parent a2eb57f commit 6f3fd24
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dokuwiki.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,14 @@ def sbs
exit unless page

if cururl.index("localhost/wiki")
cururl = cururl.to_s + "?do=edit&vecdo=print"
url = cururl.to_s + "?do=edit&vecdo=print"
else
# uses Instapaper to nicely format the article text, for fitting into a split-screen window
cururl = "http://www.instapaper.com/text?u=\"+encodeURIComponent(\"#{cururl}\")+\""
url = "http://www.instapaper.com/text?u=\"+encodeURIComponent(\"#{cururl}\")+\""
end

newurl = "http://localhost/wiki/#{page.gsub(" ","_")}"

js = "var MyFrame=\"<frameset cols=\'*,*\'><frame src=\'#{cururl}\'><frame src=\'#{newurl}?do=edit&vecdo=print\'></frameset>\";with(document) { write(MyFrame);};return false;"
js = "var MyFrame=\"<frameset cols=\'*,*\'><frame src=\'#{url}\'><frame src=\'#{newurl}?do=edit&vecdo=print\'></frameset>\";with(document) { write(MyFrame);};return false;"
Chrome.windows[1].get.tabs[Chrome.windows[1].get.active_tab_index.get].get.execute(:javascript => js)
end

Expand Down Expand Up @@ -243,4 +242,4 @@ def newauthor
#### Running the right function, depending on command line input ####
Chrome = Appscript.app('Google Chrome')
send *ARGV
send *ARGV unless ARGV == []

0 comments on commit 6f3fd24

Please sign in to comment.