Index: lams_central/web/lams_authoring.swf =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/lams_authoring.swf,v diff -u -r1.495 -r1.496 Binary files differ Index: lams_central/web/lams_authoring_library.swf =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/lams_authoring_library.swf,v diff -u -r1.395 -r1.396 Binary files differ Index: lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceContainer.as =================================================================== RCS file: /usr/local/cvsroot/lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceContainer.as,v diff -u -r1.5 -r1.6 --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceContainer.as 4 Nov 2008 01:22:10 -0000 1.5 +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceContainer.as 17 Nov 2008 22:48:13 -0000 1.6 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceDefinitionDialog.as,v diff -u -r1.6 -r1.7 --- lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceDefinitionDialog.as 4 Nov 2008 00:01:17 -0000 1.6 +++ lams_flash/src/central/flash/org/lamsfoundation/lams/authoring/cmpt/CompetenceDefinitionDialog.as 17 Nov 2008 22:48:13 -0000 1.7 @@ -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