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. |