PageSourceSearch

https://www.turquieeuropeenne.eu/plugins-dist/porte_plume/javascript/jquery.previsu_spip.js

js turquieeuropeenne.eu collected 2026-10-02 11:43:04 UTC 3,433 bytes, 103 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;(function($) {
11	$.fn.previsu_spip = function(settings) {
12		var options;
13
14		options = {
15			previewParserPath:	'' ,
16			previewParserVar:	'data',
17			textEditer:	'Editer',
18			textVoir:	'Voir'
19		};
20		$.extend(options, settings);
21
22		return this.each(function() {
23
24			var $$, textarea, tabs, preview;
25			$$ = $(this);
26			textarea = this;
27
28			// init and build previsu buttons
29			function init() {
30				$$.addClass("pp_previsualisation");
31				tabs = $('<div class="markItUpTabs"></div>').prependTo($$.parent());
32				$(tabs).append(
33					'<a href="#previsuVoir" class="previsuVoir">' + options.textVoir + '</a>' +
34					'<a href="#previsuEditer" class="previsuEditer on">' + options.textEditer + '</a>'
35				);
36				
37				preview = $('<div class="markItUpPreview"></div>').insertAfter(tabs);
38				preview.hide();
39				
40				$('.previsuVoir').click(function(){
41					mark = $(this).parent().parent();
42					objet = mark.parents('.formulaire_spip')[0].className.match(/formulaire_editer_(\w+)/);
43					champ = mark.parents('li')[0].className.match(/editer_(\w+)/);
44					$(mark).find('.markItUpPreview').height(
45						  $(mark).find('.markItUpHeader').height()
46						+ $(mark).find('.markItUpEditor').height()
47						+ $(mark).find('.markItUpFooter').height()
48					);
49
50					$(mark).find('.markItUpHeader').hide();
51					$(mark).find('.markItUpEditor').hide();
52					$(mark).find('.markItUpFooter').hide();
53					$(this).addClass('on').next().removeClass('on');
54					$(mark).find('.markItUpPreview').show()
55						.addClass('ajaxLoad')
56						.html(renderPreview(
57							$(mark).find('textarea.pp_previsualisation').val(),
58							champ[1].toUpperCase(),
59							(objet ? objet[1] : ''))
60						)
61						.removeClass('ajaxLoad');
62					
63					//ouvre un nouvel onglet lorsqu'on clique sur un lien dans la prévisualisation
64					$(".markItUpPreview a").attr("target","blank");
65
66					return false;
67				});
68				$('.previsuEditer').click(function(){
69					mark = $(this).parent().parent();
70					$(mark).find('.markItUpPreview').hide();
71					$(mark).find('.markItUpHeader').show();
72					$(mark).find('.markItUpEditor').show();
73					$(mark).find('.markItUpFooter').show();
74					$(this).addClass('on').prev().removeClass('on');
75					return false;
76				});
77			}
78
79
80			function renderPreview(val, champ, objet) {
81				var phtml;
82				if (options.previewParserPath !== '') {
83					$.ajax( {
84						type: 'POST',
85						async: false,
86						url: options.previewParserPath,
87						data: 'champ='+champ
88							+'&objet='+objet
89							+'&' + options.previewParserVar+'='+encodeURIComponent(val),
90						success: function(data) {
91							phtml = data; 
92						}
93					} );
94				}
95				return phtml;
96			}
97	
98			init();
99		});
100	};
101})(jQuery);
102
103}

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.