PageSourceSearch

https://www.turquieeuropeenne.eu/prive/javascript/jquery.autosave.js

js turquieeuropeenne.eu collected 2026-10-02 11:42:56 UTC 2,224 bytes, 68 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (globalThis._wb_wombat && globalThis._wb_wombat.local_init && globalThis._wb_wombat.local_init(name))||globalThis[name];};if(!globalThis.__WB_pmw){globalThis.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opener = _____WB$wombat$assign$function_____("opener");
10/**
11 * autosave plugin
12 *
13 * Copyright (c) 2009 Fil ([email protected])
14 * Dual licensed under the MIT and GPL licenses:
15 * http://www.opensource.org/licenses/mit-license.php
16 * http://www.gnu.org/licenses/gpl.html
17 *
18 */
19
20/*
21 * Usage: $("form").autosave({options...});
22 * to use with SPIP's action/session.php
23 */
24
25(function($){
26	$.fn.autosave = function(opt) {
27		opt = $.extend({
28			url: window.location,
29			confirm: false,
30			confirmstring: 'Sauvegarder ?'
31		},opt);
32		var save_changed = function(){
33			$('form.autosavechanged')
34			.each(function(){
35				if (!opt.confirm || confirm(opt.confirmstring)) {
36					var contenu = $(this).serialize();
37					// ajoutons un timestamp
38					var d=new Date();
39					contenu = contenu + "&__timestamp=" + d.getTime();
40					$.post(opt.url, {
41						'action': 'session',
42						'var': 'autosave_' + $('input[name=autosave]', this).val(),
43						'val': contenu
44					});
45				}
46			}).removeClass('autosavechanged');
47		}
48		$(window)
49		.bind('unload',save_changed);
50		return this
51		.bind('keyup', function() {
52			$(this).addClass('autosavechanged');
53		})
54		.bind('change', function() {
55			$(this).addClass('autosavechanged');
56			save_changed();
57		})
58		.bind('submit',function() {
59			save_changed();
60			/* trop agressif : exemple du submit previsu forum, ou des submit suivant/precedent d'un cvt multipage
61			on sauvegarde toujours, et le serveur videra quand il faudra */
62			/*$(this).removeClass('autosavechanged')*/;
63		});
64	}
65})(jQuery);
66
67
68}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.