mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-31 00:59:58 +09:00
자동저장 메시지 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7922 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
048d54b869
commit
d6c29a7415
2 changed files with 44 additions and 4 deletions
|
|
@ -385,9 +385,16 @@
|
||||||
|
|
||||||
<!-- Activate Editor -->
|
<!-- Activate Editor -->
|
||||||
<script type="text/javascript">//<![CDATA[
|
<script type="text/javascript">//<![CDATA[
|
||||||
var editor_path = '{$editor_path}';
|
var editor_path = '{$editor_path}';
|
||||||
var xeed_path = '{$editor_path}';
|
var xeed_path = '{$editor_path}';
|
||||||
var auto_saved_msg = '{$lang->msg_auto_saved}';
|
var auto_saved_msg = '{$lang->msg_auto_saved}';
|
||||||
var oEditor = editorStart_xe('{$editor_sequence}', '{$editor_primary_key_name}', '{$editor_content_key_name}', '{$editor_height}', '{$colorset}', '{$content_style}', '{$content_font}', '{$content_font_size}');
|
var oEditor = editorStart_xe('{$editor_sequence}', '{$editor_primary_key_name}', '{$editor_content_key_name}', '{$editor_height}', '{$colorset}', '{$content_style}', '{$content_font}', '{$content_font_size}');
|
||||||
|
|
||||||
|
window.lang = jQuery.extend(window.lang||{}, {
|
||||||
|
<!--@foreach($lang->edit as $key=>$val)-->
|
||||||
|
<!--@if(strpos($key,'autosave')===0)-->'{$key}':'{$val}',<!--@end-->
|
||||||
|
<!--@end-->
|
||||||
|
'_':'_'
|
||||||
|
});
|
||||||
//]]></script>
|
//]]></script>
|
||||||
<!-- // Activate Editor -->
|
<!-- // Activate Editor -->
|
||||||
|
|
|
||||||
|
|
@ -2941,6 +2941,7 @@ Table = xe.createPlugin('Table', {
|
||||||
*/
|
*/
|
||||||
AutoSave = xe.createPlugin('AutoSave', {
|
AutoSave = xe.createPlugin('AutoSave', {
|
||||||
_enable : false,
|
_enable : false,
|
||||||
|
_timer : null,
|
||||||
_start_time : null,
|
_start_time : null,
|
||||||
_save_time : null,
|
_save_time : null,
|
||||||
$bar : null,
|
$bar : null,
|
||||||
|
|
@ -2966,9 +2967,41 @@ AutoSave = xe.createPlugin('AutoSave', {
|
||||||
},
|
},
|
||||||
deactivate : function() {
|
deactivate : function() {
|
||||||
this.$bar.unbind();
|
this.$bar.unbind();
|
||||||
|
clearTimeout(this._timer);
|
||||||
},
|
},
|
||||||
_save_callback : function(params) {
|
_save_callback : function(params) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
this._save_time = (new Date).getTime();
|
||||||
|
|
||||||
this.$bar.slideDown(300);
|
this.$bar.slideDown(300);
|
||||||
|
this._update_message();
|
||||||
|
|
||||||
|
this._timer = setInterval(function(){self._update_message()}, 5000);
|
||||||
|
},
|
||||||
|
_update_message : function() {
|
||||||
|
var msg = lang.autosave_format, now = (new Date).getTime(), write_interval, save_interval, write_msg, save_msg;
|
||||||
|
|
||||||
|
write_interval = Math.floor( (now - this._start_time)/1000/60 );
|
||||||
|
save_interval = Math.floor( (now - this._save_time)/1000/60 );
|
||||||
|
|
||||||
|
if (write_interval < 60) {
|
||||||
|
write_msg = ((write_interval>1)?lang.autosave_mins:lang.autosave_min).replace('%d', write_interval);
|
||||||
|
} else {
|
||||||
|
write_interval = Math.floor(write_interval/60);
|
||||||
|
write_msg = ((write_interval>1)?lang.autosave_hours:lang.autosave_hour).replace('%d', write_interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (save_interval < 60) {
|
||||||
|
save_msg = ((save_interval>1)?lang.autosave_mins_ago:lang.autosave_min_ago).replace('%d', save_interval);
|
||||||
|
} else {
|
||||||
|
save_interval = Math.floor(write_interval/60);
|
||||||
|
save_msg = ((save_interval>1)?lang.autosave_hours_ago:lang.autosave_hour_ago).replace('%d', save_interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = msg.replace('%s', write_msg).replace('%s', save_msg);
|
||||||
|
|
||||||
|
this.$bar.find('>p').html(msg);
|
||||||
},
|
},
|
||||||
API_EXEC_AUTOSAVE : function() {
|
API_EXEC_AUTOSAVE : function() {
|
||||||
_editorAutoSave(true, this._save_callback);
|
_editorAutoSave(true, this._save_callback);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue