script: pointer config
(function() {
  var permissionsContent, pointerContent;

  $.extend(wagn.editorContentFunctionMap, {
    '.pointer-select': function() {
      return pointerContent(this.val());
    },
    '.pointer-multiselect': function() {
      return pointerContent(this.val());
    },
    '.pointer-radio-list': function() {
      return pointerContent(this.find('input:checked').val());
    },
    '.pointer-list-ul': function() {
      return pointerContent(this.find('input').map(function() {
        return $(this).val();
      }));
    },
    '.pointer-checkbox-list': function() {
      return pointerContent(this.find('input:checked').map(function() {
        return $(this).val();
      }));
    },
    '.pointer-select-list': function() {
      return pointerContent(this.find('.pointer-select select').map(function() {
        return $(this).val();
      }));
    },
    '.pointer-mixed': function() {
      var element;
      element = '.pointer-checkbox-sublist input:checked,.pointer-sublist-ul input';
      return pointerContent(this.find(element).map(function() {
        return $(this).val();
      }));
    },
    '.perm-editor': function() {
      return permissionsContent(this);
    }
  });

  wagn.editorInitFunctionMap['.pointer-list-editor'] = function() {
    this.sortable({
      handle: '.handle',
      cancel: ''
    });
    return wagn.initPointerList(this.find('input'));
  };

  $.extend(wagn, {
    initPointerList: function(input) {
      var optionsCard;
      optionsCard = input.closest('ul').data('options-card');
      return input.autocomplete({
        source: wagn.prepUrl(wagn.rootPath + '/' + optionsCard + '.json?view=name_complete')
      });
    }
  });

  pointerContent = function(vals) {
    var list;
    list = $.map($.makeArray(vals), function(v) {
      if (v) {
        return '[[' + v + ']]';
      }
    });
    return $.makeArray(list).join("\n");
  };

  permissionsContent = function(ed) {
    var groups, indivs;
    if (ed.find('#inherit').is(':checked')) {
      return '_left';
    }
    groups = ed.find('.perm-group input:checked').map(function() {
      return $(this).val();
    });
    indivs = ed.find('.perm-indiv input').map(function() {
      return $(this).val();
    });
    return pointerContent($.makeArray(groups).concat($.makeArray(indivs)));
  };

}).call(this);

All Cards on This Page

 

Journals

2110 medium
Full list of journal entries