[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] news_admin/js/fckeditor/editor/dialog/fck_select fck_
From: |
skwashd |
Subject: |
[Phpgroupware-cvs] news_admin/js/fckeditor/editor/dialog/fck_select fck_select.js, 1.1 |
Date: |
Tue, 24 May 2005 16:32:00 +0200 |
Update of news_admin/js/fckeditor/editor/dialog/fck_select
Added Files:
Branch: MAIN
fck_select.js
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: fck_select.js
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fck_select.js
* Scripts for the fck_select.html page.
*
* Version: 2.0 RC3
* Modified: 2005-02-10 17:53:50
*
* File Authors:
* Frederico Caldeira Knabben (address@hidden)
*/
function Select( combo )
{
var iIndex = combo.selectedIndex ;
oListText.selectedIndex = iIndex ;
oListValue.selectedIndex = iIndex ;
var oTxtText = document.getElementById( "txtText" ) ;
var oTxtValue = document.getElementById( "txtValue" ) ;
oTxtText.value = oListText.value ;
oTxtValue.value = oListValue.value ;
}
function Add()
{
var oTxtText = document.getElementById( "txtText" ) ;
var oTxtValue = document.getElementById( "txtValue" ) ;
AddComboOption( oListText, oTxtText.value, oTxtText.value ) ;
AddComboOption( oListValue, oTxtValue.value, oTxtValue.value ) ;
oListText.selectedIndex = oListText.options.length - 1 ;
oListValue.selectedIndex = oListValue.options.length - 1 ;
oTxtText.value = '' ;
oTxtValue.value = '' ;
oTxtText.focus() ;
}
function Modify()
{
var iIndex = oListText.selectedIndex ;
if ( iIndex < 0 ) return ;
var oTxtText = document.getElementById( "txtText" ) ;
var oTxtValue = document.getElementById( "txtValue" ) ;
oListText.options[ iIndex ].innerHTML = oTxtText.value ;
oListText.options[ iIndex ].value = oTxtText.value ;
oListValue.options[ iIndex ].innerHTML = oTxtValue.value ;
oListValue.options[ iIndex ].value = oTxtValue.value ;
oTxtText.value = '' ;
oTxtValue.value = '' ;
oTxtText.focus() ;
}
function Move( steps )
{
ChangeOptionPosition( oListText, steps ) ;
ChangeOptionPosition( oListValue, steps ) ;
}
function Delete()
{
RemoveSelectedOptions( oListText ) ;
RemoveSelectedOptions( oListValue ) ;
}
function SetSelectedValue()
{
var iIndex = oListValue.selectedIndex ;
if ( iIndex < 0 ) return ;
var oTxtValue = document.getElementById( "txtSelValue" ) ;
oTxtValue.value = oListValue.options[ iIndex ].value ;
}
// Moves the selected option by a number of steps (also negative)
function ChangeOptionPosition( combo, steps )
{
var iActualIndex = combo.selectedIndex ;
if ( iActualIndex < 0 )
return ;
var iFinalIndex = iActualIndex + steps ;
if ( iFinalIndex < 0 )
iFinalIndex = 0 ;
if ( iFinalIndex > ( combo.options.lenght - 1 ) )
iFinalIndex = combo.options.lenght - 1 ;
if ( iActualIndex == iFinalIndex )
return ;
var oOption = combo.options[ iActualIndex ] ;
var sText = oOption.innerHTML ;
var sValue = oOption.value ;
combo.remove( iActualIndex ) ;
oOption = AddComboOption( combo, sText, sValue, null, iFinalIndex ) ;
oOption.selected = true ;
}
// Remove all selected options from a SELECT object
function RemoveSelectedOptions(combo)
{
// Save the selected index
var iSelectedIndex = combo.selectedIndex ;
var oOptions = combo.options ;
// Remove all selected options
for ( var i = oOptions.length - 1 ; i >= 0 ; i-- )
{
if (oOptions[i].selected) combo.remove(i) ;
}
// Reset the selection based on the original selected index
if ( combo.options.length > 0 )
{
if ( iSelectedIndex >= combo.options.length ) iSelectedIndex =
combo.options.length - 1 ;
combo.selectedIndex = iSelectedIndex ;
}
}
// Add a new option to a SELECT object (combo or list)
function AddComboOption( combo, optionText, optionValue, documentObject, index )
{
var oOption ;
if ( documentObject )
oOption = documentObject.createElement("OPTION") ;
else
oOption = document.createElement("OPTION") ;
if ( index != null )
combo.options.add( oOption, index ) ;
else
combo.options.add( oOption ) ;
oOption.innerHTML = optionText.length > 0 ? optionText : ' ' ;
oOption.value = optionValue ;
return oOption ;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] news_admin/js/fckeditor/editor/dialog/fck_select fck_select.js, 1.1,
skwashd <=
- Prev by Date:
[Phpgroupware-cvs] news_admin/js/fckeditor/_docs fck_docs.css, 1.1 index.html, 1.1 whatsnew.html, 1.1
- Next by Date:
[Phpgroupware-cvs] news_admin/js/fckeditor/editor/_source/internals fckselection_gecko.js, 1.1 fckselection_ie.js, 1.1 fcktablehandler.js, 1.1 fcktablehandler_gecko.js, 1.1 fckselection.js, 1.1 fckscriptloader.js, 1.1 fckdialog_ie.js, 1.1 fcklanguagemanager.js, 1.1 fckplugins.js, 1.1 fckregexlib.js, 1.1 fcktablehandler_ie.js, 1.1 fcktoolbaritems.js, 1.1 fckxhtml.js, 1.1 fckxhtml_gecko.js, 1.1 fckxhtml_ie.js, 1.1 fckxhtmlentities.js, 1.1 fckurlparams.js, 1.1 fcktools_ie.js, 1.1 fcktoolbarset.js, 1.1 fcktools.js, 1.1 fcktools_gecko.js, 1.1 fckdialog_gecko.js, 1.1 fckdialog.js, 1.1 fck_1_ie.js, 1.1 fck_2.js, 1.1 fck_2_gecko.js, 1.1 fck_2_ie.js, 1.1 fck_1_gecko.js, 1.1 fck_1.js, 1.1 fck.js, 1.1 fck_last.js, 1.1 fck_onload.js, 1.1 fckcontextmenu_gecko.js, 1.1 fckcontextmenu_ie.js, 1.1 fckcoreextensions.js, 1.1 fckdebug.js, 1.1 fckcontextmenu.js, 1.1 fckconfig.js, 1.1 fckbrowserinfo.js, 1.1 fckcodeformatter.js, 1.1 fckcommands.js, 1.1
- Previous by thread:
[Phpgroupware-cvs] news_admin/js/fckeditor/_docs fck_docs.css, 1.1 index.html, 1.1 whatsnew.html, 1.1
- Next by thread:
[Phpgroupware-cvs] news_admin/js/fckeditor/editor/_source/internals fckselection_gecko.js, 1.1 fckselection_ie.js, 1.1 fcktablehandler.js, 1.1 fcktablehandler_gecko.js, 1.1 fckselection.js, 1.1 fckscriptloader.js, 1.1 fckdialog_ie.js, 1.1 fcklanguagemanager.js, 1.1 fckplugins.js, 1.1 fckregexlib.js, 1.1 fcktablehandler_ie.js, 1.1 fcktoolbaritems.js, 1.1 fckxhtml.js, 1.1 fckxhtml_gecko.js, 1.1 fckxhtml_ie.js, 1.1 fckxhtmlentities.js, 1.1 fckurlparams.js, 1.1 fcktools_ie.js, 1.1 fcktoolbarset.js, 1.1 fcktools.js, 1.1 fcktools_gecko.js, 1.1 fckdialog_gecko.js, 1.1 fckdialog.js, 1.1 fck_1_ie.js, 1.1 fck_2.js, 1.1 fck_2_gecko.js, 1.1 fck_2_ie.js, 1.1 fck_1_gecko.js, 1.1 fck_1.js, 1.1 fck.js, 1.1 fck_last.js, 1.1 fck_onload.js, 1.1 fckcontextmenu_gecko.js, 1.1 fckcontextmenu_ie.js, 1.1 fckcoreextensions.js, 1.1 fckdebug.js, 1.1 fckcontextmenu.js, 1.1 fckconfig.js, 1.1 fckbrowserinfo.js, 1.1 fckcodeformatter.js, 1.1 fckcommands.js, 1.1
- Index(es):