Index: lams_central/web/lams_authoring.swf =================================================================== diff -u -r57ace88428f8b87e37237985b0f52d6d7bb8028b -r1d4d284be0fb2b3eacf000364553f72c70e46eae Binary files differ Index: lams_central/web/lams_authoring_library.swf =================================================================== diff -u -r57ace88428f8b87e37237985b0f52d6d7bb8028b -r1d4d284be0fb2b3eacf000364553f72c70e46eae Binary files differ Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceContainer.as =================================================================== diff -u -r481129625a0ebaa053fa294cabecceaa230e274f -r1d4d284be0fb2b3eacf000364553f72c70e46eae --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceContainer.as (.../CompetenceContainer.as) (revision 481129625a0ebaa053fa294cabecceaa230e274f) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceContainer.as (.../CompetenceContainer.as) (revision 1d4d284be0fb2b3eacf000364553f72c70e46eae) @@ -63,7 +63,6 @@ private var delete_competence_btn:Button; private var _bgpanel:MovieClip; //The underlaying panel base - private var definitionDialog:MovieClip; private var app:Application; private var fm:FocusManager; //Reference to focus manager @@ -152,10 +151,9 @@ public function editHandler():Void { Debugger.log("editCompetence clicked: _competenceTitle "+_competenceTitle, Debugger.CRITICAL, "editHandler", "CompetenceContainer"); - CompetenceEditorDialog(app.dialog.scrollContent).editingCompetence = _competenceTitle; - - definitionDialog = app.getCanvas().openCompetenceDefinitionWindow(); - Selection.setFocus(definitionDialog.scrollContent); + CompetenceEditorDialog(app.canvas.model.competenceEditorDialog.scrollContent).editingCompetence = _competenceTitle; + app.getCanvas().openCompetenceDefinitionWindow(); // sets app.dialog to the definition dialog + Selection.setFocus(app.dialog.scrollContent); } public function deleteHandler():Void { @@ -215,8 +213,7 @@ private function deleteCompetence() { - // app.dialog.scrollContent must be an instance of CompetenceEditorDialog - var competenceEditorDialog:CompetenceEditorDialog = CompetenceEditorDialog(app.dialog.scrollContent); + var competenceEditorDialog:CompetenceEditorDialog = CompetenceEditorDialog(app.canvas.model.competenceEditorDialog.scrollContent); app.getDesignDataModel().competences.remove(_competenceTitle); competenceEditorDialog.clear(); Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceDefinitionDialog.as =================================================================== diff -u -rd8272e3360693eccf08daaf8ecb5f8d73e9fcf34 -r1d4d284be0fb2b3eacf000364553f72c70e46eae --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceDefinitionDialog.as (.../CompetenceDefinitionDialog.as) (revision d8272e3360693eccf08daaf8ecb5f8d73e9fcf34) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceDefinitionDialog.as (.../CompetenceDefinitionDialog.as) (revision 1d4d284be0fb2b3eacf000364553f72c70e46eae) @@ -114,7 +114,7 @@ add_competence_btn.label = Dictionary.getValue("competence_editor_add_competence_btn"); save_competence_btn.label = Dictionary.getValue("mnu_file_save"); - editingCompetence = CompetenceEditorDialog(app.dialog.scrollContent).editingCompetence; + editingCompetence = CompetenceEditorDialog(app.canvas.model.competenceEditorDialog.scrollContent).editingCompetence; //EVENTS //Add event listeners for ok, cancel and close buttons @@ -210,21 +210,20 @@ var competenceDesc:String = StringUtils.trim(competence_description_txt.text); if (competenceName.length == 0) { - LFMessage.showMessageAlert(Dictionary.getValue("competence_editor_warning_title_blank"), null); + LFMessage.showMessageAlert(Dictionary.getValue("competence_editor_warning_title_blank"), Delegate.create(this, selectAndHighlightTitle)); } else if (app.getDesignDataModel().competences.containsKey(competenceName)) { // entry already exists, do not add - LFMessage.showMessageAlert(Dictionary.getValue("competence_editor_warning_title_exists", [competenceName]), null); + LFMessage.showMessageAlert(Dictionary.getValue("competence_editor_warning_title_exists", [competenceName]), Delegate.create(this, selectAndHighlightTitle)); } else { // add the new competence to the hashtable app.getDesignDataModel().competences.put(competenceName, competenceDesc); - CompetenceEditorDialog(app.dialog.scrollContent).clear(); - CompetenceEditorDialog(app.dialog.scrollContent).draw(); + CompetenceEditorDialog(app.canvas.model.competenceEditorDialog.scrollContent).clear(); + CompetenceEditorDialog(app.canvas.model.competenceEditorDialog.scrollContent).draw(); + _container.deletePopUp(); } - - _container.deletePopUp(); } // used for updating an existing competence @@ -234,54 +233,52 @@ var updatedCompetenceDesc:String = StringUtils.trim(competence_description_txt.text); if (updatedCompetenceName.length == 0) { - LFMessage.showMessageAlert(Dictionary.getValue("competence_editor_warning_title_blank"), null); + LFMessage.showMessageAlert(Dictionary.getValue("competence_editor_warning_title_blank"), Delegate.create(this, selectAndHighlightTitle)); } else if (editingCompetence != updatedCompetenceName && app.getDesignDataModel().competences.containsKey(updatedCompetenceName)) { // entry already exists, do not add - LFMessage.showMessageAlert(Dictionary.getValue("competence_editor_warning_title_exists", [updatedCompetenceName]), null); + LFMessage.showMessageAlert(Dictionary.getValue("competence_editor_warning_title_exists", [updatedCompetenceName]), Delegate.create(this, selectAndHighlightTitle)); } else { - if (editingCompetence != null && editingCompetence != undefined && app.getDesignDataModel().competences.containsKey(editingCompetence)) { - if (updatedCompetenceName.length > 0) { - app.getDesignDataModel().competences.remove(editingCompetence); // remove the original competencetitle - app.getDesignDataModel().competences.put(updatedCompetenceName, updatedCompetenceDesc); + + app.getDesignDataModel().competences.remove(editingCompetence); // remove the original competencetitle + app.getDesignDataModel().competences.put(updatedCompetenceName, updatedCompetenceDesc); - // if the competence title has changed, update the mappings for all activities to the new competence title - if (editingCompetence != updatedCompetenceName) { + // if the competence title has changed, update the mappings for all activities to the new competence title + if (editingCompetence != updatedCompetenceName) { - var activityKeys:Array = app.getDesignDataModel().activities.keys(); // contains the activity UIIDs + var activityKeys:Array = app.getDesignDataModel().activities.keys(); // contains the activity UIIDs - for (var i=0; i