vendor: 5,835 bytes, lines 1-6
1/*! 2 * typeahead.js 0.11.1 3 * https://github.com/twitter/typeahead.js 4 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT 5 */ 6!function(a,b){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(c){return a.Bloodhound=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):a.Bloodhound=b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(c){return b.isUndefined(c)||null===c?"":c+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){if(!(d=c.call(null,e,a,b)))return!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){if(d=c.call(null,e,a,b))return!1}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(c){function d(){return String(c)}return a.isFunction(c)?c:d},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var h,i,f=this,g=arguments;return h=function(){d=null,c||(e=a.apply(f,g))},i=c&&!d,clearTimeout(d),d=setTimeout(h,b),i&&(e=a.apply(f,g)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,j<=0?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c="0.11.1",d=function(){"use strict";function a(a){return a=b.toStr(a),a?a.split(/\s+/):[]}function c(a){return a=b.toStr(a),a?a.split(/\W+/):[]}function d(a){return function(d){return d=b.isArray(d)?d:[].slice.call(arguments,0),function(e){var f=[];return b.each(d,function(c){f=f.concat(a(b.toStr(e[c])))}),f}}}return{nonword:c,whitespace:a,obj:{nonword:d(c),whitespace:d(a)}}}(),e=function(){"use strict";function c(c){this.maxSize=b.isNumber(c)?c:100,this.reset(),this.maxSize<=0&&(this.set=this.get=a.noop)}function d(){this.head=this.tail=null}function e(a,b){this.key=a,this.val=b,this.prev=this.next=null}return b.mixin(c.prototype,{set:function(b,c){var f,d=this.list.tail;this.size>=this.maxSize&&(this.list.remove(d),delete this.hash[d.key],this.size--),(f=this.hash[b])?(f.val=c,this.list.moveToFront(f)):(f=new e(b,c),this.list.add(f),this.hash[b]=f,this.size++)},get:function(b){var c=this.hash[b];if(c)return this.list.moveToFront(c),c.val},reset:function(){this.size=0,this.hash={},this.list=new d}}),b.mixin(d.prototype,{add:function(b){this.head&&(b.next=this.head,this.head.prev=b),this.head=b,this.tail=this.tail||b},remove:function(b){b.prev?b.prev.next=b.next:this.head=b.next,b.next?b.next.prev=b.prev:this.tail=b.prev},moveToFront:function(a){this.remove(a),this.add(a)}}),c}(),f=function(){"use strict";function d(a,d){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+b.escapeRegExChars(this.prefix)),this.ls=d||c,!this.ls&&this._noop()}function e(){return(new Date).getTime()}function f(a){return JSON.stringify(b.isUndefined(a)?null:a)}function g(b){return a.parseJSON(b)}function h(a){var b,d,e=[],f=c.length;for(b=0;b<f;b++)(d=c.key(b)).match(a)&&e.push(d.replace(a,""));return e}var c;try{c=window.localStorage,c.setItem("~~~","!"),c.removeItem("~~~")}catch(a){c=null}return b.mixin(d.prototype,{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=b.noop},_safeSet:function(a,b){try{this.ls.setItem(a,b)}catch(a){"QuotaExceededError"===a.name&&(this.clear(),this._noop())}},get:function(a){return this.isExpired(a)&&this.remove(a),g(this.ls.getItem(this._prefix(a)))},set:function(a,c,d){return b.isNumber(d)?this._safeSet(this._ttlKey(a),f(e()+d)):this.ls.removeItem(this._ttlKey(a)),this._safeSet(this._prefix(a),f(c))},remove:function(a){return this.ls.removeItem(this._ttlKey(a)),this.ls.removeItem(this._prefix(a)),this},clear:function(){var a,b=h(this.keyMatcher);for(a=b.length;a--;)this.remove(b[a]);return this},isExpired:function(a){var c=g(this.ls.getItem(this._ttlKey(a)));return!!(b.isNumber(c)&&e()>c)}}),d}(),g=function(){"use strict";function h(a){a=a||{},this.cancelled=!1,this.lastReq=null,this._send=a.transport,this._get=a.limiter?a.limiter(this._get):this._get,this._cache=a.cache===!1?new e(0):g}var c=0,d={},f=6,g=new e(10);return h.setMaxPendingRequests=function(b){f=b},h.resetCache=function(){g.reset()},b.mixin(h.prototype,{_fingerprint:function(c){return c=c||{},c.url+c.type+a.param(c.data||{})},_get:function(a,b){function i(a){b(null,a),e._cache.set(g,a)}function j(){b(!0)}function k(){c--,delete d[g],e.onDeckRequestArgs&&(e._get.apply(e,e.onDeckRequestArgs),e.onDeckRequestArgs=null)}var g,h,e=this;g=this._fingerprint(a),this.cancelled||g!==this.lastReq||((h=d[g])?h.done(i).fail(j):c<f?(c++,d[g]=this._send(a).done(i).fail(j).always(k)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(c,d){var e,f;d=d||a.noop,c=b.isString(c)?{url:c}:c||{},f=this._fingerprint(c),this.cancelled=!1,this.lastReq=f,(e=this._cache.get(f))?d(null,e):this._get(c,d)}
vendor: 5,672 bytes, line 6
6,cancel:function(){this.cancelled=!0}}),h}(),h=window.SearchIndex=function(){"use strict";function e(c){c=c||{},c.datumTokenizer&&c.queryTokenizer||a.error("datumTokenizer and queryTokenizer are both required"),this.identify=c.identify||b.stringify,this.datumTokenizer=c.datumTokenizer,this.queryTokenizer=c.queryTokenizer,this.reset()}function f(a){return a=b.filter(a,function(a){return!!a}),a=b.map(a,function(a){return a.toLowerCase()})}function g(){var a={};return a[d]=[],a[c]={},a}function h(a){for(var b={},c=[],d=0,e=a.length;d<e;d++)b[a[d]]||(b[a[d]]=!0,c.push(a[d]));return c}function i(a,b){var c=0,d=0,e=[];a=a.sort(),b=b.sort();for(var f=a.length,g=b.length;c<f&&d<g;)a[c]<b[d]?c++:a[c]>b[d]?d++:(e.push(a[c]),c++,d++);return e}var c="c",d="i";return b.mixin(e.prototype,{bootstrap:function(b){this.datums=b.datums,this.trie=b.trie},add:function(a){var e=this;a=b.isArray(a)?a:[a],b.each(a,function(a){var h,i;e.datums[h=e.identify(a)]=a,i=f(e.datumTokenizer(a)),b.each(i,function(a){var b,f,i;for(b=e.trie,f=a.split("");i=f.shift();)b=b[c][i]||(b[c][i]=g()),b[d].push(h)})})},get:function(c){var d=this;return b.map(c,function(a){return d.datums[a]})},search:function(e){var j,k,g=this;return j=f(this.queryTokenizer(e)),b.each(j,function(a){var b,e,f,h;if(k&&0===k.length)return!1;for(b=g.trie,e=a.split("");b&&(f=e.shift());)b=b[c][f];return b&&0===e.length?(h=b[d].slice(0),void(k=k?i(k,h):h)):(k=[],!1)}),k?b.map(h(k),function(a){return g.datums[a]}):[]},all:function(){var b=[];for(var c in this.datums)b.push(this.datums[c]);return b},reset:function(){this.datums={},this.trie=g()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),e}(),i=function(){"use strict";function c(a){this.url=a.url,this.ttl=a.ttl,this.cache=a.cache,this.prepare=a.prepare,this.transform=a.transform,this.transport=a.transport,this.thumbprint=a.thumbprint,this.storage=new f(a.cacheKey)}var a;return a={data:"data",protocol:"protocol",thumbprint:"thumbprint"},b.mixin(c.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(c){this.cache&&(this.storage.set(a.data,c,this.ttl),this.storage.set(a.protocol,location.protocol,this.ttl),this.storage.set(a.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var d,c={};return this.cache?(c.data=this.storage.get(a.data),c.protocol=this.storage.get(a.protocol),c.thumbprint=this.storage.get(a.thumbprint),d=c.thumbprint!==this.thumbprint||c.protocol!==location.protocol,c.data&&!d?c.data:null):null},fromNetwork:function(a){function d(){a(!0)}function e(c){a(null,b.transform(c))}var c,b=this;a&&(c=this.prepare(this._settings()),this.transport(c).fail(d).done(e))},clear:function(){return this.storage.clear(),this}}),c}(),j=function(){"use strict";function a(a){this.url=a.url,this.prepare=a.prepare,this.transform=a.transform,this.transport=new g({cache:a.cache,limiter:a.limiter,transport:a.transport})}return b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(b,c){function f(a,b){c(a?[]:d.transform(b))}var e,d=this;if(c)return b=b||"",e=this.prepare(b,this._settings()),this.transport.get(e,f)},cancelLastRequest:function(){this.transport.cancel()}}),a}(),k=function(){"use strict";function d(d){var e;return d?(e={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:b.identity,transform:b.identity,transport:null},d=b.isString(d)?{url:d}:d,d=b.mixin(e,d),!d.url&&a.error("prefetch requires url to be set"),d.transform=d.filter||d.transform,d.cacheKey=d.cacheKey||d.url,d.thumbprint=c+d.thumbprint,d.transport=d.transport?h(d.transport):a.ajax,d):null}function e(c){var d;if(c)return d={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:b.identity,transport:null},c=b.isString(c)?{url:c}:c,c=b.mixin(d,c),!c.url&&a.error("remote requires url to be set"),c.transform=c.filter||c.transform,c.prepare=f(c),c.limiter=g(c),c.transport=c.transport?h(c.transport):a.ajax,delete c.replace,delete c.wildcard,delete c.rateLimitBy,delete c.rateLimitWait,c}function f(a){function e(a,b){return b.url=c(b.url,a),b}function f(a,b){return b.url=b.url.replace(d,encodeURIComponent(a)),b}function g(a,b){return b}var b,c,d;return b=a.prepare,c=a.replace,d=a.wildcard,b?b:b=c?e:a.wildcard?f:g}function g(a){function f(a){return function(d){return b.debounce(d,a)}}function g(a){return function(d){return b.throttle(d,a)}}var c,d,e;return c=a.limiter,d=a.rateLimitBy,e=a.rateLimitWait,c||(c=/^throttle$/i.test(d)?g(e):f(e)),c}function h(c){return function(e){function g(a){b.defer(function(){f.resolve(a)})}function h(a){b.defer(function(){f.reject(a)})}var f=a.Deferred();return c(e,g,h),f}}return function(f){var g,h;return g={initialize:!0,identify:b.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},f=b.mixin(g,f||{}),!f.datumTokenizer&&a.error("datumTokenizer is required"),!f.queryTokenizer&&a.error("queryTokenizer is required"),h=f.sorter,f.sorter=h?function(a){return a.sort(h)}:b.identity,f.local=b.isFunction(f.local)?f.local():f.local,f.prefetch=d(f.prefetch),f.remote=e(f.remote),f}}(),l=function(){"use strict";function e(a){a=k(a),this.sorter=a.sorter,this.identify=a.identify,this.sufficient=a.sufficient,this.local=a.local,this.remote=a.remote?new j(a.remote):null,this.prefetch=a.prefetch?new i(a.prefetch):null,this.index=new h({identify:this.identify,datumTokenizer:a.datumTokenizer,queryTokenizer:a.queryTokenizer}),a.initialize!==!1&&this.initialize()}var c;return c=window&&window.Bloodhound,e.noConflict=function(){return window&&(window.Bloodhound=c),e}
vendor: 4,602 bytes, line 6
6,e.tokenizers=d,b.mixin(e.prototype,{__ttAdapter:function(){function c(a,c,d){return b.search(a,c,d)}function d(a,c){return b.search(a,c)}var b=this;return this.remote?c:d},_loadPrefetch:function(){function f(a,b){return a?d.reject():(c.add(b),c.prefetch.store(c.index.serialize()),void d.resolve())}var d,e,c=this;return d=a.Deferred(),this.prefetch?(e=this.prefetch.fromCache())?(this.index.bootstrap(e),d.resolve()):this.prefetch.fromNetwork(f):d.resolve(),d.promise()},_initialize:function(){function d(){b.add(b.local)}var b=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(d),this.initPromise},initialize:function(b){return!this.initPromise||b?this._initialize():this.initPromise},add:function(b){return this.index.add(b),this},get:function(c){return c=b.isArray(c)?c:[].slice.call(arguments),this.index.get(c)},search:function(c,d,e){function h(a){var c=[];b.each(a,function(a){!b.some(g,function(b){return f.identify(a)===f.identify(b)})&&c.push(a)}),e&&e(c)}var g,f=this;return g=this.sorter(this.index.search(c)),d(this.remote?g.slice():g),this.remote&&g.length<this.sufficient?this.remote.get(c,h):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return g.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),e}();return l}),function(a,b){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(c){return b.isUndefined(c)||null===c?"":c+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){if(!(d=c.call(null,e,a,b)))return!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){if(d=c.call(null,e,a,b))return!1}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(c){function d(){return String(c)}return a.isFunction(c)?c:d},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var h,i,f=this,g=arguments;return h=function(){d=null,c||(e=a.apply(f,g))},i=c&&!d,clearTimeout(d),d=setTimeout(h,b),i&&(e=a.apply(f,g)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,j<=0?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c=function(){"use strict";function c(c){var g,h;return h=b.mixin({},a,c),g={css:f(),classes:h,html:d(h),selectors:e(h)},{css:g.css,html:g.html,classes:g.classes,selectors:g.selectors,mixin:function(a){b.mixin(a,g)}}}function d(a){return{wrapper:'<span class="'+a.wrapper+'"></span>',menu:'<div class="'+a.menu+'"></div>'}}function e(a){var c={};return b.each(a,function(a,b){c[b]="."+a}),c}function f(){var a={wrapper:{position:"relative"},hint:{position:"absolute",top:"0",left:"0",background:"transparent",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"#FFF"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"10000",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),a}var a={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-
6open",cursor:"tt-cursor",highlight:"tt-highlight"};return c}(),d=function(){"use strict";function e(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var c,d;return c="typeahead:",d={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},b.mixin(e.prototype,{_trigger:function(b,d){var e;return e=a.Event(c+b),(d=d||[]).unshift(e),this.$el.trigger.apply(this.$el,d),e},before:function(a){var b,c;return b=[].slice.call(arguments,1),c=this._trigger("before"+a,b),c.isDefaultPrevented()},trigger:function(a){var b;this._trigger(a,[].slice.call(arguments,1)),(b=d[a])&&this._trigger(b,[].slice.call(arguments,1))}}),e}(),e=function(){"use strict";function c(b,c,d,e){var f;if(!d)return this;for(c=c.split(a),d=e?j(d,e):d,this._callbacks=this._callbacks||{};f=c.shift();)this._callbacks[f]=this._callbacks[f]||{sync:[],async:[]},this._callbacks[f][b].push(d);return this}function d(a,b,d){return c.call(this,"async",a,b,d)}function e(a,b,d){return c.call(this,"sync",a,b,d)}function f(b){var c;if(!this._callbacks)return this;for(b=b.split(a);c=b.shift();)delete this._callbacks[c];return this}function g(c){var d,e,f,g,i;if(!this._callbacks)return this;for(c=c.split(a),f=[].slice.call(arguments,1);
vendor: 12,833 bytes, line 6
6(d=c.shift())&&(e=this._callbacks[d]);)g=h(e.sync,this,[d].concat(f)),i=h(e.async,this,[d].concat(f)),g()&&b(i);return this}function h(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&e<f;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function i(){var a;return a=window.setImmediate?function(b){setImmediate(function(){b()})}:function(b){setTimeout(function(){b()},0)}}function j(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var a=/\s+/,b=i();return{onSync:e,onAsync:d,off:f,trigger:g}}(),f=function(a){"use strict";function d(a,c,d){for(var f,e=[],g=0,h=a.length;g<h;g++)e.push(b.escapeRegExChars(a[g]));return f=d?"\\b("+e.join("|")+")\\b":"("+e.join("|")+")",c?new RegExp(f):new RegExp(f,"i")}var c={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(f){function h(b){var c,d,e;return(c=g.exec(b.data))&&(e=a.createElement(f.tagName),f.className&&(e.className=f.className),d=b.splitText(c.index),d.splitText(c[0].length),e.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(e,d)),!!c}function i(a,b){for(var c,d=3,e=0;e<a.childNodes.length;e++)c=a.childNodes[e],c.nodeType===d?e+=b(c)?1:0:i(c,b)}var g;f=b.mixin({},c,f),f.node&&f.pattern&&(f.pattern=b.isArray(f.pattern)?f.pattern:[f.pattern],g=d(f.pattern,f.caseSensitive,f.wordsOnly),i(f.node,h))}}(window.document),g=function(){"use strict";function d(c,d){c=c||{},c.input||a.error("input is missing"),d.mixin(this),this.$hint=a(c.hint),this.$input=a(c.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=f(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=b.noop)}function f(b){return a('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function g(a,b){return d.normalizeQuery(a)===d.normalizeQuery(b)}function h(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var c;return c={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},d.normalizeQuery=function(a){return b.toStr(a).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},b.mixin(d.prototype,e,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(b){var d=c[b.which||b.keyCode];this._managePreventDefault(d,b),d&&this._shouldTrigger(d,b)&&this.trigger(d+"Keyed",b)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(b,c){var d;switch(b){case"up":case"down":d=!h(c);break;default:d=!1}d&&c.preventDefault()},_shouldTrigger:function(b,c){var d;switch(b){case"tab":d=!h(c);break;default:d=!0}return d},_checkLanguageDirection:function(){var b=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==b&&(this.dir=b,this.$hint.attr("dir",b),this.trigger("langDirChanged",b))},_setQuery:function(b,c){var d,e;d=g(b,this.query),e=!!d&&this.query.length!==b.length,this.query=b,c||d?!c&&e&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var d,e,f,g,a=this;return d=b.bind(this._onBlur,this),e=b.bind(this._onFocus,this),f=b.bind(this._onKeydown,this),g=b.bind(this._onInput,this),this.$input.on("blur.tt",d).on("focus.tt",e).on("keydown.tt",f),!b.isMsie()||b.isMsie()>9?this.$input.on("input.tt",g):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(d){c[d.which||d.keyCode]||b.defer(b.bind(a._onInput,a,d))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(b,c){this.setInputValue(b),this._setQuery(b,c)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(b){this.$input.val(b),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(b){this.$hint.val(b)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var b,c,d,e;b=this.getInputValue(),c=this.getHint(),d=b!==c&&0===c.indexOf(b),e=""!==b&&d&&!this.hasOverflow(),!e&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var b=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=b},isCursorAtEnd:function(){var a,c,d;return a=this.$input.val().length,c=this.$input[0].selectionStart,b.isNumber(c)?c===a:!document.selection||(d=document.selection.createRange(),d.moveStart("character",-a),a===d.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=a("<div>")}}),d}(),h=function(){"use strict";function g(c,e){c=c||{},c.templates=c.templates||{},c.templates.notFound=c.templates.notFound||c.templates.empty,c.source||a.error("missing source"),c.node||a.error("missing node"),c.name&&!j(c.name)&&a.error("invalid dataset name: "+c.name),e.mixin(this),this.highlight=!!c.highlight,this.name=c.name||d(),this.limit=c.limit||5,this.displayFn=h(c.display||c.displayKey),this.templates=i(c.templates,this.displayFn),this.source=c.source.__ttAdapter?c.source.__ttAdapter():c.source,this.async=b.isUndefined(c.async)?this.source.length>2:!!c.async,this._resetLastSuggestion(),this.$el=a(c.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function h(a){function c(b){return b[a]}return a=a||b.stringify,b.isFunction(a)?a:c}function i(c,d){function e(b){return a("<div>").text(d(b))}return{notFound:c.notFound&&b.templatify(c.notFound),pending:c.pending&&b.templatify(c.pending),header:c.header&&b.templatify(c.header),footer:c.footer&&b.templatify(c.footer),suggestion:c.suggestion||e}}function j(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var c,d;return c={val:"tt-selectable-display",obj:"tt-selectable-object"},d=b.getIdGenerator(),g.extractData=function(d){var e=a(d);return e.data(c.obj)?{val:e.data(c.val)||"",obj:e.data(c.obj)||null}:null},b.mixin(g.prototype,e,{_overwrite:function(b,c){c=c||[],c.length?this._renderSuggestions(b,c):this.async&&this.templates.pending?this._renderPending(b):!this.async&&this.templates.notFound?this._renderNotFound(b):this._empty(),this.trigger("rendered",this.name,c,!1)},_append:function(b,c){c=c||[],c.length&&this.$lastSuggestion.length?this._appendSuggestions(b,c):c.length?this._renderSuggestions(b,c):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(b),this.trigger("rendered",this.name,c,!0)},_renderSuggestions:function(b,c){var d;d=this._getSuggestionsFragment(b,c),this.$lastSuggestion=d.children().last(),this.$el.html(d).prepend(this._getHeader(b,c)).append(this._getFooter(b,c))},_appendSuggestions:function(b,c){var d,e;d=this._getSuggestionsFragment(b,c),e=d.children().last(),this.$lastSuggestion.after(d),this.$lastSuggestion=e},_renderPending:function(b){var c=this.templates.pending;this._resetLastSuggestion(),c&&this.$el.html(c({query:b,dataset:this.name}))},_renderNotFound:function(b){var c=this.templates.notFound;this._resetLastSuggestion(),c&&this.$el.html(c({query:b,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(e,g){var i,h=this;return i=document.createDocumentFragment(),b.each(g,function(d){var f,g;g=h._injectQuery(e,d),f=a(h.templates.suggestion(g)).data(c.obj,d).data(c.val,h.displayFn(d)).addClass(h.classes.suggestion+" "+h.classes.selectable)}),this.highlight&&f({className:this.classes.highlight,node:i,pattern:e}),a(i)},_getFooter:function(b,c){return this.templates.footer?this.templates.footer({query:b,suggestions:c,dataset:this.name}):null},_getHeader:function(b,c){return this.templates.header?this.templates.header({query:b,suggestions:c,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=a()},_injectQuery:function(c,d){return b.isObject(d)?b.mixin({_query:c},d):d},update:function(c){function h(a){f||(f=!0,a=(a||[]).slice(0,d.limit),g=a.length,d._overwrite(c,a),g<d.limit&&d.async&&d.trigger("asyncRequested",c))}function i(b){b=b||[],!e&&g<d.limit&&(d.cancel=a.noop,b=(b||[]).slice(0,d.limit-g),g+=b.length,d._append(c,b),d.async&&d.trigger("asyncReceived",c))}var d=this,e=!1,f=!1,g=0;this.cancel(),this.cancel=function(){e=!0,d.cancel=a.noop,d.async&&d.trigger("asyncCanceled",c)},this.source(c,h,i),!f&&h([])},cancel:a.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=a("<div>")}}),g}(),i=function(){"use strict";function c(c,d){function f(b){var c=e.$node.find(b.node).first();return b.node=c.length?c:a("<div>").appendTo(e.$node),new h(b,d)}var e=this;c=c||{},c.node||a.error("node is required"),d.mixin(this),this.$node=a(c.node),this.query=null,this.datasets=b.map(c.datasets,f)}return b.mixin(c.prototype,e,{_onSelectableClick:function(c){this.trigger("selectableClicked",a(c.currentTarget))},_onRendered:function(b,c,d,e){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",c,d,e)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){function c(a){return a.isEmpty()}return b.every(this.datasets,c)},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var b=this.getActiveSelectable();b&&b.removeClass(this.classes.cursor)},_ensureVisible:function(b){var c,d,e,f;c=b.position().top,d=c+b.outerHeight(!0),e=this.$node.scrollTop(),f=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),c<0?this.$node.scrollTop(e+c):f<d&&this.$node.scrollTop(e+(d-f))},bind:function(){var c,a=this;return c=b.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,c),b.each(this.datasets,function(b){b.onSync("asyncRequested",a._propagate,a).onSync("asyncCanceled",a._propagate,a).onSync("asyncReceived",a._propagate,a).onSync("rendered",a._onRendered,a).onSync("cleared",a._onCleared,a)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(b){this.$node.attr("dir",b)},selectableRelativeToCursor:function(b){var c,d,e,f;return d=this.getActiveSelectable(),c=this._getSelectables(),e=d?c.index(d):-1,f=e+b,f=(f+1)%(c.length+1)-1,f=f<-1?c.length-1:f,f===-1?null:c.eq(f)},setCursor:function(b){this._removeCursor(),(b=b&&b.first())&&(b.addClass(this.classes.cursor),this._ensureVisible(b))},getSelectableData:function(b){return b&&b.length?h.extractData(b):null},getActiveSelectable:function(){var b=this._getSelectables().filter(this.selectors.cursor).first();return b.length?b:null},getTopSelectable:function(){var b=this._getSelectables().first();return b.length?b:null},update:function(c){function e(a){a.update(c)}var d=c!==this.query;return d&&(this.query=c,b.each(this.datasets,e)),d},empty:function(){function c(a){a.clear()}b.each(this.datasets,c),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function d(a){a.destroy()}this.$node.off(".tt"),this.$node=a("<div>"),b.each(this.datasets,d)}}),c}(),j=function(){"use strict";function c(){i.apply(this,[].slice.call(arguments,0))}var a=i.prototype;return b.mixin(c.prototype,i.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),a.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),a.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),a._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),a._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(c){return this.$node.css("ltr"===c?this.css.ltr:this.css.rtl),a.setLanguageDirection.apply(this,[].slice.call(arguments,0))}
vendor: 6,303 bytes, lines 6-7
6,_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),c}(),k=function(){"use strict";function c(c,e){var f,g,h,i,j,k,l,m,n,o,p;c=c||{},c.input||a.error("missing input"),c.menu||a.error("missing menu"),c.eventBus||a.error("missing event bus"),e.mixin(this),this.eventBus=c.eventBus,this.minLength=b.isNumber(c.minLength)?c.minLength:1,this.input=c.input,this.menu=c.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),f=d(this,"activate","open","_onFocused"),g=d(this,"deactivate","_onBlurred"),h=d(this,"isActive","isOpen","_onEnterKeyed"),i=d(this,"isActive","isOpen","_onTabKeyed"),j=d(this,"isActive","_onEscKeyed"),k=d(this,"isActive","open","_onUpKeyed"),l=d(this,"isActive","open","_onDownKeyed"),m=d(this,"isActive","isOpen","_onLeftKeyed"),n=d(this,"isActive","isOpen","_onRightKeyed"),o=d(this,"_openIfActive","_onQueryChanged"),p=d(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",f,this).onSync("blurred",g,this).onSync("enterKeyed",h,this).onSync("tabKeyed",i,this).onSync("escKeyed",j,this).onSync("upKeyed",k,this).onSync("downKeyed",l,this).onSync("leftKeyed",m,this).onSync("rightKeyed",n,this).onSync("queryChanged",o,this).onSync("whitespaceChanged",p,this).onSync("langDirChanged",this._onLangDirChanged,this)}function d(a){var c=[].slice.call(arguments,1);return function(){var d=[].slice.call(arguments);b.each(c,function(b){return a[b].apply(a,d)})}}return b.mixin(c.prototype,{_hacks:function(){var d,e;d=this.input.$input||a("<div>"),e=this.menu.$node||a("<div>"), 7d.on("blur.tt",function(a){var c,f,g;c=document.activeElement,f=e.is(c),g=e.has(c).length>0,b.isMsie()&&(f||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){d.focus()}))}),e.on("mousedown.tt",function(a){a.preventDefault()})},_onSelectableClicked:function(b,c){this.select(c)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(b,c,d,e){this._updateHint(),this.eventBus.trigger("render",d,e,c)},_onAsyncRequested:function(b,c,d){this.eventBus.trigger("asyncrequest",d,c)},_onAsyncCanceled:function(b,c,d){this.eventBus.trigger("asynccancel",d,c)},_onAsyncReceived:function(b,c,d){this.eventBus.trigger("asyncreceive",d,c)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(b,c){var d;(d=this.menu.getActiveSelectable())&&this.select(d)&&c.preventDefault()},_onTabKeyed:function(b,c){var d;(d=this.menu.getActiveSelectable())?this.select(d)&&c.preventDefault():(d=this.menu.getTopSelectable())&&this.autocomplete(d)&&c.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(b,c){this._minLengthMet(c)?this.menu.update(c):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(b,c){this.dir!==c&&(this.dir=c,this.menu.setLanguageDirection(c))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(c){return c=b.isString(c)?c:this.input.getQuery()||"",c.length>=this.minLength},_updateHint:function(){var c,d,e,f,h,i,j;c=this.menu.getTopSelectable(),d=this.menu.getSelectableData(c),e=this.input.getInputValue(),!d||b.isBlankString(e)||this.input.hasOverflow()?this.input.clearHint():(f=g.normalizeQuery(e),h=b.escapeRegExChars(f),i=new RegExp("^(?:"+h+")(.+$)","i"),j=i.exec(d.val),j&&this.input.setHint(e+j[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(c){this.input.setQuery(b.toStr(c))},getVal:function(){return this.input.getQuery()},select:function(b){var c=this.menu.getSelectableData(b);return!(!c||this.eventBus.before("select",c.obj))&&(this.input.setQuery(c.val,!0),this.eventBus.trigger("select",c.obj),this.close(),!0)},autocomplete:function(b){var c,d,e;return c=this.input.getQuery(),d=this.menu.getSelectableData(b),e=d&&c!==d.val,!(!e||this.eventBus.before("autocomplete",d.obj))&&(this.input.setQuery(d.val),this.eventBus.trigger("autocomplete",d.obj),!0)},moveCursor:function(b){var c,d,e,f,g;return c=this.input.getQuery(),d=this.menu.selectableRelativeToCursor(b),e=this.menu.getSelectableData(d),f=e?e.obj:null,g=this._minLengthMet()&&this.menu.update(c),!g&&!this.eventBus.before("cursorchange",f)&&(this.menu.setCursor(d),e?this.input.setInputValue(e.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",f),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),c}();!function(){"use strict";function l(b,c){b.each(function(){var d,b=a(this);(d=b.data(f.typeahead))&&c(d,b)})}function m(a,b){return a.clone().addClass(b.classes.hint).removeData().css(b.css.hint).css(o(a)).prop("readonly",!0).removeAttr("id n
vendor: 5,913 bytes, lines 7-9
7ame placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function n(a,b){a.data(f.attrs,{dir:a.attr("dir"),autocomplete:a.attr("autocomplete"),spellcheck:a.attr("spellcheck"),style:a.attr("style")}),a.addClass(b.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!a.attr("dir")&&a.attr("dir","auto")}catch(a){}return a}function o(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function p(a){var c,d;c=a.data(f.www),d=a.parent().filter(c.selectors.wrapper),b.each(a.data(f.attrs),function(c,d){b.isUndefined(c)?a.removeAttr(d):a.attr(d,c)}),a.removeData(f.typeahead).removeData(f.www).removeData(f.attr).removeClass(c.classes.input),d.length&&(a.detach().insertAfter(d),d.remove())}function q(c){var d,e;return d=b.isJQuery(c)||b.isElement(c),e=d?a(c).first():[],e.length?e:null}var e,f,h;e=a.fn.typeahead,f={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},h={initialize:function(h,l){function p(){var c,e,p,r,s,t,u,v,w,x,y;b.each(l,function(a){a.highlight=!!h.highlight}),c=a(this),e=a(o.html.wrapper),p=q(h.hint),r=q(h.menu),s=h.hint!==!1&&!p,t=h.menu!==!1&&!r,s&&(p=m(c,o)),t&&(r=a(o.html.menu).css(o.css.menu)),p&&p.val(""),c=n(c,o),(s||t)&&(e.css(o.css.wrapper),c.css(s?o.css.input:o.css.inputWithNoHint),c.wrap(e).parent().prepend(s?p:null).append(t?r:null)),y=t?j:i,u=new d({el:c}),v=new g({hint:p,input:c},o),w=new y({node:r,datasets:l},o),x=new k({input:v,menu:w,eventBus:u,minLength:h.minLength},o),c.data(f.www,o),c.data(f.typeahead,x)}var o;return l=b.isArray(l)?l:[].slice.call(arguments,1),h=h||{},o=c(h.classNames),this.each(p)},isEnabled:function(){var b;return l(this.first(),function(a){b=a.isEnabled()}),b},enable:function(){return l(this,function(a){a.enable()}),this},disable:function(){return l(this,function(a){a.disable()}),this},isActive:function(){var b;return l(this.first(),function(a){b=a.isActive()}),b},activate:function(){return l(this,function(a){a.activate()}),this},deactivate:function(){return l(this,function(a){a.deactivate()}),this},isOpen:function(){var b;return l(this.first(),function(a){b=a.isOpen()}),b},open:function(){return l(this,function(a){a.open()}),this},close:function(){return l(this,function(a){a.close()}),this},select:function(c){var d=!1,e=a(c);return l(this.first(),function(a){d=a.select(e)}),d},autocomplete:function(c){var d=!1,e=a(c);return l(this.first(),function(a){d=a.autocomplete(e)}),d},moveCursor:function(b){var c=!1;return l(this.first(),function(a){c=a.moveCursor(b)}),c},val:function(b){var c;return arguments.length?(l(this,function(a){a.setVal(b)}),this):(l(this.first(),function(a){c=a.getVal()}),c)},destroy:function(){return l(this,function(a,b){p(b),a.destroy()}),this}},a.fn.typeahead=function(a){return h[a]?h[a].apply(this,[].slice.call(arguments,1)):h.initialize.apply(this,arguments)},a.fn.typeahead.noConflict=function(){return a.fn.typeahead=e,this}}()}); 8 9!function(a){"use strict";var b="starRating",c=function(){},d={totalStars:5,useFullStars:!1,starShape:"straight",emptyColor:"lightgray",hoverColor:"orange",activeColor:"gold",useGradient:!0,readOnly:!1,disableAfterRate:!0,baseUrl:!1,starGradient:{start:"#FEF7CD",end:"#FF9511"},strokeWidth:4,strokeColor:"black",initialRating:0,starSize:40,callback:c,onHover:c,onLeave:c},e=function(c,e){var f;this.element=c,this.$el=a(c),this.settings=a.extend({},d,e),f=this.$el.data("rating")||this.settings.initialRating,this._state={rating:(Math.round(2*f)/2).toFixed(1)},this._uid=Math.floor(999*Math.random()),e.starGradient||this.settings.useGradient||(this.settings.starGradient.start=this.settings.starGradient.end=this.settings.activeColor),this._defaults=d,this._name=b,this.init()},f={init:function(){this.renderMarkup(),this.addListeners(),this.initRating()},addListeners:function(){this.settings.readOnly||(this.$stars.on("mouseover",this.hoverRating.bind(this)),this.$stars.on("mouseout",this.restoreState.bind(this)),this.$stars.on("click",this.handleRating.bind(this)))},hoverRating:function(a){var b=this.getIndex(a);this.paintStars(b,"hovered"),this.settings.onHover(b+1,this._state.rating,this.$el)},handleRating:function(a){var b=this.getIndex(a),c=b+1;this.applyRating(c,this.$el),this.executeCallback(c,this.$el),this.settings.disableAfterRate&&this.$stars.off()},applyRating:function(a){var b=a-1;this.paintStars(b,"active"),this._state.rating=b+1},restoreState:function(a){var b=this.getIndex(a),c=this._state.rating||-1;this.paintStars(c-1,"active"),this.settings.onLeave(b+1,this._state.rating,this.$el)},getIndex:function(b){var c=a(b.currentTarget),d=c.width(),e=a(b.target).attr("data-side");e=e?e:this.getOffsetByPixel(b,c,d),e=this.settings.useFullStars?"right":e;var f=c.index()-("left"===e?.5:0);return f=.5>f&&b.offsetX<d/4?-1:f},getOffsetByPixel:function(a,b,c){var d=a.pageX-b.offset().left;return c/2>=d&&!this.settings.useFullStars?"left":"right"},initRating:function(){this.paintStars(this._state.rating-1,"active")},paintStars:function(b,c){var d,e,f,g;a.each(this.$stars,function(h,i){d=a(i).find('[data-side="left"]'),e=a(i).find('[data-side="right"]'),f=g=b>=h?c:"empty",f=h-b===.5?c:f,d.attr("class","svg-"+f+"-"+this._uid),e.attr("class","svg-"+g+"-"+this._uid)}.bind(this))},renderMarkup:function(){for(var a=this.settings,b=a.baseUrl?location.href.split("#")[0]:"",c='<div class="jq-star" style="width:'+a.starSize+"px; height:"+a.starSize+'px;"><svg version="1.0" class="jq-star-svg" shape-rendering="geometricPrecision" xmlns="http://www.w3.org/2000/svg" '+this.getSvgDimensions(a.starShape)+" stroke-width:"+a.strokeWidth+'px;" xml:space="preserve"><style type="text/css">
9.svg-empty-'+this._uid+"{fill:url("+b+"#"+this._uid+"_SVGID_1_);}.svg-hovered-"+this._uid+"{fill:url("+b+"#"+this._uid+"_SVGID_2_);}.svg-active-"+this._uid+"{fill:url("+b+"#"+this._uid+"_SVGID_3_);}</style>"+this.getLinearGradient(this._uid+"_SVGID_1_",a.emptyColor,a.emptyColor,a.starShape)+this.getLinearGradient(this._uid+"_SVGID_2_",a.hoverColor,a.hoverColor,a.starShape)+this.getLinearGradient(this._uid+"_SVGID_3_",a.starGradient.start,a.starGradient.end,a.starShape)+this.getVectorPath(this._uid,{starShape:a.starShape,strokeWidth:a.strokeWidth,strokeColor:a.strokeColor})+"</svg></div>",d="",e=0;e<a.totalStars;e++)d+=c;this.$el.append(d),this.$stars=this.$el.find(".jq-star")},getVectorPath:function(a,b){return"rounded"===b.starShape?this.getRoundedVectorPath(a,b):this.getSpikeVectorPath(a,b)},getSpikeVectorPath:function(a,b){return'<polygon data-side="center" class="svg-empty-'+a+'" points="281.1,129.8 364,55.7 255.5,46.8 214,-59 172.5,46.8 64,55.4 146.8,129.7 121.1,241 212.9,181.1 213.9,181 306.5,241 " style="fill: transparent; stroke: '+b.strokeColor+';" /><polygon data-side="left" class="svg-empty-'+a+'" points="281.1,129.8 364,55.7 255.5,46.8 214,-59 172.5,46.8 64,55.4 146.8,129.7 121.1,241 213.9,181.1 213.9,181 306.5,241 " style="stroke-opacity: 0;" /><polygon data-side="right" class="svg-empty-'+a+'" points="364,55.7 255.5,46.8 214,-59 213.9,181 306.5,241 281.1,129.8 " style="stroke-opacity: 0;" />'},getRoundedVectorPath:function(a,b){var c="M520.9,336.5c-3.8-11.8-14.2-20.5-26.5-22.2l-140.9-20.5l-63-127.7 c-5.5-11.2-16.8-18.2-29.3-18.2c-12.5,0-23.8,7-29.3,18.2l-63,127.7L28,314.2C15.7,316,5.4,324.7,1.6,336.5S1,361.3,9.9,370 l102,99.4l-24,140.3c-2.1,12.3,2.9,24.6,13,32c5.7,4.2,12.4,6.2,19.2,6.2c5.2,0,10.5-1.2,15.2-3.8l126-66.3l126,66.2 c4.8,2.6,10,3.8,15.2,3.8c6.8,0,13.5-2.1,19.2-6.2c10.1-7.3,15.1-19.7,13-32l-24-140.3l102-99.4 C521.6,361.3,524.8,348.3,520.9,336.5z";return'<path data-side="center" class="svg-empty-'+a+'" d="'+c+'" style="stroke: '+b.strokeColor+'; fill: transparent; " /><path data-side="right" class="svg-empty-'+a+'" d="'+c+'" style="stroke-opacity: 0;" /><path data-side="left" class="svg-empty-'+a+'" d="M121,648c-7.3,0-14.1-2.2-19.8-6.4c-10.4-7.6-15.6-20.3-13.4-33l24-139.9l-101.6-99 c-9.1-8.9-12.4-22.4-8.6-34.5c3.9-12.1,14.6-21.1,27.2-23l140.4-20.4L232,164.6c5.7-11.6,17.3-18.8,30.2-16.8c0.6,0,1,0.4,1,1 v430.1c0,0.4-0.2,0.7-0.5,0.9l-126,66.3C132,646.6,126.6,648,121,648z" style="stroke: '+b.strokeColor+'; stroke-opacity: 0;" />'},getSvgDimensions:function(a){return"rounded"===a?'width="550px" height="500.2px" viewBox="0 146.8 550 500.2" style="enable-background:new 0 0 550 500.2;':'x="0px" y="0px" width="305px" height="305px" viewBox="60 -62 309 309" style="enable-background:new 64 -59 305 305;'},getLinearGradient:function(a,b,c,d){var e="rounded"===d?500:250;return'<linearGradient id="'+a+'" gradientUnits="userSpaceOnUse" x1="0" y1="-50" x2="0" y2="'+e+'"><stop offset="0" style="stop-color:'+b+'"/><stop offset="1" style="stop-color:'+c+'"/> </linearGradient>'},executeCallback:function(a,b){var c=this.settings.callback;c(a,b)}},g={unload:function(){var c="plugin_"+b,d=a(this),e=d.data(c).$stars;e.off(),d.removeData(c).remove()},setRating:function(c,d){var e="plugin_"+b,f=a(this),g=f.data(e);c>g.settings.totalStars||0>c||(d&&(c=Math.round(c)),g.applyRating(c))},getRating:function(){var c="plugin_"+b,d=a(this),e=d.data(c);return e._state.rating},resize:function(c){var d="plugin_"+b,e=a(this),f=e.data(d),g=f.$stars;return 1>=c||c>200?void console.log("star size out of bounds"):(g=Array.prototype.slice.call(g),void g.forEach(function(b){a(b).css({width:c+"px",height:c+"px"})}))},setReadOnly:function(c){var d="plugin_"+b,e=a(this),f=e.data(d);c===!0?f.$stars.off("mouseover mouseout click"):(f.settings.readOnly=!1,f.addListeners())}};a.extend(e.prototype,f),a.fn[b]=function(c){if(!a.isPlainObject(c)){if(g.hasOwnProperty(c))return g[c].apply(this,Array.prototype.slice.call(arguments,1));a.error("Method "+c+" does not exist on "+b+".js")}return this.each(function(){a.data(this,"plugin_"+b)||a.data(this,"plugin_"+b,new e(this,c))})}}(jQuery,window,document); 10 11var toggleSize; 12var mobileSliders = []; 13var desktopSliders = []; 14var responsiveSliders = []; 15 16(function(c){function p(){var d,a={height:h.innerHeight,width:h.innerWidth};if(!a.height&&((d=i.compatMode)||!c.support.boxModel))d=d==="CSS1Compat"?k:i.body,a={height:d.clientHeight,width:d.clientWidth};return a}var m={},e,a,i=document,h=window,k=i.documentElement,j=c.expando;c.event.special.inview={add:function(a){m[a.guid+"-"+this[j]]={data:a,$element:c(this)}},remove:function(a){try{delete m[a.guid+"-"+this[j]]}catch(c){}}};c(h).bind("scroll resize",function(){e=a=null});setInterval(function(){var d= 17c(),j,l=0;c.each(m,function(a,b){var c=b.data.selector,e=b.$element;d=d.add(c?e.find(c):e)});if(j=d.length){e=e||p();for(a=a||{top:h.pageYOffset||k.scrollTop||i.body.scrollTop,left:h.pageXOffset||k.scrollLeft||i.body.scrollLeft};l<j;l++)if(c.contains(k,d[l])){var g=c(d[l]),f={height:g.height(),width:g.width()},b=g.offset(),n=g.data("inview"),o;if(!a||!e)break;b.top+f.height>a.top&&b.top<a.top+e.height&&b.left+f.width>a.left&&b.left<a.left+e.width?(o=a.left>b.left?"right":a.left+e.width<b.left+f.width? 18"left":"both",f=a.top>b.top?"bottom":a.top+e.height<b.top+f.height?"top":"both",b=o+"-"+f,(!n||n!==b)&&g.data("inview",b).trigger("inview",[!0,o,f])):n&&g.data("inview",!1).trigger("inview",[!1])}}},250)})(jQuery); 19 20function get_scrollx(){ 21 if (navigator.appName=="Microsoft Internet Explorer") 22 { 23 ScrollX = document.documentElement.scrollLeft + document.body.scrollLeft; 24 } 25 else 26 { 27 ScrollX = window.pageXOffset; 28 } 29 return ScrollX; 30} 31 32function get_scrolly(){ 33 if (navigator.appName=="Microsoft Internet Explorer") 34 { 35 ScrollY = document.documentElement.scrollTop + document.body.scrollTop; 36 } 37 else 38 { 39 ScrollY = window.pageYOffset; 40 } 41 return ScrollY; 42} 43 44function get_size_view(){ 45 var View = { 46 width : ( 47 // W3C Compliant calculation 48 window.innerWidth ? 49 window.innerWidth : 50 // IE 6 + 51 ( document.documentElement && document.documentElement.clientWidth ) ? 52 document.documentElement.clientWidth : 53 // IE 4 54 document.body.clientWidth 55 ), 56 height : ( 57 // W3C Compliant calculation 58 window.innerHeight ? 59 window.innerHeight : 60 // IE 6 + 61 ( document.documentElement && document.documentElement.clientHeight ) ? 62 document.documentElement.clientHeight : 63 // IE 4 64 document.body.clientHeight 65 ) 66 } 67 return View; 68} 69 70View = get_size_view(); 71 72function ajouter_actu(){ 73 $("#main").css("z-index","1"); 74 /*$("#main").css("opacity","0.5");*/ 75 $("#flux").prepend('<div id="flux_ajouter_actu" style="display:none;"> </div>'); 76 $.get('/ajax_ajouter_actu.php',function(data){ $("#flux_ajouter_actu").html(data); }); 77 $("#flux_ajouter_actu").css("z-index","10003"); 78 if($("#site_mobile").css("display")=="block"){ 79 $("#flux_ajouter_actu").css("position","absolute"); 80 $("#flux_ajouter_actu").css("marginLeft","0"); 81 $("#flux_ajouter_actu").css("marginTop","0"); 82 $("#flux_ajouter_actu").css("width","100%"); 83 $("#flux_ajouter_actu").css("height","auto"); 84 $("#flux_ajouter_actu").css("padding","0"); 85 }else{ 86 $("#flux_ajouter_actu").css("position","absolute"); 87 $("#flux_ajouter_actu").css("marginLeft","20%"); 88 $("#flux_ajouter_actu").css("marginTop","40px"); 89 $("#flux_ajouter_actu").css("width","60%"); 90 $("#flux_ajouter_actu").css("padding","4px"); 91 }
92 $("#flux_ajouter_actu").css("border","1px solid #BBBBBB"); 93 $("#flux_ajouter_actu").css("opacity","1"); 94 $("#flux_ajouter_actu").css("background-color","#FFFFFF"); 95 $("#flux_ajouter_actu").show(); 96} 97 98function valider_actu(){ 99 titre = $("#titre_actu").val(); 100 contenu = encodeURIComponent($("#contenu_actu").val()); 101 if((titre=='')||(contenu=='')){ 102 $("#msg_valider_actu").html("Veuillez remplir tous les champs"); 103 return false; 104 } 105 var OAjax; 106 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 107 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 108 OAjax.open('POST',"ajax_actu_valider.php",true); 109 OAjax.onreadystatechange = function() 110 { 111 if (OAjax.readyState == 4 && OAjax.status==200) 112 { 113 if (document.getElementById) 114 { 115 if (OAjax.responseText =='true') { 116 $("#msg_valider_actu").html(""); 117 }else{ 118 if(OAjax.responseText!=''){ 119 $("#div_valider_actu").html("<br>Votre actualité a bien été enregistrée. Si elle valide bien toutes les conditions elle sera publiée très rapidement."); 120 } 121 } 122 } 123 } 124 } 125 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 126 OAjax.send('titre='+titre+'&contenu='+contenu); 127} 128 129function fermer_ajouter_actu(){ 130 $("#flux_ajouter_actu").html(""); 131 $("#flux_ajouter_actu").remove(); 132 $("#main").css("z-index","1"); 133 $("#main").css("opacity","1"); 134} 135 136function edit_msg(id_comm,type) { 137 138 var OAjax; 139 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 140 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 141 OAjax.open('POST',"edit_msg.php",true); 142 OAjax.onreadystatechange = function() 143 { 144 if (OAjax.readyState == 4 && OAjax.status==200) 145 { 146 if (document.getElementById) 147 { 148 if (OAjax.responseText =='true') { 149 document.getElementById('msg_'+id_comm).innerHTML=''; 150 }else{ 151 document.getElementById('msg_'+id_comm).innerHTML=OAjax.responseText; 152 tinyMCE.execCommand('mceRemoveEditor',true, 'edit'+id_comm); 153 tinyMCE.execCommand('mceAddEditor', true, 'edit'+id_comm); 154 tinyMCE.execCommand('mceFocus', true, 'edit'+id_comm ); 155 } 156 } 157 } 158 } 159 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 160 161 var envoi="id_comm="+id_comm+'&type='+type; 162 OAjax.send(envoi); 163 164} 165 166function repondre(id_comm){ 167 if($("#repondre_comm_"+id_comm).html()==null){ 168 $("#comm_ligne_options_"+id_comm).after('<tr id="repondre_comm_'+id_comm+'"><td colspan="5" class="center"><form method="POST" action=""><textarea id="contenu_repondre_'+id_comm+'" rows="6" name="enr_contenu_repondre"></textarea><br/><input type="hidden" name="id_comm_parent" value="'+id_comm+'"/><input type="submit" value="Publier ma réponse" class="bouton_degrade_v4"/></form></td></tr>'); 169 tinyMCE.init({ 170 selector:'#contenu_repondre_'+id_comm, 171 plugins: "charmap, paste, lists, image, link, code, spoiler", 172 menubar: false, 173 paste_as_text: true, 174 gecko_spellcheck : true, 175 height : 100, 176 body_class: 'my_class', 177 content_css: '/includes/css/tiny.css', 178 relative_urls : false, 179 remove_script_host : true, 180 document_base_url : "http://www.spin-off.fr/", 181 toolbar1: "undo redo | bold italic underline | link image | preview removeformat | bullist numlist outdent indent | spoiler", 182 }); 183 } 184} 185 186function valider_edit(id_comm,type) { 187 var OAjax; 188 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 189 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 190 OAjax.open('POST',"valider_edit.php",true); 191 OAjax.onreadystatechange = function() 192 { 193 if (OAjax.readyState == 4 && OAjax.status==200) 194 { 195 if (document.getElementById) 196 { 197 if (OAjax.responseText =='true') { 198 document.getElementById('msg_'+id_comm).innerHTML=''; 199 }else{ 200 document.getElementById('msg_'+id_comm).innerHTML=OAjax.responseText; 201 202 } 203 } 204 } 205 } 206 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 207 208 texte_comm = encodeURIComponent( tinyMCE.get('edit'+id_comm).getContent() ); 209 210 var envoi="id_comm="+id_comm+"&texte_comm="+texte_comm+'&type='+type; 211 OAjax.send(envoi); 212} 213 214function annuler_edit(id_comm,type) { 215 var OAjax; 216 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 217 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 218 OAjax.open('POST',"annuler_edit.php",true); 219 OAjax.onreadystatechange = function() 220 { 221 if (OAjax.readyState == 4 && OAjax.status==200) 222 { 223 if (document.getElementById) 224 { 225 if (OAjax.responseText =='true') { 226 document.getElementById('msg_'+id_comm).innerHTML='';
227 }else{ 228 document.getElementById('msg_'+id_comm).innerHTML=OAjax.responseText; 229 230 /*tinyMCE.execCommand('mceAddControl', true, 'edit'+id_comm); 231 tinyMCE.execCommand('mceFocus', true, 'edit'+id_comm );*/ 232 233 } 234 } 235 } 236 } 237 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 238 239 var envoi="id_comm="+id_comm+'&type='+type; 240 OAjax.send(envoi); 241} 242 243function changer_pages_comm(page,idc,type,lastcomm) { 244 var OAjax; 245 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 246 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 247 OAjax.open('POST',"pages_comm.php",true); 248 OAjax.onreadystatechange = function() 249 { 250 if (OAjax.readyState == 4 && OAjax.status==200) 251 { 252 if (document.getElementById) 253 { 254 if (OAjax.responseText =='true') { 255 return false; 256 }else{ 257 258 document.getElementById('div_ajax_comm').innerHTML=OAjax.responseText; 259 var div_ajax_comm = document.getElementById('div_ajax_comm'); 260 div_ajax_comm.innerHTML = OAjax.responseText; 261 262 var allscript = div_ajax_comm.getElementsByTagName('script'); 263 for(var i=0;i<allscript.length;i++){ 264 eval(allscript[i].text); 265 } 266 267 if(lastcomm==null||lastcomm==''||lastcomm.indexOf("#")==-1){ 268 269 decalage = $("#div_ajax_comm").offset().top; 270 $("html:not(:animated), body:not(:animated)").animate({scrollTop:decalage}, 1000); 271 272 }else if(lastcomm.indexOf("#")!=-1){ 273 274 pos = lastcomm.indexOf("#"); 275 go = lastcomm.substring(pos+1); 276 277 decalage = $("#tr_"+go).offset().top; 278 $("html:not(:animated), body:not(:animated)").animate({scrollTop:'10px'}, 1000); 279 280 } 281 } 282 } 283 } 284 } 285 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 286 OAjax.send('id='+idc+'&page='+page+'&type='+type); 287} 288 289function afficher_plus_custom(ref){ 290 if($("."+ref).css("display")!="none"){ 291 //$("."+ref).css("display","none"); 292 $("."+ref).fadeOut("normal"); 293 $("#"+ref).html("Afficher plus"); 294 }else{ 295 //$("."+ref).css("display",""); 296 $("."+ref).fadeIn("normal"); 297 $("#"+ref).html("Afficher moins"); 298 } 299} 300 301function afficher_plus_look(){ 302 if($(".plus_look").css("display")!="none"){ 303 $(".plus_look").css("display","none"); 304 $("#a_plus_look").text("Plus de choix"); 305 }else{ 306 $(".plus_look").css("display",""); 307 $("#a_plus_look").text("Afficher moins"); 308 } 309} 310 311function afficher_graph(id_type,page){ 312 document.getElementById('div_graph').innerHTML = '<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><center><img src="/images/ajax-loader.gif"></center>'; 313 var OAjax; 314 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 315 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 316 OAjax.open('POST',"ajax_graph.php",true); 317 OAjax.onreadystatechange = function() 318 { 319 if (OAjax.readyState == 4 && OAjax.status==200) 320 { 321 if (document.getElementById) 322 { 323 if (OAjax.responseText =='true') { 324 document.getElementById('div_graph').innerHTML=''; 325 }else{ 326 var div_graph = document.getElementById('div_graph'); 327 div_graph.innerHTML = OAjax.responseText; 328 329 var allscript = div_graph.getElementsByTagName('script'); 330 for(var i=0;i<allscript.length;i++){ 331 eval(allscript[i].text); 332 } 333 } 334 } 335 } 336 } 337 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 338 339 if($("#checkbox_notes").is(":checked")==true){ 340 notes = 1; 341 }else{ 342 notes = 0; 343 } 344 if($("#checkbox_notes_indic").is(":checked")==true){ 345 notes_indic = 1; 346 }else{ 347 notes_indic = 0; 348 } 349 if($("#checkbox_mesnotes").is(":checked")==true){ 350 mesnotes = 1; 351 }else{ 352 mesnotes = 0; 353 } 354 if($("#checkbox_mesnotes_indic").is(":checked")==true){ 355 mesnotes_indic = 1; 356 }else{ 357 mesnotes_indic = 0; 358 } 359 if($("#checkbox_audiences").is(":checked")==true){ 360 audiences = 1; 361 }else{ 362 audiences = 0; 363 } 364 if($("#checkbox_audiences_indic").is(":checked")==true){ 365 audiences_indic = 1; 366 }else{ 367 audiences_indic = 0; 368 } 369 370 var envoi='id_type='+id_type+'¬es='+notes+'¬es_indic='+notes_indic+'&mesnotes='+mesnotes+'&mesnotes_indic='+mesnotes_indic+'&audiences='+audiences+'&audiences_indic='+audiences_indic+'&page='+page; 371 OAjax.send(envoi); 372} 373 374function afficher_graph_comp(id_type,page){ 375 document.getElementById('div_graph').innerHTML = '<img src="images/ajax-loader.gif">'; 376 var OAjax; 377 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 378 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 379 OAjax.open('POST',"ajax_graph_comp.php",true); 380 OAjax.onreadystatechange = function() 381 { 382 if (OAjax.readyState == 4 && OAjax.status==200) 383 { 384 if (document.getElementById) 385 { 386 if (OAjax.responseText =='true') { 387 document.getElementById('div_graph').innerHTML='';
388 }else{ 389 var div_graph = document.getElementById('div_graph'); 390 div_graph.innerHTML = OAjax.responseText; 391 392 var allscript = div_graph.getElementsByTagName('script'); 393 for(var i=0;i<allscript.length;i++){ 394 eval(allscript[i].text); 395 } 396 } 397 } 398 } 399 } 400 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 401 if(document.getElementById('id_serie')){ 402 var comp_serie = document.getElementById('id_serie').value; 403 var comp_ami = document.getElementById('id_ami').value; 404 if(document.getElementById('id_serie').value!=''){ 405 var comp_saison = document.getElementById('id_saison').value; 406 } 407 }else{ 408 var comp_serie = ''; 409 var comp_ami = ''; 410 var comp_saison = ''; 411 } 412 413 var envoi='comp_serie='+comp_serie+'&comp_ami='+comp_ami+'&comp_saison='+comp_saison; 414 OAjax.send(envoi); 415} 416 417function vote_episode_flux(id_user,id_episode,note_episode) { 418 var rech_serie; 419 if($("#rech_serie_anoter").val()!=""){ 420 rech_serie = $("#rech_serie_anoter").val(); 421 }else{ 422 rech_serie = ""; 423 } 424 425 var OAjax; 426 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 427 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 428 OAjax.open('POST',"vote_serie.php",true); 429 OAjax.onreadystatechange = function() 430 { 431 if (OAjax.readyState == 4 && OAjax.status==200) 432 { 433 if (document.getElementById) 434 { 435 if (OAjax.responseText =='true') { 436 document.getElementById('msg').innerHTML=''; 437 }else{ 438 affiche_flux("anoter",1); 439 } 440 } 441 } 442 } 443 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 444 445 var envoi="id_episode="+id_episode+"&id_user="+id_user+"¬e_episode="+note_episode; 446 OAjax.send(envoi); 447} 448 449function affiche_flux(onglet,page) { 450 451 var tri = 'all'; 452 if(document.getElementById('tri_flux_profil')){ 453 tri = $("#tri_flux_profil").val(); 454 } 455 $("#flux").html('<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><center><img src="/images/ajax-loader.gif"/></center>'); 456 457 /*document.getElementById('flux').style.display = 'block';*/ 458 if($("#flux").css("display")=="none"){ 459 $("#flux").show(); 460 }/*else{ 461 $("#flux").css("visibility","visible"); 462 }*/ 463 464 if($("#site_mobile").css("display")!="block") $("#flux").css("margin-left",($("#main").width()-$("#flux").outerWidth()) / 2); 465 466 if($("#site_mobile").css("display")=="none"){ 467 view = get_size_view(); 468 $("#flux").css("max-height",(view.height-80)); 469 } 470 471 $.get('/ajax_flux.php', {onglet:onglet,page:page,tri:tri}, function(data){ $("#flux").html(data); 472 473 if(onglet=="avenir"){ 474 //cal_flux('',''); 475 } 476 if(onglet=="messeries"){ 477 load_mes_series(1,''); 478 } 479 if(onglet=="suggestions"){ 480 create_slider('#mes_recommandations_flux'); 481 } 482 if(onglet=="mesamis"){ 483 load_mes_acteurs(1); 484 load_mes_spectateurs(1); 485 } 486 /*var allscript = document.getElementById('flux').getElementsByTagName('script'); 487 for(var i=0;i<allscript.length;i++){ 488 eval(allscript[i].text); 489 }*/ 490 491 }); 492} 493 494function supprimer_serie_ms(id_serie,page) { 495 if(confirm("Etes-vous s\373r de vouloir supprimer cette s\351rie de votre liste ?")){ 496 var OAjax; 497 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 498 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 499 OAjax.open('POST',"ajax_supprimer_serie_ms.php",true); 500 OAjax.onreadystatechange = function() 501 { 502 if (OAjax.readyState == 4 && OAjax.status==200) 503 { 504 if (document.getElementById) 505 { 506 if (OAjax.responseText =='true') { 507 return false; 508 }else{ 509 $("#ms_"+id_serie).remove(); 510 } 511 } 512 } 513 } 514 load_mes_series(1,''); 515 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 516 OAjax.send('id_serie='+id_serie); 517 } 518} 519 520function changer_statut_etat_ms(id_serie) { 521 var OAjax; 522 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 523 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 524 OAjax.open('POST',"ajax_change_statut_etat_ms.php",true); 525 OAjax.onreadystatechange = function() 526 { 527 if (OAjax.readyState == 4 && OAjax.status==200) 528 { 529 if (document.getElementById) 530 { 531 if (OAjax.responseText =='true') { 532 return false;
533 }else{ 534 return true; 535 } 536 } 537 } 538 } 539 statut = encodeURIComponent($("#input_statut_etat_"+id_serie).val()); 540 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 541 OAjax.send('id_serie='+id_serie+'&statut='+statut); 542} 543 544function changer_etat_ms(id_serie,etat) { 545 debute = 3; 546 termine = 3; 547 548 if(etat==0){ 549 $("#img_etat_ms_"+id_serie).css("color","#138be0"); 550 $("#ms_enattente_"+id_serie).html('<input id="input_statut_etat_'+id_serie+'" type="text" size="20" style="border:1px solid #DDDDDD;color:#999999;" value="" onchange="changer_statut_etat_ms('+id_serie+');">'); 551 }else if(etat==1){ 552 if(document.getElementById('box_encours_choix')){ 553 if($("#box_encours_choix").is(":checked")==true){ 554 debute = 1; 555 }else{ 556 debute = 0; 557 } 558 $("#img_etat_ms_"+id_serie).css("color","green"); 559 $("#ms_enattente_"+id_serie).html(""); 560 $("#div_choix_encours").html(""); 561 $("#mes_series_table_choix_encours").html(""); 562 $("#div_choix_encours").css("border","0"); 563 }else{ 564 aff_fenetre_encours(id_serie); 565 return; 566 } 567 }else if(etat==2){ 568 $("#img_etat_ms_"+id_serie).css("color","red"); 569 $("#ms_enattente_"+id_serie).html(""); 570 /*if(document.getElementById('box_termine_choix')){ 571 if($("#box_termine_choix").attr("checked")==true){ 572 termine = 1; 573 }else{ 574 termine = 0; 575 } 576 $("#img_etat_ms_"+id_serie).attr("src","/images/pictos/serie-terminee.png"); 577 $("#ms_enattente_"+id_serie).html(""); 578 $("#div_choix_termine").html(""); 579 $("#div_choix_termine").css("border","0"); 580 }else{ 581 aff_fenetre_termine(id_serie); 582 return; 583 }*/ 584 }else if(etat==3){ 585 $("#img_etat_ms_"+id_serie).css("color","#DDD"); 586 $("#ms_enattente_"+id_serie).html(""); 587 }else if(etat==4){ 588 $("#img_etat_ms_"+id_serie).css("color","#000"); 589 $("#ms_enattente_"+id_serie).html(""); 590 } 591 592 var OAjax; 593 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 594 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 595 OAjax.open('POST',"ajax_change_etat_ms.php",true); 596 OAjax.onreadystatechange = function() 597 { 598 if (OAjax.readyState == 4 && OAjax.status==200) 599 { 600 if (document.getElementById) 601 { 602 if (OAjax.responseText =='true') { 603 return false; 604 }else{ 605 return; 606 } 607 } 608 } 609 } 610 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 611 OAjax.send('id_serie='+id_serie+'&etat='+etat+'&debute='+debute+'&termine='+termine); 612} 613 614function aff_fenetre_encours(id_serie){ 615 616 var OAjax; 617 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 618 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 619 OAjax.open('POST',"ajax_afficher_choix_encours.php",true); 620 OAjax.onreadystatechange = function() 621 { 622 if (OAjax.readyState == 4 && OAjax.status==200) 623 { 624 if (document.getElementById) 625 { 626 if (OAjax.responseText =='true') { 627 return false; 628 }else{ 629 $("#div_choix_encours").html(OAjax.responseText); 630 631 if($("#site_mobile").css("display")=="block"){ 632 decalage_gauche = "0"; 633 }else{ 634 taille_flux = 0; 635 if($("#flux").css("width")!=null){ 636 taille_flux = $("#flux").outerWidth(); 637 decalage_gauche = (taille_flux - 340) / 2 + get_scrollx(); 638 }else{ 639 decalage_gauche = (View.width - 340) / 2 + get_scrollx(); 640 } 641 642 } 643 644 if($("#site_mobile").css("display")=="none"){ 645 $("#div_choix_encours").css("left",decalage_gauche + 'px'); 646 } 647 let posTr = $('#ms_'+id_serie).offset().top; 648 let sizeHeader = $('#header_container').height() + $('#header_flux').height(); 649 650 $("#div_choix_encours").css("top", (posTr-sizeHeader) + 'px'); 651 652 //$("#div_choix_encours").css("top",View.height / 2 - 100 + get_scrolly() + 'px'); 653 //$("#div_choix_encours").css("left",'240px'); 654 //$("#div_choix_encours").css("top",'355px'); 655 $("#div_choix_encours").css("z-index",'1000'); 656 if($("#site_mobile").css("display")=="block"){ 657 $("#ms_"+id_serie).after('<tr class="mes_series_table_tr" id="mes_series_table_choix_encours"><td class="mes_series_table_td" colspan="8"></td></tr>'); 658 $("#ms_"+id_serie).next('tr').find('td').append($('#div_choix_encours')); 659 $("#div_choix_encours").css("position","inherit"); 660 }else{ 661 $("#div_choix_encours").css("padding",'20px'); 662 $("#div_choix_encours").css("background-color","#FFFFFF"); 663 $("#div_choix_encours").css("border","1p
663x solid #CCCCCC"); 664 } 665 $("#div_choix_encours").show(); 666 667 } 668 } 669 } 670 } 671 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 672 OAjax.send('id_serie='+id_serie); 673} 674 675function aff_fenetre_termine(id_serie){ 676 677 var OAjax; 678 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 679 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 680 OAjax.open('POST',"ajax_afficher_choix_termine.php",true); 681 OAjax.onreadystatechange = function() 682 { 683 if (OAjax.readyState == 4 && OAjax.status==200) 684 { 685 if (document.getElementById) 686 { 687 if (OAjax.responseText =='true') { 688 return false; 689 }else{ 690 $("#div_choix_termine").html(OAjax.responseText); 691 $("#div_choix_termine").css("background-color","#FFFFFF"); 692 $("#div_choix_termine").css("border","1px solid #CCCCCC"); 693 $("#div_choix_termine").css("left",View.width / 2 - 250 + get_scrollx() + 'px'); 694 $("#div_choix_termine").css("top",View.height / 2 - 100 + get_scrolly() + 'px'); 695 $("#div_choix_termine").show(); 696 } 697 } 698 } 699 } 700 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 701 OAjax.send('id_serie='+id_serie); 702} 703 704function addflux(valeur,actionid,type,fluxref){ 705 if(valeur!=""){ 706 var OAjax; 707 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 708 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 709 OAjax.open('POST',"ajax_add_flux.php",true); 710 OAjax.onreadystatechange = function() 711 { 712 if (OAjax.readyState == 4 && OAjax.status==200) 713 { 714 if (document.getElementById) 715 { 716 if (OAjax.responseText =='true') { 717 return false; 718 }else{ 719 if(type=="status"){ 720 affiche_flux('profil',1); 721 }else{ 722 $("#fluxtexte_"+actionid+"_"+type+"_"+fluxref).val(""); 723 $("#table_flux_"+actionid+"_"+type+"_"+fluxref).append(OAjax.responseText); 724 } 725 } 726 } 727 } 728 } 729 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 730 OAjax.send('type='+type+'&profil='+actionid+'&link='+fluxref+'&fluxtexte='+encodeURIComponent(valeur)); 731 } 732} 733 734function delflux(flux,userid,type){ 735 if(confirm('Etes-vous s\373r de vouloir supprimer ce commentaire ?')){ 736 var OAjax; 737 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 738 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 739 OAjax.open('POST',"/ajax_del_flux.php",true); 740 OAjax.onreadystatechange = function() 741 { 742 if (OAjax.readyState == 4 && OAjax.status==200) 743 { 744 if (document.getElementById) 745 { 746 if (OAjax.responseText =='true') { 747 return false; 748 }else{ 749 affiche_flux('profil',1); 750 } 751 } 752 } 753 } 754 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 755 OAjax.send('id_flux='+flux); 756 } 757} 758 759function rechercher_user_onglet(user,type){ 760 if(type==null) var type=''; 761 var OAjax; 762 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 763 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 764 OAjax.open('POST',"/ajax_rechercher_user.php",true); 765 OAjax.onreadystatechange = function() 766 { 767 if (OAjax.readyState == 4 && OAjax.status==200) 768 { 769 if (document.getElementById) 770 { 771 if (OAjax.responseText =='true') { 772 return false; 773 }else{ 774 $("#div_onglet_rech_user").html(OAjax.responseText); 775 } 776 } 777 } 778 } 779 user = encodeURIComponent(user); 780 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 781 OAjax.send('user='+user+'&type='+type); 782} 783 784function load_mes_spectateurs(page){ 785 var OAjax; 786 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 787 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 788 OAjax.open('POST',"/ajax_messpectateurs_onglet.php",true); 789 OAjax.onreadystatechange = function() 790 { 791 if (OAjax.readyState == 4 && OAjax.status==200) 792 { 793 if (document.getElementById) 794 { 795 if (OAjax.responseText =='true') { 796 return false; 797 }else{ 798 $("#div_mes_spectateurs_onglet").html(OAjax.responseText); 799 } 800 } 801 } 802 } 803 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 804 OAjax.send('page='+page); 805} 806 807function load_mes_acteurs(page){ 808 var OAjax; 809 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 810 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 811 OAjax.open('POST',"ajax_mesacteurs_onglet.php",true); 812 OAjax.onreadystatechange = function() 813 { 814 if (OAjax.readyState == 4 && OAjax.status==200) 815 { 816 if (document.getElementById) 817 { 818 if (OAjax.responseText =='true') { 819 return false;
820 }else{ 821 $("#div_mes_acteurs_onglet").html(OAjax.responseText); 822 } 823 } 824 } 825 } 826 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 827 OAjax.send('page='+page); 828} 829 830function supprimer_acteurs_ma(suiveur,page) { 831 if(confirm("Etes-vous s\373r de vouloir supprimer cet acteur de votre liste ?")){ 832 var OAjax; 833 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 834 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 835 OAjax.open('POST',"ajax_supprimer_acteur_ma.php",true); 836 OAjax.onreadystatechange = function() 837 { 838 if (OAjax.readyState == 4 && OAjax.status==200) 839 { 840 if (document.getElementById) 841 { 842 if (OAjax.responseText =='true') { 843 return false; 844 }else{ 845 load_mes_acteurs(1); 846 } 847 } 848 } 849 } 850 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 851 OAjax.send('suiveur='+suiveur); 852 } 853} 854 855function bloquer_spectateur_ms(suiveur,page,type) { 856 var OAjax; 857 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 858 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 859 OAjax.open('POST',"ajax_bloquer_spectateur_ms.php",true); 860 OAjax.onreadystatechange = function() 861 { 862 if (OAjax.readyState == 4 && OAjax.status==200) 863 { 864 if (document.getElementById) 865 { 866 if (OAjax.responseText =='true') { 867 return false; 868 }else{ 869 load_mes_spectateurs(page); 870 } 871 } 872 } 873 } 874 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 875 OAjax.send('suiveur='+suiveur+'&type='+type); 876} 877 878function rechercher_serie_anoter(serie){ 879 var OAjax; 880 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 881 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 882 OAjax.open('POST',"ajax_rechercher_serie_anoter.php",true); 883 OAjax.onreadystatechange = function() 884 { 885 if (OAjax.readyState == 4 && OAjax.status==200) 886 { 887 if (document.getElementById) 888 { 889 if (OAjax.responseText =='true') { 890 return false; 891 }else{ 892 $("#div_onglet_rech_anoter").html(OAjax.responseText); 893 } 894 } 895 } 896 } 897 serie = encodeURIComponent(serie); 898 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 899 OAjax.send('serie='+serie); 900} 901 902function rechercher_serie_onglet(serie){ 903 var OAjax; 904 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 905 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 906 OAjax.open('POST',"ajax_rechercher_serie.php",true); 907 OAjax.onreadystatechange = function() 908 { 909 if (OAjax.readyState == 4 && OAjax.status==200) 910 { 911 if (document.getElementById) 912 { 913 if (OAjax.responseText =='true') { 914 return false; 915 }else{ 916 $("#div_onglet_rech_serie").html(OAjax.responseText); 917 } 918 } 919 } 920 } 921 serie = encodeURIComponent(serie); 922 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 923 OAjax.send('serie='+serie); 924} 925 926function voir_details_serie(id_serie){ 927 var OAjax; 928 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 929 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 930 OAjax.open('POST',"ajax_details_serie.php",true); 931 OAjax.onreadystatechange = function() 932 { 933 if (OAjax.readyState == 4 && OAjax.status==200) 934 { 935 if (document.getElementById) 936 { 937 if (OAjax.responseText =='true') { 938 return false; 939 }else{ 940 $("#div_details_serie").html(OAjax.responseText); 941 } 942 } 943 } 944 } 945 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 946 OAjax.send('id_serie='+id_serie); 947} 948 949function load_mes_series(page,tri){ 950 var search = $('#onglet_messeries_rech_messeries').val() ?? ''; 951 var OAjax; 952 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 953 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 954 OAjax.open('POST',"ajax_messeries_onglet.php",true); 955 OAjax.onreadystatechange = function() 956 { 957 if (OAjax.readyState == 4 && OAjax.status==200) 958 { 959 if (document.getElementById) 960 { 961 if (OAjax.responseText =='true') { 962 return false;
963 }else{ 964 $("#div_mes_series_onglet").html(OAjax.responseText); 965 } 966 } 967 } 968 } 969 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 970 OAjax.send('page='+page+'&tri='+tri+'&search='+search); 971} 972 973function formulaire_ajout_ms(serie){ 974 975 $.get('/ajax_formulaire_ajout_ms.php',{serie:serie},function(data){ 976 if($("#zone_ajout_serie").html()==null){ 977 $("#main").append('<div id="zone_ajout_serie"></div>'); 978 } 979 $("#zone_ajout_serie").html(data); 980 //$("#zone_ajout_serie").css("left",View.width / 2 - 250 + get_scrollx() + 'px'); 981 $("#zone_ajout_serie").css("top",View.height / 2 + 'px'); 982 $("#zone_ajout_serie").show(); 983 }); 984 985} 986 987function ajout_mes_series(serie,etat,direct) { 988 if(direct==0){ 989 statut = encodeURIComponent($("#input_statut_etat_new").val()); 990 if($("#box_add_ms").is(":checked")==true){ 991 npp = 1; 992 }else{ 993 npp = 0; 994 } 995 if($("#box_debute_ms").is(":checked")==true){ 996 debute = 1; 997 }else{ 998 debute = 0; 999 } 1000 if($("#box_termine_ms").is(":checked")==true){ 1001 termine = 1; 1002 }else{ 1003 termine = 0; 1004 } 1005 }else{ 1006 statut = ''; 1007 termine = ''; 1008 npp = 0; 1009 debute = 0; 1010 } 1011 //OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 1012 //OAjax.send('serie='+serie+'&etat='+etat+'&statut='+statut+'&npp='+npp+'&debute='+debute+'&termine='+termine); 1013 $.get("/ajax_ajout_mes_series.php",{serie:serie,etat:etat,statut:statut,npp:npp,debute:debute,termine:termine},function(data){ if(direct==0){ load_mes_series(1,''); } }); 1014 if(direct==0){ 1015 $("#zone_ajout_serie").html(""); 1016 $("#zone_ajout_serie").css("border","0"); 1017 } 1018 affiche_flux('messeries',1); 1019} 1020 1021function ajout_recomm(serie,etat) { 1022 1023 var OAjax; 1024 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1025 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1026 OAjax.open('POST',"ajax_ajout_recomm.php",true); 1027 OAjax.onreadystatechange = function() 1028 { 1029 if (OAjax.readyState == 4 && OAjax.status==200) 1030 { 1031 if (document.getElementById) 1032 { 1033 if (OAjax.responseText =='true') { 1034 return false; 1035 }else{ 1036 if(document.getElementById('zone_ajout_recomm')){ 1037 document.getElementById('zone_ajout_recomm').innerHTML=OAjax.responseText; 1038 }else{ 1039 if(etat==0){ 1040 $("#img_recomm_"+serie).attr("src","/images/pictos/Recommander-g.png"); 1041 $("#hidden_recomm_"+serie).val("1"); 1042 }else{ 1043 $("#img_recomm_"+serie).attr("src","/images/pictos/Recommander.png"); 1044 $("#hidden_recomm_"+serie).val("0"); 1045 } 1046 } 1047 } 1048 } 1049 } 1050 } 1051 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 1052 OAjax.send('serie='+serie+'&etat='+etat); 1053} 1054 1055function aff_statut_etat(etat){ 1056 if(etat==0){ 1057 $("#span_statut_add_ms").show(); 1058 $("#span_termine").hide(); 1059 $("#span_debute").hide(); 1060 }else if(etat==1){ 1061 $("#span_statut_add_ms").hide(); 1062 $("#span_termine").hide(); 1063 $("#span_debute").show(); 1064 /*}else if(etat==2){ 1065 $("#span_statut_add_ms").hide(); 1066 $("#span_termine").show(); 1067 $("#span_debute").hide();*/ 1068 }else{ 1069 $("#span_statut_add_ms").hide(); 1070 $("#span_termine").hide(); 1071 $("#span_debute").hide(); 1072 } 1073} 1074 1075function afficher_plus_ajax(ref){ 1076 $.get('/contributions.php',{ref:ref,limite:$("."+ref).length},function(data){ $("#"+ref+"_bottom").show(); $("."+ref).show(); $("."+ref).last().after(data); }); 1077} 1078function cacher_lignes(ref){ 1079 $("."+ref+":gt(5)").hide(); 1080 $("#"+ref+"_bottom").hide(); 1081} 1082 1083function aff_comm(row,nb){ 1084 1085 if($(".tr_flux_cache_"+row).css("display")=="none"){ 1086 $("#a_plus_flux_"+row).html("Afficher moins de commentaires"); 1087 $(".tr_flux_cache_"+row).show(); 1088 }else{ 1089 if(nb>1){ 1090 $("#a_plus_flux_"+row).html("Afficher les "+nb+" autres commentaires"); 1091 }else{ 1092 $("#a_plus_flux_"+row).html("Afficher l'autre commentaire"); 1093 } 1094 $(".tr_flux_cache_"+row).hide(); 1095 } 1096} 1097 1098function row_effect(show,row){ 1099 /*if($("#site_mobile").css("display")=="none"){ 1100 if(show==1){ 1101 $("#row_eff_"+row).css("background-color","#EEEEEE"); 1102 $("#a_comm_"+row).css("color","#555555"); 1103 $("#autres_a_comm_"+row).css("color","#555555"); 1104 }else{ 1105 $("#row_eff_"+row).css("background-color","#FFFFFF"); 1106 $("#a_comm_"+row).css("color","#FFFFFF"); 1107 $("#autres_a_comm_"+row).css("color","#FFFFFF"); 1108 } 1109 }*/ 1110} 1111 1112function affiche_comm_flux(row){ 1113 if($("#a_comm_"+row).text() == "Masquer les commentaires"){ 1114 $("#tr_comm_"+row).hide(); 1115 $("#a_comm_"+row).text("Afficher les commentaires"); 1116 }else if($("#a_comm_"+row).text() == "Afficher les commentaires"){ 1117 $("#tr_comm_"+row).show(); 1118 $("#a_comm_"+row).text("Masquer les commentaires"); 1119 }else{ 1120 $("#"+row).show(); 1121 } 1122} 1123 1124function show_menu(){ 1125 $("#flux").toggle(); 1126 if($("#site_mobile").css("display")!="block") $("#flux").css("margin-left",($("#main").width()-$("#flux").outerWidth()) / 2); 1127 if(($("#flux").css("display")!="none")){ 1128 if($("#site_mobile").css("display")!="none"){ 1129 affiche_flux('avenir',1); 1130 }else{ 1131 affiche_flux('profil',1); 1132 } 1133 } 1134} 1135 1136function add_acteur(acteur,page) { 1137 var OAjax; 1138 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1139 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1140 OAjax.open('POST',"ajax_acteur_ajouter.php",true); 1141 OAjax.onreadystatechange = function() 1142 { 1143 if (OAjax.readyState == 4 && OAjax.status==200) 1144 { 1145 if (document.getElementById) 1146 { 1147 if (OAjax.responseText =='true') { 1148 return false;
1149 }else{ 1150 //document.getElementById('span_ajout_ami').innerHTML=OAjax.responseText; 1151 if(page=="profil"){ 1152 $("#acteur_suivre_profil").html("Acteur ajouté !"); 1153 }else if(page=="profil_liste"){ 1154 $(".lien_acteur_"+acteur).remove(); 1155 }else if(page.indexOf('comm_')!=-1){ 1156 id_comm = page.split("_"); 1157 id_comm = id_comm[1]; 1158 $("#add_acteur_comm_"+id_comm).html("Vous suivez désormais ce membre !"); 1159 }else{ 1160 affiche_flux("mesamis",1); 1161 } 1162 } 1163 } 1164 } 1165 } 1166 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=iso-8859-1'); 1167 OAjax.send('acteur='+acteur); 1168} 1169 1170function jaime(type,idjaime) { 1171 var OAjax; 1172 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1173 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1174 OAjax.open('POST',"ajax_jaime.php",true); 1175 OAjax.onreadystatechange = function() 1176 { 1177 if (OAjax.readyState == 4 && OAjax.status==200) 1178 { 1179 if (document.getElementById) 1180 { 1181 if (OAjax.responseText =='true') { 1182 document.getElementById('jaime_'+type+'_'+idjaime).innerHTML=''; 1183 }else{ 1184 document.getElementById('jaime_'+type+'_'+idjaime).innerHTML='<img title="Vote comptabilis\351" src="images/tick.png" src="images/tick.png" width="12"/>'; 1185 } 1186 } 1187 } 1188 } 1189 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1190 var envoi="idjaime="+idjaime+'&type='+type; 1191 OAjax.send(envoi); 1192} 1193 1194function citer_msg(posteur,msgid,url){ 1195 ed = window.tinyMCE.get("contenu"); // cible le champ \340 traiter 1196 ed.setContent('<br/><blockquote><table style="border:1px solid #EEEEEE;"><tr style="background-color:#EEEEEE;"><td class="left">'+unescape(posteur)+' a écrit :</td></tr><tr><td class="left">'+document.getElementById('msg_'+msgid).innerHTML+'</td></tr></table></blockquote><br/>' + ed.getContent()); 1197 document.location.href= url+'#ajout_msg'; 1198} 1199 1200function afficher_saison_select(id_serie){ 1201 var OAjax; 1202 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1203 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1204 OAjax.open('POST',"saison_compte_affiche.php",true); 1205 OAjax.onreadystatechange = function() 1206 { 1207 if (OAjax.readyState == 4 && OAjax.status==200) 1208 { 1209 if (document.getElementById) 1210 { 1211 if (OAjax.responseText =='true') { 1212 document.getElementById('saison_affiche').innerHTML=''; 1213 }else{ 1214 document.getElementById('saison_affiche').innerHTML=OAjax.responseText; 1215 } 1216 } 1217 } 1218 } 1219 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1220 OAjax.send('id_serie='+id_serie); 1221} 1222 1223function affiche_ep_saison(saison,episode){ 1224 //$("#chaine_autres_saison a").removeClass("autres_saison_hover"); 1225 //$("#chaine_autres_saison a").addClass("autres_saison"); 1226 $(".episodes_autres_saisons_check").removeClass("fond_degrade_v4"); 1227 //$("#bouton_saison_"+saison).removeClass("autres_saison"); 1228 $("#bouton_saison_"+saison).addClass("fond_degrade_v4"); 1229 1230 $("#all_ep_sa").html('<td align="center"><img src="/images/ajax-loader.gif"/></td>'); 1231 var OAjax; 1232 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1233 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1234 OAjax.open('POST',"ajax_load_ep_saison.php",true); 1235 OAjax.onreadystatechange = function() 1236 { 1237 if (OAjax.readyState == 4 && OAjax.status==200) 1238 { 1239 if (document.getElementById) 1240 { 1241 if (OAjax.responseText =='true') { 1242 document.getElementById('all_ep_sa').innerHTML=''; 1243 }else{ 1244 document.getElementById('all_ep_sa').innerHTML=OAjax.responseText; 1245 } 1246 } 1247 } 1248 } 1249 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1250 var envoi="saison="+saison+'&episode='+episode; 1251 OAjax.send(envoi); 1252} 1253
1254function affiche_ep_saison_acteurs(saison){ 1255 $("#chaine_autres_saison a").removeClass("fond_degrade_v4"); 1256 $("#bouton_saison_"+saison).addClass("fond_degrade_v4"); 1257 1258 $("#all_ep_sa").html('<td align="center"><img src="/images/ajax-loader.gif"/></td>'); 1259 var OAjax; 1260 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1261 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1262 OAjax.open('POST',"ajax_load_ep_saison_acteurs.php",true); 1263 OAjax.onreadystatechange = function() 1264 { 1265 if (OAjax.readyState == 4 && OAjax.status==200) 1266 { 1267 if (document.getElementById) 1268 { 1269 if (OAjax.responseText =='true') { 1270 document.getElementById('all_ep_sa').innerHTML=''; 1271 }else{ 1272 document.getElementById('all_ep_sa').innerHTML=OAjax.responseText; 1273 } 1274 } 1275 } 1276 } 1277 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1278 var envoi="saison="+saison; 1279 OAjax.send(envoi); 1280} 1281 1282function del_avatar(iduser,idcomm){ 1283 var OAjax; 1284 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1285 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1286 OAjax.open('POST',"ajax_del_avatar.php",true); 1287 OAjax.onreadystatechange = function() 1288 { 1289 if (OAjax.readyState == 4 && OAjax.status==200) 1290 { 1291 if (document.getElementById) 1292 { 1293 if (OAjax.responseText =='true') { 1294 /*document.getElementById('all_ep_sa').innerHTML='';*/ 1295 }else{ 1296 document.getElementById('avatar_'+idcomm).innerHTML=OAjax.responseText; 1297 } 1298 } 1299 } 1300 } 1301 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1302 var envoi="iduser="+iduser; 1303 OAjax.send(envoi); 1304} 1305 1306function hashtags(url){ 1307 if(window.location.hash!=""){ 1308 var lehash = window.location.hash; 1309 document.location.href = lehash; 1310 } 1311} 1312 1313function findValue(li) { 1314 if( li == null ) return alert("No match!"); 1315 1316 // if coming from an AJAX call, let's use the CityId as the value 1317 if( !!li.extra ) var sValue = li.extra[0]; 1318 1319 // otherwise, let's just display the value in the text box 1320 else var sValue = li.selectValue; 1321} 1322 1323 function selectItem(li) { 1324 findValue(li); 1325} 1326 1327function formatItem(row) { 1328 return row[0] + "<br><i>" + row[1] + "</i>"; 1329} 1330 1331function slideshow(){ 1332 /*if($("#slidezap").html()!=null){ 1333 id_active = $("#slidezap").find(".slidezap_active").attr("id"); 1334 numero_slide = id_active.split("_"); 1335 numero_slide = numero_slide[1]; 1336 next_slide = parseInt(numero_slide)+1; 1337 if($("#slidezap_"+next_slide).html()==null){ 1338 next_slide = 1; 1339 } 1340 $("#"+id_active).removeClass("slidezap_active"); 1341 $("#"+id_active).fadeOut(); 1342 $("#slidezap_"+next_slide).addClass("slidezap_active"); 1343 $("#slidezap_"+next_slide).fadeIn(); 1344 }*/ 1345} 1346 1347function slideclic(indice,type){ 1348 1349 clearInterval(slidetimer); 1350 slidetimer = ''; 1351 1352 if(type=="prev"){ 1353 prev_slide = parseInt(indice)-1; 1354 if($("#slidezap_"+prev_slide).html()==null){ 1355 prev_slide = $("#slidezap").find(".slidezap").length; 1356 } 1357 $("#slidezap_"+indice).removeClass("slidezap_active"); 1358 $("#slidezap_"+indice).fadeOut(); 1359 $("#slidezap_"+prev_slide).addClass("slidezap_active"); 1360 $("#slidezap_"+prev_slide).fadeIn(); 1361 }else if(type=="next"){ 1362 next_slide = parseInt(indice)+1; 1363 if($("#slidezap_"+next_slide).html()==null){ 1364 next_slide = 1; 1365 } 1366 $("#slidezap_"+indice).removeClass("slidezap_active"); 1367 $("#slidezap_"+indice).fadeOut(); 1368 $("#slidezap_"+next_slide).addClass("slidezap_active"); 1369 $("#slidezap_"+next_slide).fadeIn(); 1370 } 1371 slidetimer = setInterval("slideshow();",6000); 1372} 1373 1374function get_lien(id,type){ 1375 var lien; 1376 $.ajax({ 1377 type: "GET", 1378 async: false, 1379 url: "ajax_search_infos.php", 1380 data: "mode=lien&id="+id+"&type="+type, 1381 success: function(msg){ 1382 lien = msg; 1383 } 1384 }); 1385 return lien; 1386} 1387 1388function get_image(id,type){ 1389 var image; 1390 $.ajax({ 1391 type: "GET", 1392 async: false, 1393 url: "ajax_search_infos.php", 1394 data: "mode=image&id="+id+"&type="+type, 1395 success: function(msg){ 1396 image = msg; 1397 } 1398 }); 1399 return image; 1400} 1401 1402function annuler_add_acteur(){ 1403 $("#main").css("background-color","#FFF").css("opacity","1"); 1404 $("#zone_ajout_acteur").remove(); 1405} 1406 1407function deroule_bloc_signal_erreur(){ 1408 /*alert($("#bloc_signal_erreur").css("display"));*/ 1409 if($("#bloc_big_signal_erreur").css("left")=="-258px"){ 1410 $("#bloc_signal_erreur").animate({left:"-50px"},500,'',function(){ /*$("#bloc_signal_erreur").hide();*/ }); 1411 $("#bloc_big_signal_erreur").animate({left:"0px"},1000,'',function(){ /*$("#bloc_big_signal_erreur").show();*/ }); 1412 }else{ 1413 $("#bloc_signal_erreur").animate({left:"0px"},500,'',function(){ /*$("#bloc_big_signal_erreur").show();*/ }); 1414 $("#bloc_big_signal_erreur").animate({left:"-258px"},500,'',function(){ /*$("#bloc_big_signal_erreur").hide();*/ }); 1415 } 1416} 1417 1418function envoyer_erreur(){ 1419 texte = encodeURIComponent($("#erreur_signalee").val()); 1420 link = $("#link_signalement").val(); 1421 type = $("#type_signalement").val(); 1422 $.get('ajax_erreur_signalement.php',{texte:texte,link:link,type:type},function(data){ $("#erreur_signalee").val(""); $("#msg_confirmation_erreur_signalee").html("Merci de votre aide !"); deroule_bloc_signal_erreur(); }); 1423} 1424 1425function annuler_add_resume_serie(){ 1426 $("#main").css("background-color","#FFF").css("opacity","1"); 1427 $("#zone_ajout_resume_serie").remove(); 1428} 1429 1430/*function add_resume_fin_serie(id_serie){ 1431 1432}*/ 1433 1434function vote_webserie(id_user,id_episode,note_episode){ 1435 $.get("/vote_serie.php",{id_user:id_user,id_episode:id_episode,note_episode:note_episode},function(data){ $("#zone_note_webserie_"+id_episode).html(data); }); 1436} 1437 1438function jour_planning(date_planning){ 1439 $.get('/jour_planning.php',{date_planning:date_planning},function(data){ $("#jours_planning").html(data); }); 1440} 1441 1442function rechercher_ajax(valeur,type,div){ 1443 if(valeur.length>2){ 1444 $.get('/ajax_rechercher.php',{valeur:encodeURIComponent(valeur),type:type},function(data){ $(div).html(data); }); 1445 }else{ 1446 $(div).html(""); 1447 } 1448} 1449 1450function change_ordre(genre,intitule){ 1451 if(genre==0){ 1452 document.location.href="series.html"; 1453 }else{ 1454 document.location.href="series-"+genre+"-"+intitule+".html"; 1455 } 1456} 1457function change_annee(annee){ 1458 if(annee==0){ 1459 document.location.href="series.html"; 1460 }else{ 1461 document.location.href="series-annee-"+annee+".html"; 1462 } 1463} 1464function change_pays(genre,intitule){ 1465 if(genre==0){ 1466 document.location.href="series.html"; 1467 }else{ 1468 document.location.href="series-pays-"+genre+"-"+intitule+".html"; 1469 } 1470} 1471 1472function select_cal(type){ 1473 if(type==1){ 1474 $("#header_cal_fr").hide(); 1475 $("#div_cal_fr").hide(); 1476 $("#header_cal").show(); 1477 $("#div_cal").show(); 1478 $("#choix_cal_monde").addClass("cal_on"); 1479 $("#choix_cal_fr").removeClass("cal_on"); 1480 }else if(type==2){ 1481 $("#header_cal").hide(); 1482 $("#div_cal").hide(); 1483 $("#header_cal_fr").show(); 1484 $("#div_cal_fr").show(); 1485 $("#choix_cal_fr").addClass("cal_on"); 1486 $("#choix_cal_monde").removeClass("cal_on"); 1487 } 1488} 1489 1490function affiche_contenu(idcrit,url){ 1491 $("#contenu_critique_full_"+idcrit).toggle(); 1492 if($("#contenu_critique_full_"+idcrit).css("display")=='none'){ 1493 $("#img_contenu_critique_full_"+idcrit).text("(Cliquez pour lire la suite)"); 1494 }else{ 1495 $("#img_contenu_critique_full_"+idcrit).text("(Cliquez pour cacher la suite)"); 1496 } 1497 document.location.href = url+'#critique_'+idcrit; 1498} 1499 1500function affiche_all(id_serie){ 1501 if($(".serie_"+id_serie).css("display")!="none"){ 1502 $(".serie_"+id_serie).css("display","none");
1503 $("#a_"+id_serie).text("(Plus d'\u00e9pisodes)"); 1504 }else{ 1505 $(".serie_"+id_serie).css("display",""); 1506 $("#a_"+id_serie).text("(Moins d'\u00e9pisodes)"); 1507 } 1508} 1509 1510function check_inscrip() { 1511 var OAjax; 1512 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1513 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1514 OAjax.open('POST',"inscription.php",true); 1515 OAjax.onreadystatechange = function() 1516 { 1517 if (OAjax.readyState == 4 && OAjax.status==200) 1518 { 1519 if (document.getElementById) 1520 { 1521 if (OAjax.responseText =='true') { 1522 document.getElementById('msg').innerHTML=''; 1523 }else{ 1524 document.getElementById('msg').innerHTML=OAjax.responseText; 1525 } 1526 } 1527 } 1528 } 1529 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1530 for(var i=0;i<document.form_inscrip.genre.length;i++){ 1531 if(document.form_inscrip.genre[i].checked==true){ 1532 rep = document.form_inscrip.genre[i].value; 1533 } 1534 } 1535 1536 pseudo = $("#pseudo").val(); 1537 nom = $("#nom").val(); 1538 prenom = $("#prenom").val(); 1539 email = $("#email").val(); 1540 jour = $("#jour").val(); 1541 mois = $("#mois").val(); 1542 annee = $("#annee").val(); 1543 pass = $("#pass").val(); 1544 pass2 = $("#pass2").val(); 1545 1546 if($("#cdu").is(":checked")==true){ cdu=1; }else{ cdu=0; } 1547 1548 if($("#mail_envoi").is(":checked")==true){ mail_envoi=1; }else{ mail_envoi=0; } 1549 1550 var envoi="genre="+rep+"&pseudo="+pseudo+"&nom="+nom+"&prenom="+prenom+"&email="+email+"&jour="+jour+"&mois="+mois+"&annee="+annee+"&pass="+pass+"&pass2="+pass2+"&cdu="+cdu+"&mail_envoi="+mail_envoi; 1551 OAjax.send(envoi); 1552} 1553 1554function vote(id_user,id_episode,note_episode,type) { 1555 $.get('/vote_serie.php',{id_episode:id_episode,id_user:id_user,note_episode:note_episode,type:type},function(data){ if(data!=''){ $(".retour_note_logout").html(data); } $("#input_manote").val(note_episode); }); 1556} 1557 1558function deconnexion_facebook() { 1559 $("#lien_deconnexion_facebook").hide(); 1560 FB.logout(); 1561} 1562 1563function vote_facebook(lien){ 1564 $("#facebook_action_vu").html("<img alt='' src='/images/ajax-loader2.gif' style='margin-top:4px;' width='16' height='16'>"); 1565 FB.api('/me', function(response) { 1566 if(response.name){ 1567 episode = 'http://www.spin-off.fr/'+lien; 1568 if($("#input_manote").val()!=''){ 1569 var chaine_param = {'episode' : episode,'note' : $("#input_manote").val() }; 1570 }else{ 1571 var chaine_param = {'episode' : episode }; 1572 } 1573 FB.api('/me/spinoff_fr:noter', 'post', chaine_param, function(response) { 1574 if (!response || response.error) { 1575 /*alert('Une erreur est survenue lors de la publication de l\'action :'+response.error.message);*/ 1576 $("#facebook_action_vu").html("Une erreur s'est produite"); 1577 } else { 1578 /*alert('Action publiée ! Identifiant d\'action : ' + response.id);*/ 1579 $("#facebook_action_vu").html("Note publiée !"); 1580 } 1581 }); 1582 } 1583 }); 1584} 1585 1586function show_votes(sondages_id) { 1587 var OAjax; 1588 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1589 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1590 OAjax.open('POST',"vote_afficher_sondage.php",true); 1591 OAjax.onreadystatechange = function() 1592 { 1593 if (OAjax.readyState == 4 && OAjax.status==200) 1594 { 1595 if (document.getElementById) 1596 { 1597 if (OAjax.responseText =='true') { 1598 document.getElementById('div_sondage_'+sondages_id).innerHTML=''; 1599 }else{ 1600 $('#div_sondage_'+sondages_id).hide(); 1601 document.getElementById('div_sondage_'+sondages_id).innerHTML=OAjax.responseText; 1602 $('#div_sondage_'+sondages_id).fadeIn("normal"); 1603 } 1604 } 1605 } 1606 } 1607 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1608 1609 var envoi='sondages_id='+sondages_id; 1610 OAjax.send(envoi); 1611} 1612 1613function sondage(sondages_id) { 1614 1615 //selectionne = $("input.poll[@type=radio][@checked]"); 1616 1617 var choix = ''; 1618 1619 choix = $("input.poll:checked").val(); 1620 1621 /*for(i=0;i<selectionne.length;i++){ 1622 if(selectionne[i].checked==true){ 1623 choix = selectionne[i].value; 1624 } 1625 }*/ 1626 1627 if(choix!=''){ 1628 1629 var OAjax; 1630 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1631 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1632 OAjax.open('POST',"vote_sondage.php",true); 1633 OAjax.onreadystatechange = function() 1634 { 1635 if (OAjax.readyState == 4 && OAjax.status==200) 1636 { 1637 if (document.getElementById) 1638 { 1639 if (OAjax.responseText =='true') { 1640 document.getElementById('msg_sondage').innerHTML='';
1641 }else{ 1642 1643 if(OAjax.responseText=="ok"){ 1644 show_votes(sondages_id); 1645 } 1646 } 1647 1648 } 1649 } 1650 } 1651 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1652 1653 var envoi='sondages_id='+sondages_id+'&choix='+choix; 1654 OAjax.send(envoi); 1655 1656 }else{ 1657 alert('Veuillez s\351lectionner un choix'); 1658 } 1659 1660} 1661 1662function grat_comm(id_user,id_comm) { 1663 var OAjax; 1664 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1665 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1666 OAjax.open('POST',"grat_comm.php",true); 1667 OAjax.onreadystatechange = function() 1668 { 1669 if (OAjax.readyState == 4 && OAjax.status==200) 1670 { 1671 if (document.getElementById) 1672 { 1673 if (OAjax.responseText =='true') { 1674 document.getElementById('div_img_vote_'+id_comm).innerHTML=''; 1675 }else{ 1676 document.getElementById('div_img_vote_'+id_comm).innerHTML='<img alt="" title="Vous avez déjà voté pour ce commentaire" src="images/tick.png" class="vmiddle" src="images/tick.png" width="16"/>'; 1677 } 1678 } 1679 } 1680 } 1681 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1682 1683 var envoi="id_user="+id_user+"&id_comm="+id_comm; 1684 OAjax.send(envoi); 1685} 1686 1687function rechercher_webseries_genres(genre){ 1688 $.get('/ajax_webseries_genres.php',{genre:genre},function(data){ $("#zone_webseries_genres").html(data); }); 1689} 1690 1691function change_couleur(id_serie){ 1692 /*if(document.getElementById('temp_saison_'+id_saison*/ 1693} 1694 1695function rechercher_series_vues(valeur){ 1696 if(valeur.length>2){ 1697 $.get('ajax_mes_series_vues_rechercher.php',{valeur:encodeURIComponent(valeur)},function(data){ $("#zone_series").html(data); }); 1698 }else{ 1699 $("#zone_series").html(""); 1700 } 1701} 1702 1703function check_edit() { 1704 var OAjax; 1705 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1706 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1707 OAjax.open('POST',"compte_edit.php",true); 1708 OAjax.onreadystatechange = function() 1709 { 1710 if (OAjax.readyState == 4 && OAjax.status==200) 1711 { 1712 if (document.getElementById) 1713 { 1714 if (OAjax.responseText =='true') { 1715 document.getElementById('msg').innerHTML=''; 1716 }else{ 1717 document.getElementById('msg').innerHTML=OAjax.responseText; 1718 } 1719 } 1720 } 1721 } 1722 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1723 1724 nom = document.getElementById('nom').value; 1725 prenom = document.getElementById('prenom').value; 1726 jour = document.getElementById('jour').value; 1727 mois = document.getElementById('mois').value; 1728 annee = document.getElementById('annee').value; 1729 pass = document.getElementById('pass').value; 1730 pass2 = document.getElementById('pass2').value; 1731 email = document.getElementById('email').value; 1732 var pseudo; 1733 if(document.getElementById('pseudo')){ 1734 pseudo = document.getElementById('pseudo').value; 1735 }else{ 1736 pseudo = ''; 1737 } 1738 facebook = 0; 1739 /*if(document.getElementById('facebook').checked==true){ 1740 facebook = 1; 1741 }else{ 1742 facebook = 0; 1743 }*/ 1744 if(document.getElementById('envoi_mails').checked==true){ 1745 envmails = 1; 1746 }else{ 1747 envmails = 0; 1748 } 1749 1750 monsite = document.getElementById('site').value; 1751 twitter = document.getElementById('twitter').value; 1752 1753 /*for(var i=0;i<document.form_inscrip.genre.length;i++){ 1754 if(document.form_inscrip.genre[i].checked==true){ 1755 rep = document.form_inscrip.genre[i].value; 1756 } 1757 }*/ 1758 1759 if(document.getElementById('genre').checked==true){ 1760 if(document.getElementById('genre').value==1){ 1761 var rep = '1'; 1762 } 1763 }else if(document.getElementById('genre2').checked==true){ 1764 if(document.getElementById('genre2').value==1){ 1765 var rep = '2'; 1766 } 1767 } 1768 1769 var envoi="genre="+rep+"&nom="+nom+"&prenom="+prenom+"&jour="+jour+"&mois="+mois+"&annee="+annee+"&pass="+pass+"&pass2="+pass2+"&email="+email+'&facebook='+facebook+'&envmails='+envmails+'&monsite='+monsite+'&twitter='+twitter+'&pseudo='+pseudo; 1770 OAjax.send(envoi); 1771} 1772 1773function deroule_archives(id_saison){ 1774 if($(".saison_"+id_saison).css("display")!="none"){ 1775 $(".saison_"+id_saison).css("display","none");
1776 $(".entetecache_"+id_saison).css("display","none"); 1777 $("#a_"+id_saison).text("(Afficher)"); 1778 }else{ 1779 $(".saison_"+id_saison).css("display",""); 1780 $(".entetecache_"+id_saison).css("display",""); 1781 $("#a_"+id_saison).text("(Cacher)"); 1782 } 1783} 1784 1785function afficher_tous(){ 1786 if($(".all_amis").css("display")!="none"){ 1787 $(".all_amis").css("display","none"); 1788 $("#all").text("(Afficher tous)"); 1789 }else{ 1790 $(".all_amis").css("display",""); 1791 $("#all").text("(Afficher moins)"); 1792 } 1793} 1794 1795function repondre_msg(id_msg){ 1796 $("#zone_rep_msg_"+id_msg).show(); 1797 //document.getElementById('zone_rep_msg').style.display=''; 1798} 1799function delete_msg(mid){ 1800 if(confirm('Etes-vous sûr de vouloir supprimer ce message ?')){ 1801 var OAjax; 1802 if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); 1803 else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 1804 OAjax.open('POST',"message_delete.php",true); 1805 OAjax.onreadystatechange = function() 1806 { 1807 if (OAjax.readyState == 4 && OAjax.status==200) 1808 { 1809 if (document.getElementById) 1810 { 1811 if (OAjax.responseText =='true') { 1812 /*document.getElementById('reserve_reponse').innerHTML='';*/ 1813 }else{ 1814 /*document.getElementById('reserve_reponse').innerHTML=OAjax.responseText;*/ 1815 } 1816 } 1817 } 1818 } 1819 OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 1820 OAjax.send('mid='+mid); 1821 document.location.href='messagerie.php'; 1822 } 1823} 1824 1825function lire_msg(id_msg){ 1826 if($("#ligne_dessous_msg_"+id_msg).html()==null){ 1827 $.get('/ajax_messages.php',{mode:'lire',id_msg:id_msg},function(data){ 1828 $(".ligne_dessous_message").hide(); 1829 $("#ligne_message_"+id_msg).after(data); 1830 }); 1831 }else{ 1832 if($("#ligne_dessous_msg_"+id_msg).css("display")!="none"){ 1833 $("#ligne_dessous_msg_"+id_msg).hide(); 1834 }else{ 1835 $(".ligne_dessous_message").hide(); 1836 $("#ligne_dessous_msg_"+id_msg).show(); 1837 } 1838 } 1839} 1840 1841function envoyer_msg(dest,id_ref){ 1842 if(id_ref==null||id_ref==0){ 1843 id_ref = 0; 1844 msg = $("#contenu_rep_"+dest).val(); 1845 titre = $("#titre_rep_"+dest).val(); 1846 }else{ 1847 msg = $("#contenu_rep").val(); 1848 titre = $("#titre_rep").val(); 1849 } 1850 if(msg!=''){ 1851 $.get('/ajax_messages.php',{mode:'envoi',msg:msg,titre:titre,dest:dest,id_ref:id_ref},function(){ 1852 if(id_ref==null||id_ref==0){ 1853 $("#msg_reponse_"+dest).html('<br/><span style="color:green;font-weight:bold;">Message envoyé</span>'); 1854 $("#contenu_rep_"+dest).val(""); 1855 }else{ 1856 $("#msg_reponse").html('<br/><span style="color:green;font-weight:bold;">Message envoyé</span>'); 1857 $("#contenu_rep").val(""); 1858 } 1859 }); 1860 1861 }else{ 1862 if(id_ref==null||id_ref==0){ 1863 $("#msg_reponse_"+dest).html('<br/><span style="color:red;font-weight:bold;">Veuillez remplir votre message</span>'); 1864 }else{ 1865 $("#msg_reponse").html('<br/><span style="color:red;font-weight:bold;">Veuillez remplir votre message</span>'); 1866 } 1867 } 1868} 1869 1870function load_video_popup(id_video){ 1871 if($("#site_mobile").css("display")=="block"){ 1872 taille_bloc = "96%"; 1873 decalage_gauche = "0"; 1874 }else{ 1875 taille_bloc = "592px"; 1876 decalage_gauche = View.width / 2 - 300 + get_scrollx(); 1877 } 1878 $("#main").after('<div id="video_popup" style="position:absolute;width:'+taille_bloc+';height:348px;text-align:center;opactiy:1;padding:2%;"></div>'); 1879 $("#main").css('opacity',0.5); 1880 $.get('/ajax_video_load.php',{vid:id_video,big:1},function(data){ $("#video_popup").html('<div class="floatright right" onclick="fermer_video_popup();" onmouseover="this.style.cursor=\'pointer\';">Fermer</div><div class="clearboth"></div><div style="margin-top:10px;">'+data+'</div>'); }); 1881 $("#video_popup").css("background-color","#FFFFFF"); 1882 $("#video_popup").css("border","1px solid #CCCCCC"); 1883 $("#video_popup").css("left",decalage_gauche + 'px'); 1884 $("#video_popup").css("top",View.height / 2 - 179 + get_scrolly() + 'px'); 1885 $("#video_popup").show(); 1886} 1887 1888function fermer_video_popup(){ 1889 $("#video_popup").html(""); 1890 $("#video_popup").remove(); 1891 $("#main").css('opacity',1); 1892} 1893 1894$(function(){ 1895 if($("#site_mobile").css("display")=="none"){ 1896 $(".menu_entete_intitule").mouseenter(function(){ 1897 id = $(this).attr("id"); 1898 id = id.split("_"); 1899 id = id[2]; 1900 timer = setTimeout(function(){ $("#menu_horiz_"+id).show(); },100); 1901 }).mouseleave(function(){ 1902 id = $(this).attr("id"); 1903 id = id.split("_"); 1904 id = id[2]; 1905 clearTimeout(timer); 1906 $("#menu_horiz_"+id).hide(); 1907 }); 1908 } 1909}); 1910 1911function load_ajax_comm(id,type,display,limite_fin){ 1912 $.ajax({ 1913 type: 'GET', 1914 async:false, 1915 url: 'ajax_comm.php', 1916 data: "id="+id+"&type="+type+"&limite="+$("#current_indice_comm").val()+(display!='' ? '&display=all' : '')+'&limite_fin='+limite_fin, 1917 success: function(data){ 1918 if(data!=''){ 1919 $("#table_comm tbody.tbody_comm").append(data); $("#current_indice_comm").val(parseInt($("#current_indice_comm").val())+15); 1920 $("#loader_comm").hide(); 1921 if(display!=''){ 1922 if(hash!=null){
1923 if($("#tr_"+hash).html()!=null){ 1924 decalage = $("#tr_"+hash).offset().top; 1925 $("html:not(:animated), body:not(:animated)").animate({scrollTop:decalage}, 1000); 1926 } 1927 } 1928 } 1929 $('#table_comm img').bind('inview', function(event, isInView, visiblePartX, visiblePartY) { 1930 image = $(this); 1931 if(image.attr("rel")!=''){ 1932 if (isInView) { 1933 image.attr("src",image.attr("rel")); 1934 image.attr("rel",""); 1935 } 1936 } 1937 }); 1938 }else{ 1939 $("#loader_comm").hide(); 1940 } 1941 } 1942 }); 1943 refresh_svg(); 1944} 1945 1946function refresh_svg(){ 1947 jQuery('img.svg').each(function(){ 1948 var $img = jQuery(this); 1949 var imgID = $img.attr('id'); 1950 var imgClass = $img.attr('class'); 1951 var imgURL = $img.attr('src'); 1952 var imgAlt = $img.attr('alt'); 1953 1954 jQuery.get(imgURL, function(data) { 1955 // Get the SVG tag, ignore the rest 1956 var $svg = jQuery(data).find('svg'); 1957 1958 // Add replaced image's ID to the new SVG 1959 if(typeof imgID !== 'undefined') { 1960 $svg = $svg.attr('id', imgID); 1961 } 1962 // Add replaced image's classes to the new SVG 1963 if(typeof imgClass !== 'undefined') { 1964 $svg = $svg.attr('class', imgClass+' replaced-svg'); 1965 } 1966 1967 // add replaced image's alt tag to the new SVG 1968 if(typeof imgAlt !== 'undefined') { 1969 $svg = $svg.attr('alt', imgAlt); 1970 } 1971 // Remove any invalid XML tags as per http://validator.w3.org 1972 $svg = $svg.removeAttr('xmlns:a'); 1973 1974 // Replace image with new SVG 1975 $img.replaceWith($svg); 1976 1977 }, 'xml'); 1978 1979 1980 }); 1981} 1982 1983function deroule_calendrier(jour){ 1984 $(".tr_calendrier_voirplus").slideDown(); 1985} 1986 1987function create_slider(container, global_config) { 1988 var slider; 1989 var slider_config; 1990 1991 if(!global_config) { 1992 global_config = {}; 1993 } 1994 1995 $(container).each(function() { 1996 slider_config = {}; 1997 // Init default slider configuration 1998 $.extend(slider_config,global_config); 1999 2000 // Init specific slider configuration 2001 var inline_config = $(this).attr('data-slider-options'); 2002 if (inline_config) { 2003 $.extend(slider_config,JSON.parse(inline_config)); 2004 } 2005 2006 // Set global slider parameters 2007 if(slider_config['pagerCustom']) { 2008 slider_config['pagerCustom'] = $(slider_config['pagerCustom']); 2009 } 2010 2011 if(typeof slider_config.parkinson === 'undefined') { 2012 //slider_config['parkinson'] = true; 2013 } 2014 2015 if(typeof slider_config.oneLine === 'undefined') { 2016 slider_config['oneLine'] = false; 2017 } 2018 2019 if(typeof slider_config.moveSlides === 'undefined') { 2020 slider_config['moveSlides'] = 1; 2021 } 2022 2023 if(typeof slider_config.speed === 'undefined') { 2024 slider_config['speed'] = 750; 2025 } 2026 2027 slider_config['nextText'] = '<span class="icon icon-caret-right"></span>'; 2028 slider_config['prevText'] = '<span class="icon icon-caret-left"></span>'; 2029 2030 if(typeof slider_config.colorSpecialArrow === 'undefined') { 2031 slider_config['classSpecialArrow'] = ''; 2032 }else{ 2033 if(($("#site_mobile").css("display")!="none")&&($('.home_slidezap').html()!=null)&&($(this).attr("id")=='carousel_flux_live')){ 2034 slider_config['classSpecialArrow'] = ''; 2035 }else{ 2036 slider_config['classSpecialArrow'] = 'fleche_blanche'; 2037 } 2038 } 2039 2040 if($("#site_mobile").css("display")=="block"){ 2041 slider_config['controls'] = true; 2042 slider_config['touchEnabled'] = true; 2043 } 2044 2045 if(typeof slider_config.arrowInside === 'undefined') { 2046 slider_config['arrowInside'] = ''; 2047 }else{ 2048 slider_config['arrowInside'] = '1'; 2049 } 2050 2051 //slider_config['slideWidth'] = 150; 2052 2053 //slider_config['pagerCustom'] = '#bx-pager';
2054 //slider_config['controls'] = false; 2055 if(typeof slider_config.pager === 'undefined') { 2056 slider_config['pager'] = false; 2057 } 2058 2059 slider = $(this).bxSlider(slider_config); 2060 2061 if($(this).hasClass('nomobile')) { 2062 $(this).parents('.bx-wrapper').addClass('nomobile'); 2063 desktopSliders.push(slider); 2064 2065 } 2066 else if($(this).hasClass('onlymobile')) { 2067 $(this).parents('.bx-wrapper').addClass('onlymobile'); 2068 mobileSliders.push(slider); 2069 } 2070 else { 2071 responsiveSliders.push(slider); 2072 } 2073 2074 if(slider_config['hidden']) { 2075 $(this).parents('.bx-wrapper').hide(); 2076 } 2077 2078 // Lazy loading 2079 $(this).find('img').on('inview', function (event, isInView) { 2080 if (isInView) { 2081 if($(this).attr("data-src")) { 2082 $(this).attr("src", $(this).attr("data-src")); 2083 } 2084 } 2085 }); 2086 }); 2087 refresh_svg(); 2088 return slider; 2089} 2090 2091let lazyObserver; 2092 2093function initLazyLoad(container = document) { 2094/*function initLazyLoad($container) { 2095 if($container.html() != null){ 2096 $container.find('img[rel]').bind('inview', function(event, isInView, visiblePartX, visiblePartY) { 2097 image = $(this); 2098 if(image.attr("rel")!=''){ 2099 if (isInView) { 2100 image.attr("src",image.attr("rel")); 2101 image.attr("rel",""); 2102 } 2103 } 2104 }); 2105 }*/ 2106 if (!lazyObserver) { 2107 lazyObserver = new IntersectionObserver((entries) => { 2108 entries.forEach(entry => { 2109 if (entry.isIntersecting) { 2110 const img = entry.target; 2111 const rel = img.getAttribute('rel'); 2112 if (rel) { 2113 img.setAttribute('src', rel); 2114 img.removeAttribute('rel'); 2115 lazyObserver.unobserve(img); 2116 } 2117 } 2118 }); 2119 }); 2120 } 2121 2122 const images = container.querySelectorAll('img.lazy_load'); 2123 images.forEach(img => lazyObserver.observe(img)); 2124 2125} 2126 2127var toggleSizeHandler = function() { 2128 if(window.matchMedia) { 2129 if (window.matchMedia('(min-width: 768px) and (max-width: 1024px)').matches) { 2130 if (toggleSize === 'desktop' || toggleSize === 'mobile') { 2131 // reload responsive sliders 2132 for (var i = 0; i < responsiveSliders.length; i++) { 2133 responsiveSliders[i].reloadSlider(); 2134 } 2135 } 2136 toggleSize = 'tablet'; 2137 } 2138 else if (window.matchMedia('(min-width: 768px)').matches) { 2139 if (toggleSize === 'mobile' || toggleSize === 'tablet') { 2140 // reload desktop sliders 2141 for (var i = 0; i < desktopSliders.length; i++) { 2142 desktopSliders[i].reloadSlider(); 2143 } 2144 // reload responsive sliders 2145 for (var i = 0; i < responsiveSliders.length; i++) { 2146 responsiveSliders[i].reloadSlider(); 2147 } 2148 // destro mobile sliders 2149 for (var i = 0; i < mobileSliders.length; i++) { 2150 mobileSliders[i].destroySlider(); 2151 } 2152 } 2153 toggleSize = 'desktop'; 2154 } 2155 if (window.matchMedia('(max-width: 767px)').matches) { 2156 if (toggleSize === 'desktop' || toggleSize === 'tablet') { 2157 // reload mobile sliders 2158 for (var i = 0; i < mobileSliders.length; i++) { 2159 mobileSliders[i].reloadSlider(); 2160 } 2161 // reload responsive sliders 2162 for (var i = 0; i < responsiveSliders.length; i++) { 2163 responsiveSliders[i].reloadSlider(); 2164 } 2165 // destroy desktop sliders 2166 for (var i = 0; i < desktopSliders.length; i++) { 2167 desktopSliders[i].destroySlider(); 2168 } 2169 } 2170 toggleSize = 'mobile'; 2171 } 2172 } 2173} 2174$(window).resize(toggleSizeHandler); 2175 2176var hash = window.location.href.split('#')[1]; 2177if(hash!=null){ 2178 if(hash.indexOf('comm')!=-1){ 2179 limite_fin = $("#nb_comm_parent").val(); 2180 if(limite_fin!=''){ 2181 load_ajax_comm($("#id_ref_comm").val(),$("#type_ref_comm").val(),'all',limite_fin); 2182 } 2183 } 2184} 2185 2186function maj_avancement(type,id,id_parent){ 2187 $.get('/ajax_avancement_series.php',{type:type,id:id},function(data){ 2188 //alert(data); 2189 if(type=='serie'){ 2190 $(".avancement_saison_"+id).removeClass("avancement_none").removeClass("avancement_half").addClass("avancement_full"); 2191 }else{ 2192 if(data>0) { 2193 $("#avancement_"+type+"_"+id+(id_parent!='' ? '_'+id_parent : '')).removeClass("avancement_none").removeClass("avancement_half").addClass("avancement_full"); 2194 if(id_parent!='') $(".avancement_serie_check_episode_"+id).prop("checked",true); 2195 }else{ 2196 $("#avancement_"+type+"_"+id+(id_parent!='' ? '_'+id_parent : '')).removeClass("avancement_full").removeClass("avancement_half").addClass("avancement_none"); 2197 if(id_parent!='') $(".avancement_serie_check_episode_"+id).prop("checked",false); 2198 } 2199 } 2200 }); 2201} 2202 2203function check_form_connexion(){ 2204 if(($("#bloc_connexion_user").val()=="")||($("#bloc_connexion_pass").val()=="")){ 2205 $("#bloc_connexion_error").show(); 2206 return false;
2207 }else{ 2208 $("#bloc_connexion_error").hide(); 2209 return true; 2210 } 2211} 2212 2213function switch_bloc_connexion(type){ 2214 if(type=='login'){ 2215 $("#bloc_connexion_create_account").hide(); 2216 $("#bloc_connexion_login").show(); 2217 $("#bloc_connexion_user").focus(); 2218 }else{ 2219 $("#bloc_connexion_login").hide(); 2220 $("#bloc_connexion_create_account").show(); 2221 } 2222} 2223 2224(function() { 2225 2226 function decimalAdjust(type, value, exp) { 2227 // Si la valeur de exp n'est pas définie ou vaut zéro... 2228 if (typeof exp === 'undefined' || +exp === 0) { 2229 return Math[type](value); 2230 } 2231 value = +value; 2232 exp = +exp; 2233 // Si la valeur n'est pas un nombre 2234 // ou si exp n'est pas un entier... 2235 if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) { 2236 return NaN; 2237 } 2238 // Si la valeur est négative 2239 if (value < 0) { 2240 return -decimalAdjust(type, -value, exp); 2241 } 2242 // Décalage 2243 value = value.toString().split('e'); 2244 value = Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))); 2245 // Décalage inversé 2246 value = value.toString().split('e'); 2247 return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)); 2248 } 2249 2250 // Arrondi décimal 2251 if (!Math.round10) { 2252 Math.round10 = function(value, exp) { 2253 return decimalAdjust('round', value, exp); 2254 }; 2255 } 2256 // Arrondi décimal inférieur 2257 if (!Math.floor10) { 2258 Math.floor10 = function(value, exp) { 2259 return decimalAdjust('floor', value, exp); 2260 }; 2261 } 2262 // Arrondi décimal supérieur 2263 if (!Math.ceil10) { 2264 Math.ceil10 = function(value, exp) { 2265 return decimalAdjust('ceil', value, exp); 2266 }; 2267 } 2268 2269}); 2270 2271document.addEventListener('touchstart', handleTouchStart, false); 2272document.addEventListener('touchmove', handleTouchMove, false); 2273 2274var xDown = null; 2275var yDown = null; 2276 2277function handleTouchStart(evt) { 2278 xDown = evt.touches[0].clientX; 2279 yDown = evt.touches[0].clientY; 2280}; 2281 2282function handleTouchMove(evt) { 2283 if ( ! xDown || ! yDown ) { 2284 return; 2285 } 2286 2287 target = evt.target; 2288 2289 2290 //if(target.parent('.container_sub_header_episode').html!=null 2291 2292 //alert(evt.target.id); 2293 2294 var xUp = evt.touches[0].clientX; 2295 var yUp = evt.touches[0].clientY; 2296 2297 var xDiff = xDown - xUp; 2298 var yDiff = yDown - yUp; 2299 2300 if ( Math.abs( xDiff ) > Math.abs( yDiff ) ) {/*most significant*/ 2301 if ( xDiff > 0 ) { 2302 if($( evt.target ).parents('#container_sub_header_episode_id').html()!=null){ 2303 if($("#episode_next_episode").val()!=null) document.location.href = $("#episode_next_episode").val(); 2304 } 2305 //alert(target.parent('.container_sub_header_episode').html()); 2306 /* left swipe */ 2307 } else { 2308 if($( evt.target ).parents('#container_sub_header_episode_id').html()!=null){ 2309 if($("#episode_prev_episode").val()!=null) document.location.href = $("#episode_prev_episode").val(); 2310 } 2311 /* right swipe */ 2312 } 2313 } else { 2314 if ( yDiff > 0 ) { 2315 /* up swipe */ 2316 } else { 2317 /* down swipe */ 2318 } 2319 } 2320 /* reset values */ 2321 xDown = null; 2322 yDown = null; 2323}; 2324 2325$(document).ready(function() { 2326 2327 //initLazyLoad($(".grille_acteurs_series")); 2328 2329 create_slider('.carousel'); 2330 2331 if($("#site_mobile").css("display")=="block"){ 2332 create_slider('.carouselmobile'); 2333 if($("#onglet_v4_entete_bouton_comm").html()!=null){ 2334 $("#onglet_v4_entete_bouton_comm").html($("#onglet_v4_entete_bouton_comm").html().replace("Commentaire","Comm")); 2335 } 2336 2337 $("body").on("click","#mobile_episode_rate_star, #mobile_episode_div_click_rate",function(e){ 2338 var deja_note = 10; 2339 if($("#variable_note_affichee").html()!=null){ 2340 deja_note = $("#variable_note_affichee").html(); 2341 } 2342 $("body").append('<div id="mobile_episode_div_rate"><span style="position:absolute;top:5px;right:5px;"><i class="fa fa-lg fa-close" onclick="$(\'#mobile_episode_div_rate\').remove();"></i></span><div class="center fs150" style="font-weight:bold;">Notez</div><br/><div style="display:inline-block;" class="star_rate" data-rating="'+(deja_note/2)+'"></div><br/><br/><div id="mobile_episode_note_temp">'+($("#variable_note_affichee").html()!=null ? (deja_note)+'/20' : '')+'</div><div class="retour_note_logout"></div></div>'); 2343 $(".star_rate").starRating({ 2344 starSize: 28, 2345 totalStars: 10, 2346 disableAfterRate: false, 2347 starGradient: { 2348 start: '#f67964', 2349 end: '#e52951' 2350 }, 2351 callback: function(currentRating, $el){ 2352 $("#mobile_episode_note_temp").html((currentRating*2)+"/20"); 2353 vote('',$("#ref_episode_rate").val(),(currentRating*2),$("#type_episode_rate").val()); 2354 } 2355 }); 2356 e.stopPropagation(); 2357 }); 2358 2359 } 2360 2361 /*$.get('/ajax_flux_live.php',function(data){ 2362 $('#slidezap').html(data); 2363 $(".star").starRating({ 2364 starSize: 18, 2365 starGradient: { 2366 start: '#f67964', 2367 end: '#e52951' 2368 }, 2369 readOnly:true 2370 }); 2371 create_slider('#carousel_flux_live'); 2372 }); 2373 */ 2374 $("#bloc_header_login").click(function(){ 2375 $("#bloc_connexion_create_account").fadeIn(); 2376 }); 2377 $(".fermer_connexion").click(function(){ 2378 $(".bloc_connexion_default").fadeOut(); 2379 }); 2380 2381 $("body").on("click","#drag_open_gestionnaire img, #user_header_myspace",function(e){ 2382 show_menu(); 2383 e.stopPropagation(); 2384 }); 2385 2386 $("body").on("click","#gestionnaire_new_msg",function(e){ 2387 affiche_flux('messagerie',1); 2388 e.stopPropagation(); 2389 }); 2390 2391 if($("#site_mobile").css("display")=="block"){ 2392 $(".content_bloc_note").bind('touchstart touchend',function(e){ 2393 e.preventDefault(); 2394 id = $(this).parents('.container_bloc_note').attr("id"); 2395 id = id.split("_"); 2396 id = id[3]; 2397 $("#mobile_info_"+id).html($(this).parents('.container_bloc_note').attr("title")).toggle(); 2398 }); 2399 /*$("body").on("click",".content_bloc_note",function(){ 2400 $(this).parents(); 2401 alert($(this).attr("title")); 2402 });*/ 2403 }else{ 2404 $(".content_bloc_note").bind('mouseenter',function(e){ 2405 e.preventDefault(); 2406 id = $(this).parents('.container_bloc_note').attr("id"); 2407 id = id.split("_"); 2408 id = id[3]; 2409 $("#mobile_info_"+id).html($(this).parents('.container_bloc_note').attr("title")).show(); 2410 }).mouseleave(function(){ 2411 $("#mobile_info_"+id).html($(this).parents('.container_bloc_note').attr("title")).hide(); 2412 }); 2413 } 2414 2415 var hash = window.location.href.split('#')[1]; 2416 if(hash==null){ 2417 if($("#loader_comm").html()!=null){ 2418 $("#loader_comm").show(); 2419 if($(".comm_ligne_"+$("#nb_comm_parent").val()).html()==null){ 2420 load_ajax_comm($("#id_ref_comm").val(),$("#type_ref_comm").val(),'',15); 2421 } 2422 } 2423 } 2424 2425 $("#icon_menu").click(function(){ 2426 $("#menu_haut").fadeIn("slow"); 2427 $("#bloc_header_login span.nomobile").css("font-size","0"); 2428 }); 2429 $("#menu_back").click(function(){ 2430 $("#menu_haut").fadeOut("slow"); 2431 $("#bloc_header_login span.nomobile").css("font-size","inherit"); 2432 }); 2433 2434 $(".star").starRating({ 2435 starSize: 18, 2436 starGradient: { 2437 start: '#f67964', 2438 end: '#e52951' 2439 }, 2440 readOnly:true 2441 }); 2442 2443 if($("#site_mobile").css("display")=="none"){ 2444 2445 if($(".content_bloc_note_big").html()!=null){ 2446 2447 var pos_x = $(".content_bloc_note_big").offset(); 2448 pos_x = pos_x.left; 2449 var init_percent = $(".content_bloc_note_big").css("background-size"); 2450 pos_init_percent = init_percent.indexOf("%"); 2451 init_percent = init_percent.substring(0,pos_init_percent); 2452 taille_content = $(".content_bloc_note_big").width();
2453 $(".content_bloc_note_big").mousemove(function(e){ 2454 pos_pourcent = ((e.clientX-pos_x)/taille_content)*100; 2455 $(this).css("background-size",pos_pourcent+"% 100%"); 2456 $("#hidden_temp_note").val(pos_pourcent); 2457 new_percent = Math.round(pos_pourcent/5); 2458 $("#variable_note_affichee").html(new_percent); 2459 $(this).css("background-size",(new_percent*5)+"% 100%"); 2460 }).mouseout(function(){ 2461 if($("#hidden_temp_note_fixed").val()!=""){ 2462 $(this).css("background-size",$("#hidden_temp_note_fixed").val()+"% 100%"); 2463 $("#hidden_temp_note").val($("#hidden_temp_note_fixed").val()); 2464 new_percent = Math.round($("#hidden_temp_note_fixed").val()/5); 2465 $("#variable_note_affichee").html(new_percent); 2466 }else{ 2467 $(this).css("background-size",init_percent+"% 100%"); 2468 $("#hidden_temp_note").val(init_percent); 2469 new_percent = Math.round(init_percent/5); 2470 $("#variable_note_affichee").html(new_percent); 2471 } 2472 }); 2473 2474 $(".content_bloc_note_big").click(function(){ 2475 $("#hidden_temp_note_fixed").val($("#hidden_temp_note").val()); 2476 $(this).css("background-size",$("#hidden_temp_note").val()+"% 100%"); 2477 new_percent = Math.round($("#hidden_temp_note").val()/5); 2478 $("#variable_note_affichee").html(new_percent); 2479 vote('',$(this).find('.bloc_note_hidden_ref').val(),new_percent,$(this).find('.bloc_note_hidden_type').val()); 2480 }); 2481 2482 } 2483 2484 } 2485 2486 /*$("#onglet_messeries_rech_messeries").keyup(function(){ 2487 2488 });*/ 2489 2490 /*$('#comm_end').bind('inview', function(event, isInView, visiblePartX, visiblePartY) { 2491 if (isInView) { 2492 $("#loader_comm").show(); 2493 if($(".comm_ligne_"+$("#nb_comm_parent").val()).html()==null){ 2494 load_ajax_comm($("#id_ref_comm").val(),$("#type_ref_comm").val(),'',15); 2495 }else{ 2496 $("#loader_comm").hide(); 2497 } 2498 } 2499 });*/ 2500 2501 $("#episode_raccourci_comm").click(function(){ 2502 $("#onglet_v4_entete_bouton_comm").trigger("click"); 2503 decalage = $("#onglet_v4_entete_bouton_comm").offset().top; 2504 $("html:not(:animated), body:not(:animated)").animate({scrollTop:decalage}, 1000); 2505 }); 2506 $("#episode_raccourci_notes").click(function(){ 2507 $("#onglet_v4_entete_bouton_notes").trigger("click"); 2508 decalage = $("#onglet_v4_entete_bouton_notes").offset().top; 2509 $("html:not(:animated), body:not(:animated)").animate({scrollTop:decalage}, 1000); 2510 }); 2511 2512 $(".onglet_v4_entete").click(function(){ 2513 id = $(this).attr("id"); 2514 explode_id = id.split("_"); 2515 real_id = explode_id[4]; 2516 $(".onglet_v4_entete").removeClass("onglet_v4_entete_active"); 2517 $(this).addClass("onglet_v4_entete_active"); 2518 2519 $(".contenu_onglet_v4_entete").fadeOut("fast"); 2520 $("#contenu_onglet_v4_entete_"+real_id).fadeIn("fast"); 2521 2522 drawChart(); 2523 2524 }); 2525 2526 //$("#div_ajax_comm").find(); 2527 2528 if($("#site_mobile").css("display")=="block"){ 2529 2530 $("body").on("click",".div_bloc_droite .box_small",function(){ 2531 $(this).parent().find('.table_in_droite').toggle(); 2532 }); 2533 2534 $(".box_small").each(function(){ 2535 if($(this).html().toLowerCase().indexOf('pub')!=-1){ 2536 $(this).next().show(); 2537 } 2538 }); 2539 2540 $("body").on("click","#mobile_recherche",function(e){ 2541 if($(".div_bloc_recherche").css("display")=="block"){ 2542 $(".div_bloc_recherche").slideUp(); 2543 }else{ 2544 $(".div_bloc_recherche").slideDown(); 2545 $("#search_keywords").focus(); 2546 } 2547 //$(".div_bloc_recherche").toggle(); 2548 }); 2549 2550 $(".image_load_video_mobile").find("div").width("100%"); 2551 2552 } 2553 2554 var longpress = 1000; 2555 var start; 2556 $( "body" ).on( 'mousedown', ".avancement_click_saison", function( e ) { 2557 start = new Date().getTime(); 2558 //$(this).addClass("cp-round"); 2559 } ); 2560 $( "body" ).on( 'mouseleave', ".avancement_click_saison", function( e ) { 2561 start = 0; 2562 } ); 2563 $( "body" ).on( 'mouseup', ".avancement_click_saison", function( e ) { 2564 //alert($(this).attr("id")); 2565 //$(this).removeClass("cp-round"); 2566 id = $(this).attr("id"); 2567 id_split = id.split("_"); 2568 type = id_split[1]; 2569 id = id_split[2]; 2570 var id_parent = ''; 2571 if(id_split[3]!=null) id_parent = id_split[3]; 2572 if ( new Date().getTime() >= ( start + longpress ) ) { 2573 //alert('long press!'+id+type); 2574 //$("#avancement_details_episode_"+id_parent).html(""); 2575 maj_avancement(type,id,id_parent); 2576 } else { 2577 //alert('short press!'+id+type); 2578 //if($("#avancement_details_episode_"+id_parent).html()==''){ 2579 $.get('/ajax_avancement_series.php',{type:'getepisodes',id:id},function(data){ 2580 if($("#input_hidden_"+id).val()==null){ 2581 $("#avancement_details_episode_"+id_parent).html(data); 2582 }else{ 2583 $("#avancement_details_episode_"+id_parent).html(""); 2584 } 2585 }); 2586 //}else{ 2587 //$("#avancement_details_episode_"+id_parent).html(""); 2588 //} 2589 } 2590 } ); 2591 2592 $("body").on("click",".avancement_click_serie", function(){ 2593 id_attr = $(this).attr("id"); 2594 id_split = id_attr.split("_"); 2595 id = id_split[2]; 2596 maj_avancement('serie',id,''); 2597 }); 2598 2599 $("body").on("click",".avancement_serie_check_episode", function(){ 2600 id_attr = $(this).attr("id"); 2601 id_split = id_attr.split("_"); 2602 id = id_split[4]; 2603 maj_avancement('episode',id,''); 2604 }); 2605 2606 $(".liste_select_tableau_bord").change(function(){ 2607 let genre = $("#select_tableau_bord_genre").val(); 2608 let pays = $("#select_tableau_bord_pays").val(); 2609 let chaine = $("#select_tableau_bord_chaine").val(); 2610 document.location.href = 'tableau_de_bord_des_series_tv.html?genre='+genre+'&pays='+pays+'&chaine='+chaine; 2611 }); 2612 2613 $("body").on("click", ".loadpopupvideo", function(){ 2614 id = $(this).attr("id"); 2615 id = id.split("_"); 2616 id_video = id[1]; 2617 if(id_video!=null){ 2618 load_video_popup(id_video); 2619 } 2620 }); 2621 2622 $("body").on("mouseenter", ".img_infos", function(){ 2623 id = $(this).attr("id"); 2624 id = id.split("_"); 2625 id = id[1]; 2626 $("#div_infos_"+id).show(); 2627 }).on("mouseleave", ".img_infos", function(){ 2628 id = $(this).attr("id"); 2629 id = id.split("_"); 2630 id = id[1]; 2631 $("#div_infos_"+id).hide(); 2632 }); 2633 2634 $("#serie_monstatut").change(function(){ 2635 $.get('/ajax_serie_monstatut.php',{param:$(this).val()}); 2636 }); 2637 2638 $(".more_videos_series").click(function(){ 2639 limite = $("#indice_serie").val(); 2640 limite = parseInt(limite)+3; 2641 $("#indice_serie").val(limite); 2642 $.get('/ajax_video_more.php',{type:'SE',limite:limite},function(data){ $(".more_videos_series").before(data); }); 2643 }); 2644 2645 $(".more_videos_saisons").click(function(){ 2646 limite = $("#indice_saison").val(); 2647 limite = parseInt(limite)+3; 2648 $("#indice_saison").val(limite); 2649 $.get('/ajax_video_more.php',{type:'SA',limite:limite},function(data){ $(".more_videos_saisons").before(data); }); 2650 }); 2651 2652 $(".more_videos_episodes").click(function(){ 2653 limite = $("#indice_episode").val(); 2654 limite = parseInt(limite)+3; 2655 $("#indice_episode").val(limite); 2656 $.get('/ajax_video_more.php',{type:'EP',limite:limite},function(data){ $(".more_videos_episodes").before(data); }); 2657 }); 2658 2659 2660 $("#panel_connexion").mouseenter(function(){ 2661 $("#panneau_deroule_connexion").show(); 2662 }).mouseleave(function(){ 2663 $("#panneau_deroule_connexion").hide(); 2664 }); 2665 2666 $("body").on("click",".image_load_video, .image_load_video_big",function(){ 2667 id = $(this).attr("id"); 2668 id = id.split("_"); 2669 vid = id[1]; 2670 big = 0; 2671 if(vid.indexOf('big')!=-1){ 2672 big = 1; 2673 }
2674 $.get('/ajax_video_load.php',{vid:vid,big:big},function(data){ $("#zone_video_"+vid).html(data); }); 2675 }); 2676 2677 //slidetimer = setInterval("slideshow();",6000); 2678 2679 if (navigator.appName=="Microsoft Internet Explorer"){ 2680 if(document.getElementById('div_graph')){ 2681 var div_graph = document.getElementById('div_graph'); 2682 var allscript = div_graph.getElementsByTagName('script'); 2683 for(var i=0;i<allscript.length;i++){ 2684 eval(allscript[i].text); 2685 } 2686 } 2687 } 2688 2689 $("#onglets").find(".tab-onglets").click(function(){ 2690 id = $(this).attr("id"); 2691 real_onglet = id.split("-"); 2692 real_onglet = real_onglet[2]; 2693 $(".tab-contenu").hide(); 2694 if((real_onglet=='notes')&&($("#tab-contenu-notes-sub").html()=='')){ 2695 $("#tab-contenu-notes").show(); 2696 $("#tab-contenu-notes-sub").html('<div style="text-align:center;"><br/><br/><img src="/images/ajax-loader.gif"/></div><br/>'); 2697 $("#tab-contenu-notes-sub").show(); 2698 $(".tab-onglets").removeClass("tab-active"); 2699 $(this).addClass("tab-active"); 2700 $.get('/ajax_member_notes.php',{id_user:$("#tab-onglets-user").val()},function(data){ 2701 $("#tab-contenu-notes-sub").html(data); 2702 }); 2703 drawChart(); 2704 }else if((real_onglet=='contributions')&&($("#tab-contenu-contributions").html()=='')){ 2705 $("#tab-contenu-contributions").show(); 2706 $("#tab-contenu-contributions").html('<div style="text-align:center;"><br/><br/><img src="/images/ajax-loader.gif"/></div><br/>'); 2707 $("#tab-contenu-contributions").show(); 2708 $(".tab-onglets").removeClass("tab-active"); 2709 $(this).addClass("tab-active"); 2710 $.get('/ajax_member_contrib.php',{id_user:$("#tab-onglets-user").val()},function(data){ 2711 $("#tab-contenu-contributions").html(data); 2712 }); 2713 }else{ 2714 $("#tab-contenu-"+real_onglet).show(); 2715 $(".tab-onglets").removeClass("tab-active"); 2716 $(this).addClass("tab-active"); 2717 } 2718 }); 2719 2720 if($("#site_mobile").css("display")=="none"){ 2721 if($("#onglets_raccourci").html()!=null){ 2722 var position_top_raccourci = $("#onglets_raccourci").offset().top; 2723 $(function(){ 2724 $(window).scroll(function () {//Au scroll dans la fenetre on déclenche la fonction 2725 if ($(this).scrollTop() > position_top_raccourci) { //si on a défilé de plus de 150px du haut vers le bas 2726 $("#onglets_raccourci").width($(".main_table").width()); 2727 $('#onglets_raccourci').addClass("fixNavigation"); //on ajoute la classe "fixNavigation" à <div id="navigation"> 2728 } else { 2729 $('#onglets_raccourci').removeClass("fixNavigation");//sinon on retire la classe "fixNavigation" à <div id="navigation"> 2730 } 2731 }); 2732 }); 2733 } 2734 } 2735 2736 $("#onglets_raccourci").find(".tab-onglets").click(function(){ 2737 id = $(this).attr("id"); 2738 real_onglet = id.split("-"); 2739 real_onglet = real_onglet[2]; 2740 2741 decalage = $("#raccourci_"+real_onglet).offset().top; 2742 var decalage_menu=0; 2743 if($("#site_mobile").css("display")!="none"){ 2744 decalage_menu = 55; 2745 } 2746 decalage = decalage-decalage_menu; 2747 $("html:not(:animated), body:not(:animated)").animate({scrollTop:decalage}, 1000); 2748 2749 $(".tab-onglets").removeClass("tab-active"); 2750 $(this).addClass("tab-active"); 2751 }); 2752 2753 $("body").on("click",".renseignement_container_p",function(e){ 2754 id = $(this).data("addserie"); 2755 $.get("/ajax_ajout_mes_series.php",{serie:id,etat:1,debute:1},function(data){ 2756 if(data!=''){ 2757 if(data=="-1"){ 2758 $("#bloc_header_login").trigger("click"); 2759 }else{ 2760 $(".renseignement_bloc_serie_"+id+" .renseignement_container_p").hide(); 2761 } 2762 } 2763 }); 2764 e.preventDefault(); 2765 }); 2766 2767 $("body").on("click","#check_recevoir_notif",function(){ 2768 if($(this).is(":checked")==true){ 2769 etat = 1 2770 }else{ 2771 etat = 0; 2772 } 2773 $.get('ajax_notification_mail_series.php',{etat:etat}); 2774 }); 2775 2776 $("body").on("click","#check_suspendre_notif",function(){ 2777 if($(this).is(":checked")==true){ 2778 etat = 1 2779 }else{ 2780 etat = 0; 2781 } 2782 $.get('ajax_notification_flux_maj_series.php',{etat:etat}); 2783 }); 2784 2785 $("body").on("click",".messeries_cacher_serie",function(){ 2786 id = $(this).attr("id"); 2787 id = id.split("_"); 2788 id = id[3]; 2789 if($(this).is(":checked")==true){ 2790 cacher = 1 2791 }else{ 2792 cacher = 0; 2793 }
2794 $.get('ajax_messeries_cacher_serie.php',{serie:id,cacher:cacher}); 2795 }); 2796 2797 //if(View.width>=1074){ 2798 $("#main").append('<div id="bloc_big_signal_erreur"><b>Vous souhaitez signaler une erreur, un problème, un bug ou un abus sur cette page ?</b><br/><br/><textarea id="erreur_signalee" rows="2" cols="30"></textarea><br/><div id="msg_confirmation_erreur_signalee"></div><br/><input type="button" onclick="envoyer_erreur();" value="Envoyer"/> <input type="button" value="Fermer" onclick="deroule_bloc_signal_erreur();"/><input type="hidden" id="type_signalement" value=""/><input type="hidden" id="link_signalement" value=""/></div>'); 2799 //} 2800 2801 /*if(View.width>=1280){ 2802 if($("#member_logged").val()==''){ 2803 if(document.location.href.indexOf('calendrier_des_series.html')==-1){ 2804 $("#main").append('<div id="bloc_rappel_inscription" class="bgbleu1" style="position:fixed;right:0;top:300px;-moz-border-bottom-left-radius: 10px; -webkit-border-bottom-left-radius: 10px; border-bottom-left-radius: 10px; -moz-border-top-left-radius: 10px; -webkit-border-top-left-radius: 10px; border-top-left-radius: 10px;text-align:center;width:126px;min-height:70px; color:#FFF; cursor:pointer; font-weight:bold;padding-top:10px;padding-bottom:10px;padding-left:2px;padding-right:2px;"><a style="color:#FFF;" href="/create_account.php?ref=slide_droite">Créez votre compte<br/>en 2 clics<br/>et profitez de<br/>toutes les<br/>fonctionnalités<br/>du site</a></div>'); 2805 } 2806 } 2807 }*/ 2808 2809 $("body").on("click",".signalement",function(){ 2810 id = $(this).attr("id"); 2811 id = id.split("_"); 2812 type = id[1]; 2813 link = id[2]; 2814 deroule_bloc_signal_erreur(); 2815 $("#type_signalement").val(type); 2816 $("#link_signalement").val(link); 2817 }); 2818 2819 $(".lien_add_resume_fin_serie").click(function(e){ 2820 id = $(this).attr("id"); 2821 id = id.split("_"); 2822 id = id[1]; 2823 2824 if($("#site_mobile").css("display")=="block"){ 2825 decalage_gauche = 0; 2826 marge_gauche = "1%"; 2827 taille_container = "auto"; 2828 decalage_top = "50"; 2829 }else{ 2830 decalage_gauche = ((View.width-530)/2); 2831 marge_gauche = "0"; 2832 taille_container = "550px"; 2833 decalage_top = "200"; 2834 } 2835 2836 $("#main").css("height",View.height+"px").css("background-color","#DDD").css("opacity","0.1"); 2837 $("body").append('<form name="form_resume_serie" method="post" action=""><div id="zone_ajout_resume_serie" style="text-align:center;z-index:1;padding:10px;left:'+decalage_gauche+'px;top:'+decalage_top+'px;margin-left:'+marge_gauche+';line-height:20px;position:fixed;width:'+taille_container+';height:210px;border:2px solid #CCC;background-color:#FFF;background-color:#EEE;">Mon résumé:<br/><textarea name="resume_serie" style="border:1px solid #DDD;background-color:#FFF;" cols="50" rows="9"></textarea><br/><input type="submit" value="Valider" style="border:1px solid #DDD;"> <input type="button" style="border:1px solid #DDD;" value="Annuler" onclick="annuler_add_resume_serie();"><input type="hidden" name="id_serie" value="'+id+'"><input type="hidden" name="submit_resume_fin_serie" value="1"/></div></form>'); 2838 return false; 2839 }); 2840 2841 $(".img_acteur").click(function(e){ 2842 id = $(this).attr("id"); 2843 id = id.split("_"); 2844 id = id[2]; 2845 $("#main").css("height",View.height+"px").css("background-color","#DDD").css("opacity","0.1"); 2846 2847 if($("#site_mobile").css("display")=="block"){ 2848 decalage_gauche = 0; 2849 marge_gauche = "1%"; 2850 taille_container = "auto"; 2851 decalage_top = "50"; 2852 }else{ 2853 decalage_gauche = ((View.width-530)/2); 2854 marge_gauche = "0"; 2855 taille_container = "550px"; 2856 decalage_top = 200; 2857 } 2858 2859 $("body").append('<form enctype="multipart/form-data" name="form_img_acteur" method="post" action=""><div id="zone_ajout_acteur" style="text-align:center;z-index:1;padding:10px;left:'+decalage_gauche+'px;top:'+decalage_top+'px;line-height:20px;position:fixed;width:'+taille_container+';height:auto;border:2px solid #CCC;background-color:#FFF;background-color:#EEE;">Attention veillez à ce que l\'image soit libre de droit (utilisée pour la promo d\'une série fera l\'affaire) et ait un format carré (un idéal de 100x100).<br>Charger ma photo : <input name="fichier_acteur" style="background-color:#FFF;" type="file"><INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="10000000"> <input type="submit" value="Valider" style="border:1px solid #DDD;"> <input type="button" style="border:1px solid #DDD;" value="Annuler" onclick="annuler_add_acteur();"><input type="hidden" name="id_acteur" value="'+id+'"></div></form>'); 2860 return false;
2861 }); 2862 2863 /*$('#table_comm img, .image_inview_load img, img.lazy_load').bind('inview', function(event, isInView, visiblePartX, visiblePartY) { 2864 image = $(this); 2865 alert('ici'); 2866 if(image.attr("rel")!=''){ 2867 if (isInView) { 2868 image.attr("src",image.attr("rel")); 2869 image.attr("rel",""); 2870 } 2871 } 2872 });*/ 2873 2874}); 2875 2876/*let lazyObserver; 2877 2878function initLazyLoad(container = document) { 2879 if (!lazyObserver) { 2880 lazyObserver = new IntersectionObserver((entries) => { 2881 entries.forEach(entry => { 2882 if (entry.isIntersecting) { 2883 const img = entry.target; 2884 const rel = img.getAttribute('rel'); 2885 if (rel) { 2886 img.setAttribute('src', rel); 2887 img.removeAttribute('rel'); 2888 lazyObserver.unobserve(img); 2889 } 2890 } 2891 }); 2892 }); 2893 } 2894 2895 const images = container.querySelectorAll('#table_comm img, .image_inview_load img, img.lazy_load'); 2896 images.forEach(img => lazyObserver.observe(img)); 2897}*/ 2898 2899document.addEventListener('DOMContentLoaded', () => initLazyLoad()); 2900 2901$('.select2').select2(); 2902 2903function preventScrollBody(mode){ 2904 if(mode=='on'){ 2905 /*$("html, body, #main").css("overflow-y","hidden"); 2906 view = get_size_view(); 2907 $("body").css("position","fixed").css("width",view.width);*/ 2908 $("html").addClass("no-scrolling"); 2909 }else{ 2910 /*$("html, body, #main").css("overflow-y","auto"); 2911 $("body").css("position","relative").css("width","100%");*/ 2912 $("html").removeClass("no-scrolling"); 2913 $("#search_keywords").blur(); 2914 } 2915} 2916 2917function close_form(){ 2918 $('#search_keywords').blur(); 2919 if($("#site_mobile").css("display")!="none"){ 2920 view = get_size_view(); 2921 var setTimeoutConst; 2922 setTimeoutConst = setTimeout(function() { 2923 $('#search_results').css("height",parseInt(view.height)-parseInt($("#search_keywords").offset().top)-86); 2924 clearTimeout(setTimeoutConst); 2925 }, 3000); 2926 } 2927} 2928 2929function close_search(){ 2930 $('#search_results').hide(); 2931 if($("#site_mobile").css("display")!="none"){ 2932 preventScrollBody('off'); 2933 } 2934} 2935 2936$.get("/ajax_mes_series.php",function(data){ 2937 if(data!=''){ 2938 series = data.split(","); 2939 series.forEach(function(i){ 2940 $(".renseignement_bloc_serie_"+i+" .renseignement_container_p").hide(); 2941 }); 2942 } 2943}); 2944 2945if($("#site_mobile").css("display")=="block"){ 2946 $(".bloc_mobile_update").each(function(){ 2947 $(".td_main_zone .box_big").after($(this)); 2948 $(this).find('.table_in_droite').toggle(); 2949 $(this).css("margin-bottom","10px"); 2950 }); 2951} 2952 2953var currentRequest = null; 2954 2955$('#remote_search #search_keywords').typeahead({ 2956 minLength: 1 2957},{ 2958 limit: 50, 2959 display: 'name', 2960 source: function (query, process, async) { 2961 var $this = this; 2962 currentRequest = $.ajax({ 2963 url:"/ajax_search.php", 2964 method: "GET", 2965 data: {q:query}, 2966 dataType: "json", 2967 cache: false, 2968 beforeSend: function() { 2969 if(currentRequest != null) { 2970 currentRequest.abort(); 2971 } 2972 }, 2973 success: function(data){ 2974 $("#search_results .search_results_bloc").html(""); 2975 return async(data); 2976 } 2977 }); 2978 return currentRequest; 2979 }, 2980 templates: { 2981 suggestion: function(item){ 2982 if(item.type=='serie'){ 2983 $("#search_series .search_results_bloc").append('<a class="search_container_result" title="'+item.name+'" href="'+item.url+'">'+(item.image_poster!='' ? '<div class="result_bloc_image"><img src="'+item.image_poster+'" style="display:inline-block;vertical-align:middle;"/></div>' : '')+'<span class="result_bloc_text"><span style="font-weight:bold;">'+item.name+'</span>'+(item.name_original!='' ? '<br/><span style="font-style:italic;">('+item.name_original+')</span>' : '')+'<br/><span style="font-size:.9em;color:#777;">'+item.nbSaisons+' saison'+(item.nbSaisons > 1 ? 's' : '')+' / '+(item.nbEpisodes>0 ? item.nbEpisodes : 'Aucun')+' épisode'+(item.nbEpisodes > 1 ? 's' : '')+'</span></span></a>'); 2984 }else if(item.type=='saison'){ 2985 $("#search_saisons .search_results_bloc").append('<a class="search_container_result" title="'+item.name+'" href="'+item.url+'">'+(item.image_poster!='' ? '<div class="result_bloc_image"><img src="'+item.image_poster+'" style="display:inline-block;vertical-align:middle;"/></div>
2985' : '')+'<span class="result_bloc_text"><span style="font-weight:bold;">'+item.name+'</span><span style="font-size:.9em;color:#777;">'+(item.date!='' ? '<br/>'+item.date : '')+'<br/>'+(item.nbEpisodes!=0 ? item.nbEpisodes : 'Aucun')+' épisode'+(item.nbEpisodes > 1 ? 's' : '')+'</span></span></a>'); 2986 }else if(item.type=='episode'){ 2987 $("#search_episodes .search_results_bloc").append('<a class="search_container_result" title="'+item.name+'" href="'+item.url+'">'+(item.image_poster!='' ? '<div class="result_bloc_image"><img src="'+item.image_poster+'" style="display:inline-block;vertical-align:middle;"/></div>' : '')+'<span class="result_bloc_text"><span style="font-weight:bold;">'+item.name+'</span><span style="font-size:.9em;color:#777;">'+(item.date!='' ? '<br/>Diffusé le '+item.date : '')+'<br/>'+(item.nb > 0 ? item.note+'/20 pour '+item.nb+' note'+(item.nb > 1 ? 's' : '') : '')+'</span></span></a>'); 2988 }else if(item.type=='acteur'){ 2989 $("#search_acteurs .search_results_bloc").append('<div style="text-align:center;"><a class="" title="'+item.name+'" href="'+item.url+'">'+(item.image!='' ? '<div class="result_bloc_image"><img src="'+item.image+'" style="display:inline-block;vertical-align:middle;"/></div>' : '')+'<span class="result_bloc_text"><span style="font-weight:bold;">'+item.name+'</span><br/>'+(item.series!='' ? '<span style="font-size:.9em;color:#777;">'+item.series+'</span>' : '')+'</span></a></div>'); 2990 }else{ 2991 $("#search_autres .search_results_bloc").append('<a class="search_container_result" href="'+item.url+'"><b>'+item.name+'</b></a>'); 2992 } 2993 } 2994 } 2995}).on('typeahead:open', function (e) { 2996 $("#search_results").show(); 2997 if(($("#search_series .search_results_bloc").html()=="")&&($("#search_saisons .search_results_bloc").html()=="")&&($("#search_autres .search_results_bloc").html()=="")&&($("#search_episodes .search_results_bloc").html()=="")&&($("#search_acteurs .search_results_bloc").html()=="")){ 2998 $("#search_results").hide(); 2999 }else{ 3000 if($("#site_mobile").css("display")!="none"){ 3001 preventScrollBody('on'); 3002 } 3003 } 3004}).on('typeahead:close', function (e) { 3005 $(document).on("click", function (e) { 3006 prevent_cc = 0; 3007 target = $(e.target); 3008 parents = target.parents('div'); 3009 parents.each(function(i){ 3010 if($(this).attr("id")=="remote_search"){ 3011 prevent_cc = 1; 3012 } 3013 }); 3014 if(prevent_cc==0){ 3015 $("#search_results").hide(); 3016 if($("#site_mobile").css("display")!="none"){ 3017 preventScrollBody('off'); 3018 } 3019 } 3020 }); 3021}).on('typeahead:asyncrequest', function (e) { 3022 $("#search_results .search_results_bloc").html(""); 3023 $("#search_series, #search_saisons, #search_episodes, #search_acteurs, #search_autres").hide(); 3024}).on('typeahead:asyncreceive', function (e) { 3025 $("#search_noresults").hide(); 3026 $("#search_results").show(); 3027 if($("#search_series .search_results_bloc").html()==""){ 3028 $("#search_series").hide(); 3029 }else{ 3030 $("#search_series").show(); 3031 } 3032 if($("#search_saisons .search_results_bloc").html()==""){ 3033 $("#search_saisons").hide(); 3034 }else{ 3035 $("#search_saisons").show(); 3036 } 3037 if($("#search_episodes .search_results_bloc").html()==""){ 3038 $("#search_episodes").hide(); 3039 }else{ 3040 $("#search_episodes").show(); 3041 } 3042 if($("#search_acteurs .search_results_bloc").html()==""){ 3043 $("#search_acteurs").hide(); 3044 }else{ 3045 $("#search_acteurs").show(); 3046 } 3047 if($("#search_autres .search_results_bloc").html()==""){ 3048 $("#search_autres").hide(); 3049 }else{ 3050 $("#search_autres").show(); 3051 } 3052 if(($("#search_series .search_results_bloc").html()=="")&&($("#search_saisons .search_results_bloc").html()=="")&&($("#search_autres .search_results_bloc").html()=="")&&($("#search_episodes .search_results_bloc").html()=="")&&($("#search_acteurs .search_results_bloc").html()=="")){ 3053 $("#search_noresults").show(); 3054 }else{ 3055 if($("#site_mobile").css("display")!="none"){ 3056 preventScrollBody('on'); 3057 } 3058 } 3059}); 3060 3061$("#search_results").on("click", "a", function(e){ 3062 recherche = $('#search_keywords').typeahead('val'); 3063 ga('send', 'pageview', 'rechercher.html?mot_recherche='+recherche+'&ref=moteur'); 3064}); 3065 3066$("#remote_search #search_keywords").on("focus",function(e){ 3067 $(".impactify-in").remove(); 3068}); 3069 3070$(document).ready(function(){ 3071$('body').on("keyup","#onglet_messeries_rech_messeries",function(e){ 3072 load_mes_series(1,''); 3073}); 3074}); 3075 3076$('#remote_search #search_keywords').on("keyup",function(e){ 3077 if($(this).val().length<3){
3078 if((e.keyCode==8)||(e.keyCode==46)){ 3079 $("#search_results").hide(); 3080 if($("#site_mobile").css("display")!="none"){ 3081 preventScrollBody('off'); 3082 } 3083 } 3084 } 3085}); 3086 3087function tris(){ 3088 genre = $("#tri_genre option:selected").val(); 3089 pays = $("#tri_pays option:selected").val(); 3090 annee = $("#tri_annee option:selected").val(); 3091 $.get('ajax_tris_series.php',{genre:genre,pays:pays,annee:annee},function(data){ $("#form_tri_body").html(data); $("#form_tri_body .select2").select2(); }); 3092 $("#tri_select_genre").val(genre); 3093 $("#tri_select_pays").val(pays); 3094 $("#tri_select_annee").val(annee); 3095} 3096$("body").on("click","#submit_tris",function(){ 3097 $("#form_tris").submit(); 3098}); 3099 3100 3101const container = $('#items-container'); 3102const sentinel = document.getElementById('scroll-sentinel'); 3103 3104let offset = 0; 3105let loading = false; 3106let hasMore = true; 3107 3108// Récupère les filtres depuis l'URL de la page actuelle (ex: page.html?categorie=jeux&tri=recent) 3109const pageParams = new URLSearchParams(window.location.search); 3110 3111function buildQueryString() { 3112 const params = new URLSearchParams(); 3113 3114 if(typeof pageFilters !== 'undefined'){ 3115 for (const [key, value] of Object.entries(pageFilters)) { 3116 if (value !== null && value !== '') { 3117 params.set(key, value); 3118 } 3119 } 3120 } 3121 3122 params.set('offset', offset); 3123 return params.toString(); 3124} 3125 3126async function loadMore() { 3127 if (loading || !hasMore) return; 3128 loading = true; 3129 showLoader(true); 3130 3131 try { 3132 const res = await fetch(`ajax_load_more.php?${buildQueryString()}`); 3133 if (!res.ok) throw new Error('Erreur réseau'); 3134 3135 const html = await res.text(); 3136 const $newItems = $(html); // convertit le HTML reçu en objet jQuery 3137 3138 container.append($newItems); // insertion (équivalent jQuery de insertAdjacentHTML) 3139 3140 initLazyLoad(); // réapplique le lazy load uniquement sur les nouveaux éléments 3141 3142 hasMore = res.headers.get('X-Has-More') === '1'; 3143 offset += 50; 3144 3145 if (!hasMore) observer.disconnect(); 3146 } catch (err) { 3147 console.error('Erreur de chargement :', err); 3148 } finally { 3149 loading = false; 3150 showLoader(false); 3151 } 3152} 3153 3154function showLoader(state) { 3155 if(document.getElementById('loader')) document.getElementById('loader').style.display = state ? 'flex' : 'none'; 3156} 3157 3158const observer = new IntersectionObserver(entries => { 3159 if (entries[0].isIntersecting) { 3160 loadMore(); 3161 } 3162}, { rootMargin: '200px' }); 3163 3164if (sentinel) observer.observe(sentinel); 3165 3166// Chargement initial 3167$(document).ready(function(){ 3168 loadMore(); 3169 3170 if($("#site_mobile").css("display")=="none"){ 3171 if(document.querySelector('#header_full_barre')) { 3172 window.headRoom = new Headroom(document.querySelector('#header_full_barre'), { 3173 offset: 60, 3174 classes: { 3175 // when element is initialised 3176 initial: "header", 3177 // when scrolling up 3178 pinned: ($("#site_mobile").css("display") != "none") ? "pinned" : "shrink", 3179 // when scrolling down 3180 unpinned: "unpinned", 3181 // when above offset 3182 top: "header-at-top", 3183 // when below offset 3184 notTop: "header-not-at-top", 3185 // when at bottom of scoll area 3186 bottom: "header-at-bottom", 3187 // when not at bottom of scroll area 3188 notBottom: "header-not-at-bottom" 3189 }, 3190 onPin: function () { 3191 if ($("#site_mobile").css("display") === "none" && $(window).scrollTop() > 0 && $(this.elem).hasClass('header-not-at-top') && !$('#colonne_gauche').hasClass('cd-filter-horiz')) { 3192 //$('#colonne_gauche').css('margin-top', '90px'); 3193 } 3194 }, 3195 onUnpin: function () { 3196 if ($("#site_mobile").css("display") != "none") { 3197 $(this.elem).addClass('shrink'); 3198 } 3199 else { 3200 $(this.elem).removeClass('shrink'); 3201 } 3202 }, 3203 onTop: function () { 3204 $(this.elem).removeClass('shrink'); 3205 $("#flux").css("position","absolute").css("top","auto"); 3206 $(".bloc_connexion_create_account_container").css("margin-top","130px"); 3207 $("#bloc_connexion_create_account").css("position","absolute").css("top","auto"); 3208 }, 3209 onNotTop: function(){ 3210 if($('#site_mobile').css('display') !== "none" && $('#menu_horizontal_actifs_developpe').hasClass('show')) 3211 { 3212 $(this.elem).removeClass('header-not-at-top'); 3213 } 3214 $("#flux").css("position","fixed").css("top","64px"); 3215 $(".bloc_connexion_create_account_container").css("margin-top","64px"); 3216 $("#bloc_connexion_create_account").css("position","fixed").css("top","0"); 3217 } 3218 }); 3219 window.headRoom.init(); 3220 3221 $("#header_full_barre").hover(function () { 3222 $(this).addClass('active') 3223 }, function () { 3224 $(this).removeClass('active') 3225 }); 3226 $("#header_full_barre").click(function () { 3227 $(this).addClass('active') 3228 }); 3229 } 3230 } 3231 3232 $("#container_prospect").height($("#main").height()); 3233 3234 if($("#site_mobile").css("display")=="block"){ 3235 $(".menu_developpe_lien_full").each(function(){ 3236 $("#ul_menu_horiz").append('<li class="menu_entete_intitule"><a class="menu_haut_a" href="'+$(this).attr("href")+'">'+$(this).html()+'</a></li>'); 3237 }); 3238 } 3239 3240 $("body").on("click","#rechercher_reco",function(e){ 3241 $("#bloc_recommandation_trouvees").html('<div style="text-align:center;"><br/><br/><img width="200" src="/images/ajax-loader2.gif"/></div><br/>'); 3242 $.ajax({ 3243 url:'/recommandations.php', 3244 //async:false, 3245 method:'POST', 3246 data:{valider:1,sexe:$("#recomm_sexe").val(),genres:$("#recomm_genres").val(),pays:$("#recomm_pays").val(),dates:$("#recomm_dates").val()}, 3247 success(data){ 3248 $("#bloc_recommandation_trouvees").html(data); 3249 } 3250 }); 3251 return false;
3252 }); 3253 3254 if($("#site_mobile").css("display")!="none"){ 3255 $("#saison_liste_episodes tr").click(function(){ 3256 document.location.href = $(this).find(".lien_saison").attr("href"); 3257 }); 3258 } 3259 3260 var hash = window.location.href.split('#')[1]; 3261 if(hash!=null){ 3262 decalage = $("#jour_"+hash).offset().top; 3263 $("body").animate({scrollTop:decalage}, 1000); 3264 } 3265 3266 refresh_svg(); 3267});
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.