|
From: | skwashd |
Subject: | [Phpgroupware-cvs] news_admin/js/fckeditor/editor/css/behaviors hiddenfield.gif, 1.1 hiddenfield.htc, 1.1 moz-bindings.xml, 1.1 showtableborders.htc, 1.1 anchors.htc, 1.1 anchor.gif, 1.1 |
Date: | Tue, 24 May 2005 16:32:00 +0200 |
Update of news_admin/js/fckeditor/editor/css/behaviors Added Files: Branch: MAIN hiddenfield.gif hiddenfield.htc moz-bindings.xml showtableborders.htc anchors.htc anchor.gif Log Message: I am working on a much better version of news_admin, this is just a taste of what is coming. Adding FCKeditor, which has the following issues: * Images and files support FCKd * Spellcheck FCKing up Didn't include non php code or samples other unneeded crap ==================================================== Index: hiddenfield.htc <public:component lightweight="true"> <public:attach event="oncontentready" onevent="ShowField()" /> <public:attach event="ondoubleclick" onevent="EditField()" /> <script language="javascript"> var bIsHiddenField = this.type == 'hidden' ; function ShowField() { if ( bIsHiddenField ) { this.runtimeStyle.width = '20px' ; this.runtimeStyle.height = '20px' ; this.runtimeStyle.border = '1px dotted #FF0000' ; this.runtimeStyle.backgroundImage = 'url(css/behaviors/hiddenfield.gif)' ; this.runtimeStyle.fontSize = '99px' ; } } function EditField() { if ( bIsHiddenField ) alert( this.outerHTML ) ; } </script> </public:component> ==================================================== Index: moz-bindings.xml <?xml version="1.0" encoding="utf-8" ?> <bindings xmlns="http://www.mozilla.org/xbl"> <binding id="showtableborders"> <implementation> <constructor> this.CheckShowBorders() ; </constructor> <method name="CheckShowBorders"> <body> var oClassRegex = /\s*FCK__ShowTableBorders\s*/ ; if ( this.border == 0 ) { if ( !oClassRegex.test( this.className ) ) this.className += ' FCK__ShowTableBorders' ; } else { if ( oClassRegex.test( this.className ) ) this.className = this.className.replace( oClassRegex, '' ) ; } </body> </method> </implementation> <handlers> <handler event="DOMAttrModified"> this.CheckShowBorders() ; </handler> </handlers> </binding> <binding id="anchors"> <implementation> <constructor> <![CDATA[ this.IsAnchor = ( this.name != null && this.name.length > 0 && ( this.getAttribute('href') == null || this.getAttribute('href').length == 0 ) ) ; this.ShowIcon() ; ]]> </constructor> <method name="ShowIcon"> <body> if ( this.IsAnchor ) { this.style.height = '1px' ; this.style.paddingLeft = '16px' ; this.style.backgroundImage = 'url(behaviors/anchor.gif)' ; this.style.backgroundRepeat = 'no-repeat' ; this.style.cursor = 'pointer' ; } </body> </method> </implementation> <handlers> <handler event="click"> if ( this.IsAnchor ) alert( this.IsAnchor ) ; </handler> </handlers> </binding> </bindings> ==================================================== Index: showtableborders.htc <public:component lightweight="true"> <public:attach event="oncontentready" onevent="ShowBorders()" /> <public:attach event="onpropertychange" onevent="OnPropertyChange()" /> <script language="javascript"> var oClassRegex = /\s*FCK__ShowTableBorders\s*/ ; var FCKConfig = window.parent.FCKConfig ; function ShowBorders() { if ( this.border == 0 && FCKConfig.ShowBorders ) { if ( !oClassRegex.test( this.className ) ) this.className += ' FCK__ShowTableBorders' ; } else { if ( oClassRegex.test( this.className ) ) { this.className = this.className.replace( oClassRegex, '' ) ; if ( this.className.length == 0 ) this.removeAttribute( 'className', 0 ) ; } } } function OnPropertyChange() { if ( FCKConfig.ShowBorders && ( event.propertyName == 'border' || event.propertyName == 'className' ) ) ShowBorders() ; } </script> </public:component> ==================================================== Index: anchors.htc <public:component lightweight="true"> <public:attach event="oncontentready" onevent="ShowIcon()" /> <public:attach event="ondoubleclick" onevent="EditAnchor()" /> <script language="javascript"> var bIsAnchor = this.name.length > 0 && this.getAttribute('href').length == 0 ; function ShowIcon() { if ( bIsAnchor ) { this.runtimeStyle.height = '1px' ; this.runtimeStyle.paddingLeft = '16px' ; this.runtimeStyle.backgroundImage = 'url(' + window.parent.FCKConfig.FullBasePath + 'css/behaviors/anchor.gif)' ; this.runtimeStyle.backgroundRepeat = 'no-repeat' ; this.runtimeStyle.cursor = 'hand' ; } } function EditAnchor() { if ( bIsAnchor ) alert( this.outerHTML ) ; } </script> </public:component>
[Prev in Thread] | Current Thread | [Next in Thread] |