From tchemit@users.labs.libre-entreprise.org Sun May 18 23:11:19 2008 From: tchemit@users.labs.libre-entreprise.org To: nuiton-rss-commits@list.nuiton.org Subject: [Lutinweb-commits] r54 - trunk/lutinrss/src/main/resources/fckeditor/editor/plugins/rssinclude Date: Sun, 18 May 2008 23:11:19 +0200 Message-ID: <20080518211119.481D7461AF8@labs.libre-entreprise.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1739597922418283977==" --===============1739597922418283977== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: tchemit Date: 2008-05-18 21:11:18 +0000 (Sun, 18 May 2008) New Revision: 54 Modified: trunk/lutinrss/src/main/resources/fckeditor/editor/plugins/rssinclude/fck_= rssinclude.js Log: chargement dynamique du script d'update rss ajout de TODO reformat Modified: trunk/lutinrss/src/main/resources/fckeditor/editor/plugins/rssinclu= de/fck_rssinclude.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/lutinrss/src/main/resources/fckeditor/editor/plugins/rssinclude/fck= _rssinclude.js 2008-05-18 21:07:58 UTC (rev 53) +++ trunk/lutinrss/src/main/resources/fckeditor/editor/plugins/rssinclude/fck= _rssinclude.js 2008-05-18 21:11:18 UTC (rev 54) @@ -8,6 +8,9 @@ // Set the language direction. window.document.dir =3D oEditor.FCKLang.Dir; =20 +// load rssinclude script +document.writeln(""); + // Recuperation du feed selectionne var oRss =3D dialog.Selection.GetSelectedElement(); =20 @@ -16,7 +19,7 @@ { // Translate the dialog box texts. oEditor.FCKLanguageManager.TranslatePage(document); - + =20 // chargement de la comba avec les feeds configures LoadCombo(); =20 @@ -78,38 +81,41 @@ { if ( GetE('txtFeedName').value.length =3D=3D 0 ) { - GetE('txtFeedName').focus() ; + GetE('txtFeedName').focus(); =20 - alert( oEditor.FCKLang.DlgRssincludeAlertFeedName ) ; + alert( oEditor.FCKLang.DlgRssincludeAlertFeedName ); return false ; } - - oEditor.FCKUndo.SaveUndoStep() ; + =20 + oEditor.FCKUndo.SaveUndoStep(); if ( !oRss ) { oRss =3D FCK.InsertElement( 'DIV' ) ; + //TODO Il faut detecter si le script est deja present, + // car ajouter n script va provoquer n chargements... oScript =3D FCK.InsertElement('SCRIPT'); SetAttribute( oScript, 'src', FCKConfig.RssScriptURL); } - updateRss( oRss ) ; - - rssincludeUpdateDiv(oRss, false); - return true ; + updateRss( oRss ); + =20 + // rssincludeUpdateDiv(oRss, false); + return true; } =20 /** * Mise a jour d'un div avec les informations trouvees dans l'interface */ function updateRss(e){ - e.contentEditable =3D false ; - + e.contentEditable =3D false; + =20 SetAttribute( e, 'class', 'rssinclude'); SetAttribute( e, 'name', 'rssinclude'); SetAttribute( e, 'feedName', GetE('txtFeedName').value ); SetAttribute( e, 'nbItem', GetE('txtNbItem').value ); SetAttribute( e, 'feedRepr', GetE('txtFeedRepr').value ); - SetAttribute( e, 'forceReload', 'true' ); - e.innerHTML =3D 'RSS ' + GetE('txtFeedName').value; + //SetAttribute( e, 'forceReload', 'true' ); + e.innerHTML =3D 'RSS ' + GetE('txtFeedName').value + ' (items:'+GetE('tx= tNbItem').value+')'; + //TODO Il faudrait utiliser une class css, afin de ne pas poluer le cont= enu final e.style.backgroundColor =3D '#ffff00' ; } =20 @@ -122,7 +128,7 @@ function updatePreview(){ =20 if ( !ePreview ) { - ePreview =3D GetE('rssincludePreview') ; + ePreview =3D GetE('rssincludePreview'); } =20 if ( ! ePreview) { @@ -130,7 +136,7 @@ } =20 if ( GetE('txtFeedName').value.length =3D=3D 0 ) { - ePreview.innerHTML =3D 'Invalid RSS' ; + ePreview.innerHTML =3D 'Invalid RSS'; } else { updateRss(ePreview); rssincludeUpdateDiv(ePreview, true); --===============1739597922418283977==--