Sha256: a1de2d5a0a5824cbccea29ebaac72fdef6f299e23f12ed93cc8c58d283e6c41d

Contents?: true

Size: 939 Bytes

Versions: 14

Compression:

Stored size: 939 Bytes

Contents

$(document).ready(function() {

  $('#import-steps').smartupdater({
    url : $('#import-steps').attr('data-url'),
    dataType: 'json',
    minTimeout: 100
  }, function(data) {
    var steps = ['site', 'content_types', 'assets', 'asset_collections', 'snippets', 'pages'];

    var currentIndex = data.step == 'done' ? steps.length - 1 : steps.indexOf(data.step);

    for (var i = 0; i < steps.length; i++) {
      var state = null;

      if (i <= currentIndex) state = 'done';
      if (i == currentIndex + 1 && data.failed) state = 'failed';

      if (state != null)
        $('#import-steps li:eq(' + i + ')').addClass(state);
    }

    if (data.step == 'done')
      $.growl('notice', $('#import-steps').attr('data-success-message'));

    if (data.failed)
      $.growl('alert', $('#import-steps').attr('data-failure-message'));

    if (data.step == 'done' || data.failed)
      $('#import-steps').smartupdaterStop();
  });

});

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
locomotive_cms-1.0.0.beta.2 public/javascripts/admin/import.js
locomotive_cms-1.0.0.beta public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta12 public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta11 public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta10 public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta9 public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta8 public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta7 public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta5 public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta4 public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta3 public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta2 public/javascripts/admin/import.js
locomotive_cms-0.0.4.beta1 public/javascripts/admin/import.js
locomotive_cms-0.0.4 public/javascripts/admin/import.js