JS document.ready shorthand

This commit is contained in:
Michael RICOIS 2016-09-22 14:18:55 +02:00
parent 39a3940463
commit b012fa258c
42 changed files with 46 additions and 54 deletions

View File

@ -11,7 +11,7 @@ p { margin:10px 0;}
div#content { float:none; width:auto;}
</style>
<script>
$(document).ready(function(){
$(function(){
$('input[type=checkbox][name=accept]').click(function(e){
$('form[name=cgu]').css('display', 'none');
$('#msgsave').css('display', 'block');

View File

@ -163,7 +163,7 @@ foreach ($this->listModulesFcc as $id => $module) {
</div>
<script>
$(document).ready(function(){
$(function(){
$('#listeModulesD').click(function(){
var position = $(this).position();
$('#listeModules').css('top', position.top);

View File

@ -7,7 +7,7 @@ fieldset legend { font-weight:bold; font-size: 108%; padding:0; }
div.submit { clear: both; text-align: center; }
</style>
<script type="text/javascript">
$(document).ready(function(){
$(function(){
$('.menu-close').click(function(){
$('div.blockh2').css('display','none');

View File

@ -27,7 +27,7 @@ function checkProgress() {
});
}
$(document).ready(function() {
$(function() {
$('#uploadForm').ajaxForm({
beforeSubmit: function() {
$('#uploadOutput').html('Envoi en cours...');

View File

@ -1,5 +1,5 @@
<script>
$(document).ready(function(){
$(function(){
$('a.user-service').click(function(e){
e.preventDefault();

View File

@ -120,7 +120,7 @@ $('select[name=type]').change(function(e){
</table>
</div>
<script>
$(document).ready(function(){
$(function(){
$('#synthese').tablesorter({
dateFormat: 'uk',
headers: {

View File

@ -83,7 +83,7 @@ foreach ($this->dataTable as $ratio) {
</div>
<script>
$(document).ready(function(){
$(function(){
$('input[name=typeBilan]').click(function(e){
window.location.href = $(this).val();
});

View File

@ -64,7 +64,7 @@ function loadGoogleMap() {
}
// --- Wait the document is ready
$(document).ready(function(){
$(function(){
// --- Start timer
timer = setInterval(waitGeoCode, timerSecondInterval);
// --- Get location and geocode address if needed
@ -138,7 +138,7 @@ var FCenterLng = 1.87528;
var FCenterLat = 46.60611;
//--- Wait the document is ready
$(document).ready(function(){
$(function(){
// --- Create Markers
var listSource = {};
$.each(marks, function (i, item) {

View File

@ -43,7 +43,7 @@
<div><img id="streetview" width="300px" /></div>
<script src="<?=$this->lienJs?>"></script>
<script type="text/javascript">
$(document).ready(function() {
$(function() {
var serviceHandler = function(result) {
if (result instanceof Mappy.api.visiocity.Frontage) {
var current = result.getCurrent();

View File

@ -73,7 +73,7 @@ $("#groups").jstree({
}
});
$(document).ready(function(){
$(function(){
var target = $('#groups');
html2canvas(target, {
onrendered: function(canvas) {

View File

@ -18,7 +18,7 @@ $class = ($key<$limit)?'first':'all';?>
<?php }?>
<div class="affiche" id="show" style="cursor:pointer;">Afficher tous les documents</div><br/>
<script>
$(document).ready(function(){
$(function(){
if (<?=$key?> >2) {
$("div.affiche").show();
} else {

View File

@ -22,7 +22,7 @@ function formSource(source)
}
}
$(document).ready(function()
$(function()
{
//Init
formSource($('#sourceSelect').val());

View File

@ -301,7 +301,7 @@
</form>
</div>
<script>
$(document).ready(function(){
$(function(){
$.datepicker.setDefaults( $.datepicker.regional['fr']);
$( ".dateArea" ).datepicker({changeYear: true});

View File

@ -76,7 +76,7 @@ span.poste input { width:50px; }
});
<?php } ?>
$(document).ready(function(){
$(function(){
$.datepicker.setDefaults( $.datepicker.regional['fr'] );
});

View File

@ -313,7 +313,7 @@ $('input[name=adresse_codvoie]').autocomplete({
}
});
$(document).ready(function(){
$(function(){
var code = $('select[name=adresse_pays]').val();
if (code!='') {
$('span#indTel').text('+'+countries[code]['indTel']);

View File

@ -159,7 +159,7 @@ function departaments()
}
}
$(document).ready(function(){
$(function(){
departaments();
});

View File

@ -248,7 +248,7 @@ function submitTri() {
), 'default', true)?>/source/'+source+'/tri/'+tri+'/triMode/'+triMode;
}
$(document).ready(function() {
$(function() {
$('select[name=page]').change(function(){
window.location.href = $(this).val();
});

View File

@ -159,7 +159,7 @@ function submitTri() {
), 'default', true)?>/tri/'+tri;
}
$(document).ready(function(){
$(function(){
$('select[name=page]').change(function(){
window.location.href = $(this).val();

View File

@ -77,7 +77,7 @@ foreach ($this->utilisateurs as $uti) {
</div>
</div>
<script>
$(document).ready(function(){
$(function(){
$('a.delete').on('click', function(e){
e.preventDefault();
var href = $(this).attr('href');

View File

@ -149,7 +149,7 @@ function isEmail(email) {
return emailval;
}
$(document).ready(function(){
$(function(){
validate();
});

View File

@ -12,7 +12,7 @@
<div><img id="streetview" width="300px" /></div>
<script src="<?=$this->lienJs?>"></script>
<script type="text/javascript">
$(document).ready(function() {
$(function() {
var photoService = new Mappy.api.visiocity.PhotoService();
var geo = new Mappy.api.geolocation.Geocoder();

View File

@ -22,7 +22,7 @@ function formSource(source)
}
}
$(document).ready(function()
$(function()
{
//Init
formSource($('#sourceSelect').val());

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
$('a.tiptxt').each(function(){
var texte = $(this).parent().find('span').html();

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
var holdTheInterval;
var nbEssai = 25;
var essai = 0;

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
$('.rs').click(function(e){
e.preventDefault();

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
$("#profil").change(function() {
var val = $("#profil").val();
if (val == 'Autre'){

View File

@ -1,5 +1,4 @@
$(document).ready(function()
{
$(function(){
$('#customRapport').on('click', function(e){
e.preventDefault();
var url = $(this).attr('href');
@ -19,5 +18,4 @@ $(document).ready(function()
$('<div id="dialogcustomrapport"></div>').dialog(dialogOpts);
return false;
});
});

View File

@ -1,5 +1,4 @@
$(document).ready(function()
{
$(function(){
$('select[name=typeBilan]').on('change', function(e){
e.preventDefault();
$(this).parent('form').submit();

View File

@ -1,5 +1,4 @@
$(document).ready( function()
{
$(function(){
$('a.dial,.ev_code').on('click', function(e){
e.preventDefault();
var title = $(this).attr('title');

View File

@ -10,7 +10,7 @@ function validate() {
$("[required]").on("change", function(){
validate();
});
$(document).ready(function() {
$(function() {
validate();
$(function() {
$( "#accordion" ).accordion({heightStyle: "content", collapsible: true,active: false });

View File

@ -1,5 +1,4 @@
$(document).ready(function(){
$(function(){
$('#groupesarbo').on('click', function(e){
e.preventDefault();
var title = $(this).attr('title');
@ -18,5 +17,4 @@ $(document).ready(function(){
};
$('<div id="dialogarbo"></div>').dialog(dialogOpts);
});
});

View File

@ -1,5 +1,4 @@
$(document).ready(function(){
$(function(){
$('a.lienfiche').qtip({
style: { classes: 'qtip-dark' },
position: { at: 'top center', my: 'bottom center' },
@ -10,5 +9,4 @@ $(document).ready(function(){
},
show: { delay: 5000 }
});
});

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
$('a.getmarque').click(function(e){
e.preventDefault();
var id = $(this).attr('id');

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
$('input[type=radio][name=method]').click(function()
{

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
var holdTheInterval;
var nbEssai = 25;
var essai = 0;

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
$('input.button:reset').click(function(){
$('input:text','form[name=recherche]').val('');

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
//Traitement des dates pour simplification saisie
$('body').delegate('.date', 'focusout', function(){
//Test du format date

View File

@ -1,4 +1,4 @@
$(document).ready(function()
$(function()
{
$('a.annonceSaisie').click(function(e){
e.preventDefault();

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
$('img.flag').on('click', function() {
var url = window.location.href;

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
//Boite de dialog surveillance
$('.dialogsurv').on('click', function(){

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
var holdTheInterval;
var nbEssai = 25;
var essai = 0;

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(function(){
$('a#password').on('click', function(){
var dialogOpts = {