Sha256: 25068cff5c058996c3760926cf7f8b3fc6d3ee6e291b928f546f3ffe4f1bcab4
Contents?: true
Size: 1.08 KB
Versions: 13
Compression:
Stored size: 1.08 KB
Contents
$.extend wagn, editorContentFunctionMap: {} editorInitFunctionMap: { '.date-editor': -> @datepicker { dateFormat: 'yy-mm-dd' } 'textarea': -> $(this).autosize() '.file-upload': -> wagn.upload_file(this) '.etherpad-textarea': -> $(this).closest('form') .find('.edit-submit-button') .attr('class', 'etherpad-submit-button') } addEditor: (selector, init, get_content) -> wagn.editorContentFunctionMap[selector] = get_content wagn.editorInitFunctionMap[selector] = init jQuery.fn.extend { setContentFieldsFromMap: (map) -> map = wagn.editorContentFunctionMap unless map? this_form = $(this) $.each map, (selector, fn) -> this_form.setContentFields(selector, fn) setContentFields: (selector, fn) -> $.each @find(selector), -> $(this).setContentField(fn) setContentField: (fn) -> field = @closest('.card-editor').find('.card-content') init_val = field.val() # tinymce-jquery overrides val(); # that's why we're not using it. new_val = fn.call this field.val new_val field.change() if init_val != new_val }
Version data entries
13 entries across 13 versions & 1 rubygems