Change <? to <?php and add some formatting

This commit is contained in:
2016-11-17 22:16:26 +01:00
parent 2d5ba7fb8d
commit fb71f8c112
27 changed files with 270 additions and 296 deletions
+1 -6
View File
@@ -1,6 +1 @@
<?header('Content-type: application/javascript');
$token = $_GET['token'];
?>
function cbfunc(o){ ␍ $('body').append('<div id="results"><h2>Select your project</h2></div>');␍ $('#results').append('<ul id="uncompletedList"><ul>');␍ for(var i in o)␍ {␍ $('#uncompletedList').append('<li id="'+o[i].id+'" class="selectableProject">'+o[i].name+'</li>');␍ }␍}␍
$(document).ready(function(){␍ var token = "<?=$token?>";␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/getProjects?token='+token+'&format=json&callback=cbfunc';␍ document.getElementsByTagName('head')[0].appendChild(script); ␍␍ $('.selectableProject').live('click', function(){␍ var name = $(this).text();␍ var id = $(this).attr('id');␍ $.post('../ajax/saveTodoist.php', {name: name, id: id}, function(msg){ ␍ $('body').append('<a href="index.php">Etape suivante</a>');␍ if(msg=="ok"){␍ location.reload();␍ }else{␍ alert(msg);␍ }␍ }); ␍ });
});
<?header('Content-type: application/javascript');$token = $_GET['token'];␍␍?>␍␍function cbfunc(o){ ␍ $('body').append('<div id="results"><h2>Select your project</h2></div>');␍ $('#results').append('<ul id="uncompletedList"><ul>');␍ for(var i in o)␍ {␍ $('#uncompletedList').append('<li id="'+o[i].id+'" class="selectableProject">'+o[i].name+'</li>');␍ }␍}␍␍$(document).ready(function(){␍ var token = "<?php echo $token; ?>";␍ var script = document.createElement('script');␍ script.type = 'text/javascript';␍ script.src = 'https://todoist.com/API/getProjects?token='+token+'&format=json&callback=cbfunc';␍ document.getElementsByTagName('head')[0].appendChild(script); ␍␍ $('.selectableProject').live('click', function(){␍ var name = $(this).text();␍ var id = $(this).attr('id');␍ $.post('../ajax/saveTodoist.php', {name: name, id: id}, function(msg){ ␍ $('body').append('<a href="index.php">Etape suivante</a>');␍ if(msg=="ok"){␍ location.reload();␍ }else{␍ alert(msg);␍ }␍ }); ␍ });␍});