Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringController.java =================================================================== diff -u -r29a37489a63e5a95f42a5ef5fd8a7daeb65c53c5 -r658453b9f8bdfbf78bc9151b2cc711796081abc2 --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringController.java (.../AuthoringController.java) (revision 29a37489a63e5a95f42a5ef5fd8a7daeb65c53c5) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringController.java (.../AuthoringController.java) (revision 658453b9f8bdfbf78bc9151b2cc711796081abc2) @@ -406,7 +406,7 @@ * Gets a list of recently used Learning Designs for currently logged in user. */ @ResponseBody - @RequestMapping("/") + @RequestMapping("/getLearningDesignAccess") public String getLearningDesignAccess(HttpServletRequest request, HttpServletResponse response) throws IOException { Integer userId = getUserId(); Index: lams_central/web/authoring/authoring.jsp =================================================================== diff -u -rd7807c73d8a9c76c44ea1a2a296d5f775afe2ac9 -r658453b9f8bdfbf78bc9151b2cc711796081abc2 --- lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision d7807c73d8a9c76c44ea1a2a296d5f775afe2ac9) +++ lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 658453b9f8bdfbf78bc9151b2cc711796081abc2) @@ -9,20 +9,17 @@ - - + - - - - + + Index: lams_central/web/css/bootstrap-treeview.css =================================================================== diff -u --- lams_central/web/css/bootstrap-treeview.css (revision 0) +++ lams_central/web/css/bootstrap-treeview.css (revision 658453b9f8bdfbf78bc9151b2cc711796081abc2) @@ -0,0 +1,43 @@ +/* ========================================================= + * bootstrap-treeview.css v1.2.0 + * ========================================================= + * Copyright 2013 Jonathan Miles + * Project URL : http://www.jondmiles.com/bootstrap-treeview + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================= */ + +.treeview .list-group-item { + cursor: pointer; +} + +.treeview span.indent { + margin-left: 10px; + margin-right: 10px; +} + +.treeview span.icon { + width: 12px; + margin-right: 5px; +} + +.treeview .node-disabled { + color: silver; + cursor: not-allowed; +} + +/* MODFIED FOR LAMS */ +.treeview .roffset10 { + margin-left: -15px !important; + margin-right: 10px !important; +} \ No newline at end of file Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -rcb4141b54c7cfe2b3acbde3d0de3c15da1c5b351 -r658453b9f8bdfbf78bc9151b2cc711796081abc2 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision cb4141b54c7cfe2b3acbde3d0de3c15da1c5b351) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 658453b9f8bdfbf78bc9151b2cc711796081abc2) @@ -1,3242 +1,3205 @@ -/** - * This file contains main methods for Authoring. - */ - - -/** - * Initialises each part of the Authoring window. - */ -$(document).ready(function() { - canvas = $('#canvas'); - GeneralInitLib.initTemplates(); - if (!isReadOnlyMode) { - // in read-only mode (SVG generator), some parts are not necessary and not loaded - GeneralInitLib.initLayout(); - PropertyLib.init(); - - if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ - $('.desktopButton').hide(); - - document.addEventListener("touchstart", HandlerLib.touchHandler, true); - document.addEventListener("touchmove", HandlerLib.touchHandler, true); - document.addEventListener("touchend", HandlerLib.touchHandler, true); - document.addEventListener("touchcancel", HandlerLib.touchHandler, true); - } - } - - GeneralLib.newLearningDesign(true); - if (!isReadOnlyMode) { - layout.ld.contentFolderID = initContentFolderID; - } - if (initLearningDesignID) { - GeneralLib.openLearningDesign(+initLearningDesignID); - } - - // remove "loading..." screen - $('#loadingOverlay').remove(); -}); - - -/** - * A few publicly visible variables . - */ - - // The Snap Paper object -var paper = null, - // container for the paper - canvas = null, - - // configuration and storage of various elements - layout = { - // draw mode prevents some handlers (click, mouseover etc.) from triggering - 'drawMode' : false, - // is the LD being live edited? - 'liveEdit' : false, - // should the sequence be saved before exiting? - 'modified' : false, - // was start point of a new branching placed? - 'addBranchingStart' : null, - // list of all dialogs, so they can be easily closed all at once - 'dialogs' : [], - // icons for special activities - 'toolMetadata': { - 'gate' : { - 'iconPath' : '../images/stop.gif' - }, - 'grouping' : { - 'iconPath' : '../images/grouping.png' - } - }, - - // graphics contants - 'conf' : { - 'arrangeHorizontalSpace' : 200, - 'arrangeVerticalSpace' : 100, - 'arrangeHorizontalPadding' : 35, - 'arrangeVerticalPadding' : 50, - - 'dragStartThreshold' : 300, - - 'propertiesDialogDimOpacity' : 0.3, - 'propertiesDialogDimThreshold' : 100, - 'propertiesDialogDimThrottle' : 100, - - 'defaultGroupingGroupCount' : 2, - 'defaultGroupingLearnerCount' : 1, - - 'containerActivityEmptyWidth' : 50, - 'containerActivityEmptyHeight' : 70, - 'containerActivityPadding' : 20, - 'containerActivityChildrenPadding' : 10, - 'regionEmptyWidth' : 20, - 'regionEmptyHeight' : 20, - 'labelDefaultSize' : 10, - 'labelMinSize' : 9, - 'labelMaxSize' : 20, - - 'groupingEffectPadding' : 5, - 'selectEffectPadding' : 7, - - 'supportsDownloadAttribute' : typeof $('')[0].download != 'undefined', - - // will be initialised when paper gets created - 'readOnlyFilter' : null - }, - - 'colors' : { - 'activityBorder' : 'black', - 'toolActivityBorder' : ['','#00007f','#ff8300','#625F67','#ffa500','#00007f','#7aa712'], - // each activity type has its own colour - 'activity' : ['','#caddfb','#ffffbb','#ece9f7','#fdf1d3','#caddfb','#e9f9c0'], - 'activityText' : 'black', - // default region colour - 'annotation' : '#CCFF99', - // region colours to choose from - 'annotationPalette' : ['CCFF99', 'CDA5F3', 'FFFFCC', '99E6DF', '6495ED', - 'FFF8DC', 'FFDDB3', 'D1DFFA', 'DCDCDC', '20B2AA', - 'B0C4DE', 'FFE4E1', 'F9D2F9', 'FF2200'], - - // when mouse hovers over rubbish bin - 'binSelect' : 'red', - - 'branchingEdgeStart' : 'green', - 'branchingEdgeEnd' : 'red', - // highlight branching edges on mouse hover - 'branchingEdgeMatch' : 'blue', - 'gate' : 'red', - 'gateBorder' : '#801515', - 'gateText' : 'white', - 'grouping' : '#caddfb', - 'groupingBorder' : '#00007f', - 'optionalActivity' : '#caddfb', - 'optionalActivityBorder' : '#00007f', - // dashed border around a selected activity - 'selectEffect' : 'black', - 'transition' : 'rgb(119,126,157)', - // highlight TBL activities which should be grouped - 'activityRequireGrouping' : 'red', - 'activityReadOnly' : 'red' - }, - - 'defaultTextAttributes' : { - 'text-anchor' : 'middle', - 'font-size' : 10, - 'font-family' : 'sans-serif' - } -}, - - -/** - * Contains methods for Authoring window initialisation which are run only once at the beginning - */ -GeneralInitLib = { - /** - * Draw boxes with Tool Activity templates in the panel on the left. - */ - initTemplates : function(){ - // store some template data in JS structures - $('.template').each(function(){ - var learningLibraryID = +$(this).attr('learningLibraryId'), - learningLibraryTitle = $(this).attr('learningLibraryTitle'), - activityCategoryID = +$(this).attr('activityCategoryId'), - parallelChildActivityDefs = null; - - if (activityCategoryID == 5) { - var childToolIds = $(this).attr('childToolIds').split(','); - $.each(childToolIds, function(){ - var childToolId = this.trim(); - if (childToolId) { - parallelChildActivity = $('.template[toolId=' + childToolId + ']'); - if (parallelChildActivityDefs) { - parallelChildActivityDefs = parallelChildActivityDefs.add(parallelChildActivity); - } else { - parallelChildActivityDefs = parallelChildActivity; - } - } - }); - } - - // assign icons' data uris to their learning library IDs instead of labels - ActivityIcons[learningLibraryID] = ActivityIcons[learningLibraryTitle]; - delete ActivityIcons[learningLibraryTitle]; - $('').attr('src', ActivityIcons[learningLibraryID]).appendTo(".img-"+learningLibraryID); - // register tool properties so they are later easily accessible - layout.toolMetadata[learningLibraryID] = { - 'iconPath' : $(this).attr('iconPath'), - 'defaultToolContentID' : $(this).attr('defaultToolContentId'), - 'supportsOutputs' : $(this).attr('supportsOutputs'), - 'activityCategoryID' : activityCategoryID, - 'parallelChildActivityDefs' : parallelChildActivityDefs - }; - - }); - - if (!isReadOnlyMode){ - // store the initial window height now as on iPad the iframe grows when templates are show, - // reporting incorrect window height to the first resizePaper() run - layout.initWindowHeight = $(window).height(); - // create list of learning libraries for each group - var templateContainerCell = $('#templateContainerCell'), - learningLibraryGroupSelect = $('select', templateContainerCell), - allGroup = $('option', learningLibraryGroupSelect), - allTemplates = $('#templateContainerCell .templateContainer').show(); - - learningLibraryGroupSelect.change(function(){ - $('.templateContainer').hide(); - // show DIV with the selected learning libraries group - $('option:selected', this).data('templates').show(); - }); - allGroup.data('templates', allTemplates); - - $.each(learningLibraryGroups, function(){ - var learningLibraries = this.learningLibraries; - if (!learningLibraries) { - return true; - } - - var templates = allTemplates.clone().appendTo(templateContainerCell); - // cloned everything, now remove ones that are not in the list - $('.template', templates).each(function(){ - var learningLibraryId = $(this).attr('learningLibraryId'), - found = false; - $.each(learningLibraries, function(){ - if (learningLibraryId == this) { - found = true; - return false; - } - }); - - if (!found) { - $(this).remove(); - } - }); - - $('