PageSourceSearch

https://www.moniteurjuris.fr/js/compiled/base_common_scroll_fos_js.js

js moniteurjuris.fr collected 2026-10-08 10:51:13 UTC 58,415 bytes, 988 lines download raw bytes

vendor: 5,725 bytes, lines 1-159
1(function($) {
2    var version = '2.0.1';
3    var optionOverrides = {};
4    var defaults = {
5        exclude: [],
6        excludeWithin: [],
7        offset: 0,
8
9        // one of 'top' or 'left'
10        direction: 'top',
11
12        // if set, bind click events through delegation
13        //  supported since jQuery 1.4.2
14        delegateSelector: null,
15
16        // jQuery set of elements you wish to scroll (for $.smoothScroll).
17        //  if null (default), $('html, body').firstScrollable() is used.
18        scrollElement: null,
19
20        // only use if you want to override default behavior
21        scrollTarget: null,
22
23        // fn(opts) function to be called before scrolling occurs.
24        // `this` is the element(s) being scrolled
25        beforeScroll: function() {},
26
27        // fn(opts) function to be called after scrolling occurs.
28        // `this` is the triggering element
29        afterScroll: function() {},
30
31        // easing name. jQuery comes with "swing" and "linear." For others, you'll need an easing plugin
32        // from jQuery UI or elsewhere
33        easing: 'swing',
34
35        // speed can be a number or 'auto'
36        // if 'auto', the speed will be calculated based on the formula:
37        // (current scroll position - target scroll position) / autoCoeffic
38        speed: 400,
39
40        // coefficient for "auto" speed
41        autoCoefficient: 2,
42
43        // $.fn.smoothScroll only: whether to prevent the default click action
44        preventDefault: true
45    };
46
47    var getScrollable = function(opts) {
48        var scrollable = [];
49        var scrolled = false;
50        var dir = opts.dir && opts.dir === 'left' ? 'scrollLeft' : 'scrollTop';
51
52        this.each(function() {
53            var el = $(this);
54
55            if (this === document || this === window) {
56                return;
57            }
58
59            if (document.scrollingElement && (this === document.documentElement || this === document.body)) {
60                scrollable.push(document.scrollingElement);
61
62                return false;
63            }
64
65            if (el[dir]() > 0) {
66                scrollable.push(this);
67            } else {
68                // if scroll(Top|Left) === 0, nudge the element 1px and see if it moves
69                el[dir](1);
70                scrolled = el[dir]() > 0;
71
72                if (scrolled) {
73                    scrollable.push(this);
74                }
75                // then put it back, of course
76                el[dir](0);
77            }
78        });
79
80        if (!scrollable.length) {
81            this.each(function() {
82                // If no scrollable elements and <html> has scroll-behavior:smooth because
83                // "When this property is specified on the root element, it applies to the viewport instead."
84                // and "The scroll-behavior property of the … body element is *not* propagated to the viewport."
85                // → https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior
86                if (this === document.documentElement && $(this).css('scrollBehavior') === 'smooth') {
87                    scrollable = [this];
88                }
89
90                // If still no scrollable elements, fall back to <body>,
91                // if it's in the jQuery collection
92                // (doing this because Safari sets scrollTop async,
93                // so can't set it to 1 and immediately get the value.)
94                if (!scrollable.length && this.nodeName === 'BODY') {
95                    scrollable = [this];
96                }
97            });
98        }
99
100        // Use the first scrollable element if we're calling firstScrollable()
101        if (opts.el === 'first' && scrollable.length > 1) {
102            scrollable = [scrollable[0]];
103        }
104
105        return scrollable;
106    };
107
108    $.fn.extend({
109        scrollable: function(dir) {
110            var scrl = getScrollable.call(this, {dir: dir});
111
112            return this.pushStack(scrl);
113        },
114        firstScrollable: function(dir) {
115            var scrl = getScrollable.call(this, {el: 'first', dir: dir});
116
117            return this.pushStack(scrl);
118        },
119
120        smoothScroll: function(options, extra) {
121            options = options || {};
122
123            if (options === 'options') {
124                if (!extra) {
125                    return this.first().data('ssOpts');
126                }
127
128                return this.each(function() {
129                    var $this = $(this);
130                    var opts = $.extend($this.data('ssOpts') || {}, extra);
131
132                    $(this).data('ssOpts', opts);
133                });
134            }
135
136            var opts = $.extend({}, $.fn.smoothScroll.defaults, options);
137
138            var clickHandler = function(event) {
139                var escapeSelector = function(str) {
140                    return str.replace(/(:|\.|\/)/g, '\\$1');
141                };
142
143                var link = this;
144                var $link = $(this);
145                var thisOpts = $.extend({}, opts, $link.data('ssOpts') || {});
146                var exclude = opts.exclude;
147                var excludeWithin = thisOpts.excludeWithin;
148                var elCounter = 0;
149                var ewlCounter = 0;
150                var include = true;
151                var clickOpts = {};
152                var locationPath = $.smoothScroll.filterPath(location.pathname);
153                var linkPath = $.smoothScroll.filterPath(link.pathname);
154                var hostMatch = location.hostname === link.hostname || !link.hostname;
155                var pathMatch = thisOpts.scrollTarget || (linkPath === locationPath);
156                var thisHash = escapeSelector(link.hash);
157
158                if (thisHash && !$(thisHash).length) {
159                    include = false;
160                }
161
162                if (!thisOpts.scrollTarget && (!hostMatch || !pathMatch || !thisHash)) {
163                    include = false;
164                } else {
165                    while (include && elCounter < exclude.length) {
166                        if ($link.is(escapeSelector(exclude[elCounter++]))) {
167                            include = false;
168                        }
169                    }
170
171                    while (include && ewlCounter < excludeWithin.length) {
172                        if ($link.closest(excludeWithin[ewlCounter++]).length) {
173                            include = false;
174                        }
175                    }
176                }
177
178                if (include) {
179                    if (thisOpts.preventDefault) {
180                        event.preventDefault();
181                    }
182
183                    $.extend(clickOpts, thisOpts, {
184                        scrollTarget: thisOpts.scrollTarget || thisHash,
185                        link: link
186                    });
187
188                    $.smoothScroll(clickOpts);
189                }
190            };
191
192            if (options.delegateSelector !== null) {
193                this
194                    .off('click.smoothscroll', options.delegateSelector)
195                    .on('click.smoothscroll', options.delegateSelector, clickHandler);
196            } else {
197                this
198                    .off('click.smoothscroll')
199                    .on('click.smoothscroll', clickHandler);
200            }
201
202            return this;
203        }
204    });
205
206    $.smoothScroll = function(options, px) {
207        if (options === 'options' && typeof px === 'object') {
208            return $.extend(optionOverrides, px);
209        }
210        var opts, $scroller, scrollTargetOffset, speed, delta;
211        var scrollerOffset = 0;
212        var offPos = 'offset';
213        var scrollDir = 'scrollTop';
214        var aniProps = {};
215        var aniOpts = {};
216
217        if (typeof options === 'number') {
218            opts = $.extend({link: null}, $.fn.smoothScroll.defaults, optionOverrides);
219            scrollTargetOffset = options;
220        } else {
221            opts = $.extend({link: null}, $.fn.smoothScroll.defaults, options || {}, optionOverrides);
222
223            if (opts.scrollElement) {
224                offPos = 'position';
225
226                if (opts.scrollElement.css('position') === 'static') {
227                    opts.scrollElement.css('position', 'relative');
228                }
229            }
230        }
231
232        scrollDir = opts.direction === 'left' ? 'scrollLeft' : scrollDir;
233
234        if (opts.scrollElement) {
235            $scroller = opts.scrollElement;
236
237            if (!(/^(?:HTML|BODY)$/).test($scroller[0].nodeName)) {
238                scrollerOffset = $scroller[scrollDir]();
239            }
240        } else {
241            $scroller = $('html, body').firstScrollable(opts.direction);
242        }
243
244        // beforeScroll callback function must fire before calculating offset
245        opts.beforeScroll.call($scroller, opts);
246
247        scrollTargetOffset = (typeof options === 'number') ? options :
248        px ||
249        ($(opts.scrollTarget)[offPos]() &&
250        $(opts.scrollTarget)[offPos]()[opts.direction]) ||
251        0;
252
253        aniProps[scrollDir] = scrollTargetOffset + scrollerOffset + opts.offset;
254        speed = opts.speed;
255
256        // automatically calculate the speed of the scroll based on distance / coefficient
257        if (speed === 'auto') {
258
259            // $scroller[scrollDir]() is position before scroll, aniProps[scrollDir] is position after
260            // When delta is greater, speed will be greater.
261            delta = Math.abs(aniProps[scrollDir] - $scroller[scrollDir]());
262
263            // Divide the delta by the coefficient
264            speed = delta / opts.autoCoefficient;
265        }
266
267        aniOpts = {
268            duration: speed,
269            easing: opts.easing,
270            complete: function() {
271                opts.afterScroll.call(opts.link, opts);
272            }
273        };
274
275        if (opts.step) {
276            aniOpts.step = opts.step;
277        }
278
279        if ($scroller.length) {
280            $scroller.stop().animate(aniProps, aniOpts);
281        } else {
282            opts.afterScroll.call(opts.link, opts);
283        }
284    };
285
286    $.smoothScroll.version = version;
287    $.smoothScroll.filterPath = function(string) {
288        string = string || '';
289
290        return string
291            .replace(/^\//, '')
292            .replace(/(?:index|default).[a-zA-Z]{3,4}$/, '')
293            .replace(/\/$/, '');
294    };
295
296    // default options
297    $.fn.smoothScroll.defaults = defaults;
298
299})(jQuery);
300'use strict';
301/**
302 * Created by rkorenblitt on 17/02/2017.
303 */
304window.App = window['App'] || {};
305
306App.router = function () {
307
308    var self = {};
309
310    self.getAjaxDocumentLoad = function (idDocument, typeDocument) {
311        return Routing.generate('ajax_document_load');
312    };
313
314    self.getSearchByIndexationTree = function (indexationTree, category) {
315        return Routing.generate('search_by_indexation_tree', {'secteur': Application.GlobalOptions.getSector()});
316    };
317
318    self.getWebRoot = function () {
319        return Application.GlobalOptions.getWebRoot();
320    }
321
322    return self;
323
324};
325
326
327/**
328 * Portions of this code are from the Google Closure Library,
329 * received from the Closure Authors under the Apache 2.0 license.
330 *
331 * All other code is (C) FriendsOfSymfony and subject to the MIT license.
332 */
333(function() {var f,l=this;function m(a,c){var b=a.split("."),d=l;b[0]in d||!d.execScript||d.execScript("var "+b[0]);for(var e;b.length&&(e=b.shift());)b.length||void 0===c?d=d[e]?d[e]:d[e]={}:d[e]=c};var n=Array.prototype,p=n.forEach?function(a,c,b){n.forEach.call(a,c,b)}:function(a,c,b){for(var d=a.length,e="string"==typeof a?a.split(""):a,g=0;g<d;g++)g in e&&c.call(b,e[g],g,a)};function q(a){var c=0,b;for(b in a)c++;return c}function r(a){var c={},b;for(b in a)c[b]=a[b];return c};function s(a,c){this.c={};this.b=[];var b=arguments.length;if(1<b){if(b%2)throw Error("Uneven number of arguments");for(var d=0;d<b;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof s)for(u(a),d=a.b.concat(),u(a),e=[],b=0;b<a.b.length;b++)e.push(a.c[a.b[b]]);else{var b=[],g=0;for(d in a)b[g++]=d;d=b;b=[];g=0;for(e in a)b[g++]=a[e];e=b}for(b=0;b<d.length;b++)this.set(d[b],e[b])}}s.prototype.f=0;s.prototype.p=0;
334function u(a){if(a.f!=a.b.length){for(var c=0,b=0;c<a.b.length;){var d=a.b[c];v(a.c,d)&&(a.b[b++]=d);c++}a.b.length=b}if(a.f!=a.b.length){for(var e={},b=c=0;c<a.b.length;)d=a.b[c],v(e,d)||(a.b[b++]=d,e[d]=1),c++;a.b.length=b}}s.prototype.get=function(a,c){return v(this.c,a)?this.c[a]:c};s.prototype.set=function(a,c){v(this.c,a)||(this.f++,this.b.push(a),this.p++);this.c[a]=c};function v(a,c){return Object.prototype.hasOwnProperty.call(a,c)};var w,x,y,A;function B(){return l.navigator?l.navigator.userAgent:null}A=y=x=w=!1;var C;if(C=B()){var D=l.navigator;w=0==C.lastIndexOf("Opera",0);x=!w&&(-1!=C.indexOf("MSIE")||-1!=C.indexOf("Trident"));y=!w&&-1!=C.indexOf("WebKit");A=!w&&!y&&!x&&"Gecko"==D.product}var E=x,G=A,H=y;var I;if(w&&l.opera){var J=l.opera.version;"function"==typeof J&&J()}else G?I=/rv\:([^\);]+)(\)|;)/:E?I=/\b(?:MSIE|rv)\s+([^\);]+)(\)|;)/:H&&(I=/WebKit\/(\S+)/),I&&I.exec(B());function K(a,c){this.a=a||{e:"",prefix:"",host:"",scheme:""};this.h(c||{})}K.g=function(){return K.j?K.j:K.j=new K};f=K.prototype;f.h=function(a){this.d=new s(a)};f.o=function(){return this.d};f.k=function(a){this.a.e=a};f.n=function(){return this.a.e};f.l=function(a){this.a.prefix=a};
335function L(a,c,b,d){var e,g=RegExp(/\[\]$/);if(b instanceof Array)p(b,function(b,e){g.test(c)?d(c,b):L(a,c+"["+("object"===typeof b?e:"")+"]",b,d)});else if("object"===typeof b)for(e in b)L(a,c+"["+e+"]",b[e],d);else d(c,b)}f.i=function(a){var c=this.a.prefix+a;if(v(this.d.c,c))a=c;else if(!v(this.d.c,a))throw Error('The route "'+a+'" does not exist.');return this.d.get(a)};
336f.m=function(a,c,b){var d=this.i(a),e=c||{},g=r(e),h="",t=!0,k="";p(d.tokens,function(b){if("text"===b[0])h=b[1]+h,t=!1;else if("variable"===b[0]){var c=b[3]in d.defaults;if(!1===t||!c||b[3]in e&&e[b[3]]!=d.defaults[b[3]]){if(b[3]in e){var c=e[b[3]],k=b[3];k in g&&delete g[k]}else if(c)c=d.defaults[b[3]];else{if(t)return;throw Error('The route "'+a+'" requires the parameter "'+b[3]+'".');}if(!0!==c&&!1!==c&&""!==c||!t)k=encodeURIComponent(c).replace(/%2F/g,"/"),"null"===k&&null===c&&(k=""),h=b[1]+
337k+h;t=!1}else c&&(b=b[3],b in g&&delete g[b])}else throw Error('The token type "'+b[0]+'" is not supported.');});""===h&&(h="/");p(d.hosttokens,function(a){var b;if("text"===a[0])k=a[1]+k;
337else if("variable"===a[0]){if(a[3]in e){b=e[a[3]];var c=a[3];c in g&&delete g[c]}else a[3]in d.defaults&&(b=d.defaults[a[3]]);k=a[1]+b+k}});h=this.a.e+h;"_scheme"in d.requirements&&this.a.scheme!=d.requirements._scheme?h=d.requirements._scheme+"://"+(k||this.a.host)+h:"schemes"in d&&"undefined"!==typeof d.schemes[0]&&
338this.a.scheme!=d.schemes[0]?h=d.schemes[0]+"://"+(k||this.a.host)+h:k&&this.a.host!==k?h=this.a.scheme+"://"+k+h:!0===b&&(h=this.a.scheme+"://"+this.a.host+h);if(0<q(g)){var z,F=[];c=function(a,b){b="function"===typeof b?b():b;F.push(encodeURIComponent(a)+"\x3d"+encodeURIComponent(null===b?"":b))};for(z in g)L(this,z,g[z],c);h=h+"?"+F.join("\x26").replace(/%20/g,"+")}return h};m("fos.Router",K);m("fos.Router.setData",function(a){var c=K.g();c.k(a.base_url);c.h(a.routes);"prefix"in a&&c.l(a.prefix);c.a.host=a.host;c.a.scheme=a.scheme});K.getInstance=K.g;K.prototype.setRoutes=K.prototype.h;K.prototype.getRoutes=K.prototype.o;K.prototype.setBaseUrl=K.prototype.k;K.prototype.getBaseUrl=K.prototype.n;K.prototype.generate=K.prototype.m;K.prototype.setPrefix=K.prototype.l;K.prototype.getRoute=K.prototype.i;window.Routing=K.g();})();
339fos.Router.setData({"base_url":"","routes":{"my_account_create_profil_invitation":{"tokens":[["text","\/invitation-publique"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_export_account_list":{"tokens":[["text","\/export-account"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_delete_filleul":{"tokens":[["text","\/delete-filleul"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"bdr_books":{"tokens":[["text","\/livres"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"get_all_idedmon_livre":{"tokens":[["text","\/get_all_idedmon_livre"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"cookies_global_rgpd":{"tokens":[["text","\/"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"cookies_administration":{"tokens":[["text","\/cookies"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"bdr_accueil":{"tokens":[["text","\/accueil"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"complete_abonnement":{"tokens":[["text","\/abonnement"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"complete_abonnement_submit":{"tokens":[["text","\/abonnement\/submit"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"toggle_draft_mode":{"tokens":[["variable","\/","[^\/]++","isDraftMode"],["text","\/activer_mode_brouillon"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"nous_contacter_page":{"tokens":[["text","\/nous_contacter"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"faq_page":{"tokens":[["text","\/faq"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"moniteurjuris_pass_page":{"tokens":[["text","\/pass"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"ajax_first_contact":{"tokens":[["text","\/accueil\/ajax\/first_contact"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"document_cited_by":{"tokens":[["text","\/document"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"document_version":{"tokens":[["variable","\/","[^\/]++","typeDocument"],["variable","\/","[^\/]++","idUd"],["text","\/document_version"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"bdr_view_fm_document_by_idud":{"tokens":[["variable","\/","[^\/]++","idDocument"],["text","\/lv"],["variable","\/","[^\/]++","typeDocument"],["text","\/document"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"bdr_view_document_from_search":{"tokens":[["variable","\/","[^\/]++","position"],["variable","\/","[^\/]++","idDocument"],["variable","\/","[^\/]++","typeDocument"],["text","\/document"],["variable","\/","[^\/]++","secteur"]],"defaults":{"position":0,"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"bdr_view_document":{"tokens":[["variable","\/","[^\/]++","idDocument"],["variable","\/","[^\/]++","typeDocument"],["text","\/document"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"bdr_print_document_in_pdf":{"tokens":[["variable","\/","[^\/]++","uid"],["variable","\/","[^\/]++","documentId"],["variable","\/","[^\/]++","documentType"],["variable","\/","[^\/]++","format"],["text","\/print"],["variable","\/","[^\/]++","secteur"]],"defaults":{"format":"pdf","uid":null,"secteur":null},"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"ajax_classify_document":{"tokens":[["text","\/document\/classify_document"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_delete_document":{"tokens":[["text","\/document\/delete"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_move_document":{"tokens":[["text","\/document\/move"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_get_form_choice_list":{"tokens":[["text","\/document\/get_form_choice_list"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"has_alert_document":{"tokens":[["text","\/has_alert_document"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"get_document_status_list":{"tokens":[["text","\/get_document_status_list"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"ajax_document_load":{"tokens":[["text","\/ajax_document"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"send_mail_validation_sammary":{"tokens":[["text","\/send_mail_validation_sammary"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_get_content":{"tokens":[["text","\/ajax_get_content"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_next_prev_doc_links":{"tokens":[["text","\/ajax_next_prev_doc_links"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_get_paginated_document":{"tokens":[["text","\/ajax_get_paginated_document"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_document_preview":{"tokens":[["text","\/document\/preview"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_annote_document":{"tokens":[["text","\/profile\/get_annote_document"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"delete_document_annotation":{"tokens":[["text","\/annotation\/delete"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"document_annotation_list":{"tokens":[["text","\/annotation\/list"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_document_annotation_bloc":{"tokens":[["text","\/document\/annotationList"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_document_create_alert":{"tokens":[["text","\/document\/createAlert"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"print_count":{"tokens":[["text","\/print_count"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_save_reading_document_statistic":{"tokens":[["text","\/save\/document_statistic"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"ajax_save_last_consulted_document":{"tokens":[["text","\/save\/last_consulted_document"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"ajax_send_xiti_marker_document":{"tokens":[["text","\/send\/xiti_marker_document"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"ajax_get_html_last_consulted_document":{"tokens":[["text","\/get_html_last_consulted_document"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"draft_ud_validate":{"tokens":[["text","\/draft_ud_validate\/"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"draft_sommaire_validate":{"tokens":[["text","\/draft_sommaire_validate\/"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"draft_get_status":{"tokens":[["text","\/draft_get_status"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_get_folder_left_menu_list":{"tokens":[["text","\/my_account\/folder_left_menu_list"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"ajax_get_folder_central_list":{"tokens":[["text","\/my_account\/folder_
339central_list"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"ajax_move_or_update_folder":{"tokens":[["text","\/my_account\/move_folder"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_create_new_folder":{"tokens":[["text","\/my_account\/new_folder"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_delete_folder":{"tokens":[["text","\/my_account\/delete_folder"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"bdr_hcub_user_enreg_onglet":{"tokens":[["text","\/mon_compte\/user\/enreg_onglet_mc"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"change_my_password":{"tokens":[["text","\/my_account\/change_my_password"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"change_my_password_return_page":{"tokens":[["variable","\/","[^\/]++","temporaryId"],["text","\/sso"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"update_search_profile":{"tokens":[["text","\/my_account\/update_search_profile"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"create_search_profile":{"tokens":[["text","\/my_account\/new_search_profile"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"delete_search_profil":{"tokens":[["text","\/my_account\/delete_search_profil"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"search_profile_list":{"tokens":[["text","\/my_account\/search_profile_list"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"enable_search_profil":{"tokens":[["text","\/my_account\/enable_search_profil"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"forgot_password":{"tokens":[["text","\/forgot_password"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"bdr_login":{"tokens":[["text","\/connexion"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"mon_compte":{"tokens":[["text","\/mon_compte"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"my_account_my_subscription":{"tokens":[["text","\/mon_compte\/update_my_subscription"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"my_account_search_document":{"tokens":[["text","\/mon_compte\/search_document"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"my_account_search_annotation":{"tokens":[["text","\/mon_compte\/search_annotate_document"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"newsletter":{"tokens":[["variable","\/","[^\/]++","isValidate"],["variable","\/","[^\/]++","idNewsletter"],["text","\/newsletter\/preview"],["variable","\/","[^\/]++","secteur"]],"defaults":{"isValidate":false},"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"create_search_alert_first_step":{"tokens":[["text","\/search\/createAlert1"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"create_search_alert":{"tokens":[["text","\/"],["variable","\/","[^\/]++","typePage"],["text","\/search\/createAlert"],["variable","\/","[^\/]++","secteur"]],"defaults":{"typePage":"resultats","secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"search_alert_list":{"tokens":[["text","\/searchAlert\/List"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"document_alert_list":{"tokens":[["text","\/documentAlert\/List"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"delete_search_alert":{"tokens":[["text","\/searchAlert\/delete"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"result_search":{"tokens":[["text","\/recherche\/resultats"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"search_by_category":{"tokens":[["variable","\/","\\d+","indexationTree"],["variable","\/","[^\/]++","category"],["text","\/recherche"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":{"indexationTree":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"search_by_reference":{"tokens":[["variable","-","[^\/]++","dateDocument"],["variable","\/","[^\/\\-]++","reference"],["text","\/recherche"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":{"indexationTree":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"search_by_indexation_tree":{"tokens":[["variable","\/","[^\/]++","category"],["variable","\/","\\d+","indexationTree"],["text","\/recherche"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":{"indexationTree":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"bdr_ajax_pagination":{"tokens":[["variable","\/","[^\/]++","position"],["text","\/pagination"]],"defaults":{"position":1},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"ajax_recherche_autocomplete":{"tokens":[["text","\/recherche\/autocomplete"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"search_ajax":{"tokens":[["text","\/recherche\/ajaxresultats"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"search_clear":{"tokens":[["text","\/recherche\/clearsearch"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"bdr_stats_index":{"tokens":[["variable","\/","[^\/]++","name"],["text","\/stats"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"stats":{"tokens":[["text","\/stats\/"],["variable","\/","[^\/]++","secteur"],["text","\/stats"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"summary_index_cpmp2016":{"tokens":[["text","\/CPMP2016"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"summary_index_cmp":{"tokens":[["text","\/CMP"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"summary_index_ccag":{"tokens":[["text","\/CCAG"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"summary_index_cgct":{"tokens":[["text","\/CGCT"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"summary_index_cpu":{"tokens":[["text","\/CPU"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"summary_index_da":{"tokens":[["text","\/DA"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"summary_index_dcc":{"tokens":[["text","\/DCC"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]}
339,"summary_index_dsp":{"tokens":[["text","\/DSP"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"summary_index_dmp":{"tokens":[["text","\/DMP"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"summary_index_cps":{"tokens":[["text","\/CPS"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"summary_index_ucmw":{"tokens":[["text","\/UCMW"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"summary_index":{"tokens":[["variable","\/","[^\/]++","theme"],["text","\/table-des-matieres"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null,"theme":null},"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"my_summary_index":{"tokens":[["variable","\/","[^\/]++","theme"],["text","\/table-des-matieres-chapitres"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null,"theme":null},"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"table_of_content_doc_search_document":{"tokens":[["text","\/tdm"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"is_user_authorized":{"tokens":[["text","\/isUserAuthorized"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"table_of_content_search_document_list":{"tokens":[["text","\/tdmList"],["variable","\/","[^\/]++","secteur"]],"defaults":{"secteur":null},"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"table_of_content_save_last_id_list":{"tokens":[["text","\/tdmSaveLastIdList"],["variable","\/","[^\/]++","secteur"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"media_export":{"tokens":[["variable","\/","[a-zA-Z0-9]+","cryptedTitle"],["text","\/medias"]],"defaults":[],"requirements":{"cryptedTitle":"[a-zA-Z0-9]+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"download_file":{"tokens":[["variable","\/","[^\/]++","universe"],["text","\/download_file"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"reponses-experts":{"tokens":[["text","\/reponses-experts"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]}},"prefix":"","host":"localhost","scheme":"http"});
340window.App = window['App'] || {};
341window.App.utils = window['App']['utils'] || {};
342
343App.utils = function () {
344    var self = {};
345
346    // ajout de bouton de zoom si le width>= ImageMaxWidth
347    self.displayZoomOption = function (targetImageName) {
348        var ImageMaxWidth = 816;
349        imagesLoaded(jQuery('.image-edition img'), function (instance) {
350            jQuery('.image-edition img').each(function (index, image) {
351                if (image.naturalWidth >= ImageMaxWidth) {
352                    var zoomLink = jQuery(this).parent("div").find("a.agrandir");
353                    if (zoomLink != undefined) {
354                        zoomLink.addClass("displayInlineBlock");
355
356                    }
357                }
358            });
359            // si on vient de la page résultat de recherche images
360            if (targetImageName != undefined && targetImageName != '') {
361                var targetImageElement = $("body img[src$='" + targetImageName + "']");
362                if (targetImageElement != undefined) {
363                    if (targetImageElement.position() != undefined) {
364                        $(window).scrollTop(targetImageElement.position().top);
365                        if (targetImageElement.parent("div").find("a.agrandir") != undefined) {
366                            if (targetImageElement.parent("div").find("a.agrandir")[0] != undefined) {
367                                targetImageElement.parent("div").find("a.agrandir")[0].click();
368                            }
369                        }
370                    }
371                }
372            }
373        });
374    };
375
376    //Decode html entities
377    self.decodeHTML = function (stringValue) {
378        stringValue = $('<div/>').html(stringValue).text();
379        return stringValue;
380    };
381
382    return self;
383};
384
385App.changeLastBreadcrumbName = function (jqVar) {
386
387    jqVar = App.utils().decodeHTML(jqVar);
388
389    // Fil ariane (breadcrumb) dynamique
390    var nameLastBreadcrumb = 'Détail';
391    switch (jqVar) {
392        case '#jqMesServices':
393            nameLastBreadcrumb = 'Mes services';
394            break;
395        case '#jqMesContenus':
396            nameLastBreadcrumb = 'Mes contenus';
397            break;
398        case '#jqMonAbo':
399            nameLastBreadcrumb = 'Mon compte';
400            break;
401        case '#jqMesWebinaires':
402            nameLastBreadcrumb = 'Mes webinaires';
403            break;
404        case '#jqAdmin':
405            nameLastBreadcrumb = 'Administration';
406            break;
407        default:
408            nameLastBreadcrumb = jqVar;
409    }
410
411    var titleWithoutHighlightSpan = nameLastBreadcrumb.replace(/<span class="highlightSearch">(\w+)<\/span>/g, '$1');
412
413    $('li.filAriane:last span').html(titleWithoutHighlightSpan);
414    // On retire le highlight sur le titre
415    $('title').html(titleWithoutHighlightSpan);
416};
417
418
419$(function () {
420    var jqContentBlocConnect = $("#jqContentBlocConnect");
421
422    // Permet d'afficher/de cacher la page d'authentification en haut à droite de la page
423    $(".jqMeConnecter").click(function () {
424        if (jqContentBlocConnect.hasClass("activeLogin")) {
425            jqContentBlocConnect.removeClass("activeLogin");
426            $("#jqContentBlocConnect > .loginForm").hide("blind", function () {
427                $(this).css('display', 'none');
428            });
429        } else {
430            jqContentBlocConnect.addClass("activeLogin");
431            $("#jqContentBlocConnect > .loginForm").show('blind');
432        }
433    });
434
435    // popin de connexion
436    loginDialog = $("#jqLoginDialog").dialog({
437        autoOpen: false,
438        width: 600,
439        modal: true,
440        closeText: "",
441        title: "Connexion",
442        buttons: [],
443        draggable: false
444    });
445
446    var jLoginForm = $("#jqLoginDialog form");
447    if ((Application.displayLoginPopin != undefined) && (Application.displayLoginPopin == '1')) {
448        $("#jqLoginDialog > div.error").remove();
449        loginDialog.dialog("open");
450    }
451
452    //afficher la popin de connexion lors de clique sur un item
453    $("body").on('click', 'a.jqLinkLocked', function (event) {
454        event.preventDefault();
455        $("#jqLoginDialog :input[name='force_target_path']").remove();
456        $('<input>').attr({
457            type: 'hidden',
458            name: 'force_target_path',
459            value: $(this).attr("href")
460        }).appendTo(jLoginForm);
461
462        $("#jqLoginDialog > div.error").remove();
463        jLoginForm.show();
464        loginDialog.dialog("open");
465    });
466
467    jLoginForm.on("submit", function (event) {
468        event.preventDefault();
469
470        $("#jqLoginDialog > div.error").remove();
471        $.ajax({
472            type: 'POST',
473            url: $(this).attr('action'),
474            data: $(this).serialize(),
475            dataType: "json",
476            success: function (data, status, object) {
477                if ((data.success == true) && data.force_target_path != "") {
478                    document.location.href = data.force_target_path;
479                } else if (data.message) {
480                    $("#jqLoginDialog").prepend('<div class="error">' + data.message + '</div>');
481                }
482            },
483            error: function (data, status, object) {
484            }
485        });
486    });
487     $("#jqFirstStep a").on('click',function (e) {
488        e.preventDefault(); // Empêche le lien de fonctionner normalement
489        $("#jqCompleteSubscDialog").dialog({
490            height: 1100
491        });
492        $('#modalContent').show();
493        $.get(Routing.getBaseUrl() + '/abonnement', function(data) {
494            $('#modalContent').html(data);
495            $("#contactForm").on("submit", function (e) {
496                // Récupération de tous les checkbox
497                var checkboxAbonneConvergence= window.location.host.includes("moniteurjuris")?$('input[value="abonne_moniteurjuris"]'):$('input[value="abonne_kheox"]'),
498                    checkboxAbonneFM    = $('input[value="abonne_fm"]'),
499                    checkboxNonAbonne   = $('input[value="non_abonne"]');
500
501                $('#contact_type_abonnement > input[type="checkbox"]').on('click', function() {
502                    $('.jqMessageTypeAbonnement').text('');
503                    if (checkboxAbonneConvergence.is(':checked') == true || checkboxAbonneFM.is(':checked') == true) {
504                        checkboxNonAbonne.attr('disabled', true);
505                    } else {
506                        checkboxNonAbonne.attr('disabled', false);
507                    }
508
509                    if (checkboxNonAbonne.is(':checked') == true) {
510                        checkboxAbonneConvergence.attr('disabled', true);
511                        checkboxAbonneFM.attr('disabled', true);
512                    } else {
513                        checkboxAbonneConvergence.attr('disabled', false);
514                        checkboxAbonneFM.attr('disabled', false);
515                    }
516                });
517
518                // On met un message d'erreur sur les cases à cocher et on bloque le submit
519
520                    if ($('#contact_type_abonnement > input[type="checkbox"]:checked').length == 0) {
521                        e.stopPropagation();
522                        $('.jqMessageTypeAbonnement').text('Veuillez cocher au moins un choix');
523
524                        return false;
525                    }
526
527                e.preventDefault();
528
529                $.ajax({
530                    type: 'POST',
531                    url: Routing.getBaseUrl() + '/abonnement/submit',
532                    data: $(this).serialize(),
533                    dataType: "json",
534                    success: function (data, status, object) {
535
536                        if ((data.success == true) ) {
537                            $("#successMessage").html('<div class="success">' + data.message + '</div>');
538
539                            // document.location.href = data.force_target_path;
540                        } else if (data.message) {
541                            $("#successMessage").html('<div class="error">' + data.message + '</div>');
542
543                        }
544                        $("#successMessage").show();
545                        $('#modalContent').hide();
546                        $("#jqCompleteSubscDialog").dialog({
547                            height: 150
548                        });
549
550                    },
551                    error: function (data, status, object) {
552                        console.log("erreur");
553                        // Gérez les erreurs si nécessaire
554                    }
555                });
556            });
557        });
558        $("#jqFirstStep").hide();
559    })
560    // popin "compléter " utilisé lors d'unn clique sur un lien avec cadenas
561    jqCompleteSubscDialog = $("#jqCompleteSubscDialog").dialog({
562        autoOpen: false,
563        width: 600,
564        modal: true,
565        closeText: "",
566        title: "Complétez votre abonnement",
567        buttons: [],
568        draggable: false,
569        close: function(event, ui) {
570            // Affichez la première partie lorsque la boîte de dialogue est fermée
571            $("#jqFirstStep").show();
572            $('#modalContent').hide();
573            $("#successMessage").hide();
574            $(this).dialog('option', 'height', 150);
575        }
576    });
577    //afficher la popin de connexion lors de clique sur un item
578    $("body").on('click', 'a.jqCompleteSubscription', function (event) {
579        event.preventDefault();
580        jqCompleteSubscDialog.dialog("open");
581    });
582    if ((Application.displayCompleteSubscriptionPopin != undefined) && (Application.displayCompleteSubscriptionPopin == '1')) {
583        jqCompleteSubscDialog.dialog("open");
584    }
585    /*var jContactForm = $("#contactForm");
586    var successMessage=$("#successMessage");
587    successMessage = $("#successMessage").dialog({
588        autoOpen: false,
589        width: 600,
590        modal: true,
591        closeText: "",
592        title: "Erreur",
593        buttons: [],
594        draggable: false
595    });*/
596/*    $("#submitEnvoiContact").on("click", function (e) {
597        e.preventDefault(); // Empêchez le formulaire de se soumettre normalement
598        console.log("here test submit");
599
600        $.ajax({
601            type: 'POST',
602            url: Routing.getBaseUrl() + '/abonnement/submit',
603            data: $(this).serialize(),
604            dataType: "json",
605            success: function (data, status, object) {
606                console.log(data.message);
607                if ((data.success == true) && data.force_target_path != "") {
608                    document.location.href = data.force_target_path;
609                } else if (data.message) {
610                    // Cachez d'abord le formulaire
611                    connexionError.dialog("open");
612                    jqCompleteSubscDialog.close()
613                 //   $('#modalContent').hide();
614                    // Affichez le message de succès dans l'élément ajouté
615                }
616            },
617            error: function (data, status, object) {
618                console.log("erreur");
619                // Gérez les erreurs si nécessaire
620            }
621        });
622    });*/
623
624
625    // scroll de fin de page
626    $(window).scroll(function () {
627        var bottomScrollToTop = $('#footer').height() + 10;
628        $('#scrollToTop a').css('bottom', bottomScrollToTop);
629        if ($(window).scrollTop() == 0) {
630            $('#scrollToTop').fadeOut("fast");
631        } else {
632            if ($('#scrollToTop').length == 0) {
633                $('header').append('<div id="scrollToTop">' +
634                    '<a href="#" title="Haut de page"><img src="/images/pictos/fleche-top.png" alt="Haut de page" /></a>' + '</div>');
635            }
636            $('#scrollToTop').fadeIn("fast");
637        }
638    });
639
640    //calcul min height
641    var heightEntete = 0;
642    if ($('.contentEnteteType2').height() > 10) {
643        heightEntete = $('.contentEnteteType2').height();
644    } else {
645        if ($('.contentEnteteType1').height() > 10) {
646            heightEntete = $('.contentEnteteType1').height();
647        }
648    }
649
650    var minHeightContenuGrise = $(window).height() - $('.contentEnteteType2').height() - $('#base_header').outerHeight() - heightEntete;
651
652
653    if ($('.contentEnteteType2').height() > 10) {
654        $('.contentEnteteType2 + .fondGrise').css('min-height', minHeightContenuGrise);
655    } else {
656        if ($('.contentEnteteType1').height() > 10) {
657            $('.contentEnteteType1 + .fondGrise').css('min-height', minHeightContenuGrise);
658        }
659    }
660
661    // popin mot de passe oublié
662    forgotPasswordDialog = $("#jqForgotPasswordDialog").dialog({
663        autoOpen: false,
664        width: '40%',
665        modal: true,
666        closeText: "",
667        title: "Mot de passe oublié",
668        buttons: [],
669        draggable: false
670    });
671
672    var dialogLoader = $("#jqForgotPasswordDialog").find('#loading');
673
674    //afficher la popin mot de passe oublié
675    $("body").on('click', 'a.jqLinkForgotPassword', function (event) {
676        event.preventDefault();
677
678        // Fermeture de toutes les POPINS
679        $('#connexion-msg.ui-dialog-content').dialog('close');
680        $('#jqLoginDialog').dialog('close');
681
682        dialogLoader.hide();
683        $('form#forgotPasswordForm')[0].reset()
684        $("div#globalMessage").text("");
685        $("#jqForgotPasswordDialog form div#errorMessage").text("");
686        $("div#jqForgotPasswordContainer").show();
687        forgotPasswordDialog.dialog("open");
688    }).on("submit", "#forgotPasswordForm", function (event) {
689        event.preventDefault();
690        $("#jqForgotPasswordDialog form div#errorMessage").text("");
691
692        $("div#jqForgotPasswordContainer").hide();
693        dialogLoader.show();
694
695        $.ajax({
696            type: 'POST',
697            url: $(this).attr('action'),
698            data: $(this).serialize(),
699            dataType: "json",
700            success: function (data, status, object) {
701                dialogLoader.hide();
702                if (data.success == true) {
703                    $("div#globalMessage, div#dialog-form div.dialogContent").text(data.msg);
704                    $("div#jqForgotPasswordContainer").hide();
705                    setTimeout(function () {
706                        forgotPasswordDialog.dialog("close")
707                    }, 3000);
708                } else if (data.msg) {
709                    $("div#jqForgotPasswordContainer").show();
710                    $("#jqForgotPasswordDialog form div#errorMessage").text(data.msg);
711                }
712            },
713            error: function (data, status, object) {
714            }
715        });
716
717    });
718
719    /*	gestion colonne gauche mobile (toggleClass puis le css prend le relais)	*/
720    $('body').on('click', '#jqSlideCol', function () {
721        $('#overlayMob').toggleClass('overlayOpen');
722        $('.ctColGaucheMobile').toggleClass('ctColGaucheMobileOpen');
723    });
724
725    /*	Fixer colonne gauche filtre au scroll	*/
726    if (($(document).height() > 650) && ($(document).width() < 737)) {
727        $(window).scroll(function () {
728            // Si on a un bloc moteur existant ou non
729            var landmarkScroll = ($('#conteneurFormSearch').length > 0) ? 180 : 50;
730
731            if (($(window).scrollTop() > landmarkScroll)) {
732                $('.ctColGaucheMobile').fadeIn();
733            }
734
735            if (($(window).scrollTop() < landmarkScroll + 1)) {
736                $('.ctColGaucheMobile').fadeOut();
737                $('#overlayMob').removeClass('overlayOpen');
738                $('.ctColGaucheMobile').removeClass('ctColGaucheMobileOpen');
739            }
740
741        });
742
743        $('body').on("click", function (e) {
744            if (($(".ctColGaucheMobile").has(e.target).length == 0)) {
745                $('#overlayMob').removeClass('overlayOpen');
746                $('.ctColGaucheMobile').removeClass('ctColGaucheMobileOpen');
747            }
748
749        });
750    }
751
752    var url = window.location.href;
753    var found = url.match('/document/') || url.match('/table-des-matieres');
754    if (found === null) {
755        sessionStorage.removeItem('itemsTdmOpen');
756    }
757
758    // Affiche le loader tant que 1 ou + Ajax sont en cours
759    var counter = 0;
760    var loader = $("div#loader");
761    var contenuPrincipal = $("div.contenuPrincipal");
762    $(document).bind("ajaxSend", function (e, xhr, settings) {
763        counter++;
764
765        if (counter === 1) {
766            contenuPrincipal.css('opacity', '0.5');
767            loader.show();
768        }
769    }).bind("ajaxComplete", function () {
770        counter--;
771
772        if (counter === 0) {
773            contenuPrincipal.css('opacity', '1');
774            loader.hide();
775        }
776    });
777
778
779 /*   $("#submitEnvoiContact").on('click',function(event) {
780        console.log("test");
781        alert("rrrrrr379");
782        event.preventDefault();
783        $.ajax({
784            url: $(this).attr('action'),
785            type: 'POST',
786            dataType: 'json',
787            data: $(this).serialize(),
788            success: function(data) {
789                alert("rrrr");
790                // Afficher le message dans un popup
791                console.log("rania");
792                alert(data.message);
793            }
794        });
795    });*/
796});
797
798$(function () {
799
800    // Select Choice List bloc recherche
801    $('body').on('click', '.selectChoiceList .jqCLickChoiceList', function (e) {
802        var selectChoiceList = $(this).parent('div');
803        var contentSelectChoiceList = selectChoiceList.children('.contentSelectChoiceList');
804
805        $('.contentSelectChoiceList').hide();
806
807        if (contentSelectChoiceList.is(':visible')) {
808            contentSelectChoiceList.removeClass('positionOn');
809            contentSelectChoiceList.hide();
810        } else {
811            contentSelectChoiceList.addClass('positionOn');
812            contentSelectChoiceList.show();
813            $('body').on("click", function (e) {
814                if (selectChoiceList.has(e.target).length == 0) {
815                    contentSelectChoiceList.hide();
816                }
817            });
818        }
819        return false;
820    });
821
822    // $('.selectChoiceList .jqCLickChoiceList').on("click", function (e) {
823    //     var selectChoiceList = $(this).parent('div');
824    //     var contentSelectChoiceList = selectChoiceList.children('.contentSelectChoiceList');
825    //     if (selectChoiceList.has(e.target).length == 0) {
826    //         contentSelectChoiceList.hide();
827    //     }
828    // });
829
830    // Fermer le select au clique sur le bouton valider
831    $('body').on('click', '.contentSelectChoiceList > .btnValider', function () {
832        $('.contentSelectChoiceList').hide();
833    });
834
835    $('body').on("click", '.optionSecteur', function () {
836        var currentSiteSector   = $('#select_choice_sector').data('current-site-sector'),
837            selectedSiteSector  = $(this).data('selected-site-sector'),
838            contentSelectChoiceList = $('.selectChoiceList .jqCLickChoiceList').parent('div').children('.contentSelectChoiceList');
839
840        if (currentSiteSector != selectedSiteSector) {
841            // On change le secteur si l'utilisateur n'a pas sélectionné le secteur courant
842            $('#select_choice_sector').val(selectedSiteSector);
843            $('#formChoixSecteur').submit();
844        } else {
845            // Si on sélectionne le secteur sur lequel on est déjà alors on cache le bloc
846            contentSelectChoiceList.hide();
847        }
848    });
849});
850
851App.window = App.window || {};
852
853jQuery(function () {
854    $('body')
855        .off("click", ".jqSubmitLogin")
856        .on("click", ".jqSubmitLogin", function (event) {
857        event.preventDefault();
858
859        // Pour récupérer les informations du bon formulaire de login car dans la page, on peut avoir 2 fois le même formulaire d'authentification
860        var type = $(this).data('type');
861
862        form = $("#loginForm" + type);
863
864        var datas = {
865            _csrf_token: form.find("#_csrf_token" + type).val(),
866            _target_path: form.find("#_target_path" + type).val(),
867            force_target_path: form.find("input[name='force_target_path']").val(),
868            _username: form.find("#username" + type).val(),
869            _password: form.find("#password" + type).val(),
870            _submit: 'ok'
871        };
872
873        // On vérifie si la case "Rester connecté" est coché alors on ajoute la valeur
874        if (form.find("#remember_me" + type).is(':checked')) {
875            datas._remember_me = form.find("#remember_me" + type).val();
876        }
877        // Controle la validité de l'adresse mail
878        function validateEmail(email) {
879            var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
880            return re.test(String(email).toLowerCase());
881        }
882
883        function hideAll() {
884            $("#connexion-msg0, #connexion-msg1, #connexion-msg2").hide();
885        }
886
887        connexionError = $("#connexion-msg").dialog({
888            autoOpen: false,
889            width: 600,
890            modal: true,
891            closeText: "",
892            title: "Erreur",
893            buttons: [],
894            draggable: false
895        });
896
897        if(validateEmail(datas._username)) {
898            hideAll();
899            $.ajax({
900                url: App.window.urlCheckLogin,
901                method: 'POST',
902                data: datas,
903                success: function (response) {
904                    if (response.success == false) {
905                        $('#jqLoginDialog').dialog('close');
906                        $("div#connexion-msg1").show();
907                        connexionError.dialog("open");
908                    } else if (response.success == true) {
909                        window.location.href = response.force_target_path;
910                    } else {
911                        $('#jqLoginDialog').dialog('close');
912                        $("div#connexion-msg0").show();
913                        connexionError.dialog("open");
914                    }
915                },
916                error: function (response) {
917                    console.log(response);
918                    console.log('Erreur login');
919                }
920            });
921        } else {
922            hideAll();
923            $("div#connexion-msg2").show();
924            connexionError.dialog("open");
925        }
926    });
927});
928
929"use strict";
930/**
931 * @Package Application.DocNavigation
932 */
933window.Application = window['Application'] || {};
934Application.DocNavigation = window['Application']['DocNavigation'] || {};
935
936Application.DocNavigation = function (config) {
937
938    /**
939     * Initialize variables
940     * @type {{}}
941     */
942    var self = {},
943        idDocument = config.idDocument || '',
944        typeDocument = config.typeDocument || '',
945        _id_static = idDocument,
946        _fetchPaginatedDocument;
947
948
949    self.initialize = function () {};
950
951    _fetchPaginatedDocument = function (documentUrl, idDocument, direction) {
952        var url = Routing.generate('ajax_get_paginated_document', {
953            'secteur': Application.GlobalOptions.getSector()
954        }),
955        locationLink = documentUrl;
956
957        jQuery.ajax({
958            url: url,
959            data: {
960                "idDocument": idDocument,
961                "direction": direction
962            },
963            method: 'POST',
964            success: function (response) {
965                if(response.document && response.document.hasOwnProperty('typeDocument') && response.document.hasOwnProperty('id')) {
966                    window.location = Routing.generate('bdr_view_document_from_search', {
967                        'secteur': Application.GlobalOptions.getSector(),
968                        'typeDocument': response.document['typeDocument'],
969                        'idDocument': response.document['id'],
970                        'position': response.position
971                    });
972                }
973                window.location = locationLink;
974            },
975            error: function () {}
976        });
977    };
978
979    jQuery('body').on('click', '.icon-fleche_gauche, .icon-fleche_droite', function (e) {
980        e.preventDefault();
981        var direction = (jQuery(jQuery(e)[0].target).hasClass('icon-fleche_gauche')) ? -1 : 1,
982            documentUrl = $(this).attr('href');
983        _fetchPaginatedDocument(documentUrl, _id_static, direction);
984        return false;
985    });
986
987    return self;
988};

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.