Index: lams_central/web/authoring/authoring.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/authoring/authoring.jsp,v
diff -u -r1.1 -r1.2
--- lams_central/web/authoring/authoring.jsp 2 Jun 2014 07:27:16 -0000 1.1
+++ lams_central/web/authoring/authoring.jsp 5 Jun 2014 12:01:32 -0000 1.2
@@ -70,6 +70,7 @@
SEQUENCE_NOT_VALID : 'The sequence is not valid.
It needs to be corrected before it can be used in lessons.',
SEQUENCE_VALIDATION_ISSUES : 'While saving the sequence there were following validation issues:',
SAVE_SUCCESSFUL : 'Congratulations! Your design is valid and has been saved.',
+ DOWNLOAD_NOT_SUPPORTED : 'Your browser does not support on the fly downloading.',
NAVIGATE_AWAY_CONFIRM : 'Your design is not saved.\nAny changes you made since you last saved will be lost.',
DELETE_NODE_CONFIRM : 'Are you sure you want to delete this ',
SEQUENCE_OVERWRITE_CONFIRM : 'Are you sure you want to overwrite the existing sequence?',
@@ -181,7 +182,7 @@
- Save as
- - Export
+
- Export
')[0].download != 'undefined'
},
'colors' : {
@@ -2120,28 +2122,40 @@
return;
}
layout.modified = modified;
- var activitiesExist = layout.activities.length > 0;
- if (modified || !activitiesExist) {
- $('#previewButton').attr('disabled', 'disabled')
- .button('option', 'disabled', true);
- $('.exportSequenceButton').attr('disabled', 'disabled')
- .css('opacity', 0.2);
- $('#ldDescriptionFieldModified').text('*');
- } else {
+ var activitiesExist = layout.activities.length > 0,
+ enableExportButton = false;
+ if (!modified && activitiesExist) {
$('#previewButton').attr('disabled', null)
- .button('option', 'disabled', false);
+ .button('option', 'disabled', false);
$('.exportSequenceButton').attr('disabled', null)
- .css('opacity', 1);
+ .css('opacity', 1);
$('#ldDescriptionFieldModified').text('');
+ enableExportButton = true;
+ } else {
+ $('#previewButton').attr('disabled', 'disabled')
+ .button('option', 'disabled', true);
+ $('.exportSequenceButton').attr('disabled', 'disabled')
+ .css('opacity', 0.2);
+ $('#ldDescriptionFieldModified').text('*');
}
- if (activitiesExist) {
+ if (layout.conf.supportsDownloadAttribute && activitiesExist) {
$('.exportImageButton').attr('disabled', null)
.css('opacity', 1);
+ enableExportButton = true;
} else {
$('.exportImageButton').attr('disabled', 'disabled')
.css('opacity', 0.2);
}
+
+ // disabled the whole export button if all children are disabled
+ if (enableExportButton) {
+ $('#exportButton').attr('disabled', null)
+ .css('opacity', 1);
+ } else {
+ $('#exportButton').attr('disabled', 'disabled')
+ .css('opacity', 0.2);
+ }
},
Index: lams_central/web/includes/javascript/authoring/authoringMenu.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringMenu.js,v
diff -u -r1.30 -r1.31
--- lams_central/web/includes/javascript/authoring/authoringMenu.js 2 Jun 2014 07:27:16 -0000 1.30
+++ lams_central/web/includes/javascript/authoring/authoringMenu.js 5 Jun 2014 12:01:32 -0000 1.31
@@ -41,8 +41,11 @@
var menuItem = $(this),
subMenu = menuItem.children('ul');
if (subMenu.length > 0){
-
menuItem.click(function(){
+ // do not show the submenu when the button is disabled
+ if ($(this).attr('disabled') == 'disabled') {
+ return;
+ }
var menu = $(this).children('ul').show().position({
my : "left+2px top",
at : "right top",
@@ -81,7 +84,6 @@
'autoOpen' : false,
'width' : 320,
'height' : 120,
- 'show' : 'fold',
'hide' : 'fold',
'draggable': false,
'resizable': false,
@@ -94,6 +96,11 @@
layout.exportLDDialog.dialog('close');
});
layout.dialogs.push(layout.exportLDDialog);
+
+
+ if (!layout.conf.supportsDownloadAttribute) {
+ $('.exportImageButton').attr('title', LABELS.DOWNLOAD_NOT_SUPPORTED);
+ }
},
@@ -329,10 +336,10 @@
return;
}
- layout.exportLDDialog.dialog('open');
$('iframe', layout.exportLDDialog)
.attr('src', LAMS_URL + 'authoring/exportToolContent.do?method=export&format=' + format + '&learningDesignID='
+ layout.ld.learningDesignID);
+ layout.exportLDDialog.dialog('open');
},