{ div, form, input, textarea, select, option, label, h4, p, a } = React.DOM class @PrintPrompt extends React.Component constructor: (props) -> super props @state = url: props.url collation: props.collation template: props.template paper: props.paper user_id: props.user_id user_email: props.user_email shared: new App.Shared() printers_url: "/admin/users/" + props.user_id + "/printers.json" wurl: "" args: "" @propTypes = url: React.PropTypes.string template: React.PropTypes.string paper: React.PropTypes.string user_id: React.PropTypes.number collation: React.PropTypes.string user_email: React.PropTypes.string @defaultProps = url: "" collation: "list" template: "" paper: "A4" user_id: 1 user_email: "" getPrinterList: (e) => jqxhr = $.ajax url: @state.printers_url method: 'GET' .done (printers) -> @obj=$("#user_suggested_printer_list") for printer in printers opt = document.createElement("option") opt.value = printer.id opt.text = printer.name @obj.append opt @obj.material_select() .fail (data) -> console.log 'fejl ved opslag i printer liste' hidePrinterList: (e) => $('.select-wrapper.printer_list').hide() showPrinterList: (e) => $('.select-wrapper.printer_list').show() hideEmailForm: (e) => $('.emailForm').hide() showEmailForm: (e) => $('.emailForm').show() hideDisplayForm: (e) => $('.displayForm').hide() showDisplayForm: (e) => $('.displayForm').show() onDisplay: (e) => @hidePrinterList() @hideEmailForm() @showDisplayForm() onEmail: (e) => @hidePrinterList() @hideDisplayForm() @showEmailForm() onPrint: (e) => @showPrinterList() @hideEmailForm() @hideDisplayForm() onDownload: (e)=> @hidePrinterList() @hideEmailForm() @hideDisplayForm() onHTML_PDF: (e) => if $(e.currentTarget).attr('id') == "display_file_as_pdf" $("#display_file_as_html").prop 'checked', !$("#display_file_as_pdf").prop('checked') else $("#display_file_as_pdf").prop 'checked', !$("#display_file_as_html").prop('checked') cancelModal: (e) => App.shared.spinWhileLoading() $("#print-dialog").closeModal() animatePrint: (e) => if e $(".print-ok-button").html('