--- C:/Users/neoguru/Desktop/fckeditor.utils.js Fri Dec 12 22:28:46 2008 +++ F:/WebServers/home/test5/www/sites/all/modules/fckeditor/fckeditor.utils.js Wed Dec 24 22:54:10 2008 @@ -97,6 +97,47 @@ ta2.style.display = 'none'; } +function doFCKeditorSave(){ + DoFCKeditorTeaserStuff(); + return true; //continue submitting +} + +function DoFCKeditorTeaserStuff() +{ + for( var i = 0 ; i < fckLaunchedJsId.length ; i++ ) { + if ( document.getElementById( fckLaunchedTextareaId[i] ).style.display == 'none' ) + { + var text = FCKeditorAPI.GetInstance( fckLaunchedJsId[i] ).GetXHTML(true); + var teaser = false; + + for (var k in Drupal.settings.teaser) { + if (Drupal.settings.teaser[k] == fckLaunchedTextareaId[i]) + teaser = k; + } + + if (teaser) { + var t = text.indexOf(''); + if (t != -1) { + $('#' + teaser).val(text.slice(0,t)); + document.getElementById( fckLaunchedTextareaId[i] ).value = text.slice(t+12); + } + else { + $('#' + teaser).val(''); + $('#' + teaser).attr('disabled', 'disabled'); + document.getElementById( fckLaunchedTextareaId[i] ).value = text; + if ($('input[@class=teaser-button]').attr('value') == Drupal.t('Join summary')) { + try {$('input[@class=teaser-button]').click();} catch(e) {$('input[@class=teaser-button]').val(Drupal.t('Join summary'));} + } + } + } + else { + document.getElementById( fckLaunchedTextareaId[i] ).value = text; + } + } + } +} + + // The FCKeditor_OnComplete function is a special function called everytime an // editor instance is completely loaded and available for API interactions. function FCKeditor_OnComplete( editorInstance )