Sha256: ef5d22e18a421d8414d3dc11b88d2d7e4cff824fdc04378e4d7f1bc3ad3f42c3

Contents?: true

Size: 1.02 KB

Versions: 19

Compression:

Stored size: 1.02 KB

Contents

$(document).ready(function(){
  $('#device_attributes').hide();

  $('#message_options input[type=radio]').on('change', function(){
    if($(this)[0].value == 'broadcast'){
      $('#device_attributes').hide();
    } else {
      $('#device_attributes').show();
    }
  });
});

function newMessageAttribute(){
  $('#message_attributes_content').append("<%= j render partial: 'jera_push/admin/messages/message_attributes', locals: {key: '', default: false} %>");
};

function removeMessageAttribute(scope){
  scope.parent().parent().remove();
};

function addAllDevices(){
  var devices = $('#device_list_checkbox tr input'), devices_input = '';
  for(var i = 0, l = devices.length; i < l; i++){
    var checkboxValue = devices[i].value;
    devices_input += "<input type='text' name='devices[]' value=" + checkboxValue + " >";
  }
  devices.prop('checked', true);
  $('#message_devices').append(devices_input);
};

function removeAllDevices(){
  $('#message_devices').empty();
  $('#device_list_checkbox tr input').prop('checked', false);
};

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
jera_push-2.1.4 app/views/jera_push/admin/messages/_new.js.erb
jera_push-2.1.3 app/views/jera_push/admin/messages/_new.js.erb
jera_push-2.1.2 app/views/jera_push/admin/messages/_new.js.erb
jera_push-2.0.0 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.2.4 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.2.3 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.2.1 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.1.7 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.1.6 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.1.5 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.1.4 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.1.3 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.1.2 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.1.1 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.1.0 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.0.3 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.0.2 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.0.1.1 app/views/jera_push/admin/messages/_new.js.erb
jera_push-1.0.1 app/views/jera_push/admin/messages/_new.js.erb