Commit 12519d18a55d6c6c0efe9c13811f33cbba06adf2
1 parent
c32b401c
Code changes for update dynamic contents
Showing
1 changed file
with
61 additions
and
25 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
... | ... | @@ -970,10 +970,10 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
970 | 970 | $('#cbRenameAuthor').val($scope.selectedNodeSingleObj.author); |
971 | 971 | } |
972 | 972 | if ($scope.selectedNodeSingleObj.version != "undefined") { |
973 | - $('#cbRenameSummary').val($scope.selectedNodeSingleObj.version); | |
973 | + $('#cbRenameSummary').val($scope.selectedNodeSingleObj.summary); | |
974 | 974 | } |
975 | 975 | if ($scope.selectedNodeSingleObj.summary != "undefined") { |
976 | - $('#cbRenameVersionNo').val($scope.selectedNodeSingleObj.summary); | |
976 | + $('#cbRenameVersionNo').val($scope.selectedNodeSingleObj.version); | |
977 | 977 | } |
978 | 978 | if ($scope.selectedNodeSingleObj.modified != "undefined") { |
979 | 979 | $('#cbRenameDate').val($scope.selectedNodeSingleObj.modified); |
... | ... | @@ -981,6 +981,10 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
981 | 981 | } |
982 | 982 | |
983 | 983 | $rootScope.cbRenameModelShow = function () { |
984 | + //Add code for Save Draft Content | |
985 | + if ($rootScope.contentNotesForSaveCB.length == 0) { | |
986 | + $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents; | |
987 | + } | |
984 | 988 | var current_id = document.getElementById('cbSelect').value; |
985 | 989 | document.getElementById('renameInputBoxId').value = ""; |
986 | 990 | traverseTreeSelectedSingleObj($rootScope.stru, current_id); |
... | ... | @@ -988,7 +992,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
988 | 992 | $('#cbRenameSectionTitle').val($scope.selectedNodeSingleObj._label); |
989 | 993 | } |
990 | 994 | if ($scope.selectedNodeSingleObj._isBranch == "true") { |
991 | - traverseTreeSelectedSingleObj($rootScope.Auther, current_id); | |
995 | + //traverseTreeSelectedSingleObj($rootScope.Auther, current_id); | |
996 | + traverseTreeSelectedSingleObj($rootScope.contentNotesForSaveCB, current_id); | |
992 | 997 | //document.getElementById('cbRenameDate').value = $scope.selectedNodeSingleObj.modified; |
993 | 998 | $scope.setProperties(); |
994 | 999 | document.getElementById('cbModelRenameBackground').style.display = "block"; |
... | ... | @@ -997,6 +1002,10 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
997 | 1002 | else { |
998 | 1003 | document.getElementById('cbModelRenameBackground').style.display = "block"; |
999 | 1004 | document.getElementById('cbModelRenameId').style.display = "block"; |
1005 | + if ($scope.selectedNodeSingleObj._label != "undefined") { | |
1006 | + $('#renameInputBoxId').val($scope.selectedNodeSingleObj._label); | |
1007 | + } | |
1008 | + | |
1000 | 1009 | } |
1001 | 1010 | } |
1002 | 1011 | |
... | ... | @@ -1078,18 +1087,20 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1078 | 1087 | } |
1079 | 1088 | if ($rootScope.cbTreeFirstID == nodeid) { |
1080 | 1089 | $rootScope.cbTreeFirstLabel = $scope.selectedNodeSingleObj._label; |
1081 | - } | |
1090 | + } | |
1091 | + //Add code for Save Draft Content | |
1092 | + if ($rootScope.contentNotesForSaveCB.length == 0) { | |
1093 | + $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents; | |
1094 | + } | |
1082 | 1095 | //$scope.selectedNodeSingleObj = ""; |
1083 | - traverseTreeSelectedSingleObj($rootScope.Auther, nodeid); | |
1096 | + //traverseTreeSelectedSingleObj($rootScope.Auther, nodeid); | |
1097 | + traverseTreeSelectedSingleObj($rootScope.contentNotesForSaveCB, nodeid); | |
1084 | 1098 | setTimeout(function () { |
1085 | 1099 | $scope.selectedNodeSingleObj.summary = newSummary; |
1086 | 1100 | $scope.selectedNodeSingleObj.author = newAuthorName; |
1087 | 1101 | $scope.selectedNodeSingleObj.version = newversion; |
1088 | 1102 | $scope.selectedNodeSingleObj.modified = $scope.dateTime; |
1089 | - //Add code for Save Draft Content | |
1090 | - if ($rootScope.contentNotesForSaveCB.length == 0) { | |
1091 | - $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents; | |
1092 | - } | |
1103 | + | |
1093 | 1104 | $scope.DropDownSelectNodeClick(nodeid); |
1094 | 1105 | console.log("Structure:" + JSON.stringify($rootScope.structureObjForSaveCB)); |
1095 | 1106 | console.log("Notes:" + JSON.stringify($rootScope.contentNotesForSaveCB)); |
... | ... | @@ -1434,6 +1445,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1434 | 1445 | } |
1435 | 1446 | } |
1436 | 1447 | $rootScope.structureObjForSaveCB = $rootScope.stru.structure.structure; |
1448 | + $scope.selectedNodeSingleObj = ""; | |
1437 | 1449 | //traverseTreeSelectedSingleObj($rootScope.structureObjForSaveCB, currentid); |
1438 | 1450 | //if ($scope.selectedNodeSingleObj._isBranch == "true") { |
1439 | 1451 | // for (var j = 0; j < $scope.selectedNodeSingleObj['structure'].length; j++) { |
... | ... | @@ -1477,6 +1489,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1477 | 1489 | |
1478 | 1490 | $rootScope.updatedContentFromEditor = function (cbCurrentId) { |
1479 | 1491 | |
1492 | + if ($rootScope.contentNotesForSaveCB.length == 0) { | |
1493 | + $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents;//Assign Dnamic Contents | |
1494 | + } | |
1480 | 1495 | var windowsInSelectedSlide; var notesForSelectedSlide; |
1481 | 1496 | var contentWindowsNotes = $rootScope.contentNotesForSaveCB |
1482 | 1497 | var selectedSlideContent = new jinqJs() |
... | ... | @@ -1501,8 +1516,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1501 | 1516 | .delete().at("_id == " + cbCurrentId).select(); |
1502 | 1517 | $rootScope.contentNotesForSaveCB = remaingNotesForCB; |
1503 | 1518 | |
1504 | - traverseTreeSelectedSingleObj($rootScope.Auther, nodeid); | |
1505 | - //traverseTreeSelectedSingleObj($rootScope.contentNotesForSaveCB, cbCurrentId); | |
1519 | + | |
1520 | + traverseTreeSelectedSingleObj($rootScope.stru, cbCurrentId); | |
1506 | 1521 | //$scope.selectedNodeSingleObj.summary |
1507 | 1522 | //$scope.selectedNodeSingleObj.author |
1508 | 1523 | //$scope.selectedNodeSingleObj.version |
... | ... | @@ -1515,30 +1530,35 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1515 | 1530 | "_id": cbCurrentId |
1516 | 1531 | }); |
1517 | 1532 | } |
1518 | - else if ($scope.selectedNodeSingleObj._isBranch == "true") { | |
1533 | + | |
1534 | + else if ($scope.selectedNodeSingleObj._isBranch == "true" && $scope.selectedNodeSingleObj._isRoot == "true") { | |
1535 | + //traverseTreeSelectedSingleObj($rootScope.Auther, cbCurrentId); | |
1536 | + traverseTreeSelectedSingleObj($rootScope.cbDynamicContents, cbCurrentId); | |
1519 | 1537 | $rootScope.contentNotesForSaveCB.push( |
1520 | 1538 | { |
1521 | - "summary": $scope.selectedNodeSingleObj.summary, | |
1522 | - "author": $scope.selectedNodeSingleObj.author, | |
1539 | + "windows": windowsInSelectedSlide, | |
1540 | + "summary": $scope.selectedNodeSingleObj.summary, | |
1541 | + "author": $scope.selectedNodeSingleObj.author, | |
1523 | 1542 | "modified": $scope.selectedNodeSingleObj.modified, |
1524 | 1543 | "password": "", |
1525 | - "version": $scope.selectedNodeSingleObj.version , | |
1526 | - "windows": windowsInSelectedSlide, | |
1527 | - "_id": cbCurrentId | |
1544 | + "version": $scope.selectedNodeSingleObj.version, | |
1545 | + "_id": cbCurrentId | |
1528 | 1546 | //"notes": notesForSelectedSlide, |
1529 | 1547 | //"windows": windowsInSelectedSlide, |
1530 | 1548 | //"_id": cbCurrentId |
1531 | 1549 | }); |
1532 | 1550 | } |
1533 | - else if ($scope.selectedNodeSingleObj._isBranch == "true" && $scope.selectedNodeSingleObj._isRoot == "true") { | |
1551 | + else if ($scope.selectedNodeSingleObj._isBranch == "true") { | |
1552 | + //traverseTreeSelectedSingleObj($rootScope.Auther, cbCurrentId); | |
1553 | + traverseTreeSelectedSingleObj($rootScope.cbDynamicContents, cbCurrentId); | |
1534 | 1554 | $rootScope.contentNotesForSaveCB.push( |
1535 | 1555 | { |
1536 | - "windows": windowsInSelectedSlide, | |
1537 | 1556 | "summary": $scope.selectedNodeSingleObj.summary, |
1538 | - "author": $scope.selectedNodeSingleObj.author, | |
1557 | + "author": $scope.selectedNodeSingleObj.author, | |
1539 | 1558 | "modified": $scope.selectedNodeSingleObj.modified, |
1540 | 1559 | "password": "", |
1541 | 1560 | "version": $scope.selectedNodeSingleObj.version, |
1561 | + "windows": windowsInSelectedSlide, | |
1542 | 1562 | "_id": cbCurrentId |
1543 | 1563 | //"notes": notesForSelectedSlide, |
1544 | 1564 | //"windows": windowsInSelectedSlide, |
... | ... | @@ -1636,11 +1656,12 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1636 | 1656 | |
1637 | 1657 | $scope.addSection = function (currentid, AddSecionId) { |
1638 | 1658 | |
1639 | - if ($rootScope.structureObjForSaveCB.length == 0) { | |
1640 | - //$rootScope.structureObjForSaveCB = $rootScope.structure;// only Tree Array | |
1641 | - //$rootScope.structureObjForSaveCB = $rootScope.stru.slideshow.presentation.structure.structure; | |
1659 | + if ($rootScope.structureObjForSaveCB.length == 0) { | |
1642 | 1660 | $rootScope.structureObjForSaveCB = $rootScope.stru.structure.structure; |
1643 | - } | |
1661 | + } | |
1662 | + if ($rootScope.contentNotesForSaveCB.length == 0) { | |
1663 | + $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents; | |
1664 | + } | |
1644 | 1665 | |
1645 | 1666 | traverseTreeSelectedSingleObj($rootScope.stru, currentid); |
1646 | 1667 | traverse($rootScope.stru, currentid); |
... | ... | @@ -1681,6 +1702,21 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1681 | 1702 | "_isBranch": "true", |
1682 | 1703 | "_isLocked": "false" |
1683 | 1704 | }); |
1705 | + | |
1706 | + $rootScope.contentNotesForSaveCB.push( | |
1707 | + { | |
1708 | + "summary": "", | |
1709 | + "author": "", | |
1710 | + "modified": "", | |
1711 | + "password": "", | |
1712 | + "version": "", | |
1713 | + "windows": "", | |
1714 | + "_id": AddSecionId | |
1715 | + //"notes": notesForSelectedSlide, | |
1716 | + //"windows": windowsInSelectedSlide, | |
1717 | + //"_id": cbCurrentId | |
1718 | + }); | |
1719 | + | |
1684 | 1720 | //if (currentid == $rootScope.cbTreeFirstID) { |
1685 | 1721 | // $rootScope.structureObjForSaveCB.push( |
1686 | 1722 | // { |
... | ... | @@ -1699,7 +1735,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
1699 | 1735 | $rootScope.structureObjForSaveCB[i]['structure'] = $scope.selectedNodeSingleObj['structure']; |
1700 | 1736 | } |
1701 | 1737 | } |
1702 | - //} | |
1738 | + //} | |
1703 | 1739 | } |
1704 | 1740 | // setTimeout(function () { traverseTreeForSetIcons($rootScope.stru, currentid); }, 1500); |
1705 | 1741 | } | ... | ... |