@@ -83,7 +83,7 @@ ccui.WebView = ccui.Widget.extend({
8383 * go back
8484 */
8585 goBack : function ( ) {
86- if ( ccui . WebView . polyfill . closeHistory )
86+ if ( ccui . WebView . _polyfill . closeHistory )
8787 return cc . log ( "The current browser does not support the GoBack" ) ;
8888 var iframe = this . _renderCmd . _iframe ;
8989 if ( iframe ) {
@@ -97,7 +97,7 @@ ccui.WebView = ccui.Widget.extend({
9797 * go forward
9898 */
9999 goForward : function ( ) {
100- if ( ccui . WebView . polyfill . closeHistory )
100+ if ( ccui . WebView . _polyfill . closeHistory )
101101 return cc . log ( "The current browser does not support the GoForward" ) ;
102102 var iframe = this . _renderCmd . _iframe ;
103103 if ( iframe ) {
@@ -116,6 +116,7 @@ ccui.WebView = ccui.Widget.extend({
116116 if ( iframe ) {
117117 var win = iframe . contentWindow ;
118118 try {
119+ cc . eventManager . dispatchCustomEvent ( ccui . WebView . EventType . JS_EVALUATED ) ;
119120 win . eval ( str ) ;
120121 } catch ( err ) {
121122 console . error ( err ) ;
@@ -161,16 +162,6 @@ ccui.WebView = ccui.Widget.extend({
161162 }
162163 } ,
163164
164- //setOnShouldStartLoading: function(callback){},
165- //setOnDidFinishLoading: function(){},
166- //setOnDidFailLoading: function(){},
167- //setOnJSCallback: function(){},
168-
169- //getOnShouldStartLoading: function(){},
170- //getOnDidFinishLoading: function(){},
171- //getOnDidFailLoading: function(){},
172- //getOnJSCallback: function(){},
173-
174165 _createRenderCmd : function ( ) {
175166 return new ccui . WebView . RenderCmd ( this ) ;
176167 } ,
@@ -206,18 +197,19 @@ ccui.WebView = ccui.Widget.extend({
206197ccui . WebView . EventType = {
207198 LOADING : "ui_webview_loading" ,
208199 LOADED : "ui_webview_load" ,
209- ERROR : "ui_webview_error"
200+ ERROR : "ui_webview_error" ,
201+ JS_EVALUATED : "ui_webview_js"
210202} ;
211203
212204( function ( ) {
213205
214- var polyfill = ccui . WebView . polyfill = {
206+ var polyfill = ccui . WebView . _polyfill = {
215207 devicePixelRatio : false ,
216208 enableDiv : false
217209 } ;
218210
219211 if ( cc . sys . os === cc . sys . OS_IOS )
220- ccui . WebView . polyfill . enableDiv = true ;
212+ polyfill . enableDiv = true ;
221213
222214 if ( cc . sys . isMobile ) {
223215 if ( cc . sys . browserType === cc . sys . BROWSER_TYPE_FIREFOX ) {
@@ -383,4 +375,4 @@ ccui.WebView.EventType = {
383375 }
384376 } ;
385377
386- } ) ( ccui . WebView . polyfill ) ;
378+ } ) ( ccui . WebView . _polyfill ) ;
0 commit comments