Projet les Halles |
| “L'actualité des travaux de réaménagement du Forum des Halles” |
|
|
|
Denis curates this topic from blogs, tweets, videos and much more: find out how!
|
// <![CDATA[
// <![CDATA[
jQuery(document).ready(function(){
var mail = getCookie("scoopemail");
var name = getCookie("scoopname");
showHideMailRegistrationDivs({"status":"cancel"});
jQuery("#inputemail").val(mail);
jQuery("#inputname").val(name);
// Put the name and email into the comments form
if (name != "") {
jQuery(".yourComment form :input[name=name]").each(function() {
jQuery(this).val(name);
});
}
if (mail != "") {
jQuery(".yourComment form :input[name=email]").each(function() {
jQuery(this).val(mail);
});
}
// Any Post to paste ?
// Any post to show fullscreen ?
});
function resizeOverlays() {
jQuery(".onePost").each(function() {
jQuery(".overlayForCuttingPost", $(this)).css({
width : $(this).outerWidth(),
height : $(this).outerHeight()
});
});
}
/**
* Hide / Show the divs about email registration (subscribe, unsubscribe)
*/
function showHideMailRegistrationDivs(data) {
var status = data["status"];
if (status == "register") {
// Show the cancel div
jQuery("#mail_register").hide();
jQuery("#mail_cancel").show();
if (jQuery("#mailinput").is(":visible")) {
jQuery("#mailinput").hide();
}
} else {
jQuery("#mail_cancel").hide();
jQuery("#mail_register").show();
}
}
function getCookie(c_name)
{
if (document.cookie.length>0) {
var c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1) {
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
var val = unescape(document.cookie.substring(c_start,c_end));
return val.replace(/['"]/g , '');
}
}
return "";
}
function emailRegistration(action) {
var auth = getCookie("auth");
var params = {};
if (auth == null || auth.length == 0) {
if (action == "cancel" || (jQuery("#popup").length > 0 && jQuery("#popup").is(':visible'))) {
var mail = jQuery("#inputemail").val();
var name = jQuery("#inputname").val();
var url = "/t/projet-les-halles/exportByMail";
params = {"view" : "json", "method" : "mail", "action": action, "email": mail, "name": name};
} else {
jQuery("#allPage").popup({
dom: jQuery("#mailinput")[0],
hideOnClick: false,
showAnimation: false
});
// Nothing to do, show popup
return;
}
} else {
var url = "/t/projet-les-halles/exportByMail";
params = {"view": "json", "method" : "mail", "action" : action };
}
jQuery.post(url, params, function(data) {
data = data.response;
var errors = data.errors;
if (errors) {
// Has errors
if (errors.email) {
jQuery("#errorsEmail").html(errors.email);
jQuery("#errorsEmail").show();
}
if (errors.name) {
jQuery("#errorsName").html(errors.name);
jQuery("#errorsName").show();
}
} else {
// Hide all
jQuery("#allPage").closePopup();
jQuery("#errors*").hide();
showHideMailRegistrationDivs(data);
}
});
}
/**
* Called when the modal edition is completed.
* Must refresh the edited post.
* Close the modal.
* Show the tutorial (overlay on the share button)
*/
function onModalCompleted(postLid, hasChanged, showOverlayOnShare) {
if (hasChanged) {
// Refresh the edited post wich is the first one.
gjAjax.getRequest("/post/get/ajax?view=topic&postLid=" + postLid + "&action=blinkReplace&id=post_" + postLid, null, function(data) {
// Close the modal
jQuery.modal.close();
});
} else {
// Close the modal
jQuery.modal.close();
}
}
function updateReactions(postLid, postExternalUrl, scoopReactions) {
var totalReactions = scoopReactions;
getFacebookReactions(postExternalUrl, function(facebookReactions) {
// update facebook field
jQuery("#" + postLid + "_reactions_facebook").text(facebookReactions);
// Compute total reactions
totalReactions += facebookReactions;
getTwitterReactions(postExternalUrl, function(twitterReactions) {
// Update twitter field
jQuery("#" + postLid + "_reactions_twitter").text(twitterReactions);
// Compute total reactions
totalReactions += twitterReactions;
jQuery('#r_' + postLid).empty();
// One or many reaction-s ?
var s = "";
if (totalReactions > 1) {
s = translate('{0} reactions', [totalReactions]);
} else {
s = translate('{0} reaction', [totalReactions])
}
jQuery('#r_' + postLid).each(function() {
jQuery(this).text(s);
});
});
});
}
function thank(postLid, thankPostUrl, postExternalUrl, scoopReactions) {
jQuery.getJSON(thankPostUrl, function(data) {
if (data.response.thanked) {
jQuery('#thank_' + postLid).remove();
var spanOfThanksCount = jQuery("#"+postLid+"_reactions_thanks");
spanOfThanksCount.text(parseInt(spanOfThanksCount.text(),10)+1);
changeReactionsCounter(postLid, 1);
}
});
}
function changeReactionsCounter(postLid, increment) {
var spanOfReactionsCount = jQuery('#r_' + postLid);
var reactionsText = spanOfReactionsCount.text();
var nbReactions = parseInt(reactionsText.substr(0, reactionsText.indexOf(" ")), 10) + increment;
var s = "";
if (nbReactions > 1) {
s = translate('{0} reactions', [nbReactions]);
} else {
s = translate('{0} reaction', [nbReactions])
}
spanOfReactionsCount.text(s);
}
// ]]>
// ]]>
|
projetleshalles – Today, 11:18 AM Depuis une semaine, nous avons réalisé une opération de publicité sauvage en collant des flashcodes (codes 2D) dans les jardins des Halles, sur les palissades et sur le forum des Halles (Des flashcodes aux Halles, notre nouvel édito : http://is.gd/H97SFn)
// <







0 reaction
0

Laisser un commentaire