[pLog-svn] r3385 - in plog/trunk: class/action/admin js/tinymcejs/ui locale templates/admin

Mark Wu markplace at gmail.com
Thu May 11 18:37:22 GMT 2006


Some behavior change in autosave:

1. Now, if you want to leave the newPost page, it will ask you really =
want
to leave or not, and the cookie will clean to meet the
"LimitRequestFieldsize" imitation. The default size of
LimitRequestFieldsize is 8192 bytes ... :( It is very small .... So, I =
have
to clean the cookie, if user really doesn't need it.

If the user does not press "OK" in the seconds that you specified. The =
auto
save will start again ....=20

2. I change the autosave from keyEvent base to time base, I think it can
save some performance.

3. I just refer Jon's modification in sessionmanager, try to use the =
same
naming rule. So, the auto save support mutiple sites in one domain
(different folders) and multiple blogs now ...

I just tested in under IE and Firefox, both browser works well... If you =
use
safari or opera, please kindly test it, and let me know it works or not.

** How to test it:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
1. Login to lifetype admin
2. Typing something in newPost
3. Use kill or task manager to kill your firefox or IE
4. Restart IE or Firefox
5. Login to lifetype admin again
6. Go to the new post page ... You will see the warning message ask you =
want
to restore or not

** Notice:
=3D=3D=3D=3D=3D=3D=3D
The default timer is 5 seconds. So ... If you just type few words and =
does
not over 5 seconds, The post won't save to cookie .....

Mark

> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net=20
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of=20
> mark at devel.lifetype.net
> Sent: Friday, May 12, 2006 1:59 AM
> To: plog-svn at devel.lifetype.net
> Subject: [pLog-svn] r3385 - in plog/trunk: class/action/admin=20
> js/tinymcejs/ui locale templates/admin
>=20
> Author: mark
> Date: 2006-05-11 17:58:34 +0000 (Thu, 11 May 2006) New Revision: 3385
>=20
> Added:
>    plog/trunk/js/ui/autosave.js
> Modified:
>    plog/trunk/class/action/admin/adminaddpostaction.class.php
>    plog/trunk/js/tinymce/tiny_mce-plog.js
>    plog/trunk/js/ui/plogui.js
>    plog/trunk/locale/locale_en_UK.php
>    plog/trunk/locale/locale_zh_TW.php
>    plog/trunk/templates/admin/header.template
>    plog/trunk/templates/admin/newpost.template
> Log:
> An improved version of autosave:
>=20
> 1. For some reasons, I change the autosave from=20
> event-base(onChange) to time-base(setInterval). Currently,=20
> the post will saved to cookie in every 5 seconds.
>=20
> 2. Now, the script can handle multiple installations and=20
> multiple blogs in the same domain.
>=20
> 3. When user want to leave the current newPost page, it will=20
> show a dialog to ask user really want to leave or not. At the=20
> same time, the cookie will clean and the autosave will=20
> restart again after 10 seconds.
>=20
> 4. Add postTopic support.
>=20
> That's all!
>=20
> Modified: plog/trunk/class/action/admin/adminaddpostaction.class.php
> =
=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
> ---=20
> plog/trunk/class/action/admin/adminaddpostaction.class.php=09
> 2006-05-11 14:45:23 UTC (rev 3384)
> +++=20
> plog/trunk/class/action/admin/adminaddpostaction.class.php=09
> 2006-05-11 17:58:34 UTC (rev 3385)
> @@ -213,8 +213,15 @@
>         =20
>          function clearAutoSaveCookie()
>          {
> +        	$rg =3D $this->_blogInfo->getBlogRequestGenerator();
> +        	$plogAdminBaseUrl =3D $rg->getBaseUrl(false)."/admin.php";
> +        	$cookieBaseName =3D "LT" .=20
> preg_replace("/[^a-zA-Z0-9]/", "",=20
> + $plogAdminBaseUrl).$this->_blogInfo->getId();
> +
>          	// set the auto save cookie as false
> -	    	setcookie( 'LTpostNotSaved', '0', -1, '/' );=09
> +	    	setcookie( $cookieBaseName.'postNotSaved', '0',=20
> -1, '/' );
> +	    	setcookie( $cookieBaseName.'postTopic', '', -1, '/' );
> +	    	setcookie( $cookieBaseName.'postText', '', -1, '/' );
> +	    	setcookie( $cookieBaseName.'postExtendedText',=20
> '', -1, '/' );
>          }
>      }
>  ?>
> \ No newline at end of file
>=20
> Modified: plog/trunk/js/tinymce/tiny_mce-plog.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
> --- plog/trunk/js/tinymce/tiny_mce-plog.js	2006-05-11=20
> 14:45:23 UTC (rev 3384)
> +++ plog/trunk/js/tinymce/tiny_mce-plog.js	2006-05-11=20
> 17:58:34 UTC (rev 3385)
> @@ -18,7 +18,6 @@
>  	theme_advanced_path_location : "bottom",
>  	theme_advanced_resizing : true,
>  	theme_advanced_resize_horizontal : false,
> -	onchange_callback : "tinyMCEOnChangeEvent",
>  	extended_valid_elements :=20
> "a[class|name|href|target|title|onclick],img[class|src|border=3D
> 0|alt|title|hspace|vspace|width|height|align|onmouseover|onmou
seout|name],hr[class|width|size|noshade],font[face|size|color|style],span=
[cl
ass|align|style]",
>  	verify_html : true,
>  	valid_elements : ""
>=20
> Added: plog/trunk/js/ui/autosave.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
> --- plog/trunk/js/ui/autosave.js	2006-05-11 14:45:23 UTC=20
> (rev 3384)
> +++ plog/trunk/js/ui/autosave.js	2006-05-11 17:58:34 UTC=20
> (rev 3385)
> @@ -0,0 +1,176 @@
> +/**
> + * functions for auto save
> + */
> +
> +// Before you change the following values, please make sure=20
> the total=20
> +cookie size of the domain does not exceed // your=20
> LimitRequestFieldsize value in Apache. Or you will get a ugly=20
> error message like this in your browser:
> +//
> +// [Bad Request: Size of a request header field exceeds=20
> server limit]=20
> +// // The default LimitRequestFieldsize value of apache is=20
> 8192 bytes.
> +=20
> +// In generally, the cookie size is 4096 bytes, So this=20
> number should=20
> +be smaller then 4096 var maxBackupCookieLength =3D 3240;
> +
> +// How many cookies we can use per postText and PostExtentedText var=20
> +maxBackupCookiesPerBlog =3D 1;
> +
> +// It doesn't make sense just backup few characters, use this to=20
> +control the minimal backup length var minBackupLength =3D 9;
> +
> +// The time interval between two post backup, the default is=20
> 5 seconds=20
> +var backupInterval =3D 5;
> +
> +// Timer we used for post backup
> +var backupTimer;
> +
> +// Make a unique cookie name for each blog.=20
> +// If you change this, please remember change the cookie=20
> name in adminaddpostaction.class.php too.
> +var re =3D new RegExp("[^a-zA-Z0-9]", "g" ); var=20
> LTCookieBaseName =3D "LT"=20
> ++ plogAdminBaseUrl.replace( re, "" ) + plogAdminBlogId; var=20
> +postNotSavedCookieName =3D LTCookieBaseName + "postNotSaved"; var=20
> +postTopicCookieName =3D LTCookieBaseName + "postTopic"; var=20
> +postTextCookieName =3D LTCookieBaseName + "postText"; var=20
> +postExtendedTextCookieName =3D LTCookieBaseName + "postExtendedText";
> +
> +function deleteBackupPostFromCookie()
> +{
> +	deleteCookie( postNotSavedCookieName );
> +	for( cookieNum =3D 0; cookieNum <=20
> maxBackupCookiesPerBlog; cookieNum++ )
> +	{
> +		deleteCookie( postTopicCookieName + cookieNum );
> +		deleteCookie( postTextCookieName + cookieNum );
> +		deleteCookie( postExtendedTextCookieName + cookieNum );
> +	}
> +}
> +
> +function saveBackupPostToCookie( cookieName, content ) {
> +	// Clear old post, I know it stupid. But it seems the=20
> best way to keep the data clean.
> +	// If we use mutiple cookies to compose a single post.
> +	for( cookieNum =3D 0; cookieNum <=20
> maxBackupCookiesPerBlog; cookieNum++ )
> +	{
> +		deleteCookie( cookieName + cookieNum );
> +	}
> +
> +	var dataIndex =3D 0;
> +	var cookieNum =3D 0;
> +	var data =3D escape( content );
> +	while ( ( dataIndex < data.length ) && ( cookieNum <=20
> maxBackupCookiesPerBlog ) ) {
> +		var cookieData =3D data.substring(dataIndex,=20
> dataIndex + maxBackupCookieLength);
> +		setCookie( cookieName + cookieNum, cookieData, 1);
> +		dataIndex +=3D maxBackupCookieLength;
> +		cookieNum++;
> +	}
> +}
> +
> +function loadBackupPostFromCookie( cookieName ) {
> +	var content =3D "";
> +	for( cookieNum =3D 0; cookieNum <=20
> maxBackupCookiesPerBlog; cookieNum++ )
> +	{
> +		data =3D getCookie( cookieName + cookieNum );
> +		if ( data )
> +			content +=3D data;
> +		else
> +			break;
> +	}=09
> +
> +	return unescape( content );
> +}
> +
> +function backupPost()
> +{
> +	postTopic =3D $('postTopic').value;
> +=09
> +	if( htmlAreaEnabled )
> +	{
> +		postText =3D=20
> tinyMCE.getInstanceById('postText').getBody().innerHTML;
> +		postExtendedText =3D=20
> tinyMCE.getInstanceById('postExtendedText').getBody().innerHTML;
> +	}
> +	else
> +	{
> +		postText =3D $('postText').value;
> +		postExtendedText =3D $('postExtendedText').value;
> +	}
> +
> +	if( postTopic.length > minBackupLength )
> +	{
> +		setCookie( postNotSavedCookieName, 1, 1);
> +		saveBackupPostToCookie( postTopicCookieName,=20
> postTopic );
> +	}
> +	=09
> +	if( postText.length > minBackupLength )
> +	{
> +		setCookie( postNotSavedCookieName, 1, 1);
> +		saveBackupPostToCookie( postTextCookieName, postText );
> +	}
> +=09
> +	if( postExtendedText.length > minBackupLength )
> +	{
> +		setCookie( postNotSavedCookieName, 1, 1);
> +		saveBackupPostToCookie(=20
> postExtendedTextCookieName, postExtendedText );
> +	}
> +}
> +
> +function initialAutoSave()
> +{
> +	window.onbeforeunload =3D beforeUnload;
> +=09
> +	postNotSaved =3D getCookie( postNotSavedCookieName );
> +	if ( postNotSaved =3D=3D 1 )
> +	{
> +		$('autoSaveMessage').innerHTML =3D msgAutoSaveMessage;
> +		Element.show($('autoSaveMessage'));
> +	}
> +	else
> +	{
> +		deleteBackupPostFromCookie();
> +	}
> +}
> +
> +function startAutoSave() {
> +	backupTimer =3D setInterval('backupPost();',=20
> backupInterval * 1000 ); }
> +
> +function restartAutoSave() {
> +	deleteBackupPostFromCookie();
> +	clearInterval( backupTimer );
> +	setTimeout( 'startAutoSave();', backupInterval * 1000 ); }
> +
> +function restoreAutoSave()
> +{
> +	$('postTopic').value =3D loadBackupPostFromCookie(=20
> postTopicCookieName=20
> +);
> +=09
> +	if( htmlAreaEnabled )
> +	{
> +	=09
> tinyMCE.getInstanceById('postText').getBody().innerHTML  =3D=20
> loadBackupPostFromCookie( postTextCookieName );
> +	=09
> tinyMCE.getInstanceById('postExtendedText').getBody().innerHTM
> L  =3D loadBackupPostFromCookie( postExtendedTextCookieName );
> +	}
> +	else
> +	{
> +		$('postText').value =3D loadBackupPostFromCookie(=20
> postTextCookieName );
> +		$('postExtendedText').value =3D=20
> loadBackupPostFromCookie( postExtendedTextCookieName );
> +	}
> +=09
> +	$('autoSaveMessage').innerHTML =3D '';
> +	Element.hide($('autoSaveMessage'));
> +}
> +
> +function eraseAutoSave()
> +{
> +	deleteBackupPostFromCookie();
> +=09
> +	$('autoSaveMessage').innerHTML =3D '';
> +	Element.hide($('autoSaveMessage'));
> +}
> +
> +function beforeUnload()
> +{
> +	postNotSaved =3D getCookie( postNotSavedCookieName );
> +	if ( postNotSaved ) {
> +		restartAutoSave();
> +		return msgBeforeUnloadMessage.replace(=20
> "restart-seconds", backupInterval * 2 );
> +	}
> +}
> \ No newline at end of file
>=20
> Modified: plog/trunk/js/ui/plogui.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
> --- plog/trunk/js/ui/plogui.js	2006-05-11 14:45:23 UTC=20
> (rev 3384)
> +++ plog/trunk/js/ui/plogui.js	2006-05-11 17:58:34 UTC=20
> (rev 3385)
> @@ -1,76 +1,4 @@
>  /**
> - * functions for auto save
> - */
> -
> -function initialAutoSave()
> -{
> -	LTpostNotSaved =3D getCookie( 'LTpostNotSaved' );
> -	if ( LTpostNotSaved =3D=3D 1 )
> -	{
> -		$('autoSaveMessage').innerHTML =3D msgAutoSaveMessage;
> -		Element.show($('autoSaveMessage'));
> -	}
> -	else
> -	{
> -		deleteCookie( 'LTpostNotSaved' );
> -		deleteCookie( 'LTpostText' );
> -		deleteCookie( 'LTpostExtendedText' );
> -	}
> -}
> -
> -function restoreAutoSave()
> -{
> -	if( htmlAreaEnabled )
> -	{
> -	=09
> tinyMCE.getInstanceById('postText').getBody().innerHTML  =3D=20
> decodeURIComponent( getCookie( 'LTpostText' ) );
> -	=09
> tinyMCE.getInstanceById('postExtendedText').getBody().innerHTM
> L  =3D decodeURIComponent( getCookie( 'LTpostExtendedText' ) );
> -	}
> -	else
> -	{
> -		$('postText').value =3D decodeURIComponent(=20
> getCookie( 'LTpostText' ) );
> -		$('postExtendedText').value =3D=20
> decodeURIComponent( getCookie( 'LTpostExtendedText' ) );
> -	}
> -=09
> -	$('autoSaveMessage').innerHTML =3D '';
> -	Element.hide($('autoSaveMessage'));
> -}
> -
> -function eraseAutoSave()
> -{
> -	deleteCookie( 'LTpostNotSaved' );
> -	deleteCookie( 'LTpostText' );
> -	deleteCookie( 'LTpostExtendedText' );
> -=09
> -	$('autoSaveMessage').innerHTML =3D '';
> -	Element.hide($('autoSaveMessage'));
> -}
> -
> -function tinyMCEOnChangeEvent( inst ) {
> -	// set the postNotSaved ture
> -	setCookie( 'LTpostNotSaved', 1, 7);
> -=09
> -	// postText
> -	if( inst.editorId =3D=3D 'mce_editor_0' )
> -		cookieId =3D 'LTpostText';
> -	else
> -		cookieId =3D 'LTpostExtendedText';
> -=09
> -	setCookie( cookieId, encodeURIComponent(=20
> inst.getBody().innerHTML ), 7 );
> -}
> -
> -function plogEditorOnChangeEvent( editor ) {
> -	setCookie( 'LTpostNotSaved', 1, 7);
> -=09
> -	// postText
> -	if( editor.id =3D=3D 'postText' )
> -		cookieId =3D 'LTpostText';
> -	else
> -		cookieId =3D 'LTpostExtendedText';
> -	=09
> -	setCookie( cookieId, encodeURIComponent( editor.value ), 7 );
> -}
> -
> -/**
>   * when adding a new form, checks that there is at least one=20
> category selected
>   */
>  function submitNewPost(form)
>=20
> Modified: plog/trunk/locale/locale_en_UK.php
> =
=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
> --- plog/trunk/locale/locale_en_UK.php	2006-05-11=20
> 14:45:23 UTC (rev 3384)
> +++ plog/trunk/locale/locale_en_UK.php	2006-05-11=20
> 17:58:34 UTC (rev 3385)
> @@ -1026,4 +1026,6 @@
> =20
>  $messages['warning_autosave_message'] =3D '<img=20
> src=3D"imgs/admin/icon_warning-16.png" alt=3D"Error"=20
> class=3D"InfoIcon"/><p class=3D"ErrorText">You seem to have left=20
> here without saving your post. If so, you may <a href=3D"#"=20
> onclick=3D"restoreAutoSave();">click here to restore it</a> or=20
> <a href=3D"#" onclick=3D"eraseAutoSave();">delete it</a>.</p>';
> =20
> +$messages['before_unload_message'] =3D 'It seems you have=20
> unsaved post, are you sure you want to leave?\n (If you=20
> don\'t press the "Ok" button in restart-seconds seconds, the=20
> auto save mechanisim will restart again.)';
> +
>  ?>
> \ No newline at end of file
>=20
> Modified: plog/trunk/locale/locale_zh_TW.php
> =
=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
> --- plog/trunk/locale/locale_zh_TW.php	2006-05-11=20
> 14:45:23 UTC (rev 3384)
> +++ plog/trunk/locale/locale_zh_TW.php	2006-05-11=20
> 17:58:34 UTC (rev 3385)
> @@ -1026,4 +1026,6 @@
> =20
>  $messages['warning_autosave_message'] =3D '<img=20
> src=3D"imgs/admin/icon_warning-16.png" alt=3D"Error"=20
> class=3D"InfoIcon"/><p=20
> =
class=3D"ErrorText">=A7A=A6n=B9=B3=A6=B3=A4=A7=ABe=A9|=A5=BC=A6s=C0=C9=AA=
=BA=A4=E5=B3=B9=A1C=A6p=AAG=A7A=C1=D9=B7Q=C4~=C4=F2=BDs=BF=E8=A1A=A7A=A5i=
=A5H
<a href=3D"#"=20
> =
onclick=3D"restoreAutoSave();">=A8=FA=A6^=A5=BC=A6s=C0=C9=A4=E5=B3=B9=C4~=
=C4=F2=BDs=BF=E8</a> =A9=CE=ACO <a href=3D"#"=20
> onclick=3D"eraseAutoSave();">=A7=E2=A5L=A7R=B0=A3</a> =A1C</p>';
> =20
> +$messages['before_unload_message'] =3D=20
> =
'=A7A=A6=B3=A9|=A5=BC=C0x=A6s=AA=BA=C5=DC=A7=F3=A1A=A7A=BDT=A9w=ADn=C2=F7=
=B6}=B6=DC=A1H\n=A6p=AAG=A7A=A5=BC=A9=F3 restart-seconds =
=AC=ED=A4=BA=AB=F6=A4U
=A1y=BDT=A9w=A1z=A1A=A6=DB=B0=CA=B3=C6=A5=F7=BE=F7=A8=EE=B1N=AD=AB=B7s=B1=
=D2=B0=CA=A1C';
> +
>  ?>
> \ No newline at end of file
>=20
> Modified: plog/trunk/templates/admin/header.template
> =
=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
> --- plog/trunk/templates/admin/header.template=09
> 2006-05-11 14:45:23 UTC (rev 3384)
> +++ plog/trunk/templates/admin/header.template=09
> 2006-05-11 17:58:34 UTC (rev 3385)
> @@ -28,7 +28,8 @@
>  	}
>  	{/literal}
>    	// base url where we can find the admin.php script
> -	var plogAdminBaseUrl =3D "{$url->getBaseUrl(false)}/admin.php";=09
> +	var plogAdminBaseUrl =3D "{$url->getBaseUrl(false)}/admin.php";
> +	var plogAdminBlogId =3D "{$blog->getId()}";
>  </script>
>  <script type=3D"text/javascript"=20
> src=3D"js/prototype/prototype.js"></script>
>  <script type=3D"text/javascript" src=3D"js/rico/rico.js"></script>
>=20
> Modified: plog/trunk/templates/admin/newpost.template
> =
=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
> --- plog/trunk/templates/admin/newpost.template=09
> 2006-05-11 14:45:23 UTC (rev 3384)
> +++ plog/trunk/templates/admin/newpost.template=09
> 2006-05-11 17:58:34 UTC (rev 3385)
> @@ -6,6 +6,7 @@
>  {assign var=3Dhtmlarea=20
> value=3D$blogsettings->getValue("htmlarea_enabled")}
>   <script type=3D"text/javascript" src=3D"js/ui/plogui.js"></script>
>   <script type=3D"text/javascript"=20
> src=3D"js/calendar/datetimepicker.js"></script>
> + <script type=3D"text/javascript" src=3D"js/ui/autosave.js"></script>
>   {if $htmlarea}
>    <script type=3D"text/javascript"=20
> src=3D"js/tinymce/tiny_mce_gzip.php"></script>
>    <script type=3D"text/javascript"=20
> src=3D"js/tinymce/tiny_mce-plog.js"></script>
> @@ -26,6 +27,7 @@
>    var msgShowOptionPanel =3D "{$locale->tr("show_option_panel")}";
>    var msgHideOptionPanel =3D "{$locale->tr("hide_option_panel")}";
>    var msgAutoSaveMessage =3D=20
> '{$locale->tr("warning_autosave_message")}';
> +  var msgBeforeUnloadMessage =3D=20
> '{$locale->tr("before_unload_message")}';
>   =20
>    var todayDay =3D '{$today->getDay()}';
>    var todayMonth =3D '{$today->getMonth()}';
> @@ -62,7 +64,7 @@
>  		 <span class=3D"required">*</span>
>  		 <div class=3D"formHelp">{$locale->tr("text_help")}</div>
>  	     {if !$htmlarea}<script type=3D"text/javascript">var=20
> ed1 =3D new pLogEditor('postText','ed1');</script>{/if}
> -	     <textarea {if=20
> $htmlarea=3D=3D1}rows=3D"20"{else}rows=3D"15"{/if} id=3D"postText"=20
> name=3D"postText" style=3D"width:100%" {if=20
> !$htmlarea}onChange=3D"javascript:plogEditorOnChangeEvent(this);
> "{/if}>{$postText}</textarea>
> +	     <textarea {if=20
> $htmlarea=3D=3D1}rows=3D"20"{else}rows=3D"15"{/if} id=3D"postText"=20
> name=3D"postText" style=3D"width:100%">{$postText}</textarea>
>  	     {include=20
> file=3D"$admintemplatepath/validate.template" field=3DpostText=20
> message=3D$locale->tr("error_missing_post_text")}  =20
>  	   </div>
>  	  =20
> @@ -70,7 +72,7 @@
>  	     <label=20
> for=3D"postExtendedText">{$locale->tr("extended_text")}</label>
>  		 <div=20
> class=3D"formHelp">{$locale->tr("extended_text_help")}</div>
>  	     {if !$htmlarea}<script type=3D"text/javascript">var=20
> ed2 =3D new pLogEditor('postExtendedText','ed2');</script>{/if}
> -	     <textarea {if=20
> $htmlarea}rows=3D"25"{else}rows=3D"20"{/if} id=3D"postExtendedText"=20
> name=3D"postExtendedText" style=3D"width:100%" {if=20
> !$htmlarea}onChange=3D"javascript:plogEditorOnChangeEvent(this);
> "{/if}>{$postExtendedText}</textarea>
> +	     <textarea {if=20
> $htmlarea}rows=3D"25"{else}rows=3D"20"{/if} id=3D"postExtendedText"=20
> name=3D"postExtendedText"=20
> style=3D"width:100%">{$postExtendedText}</textarea>
>  	   </div>
> =20
>  	   <div class=3D"field">
> @@ -188,7 +190,7 @@
>  		<input type=3D"button"=20
> name=3D"saveDraftAndContinue"=20
> value=3D"{$locale->tr("save_draft_and_continue")}"=20
> onclick=3D"javascript:saveDraftArticleAjax()" />
>  		{/if}=09
>  		<input type=3D"button" name=3D"previewPost"=20
> value=3D"{$locale->tr("preview")}"=20
> onclick=3D"javascript:previewNewPost()" />
> -		<input type=3D"submit" name=3D"addPost"=20
> value=3D"{$locale->tr("add_post")}"/>	=09
> +		<input type=3D"button" name=3D"addPost"=20
> value=3D"{$locale->tr("add_post")}" =20
> onclick=3D"window.onbeforeunload =3D null; this.form.submit();"/>
>  		<input type=3D"hidden" name=3D"isDraft" value=3D"" />
>  		<input type=3D"hidden" name=3D"op" value=3D"addPost"/>
>  		<input type=3D"hidden" name=3D"postId" id=3D"postId"=20
> value=3D"{$postId}" />
> @@ -196,6 +198,7 @@
>    </form>
>    <script type=3D"text/javascript">
>      initialAutoSave();
> +    startAutoSave();
>    </script>
>  {include file=3D"$admintemplatepath/footernavigation.template"}
>  {include file=3D"$admintemplatepath/footer.template"}
> \ No newline at end of file
>=20
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn



More information about the pLog-svn mailing list