X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpanel%2Fplugin.js;h=ae712c0d780a5710aae3dd60f844d022188b99ca;hb=refs%2Ftags%2Fv3.5.3;hp=c7c6adb5dea676c2eb7e95d580310655ba0efc27;hpb=055b6b0792ce7dc53d47af606b367c04b927c2ab;p=ckeditor.git
diff --git a/_source/plugins/panel/plugin.js b/_source/plugins/panel/plugin.js
index c7c6adb..ae712c0 100644
--- a/_source/plugins/panel/plugin.js
+++ b/_source/plugins/panel/plugin.js
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
@@ -31,7 +31,7 @@ CKEDITOR.ui.panel = function( document, definition )
css : []
});
- this.id = CKEDITOR.tools.getNextNumber();
+ this.id = CKEDITOR.tools.getNextId();
this.document = document;
this._ =
@@ -73,7 +73,7 @@ CKEDITOR.ui.panel.prototype =
*/
render : function( editor, output )
{
- var id = 'cke_' + this.id;
+ var id = this.id;
output.push(
'
' +
'' +
@@ -162,18 +156,20 @@ CKEDITOR.ui.panel.prototype =
// after , so it (body) becames immediatelly
// available. (#3031)
CKEDITOR.tools.buildStyleHtml( this.css ) +
- '<\/html>' );
- doc.$.close();
+ '<\/html>';
+
+ doc.write( data );
var win = doc.getWindow();
// Register the CKEDITOR global.
win.$.CKEDITOR = CKEDITOR;
- doc.on( 'keydown', function( evt )
+ // Arrow keys for scrolling is only preventable with 'keypress' event in Opera (#4534).
+ doc.on( 'key' + ( CKEDITOR.env.opera? 'press':'down' ), function( evt )
{
var keystroke = evt.data.getKeystroke(),
- dir = this.document.getById( 'cke_' + this.id ).getAttribute( 'dir' );
+ dir = this.document.getById( this.id ).getAttribute( 'dir' );
// Delegate key processing to block.
if ( this._.onKeyDown && this._.onKeyDown( keystroke ) === false )
@@ -186,16 +182,17 @@ CKEDITOR.ui.panel.prototype =
if ( keystroke == 27 || keystroke == ( dir == 'rtl' ? 39 : 37 ) )
{
if ( this.onEscape && this.onEscape( keystroke ) === false )
- evt.data.preventDefault( );
+ evt.data.preventDefault();
}
},
this );
holder = doc.getBody();
holder.unselectable();
+ CKEDITOR.env.air && CKEDITOR.tools.callFunction( onLoad );
}
else
- holder = this.document.getById( 'cke_' + this.id );
+ holder = this.document.getById( this.id );
this._.holder = holder;
}
@@ -225,7 +222,7 @@ CKEDITOR.ui.panel.prototype =
block = blocks[ name ],
current = this._.currentBlock,
holder = this.forceIFrame ?
- this.document.getById( 'cke_' + this.id + '_frame' )
+ this.document.getById( this.id + '_frame' )
: this._.holder;
// Disable context menu for block panel.
@@ -317,7 +314,7 @@ CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass(
// Safari need focus on the iframe window first(#3389), but we need
// lock the blur to avoid hiding the panel.
- if ( CKEDITOR.env.webkit )
+ if ( CKEDITOR.env.webkit || CKEDITOR.env.opera )
item.getDocument().getWindow().focus();
item.focus();
@@ -396,3 +393,10 @@ CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass(
}
}
});
+
+/**
+ * Fired when a panel is added to the document
+ * @name CKEDITOR#ariaWidget
+ * @event
+ * @param {Object} holder The element wrapping the panel
+ */