Amélioration des scripts AJAX et des styles
Ajout de la fonctionnalité "changement d'options" pour la clockAdvanced
This commit is contained in:
@@ -11,7 +11,7 @@ function cbfunc2(o){
|
||||
|
||||
{
|
||||
|
||||
$('#uncompletedList').append('<li id="'+o[i].id+'">'+o[i].content+' - '+o[i].date_string+' <img src="images/interface/delete.png" class="deleteTask" id="delete-'+o[i].id+'"/> <img src="images/interface/complete.png" class="completeTask" id="complete-'+o[i].id+'"/> </li>');
|
||||
$('#uncompletedList').append('<li id="'+o[i].id+'">'+o[i].content+' - '+o[i].date_string+' <img src="images/interface/delete.png" class="deleteTask" id="delete-'+o[i].id+'"/> <img src="images/interface/complete.png" class="completeTask" id="complete-'+o[i].id+'"/> </li>');
|
||||
|
||||
}
|
||||
|
||||
@@ -52,5 +52,5 @@ $(document).ready(function(){
$('#todoList').resizable();
$('#todoList').dragg
|
||||
|
||||
$('#newTaskFieldset').toggle();
|
||||
|
||||
});
|
||||
});
|
||||
|
@@ -22,14 +22,20 @@ function make_draggable(elements)
|
||||
}
|
||||
|
||||
//affichage des blogs
|
||||
$('body').append('<div id="blogs"></div>');
|
||||
$("#blogs").html("<img src=\"images/interface/ajax_load.gif\"/> Loading Blogs...");
|
||||
var tmp;
|
||||
|
||||
/* A helper function for converting a set of elements to draggables: */
|
||||
make_draggable($('#blogs'));
|
||||
|
||||
$.get("blogs.php", function(data){
|
||||
$("#blogs").html(data);
|
||||
});
|
||||
$.ajax(
|
||||
{url : "blogs.php",
|
||||
timeout : 36000,
|
||||
error: function(data){
|
||||
$("#blogs").html('<img src="images/interface/error.png"/> Délai dépassé !');
|
||||
},
|
||||
success:function(data){
|
||||
$("#blogs").html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@@ -209,4 +209,29 @@
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
$(document).ready(function(){
|
||||
$('body').append('<a href="#jca" id="jclockAdvanced-menu"><img src="images/interface/clock_edit.png" /></a><div style="display:none;"><div id="jca"></div></div>');
|
||||
$('#menu-bar').prepend($('#jclockAdvanced-menu'));
|
||||
$('#jca').append('<h3>Options</h3><br/><label for="fontFamily">Font Family : </label><input type="text" id="fontFamily" name="fontFamily"/><br/><label for="fontSize">Font Size : </label><input type="text" id="fontSize" name="fontSize"/><br/><label for="format">Format : </label><input type="text" id="format" name="format"/><br/><label for="color">Color : </label><input type="text" id="color" name="color"/><span id="jca-submit" class="green-button">Enregistrer</span>');
|
||||
$('#jclockAdvanced-menu').fancybox({
|
||||
'zoomSpeedIn' : 600,
|
||||
'zoomSpeedOut' : 500,
|
||||
'easingIn' : 'easeOutBack',
|
||||
'easingOut' : 'easeInBack',
|
||||
'hideOnContentClick': false,
|
||||
'padding' : 15
|
||||
});
|
||||
$('#jca-submit').live('click', function(){
|
||||
var fontFamily = $('#fontFamily').val();
|
||||
var fontSize = $('#fontSize').val();
|
||||
var format = $('#format').val();
|
||||
var color = $('#color').val();
|
||||
if(fontFamily != '' && fontSize != '' && format != '' && color != ''){
|
||||
$.get('ajax/update.php', {id:'clockAdvanced', fontFamily: fontFamily, fontSize:fontSize, format:format, color:color}, function(msg){
|
||||
location.reload();
|
||||
});
|
||||
}else{
|
||||
$('#jca').append('<span class="error">Fields can\'t be empty.</span>');
|
||||
}
|
||||
});
|
||||
});
|
@@ -13,12 +13,8 @@ $(document).ready(function(){
|
||||
$('#city-submit').live('click', function(){
|
||||
var ville = $('#cityChoice').val();
|
||||
if(ville != '' || ville != null){
|
||||
$.get('ajax/update-city.php', {city: ville}, function(msg){
|
||||
if(msg=='ok'){
|
||||
$.get('ajax/update.php', {id:'weather', city: ville}, function(msg){
|
||||
location.reload();
|
||||
}else{
|
||||
$('#city').append('<span class="error">An error occured while changing city.</span>');
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('#city').append('<span class="error">City can\'t be empty.</span>');
|
||||
@@ -41,11 +37,12 @@ function make_draggable(elements)
|
||||
stop:function(e,ui){
|
||||
|
||||
/* Sending the z-index and positon of the note to update_position.php via AJAX GET: */
|
||||
$.get('ajax/update_position_config.php',{
|
||||
$.get('ajax/update.php',{
|
||||
x : ui.position.left,
|
||||
y : ui.position.top,
|
||||
id : ui.helper.attr('id')
|
||||
});
|
||||
}
|
||||
});}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user