AnonSec Team
Server IP : 10.111.40.2  /  Your IP : 216.73.217.126
Web Server : Apache
System : Linux webd002.cluster111.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : comimage ( 973271)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/comimage/referencement/demo/prive/javascript/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/comimage/referencement/demo/prive/javascript/jquery.autosave.js
/**
 * autosave plugin
 *
 * Copyright (c) 2009-2016 Fil (fil@rezo.net)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/*
 * Usage: $("form").autosave({options...});
 * to use with SPIP's action/session.php
 */

(function($){
	$.fn.autosave = function(opt) {
		opt = $.extend({
			url: window.location,
			confirm: false,
			confirmstring: 'Sauvegarder ?'
		},opt);
		var save_changed = function(){
			$('form.autosavechanged')
			.each(function(){
				if (!opt.confirm || confirm(opt.confirmstring)) {
					var contenu = $(this).serialize();
					// ajoutons un timestamp
					var d=new Date();
					contenu = contenu + "&__timestamp=" + Math.round(d.getTime()/1000);
					$.post(opt.url, {
						'action': 'session',
						'var': 'autosave_' + $('input[name=autosave]', this).val(),
						'val': contenu
					});
				}
			}).removeClass('autosavechanged');
		}
		$(window)
		.bind('unload',save_changed);
		return this
		.bind('keyup', function() {
			$(this).addClass('autosavechanged');
		})
		.bind('change', function() {
			$(this).addClass('autosavechanged');
			save_changed();
		})
		.bind('submit',function() {
			save_changed();
			/* trop agressif : exemple du submit previsu forum, ou des submit suivant/precedent d'un cvt multipage
			on sauvegarde toujours, et le serveur videra quand il faudra */
			/*$(this).removeClass('autosavechanged')*/;
		});
	}
})(jQuery);


AnonSec - 2021