12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873 |
-
-
-
- var myMessages = ['info','warning','error','success'];
-
- function hideAllMessages()
- {
- var messagesHeights = new Array();
-
- for (i=0; i<myMessages.length; i++)
- {
- messagesHeights[i] = $('.' + myMessages[i]).outerHeight();
- $('.' + myMessages[i]).css('top', -messagesHeights[i]);
- }
- }
-
- $(document).ready(function(){
-
-
- hideAllMessages();
-
- $('.message').animate({top:"0"}, 500);
-
-
- $('.message a.message-close').click(function(){
- $('.message').hide();
- return false;
- });
-
- });
-
- function findKeyWithValue(arrayt, value)
- {
- for(i in arrayt)
- {
- if (arrayt[i] == value)
- {
- return i;
- }
- }
- return "";
- }
-
- function array_key_exists (key, search) {
-
-
-
-
-
-
- if (!search || (search.constructor !== Array && search.constructor !== Object)) {
- return false;
- }
-
- return key in search;
- }
-
-
- function json_to_array(json_string)
- {
- if (json_string.length)
- {
- return eval("(" + json_string + ")");
- }
- return new Array();
- }
-
- function strpos (haystack, needle, offset) {
-
-
-
-
-
-
-
-
- var i = (haystack + '').indexOf(needle, (offset || 0));
- return i === -1 ? false : i;
- }
-
-
- function array2json(arr) {
- var parts = [];
- var is_list = (Object.prototype.toString.apply(arr) === '[object Array]');
-
- for(var key in arr) {
- var value = arr[key];
- if(typeof value == "object") {
- if(is_list) parts.push(array2json(value));
- else parts[key] = array2json(value);
- } else {
- var str = "";
- if(!is_list) str = '"' + key + '":';
-
-
- if(typeof value == "number") str += value;
- else if(value === false) str += 'false';
- else if(value === true) str += 'true';
- else str += '"' + value + '"';
-
-
- parts.push(str);
- }
- }
- var json = parts.join(",");
-
- if(is_list) return '[' + json + ']';
- return '{' + json + '}';
- }
-
- function isInteger(s) {
- return (s.toString().search(/^-?[0-9]+$/) == 0);
- }
-
- function inArray(array, p_val) {
- var l = array.length;
- for(var i = 0; i < l; i++) {
- if(array[i] == p_val) {
- return true;
- }
- }
- return false;
- }
-
- if(typeof(String.prototype.trim) === "undefined")
- {
- String.prototype.trim = function()
- {
- return String(this).replace(/^\s+|\s+$/g, '');
- };
- }
-
- function str_replace (search, replace, subject, count) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- j = 0,
- temp = '',
- repl = '',
- sl = 0, fl = 0,
- f = [].concat(search),
- r = [].concat(replace),
- s = subject,
- ra = Object.prototype.toString.call(r) === '[object Array]', sa = Object.prototype.toString.call(s) === '[object Array]';
- s = [].concat(s);
- if (count) {
- this.window[count] = 0;
- }
- for (i = 0, sl = s.length; i < sl; i++) {
- if (s[i] === '') {
- continue;
- }for (j = 0, fl = f.length; j < fl; j++) {
- temp = s[i] + '';
- repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];
- s[i] = (temp).split(f[j]).join(repl);
- if (count && s[i] !== temp) {this.window[count] += (temp.length - s[i].length) / f[j].length;
- }
- }
- }
- return sa ? s : s[0];
- }
-
- function explode (delimiter, string, limit) {
-
-
-
-
-
-
-
-
-
-
-
- var emptyArray = {0: ''
- };
-
-
- if (arguments.length < 2 || typeof arguments[0] == 'undefined' || typeof arguments[1] == 'undefined') {return null;
- }
-
- if (delimiter === '' || delimiter === false || delimiter === null) {
- return false;}
-
- if (typeof delimiter == 'function' || typeof delimiter == 'object' || typeof string == 'function' || typeof string == 'object') {
- return emptyArray;
- }
- if (delimiter === true) {
- delimiter = '1';
- }
- if (!limit) {
- return string.toString().split(delimiter.toString());
- }
-
- var splitted = string.toString().split(delimiter.toString());var partA = splitted.splice(0, limit - 1);
- var partB = splitted.join(delimiter.toString());
- partA.push(partB);
- return partA;
- }
-
-
- function remove_tags(form_name)
- {
-
-
-
-
- }
-
- function JQueryJson(url, data, callback_success)
- {
- $.ajax({
- type: 'POST',
- url: url,
- dataType: 'json',
- data: data,
- success: function(response)
- {
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- callback_success(response);
- }
- });
- }
-
- $(document).ready(function(){
-
-
- function onBlur() {
- document.body.className = 'blurred';
- }
-
- function onFocus(){
- document.body.className = 'focused';
- do_action_body_focused();
- }
-
- if (false) {
- document.onfocusin = onFocus;
- document.onfocusout = onBlur;
- } else {
- window.onfocus = onFocus;
- window.onblur = onBlur;
- }
-
-
-
- $('#tabs_tag_search_no_tags, a.filter_clear_url').live("click", function(){
- $('img.elements_more_loader').show();
- $('ul.elements').html('');
-
-
- if ($(this).hasClass('filter_clear_url'))
- {
- $('ul#tabs_tag_search_buttons').find('li').removeClass('selected');
- $('li#tab_li_tag_search_no_tags').addClass('selected');
- $('input#element_search_form_tag_strict').attr('checked', false);
- }
- else
- {
- $(this).parents('ul#tabs_tag_search_buttons').find('li').removeClass('selected');
- $(this).parent('li').addClass('selected');
- }
-
- if ($('div.top_tools:visible').length)
- {
- $('div.top_tools').slideUp();
- }
-
-
- window.search_tag_prompt_connector.initializeTags([]);
- $('div.no_elements').hide();
-
- var form = $('form[name="search"]');
-
- form.submit();
- });
-
-
- $('#tabs_tag_search_with_tags').live("click", function(){
-
- $('img.elements_more_loader').show();
- $('ul.elements').html('');
- $(this).parents('ul#tabs_tag_search_buttons').find('li').removeClass('selected');
- $(this).parent('li').addClass('selected');
-
- if ($('div.top_tools:visible').length == 0)
- {
- $('div.top_tools').slideDown();
- }
-
- var form = $('form[name="search"]');
-
- $.getJSON(url_get_favorites_tags, function(response) {
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- var tags = [];
- for (i in response.tags)
- {
- var tag = new Tag(i, response.tags[i]);
- tags.push(tag);
- }
-
- window.search_tag_prompt_connector.initializeTags(tags);
- form.submit();
- });
- });
-
-
- $('ul.element_tags li a.element_tag').live('click', function(){
-
- var id;
-
- if ($('ul#favorite_tags').length)
- {
- id = str_replace('element_tag_', '', $(this).attr('id'));
- var link = $('a#filtering_tag_'+id);
- list_tag_clicked(link, true);
- }
-
- if ($('form[name="search"]').length)
- {
- if ($('li#tab_li_tag_search_no_tags').hasClass('selected'))
- {
- $('ul#tabs_tag_search_buttons').find('li').removeClass('selected');
- $('li#tab_li_tag_search_with_tags').addClass('selected');
- if (!$('div.top_tools:visible').length)
- {
- $('div.top_tools').slideDown();
- }
- }
-
-
- $('img.elements_more_loader').show();
- $('ul.elements').html('');
-
- var form = $('form[name="search"]');
- id = str_replace('element_tag_', '', $(this).attr('id'));
- var tag = new Tag(id, $(this).text());
-
- window.search_tag_prompt_connector.initializeTags([tag]);
-
- form.submit();
-
- }
-
- $('html, body').animate({ scrollTop: 0 }, 'fast');
- return false;
- });
-
- function element_last_opened(li)
- {
- $('li.element').removeClass('shadows');
- li.addClass('shadows');
- }
-
-
-
-
- $('a.element_embed_open_link, a.element_name_embed_open_link').live("click", function(){
-
- var li = $(this).parents('li.element');
-
- element_last_opened(li);
- li.find('a.element_embed_close_link').show();
- li.find('a.element_embed_open_link_text').hide();
- li.find('div.element_embed').show();
-
- if ((player = window.dynamic_player.play(
- li.find('div.element_embed'),
- li.data('type'),
- li.data('refid'),
- li.data('elementid'),
- false
- )))
- {
- window.players_manager.add(player, li.attr('id'));
- }
-
- return false;
- });
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $('a.element_embed_close_link').live("click", function(){
-
- var li = $(this).parents('li.element');
-
- li.removeClass('shadows');
- li.find('div.element_embed').hide();
- li.find('a.element_embed_open_link_text').show();
- $(this).hide();
-
- var player = window.players_manager.get(li.attr('id'));
- if (player)
- {
- player.close();
- }
- else
- {
-
- }
-
- return false;
- });
-
-
- $('li.element a.a_thumbnail, li.element img.open, li.element img.play').live({
- mouseenter:
- function()
- {
- var td = $(this).parent('td');
- var a = td.find('a.a_thumbnail');
- if (a.hasClass('embed'))
- {
- td.find('img.play').show();
- }
- else
- {
- td.find('img.open').show();
- }
- },
- mouseleave:
- function()
- {
- var td = $(this).parent('td');
- var a = td.find('a.a_thumbnail');
- if (a.hasClass('embed'))
- {
- td.find('img.play').hide();
- }
- else
- {
- td.find('img.open').hide();
- }
- }
- }
- );
-
-
- $('a.favorite_link').live("click", function(){
- var link = $(this);
-
-
- var img = link.find('img');
- if (!link.hasClass('loading'))
- {
- if (img.attr('src') == '/img/icon_star_2.png')
- {
- img.attr('src', '/img/icon_star_2_red.png');
- }
- else
- {
- img.attr('src', '/img/icon_star_2.png');
- }
- }
-
- link.addClass('loading');
-
- $.getJSON($(this).attr('href'), function(response) {
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- var img = link.find('img');
- link.attr('href', response.link_new_url);
- img.attr('src', response.img_new_src);
- img.attr('title', response.img_new_title);
- link.removeClass('loading');
- });
- return false;
- });
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var last_id = null;
- $('a.elements_more').click(function(){
-
- $('img.elements_more_loader').show();
-
- if (!$(this).hasClass('event_view'))
- {
- var link = $(this);
- var last_element = $('ul.elements li.element:last');
- var id_last = str_replace('element_', '', last_element.attr('id'));
-
- var url = link.attr('href')+'/'+id_last;
-
- if ($('div#results_search_form').length)
- {
- url = link.attr('href')+id_last+'/'+$('div#results_search_form form input[type="text"]').val();
- }
-
- var old_form_action = $('form[name="search"]').attr('action');
- $('form[name="search"]').attr('action', url);
-
- var data = $('form[name="search"]').serialize();
- var type = 'POST';
- }
- else
- {
- var link = $(this);
- var url = $(this).attr('href');
- var data = {};
- var type = 'GET';
- }
-
- $.ajax({
- type: type,
- url: url,
- data: data,
- success: function(response) {
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.count)
- {
- $('ul.elements').append(response.html);
- $('img.elements_more_loader').hide();
- recolorize_element_list();
-
- if (link.hasClass('event_view'))
- {
- link.attr('href', response.data.more_link_href);
- }
- }
-
- if (response.end || response.count < 1)
- {
- $('img.elements_more_loader').hide();
- $('ul.elements').after('<div class="no_elements"><p class="no-elements">'+
- response.message+'</p></div>');
- link.hide();
- }
- },
- dataType: "json"
- });
-
- if (!$(this).hasClass('event_view'))
- {
- $('form[name="search"]').attr('action', old_form_action);
- }
- return false;
- });
-
- tag_box_input_value = $('ul.tagbox input[type="text"]').val();
-
-
- $('form[name="search"] input[type="submit"]').click(function(){
- $('ul.elements').html('');
- $('div.no_elements').hide();
- $('img.elements_more_loader').show();
- });
-
- $('form[name="search"]').ajaxForm(function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- $('ul.elements').html(response.html);
-
- if (response.count)
- {
- $('img.elements_more_loader').hide();
- $('span.elements_more').show();
- $('a.elements_more').show();
- }
-
- if (response.count < 1)
- {
- $('img.elements_more_loader').hide();
- $('ul.elements').after('<div class="no_elements"><p class="no-elements">'+
- response.message+'</p></div>');
- $('a.elements_more').hide()
- ;
- }
-
- $('ul.tagbox input[type="text"]').val($('ul.tagbox input[type="text"]').val());
-
- });
-
-
- $('a.element_remove_link').jConfirmAction({
- question : string_element_delete_confirm_sentence,
- yesAnswer : string_element_delete_confirm_yes,
- cancelAnswer : string_element_delete_confirm_no,
- onYes: function(link){
-
- var li = link.parents('li.element');
- li.find('img.element_loader').show();
- $.getJSON(link.attr('href'), function(response){
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- li.remove();
- }
- else
- {
- li.find('img.element_loader').hide();
- }
- });
-
- return false;
- },
- onOpen: function(link){
- var li = link.parents('li.element');
- li.find('a.element_edit_link').addClass('mustBeDisplayed');
- li.find('a.element_remove_link').addClass('mustBeDisplayed');
- },
- onClose: function(link){
- var li = link.parents('li.element');
- li.find('a.element_edit_link').removeClass('mustBeDisplayed');
- li.find('a.element_remove_link').removeClass('mustBeDisplayed');
- li.find('a.element_edit_link').hide();
- li.find('a.element_remove_link').hide();
- }
-
-
- });
-
-
- $('a.element_remove_from_group_link').jConfirmAction({
- question : string_removefromgroup_sentence,
- yesAnswer : string_removefromgroup_confirm_yes,
- cancelAnswer : string_removefromgroup_confirm_no,
- onYes: function(link){
-
- var li = link.parents('li.element');
- li.find('img.element_loader').show();
- $.getJSON(link.attr('href'), function(response){
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- li.remove();
- }
- else
- {
- li.find('img.element_loader').hide();
- }
- });
-
- return false;
- }
- });
-
- var elements_edited = new Array();
-
- $('a.element_edit_link').live('click', function(){
-
- var link = $(this);
- var li = link.parents('li.element');
- li.addClass('selected');
-
- elements_edited[li.attr('id')] = li.html();
- var div_loader = li.find('div.loader');
- li.html(div_loader);
- li.find('img.element_loader').show();
-
- $.getJSON($(this).attr('href'), function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
-
- li.html(response.html);
-
-
-
- var options = new Array();
- options.form_name = response.form_name;
- options.tag_init = response.tags;
-
- ajax_query_timestamp = null;
-
-
-
-
- $('form[name="'+response.form_name+'"] input[type="submit"]').live('click', function(){
- var li = $(this).parents('li.element');
- li.prepend(div_loader);
- li.find('img.element_loader').show();
- });
- $('form[name="'+response.form_name+'"]').ajaxForm(function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- var li = $('li#'+response.dom_id);
-
- if (response.status == 'success')
- {
- li.html(response.html);
- li.removeClass('selected');
- delete(elements_edited[li.attr('id')]);
- }
- else if (response.status == 'error')
- {
- li.find('img.element_loader').hide();
- li.find('ul.error_list').remove();
- var ul_errors = $('<ul>').addClass('error_list');
-
- for (i in response.errors)
- {
- ul_errors.append($('<li>').append(response.errors[i]));
- }
-
- li.prepend(ul_errors);
- }
- });
-
- });
- return false;
- });
-
-
- $('form.edit_element input.cancel_edit').live('click', function(){
- var li = $(this).parents('li.element');
- li.removeClass('selected');
- li.html(elements_edited[li.attr('id')]);
- delete(elements_edited[li.attr('id')]);
- });
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $('a.group_remove_link').jConfirmAction({
- question : "Supprimer ce groupe ?",
- yesAnswer : "Oui",
- cancelAnswer : "Non",
- onYes: function(link){
- window.location = link.attr('href');
- return false;
- },
- onOpen: function(){},
- onClose: function(){}
- });
-
-
- $('a.all_network, a.my_network').live('click', function(){
-
- if ($('form[name="search"]').length)
- {
- $(this).parent('li').parent('ul').find('li').removeClass('selected')
-
- if ($(this).hasClass('all_network'))
- {
- $(this).parent('li').addClass('selected');
- $('#element_search_form_network').val('network_public');
- }
- else
- {
- $(this).parent('li').addClass('selected');
- $('#element_search_form_network').val('network_personal');
- }
-
- $('form[name="search"] input[type="submit"]').trigger('click');
-
- return false;
- }
- return true;
- });
-
- function element_add_proceed_json_response(response)
- {
- if (response.status == 'success')
- {
- $('form[name="add"]').find('ul.error_list').remove();
- $('ul.elements').prepend(response.html);
- $('form[name="add"] input[type="text"]').val('');
-
- if ($('form[name="search"]').length)
- {
- if ($('a#tabs_tag_search_with_tags').parent('li').hasClass('selected'))
- {
- $('div.top_tools').slideDown();
- }
- }
- remove_tags('add');
- recolorize_element_list();
-
- $('div#element_add_box').slideUp();
-
- if (response.groups.length)
- {
-
- $('div#added_element_to_group').slideDown();
- for (i in response.groups)
- {
- var group = response.groups[i];
- $('ul#groups_to_add_element').html('');
- $('ul#groups_to_add_element')
- .append($('<li>')
- .append($('<a>')
- .addClass('added_element_add_to_group')
- .attr('href', group.url)
- .append(group.name)
- )
- )
- ;
- }
- }
- else
- {
- $('a#element_add_link').show();
- $('a#element_add_close_link').hide();
- }
-
- form_add_hide_errors();
-
- return true;
- }
- else if (response.status == 'error')
- {
- form_add_display_errors(response.errors);
- $('#form_add_loader').hide();
- return false;
- }
-
- return false;
- }
-
- function form_add_hide_errors()
- {
- $('form[name="add"]').find('ul.error_list').remove();
- }
-
-
- function form_add_display_errors(errors)
- {
- $('form[name="add"]').find('ul.error_list').remove();
- var ul_errors = $('<ul>').addClass('error_list');
-
- for (i in errors)
- {
- ul_errors.append($('<li>').append(errors[i]));
- }
-
- $('form[name="add"]').prepend(ul_errors);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- function element_add_proceed_data_apis(response)
- {
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
-
- $('img#form_add_loader').hide();
-
-
-
- if (response.name)
- {
- $('input#element_add_name').val(response.name);
- }
-
-
- $('div#form_add_thumb img').attr('src', '/bundles/muzichcore/img/nothumb.png');
- if (response.thumb)
- {
- $('div#form_add_thumb img').attr('src', response.thumb);
- }
-
-
- if (response.tags)
- {
- $('ul#form_add_prop_tags li').remove();
- $('ul#form_add_prop_tags_api').show();
- $('p#form_add_prop_tags_text').hide();
-
- if (response.tags.length)
- {
- $('p#form_add_prop_tags_text').show();
- }
-
- $('ul#form_add_prop_tags_api li').remove();
- for (tags_index = 0; tags_index < response.tags.length; tags_index++)
- {
- var tag = response.tags[tags_index];
- var tag_id = '';
- var tag_name = tag.original_name;
-
- if (tag.like_found)
- {
- tag_id = tag.like.id;
- tag_name = tag.like.name;
- }
-
-
- $('ul#form_add_prop_tags_api').append(
- '<li>'+
- '<a href="#'+tag_id+'" class="form_add_prop_tag">'+
- tag_name+
- '</a>'+
- '</li>'
- );
- }
- }
-
- return true;
- }
- else if (response.status == 'error')
- {
- return false;
- }
-
- return true;
- }
-
-
-
-
- $('a.form_add_prop_tag').live('click', function(){
-
- var form_name = "add";
- var tag_id = str_replace('#', '', $(this).attr('href'));
-
-
- if (tag_id)
- {
- var tag = new Tag(tag_id, $(this).text());
- window.add_tag_prompt_connector.addTagToTagPrompt(tag);
- }
- else
- {
- window.add_tag_prompt_connector.openTagSubmission($(this).text());
- }
-
-
- $('input.form-default-value-processed').val('');
-
- });
-
-
- $('form[name="add"] input[type="submit"]').live('click', function(){
- $('form[name="add"]').find('img.tag_loader').show();
- });
- $('form[name="add"]').ajaxForm(function(response) {
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- $('form[name="add"] img.tag_loader').hide();
-
-
-
- if ($('input#form_add_step').val() == '1')
- {
- if (element_add_proceed_data_apis(response))
- {
-
- $('div#form_add_second_part').slideDown();
- $('div#form_add_first_part').slideUp();
- form_add_hide_errors();
- $('#form_add_loader').hide();
- $('input#form_add_step').val('2');
-
-
- if (!$('input#add_element_group_page').length)
- {
- $('form[name="add"]').attr('action', url_element_add);
- }
- else
- {
- $('form[name="add"]').attr('action', url_element_add+'/'+$('input#add_element_group_page').val());
- }
- $('span#add_url_title_url').html($('input#element_add_url').val());
-
- window.add_tag_prompt_connector.initializeTags([]);
- $('input#element_add_need_tags').attr('checked', false);
- }
- else
- {
- form_add_display_errors(response.errors);
- $('#form_add_loader').hide();
- }
- }
- else if ($('input#form_add_step').val() == '2')
- {
- if (element_add_proceed_json_response(response))
- {
- form_add_reinit();
- }
- }
-
-
- return false;
- });
-
-
- function form_add_reinit()
- {
- $('div#element_add_box').slideUp();
- $('div#form_add_first_part').show();
- $('div#form_add_second_part').hide();
- $('ul#form_add_prop_tags_api').hide();
- $('ul#form_add_prop_tags_text').hide();
- $('input#element_add_url').val('');
- $('input#element_add_name').val('');
- $('input#form_add_step').val(1);
- $('form[name="add"]').attr('action', url_datas_api);
- }
-
-
- var tags_ids_for_filter = new Array();
-
- function refresh_elements_with_tags_selected(link)
- {
-
-
-
- $('ul.elements').html('');
- $('div.no_elements').hide();
- $('img.elements_more_loader').show();
- $.getJSON($('input#get_elements_url').val()+'/'+array2json(tags_ids_for_filter), function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- $('ul.elements').html(response.html);
-
- if (response.count)
- {
- $('img.elements_more_loader').hide();
- $('span.elements_more').show();
- $('a.elements_more').show();
- }
- });
-
- return false;
- }
-
- function list_tag_clicked(link, erease)
- {
- if (erease)
- {
- $('ul#favorite_tags a.tag').removeClass('active');
- }
-
-
- if (link.hasClass('active'))
- {
- link.removeClass('active');
- }
- else
- {
- link.addClass('active');
- }
-
-
- tags_ids_for_filter = new Array();
- $('ul#favorite_tags a.tag.active').each(function(index){
- var id = str_replace('filtering_tag_', '', $(this).attr('id'));
- tags_ids_for_filter[id] = id;
- });
-
-
- var a_more = $('a.elements_more');
- a_more.attr('href', $('input#more_elements_url').val()+'/'+array2json(tags_ids_for_filter));
-
-
-
-
-
-
-
-
-
-
-
- return check_timelaps_and_find_with_tags(link, new Date().getTime(), false);
- }
-
- $('ul#favorite_tags a.tag').click(function(){
- list_tag_clicked($(this));
- return false;
- });
-
- last_keypress = 0;
- function check_timelaps_and_find_with_tags(link, time_id, timed)
- {
- if (!timed)
- {
-
-
- last_keypress = new Date().getTime();
- var this_time_id = last_keypress;
- }
- else
- {
-
- var this_time_id = time_id;
- }
-
-
- if (time_id != last_keypress && timed)
- {
-
- }
- else
- {
-
- if ((new Date().getTime() - last_keypress) < 800 || timed == false)
- {
-
-
-
- setTimeout(function(){check_timelaps_and_find_with_tags(link, this_time_id, true)}, 900);
- }
- else
- {
-
- return refresh_elements_with_tags_selected(link);
- }
- }
-
- return null;
- }
-
-
-
-
- var do_check_new_elements = false;
-
- function check_new_elements()
- {
- if ($('ul.elements li').length)
- {
-
- if ($('body.blurred').length)
- {
-
-
- do_check_new_elements = true;
- }
- else
- {
- var url = url_element_new_count
- +'/'
- +str_replace('element_', '', $('ul.elements li:first').attr('id'))
- ;
-
- $.ajax({
- type: 'POST',
- url: url,
- data: $('form[name="search"]').serialize(),
- success: function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success' && response.count)
- {
- $('div.display_more_elements').show();
- $('div.display_more_elements span').html(response.message);
- }
-
- setTimeout(check_new_elements, 150000);
- },
- dataType: "json"
- });
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- do_check_new_elements = false;
- }
-
- }
- }
-
- if ($('div.display_more_elements').length)
- {
- setTimeout(check_new_elements, 150000);
- }
-
- $('a.show_new_elements').live('click', function(){
- var url = url_element_new_get
- +'/'
- +str_replace('element_', '', $('ul.elements li:first').attr('id'))
- ;
- $('img.elements_new_loader').show();
-
-
- $.ajax({
- type: 'POST',
- url: url,
- data: $('form[name="search"]').serialize(),
- success: function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- if (response.count)
- {
- $('div.display_more_elements').show();
- $('div.display_more_elements span').html(response.message);
- }
- else
- {
- $('div.display_more_elements').hide();
- }
-
- $('ul.elements').prepend(response.html);
- recolorize_element_list();
- }
-
- $('img.elements_new_loader').hide();
- },
- dataType: "json"
- });
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- });
-
- function recolorize_element_list()
- {
- $('ul.elements li.element').each(function(index){
- if ((index & 1) == 1)
- {
- $(this).removeClass('even');
- $(this).removeClass('odd');
- $(this).addClass('odd');
- }
- else
- {
- $(this).removeClass('odd');
- $(this).removeClass('even');
- $(this).addClass('even');
- }
- });
- }
-
-
-
- function do_action_body_focused()
- {
- if (do_check_new_elements)
- {
- check_new_elements();
- }
- }
-
-
-
-
-
- $('td.element_content a.display_comments').live('click', function(){
- display_comments($(this).parents('li.element'));
- });
-
- $('td.element_content a.hide_comments').live('click', function(){
- hide_comments($(this).parents('li.element'));
- });
-
- function display_comments(li_element)
- {
- li_element.find('div.comments').slideDown();
- li_element.find('a.display_comments').hide();
- li_element.find('a.hide_comments').show();
- }
-
- function hide_comments(li_element)
- {
- li_element.find('div.comments').slideUp();
- li_element.find('a.display_comments').show();
- li_element.find('a.hide_comments').hide();
- }
-
-
- $('li.element a.add_comment').live('click', function(){
- display_add_comment($(this).parents('li.element'));
- });
-
- $('form.add_comment input[type="submit"]').live('click', function(){
- $(this).parents('div.comments').find('img.comments_loader').show();
- });
-
- function display_add_comment(li_element)
- {
- display_comments(li_element);
- li_element.find('a.add_comment').hide();
- li_element.find('form.add_comment').show();
-
- li_element.find('form.add_comment').ajaxForm(function(response) {
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- li_element.find('img.comments_loader').hide();
-
- if (response.status == 'success')
- {
- li_element.find('form.add_comment').find('ul.error_list').remove();
- li_element.find('div.comments ul.comments').append(response.html);
- hide_add_comment(li_element);
- }
- else if (response.status == 'error')
- {
- li_element.find('form.add_comment').find('ul.error_list').remove();
- var ul_errors = $('<ul>').addClass('error_list');
-
- for (i in response.errors)
- {
- ul_errors.append($('<li>').append(response.errors[i]));
- }
-
- li_element.find('form.add_comment').prepend(ul_errors);
- }
-
- return false;
- });
-
- }
-
- $('form.add_comment input.cancel').live('click', function(){
- var li_element = $(this).parents('li.element');
- hide_add_comment(li_element);
- });
-
- function hide_add_comment(li_element)
- {
- li_element.find('a.add_comment').show();
- li_element.find('form.add_comment').hide();
- li_element.find('form.add_comment textarea').val('');
- }
-
-
-
- $('ul.comments li.comment').live({
- mouseenter:
- function()
- {
- $(this).find('a.comment_edit_link').show();
- $(this).find('a.comment_remove_link').show();
- },
- mouseleave:
- function()
- {
- if (!$(this).find('a.comment_edit_link').hasClass('mustBeDisplayed'))
- {
- $(this).find('a.comment_edit_link').hide();
- }
- if (!$(this).find('a.comment_remove_link').hasClass('mustBeDisplayed'))
- {
- $(this).find('a.comment_remove_link').hide();
- }
- }
- }
- );
-
-
- $('a.comment_remove_link').jConfirmAction({
- question : string_comment_delete_confirm_sentence,
- yesAnswer : string_comment_delete_confirm_yes,
- cancelAnswer : string_comment_delete_confirm_no,
- onYes: function(link){
-
- var li = link.parents('li.comment');
- li.find('img.comment_loader').show();
-
- $.getJSON(link.attr('href'), function(response){
-
- li.find('img.comment_loader').hide();
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- li.remove();
- }
- });
-
- return false;
- },
- onOpen: function(link){
- var li = link.parents('li.comment');
- li.find('a.comment_edit_link').addClass('mustBeDisplayed');
- li.find('a.comment_remove_link').addClass('mustBeDisplayed');
- },
- onClose: function(link){
- var li = link.parents('li.comment');
- li.find('a.comment_edit_link').removeClass('mustBeDisplayed');
- li.find('a.comment_remove_link').removeClass('mustBeDisplayed');
- li.find('a.comment_edit_link').hide();
- li.find('a.comment_remove_link').hide();
- }
- });
-
- var comments_edited = new Array();
-
-
-
- $('a.comment_edit_link').live('click', function(){
-
- var link = $(this);
- var li = link.parents('li.comment');
-
- comments_edited[li.attr('id')] = li.html();
- var loader = li.find('img.comment_loader');
- li.html(loader);
- li.find('img.comment_loader').show();
-
- $.getJSON($(this).attr('href'), function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- li.html(response.html);
-
- $('li#'+li.attr('id')+' form.edit_comment input[type="submit"]').live('click', function(){
- var li_current = $(this).parents('li.comment');
- li_current.prepend(loader);
- li_current.find('img.comment_loader').show();
- });
-
- li.find('form.edit_comment').ajaxForm(function(response){
-
- li = $('li#'+response.dom_id);
- li.find('img.comment_loader').hide();
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- li.html(response.html);
- delete(comments_edited[li.attr('id')]);
- }
- else if (response.status == 'error')
- {
- li.find('ul.error_list').remove();
- var ul_errors = $('<ul>').addClass('error_list');
-
- for (i in response.errors)
- {
- ul_errors.append($('<li>').append(response.errors[i]));
- }
-
- li.prepend(ul_errors);
- }
- });
-
- });
- return false;
- });
-
-
- $('form.edit_comment input.cancel').live('click', function(){
- var li = $(this).parents('li.comment');
- li.html(comments_edited[li.attr('id')]);
- delete(comments_edited[li.attr('id')]);
- });
-
-
-
-
- $('li.element_tag').live({
- mouseenter:
- function()
- {
- $(this).find('a.tag_to_favorites').show();
- $(this).find('a.element_tag').addClass('element_tag_large_for_fav');
- },
- mouseleave:
- function()
- {
- if (!$(this).find('a.tag_to_favorites').hasClass('mustBeDisplayed'))
- {
- $(this).find('a.tag_to_favorites').hide();
- $(this).find('a.element_tag').removeClass('element_tag_large_for_fav');
- }
- }
- }
- );
-
- $('a.tag_to_favorites').jConfirmAction({
- question : string_tag_addtofav_confirm_sentence,
- yesAnswer : string_tag_addtofav_confirm_yes,
- cancelAnswer : string_tag_addtofav_confirm_no,
- onYes: function(link){
-
- $.getJSON(link.attr('href'), function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
- });
-
- $('div.question').fadeOut();
- return false;
- },
- onOpen: function(link){
- var li = link.parents('li.element_tag');
- li.find('a.tag_to_favorites').addClass('mustBeDisplayed');
- },
- onClose: function(link){
- var li = link.parents('li.element_tag');
- li.find('a.tag_to_favorites').removeClass('mustBeDisplayed');
- li.find('a.element_tag').removeClass('element_tag_large_for_fav');
- li.find('a.tag_to_favorites').hide();
- }
- });
-
-
-
-
- $('a.added_element_add_to_group').live('click', function(){
-
- var loader = $('div#added_element_to_group').find('img.loader');
- loader.show();
-
- $.getJSON($(this).attr('href'), function(response) {
-
- loader.hide();
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- $('li#'+response.dom_id).html(response.html);
- }
-
- $('div#added_element_to_group').slideUp();
- $('a#element_add_link').show();
- $('a#element_add_close_link').hide();
-
- });
- return false;
- });
-
- $('div#added_element_to_group a.cancel').live('click', function(){
- $('div#added_element_to_group').slideUp();
- $('a#element_add_link').show();
- $('a#element_add_close_link').show();
- return false;
- });
-
-
-
-
- $('a.element_report').jConfirmAction({
- question : string_elementreport_confirm_sentence,
- yesAnswer : string_elementreport_confirm_yes,
- cancelAnswer : string_elementreport_confirm_no,
- onYes: function(link){
-
- $.getJSON(link.attr('href'), function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
- });
-
- $('div.question').fadeOut();
- return false;
- },
- onOpen: function(link){
-
- },
- onClose: function(link){
-
- }
- });
-
-
-
-
- $('li.element a.vote').live('click', function(){
-
- var img = $(this).find('img');
- var link = $(this);
- img.attr('src', url_img_ajax_loader);
-
- $.getJSON(link.attr('href'), function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- link.attr('href', response.data.a.href);
- img.attr('src', response.data.img.src);
- link.parents('ul.element_thumb_actions').find('li.score').text(response.data.element.points);
- }
-
- });
-
- return false;
- });
-
-
-
- $('div.more_filters a.new_comments, div.more_filters a.new_favorites, div.more_filters a.new_tags').live('click', function(){
-
- $('img.elements_more_loader').show();
- $('ul.elements').html('');
- var link = $(this);
-
- $.getJSON(link.attr('href'), function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- $('form[name="search"]').submit();
- $('div.more_filters a.new_comments').hide();
- $('div.more_filters a.new_favorites').hide();
- $('div.more_filters a.new_tags').hide();
- }
-
- });
-
- return false;
- });
-
-
-
-
-
- $('a.element_propose_tags').live('click', function(){
-
- var link = $(this);
- var li = link.parents('li.element');
-
- li.find('img.element_loader').show();
-
- $.getJSON($(this).attr('href'), function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- li.find('img.element_loader').hide();
-
- if (response.status == 'success')
- {
-
-
- var table = li.find('table:first');
- li.find('div.tag_proposition').remove();
- table.after(response.html);
-
-
-
-
- var options = new Array();
- options.form_name = response.form_name;
- options.tag_init = response.tags;
-
- ajax_query_timestamp = null;
-
-
-
-
- $('form[name="'+response.form_name+'"] input[type="submit"]').live('click', function(){
- li = $(this).parents('li.element');
- li.find('img.element_loader').show();
- });
- $('form[name="'+response.form_name+'"]').ajaxForm(function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- li = $('li#'+response.dom_id);
- li.find('img.element_loader').hide();
- li.find('form')
- li.find('div.tag_proposition').remove();
- }
- else if (response.status == 'error')
- {
- li.find('img.element_loader').hide();
- li.find('ul.error_list').remove();
- var ul_errors = $('<ul>').addClass('error_list');
-
- for (i in response.errors)
- {
- ul_errors.append($('<li>').append(response.errors[i]));
- }
-
- li.find('div.tag_proposition div.tags_prompt').prepend(ul_errors);
- }
-
- });
-
- }
- });
- return false;
- });
-
-
- $('div.tag_proposition input.cancel').live('click', function(){
- $(this).parents('div.tag_proposition').slideUp();
- });
-
-
- $('a.element_view_propositions_link').live('click', function(){
-
- var link = $(this);
- li = link.parents('li.element');
-
- li.find('img.element_loader').show();
-
- $.getJSON($(this).attr('href'), function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- li.find('img.element_loader').hide();
-
- if (response.status == 'success')
- {
- var table = li.find('table:first');
- li.find('div.tags_proposition_view').remove();
- table.after(response.html);
- }
- });
-
- return false;
- });
-
- $('a.accept_tag_propotision').live('click', function(){
-
- var link = $(this);
- var li = link.parents('li.element');
-
- li.find('img.element_loader').show();
-
- $.getJSON($(this).attr('href'), function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- li.find('img.element_loader').hide();
-
- if (response.status == 'success')
- {
- li.html(response.html);
- }
- });
-
- return false;
- });
-
-
- $('a.refuse_tag_propositions').live('click', function(){
-
- var link = $(this);
- var li = link.parents('li.element');
-
- li.find('img.element_loader').show();
-
- $.getJSON($(this).attr('href'), function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- li.find('img.element_loader').hide();
-
- if (response.status == 'success')
- {
- li.find('div.tags_proposition_view').remove();
- }
- });
-
- return false;
- });
-
-
-
-
-
-
-
- $('a.comment_report').jConfirmAction({
- question : string_commentreport_confirm_sentence,
- yesAnswer : string_commentreport_confirm_yes,
- cancelAnswer : string_commentreport_confirm_no,
- onYes: function(link){
-
- $.getJSON(link.attr('href'), function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
- });
-
- $('div.question').fadeOut();
- return false;
- },
- onOpen: function(link){
-
- },
- onClose: function(link){
-
- }
- });
-
-
-
-
-
- $('a.element_reshare').jConfirmAction({
- question : string_elementreshare_confirm_sentence,
- yesAnswer : string_elementreshare_confirm_yes,
- cancelAnswer : string_elementreshare_confirm_no,
- onYes: function(link){
-
- $('div.question').fadeOut();
- $.getJSON(link.attr('href'), function(response){
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
-
-
-
- if ($('form[name="add"]').length)
- {
- element_add_proceed_json_response(response);
- }
- return false;
- });
-
-
-
- return false;
- },
- onOpen: function(link){
-
- },
- onClose: function(link){
-
- }
- });
-
-
-
-
- $('a#display_all_cloud_tag').click(function(){
- $('ul#favorite_tags li').show();
- $(this).hide();
- });
-
- $('input#cloud_tags_filter').keyup(function(){
- var search_string = $(this).val();
-
- $('ul#favorite_tags li a').removeClass('highlight');
-
- if (search_string.length > 1)
- {
- $('ul#favorite_tags li a').each(function(){
-
- if ($(this).text().toUpperCase().search(search_string.toUpperCase()) != -1)
- {
- $(this).addClass('highlight')
- }
-
- });
- }
-
- });
-
-
- $('div.seachboxcontainer a.global_search_link').click(function(){
- $(this).parents('div.seachboxcontainer').find('form').submit();
- });
-
-
- $('ul.secondarymenu a.top_menu_link').click(function(){
-
- if ($(this).parents('li.top_menu_element').hasClass('close'))
- {
- $(this).parents('li.top_menu_element').find('ul.submenu').hide();
- $(this).parents('li.top_menu_element').removeClass('close');
- $(this).parents('li.top_menu_element').addClass('open');
- $(this).parents('li.top_menu_element').find('ul.submenu').slideDown();
- }
- else
- {
- $(this).parents('li.top_menu_element').removeClass('open');
- $(this).parents('li.top_menu_element').addClass('close');
- }
-
- return false;
- });
-
- $('div#secondarymenu ul.submenu').each(function(){
- if ($(this).find('li').length > 7)
- {
- $(this).css('overflow', 'auto');
- $(this).css('height', '283px');
- }
- });
-
-
- $('div#myaccount h2').click(function(){
- $('div#myaccount div.myaccount_part:visible').slideUp();
- $('div#'+$(this).data('open')).slideDown();
- });
-
-
- var selected_language = $('div#languages a.selected');
- $('div#languages').prepend(selected_language);
-
-
- if ($.browser.msie)
- {
- if ($.browser.version < 10)
- {
- $('[placeholder]').each(function(){
- $(this).addClass('placeholder');
- $(this).val($(this).attr('placeholder'));
- });
-
- $('[placeholder]').focus(function() {
- var input = $(this);
- if (input.val() == input.attr('placeholder')) {
- input.val('');
- input.removeClass('placeholder');
- }
- }).blur(function() {
- var input = $(this);
- if (input.val() == '' || input.val() == input.attr('placeholder')) {
- input.addClass('placeholder');
- input.val(input.attr('placeholder'));
- }
- }).blur().parents('form').submit(function() {
- $(this).find('[placeholder]').each(function() {
- var input = $(this);
- if (input.val() == input.attr('placeholder')) {
- input.val('');
- }
- })
- });
- }
- }
-
- });
-
-
-
-
-
- function open_popin_dialog(object_id)
- {
-
-
- $('body').append($('<div>').attr('id', 'fade'));
-
- $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn();
-
- $('#'+object_id).css({
- position: 'absolute',
- left: ($(window).width()
- - $('#'+object_id).width())/2,
-
-
- top: '10%'
- });
- $('#'+object_id).show();
- }
-
-
- $(document).ready(function(){
-
- $('#group_add_link').click(function(){
- $('#group_add_box').slideDown("slow");
- $('#group_add_link').hide();
- $('#group_add_close_link').show();
- return false;
- });
-
-
- $('#group_add_close_link').click(function(){
- $('#group_add_box').slideUp("slow");
- $('#group_add_link').show();
- $(this).hide();
- return false;
- });
- });
-
- $(document).ready(function(){
-
-
- $('#element_add_link').click(function(){
- $('#element_add_box').slideDown("slow");
- $('#element_add_link').hide();
- $('#element_add_close_link').show();
- if ($('a#tabs_tag_search_with_tags').parent('li').hasClass('selected'))
- {
- $('div.top_tools').slideUp();
- }
-
- $('input#form_add_step').val('1');
- $('form[name="add"]').attr('action', url_datas_api);
- return false;
- });
-
-
- $('#element_add_close_link').click(function(){
- $('#element_add_box').slideUp("slow");
- $('#element_add_link').show();
- $('#element_add_close_link').hide();
-
- if ($('a#tabs_tag_search_with_tags').parent('li').hasClass('selected'))
- {
- $('div.top_tools').slideDown();
- }
-
-
-
- $('div#element_add_box').slideUp();
- $('div#form_add_first_part').show();
- $('div#form_add_second_part').hide();
- $('ul#form_add_prop_tags').hide();
- $('ul#form_add_prop_tags_text').hide();
- $('input#element_add_url').val('');
- $('input#element_add_name').val('');
- $('form[name="add"]').attr('action', url_datas_api);
-
- return false;
- });
-
-
- $('div.show_options a.following').live({
- mouseenter:
- function()
- {
- $(this).html(string_follow_stop);
- },
- mouseleave:
- function()
- {
- $(this).html(string_follow_following);
- }
- }
- );
-
- $('div.show_options a.follow_link').live('click', function(){
- link = $(this);
- $.getJSON(link.attr('href'), function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- if (response.following)
- {
- link.html(string_follow_following);
- link.removeClass('notfollowing');
- link.addClass('following');
- }
- else
- {
- link.html(string_follow_follow);
- link.addClass('notfollowing');
- link.removeClass('following');
- }
- }
- });
- return false;
- });
-
- });
-
- $(document).ready(function(){
-
- $('#registration_link').click(function(){
- $('#registration_box').slideDown("slow");
- $('#login_box').slideUp("slow");
- $(this).hide();
- $('#login_link').show();
- return false;
- });
-
- $('#login_link').click(function(){
- $('#login_box').slideDown("slow");
- $('#registration_box').slideUp("slow");
- $('#registration_link').show();
- $(this).hide();
- return false;
- });
-
-
- });
-
- $(document).ready(function(){
-
- $('ul#moderate_tags li.tag a.accept, ul#moderate_tags li.tag a.refuse').click(function(){
- var link = $(this);
- $.getJSON($(this).attr('href'), function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- link.parent('li').remove();
- }
-
- if (response.status == 'error')
- {
- alert(response.message);
- }
-
- });
-
- return false;
- });
-
-
- $('ul#moderate_tags li.tag a.replace').click(function(){
- var link = $(this);
-
- var newtag = link.parent('li').find('input.tagBox_tags_ids').val();
-
- $.getJSON($(this).attr('href')+'/'+newtag, function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'error')
- {
- alert(response.message);
- }
-
- if (response.status == 'success')
- {
- link.parent('li').remove();
- }
-
- });
-
- return false;
- });
-
- $('ul#moderate_elements li.element div.controls a.delete').live('click', function(){
- var li = $(this).parent('div.controls').parent('li.element');
- $.getJSON($(this).attr('href'), function(response) {
- if (response.status == 'success')
- {
- li.slideUp(500, function(){li.remove();});
- }
- else
- {
- alert(response.status);
- }
- });
- return false;
- });
-
- $('ul#moderate_elements li.element div.controls a.clean').live('click', function(){
- var li = $(this).parent('div.controls').parent('li.element');
- $.getJSON($(this).attr('href'), function(response) {
- if (response.status == 'success')
- {
- li.slideUp(500, function(){li.remove();});
- }
- else
- {
- alert(response.status);
- }
- });
- return false;
- });
-
- $('ul#moderate_comments li.comment a.accept, ul#moderate_comments li.comment a.refuse').click(function(){
- var link = $(this);
- $.getJSON($(this).attr('href'), function(response) {
-
- if (response.status == 'mustbeconnected')
- {
- $(location).attr('href', url_index);
- }
-
- if (response.status == 'success')
- {
- link.parent('li').remove();
- }
-
- if (response.status == 'error')
- {
- alert(response.message);
- }
-
- });
-
- return false;
- });
-
- });
-
-
-
- $(document).ready(function(){
-
- $('form#address_update input[type="submit"]').click(function(){
- $('form#address_update img.loader').show();
- });
-
- $('form#address_update').ajaxForm(function(response){
-
- $('form#address_update img.loader').hide();
- form = $('form#address_update');
-
- form.find('ul.error_list').remove();
- if (response.status == 'error')
- {
- ul_errors = $('<ul>').addClass('error_list');
-
- for (i in response.errors)
- {
- ul_errors.append($('<li>').append(response.errors[i]));
- }
-
- form.prepend(ul_errors);
- }
-
- });
-
- });
|