Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r284923f86a16bfc0fa2681918f532b1eb12ac8b9 -re837b7b90d6cbae5ecf051b9c9ba61b3097e0c51 --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 284923f86a16bfc0fa2681918f532b1eb12ac8b9) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision e837b7b90d6cbae5ecf051b9c9ba61b3097e0c51) @@ -444,4 +444,195 @@ error.username.invalid.characters =Username can only contain alphanumeric characters and no spaces. error.lessonname.invalid.characters =Lesson name contains invalid characters +authoring.fla.default.grouping.title =Grouping +authoring.fla.default.group.prefix =Group +authoring.fla.default.branching.title =Branching +authoring.fla.default.branch.prefix =Branch +authoring.fla.default.optional.activity.title =Optional Activity +authoring.fla.support.activity.title =Support Activity +authoring.fla.gate.activity.label =STOP +authoring.fla.branching.start.suffix =start +authoring.fla.branching.end.suffix =end +authoring.fla.remove.activity.confirm =Are you sure you want to remove the whole branching activity? +authoring.fla.branching.create.confirm =Transition from this activity already exists.\\nDo you want to create branching here? +authoring.fla.transition.to.exists.error =Transition to this activity already exists +authoring.fla.default.annotation.label.title =Label +authoring.fla.region.fit.button.tooltip =Fit +authoring.fla.new.folder.button =New +authoring.fla.copy.button =Copy +authoring.fla.paste.button =Paste +authoring.fla.delete.button =Delete +authoring.fla.rename.button =Rename +authoring.fla.open.button =Open +authoring.fla.save.button =Save +authoring.fla.import.button =Import +authoring.fla.folder =folder +authoring.fla.sequence =sequence +authoring.fla.sequence.not.valid =The sequence is not valid.
It needs to be corrected before it can be used in lessons. +authoring.fla.sequence.validation.issues =While saving the sequence there were following validation issues: +authoring.fla.save.successful =Congratulations! Your design is valid and has been saved. +authoring.fla.navigate.away.confirm =Your design is not saved.\\nAny changes you made since you last saved will be lost. +authoring.fla.delete.node.confirm =Are you sure you want to delete this +authoring.fla.sequence.overwrite.confirm =Are you sure you want to overwrite the existing sequence? +authoring.fla.new.folder.title.prompt =Please enter the name for a new folder +authoring.fla.rename.title.prompt =Please enter the new name for +authoring.fla.save.sequence.title.prompt =Please enter a title for the sequence +authoring.fla.import.part.choose.prompt =Click on activities to choose them for import +authoring.fla.folder.not.selected.error =Please choose a folder +authoring.fla.title.validation.error =The title can not contain any of these characters < > ^ * @ % $ +authoring.fla.folder.exists.error =A folder with this name already exists. +authoring.fla.sequence.exists.error =A sequence with this name already exists. +authoring.fla.sequence.save.error =Error while loading sequence +authoring.fla.sequence.not.selected.error =Please choose a sequence +authoring.fla.sequence.load.error =Error while loading the sequence +authoring.fla.transition.from.exists.error =Transition from this activity already exists +authoring.fla.export.image.dialog.title =Image export +authoring.fla.export.sequence.dialog.title =Sequence export +authoring.fla.activity.copy.title.prefix =Copy [0] of +authoring.fla.preview.lesson.default.title =Preview +authoring.fla.save.dialog.title =Save sequence +authoring.fla.open.dialog.title =Open sequence +authoring.fla.import.part.dialog.title =Import activities +authoring.fla.run.sequences.folder = +authoring.fla.arrange.confirm =There are annotations on the canvas.\\n\ + They will be not arranged automatically, you will have to adjust them manually later.\\n\ + Do you want to continue? +authoring.fla.clear.canvas.confirm =Are you sure you want to remove all existing elements? +authoring.fla.branching.start.place.prompt =Place the branching point +authoring.fla.branching.end.place.prompt =Place the converge point +authoring.fla.annotation.region.place.prompt =Click and hold to start drawing an annotation region +authoring.fla.annotation.label.place.prompt =Click to add an annotation label +authoring.fla.optional.activity.place.prompt =Click to add an optional activity container. +authoring.fla.support.activity.place.prompt =Click to add a support activity container. +authoring.fla.transition.place.prompt =Click on an activity +authoring.fla.paste.error =Sorry, you can not paste this type of activity +authoring.fla.preview.error =Error while initialising lesson for preview +authoring.fla.ok.button =OK +authoring.fla.cancel.button =Cancel +authoring.fla.clear.all.button =Clear all +authoring.fla.refresh.button =Refresh +authoring.fla.remove.condition.button =Remove +authoring.fla.properties.dialog.title =Properties +authoring.fla.group.naming.dialog.title =Group Naming +authoring.fla.groups.to.branches.match.dialog_title =Match Groups to Branches +authoring.fla.branch.mapping.groups.header =Groups +authoring.fla.branch.mapping.group.header =Group +authoring.fla.conditions.dialog.title =Select Output Conditions for Input +authoring.fla.branch.mapping.conditions.header =Conditions +authoring.fla.branch.mapping.condition.header =Condition +authoring.fla.branch.mapping.gate.header =Gate +authoring.fla.branch.mapping.branches.header =Branches +authoring.fla.branch.mapping.branch.header =Branch +authoring.fla.gate.state.mapping.dialog.title =Map gate conditions +authoring.fla.branch.mapping.dialog.title =Match conditions to branches +authoring.fla.gate.state.open =open +authoring.fla.gate.state.closed =closed +authoring.fla.branch.mapping.default.branch.suffix = (default) +authoring.fla.complex.output.suffix = (user defined) +authoring.fla.range.output.suffix = (range) +authoring.fla.range.condition.description =Range [0] to [1] +authoring.fla.exact.condition.description =Exact value of +authoring.fla.less.condition.description =Less than or eq +authoring.fla.greater.condition.description =Greater than or eq +authoring.fla.default.range.condition.title.prefix =Untitled +authoring.fla.clear.all.confirm =There are conditions linked to an existing branch.\\nDo you wish to remove them? +authoring.fla.remove.condition.confirm =This condition is linked to an existing branch.\\nDo you wish to remove it? +authoring.fla.refresh.conditions.confirm =You are about to update your conditions for the selected output definition.\\n\ + This will clear all links to existing branches.\\nDo you wish to continue? +authoring.fla.conditions.to.default.gate.state.confirm =All remaining conditions will be mapped to the selected gate\\'s closed state +authoring.fla.conditions.to.default.branch.confirm =All remaining conditions will be mapped to the default branch +authoring.fla.groups.to.default.branch.confirm =All remaining groups will be mapped to the default branch +authoring.fla.range.condition.add.start.error =The start value can not be within the range of an existing condition +authoring.fla.range.condition.add.end.error =The end value can not be within the range of an existing condition +authoring.fla.group.title.validation.erorr =Group name can not contain any of these characters < > ^ * @ % $ +authoring.fla.page.title =Flashless Authoring +authoring.fla.page.menu.new =New +authoring.fla.page.menu.open =Open +authoring.fla.page.menu.import =Import +authoring.fla.page.menu.import.part =Import part +authoring.fla.page.menu.save =Save +authoring.fla.page.menu.saveas =Save as +authoring.fla.page.menu.export =Export +authoring.fla.page.menu.export.lams =Sequence LAMS +authoring.fla.page.menu.export.ims.tooltip =IMS Learning Design Level A Format \ + (This format cannot be reimported back into LAMS. Export only!) +authoring.fla.page.menu.export.ims =Sequence IMS +authoring.fla.page.menu.export.png =Image PNG +authoring.fla.page.menu.export.svg =Image SVG +authoring.fla.page.menu.copy =Copy +authoring.fla.page.menu.paste =Paste +authoring.fla.page.menu.transition =Transition +authoring.fla.page.menu.optional =Optional +authoring.fla.page.menu.optional.activity =Activity +authoring.fla.page.menu.optional.support =Support +authoring.fla.page.menu.flow =Flow +authoring.fla.page.menu.flow.gate =Gate +authoring.fla.page.menu.flow.branch =Branch +authoring.fla.page.menu.group =Group +authoring.fla.page.menu.annotate =Annotate +authoring.fla.page.menu.annotate.label =Label +authoring.fla.page.menu.annotate.region =Region +authoring.fla.page.menu.arrange =Arrange +authoring.fla.page.menu.preview =Preview +authoring.fla.page.ld.title =Untitled +authoring.fla.page.ld.description =Description: +authoring.fla.page.ld.license =License: +authoring.fla.page.ld.license.none =No license currently selected. Please select one. +authoring.fla.page.ld.license.info =Additional license information: +authoring.fla.page.dialog.access =Recently used sequences +authoring.fla.page.dialog.ld.title =Title: +authoring.fla.page.dialog.mappings =Mappings +authoring.fla.page.prop.title =Title: +authoring.fla.page.prop.default =Default? +authoring.fla.page.prop.grouping.type =Grouping type: +authoring.fla.page.prop.grouping.type.random =Random +authoring.fla.page.prop.grouping.type.monitor =Choose in Monitor +authoring.fla.page.prop.grouping.type.learner =Learner's choice +authoring.fla.page.prop.groups.number =Number of groups: +authoring.fla.page.prop.groups.learners =Number of learners: +authoring.fla.page.prop.groups.equal =Equal group sizes? +authoring.fla.page.prop.groups.view.learners =View learners before selection? +authoring.fla.page.prop.groups.name =Name Groups +authoring.fla.page.prop.description =Description: +authoring.fla.page.prop.gate.type =Type: +authoring.fla.page.prop.gate.type.condition =Condition +authoring.fla.page.prop.gate.type.sync =Synchronise +authoring.fla.page.prop.gate.type.schedule =Schedule +authoring.fla.page.prop.gate.type.permission =Permission +authoring.fla.page.prop.input =Input (Tool): +authoring.fla.page.prop.gate.delay =Delay: +authoring.fla.page.prop.days =days +authoring.fla.page.prop.hours =hours +authoring.fla.page.prop.minutes =minutes +authoring.fla.page.prop.gate.activity.finish.based =Since learner finished previous activity? +authoring.fla.page.prop.conditions.create =Create conditions +authoring.fla.page.prop.gate.conditions.map =Map gate conditions +authoring.fla.page.prop.branching.type =Branching type: +authoring.fla.page.prop.branching.type.chose =Instructor's choice +authoring.fla.page.prop.branching.type.group =Group-based +authoring.fla.page.prop.branching.type.tool =Learner's output +authoring.fla.page.prop.branching.type.optional =Learner's choice +authoring.fla.page.prop.grouping =Grouping: +authoring.fla.page.prop.branching.conditions.match =Match conditions to branches +authoring.fla.page.prop.branching.groups.match =Match Groups to Branches +authoring.fla.page.prop.branching.sequences.min =Min sequences: +authoring.fla.page.prop.branching.sequences.max =Max sequences: +authoring.fla.page.prop.optional.activities.min =Min activities: +authoring.fla.page.prop.optional.activities.max =Max activities: +authoring.fla.page.prop.color =Color: +authoring.fla.page.dialog.cond.output.choose =[ Choose Output ] +authoring.fla.page.dialog.cond.options.choose =[ Options ] +authoring.fla.page.dialog.cond.greater =Greater than or equal to +authoring.fla.page.dialog.cond.less =Less than or equal to +authoring.fla.page.dialog.cond.range =Range +authoring.fla.page.dialog.cond.range.from =From: +authoring.fla.page.dialog.cond.range.to =To: +authoring.fla.page.dialog.cond.add =Add +authoring.fla.page.dialog.cond.name =Name: +authoring.fla.page.dialog.cond.list.name =Name +authoring.fla.page.dialog.cond.list.condition =Condition +authoring.fla.page.download.image =Click here to download the image. +authoring.fla.page.download.wait =Please wait for the download. +authoring.fla.page.download.close =Close the dialog when the download is finished. +authoring.fla.page.svg.generator.title =SVG Generator #======= End labels: Exported 436 labels for en AU ===== Index: lams_central/web/authoring/authoring.jsp =================================================================== diff -u -r7676f06ab1c200a434600195e4380a30a7b8264b -re837b7b90d6cbae5ecf051b9c9ba61b3097e0c51 --- lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 7676f06ab1c200a434600195e4380a30a7b8264b) +++ lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision e837b7b90d6cbae5ecf051b9c9ba61b3097e0c51) @@ -7,7 +7,7 @@ - Flashless Authoring + <fmt:message key="authoring.fla.page.title" /> @@ -40,117 +40,118 @@ LD_THUMBNAIL_URL_BASE = LAMS_URL + 'home.do?method=createLearningDesignThumbnail&ldId=', LABELS = { // ActivityLib - DEFAULT_GROUPING_TITLE : 'Grouping', - DEFAULT_GROUP_PREFIX : 'Group ', - DEFAULT_BRANCHING_TITLE :'Branching', - DEFAULT_BRANCH_PREFIX : 'Branch ', - DEFAULT_OPTIONAL_ACTIVITY_TITLE : 'Optional Activity', - SUPPORT_ACTIVITY_TITLE : 'Support Activity', - GATE_ACTIVITY_LABEL : 'STOP', - BRANCHING_START_SUFFIX : 'start', - BRANCHING_END_SUFFIX : 'end', - REMOVE_ACTIVITY_CONFIRM : 'Are you sure you want to remove the whole branching activity?', - BRANCHING_CREATE_CONFIRM : 'Transition from this activity already exists.\nDo you want to create branching here?', - TRANSITION_TO_EXISTS_ERROR : 'Transition to this activity already exists', + DEFAULT_GROUPING_TITLE : '', + DEFAULT_GROUP_PREFIX : '', + DEFAULT_BRANCHING_TITLE : '', + DEFAULT_BRANCH_PREFIX : '', + DEFAULT_OPTIONAL_ACTIVITY_TITLE : '', + SUPPORT_ACTIVITY_TITLE : '', + GATE_ACTIVITY_LABEL : '', + BRANCHING_START_SUFFIX : '', + BRANCHING_END_SUFFIX : '', + REMOVE_ACTIVITY_CONFIRM : '', + BRANCHING_CREATE_CONFIRM : '', + TRANSITION_TO_EXISTS_ERROR : '', // DecorationLib - DEFAULT_ANNOTATION_LABEL_TITLE : 'Label', - REGION_FIT_BUTTON_TOOLTIP : 'Fit', + DEFAULT_ANNOTATION_LABEL_TITLE : '', + REGION_FIT_BUTTON_TOOLTIP : '', // General - NEW_FOLDER_BUTTON : 'New', - COPY_BUTTON : 'Copy', - PASTE_BUTTON : 'Paste', - DELETE_BUTTON : 'Delete', - RENAME_BUTTON : 'Rename', - OPEN_BUTTON : 'Open', - SAVE_BUTTON : 'Save', - FOLDER : 'folder', - SEQUENCE : 'sequence', - 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.', - 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?', - NEW_FOLDER_TITLE_PROMPT : 'Please enter the name for a new folder', - RENAME_TITLE_PROMPT : 'Please enter the new name for ', - SAVE_SEQUENCE_TITLE_PROMPT : 'Please enter a title for the sequence', - FOLDER_NOT_SELECTED_ERROR : 'Please choose a folder', - TITLE_VALIDATION_ERROR : 'The title can not contain any of these characters < > ^ * @ % $', - FOLDER_EXISTS_ERROR : 'A folder with this name already exists.', - SEQUENCE_EXISTS_ERROR : 'A sequence with this name already exists.', - SEQUENCE_SAVE_ERROR : 'Error while loading sequence', - SEQUENCE_NOT_SELECTED_ERROR : 'Please choose a sequence', - SEQUENCE_LOAD_ERROR : 'Error while loading the sequence', + NEW_FOLDER_BUTTON : '', + COPY_BUTTON : '', + PASTE_BUTTON : '', + DELETE_BUTTON : '', + RENAME_BUTTON : '', + OPEN_BUTTON : '', + SAVE_BUTTON : '', + IMPORT_BUTTON : '', + FOLDER : '', + SEQUENCE : '', + SEQUENCE_NOT_VALID : '', + SEQUENCE_VALIDATION_ISSUES : '', + SAVE_SUCCESSFUL : '', + NAVIGATE_AWAY_CONFIRM : '', + DELETE_NODE_CONFIRM : '', + SEQUENCE_OVERWRITE_CONFIRM : '', + NEW_FOLDER_TITLE_PROMPT : '', + RENAME_TITLE_PROMPT : '', + SAVE_SEQUENCE_TITLE_PROMPT : '', + IMPORT_PART_CHOOSE_PROMPT : '', + FOLDER_NOT_SELECTED_ERROR : '', + TITLE_VALIDATION_ERROR : '', + FOLDER_EXISTS_ERROR : '', + SEQUENCE_EXISTS_ERROR : '', + SEQUENCE_SAVE_ERROR : '', + SEQUENCE_NOT_SELECTED_ERROR : '', + SEQUENCE_LOAD_ERROR : '', // HandlerLib - TRANSITION_FROM_EXISTS_ERROR : 'Transition from this activity already exists', + TRANSITION_FROM_EXISTS_ERROR : '', // MenuLib - EXPORT_IMAGE_DIALOG_TITLE : 'Image export', - EXPORT_SEQUENCE_DIALOG_TITLE : 'Sequence export', - ACTIVITY_COPY_TITLE_PREFIX : 'Copy [0] of ', - PREVIEW_LESSON_DEFAULT_TITLE : 'Preview', - SAVE_DIALOG_TITLE : 'Save sequence', - OPEN_DIALOG_TITLE : 'Open sequence', + EXPORT_IMAGE_DIALOG_TITLE : '', + EXPORT_SEQUENCE_DIALOG_TITLE : '', + ACTIVITY_COPY_TITLE_PREFIX : '', + PREVIEW_LESSON_DEFAULT_TITLE : '', + SAVE_DIALOG_TITLE : '', + OPEN_DIALOG_TITLE : '', + IMPORT_PART_DIALOG_TITLE : '', RUN_SEQUENCES_FOLDER : '', - ARRANGE_CONFIRM : 'There are annotations on the canvas.\n' - + 'They will be not arranged automatically, you will have to adjust them manually later.\n' - + 'Do you want to continue?', - CLEAR_CANVAS_CONFIRM : 'Are you sure you want to remove all existing elements?', - BRANCHING_START_PLACE_PROMPT : 'Place the branching point', - BRANCHING_END_PLACE_PROMPT : 'Place the converge point', - ANNOTATION_REGION_PLACE_PROMPT : 'Click and hold to start drawing an annotation region', - ANNOTATION_LABEL_PLACE_PROMPT : 'Click to add an annotation label', - OPTIONAL_ACTIVITY_PLACE_PROMPT : 'Click to add an optional activity container.', - SUPPORT_ACTIVITY_PLACE_PROMPT : 'Click to add a support activity container.', - TRANSITION_PLACE_PROMPT : 'Click on an activity', - PASTE_ERROR : 'Sorry, you can not paste this type of activity', - PREVIEW_ERROR : 'Error while initialising lesson for preview', + ARRANGE_CONFIRM : '', + CLEAR_CANVAS_CONFIRM : '', + BRANCHING_START_PLACE_PROMPT : '', + BRANCHING_END_PLACE_PROMPT : '', + ANNOTATION_REGION_PLACE_PROMPT : '', + ANNOTATION_LABEL_PLACE_PROMPT : '', + OPTIONAL_ACTIVITY_PLACE_PROMPT : '', + SUPPORT_ACTIVITY_PLACE_PROMPT : '', + TRANSITION_PLACE_PROMPT : '', + PASTE_ERROR : '', + PREVIEW_ERROR : '', // PropertyLib - OK_BUTTON : 'OK', - CANCEL_BUTTON : 'Cancel', - CLEAR_ALL_BUTTON : 'Clear all', - REFRESH_BUTTON : 'Refresh', - REMOVE_CONDITION_BUTTON : 'Remove', - PROPERTIES_DIALOG_TITLE : 'Properties', - GROUP_NAMING_DIALOG_TITLE : 'Group Naming', - GROUPS_TO_BRANCHES_MATCH_DIALOG_TITLE : 'Match Groups to Branches', - BRANCH_MAPPING_GROUPS_HEADER : 'Groups', - BRANCH_MAPPING_GROUP_HEADER : 'Group', - CONDITIONS_DIALOG_TITLE : 'Select Output Conditions for Input', - BRANCH_MAPPING_CONDITIONS_HEADER : 'Conditions', - BRANCH_MAPPING_CONDITION_HEADER : 'Condition', - BRANCH_MAPPING_GATE_HEADER : 'Gate', - BRANCH_MAPPING_BRANCHES_HEADER : 'Branches', - BRANCH_MAPPING_BRANCH_HEADER : 'Branch', - GATE_STATE_MAPPING_DIALOG_TITLE : 'Map gate conditions', - BRANCH_MAPPING_DIALOG_TITLE : 'Match conditions to branches', - GATE_STATE_OPEN : 'open', - GATE_STATE_CLOSED : 'closed', - BRANCH_MAPPING_DEFAULT_BRANCH_SUFFIX : ' (default)', - COMPLEX_OUTPUT_SUFFIX : ' (user defined)', - RANGE_OUTPUT_SUFFIX : ' (range)', - RANGE_CONDITION_DESCRIPTION : 'Range [0] to [1]', - EXACT_CONDITION_DESCRIPTION : 'Exact value of ', - LESS_CONDITION_DESCRIPTION : 'Less than or eq ', - GREATER_CONDITION_DESCRIPTION : 'Greater than or eq ', - DEFAULT_RANGE_CONDITION_TITLE_PREFIX : 'Untitled ', - CLEAR_ALL_CONFIRM : 'There are conditions linked to an existing branch.\nDo you wish to remove them?', - REMOVE_CONDITION_CONFIRM : 'This condition is linked to an existing branch.\nDo you wish to remove it?', - REFRESH_CONDITIONS_CONFIRM : 'You are about to update your conditions for the selected output definition.\n' - + 'This will clear all links to existing branches.\nDo you wish to continue?', - CONDITIONS_TO_DEFAULT_GATE_STATE_CONFIRM : 'All remaining conditions will be mapped to the selected gate\'s closed state', - CONDITIONS_TO_DEFAULT_BRANCH_CONFIRM : 'All remaining conditions will be mapped to the default branch', - GROUPS_TO_DEFAULT_BRANCH_CONFIRM : 'All remaining groups will be mapped to the default branch', - RANGE_CONDITION_ADD_START_ERROR : 'The start value can not be within the range of an existing condition', - RANGE_CONDITION_ADD_END_ERROR : 'The end value can not be within the range of an existing condition', - GROUP_TITLE_VALIDATION_ERORR : 'Group name can not contain any of these characters < > ^ * @ % $' + OK_BUTTON : '', + CANCEL_BUTTON : '', + CLEAR_ALL_BUTTON : '', + REFRESH_BUTTON : '', + REMOVE_CONDITION_BUTTON : '', + PROPERTIES_DIALOG_TITLE : '', + GROUP_NAMING_DIALOG_TITLE : '', + GROUPS_TO_BRANCHES_MATCH_DIALOG_TITLE : '', + BRANCH_MAPPING_GROUPS_HEADER : '', + BRANCH_MAPPING_GROUP_HEADER : '', + CONDITIONS_DIALOG_TITLE : '', + BRANCH_MAPPING_CONDITIONS_HEADER : '', + BRANCH_MAPPING_CONDITION_HEADER : '', + BRANCH_MAPPING_GATE_HEADER : '', + BRANCH_MAPPING_BRANCHES_HEADER : '', + BRANCH_MAPPING_BRANCH_HEADER : '', + GATE_STATE_MAPPING_DIALOG_TITLE : '', + BRANCH_MAPPING_DIALOG_TITLE : '', + GATE_STATE_OPEN : '', + GATE_STATE_CLOSED : '', + BRANCH_MAPPING_DEFAULT_BRANCH_SUFFIX : '', + COMPLEX_OUTPUT_SUFFIX : '', + RANGE_OUTPUT_SUFFIX : '', + RANGE_CONDITION_DESCRIPTION : '', + EXACT_CONDITION_DESCRIPTION : '', + LESS_CONDITION_DESCRIPTION : '', + GREATER_CONDITION_DESCRIPTION : '', + DEFAULT_RANGE_CONDITION_TITLE_PREFIX : '', + CLEAR_ALL_CONFIRM : '', + REMOVE_CONDITION_CONFIRM : '', + REFRESH_CONDITIONS_CONFIRM : '', + CONDITIONS_TO_DEFAULT_GATE_STATE_CONFIRM : '', + CONDITIONS_TO_DEFAULT_BRANCH_CONFIRM : '', + GROUPS_TO_DEFAULT_BRANCH_CONFIRM : '', + RANGE_CONDITION_ADD_START_ERROR : '', + RANGE_CONDITION_ADD_END_ERROR : '', + GROUP_TITLE_VALIDATION_ERORR : '', }, isReadOnlyMode = false, + activitiesOnlySelectable = false, initContentFolderID = '${contentFolderID}', initLearningDesignID = '${param.learningDesignID}', initAccess = ${access}; @@ -159,95 +160,96 @@
- New +
- Open +
 
    -
  • Import
  • +
  • +
- Save +
 
    -
  • Save as
  • -
  • Export +
  • +
    • Sequence LAMS
    • + onClick="javascript:MenuLib.exportLearningDesign(1)">
    • Sequence IMS
    • -
    • Image PNG
    • -
    • Image SVG
    • + title="" + onClick="javascript:MenuLib.exportLearningDesign(2)"> +
    • +
- Copy +
- Paste +
- Transition +
- Optional +
 
    -
  • Activity
  • -
  • Support
  • +
  • +
- Flow +
 
    -
  • Gate
  • -
  • Branch
  • +
  • +
- Group +
- Annotate +
 
    -
  • Label
  • -
  • Region
  • +
  • +
- Arrange +
- Preview +
- From: To: + +
- Add +
-
Name:
+
    - - + +
    NameCondition
    - Please wait for the download.
    Close the dialog when the download is finished.
    +
    Index: lams_central/web/authoring/svgGenerator.jsp =================================================================== diff -u -rb92a2c77d9fc93b3a4100d70f95d31a78c4b6792 -re837b7b90d6cbae5ecf051b9c9ba61b3097e0c51 --- lams_central/web/authoring/svgGenerator.jsp (.../svgGenerator.jsp) (revision b92a2c77d9fc93b3a4100d70f95d31a78c4b6792) +++ lams_central/web/authoring/svgGenerator.jsp (.../svgGenerator.jsp) (revision e837b7b90d6cbae5ecf051b9c9ba61b3097e0c51) @@ -7,32 +7,36 @@ - SVG Generator + <fmt:message key="authoring.fla.page.svg.generator.title" /> + + + Index: lams_central/web/css/authoring.css =================================================================== diff -u -r7676f06ab1c200a434600195e4380a30a7b8264b -re837b7b90d6cbae5ecf051b9c9ba61b3097e0c51 --- lams_central/web/css/authoring.css (.../authoring.css) (revision 7676f06ab1c200a434600195e4380a30a7b8264b) +++ lams_central/web/css/authoring.css (.../authoring.css) (revision e837b7b90d6cbae5ecf051b9c9ba61b3097e0c51) @@ -134,14 +134,20 @@ div#ldStoreDialog div#ldStoreDialogCanvasDiv { overflow: auto; - height: 665px; + /* height: 665px; */ } div#ldStoreDialog img#ldScreenshotLoading { padding-top: 200px; } -.ldStoreDialogLoad .ldStoreDialogSaveOnly { +div#ldStoreDialog #ldStoreDialogImportPartFrame { + border: none; + width: 99%; +} + +.ldStoreDialogLoad .ldStoreDialogSaveOnly, +.ldStoreDialogImportPart .ldStoreDialogSaveOnly { display: none; } Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== diff -u -rfe06d16b234341fc965d9b40494e6a2fb4cb9438 -re837b7b90d6cbae5ecf051b9c9ba61b3097e0c51 --- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision fe06d16b234341fc965d9b40494e6a2fb4cb9438) +++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision e837b7b90d6cbae5ecf051b9c9ba61b3097e0c51) @@ -180,7 +180,7 @@ /** * Constructor for a Parallel (double) Activity */ - ParallelActivity : function(id, uiid, learningLibraryID, x, y, title, childActivityDefs){ + ParallelActivity : function(id, uiid, learningLibraryID, x, y, title, childActivities){ DecorationDefs.Container.call(this, id, uiid, title); this.id = +id || null; @@ -190,8 +190,8 @@ 'from' : [], 'to' : [] }; - if (childActivityDefs){ - this.childActivityDefs = childActivityDefs; + if (childActivities){ + this.childActivities = childActivities; } if (!isReadOnlyMode){ @@ -299,25 +299,25 @@ /** * Draws a Floating (support) Activity container */ - floatingActivity : function(x, y, ignoredParam1, ignoredParam2, childActivityDefs) { + floatingActivity : function(x, y, ignoredParam1, ignoredParam2, childActivities) { if (x == undefined || y == undefined) { // if no new coordinates are given, just redraw the activity x = this.items.shape.getBBox().x; y = this.items.shape.getBBox().y; } // either check what children are on canvas or use the priovided parameter - if (childActivityDefs) { - this.childActivityDefs = childActivityDefs; + if (childActivities) { + this.childActivities = childActivities; } - if (this.childActivityDefs && this.childActivityDefs.length > 0) { + if (this.childActivities && this.childActivities.length > 0) { // draw one by one, horizontally var activityX = x + layout.conf.containerActivityPadding, allElements = paper.set(), floatingActivity = this, box = this.items.shape.getBBox(); - $.each(this.childActivityDefs, function(orderID){ + $.each(this.childActivities, function(orderID){ this.parentActivity = floatingActivity; this.orderID = orderID; var childBox = this.items.shape.getBBox(); @@ -409,25 +409,25 @@ /** * Draws an Optional Activity container */ - optionalActivity : function(x, y, ignoredParam1, ignoredParam2, childActivityDefs) { + optionalActivity : function(x, y, ignoredParam1, ignoredParam2, childActivities) { if (x == undefined || y == undefined) { // if no new coordinates are given, just redraw the activity x = this.items.shape.getBBox().x; y = this.items.shape.getBBox().y; } // either check what children are on canvas or use the priovided parameter - if (childActivityDefs) { - this.childActivityDefs = childActivityDefs; + if (childActivities) { + this.childActivities = childActivities; } - if (this.childActivityDefs && this.childActivityDefs.length > 0) { + if (this.childActivities && this.childActivities.length > 0) { // draw one by one, vertically var activityY = y + layout.conf.containerActivityPadding + 10, allElements = paper.set(), optionalActivity = this, box = this.items.shape.getBBox(); - $.each(this.childActivityDefs, function(orderID){ + $.each(this.childActivities, function(orderID){ this.parentActivity = optionalActivity; this.orderID = orderID + 1; var childBox = this.items.shape.getBBox(); @@ -469,12 +469,12 @@ y = this.items.shape.getBBox().y; } - if (this.childActivityDefs && this.childActivityDefs.length > 0) { + if (this.childActivities && this.childActivities.length > 0) { // draw one by one, vertically var activityY = y + layout.conf.containerActivityPadding + 10, allElements = paper.set(), optionalActivity = this; - $.each(this.childActivityDefs, function(orderID){ + $.each(this.childActivities, function(orderID){ this.parentActivity = optionalActivity; this.orderID = orderID + 1; this.draw(x + layout.conf.containerActivityPadding, activityY); @@ -606,7 +606,14 @@ activityHandlersInit : function(activity) { activity.items.data('parentObject', activity); - if (!isReadOnlyMode) { + if (isReadOnlyMode) { + if (activitiesOnlySelectable) { + activity.items.click(HandlerLib.itemClickHandler) + .attr({ + 'cursor' : 'pointer' + }); + } + } else { // set all the handlers activity.items.mousedown(HandlerActivityLib.activityMousedownHandler) .click(HandlerLib.itemClickHandler) @@ -728,11 +735,11 @@ object.items.selectEffect = true; // also select encapsulated activities - var childActivityDefs = DecorationLib.getChildActivityDefs(object.items.shape); - if (childActivityDefs.length > 0) { + var childActivities = DecorationLib.getChildActivities(object.items.shape); + if (childActivities.length > 0) { object.items.fitButton.show(); - $.each(childActivityDefs, function(){ + $.each(childActivities, function(){ if (!this.parentActivity || !(this.parentActivity instanceof DecorationDefs.Container)) { ActivityLib.addSelectEffect(this, false); } @@ -763,6 +770,33 @@ 'stroke-dasharray' : '-' }); object.items.push(object.items.selectEffect); + + // if it's "import part" select children activities + if (activitiesOnlySelectable) { + if (object instanceof ActivityDefs.BranchingEdgeActivity) { + if (object.isStart){ + ActivityLib.addSelectEffect(object.branchingActivity.end); + + $.each(object.branchingActivity.branches, function(){ + var transition = this.transitionFrom; + while (transition) { + var activity = transition.toActivity; + if (activity instanceof ActivityDefs.BranchingEdgeActivity) { + return true; + } + ActivityLib.addSelectEffect(activity); + transition = activity.transitions.from.length > 0 ? activity.transitions.from[0] : null; + } + }); + } else { + ActivityLib.addSelectEffect(object.branchingActivity.start); + } + } else if (object instanceof DecorationDefs.Container){ + $.each(object.childActivities, function(){ + ActivityLib.addSelectEffect(this); + }); + } + } } // make it officially marked? @@ -844,7 +878,6 @@ } } - if (transition) { ActivityLib.removeTransition(transition, redraw); } @@ -913,8 +946,8 @@ if (!(activity instanceof ActivityDefs.OptionalActivity || activity instanceof ActivityDefs.FloatingActivity)) { // check if it was removed from an Optional or Floating Activity if (activity.parentActivity && activity.parentActivity instanceof DecorationDefs.Container) { - var childActivityDefs = DecorationLib.getChildActivityDefs(activity.parentActivity.items.shape); - if ($.inArray(activity, childActivityDefs) == -1) { + var childActivities = DecorationLib.getChildActivities(activity.parentActivity.items.shape); + if ($.inArray(activity, childActivities) == -1) { activity.parentActivity.draw(); ActivityLib.redrawTransitions(activity.parentActivity); activity.parentActivity = null; @@ -935,7 +968,7 @@ }); } if (container) { - if ($.inArray(activity, container.childActivityDefs) == -1) { + if ($.inArray(activity, container.childActivities) == -1) { $.each(activity.transitions.from, function(){ ActivityLib.removeTransition(this); }); @@ -946,8 +979,8 @@ // for properties dialog to reload ActivityLib.removeSelectEffect(container); - container.childActivityDefs.push(activity); - container.draw(null, null, null, null, childActivityDefs); + container.childActivities.push(activity); + container.draw(null, null, null, null, childActivities); ActivityLib.redrawTransitions(container); } } @@ -1066,12 +1099,12 @@ // remove the activity from parent activity if (activity.parentActivity && activity.parentActivity instanceof DecorationDefs.Container) { - activity.parentActivity.childActivityDefs.splice(activity.parentActivity.childActivityDefs.indexOf(activity), 1); + activity.parentActivity.childActivities.splice(activity.parentActivity.childActivities.indexOf(activity), 1); } // remove child activities if (activity instanceof DecorationDefs.Container) { - $.each(activity.childActivityDefs, function(){ + $.each(activity.childActivities, function(){ ActivityLib.removeActivity(this); }); } @@ -1092,7 +1125,9 @@ } if (object) { - if (object.items.selectEffect) { + var selectEffect = object.items.selectEffect; + if (selectEffect) { + object.items.selectEffect = null; // different effects for different types of objects if (object instanceof DecorationDefs.Region) { object.items.shape.attr({ @@ -1102,21 +1137,59 @@ object.items.fitButton.hide(); object.items.resizeButton.hide(); - var childActivityDefs = DecorationLib.getChildActivityDefs(object.items.shape); - $.each(childActivityDefs, function(){ + var childActivities = DecorationLib.getChildActivities(object.items.shape); + $.each(childActivities, function(){ ActivityLib.removeSelectEffect(this); }); } else if (object instanceof ActivityDefs.Transition) { // just redraw the transition, it's easier object.draw(); } else { - object.items.selectEffect.remove(); + selectEffect.remove(); + + // if it's "import part" do special processing for branching + if (activitiesOnlySelectable) { + if (object instanceof ActivityDefs.BranchingEdgeActivity) { + if (object.isStart) { + ActivityLib.removeSelectEffect(object.branchingActivity.end); + + // deselect all children in branches + $.each(object.branchingActivity.branches, function(){ + var transition = this.transitionFrom; + while (transition) { + var activity = transition.toActivity; + if (activity instanceof ActivityDefs.BranchingEdgeActivity) { + return true; + } + ActivityLib.removeSelectEffect(activity); + transition = activity.transitions.from.length > 0 ? activity.transitions.from[0] : null; + } + }); + } else { + ActivityLib.removeSelectEffect(object.branchingActivity.start); + } + } + + // deselect Parallel Activity children + $.each(layout.activities, function(){ + if (this instanceof ActivityDefs.ParallelActivity && this.childActivities.indexOf(object) > -1){ + ActivityLib.removeSelectEffect(this); + $.each(this.childActivities, function(){ + if (this != object) { + this.items.selectEffect.remove(); + this.items.selectEffect = null; + } + }); + } + }); + } } - object.items.selectEffect = null; } - // no selected activity = no properties dialog - layout.propertiesDialog.dialog('close'); + if (layout.propertiesDialog) { + // no selected activity = no properties dialog + layout.propertiesDialog.dialog('close'); + } layout.selectedObject = null; } }, Index: lams_central/web/includes/javascript/authoring/authoringDecoration.js =================================================================== diff -u -rfe06d16b234341fc965d9b40494e6a2fb4cb9438 -re837b7b90d6cbae5ecf051b9c9ba61b3097e0c51 --- lams_central/web/includes/javascript/authoring/authoringDecoration.js (.../authoringDecoration.js) (revision fe06d16b234341fc965d9b40494e6a2fb4cb9438) +++ lams_central/web/includes/javascript/authoring/authoringDecoration.js (.../authoringDecoration.js) (revision e837b7b90d6cbae5ecf051b9c9ba61b3097e0c51) @@ -14,7 +14,7 @@ this.id = +id || null; this.uiid = +uiid || (layout.ld ? ++layout.ld.maxUIID : null); this.title = title; - this.childActivityDefs = []; + this.childActivities = []; this.drawContainer = DecorationDefs.methods.container.draw; this.fit = DecorationDefs.methods.container.fit; @@ -46,7 +46,7 @@ Region : function(id, uiid, x, y, x2, y2, title, color) { DecorationDefs.Container.call(this, id, uiid, title); // we don't use it for region - this.childActivityDefs = null; + this.childActivities = null; this.draw = DecorationDefs.methods.region.draw; @@ -63,9 +63,9 @@ draw : function(x, y, x2, y2, color){ // check for new coordinates or just take them from the existing shape - var box = this.items ? this.items.shape.getBBox() : null, - x = x ? x : box.x, - y = y ? y : box.y, + var box = this.items ? this.items.shape.getBBox() : null, + x = x != undefined ? x : box.x, + y = y != undefined ? y : box.y, // take into account minimal size of rectangle x2 = x2 ? Math.max(x2, x + layout.conf.regionEmptyWidth) : x + box.width, y2 = y2 ? Math.max(y2, y + layout.conf.regionEmptyHeight) : y + box.height, @@ -97,7 +97,12 @@ .toBack(); this.items.push(this.items.shape); - if (!isReadOnlyMode){ + if (isReadOnlyMode){ + if (activitiesOnlySelectable) { + this.items.shape.attr('cursor', 'pointer'); + this.items.click(HandlerLib.itemClickHandler); + } + } else { this.items.shape.attr('cursor', 'pointer'); this.items.mousedown(HandlerDecorationLib.containerMousedownHandler) .click(HandlerLib.itemClickHandler); @@ -109,15 +114,15 @@ * Adjust the annotation so it envelops its child activities and nothing more. */ fit : function() { - var childActivityDefs = DecorationLib.getChildActivityDefs(this.items.shape); - if (childActivityDefs.length == 0) { + var childActivities = DecorationLib.getChildActivities(this.items.shape); + if (childActivities.length == 0) { return; } ActivityLib.removeSelectEffect(this); var allElements = paper.set(); - $.each(childActivityDefs, function(){ + $.each(childActivities, function(){ allElements.push(this.items.shape); }); // big rectangle enveloping all child activities @@ -242,7 +247,7 @@ /** * Get activities enveloped by given container */ - getChildActivityDefs : function(shape){ + getChildActivities : function(shape){ var result = []; $.each(layout.activities, function(){ if (shape != this.items.shape) { @@ -259,7 +264,7 @@ var parentObject = shape.data('parentObject'); // store the result in the shape's object if (parentObject && !(parentObject instanceof DecorationDefs.Region)) { - parentObject.childActivityDefs = result; + parentObject.childActivities = result; } return result; }, Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -r7676f06ab1c200a434600195e4380a30a7b8264b -re837b7b90d6cbae5ecf051b9c9ba61b3097e0c51 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 7676f06ab1c200a434600195e4380a30a7b8264b) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision e837b7b90d6cbae5ecf051b9c9ba61b3097e0c51) @@ -44,6 +44,8 @@ 'modified' : false, // list of all dialogs, so they can be easily closed all at once 'dialogs' : [], + // stores precached tool images so they can be used in exported SVG + 'iconLib' : {}, // icons for special activities 'toolMetadata': { 'gate' : { @@ -53,6 +55,7 @@ 'iconPath' : '../images/grouping.gif' } }, + // graphics contants 'conf' : { 'arrangeHorizontalSpace' : 200, @@ -151,17 +154,6 @@ 'parallelChildActivityDefs' : parallelChildActivityDefs }; - - if (/\.svg$/i.test(iconPath)){ - $.ajax({ - url : iconPath, - dataType : 'text', - success : function(response) { - layout.toolMetadata[learningLibraryID].iconCode = response.substring(response.indexOf(' 0) { + $.each(addActivities, function(){ + var activity = this; + if (activity.childActivities) { + $.each(selectedActivities, function(){ + if (this.uiid == activity.uiid) { + $.each(this.childActivities, function(){ + var childActivity = this; + $.each(addActivities, function(){ + if (this.uiid == childActivity.uiid) { + if (!activity.childActivities) { + activity.childActivities = []; + } + activity.childActivities.push(this); + // container will expand to its child activities + activity.draw(0, 0); + } + }); + }); + } + }); + } + }); + + // put UIID specific to current LD + $.each(addActivities, function(){ + if (this instanceof ActivityDefs.BranchingEdgeActivity) { + if (this.isStart) { + this.branchingActivity.uiid = ++layout.ld.maxUIID; + } + } else { + this.uiid = ++layout.ld.maxUIID; + } + }); + + // arrange just the new activities + GeneralLib.arrangeActivities(addActivities); + + layout.activities = layout.activities.concat(addActivities); + } + + dialog.dialog('close'); + } + } + ]), + 'open' : function(){ GeneralLib.showLearningDesignThumbnail(); @@ -652,17 +732,129 @@ $('.defaultFocus').focus(); $(this).dialog('option', 'copiedResource', null); + }, + + /** + * Extracts a selected activity from another LD. + */ + 'importActivity' : function(activity, addActivities) { + $.each(addActivities, function(){ + if (this.uiid == activity.uiid) { + return; + } + }); + + // activities in the another LD have different clousures, so they can not be imported directly + // they need to be recreated from a scratch with current LD being their context + var frameWindow = $('#ldStoreDialogImportPartFrame', layout.ldStoreDialog)[0].contentWindow, + frameActivities = frameWindow.layout.activities, + frameActivityDefs = frameWindow.ActivityDefs, + // the local activity + addActivity = null; + + if (activity instanceof frameActivityDefs.BranchingEdgeActivity) { + // add both branching edges right away + if (activity.isStart) { + var branchingActivity = activity.branchingActivity, + branchingEdge = addActivity = new ActivityDefs.BranchingEdgeActivity( + null, branchingActivity.uiid, 0, 0, branchingActivity.title, branchingActivity.branchingType); + + branchingEdge = new ActivityDefs.BranchingEdgeActivity( + null, null, 0, 0, null, null, branchingEdge.branchingActivity); + addActivities.push(branchingEdge); + + if (branchingActivity.branchingType == 'optional'){ + branchingEdge.branchingActivity.minOptions = branchingActivity.minOptions; + branchingEdge.branchingActivity.maxOptions = branchingActivity.maxOptions; + } + } + } else if (activity instanceof frameActivityDefs.FloatingActivity) { + if (layout.floatingActivity) { + return; + } + addActivity = new ActivityDefs.FloatingActivity(null, activity.uiid, 0, 0); + } else if (activity instanceof frameActivityDefs.GateActivity) { + addActivity = new ActivityDefs.GateActivity( + null, activity.uiid, 0, 0, activity.title, activity.description, activity.gateType, + activity.startTimeoffset, activity.gateActivityCompletionBased + ); + } else if (activity instanceof frameActivityDefs.GroupingActivity) { + addActivity = new ActivityDefs.GroupingActivity( + null, activity.uiid, 0, 0, activity.title, null, null, activity.groupingType, activity.groupDivide, + activity.groupCount, activity.learnerCount, activity.equalSizes, activity.viewLearners, null + ); + } else if (activity instanceof frameActivityDefs.OptionalActivity) { + addActivity = new ActivityDefs.OptionalActivity( + null, activity.uiid, 0, 0, activity.title, activity.minOptions, activity.maxOptions + ); + } else if (activity instanceof frameActivityDefs.ParallelActivity) { + addActivity = new ActivityDefs.ParallelActivity( + null, activity.uiid, activity.learningLibraryID, 0, 0, activity.title + ); + } else if (activity instanceof frameActivityDefs.ToolActivity) { + addActivity = new ActivityDefs.ToolActivity( + null, activity.uiid, null, activity.toolID, activity.learningLibraryID, null, 0, 0, activity.title + ); + } + + // recreate the transitions + if (addActivity) { + if (activity.transitions) { + $.each(activity.transitions.from, function(){ + var transition = this; + $.each(addActivities, function(){ + // special processing for transitions from/to branching edges + var uiid = this instanceof ActivityDefs.BranchingEdgeActivity + ? this.branchingActivity.uiid : this.uiid, + toUiid = transition.toActivity instanceof frameActivityDefs.BranchingEdgeActivity + ? transition.toActivity.branchingActivity.uiid : transition.toActivity.uiid; + // isStart can be undefined, true or false + if (uiid == toUiid && this.isStart == transition.toActivity.isStart) { + ActivityLib.addTransition(addActivity, this, true, null, null, + transition.branch ? transition.branch.title : null); + return false; + } + }); + }); + + $.each(activity.transitions.to, function(){ + var transition = this; + $.each(addActivities, function(){ + var uiid = this instanceof ActivityDefs.BranchingEdgeActivity + ? this.branchingActivity.uiid : this.uiid, + fromUiid = transition.fromActivity instanceof frameActivityDefs.BranchingEdgeActivity + ? transition.fromActivity.branchingActivity.uiid : transition.fromActivity.uiid; + if (uiid == fromUiid && this.isStart == transition.fromActivity.isStart) { + ActivityLib.addTransition(this, addActivity, true, null, null, + transition.branch ? transition.branch.title : null); + return false; + } + }); + }); + } + + addActivities.push(addActivity); + } } }); layout.dialogs.push(layout.ldStoreDialog); + $('#ldScreenshotAuthor', layout.ldStoreDialog).load(function(){ // hide "loading" animation - $('.ldChoiceDependentCanvasElement', layout.ldStoreDialog).css('display', 'none'); + $('.ldChoiceDependentCanvasElement', layout.ldStoreDialog).hide(); // show the thumbnail - $(this).css('display', 'inline'); + $(this).show(); }); + + $('#ldStoreDialogImportPartFrame').load(function() { + if (!$(this).attr('src')){ + return; + } + + $(this).css('visibility', 'visible').height(+$(this).contents().find('svg').attr('height') + 20); + }); // there should be no focus, just highlight YAHOO.widget.TreeView.FOCUS_CLASS_NAME = null; @@ -685,14 +877,14 @@ }); tree.singleNodeHighlight = true; tree.subscribe('clickEvent', function(event){ - var isSaveDialog = layout.ldStoreDialog.hasClass('ldStoreDialogSave'); + var isSaveDialog = layout.ldStoreDialog.closest('.ui-dialog').hasClass('ldStoreDialogSave'); $('.leftDialogButton') .attr('disabled', event.node.highlightState > 0 ? 'disabled' : null) .button('option', 'disabled', event.node.highlightState > 0); if (!isSaveDialog && !event.node.data.learningDesignId){ - // it is a folder in load sequence dialog, hightlight but stop processing + // it is a folder in load sequence dialog, highlight but stop processing return true; } @@ -714,13 +906,15 @@ 'hide' : 'fold', 'draggable' : false, 'dialogClass': 'dialog-no-title', - 'position' : { + 'defaultPosition' : { my: "right top", at: "right top+5px", of: '#canvas' } }); + layout.infoDialog.dialog('option', 'position', layout.infoDialog.dialog('option', 'defaultPosition')); + layout.dialogs.push(layout.infoDialog); // license widgets init @@ -774,14 +968,18 @@ /** * Sorts activities on canvas. */ - arrangeActivities : function(){ - if ((layout.regions.length > 0 || layout.labels.length > 0) - && !isReadOnlyMode && !confirm(LABELS.ARRANGE_CONFIRM)) { + arrangeActivities : function(activities){ + // when importing parts of another LD, activities get appended and only they get sorted + var append = activities, + activities = activities || layout.activities; + + if (activities.length == 0) { + // no activities, nothing to do return; } - - if (layout.activities.length == 0) { - // no activities, nothing to do + + if (!append && (layout.regions.length > 0 || layout.labels.length > 0) + && !isReadOnlyMode && !confirm(LABELS.ARRANGE_CONFIRM)) { return; } @@ -790,11 +988,20 @@ HandlerLib.resetCanvasMode(true); } + var row = 0; + if (append) { + // find the lowest existing activity and append the new activities beneath + $.each(layout.activities, function(){ + row = Math.max(row, + Math.ceil((this.items.getBBox().y2 - layout.conf.arrangeVerticalPadding) + / layout.conf.arrangeVerticalSpace)); + }); + } + // activities are arranged in a grid - var row = 0, + var column = 0, // for special cases when row needs to shifted more forceRowY = null, - column = 0, // check how many columns current paper can hold maxColumns = Math.floor((paper.width - layout.conf.arrangeHorizontalPadding) / layout.conf.arrangeHorizontalSpace), @@ -805,15 +1012,15 @@ // just to speed up processing when there are only activities with no transitions left onlyDetachedLeft = false; - $.each(layout.activities, function(){ + $.each(activities, function(){ if (!this.parentActivity || !(this.parentActivity instanceof DecorationDefs.Container)){ activitiesCopy.push(this); } }); // branches will not be broken into few rows; if they are long, paper will be resized // find the longes branch to find the new paper size - $.each(layout.activities, function(){ + $.each(activities, function(){ if (this instanceof ActivityDefs.BranchingEdgeActivity && this.isStart) { // refresh branching metadata ActivityLib.updateBranchesLength(this.branchingActivity); @@ -826,8 +1033,8 @@ }); // check how many child activities are in Floating Activity, if any - if (layout.floatingActivity && layout.floatingActivity.childActivityDefs.length > subsequenceMaxLength) { - subsequenceMaxLength = childActivityDefs.length; + if (layout.floatingActivity && layout.floatingActivity.childActivities.length > subsequenceMaxLength) { + subsequenceMaxLength = childActivities.length; } // resize paper horizontally, if needed @@ -956,7 +1163,7 @@ // learn where a tall Optional Activity has its end // and later start drawing activities lower than in the next row - if (activity instanceof DecorationDefs.Container && activity.childActivityDefs.length > 1) { + if (activity instanceof DecorationDefs.Container && activity.childActivities.length > 1) { var activityEndY = activity.items.shape.getBBox().y2; if (!forceRowY || activityEndY > forceRowY) { forceRowY = activityEndY; @@ -1043,7 +1250,7 @@ } // redraw transitions one by one - $.each(layout.activities, function(){ + $.each(activities, function(){ $.each(this.transitions.from.slice(), function(){ ActivityLib.addTransition(this.fromActivity, this.toActivity, true); }); @@ -1437,10 +1644,10 @@ if (layout.floatingActivity && layout.floatingActivity.id == activityData.parentActivityID) { // add a Tool Activity as a Floating Activity element - if (!layout.floatingActivity.childActivityDefs) { - layout.floatingActivity.childActivityDefs = []; + if (!layout.floatingActivity.childActivities) { + layout.floatingActivity.childActivities = []; } - layout.floatingActivity.childActivityDefs.push(activity); + layout.floatingActivity.childActivities.push(activity); activity.parentActivity = layout.floatingActivity; if (!arrangeNeeded){ // if no auto re-arrange will be done, just redraw the container with its child activities @@ -1455,10 +1662,10 @@ && (this instanceof ActivityDefs.ParallelActivity || this instanceof ActivityDefs.OptionalActivity)) { // add a Tool Activity as a Optional/Parallel Activity element - if (!this.childActivityDefs) { - this.childActivityDefs = []; + if (!this.childActivities) { + this.childActivities = []; } - this.childActivityDefs.push(activity); + this.childActivities.push(activity); activity.parentActivity = this; if (!arrangeNeeded) { // if no auto re-arrange will be done, just redraw the container with its child activities @@ -1614,11 +1821,11 @@ GeneralLib.updateAccess(response.access); if (!ld.validDesign && !isReadOnlyMode) { - var dialog = layout.infoDialog.html(LABELS.SEQUENCE_NOT_VALID); - dialog.dialog('open'); + layout.infoDialog.text(LABELS.SEQUENCE_NOT_VALID) + .dialog('open'); setTimeout(function(){ - dialog.text('').dialog('close'); + layout.infoDialog.text('').dialog('close'); }, 5000); } } @@ -2239,16 +2446,27 @@ */ showLearningDesignThumbnail : function(learningDesignID, title) { // display "loading" animation and finally LD thumbnail - $('.ldChoiceDependentCanvasElement').css('display', 'none'); + $('.ldChoiceDependentCanvasElement').hide(); + // the "import part" frame can't use "display:none" CSS attribute as its JS won't execute right + $('#ldStoreDialogImportPartFrame', layout.ldStoreDialog).css('visibility', 'hidden'); + if (learningDesignID) { - $('#ldScreenshotLoading', layout.ldStoreDialog).css('display', 'inline'); - // get the image of the chosen LD and prevent caching - $('#ldScreenshotAuthor', layout.ldStoreDialog) - .attr('src', LD_THUMBNAIL_URL_BASE + learningDesignID + '&_=' + new Date().getTime()) - .css({ - 'width' : 'auto', - 'height' : 'auto' - }); + if (layout.ldStoreDialog.closest('.ui-dialog').hasClass('ldStoreDialogImportPart')) { + // get read-only Authoring of the chosen LD and prevent caching + $('#ldStoreDialogImportPartFrame', layout.ldStoreDialog).attr('src', + LAMS_URL + 'authoring/author.do?method=generateSVG&selectable=true&learningDesignID=' + + learningDesignID + '&_=' + new Date().getTime()); + } else { + $('#ldScreenshotLoading', layout.ldStoreDialog).show(); + // get the image of the chosen LD and prevent caching + $('#ldScreenshotAuthor', layout.ldStoreDialog) + .attr('src', LD_THUMBNAIL_URL_BASE + learningDesignID + '&_=' + new Date().getTime()) + .css({ + 'width' : 'auto', + 'height' : 'auto' + }); + } + if (title) { // copy title of the highligthed sequence to title field $('#ldStoreDialogNameField').val(title).focus(); @@ -2322,7 +2540,7 @@ return; } - var isSaveDialog = layout.ldStoreDialog.hasClass('ldStoreDialogSave'), + var isSaveDialog = layout.ldStoreDialog.closest('.ui-dialog').hasClass('ldStoreDialogSave'), learningDesignID = +accessEntry.attr('learningDesignId'), title = isSaveDialog ? accessEntry.text() : null; Index: lams_central/web/includes/javascript/authoring/authoringHandler.js =================================================================== diff -u -rb92a2c77d9fc93b3a4100d70f95d31a78c4b6792 -re837b7b90d6cbae5ecf051b9c9ba61b3097e0c51 --- lams_central/web/includes/javascript/authoring/authoringHandler.js (.../authoringHandler.js) (revision b92a2c77d9fc93b3a4100d70f95d31a78c4b6792) +++ lams_central/web/includes/javascript/authoring/authoringHandler.js (.../authoringHandler.js) (revision e837b7b90d6cbae5ecf051b9c9ba61b3097e0c51) @@ -63,10 +63,10 @@ // hide child activities while moving the parent around if (sticky) { - $.each(parentObject.childActivityDefs, function(){ + $.each(parentObject.childActivities, function(){ this.items.hide(); - if (this.childActivityDefs) { - $.each(this.childActivityDefs, function() { + if (this.childActivities) { + $.each(this.childActivities, function() { this.items.hide(); }); } @@ -163,7 +163,15 @@ var parentObject = this.data('parentObject'); // inform that user wants to select, not drag the activity parentObject.items.clicked = true; - if (parentObject != layout.selectedObject) { + + // if it's "import part" allow multiple selection of activities + if (activitiesOnlySelectable) { + if (parentObject.items.selectEffect) { + ActivityLib.removeSelectEffect(parentObject); + } else { + ActivityLib.addSelectEffect(parentObject); + } + } else if (parentObject != layout.selectedObject) { HandlerLib.canvasClickHandler(event); ActivityLib.addSelectEffect(parentObject, true); } @@ -364,9 +372,9 @@ }); // immediatelly show which activities will be enveloped - var childActivityDefs = DecorationLib.getChildActivityDefs(data.shape); + var childActivities = DecorationLib.getChildActivities(data.shape); $.each(layout.activities, function(){ - if (!this.parentActivity && $.inArray(this, childActivityDefs) > -1){ + if (!this.parentActivity && $.inArray(this, childActivities) > -1){ ActivityLib.addSelectEffect(this, false); } else { ActivityLib.removeSelectEffect(this); Index: lams_central/web/includes/javascript/authoring/authoringMenu.js =================================================================== diff -u -rfe06d16b234341fc965d9b40494e6a2fb4cb9438 -re837b7b90d6cbae5ecf051b9c9ba61b3097e0c51 --- lams_central/web/includes/javascript/authoring/authoringMenu.js (.../authoringMenu.js) (revision fe06d16b234341fc965d9b40494e6a2fb4cb9438) +++ lams_central/web/includes/javascript/authoring/authoringMenu.js (.../authoringMenu.js) (revision e837b7b90d6cbae5ecf051b9c9ba61b3097e0c51) @@ -304,11 +304,10 @@ var startActivity = null, targetElement = paper.getElementByPoint(event.pageX, event.pageY); - if (targetElement) { startActivity = targetElement.data('parentObject'); if (startActivity) { - HandlerPropertyLib.approachPropertiesDialogHandler(startActivity, null, event.pageX, event.pageY); + HandlerTransitionLib.drawTransitionStartHandler(startActivity, null, event.pageX, event.pageY); } } }); @@ -396,36 +395,48 @@ } // replace image links with PNG code - var iconLibrary = {}; crop.canvasClone.find('image').each(function(){ - var attributeName = 'xlink:href', - iconLink = $(this).attr(attributeName); - if (!iconLink) { + var image = $(this), + attributeName = 'xlink:href', + iconPath = image.attr(attributeName); + if (!iconPath) { attributeName = 'href', - iconLink = $(this).attr(attributeName); + iconPath = image.attr(attributeName); } - var iconCode = iconLibrary[iconLink]; - if (!iconCode) { - $.ajax({ - url : iconLink, - async: false, - dataType : 'text', - success : function(response) { - iconCode = iconLibrary[iconLink] = response; - } - }); + var iconCode = null, + extensionIndex = iconPath.indexOf('.svg'); + + if (extensionIndex > -1) { + var pngPath = iconPath.substring(0, extensionIndex) + '.png'; + // PNG images got precached when dropping tools on canvas + iconCode = layout.iconLib[pngPath]; + + if (!iconCode) { + // no precached PNG image, generate one from SVG + $.ajax({ + url : iconPath, + async: false, + dataType : 'text', + success : function(response) { + var workspace = $('')[0]; + workspace.width = image.width(); + workspace.height = image.height(); + canvg(workspace, response); + iconCode = layout.iconLib[pngPath] = workspace.toDataURL('image/png'); + } + }); + } + } else { + iconCode = layout.iconLib[iconPath]; } - if (!iconCode) { - return true; + + if (iconCode) { + image.attr(attributeName, iconCode); } - - canvg(crop.workspace, iconCode); - $(this).attr(attributeName, crop.workspace.toDataURL("image/png")); }); - // set viewBox so content is nicely aligned var width = crop.x2 - crop.x + 2, height = crop.y2 - crop.y + 2, @@ -600,6 +611,24 @@ /** + * Opens "Import activities" dialog where an user can choose activities from an existing Learning Design. + */ + importPartLearningDesign : function(){ + // remove the directory tree, if it remained for last dialog opening + layout.ldStoreDialog.dialog('option', { + 'title' : LABELS.IMPORT_PART_DIALOG_TITLE, + 'learningDesignTitle' : null, + 'buttons' : layout.ldStoreDialog.dialog('option', 'buttonsImportPart'), + // it informs widgets that it is the import part dialog + 'dialogClass' : 'ldStoreDialogImportPart' + }) + .dialog('open'); + + MenuLib.loadLearningDesignTree(); + }, + + + /** * Loads Learning Design Tree from DB */ loadLearningDesignTree : function(){ @@ -631,7 +660,7 @@ 'buttons' : layout.ldStoreDialog.dialog('option', 'buttonsLoad'), // it informs widgets that it is load dialog 'dialogClass' : 'ldStoreDialogLoad' - }) + }) .dialog('open'); MenuLib.loadLearningDesignTree(); Index: lams_central/web/includes/javascript/authoring/authoringProperty.js =================================================================== diff -u -rb92a2c77d9fc93b3a4100d70f95d31a78c4b6792 -re837b7b90d6cbae5ecf051b9c9ba61b3097e0c51 --- lams_central/web/includes/javascript/authoring/authoringProperty.js (.../authoringProperty.js) (revision b92a2c77d9fc93b3a4100d70f95d31a78c4b6792) +++ lams_central/web/includes/javascript/authoring/authoringProperty.js (.../authoringProperty.js) (revision e837b7b90d6cbae5ecf051b9c9ba61b3097e0c51) @@ -417,8 +417,8 @@ var activity = this, content = activity.propertiesContent; - activity.minOptions = Math.min(activity.minOptions, activity.childActivityDefs.length); - activity.maxOptions = Math.min(activity.maxOptions, activity.childActivityDefs.length); + activity.minOptions = Math.min(activity.minOptions, activity.childActivities.length); + activity.maxOptions = Math.min(activity.maxOptions, activity.childActivities.length); if (!content) { // first run, create the content @@ -449,7 +449,7 @@ $('.propertiesContentFieldOptionalActivityMin', content).spinner({'min' : 0}) .on('spinchange', function(){ var value = +$(this).val(); - activity.minOptions = Math.min(value, activity.childActivityDefs.length); + activity.minOptions = Math.min(value, activity.childActivities.length); if (value != activity.minOptions) { $(this, content).spinner('value', activity.minOptions); } @@ -463,19 +463,19 @@ $('.propertiesContentFieldOptionalActivityMax', content).spinner({'min' : 0}) .on('spinchange', function(){ var value = +$(this).val(); - activity.maxOptions = Math.min(value, activity.childActivityDefs.length); + activity.maxOptions = Math.min(value, activity.childActivities.length); if (value != activity.maxOptions) { $(this, content).spinner('value', activity.maxOptions); } }); } $('.propertiesContentFieldOptionalActivityMin', content).spinner('value', activity.minOptions) - .spinner('option', 'max', activity.childActivityDefs.length); + .spinner('option', 'max', activity.childActivities.length); $('.propertiesContentFieldOptionalActivityMax', content).spinner('value', activity.maxOptions) .spinner('option', { 'min' : activity.minOptions, - 'max' : activity.childActivityDefs.length + 'max' : activity.childActivities.length }); },