WebBrowser/Tools/Scripts.py

changeset 6142
304a469455c8
parent 6140
c20e2d414d0d
child 6149
e611e45a17d6
equal deleted inserted replaced
6141:f4cecd941096 6142:304a469455c8
82 match = "// @exclude eric:*" 82 match = "// @exclude eric:*"
83 else: 83 else:
84 match = "// @include eric:*" 84 match = "// @include eric:*"
85 return source.format( 85 return source.format(
86 match, readAllFileContents(":/javascript/qwebchannel.js")) 86 match, readAllFileContents(":/javascript/qwebchannel.js"))
87
88
89 def setupWindowObject():
90 """
91 Function generating a script to setup window.object add-ons.
92
93 @return generated script
94 @rtype str
95 """
96 source = """
97 (function() {
98 var external = {};
99
100 window.external = external;
101
102 window.print = function() {
103 window.location = 'eric:PrintPage';
104 };
105 })()"""
106
107 return source
87 108
88 109
89 def setStyleSheet(css): 110 def setStyleSheet(css):
90 """ 111 """
91 Function generating a script to set a user style sheet. 112 Function generating a script to set a user style sheet.

eric ide

mercurial