X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpanel%2Fplugin.js;h=ae712c0d780a5710aae3dd60f844d022188b99ca;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=b9e78865c8f5341b0e8420adf1555b8fa54bffb6;hpb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1;p=ckeditor.git
diff --git a/_source/plugins/panel/plugin.js b/_source/plugins/panel/plugin.js
index b9e7886..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,15 +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;
}
@@ -224,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.
@@ -316,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();
@@ -395,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
+ */