! Copyright (C) 2011 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
-USING: io.launcher kernel sequences system webbrowser ;
+USING: arrays io.launcher kernel present system webbrowser ;
IN: webbrowser.linux
M: linux open-file ( path -- )
- { "xdg-open" } swap suffix try-process ;
+ present "xdg-open" swap 2array try-process ;
! Copyright (C) 2011 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
-USING: io.launcher kernel sequences system webbrowser ;
+USING: arrays io.launcher kernel present system webbrowser ;
IN: webbrowser.macosx
M: macosx open-file ( path -- )
- { "open" } swap suffix try-process ;
+ present "open" swap 2array try-process ;
! Copyright (C) 2011 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
-USING: combinators combinators.short-circuit present sequences strings system
-ui.operations urls vocabs ;
+USING: combinators combinators.short-circuit io.pathnames
+present sequences strings system ui.operations urls vocabs ;
IN: webbrowser
} cond require
: open-url ( url -- )
- >url present open-file ;
+ >url open-file ;
+
+[ pathname? ] \ open-file H{ } define-operation
[ url? ] \ open-url H{ } define-operation
! Copyright (C) 2011 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
-USING: system kernel webbrowser windows.shell32 windows.user32 ;
+USING: kernel present system webbrowser windows.shell32
+windows.user32 ;
IN: webbrowser.windows
M: windows open-file ( path -- )
- [ f "open" ] dip f f SW_SHOWNORMAL ShellExecute drop ;
+ [ f "open" ] dip present f f
+ SW_SHOWNORMAL ShellExecute drop ;