consent.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. var strings = strings;
  2. /* global data */
  3. $(document).ready(function(){
  4. resolveAttributes();
  5. optionSelected();
  6. });
  7. function optionSelected() {
  8. var v = $('input[name=option]:checked', '#fm1').val();
  9. if (v == 0) {
  10. $('#reminderPanel').hide();
  11. $('#reminderTab').hide();
  12. } else {
  13. $('#reminderPanel').show();
  14. $('#reminderTab').show();
  15. }
  16. }
  17. function resolveAttributes() {
  18. var table;
  19. if ( $.fn.dataTable.isDataTable( '#attributesTable' ) ) {
  20. table = $('#attributesTable').DataTable();
  21. }
  22. else {
  23. table = $('#attributesTable').DataTable( {
  24. paging : false,
  25. searching : false,
  26. language: {
  27. info: strings.info
  28. }
  29. } );
  30. }
  31. table.clear();
  32. var attrs = data.attributes;
  33. for (var property in attrs) {
  34. if (attrs.hasOwnProperty(property)) {
  35. table.row.add([
  36. '<code>' + property + '</code>', '<code>' + attrs[property] + '</code>'
  37. ]).draw(false);
  38. }
  39. }
  40. }