Sha256: 18815f760b02068bfedb93950d56a99f7d95df94c2cc34c2ac8c096b34e07533

Contents?: true

Size: 1.38 KB

Versions: 41

Compression:

Stored size: 1.38 KB

Contents

document.addEventListener('graph:changed', function (e) {
  $("button[name=save]").prop("disabled",false);
}, false);
document.addEventListener('parameters:changed', function (e) {
  $("button[name=save]").prop("disabled",false);
}, false);
document.addEventListener('modifiers:changed', function (e) {
  $("button[name=save]").prop("disabled",false);
}, false);

function leading_zeros(dt) {
  return (dt < 10 ? '0' : '') + dt;
}

$(document).ready(function() {
  $("button[name=save]").click(function(){
    var def = new $.Deferred();
    def.done(function(name,testset) {
      $.ajax({
        url: $('body').attr('current-save') + ($('body').attr('current-save-dir') ? ($('body').attr('current-save-dir') + '/').replace(/\/+/,'/') : '') + name + '.xml',
        type: 'PUT',
        contentType: 'application/xml',
        data: testset.serializePrettyXML(),
        headers: { 'Content-ID': 'content' },
        success: function() {
          $("button[name=save]").prop("disabled",true);
          $("#lastsavedline").removeClass('hidden');
          var dt = new Date();
          var time = leading_zeros(dt.getHours()) + ":" + leading_zeros(dt.getMinutes()) + ":" + leading_zeros(dt.getSeconds());
          $("#lastsaved").text(time);
        },
        error: function() {
          alert('File was moved or deleted. Save testset to disk.');
        }
      });
    });
    get_testset(def);
  });
});

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
cpee-2.1.52 cockpit/js/edit.js
cpee-2.1.51 cockpit/js/edit.js
cpee-2.1.50 cockpit/js/edit.js
cpee-2.1.49 cockpit/js/edit.js
cpee-2.1.48 cockpit/js/edit.js
cpee-2.1.47 cockpit/js/edit.js
cpee-2.1.46 cockpit/js/edit.js
cpee-2.1.45 cockpit/js/edit.js
cpee-2.1.44 cockpit/js/edit.js
cpee-2.1.43 cockpit/js/edit.js
cpee-2.1.41 cockpit/js/edit.js
cpee-2.1.39 cockpit/js/edit.js
cpee-2.1.38 cockpit/js/edit.js
cpee-2.1.37 cockpit/js/edit.js
cpee-2.1.36 cockpit/js/edit.js
cpee-2.1.35 cockpit/js/edit.js
cpee-2.1.34 cockpit/js/edit.js
cpee-2.1.33 cockpit/js/edit.js
cpee-2.1.32 cockpit/js/edit.js
cpee-2.1.30 cockpit/js/edit.js