Commit 295edd7c879b1f5592be4f58ef6b0311b18ecc92
1 parent
ebb53789
bug fixes for editor
Showing
4 changed files
with
214 additions
and
47 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
... | ... | @@ -542,9 +542,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
542 | 542 | tinymce.get("CBTextArea").setContent($scope.SelectedNotes); |
543 | 543 | |
544 | 544 | setTimeout(function () { |
545 | - if ($scope.selectedNodeSingleObj.windows != "") { | |
546 | - | |
547 | - $scope.loadContentOfSelectedSlide($scope.selectedNodeSingleObj._id) | |
545 | + if ($scope.selectedNodeSingleObj.windows != "") { | |
546 | + $scope.loadContentOfSelectedSlide($scope.selectedNodeSingleObj._id) | |
548 | 547 | |
549 | 548 | } |
550 | 549 | },200); |
... | ... | @@ -561,24 +560,107 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
561 | 560 | tinymce.remove(); |
562 | 561 | |
563 | 562 | }); |
564 | - $scope.DropDownSelectNodeClick = function (nodeid) { | |
565 | 563 | |
564 | + //Start Code commented by Sandeep | |
565 | + //$scope.DropDownSelectNodeClick = function (nodeid) { | |
566 | + | |
567 | + // //var current_id = document.getElementById('cbSelect').value; | |
568 | + // //traverseTreeSelectedSingleObj($rootScope.stru, nodeid); | |
569 | + // if ($scope.selectedNodeSingleObj._isBranch == "true") { | |
570 | + // traverseTreeSelectedSingleObj($rootScope.stru, nodeid); | |
571 | + // $("#cbSelect").empty(); | |
572 | + // //for (i = 0; i < $scope.selectedNodeSingleObj.length; i++) { | |
573 | + // localStorage.setItem("cbSelectId", nodeid); | |
574 | + // if ($scope.selectedNodeSingleObj._id == nodeid) { | |
575 | + // $scope.currentSlideNumber = i + 1; | |
576 | + // $('#cbSelect').append('<option selected value="' + $scope.selectedNodeSingleObj._id + '">' + $scope.selectedNodeSingleObj._label + '</option>'); | |
577 | + // } | |
578 | + // else { | |
579 | + // $('#cbSelect').append('<option value="' + $scope.selectedNodeSingleObj._id + '">' + $scope.selectedNodeSingleObj._label + '</option>'); | |
580 | + // } | |
581 | + // //} | |
582 | + // document.getElementById("slideNumber").innerHTML = "Slide" + $scope.currentSlideNumber + " of " + $scope.selectedNodeSingleObj.length; | |
583 | + // } | |
584 | + // else { | |
585 | + // traverse($rootScope.stru, nodeid); | |
586 | + // $("#cbSelect").empty(); | |
587 | + // for (i = 0; i < $scope.selectedNodeSiblingObjs.length; i++) { | |
588 | + // localStorage.setItem("cbSelectId", nodeid); | |
589 | + // if ($scope.selectedNodeSiblingObjs[i]._id == nodeid) { | |
590 | + // $scope.currentSlideNumber = i + 1; | |
591 | + // $('#cbSelect').append('<option selected value="' + $scope.selectedNodeSiblingObjs[i]._id + '">' + $scope.selectedNodeSiblingObjs[i]._label + '</option>'); | |
592 | + // } | |
593 | + // else { | |
594 | + // $('#cbSelect').append('<option value="' + $scope.selectedNodeSiblingObjs[i]._id + '">' + $scope.selectedNodeSiblingObjs[i]._label + '</option>'); | |
595 | + // } | |
596 | + | |
597 | + // } | |
598 | + // document.getElementById("slideNumber").innerHTML = "Slide" + $scope.currentSlideNumber + " of " + $scope.selectedNodeSiblingObjs.length; | |
599 | + // } | |
600 | + //} | |
601 | + //End Code commented by Sandeep | |
602 | + | |
603 | + //$("CBBodyView").on("change", "#cbSelect", function () { | |
604 | + // var datavalue = document.getElementById('cbSelect').value; | |
605 | + // $('#jstree').jstree(true).deselect_all(); | |
606 | + // $('#jstree').jstree('select_node', datavalue); | |
607 | + //}); | |
608 | + | |
609 | + $rootScope.cbSelectOnChange = function (obj) { | |
610 | + $('#jstree').jstree(true).deselect_all(); | |
611 | + $('#jstree').jstree('select_node', obj.value); | |
612 | + } | |
613 | + | |
614 | + //Start Code Commented by Sandeep | |
615 | + //$rootScope.cbNext = function () { | |
616 | + // var cbCurrentId = document.getElementById('cbSelect').value; | |
617 | + // traverse($rootScope.stru, cbCurrentId); | |
618 | + // for (var k = 0; k < $scope.selectedNodeSiblingObjs.length; k++) { | |
619 | + // if ($scope.selectedNodeSiblingObjs[k]._id == cbCurrentId) { | |
620 | + // $scope.nextCurrentId = $scope.selectedNodeSiblingObjs[k + 1]._id; | |
621 | + // } | |
622 | + // } | |
623 | + // $('#jstree').jstree(true).deselect_all(); | |
624 | + // $('#jstree').jstree('select_node', $scope.nextCurrentId); | |
625 | + | |
626 | + //} | |
627 | + //$rootScope.cbBack = function () { | |
628 | + // var cbCurrentId = document.getElementById('cbSelect').value; | |
629 | + // traverse($rootScope.stru, cbCurrentId); | |
630 | + // for (var k = 0; k < $scope.selectedNodeSiblingObjs.length; k++) { | |
631 | + // if ($scope.selectedNodeSiblingObjs[k]._id == cbCurrentId) { | |
632 | + // $scope.backCurrentId = $scope.selectedNodeSiblingObjs[k - 1]._id; | |
633 | + // } | |
634 | + // } | |
635 | + // $('#jstree').jstree(true).deselect_all(); | |
636 | + // $('#jstree').jstree('select_node', $scope.backCurrentId); | |
637 | + //} | |
638 | + //End code commented by Sandeep | |
639 | + | |
640 | + //Start Code by Sandeep for TicketNo: 49226(3) | |
641 | + $scope.DropDownSelectNodeClick = function (nodeid) { | |
642 | + | |
566 | 643 | //var current_id = document.getElementById('cbSelect').value; |
567 | - //traverseTreeSelectedSingleObj($rootScope.stru, nodeid); | |
568 | - if ($scope.selectedNodeSingleObj._isBranch == "true") { | |
569 | - traverseTreeSelectedSingleObj($rootScope.stru, nodeid); | |
644 | + traverseTreeSelectedSingleObj($rootScope.stru, nodeid); | |
645 | + traverse($rootScope.stru, nodeid); | |
646 | + if ($scope.selectedNodeSiblingObjs._isBranch == "true") { | |
647 | + //traverseTreeSelectedSingleObj($rootScope.stru, nodeid); | |
570 | 648 | $("#cbSelect").empty(); |
571 | 649 | //for (i = 0; i < $scope.selectedNodeSingleObj.length; i++) { |
572 | 650 | localStorage.setItem("cbSelectId", nodeid); |
573 | - if ($scope.selectedNodeSingleObj._id == nodeid) { | |
574 | - $scope.currentSlideNumber = i + 1; | |
651 | + if ($scope.selectedNodeSiblingObjs._id == nodeid) { | |
652 | + $scope.currentSlideNumber += 1; | |
575 | 653 | $('#cbSelect').append('<option selected value="' + $scope.selectedNodeSingleObj._id + '">' + $scope.selectedNodeSingleObj._label + '</option>'); |
576 | 654 | } |
577 | 655 | else { |
578 | 656 | $('#cbSelect').append('<option value="' + $scope.selectedNodeSingleObj._id + '">' + $scope.selectedNodeSingleObj._label + '</option>'); |
579 | 657 | } |
580 | 658 | //} |
581 | - document.getElementById("slideNumber").innerHTML = "Slide" + $scope.currentSlideNumber + " of " + $scope.selectedNodeSingleObj.length; | |
659 | + if ($scope.selectedNodeSingleObj._isBranch == "true") { | |
660 | + document.getElementById("slideNumber").innerHTML = "Slide " + $scope.currentSlideNumber + " of " + Object.keys($scope.selectedNodeSiblingObjs).length; | |
661 | + } else { | |
662 | + document.getElementById("slideNumber").innerHTML = "Slide " + $scope.currentSlideNumber + " of " + Object.keys($scope.selectedNodeSingleObj).length; | |
663 | + } | |
582 | 664 | } |
583 | 665 | else { |
584 | 666 | traverse($rootScope.stru, nodeid); |
... | ... | @@ -592,48 +674,111 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
592 | 674 | else { |
593 | 675 | $('#cbSelect').append('<option value="' + $scope.selectedNodeSiblingObjs[i]._id + '">' + $scope.selectedNodeSiblingObjs[i]._label + '</option>'); |
594 | 676 | } |
595 | - | |
596 | 677 | } |
597 | - document.getElementById("slideNumber").innerHTML = "Slide" + $scope.currentSlideNumber + " of " + $scope.selectedNodeSiblingObjs.length; | |
678 | + document.getElementById("slideNumber").innerHTML = "Slide " + $scope.currentSlideNumber + " of " + Object.keys($scope.selectedNodeSiblingObjs).length; | |
598 | 679 | } |
599 | 680 | } |
600 | - | |
601 | - | |
602 | - //$("CBBodyView").on("change", "#cbSelect", function () { | |
603 | - // var datavalue = document.getElementById('cbSelect').value; | |
604 | - // $('#jstree').jstree(true).deselect_all(); | |
605 | - // $('#jstree').jstree('select_node', datavalue); | |
606 | - //}); | |
607 | - | |
608 | - | |
609 | - $rootScope.cbSelectOnChange = function (obj) { | |
610 | - $('#jstree').jstree(true).deselect_all(); | |
611 | - $('#jstree').jstree('select_node', obj.value); | |
612 | - } | |
613 | - | |
681 | + | |
614 | 682 | $rootScope.cbNext = function () { |
683 | + | |
615 | 684 | var cbCurrentId = document.getElementById('cbSelect').value; |
616 | 685 | traverse($rootScope.stru, cbCurrentId); |
686 | + if ($scope.selectedNodeSiblingObjs.length == undefined) { | |
687 | + if ($scope.selectedNodeSiblingObjs["structure"]._isRoot == "true") { | |
688 | + $scope.nextCurrentId = $('#' + cbCurrentId).parent().next().find('span').attr('id'); | |
689 | + } | |
690 | + } | |
617 | 691 | for (var k = 0; k < $scope.selectedNodeSiblingObjs.length; k++) { |
618 | 692 | if ($scope.selectedNodeSiblingObjs[k]._id == cbCurrentId) { |
619 | - $scope.nextCurrentId = $scope.selectedNodeSiblingObjs[k + 1]._id; | |
693 | + | |
694 | + if ($scope.selectedNodeSiblingObjs[k]._isBranch == "true") { | |
695 | + | |
696 | + $scope.nextCurrentId = $('#' + cbCurrentId).parent().next().find('span').attr('id'); // folder to child slide | |
697 | + | |
698 | + } | |
699 | + //$scope.nextCurrentId = $scope.selectedNodeSiblingObjs[k + 1]._id; | |
700 | + else if (k + 1 >= $scope.selectedNodeSiblingObjs.length) { | |
701 | + $scope.nextCurrentId = $('#' + cbCurrentId).parent().parent().parent().parent().next().find('span').attr('id');//last slide to next parent folder | |
702 | + //if ($scope.nextCurrentId == undefined) { | |
703 | + // var parentLen = $('#' + cbCurrentId).parents().length; | |
704 | + // for (i = 1; i < parentLen; i++) { | |
705 | + // $scope.nextCurrentId = $('#' + cbCurrentId).parent().parent().parent().parent().append(".parent().parent()") | |
706 | + // .next().find('span').attr('id'); | |
707 | + // } | |
708 | + //} | |
709 | + if ($scope.nextCurrentId == undefined) { | |
710 | + //$scope.nextCurrentId = $('#' + cbCurrentId).parent().parent().next().find('span').attr('id');//next sibling | |
711 | + $scope.nextCurrentId = $('#' + cbCurrentId).parent().parent().parent().parent().parent().parent().next().find('span').attr('id'); | |
712 | + } | |
713 | + if ($scope.nextCurrentId == undefined) { | |
714 | + $scope.nextCurrentId = $('#' + cbCurrentId).parent().parent().parent().parent().parent().parent().parent().parent().next().find('span').attr('id'); | |
715 | + } | |
716 | + if ($scope.nextCurrentId == undefined) { | |
717 | + $scope.nextCurrentId = $('#' + cbCurrentId).parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().next().find('span').attr('id'); | |
718 | + } | |
719 | + } | |
720 | + else if (k + 1 < $scope.selectedNodeSiblingObjs.length) { | |
721 | + $scope.nextCurrentId = $('#' + cbCurrentId).parent().parent().next().find('span').attr('id');//next sibling | |
722 | + } | |
723 | + else if (k + 1 == $scope.selectedNodeSiblingObjs.length) { | |
724 | + $scope.nextCurrentId = $('#' + cbCurrentId).parent().parent().parent().parent().next().find('span').attr('id');//last slide to next parent folder | |
725 | + } | |
726 | + | |
620 | 727 | } |
621 | 728 | } |
622 | - $('#jstree').jstree(true).deselect_all(); | |
623 | - $('#jstree').jstree('select_node', $scope.nextCurrentId); | |
624 | - | |
729 | + if ($scope.nextCurrentId != undefined) { | |
730 | + $('#jstree').jstree(true).deselect_all(); | |
731 | + $('#jstree').jstree('select_node', $scope.nextCurrentId); | |
732 | + } | |
625 | 733 | } |
626 | 734 | $rootScope.cbBack = function () { |
735 | + | |
627 | 736 | var cbCurrentId = document.getElementById('cbSelect').value; |
628 | 737 | traverse($rootScope.stru, cbCurrentId); |
629 | 738 | for (var k = 0; k < $scope.selectedNodeSiblingObjs.length; k++) { |
630 | 739 | if ($scope.selectedNodeSiblingObjs[k]._id == cbCurrentId) { |
631 | - $scope.backCurrentId = $scope.selectedNodeSiblingObjs[k - 1]._id; | |
740 | + | |
741 | + if ($scope.selectedNodeSiblingObjs[k]._isBranch == "true") { | |
742 | + //$scope.nextCurrentId = $('#' + cbCurrentId).parent().next().find('span').attr('id'); // folder to child slide | |
743 | + //$scope.backCurrentId= $('#' + cbCurrentId).prev().parent().parent().prev().find('span').attr('id'); | |
744 | + $scope.backCurrentId = $('#' + cbCurrentId).parent().parent().prev().find('span').attr('id'); // Privious child slide | |
745 | + } | |
746 | + else if (k == 0) { // frist to prev | |
747 | + $scope.backCurrentId = $('#' + cbCurrentId).parent().parent().parent().prev().find('span').attr('id'); // frist slide to prev parent folder | |
748 | + } | |
749 | + else if (k == $scope.selectedNodeSiblingObjs.length - 1) { // last to prev parent | |
750 | + //$scope.backCurrentId = $('#' + cbCurrentId).parent().parent().parent().prev().find('span').attr('id'); // Cuurent prev parent | |
751 | + $scope.backCurrentId = $('#' + cbCurrentId).parent().parent().prev().find('span').attr('id');// Last slide to cuuent prev slide | |
752 | + } | |
753 | + else if (k - 1 >= $scope.selectedNodeSiblingObjs.length) { | |
754 | + //$scope.backCurrentId = $('#' + cbCurrentId).parent().parent().parent().parent().next().find('span').attr('id');//last slide to next parent folder | |
755 | + | |
756 | + $scope.backCurrentId = $('#' + cbCurrentId).parent().parent().parent().prev().find('span').attr('id'); | |
757 | + | |
758 | + if ($scope.backCurrentId == undefined) { | |
759 | + //$scope.nextCurrentId = $('#' + cbCurrentId).parent().parent().next().find('span').attr('id');//next sibling | |
760 | + $scope.backCurrentId = $('#' + cbCurrentId).parent().parent().parent().parent().parent().parent().prev().find('span').attr('id'); | |
761 | + } | |
762 | + if ($scope.backCurrentId == undefined) { | |
763 | + $scope.backCurrentId = $('#' + cbCurrentId).parent().parent().parent().parent().parent().parent().parent().parent().prev().find('span').attr('id'); | |
764 | + } | |
765 | + if ($scope.backCurrentId == undefined) { | |
766 | + $scope.backCurrentId = $('#' + cbCurrentId).parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().prev().find('span').attr('id'); | |
767 | + } | |
768 | + } | |
769 | + else if (k - 1 < $scope.selectedNodeSiblingObjs.length) { | |
770 | + | |
771 | + $scope.backCurrentId = $('#' + cbCurrentId).parent().parent().prev().find('span').attr('id'); //prev sibling | |
772 | + } | |
773 | + | |
774 | + | |
632 | 775 | } |
633 | 776 | } |
634 | 777 | $('#jstree').jstree(true).deselect_all(); |
635 | 778 | $('#jstree').jstree('select_node', $scope.backCurrentId); |
636 | 779 | } |
780 | + //End Code by Sandeep for TicketNo: 49226 | |
781 | + | |
637 | 782 | function traverse(o, current_id) { |
638 | 783 | for (var i in o) { |
639 | 784 | if (o[i] !== null && typeof (o[i]) == "object") { |
... | ... | @@ -643,7 +788,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ |
643 | 788 | traverse(o[i], current_id); |
644 | 789 | } |
645 | 790 | } |
646 | - } | |
791 | + } | |
647 | 792 | |
648 | 793 | $rootScope.cbRenameModelShow = function () { |
649 | 794 | var current_id = document.getElementById('cbSelect').value; | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-TinyMCEjspanel.html
... | ... | @@ -4,8 +4,9 @@ |
4 | 4 | <div class="col-sm-12 nopadding"> |
5 | 5 | <div class="form-inline"> |
6 | 6 | <button class="btn btn-primary btn-sm"> |
7 | - <img src="../../../content/images/CB/anchor-icon.png" alt="" title=""> | |
7 | + <img src="../../../content/images/CB/anchor-icon.png" alt="" title=""> | |
8 | 8 | </button> |
9 | + | |
9 | 10 | <button class="btn btn-black btn-sm" onclick="cbRenameModelShow()"> |
10 | 11 | <img src="../../../content/images/CB/icon-tasks.png" alt="" title=""> |
11 | 12 | </button> |
... | ... | @@ -38,6 +39,7 @@ |
38 | 39 | </div> |
39 | 40 | </div> |
40 | 41 | <div class="col-sm-1 nopadding" id="cbEditorRightSideBar"> |
42 | + <!--Commented by sandeep for user story-49226(1)--> | |
41 | 43 | <!--<div class="col-sm-12 nopadding" title="Hyperlink"> |
42 | 44 | <button class="btn btn-black btn-sm btn-block marginTop5" data-toggle="modal" data-target="#myModal-transparency-box"><img src="../../../content/images/CB/icon-link.png" alt="" title=""></button> |
43 | 45 | </div>--> |
... | ... | @@ -47,13 +49,19 @@ |
47 | 49 | <div class="col-sm-6 nopadding" title="Delete Current Slide"> |
48 | 50 | <button class="btn btn-black btn-sm pull-right marginTop5" data-toggle="modal" data-target="#deletecurrentslide" onclick="CBDeleteSlide()"><img src="../../../content/images/CB/icon-removeslide.png" alt="" title=""></button> |
49 | 51 | </div> |
50 | - | |
51 | - | |
52 | - </div> | |
53 | - <div class="col-sm-11 nopadding"> | |
54 | - <textarea id="CBTextArea" style="margin-top: 37px;"></textarea> | |
52 | + | |
53 | + <!--Added Code by Sandeep for User Story-52695--> | |
54 | + <!--<div class="col-sm-6 nopadding" title="Capture Screen"> | |
55 | + <button class="btn btn-black btn-sm" onclick="captureScreen()"> | |
56 | + <img src="../../../content/images/CB/icon-capture.png" alt="" title="Capture"> | |
57 | + <img src="../../../content/images/CB/icon-captureview.png" alt="" title="Capture View"> | |
58 | + </button> | |
59 | + </div>--> | |
60 | + </div> | |
61 | + <div class="col-sm-11 nopadding"> | |
62 | + <textarea id="CBTextArea" style="margin-top: 37px;"></textarea> | |
63 | + </div> | |
55 | 64 | </div> |
56 | -</div> | |
57 | 65 | |
58 | 66 | |
59 | 67 | |
... | ... | @@ -105,15 +113,14 @@ |
105 | 113 | tinymce.execCommand('mceAddEditor', true, textArea_id); |
106 | 114 | } |
107 | 115 | |
108 | - | |
116 | + //Modified code by Sandeep for fixed bug TicketNo: 49226(6) | |
109 | 117 | $("#hideShowEditor").click(function () { |
110 | - | |
111 | - | |
112 | 118 | $("#cbEditorRightSideBar").toggle(); |
113 | - $(".mce-panel").toggle(); | |
114 | - | |
115 | - | |
116 | - }); | |
119 | + $(".mce-panel").toggle(); | |
120 | + $(".mce-menu-align").css("display", "none"); | |
121 | + $(".mce-menu-align").css("display", "contents"); | |
122 | + $(".mce-start").css("display", "none"); | |
123 | + }); | |
117 | 124 | |
118 | 125 | cbPasswordModelShow |
119 | 126 | function cbRenameModelShow() { |
... | ... | @@ -151,4 +158,13 @@ |
151 | 158 | |
152 | 159 | angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().myeditorclick(); |
153 | 160 | } |
161 | + | |
162 | + //Added Code by Sandeep for User Story-52695 | |
163 | + //function captureScreen() { | |
164 | + | |
165 | + // angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().captureScreen(); | |
166 | + | |
167 | + //} | |
168 | + | |
154 | 169 | </script> |
170 | + | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-detail.html
400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css