Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ListType/list-type.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ListType/list-type.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ListType/list-type.js 4 Jun 2006 00:45:53 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ListType/list-type.js 25 Feb 2007 19:06:28 -0000 1.4 @@ -1,191 +1,137 @@ -// ListType Plugin for Xinha -// Toolbar Implementation by Mihai Bazon, http://dynarch.com/mishoo/ -HTMLArea.loadStyle( 'ListType.css', 'ListType' ); - -function ListType( editor ) -{ - this.editor = editor; - var cfg = editor.config; - var self = this; - - if ( cfg.ListType.mode == 'toolbar' ) - { - var options = {}; - options[HTMLArea._lc( "Decimal numbers", "ListType" )] = "decimal"; - options[HTMLArea._lc( "Lower roman numbers", "ListType" )] = "lower-roman"; - options[HTMLArea._lc( "Upper roman numbers", "ListType" )] = "upper-roman"; - options[HTMLArea._lc( "Lower latin letters", "ListType" )] = "lower-alpha"; - options[HTMLArea._lc( "Upper latin letters", "ListType" )] = "upper-alpha"; - if (!HTMLArea.is_ie) - // IE doesn't support this property; even worse, it complains - // with a gross error message when we tried to select it, - // therefore let's hide it from the damn "browser". - options[HTMLArea._lc( "Lower greek letters", "ListType" )] = "lower-greek"; - var obj = - { - id : "listtype", - tooltip : HTMLArea._lc( "Choose list style type (for ordered lists)", "ListType" ), - options : options, - action : function( editor ) { self.onSelect( editor, this ); }, - refresh : function( editor ) { self.updateValue( editor, this ); }, - context : "ol" - }; - cfg.registerDropdown( obj ); - cfg.addToolbarElement( "listtype", ["insertorderedlist","orderedlist"], 1 ); - } - else - { - editor._ListType = editor.addPanel( 'right' ); - HTMLArea.freeLater( editor, '_ListType' ); - HTMLArea.addClass( editor._ListType, 'ListType' ); - // hurm, ok it's pretty to use the background color for the whole panel, - // but should not it be set by default when creating the panel ? - HTMLArea.addClass( editor._ListType.parentNode, 'dialog' ); - - editor.notifyOn( 'modechange', - function(e,args) - { - if ( args.mode == 'text' ) editor.hidePanel( editor._ListType ); - } - ); - - var elts_ul = ['disc', 'circle', 'square', 'none']; - var elts_ol = ['decimal', 'lower-alpha', 'upper-alpha', 'lower-roman', 'upper-roman', 'none']; - var divglobal = document.createElement( 'div' ); - divglobal.style.height = '90px'; - var div = document.createElement( 'div' ); - div.id = 'LTdivUL'; - div.style.display = 'none'; - for ( var i=0; i