var annoQuote; (function($){ var inputs = {}, ed; annoQuote = { keySensitivity: 100, textarea: function() { return edCanvas; }, init : function() { inputs.dialog = $('#anno-popup-quote'); inputs.submit = $('#anno-quote-submit'); // Bind event handlers inputs.dialog.keydown( annoQuote.keydown ); inputs.dialog.keyup( annoQuote.keyup ); inputs.submit.click( function(e){ annoQuote.update(); e.preventDefault(); }); $('#anno-quote-cancel').click(annoQuote.close); }, update : function(attachment_id) { var display_type, caption, label, copyright_statement, copyright_holder, license, url, xml; var ed = tinymce.activeEditor; ed.selection.collapse(0); form = $('#anno-popup-quote-form'); quote = $('input[name$="text"]', form).val(); attribution = $('input[name$="attribution"]', form).val(); statement = $('input[name$="statement"]', form).val(); holder = $('input[name$="holder"]', form).val(); license = $('input[name$="license"]', form).val(); if (license.trim() == '') { license = ''; } else { license = '' + license + ''; } xml = '