Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
add model solution
Commit Description:
add model solution
from browser import window
__all__ = [ "Error" , "open" , "open_new" , "open_new_tab" ]
class Error ( Exception ):
pass
_target = { 0 : '' , 1 : '_blank' , 2 : '_new' } # hack...
def open ( url , new = 0 , autoraise = True ):
"""
new window or tab is not controllable
on the client side. autoraise not available.
"""
# javascript window.open doesn't work if you do not specify the protocol
# A solution is the next hack:
if '://' in url :
if url [: 6 ] == 'ftp://' :
print ( 'entro' )
else :
protocol = url . split ( '//:' )[ 0 ]
url = url . replace ( protocol + '//:' , '//' )
else :
url = '//' + url
print ( url )
if window . open ( url , _target [ new ]):
return True
return False
def open_new ( url ):
return open ( url , 1 )
def open_new_tab ( url ):
return open ( url , 2 )
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings