9 {'actions':['export'], 'extension':'pdf', 'label': gettext('download portable object format file (.pdf)')}, |
9 {'actions':['export'], 'extension':'pdf', 'label': gettext('download portable object format file (.pdf)')}, |
10 {'actions':['export'], 'extension':'latex', 'label': gettext('download latex file (.tex)')}, |
10 {'actions':['export'], 'extension':'latex', 'label': gettext('download latex file (.tex)')}, |
11 {'actions':['export'], 'extension':'odt', 'label': gettext('download open document file (.odt)')}, |
11 {'actions':['export'], 'extension':'odt', 'label': gettext('download open document file (.odt)')}, |
12 {'actions':['export'], 'extension':'doc', 'label': gettext('download microsoft word file (.doc)')}, |
12 {'actions':['export'], 'extension':'doc', 'label': gettext('download microsoft word file (.doc)')}, |
13 {'actions':['export'], 'extension':'docx', 'label': gettext('download microsoft word 2007 file (.docx)')}, |
13 {'actions':['export'], 'extension':'docx', 'label': gettext('download microsoft word 2007 file (.docx)')}, |
14 {'actions':['export'], 'extension':'xml', 'label': gettext('download XML file for re-import')}]; |
14 ]; |
15 |
15 |
16 var pandoc_version_ary = sv_pandoc_version.split('.'); |
16 var pandoc_version_ary = sv_pandoc_version.split('.'); |
17 if (parseInt(pandoc_version_ary[0]) > 1 || (parseInt(pandoc_version_ary[0]) == 1 && parseInt(pandoc_version_ary[1]) > 8)) { |
17 if (parseInt(pandoc_version_ary[0]) > 1 || (parseInt(pandoc_version_ary[0]) == 1 && parseInt(pandoc_version_ary[1]) > 8)) { |
18 gFormats.push({'actions':['export'], 'extension':'epub', 'label': gettext('download ebook (.epub)')}); |
18 gFormats.push({'actions':['export'], 'extension':'epub', 'label': gettext('download ebook (.epub)')}); |
19 } |
19 } |
|
20 |
|
21 gFormats.push({'actions':['export'], 'extension':'xml', 'label': gettext('download XML file for re-importing text and comments')}); |
20 |
22 |
21 gActions = {'print':{'dialogTitle':gettext('Print text'), 'chooseFormatLabel':gettext('How do you want to print?'), 'defaultMethod':'pdf', 'defaultWithColors':"no", 'defaultWhichComments':'all'}, |
23 gActions = {'print':{'dialogTitle':gettext('Print text'), 'chooseFormatLabel':gettext('How do you want to print?'), 'defaultMethod':'pdf', 'defaultWithColors':"no", 'defaultWhichComments':'all'}, |
22 'export':{'dialogTitle':gettext('Export text'), 'chooseFormatLabel':gettext('Choose file format'), 'defaultMethod':'pdf', 'defaultWithColors':"no", 'defaultWhichComments':'all'}} ; |
24 'export':{'dialogTitle':gettext('Export text'), 'chooseFormatLabel':gettext('Choose file format'), 'defaultMethod':'pdf', 'defaultWithColors':"no", 'defaultWhichComments':'all'}} ; |
23 gCurrentAction = null ; |
25 gCurrentAction = null ; |
24 |
26 |
72 } ; |
74 } ; |
73 |
75 |
74 _manageMarkersColorsChoice = function() { |
76 _manageMarkersColorsChoice = function() { |
75 var method = $("#p_method").val(); |
77 var method = $("#p_method").val(); |
76 var which = $("#p_comments").val(); |
78 var which = $("#p_comments").val(); |
|
79 var all = frames['text_view_comments'].gDb.getCommentsNb(true); |
|
80 var currents = frames['text_view_comments'].gDb.getCommentsNb(false); |
|
81 var nb_comments = (which == 'all') ? all : currents; |
77 |
82 |
78 var disableMarkersColorsChoice ; |
83 var disableMarkersColorsChoice ; |
79 if (gCurrentAction == 'print') |
84 if (gCurrentAction == 'print') |
80 disableMarkersColorsChoice = ((which == 'none') || (method == 'markdown') || (method == 'html')) ; |
85 disableMarkersColorsChoice = ((nb_comments == 0) || (which == 'none')); |
81 if (gCurrentAction == 'export') |
86 if (gCurrentAction == 'export') |
82 disableMarkersColorsChoice = ((which == 'none') || (method == 'markdown')) ; |
87 disableMarkersColorsChoice = ((nb_comments == 0) || (which == 'none') || (method == 'markdown') || (method == 'latex') || (method == 'epub') || (method == 'odt') || (method == 'doc')) ; |
83 |
88 |
84 if (disableMarkersColorsChoice) |
89 if (disableMarkersColorsChoice) |
85 $("#p_color").val('no'); |
90 $("#p_color").val('no'); |
86 |
91 |
87 $("#p_color").attr("disabled", disableMarkersColorsChoice); |
92 $("#p_color").attr("disabled", disableMarkersColorsChoice); |