Commit f3e77c0329074d10b43b032dfe2bc11b0277345f

Authored by Birendra
1 parent da18c658

add functionalities for export CB

400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
@@ -85,11 +85,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -85,11 +85,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
85 $('#HomeContainerDiv').css('pointer-events', 'none'); 85 $('#HomeContainerDiv').css('pointer-events', 'none');
86 $('#HomeContainerDiv').css('opacity', '0.7'); 86 $('#HomeContainerDiv').css('opacity', '0.7');
87 87
88 -  
89 $('#CBTextArea_ifr').css('pointer-events', 'none'); 88 $('#CBTextArea_ifr').css('pointer-events', 'none');
90 $('#CBTextArea_ifr').css('opacity', '0.7'); 89 $('#CBTextArea_ifr').css('opacity', '0.7');
91 90
92 -  
93 $('#jstree').css('pointer-events', 'none'); 91 $('#jstree').css('pointer-events', 'none');
94 $('#jstree').css('opacity', '0.7'); 92 $('#jstree').css('opacity', '0.7');
95 93
@@ -99,13 +97,12 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -99,13 +97,12 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
99 $('#cbEditorLeftSideBar').css('pointer-events', 'none'); 97 $('#cbEditorLeftSideBar').css('pointer-events', 'none');
100 $('#cbEditorLeftSideBar').css('opacity', '0.7'); 98 $('#cbEditorLeftSideBar').css('opacity', '0.7');
101 99
102 - $('#cbEditorRightSideBar').css('pointer-events', 'none');  
103 - $('#cbEditorRightSideBar').css('opacity', '0.7'); 100 + $('#cbEditorRightSideBar').css('pointer-events', 'none');
  101 + $('#cbEditorRightSideBar').css('opacity', '0.7');
104 102
105 $('.tox-editor-header').css('pointer-events', 'none'); 103 $('.tox-editor-header').css('pointer-events', 'none');
106 $('.tox-editor-header').css('opacity', '0.7'); 104 $('.tox-editor-header').css('opacity', '0.7');
107 -  
108 - 105 +
109 $timeout(function () { 106 $timeout(function () {
110 107
111 // in case failed default time out 40 second 108 // in case failed default time out 40 second
@@ -143,7 +140,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -143,7 +140,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
143 $('#cbEditorRightSideBar').css('opacity', '01'); 140 $('#cbEditorRightSideBar').css('opacity', '01');
144 141
145 $('.tox-editor-header').css('pointer-events', 'auto'); 142 $('.tox-editor-header').css('pointer-events', 'auto');
146 - $('.tox-editor-header').css('opacity', '1'); 143 + $('.tox-editor-header').css('opacity', '1');
147 144
148 } 145 }
149 146
@@ -318,18 +315,18 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -318,18 +315,18 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
318 315
319 function receivedFile(e) { 316 function receivedFile(e) {
320 //let lines = e.target.result; 317 //let lines = e.target.result;
  318 + $scope.CBEnableUI();
321 var jsonData = JSON.parse(e.target.result); 319 var jsonData = JSON.parse(e.target.result);
322 localStorage.setItem("cbJsonDataObject", JSON.stringify(jsonData)); 320 localStorage.setItem("cbJsonDataObject", JSON.stringify(jsonData));
323 $rootScope.cbJsonData = ""; $rootScope.cbDynamicJsonData = ""; 321 $rootScope.cbJsonData = ""; $rootScope.cbDynamicJsonData = "";
324 $rootScope.cbJsonData = JSON.parse(e.target.result); 322 $rootScope.cbJsonData = JSON.parse(e.target.result);
325 $rootScope.cbDynamicJsonData = JSON.parse(e.target.result); 323 $rootScope.cbDynamicJsonData = JSON.parse(e.target.result);
326 $rootScope.cbTreeFirstLabel = $rootScope.cbJsonData.slideshow.presentation.structure._label; 324 $rootScope.cbTreeFirstLabel = $rootScope.cbJsonData.slideshow.presentation.structure._label;
327 -  
328 - $rootScope.getCBsummary();  
329 - $scope.CBEnableUI();  
330 -  
331 $rootScope.AutherName = ""; 325 $rootScope.AutherName = "";
332 $rootScope.summary = ""; 326 $rootScope.summary = "";
  327 +
  328 + $rootScope.getCBsummary();
  329 +
333 $rootScope.FileTitle = $rootScope.cbTreeFirstLabel; 330 $rootScope.FileTitle = $rootScope.cbTreeFirstLabel;
334 331
335 $timeout(function () { 332 $timeout(function () {
@@ -469,7 +466,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -469,7 +466,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
469 } 466 }
470 467
471 $scope.openTinyMCE = function (nodeid) { 468 $scope.openTinyMCE = function (nodeid) {
472 -  
473 $scope.CBDisableUI(); 469 $scope.CBDisableUI();
474 if ($scope.Currentselectednodeid == undefined || $scope.Currentselectednodeid != nodeid) { 470 if ($scope.Currentselectednodeid == undefined || $scope.Currentselectednodeid != nodeid) {
475 console.log("instance create for id : " + nodeid); 471 console.log("instance create for id : " + nodeid);
@@ -488,7 +484,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -488,7 +484,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
488 $("#AddSection").addClass("cbAddSection"); 484 $("#AddSection").addClass("cbAddSection");
489 $("#openResourceId").removeClass("openResources"); 485 $("#openResourceId").removeClass("openResources");
490 $("#openPictureId").removeClass("OpenPitures"); 486 $("#openPictureId").removeClass("OpenPitures");
491 - 487 + $("#export_btn").addClass("importExportSection");
  488 + $("#import_btn").addClass("importExportSection");
492 } 489 }
493 if ($scope.selectedNodeSingleObj._isBranch == "true") { 490 if ($scope.selectedNodeSingleObj._isBranch == "true") {
494 $("#Deletesection").removeClass("DeletesectionClass"); 491 $("#Deletesection").removeClass("DeletesectionClass");
@@ -497,7 +494,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -497,7 +494,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
497 $("#AddSection").removeClass("cbAddSection"); 494 $("#AddSection").removeClass("cbAddSection");
498 $("#openResourceId").addClass("openResources"); 495 $("#openResourceId").addClass("openResources");
499 $("#openPictureId").addClass("OpenPitures"); 496 $("#openPictureId").addClass("OpenPitures");
  497 + $("#export_btn").removeClass("importExportSection");
  498 + $("#import_btn").removeClass("importExportSection");
500 } 499 }
  500 + $scope.nodeTypeIsBranch = $scope.selectedNodeSingleObj._isBranch;
  501 +
501 $scope.DropDownSelectNodeClick(nodeid); 502 $scope.DropDownSelectNodeClick(nodeid);
502 $scope.SelectedNotes = ""; 503 $scope.SelectedNotes = "";
503 504
@@ -529,13 +530,21 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -529,13 +530,21 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
529 530
530 } 531 }
531 }, 200); 532 }, 200);
532 - //$scope.CBEnableUI(); 533 +
533 } 534 }
534 else { 535 else {
535 tinymce.get("CBTextArea").setContent(""); 536 tinymce.get("CBTextArea").setContent("");
536 $scope.CBEnableUI(); 537 $scope.CBEnableUI();
  538 + //disable tiny editor while section active
  539 + if($scope.nodeTypeIsBranch=="true")
  540 + {
  541 + $('.tox-editor-header').css('pointer-events', 'none');
  542 + $('.tox-editor-header').css('opacity', '0.7');
  543 + $('#CBTextArea_ifr').css('pointer-events', 'none');
  544 + $('#CBTextArea_ifr').css('opacity', '0.7');
  545 + }
  546 +
537 } 547 }
538 -  
539 } 548 }
540 else { 549 else {
541 $scope.CBEnableUI(); 550 $scope.CBEnableUI();
@@ -941,6 +950,127 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -941,6 +950,127 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
941 document.getElementById('cbModelDeleteBackground').style.display = "block"; 950 document.getElementById('cbModelDeleteBackground').style.display = "block";
942 document.getElementById('cbModelDeleteConfirmBoxId').style.display = "block"; 951 document.getElementById('cbModelDeleteConfirmBoxId').style.display = "block";
943 } 952 }
  953 + $rootScope.ExportSection = function () {
  954 + var currentid = document.getElementById('cbSelect').value;
  955 +
  956 + if ($rootScope.contentNotesForSaveCB.length == 0) {
  957 + $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents;
  958 + }
  959 + $scope.SectionContentForExportCB=[];
  960 +
  961 + traverseTreeSelectedSingleObj($rootScope.stru, currentid);
  962 +
  963 + var strFromParent=$scope.selectedNodeSingleObj['structure'];
  964 + if(strFromParent.length<=0)
  965 + {
  966 + alert("Add slide in this section to export this curriculum");
  967 + return;
  968 + }
  969 + $("#btnExportCB").css({"display":"block"}) ;
  970 + $("#btnSaveCB").css({"display":"none"}) ;
  971 + $(".export-curriculum").modal("show").draggable({ handle: ".modal-header" });
  972 + $(".modal-backdrop").css("opacity", ".5");
  973 + $(".modal-backdrop").css("z-index", "1200001");
  974 + }
  975 +
  976 + $scope.ExportCurriculum =function()
  977 + {
  978 + var filename = document.getElementById("filename").value;
  979 + if (filename == "" ||filename == " ")
  980 + {
  981 + alert("Curriculum name is empty!");
  982 + return;
  983 + }
  984 +
  985 + var strFromParent=$scope.selectedNodeSingleObj['structure'];
  986 + var parentLevel=$scope.selectedNodeSingleObj._label;
  987 + var parentId=$scope.selectedNodeSingleObj._id;
  988 +
  989 + var rootNoteSummary = new jinqJs()
  990 + .from($rootScope.contentNotesForSaveCB)
  991 + .where("_id == " + $scope.selectedNodeSingleObj._id)
  992 + .select();
  993 +
  994 + $scope.SectionContentForExportCB.push(
  995 + {
  996 + "summary":rootNoteSummary[0].summary,
  997 + "author": rootNoteSummary[0].author,
  998 + "modified":rootNoteSummary[0].modified,
  999 + "password":rootNoteSummary[0].password,
  1000 + "version":rootNoteSummary[0].version,
  1001 + "windows":rootNoteSummary[0].windows,
  1002 + "_id":rootNoteSummary[0]._id,
  1003 + });
  1004 +
  1005 + function traverseTreeforExportContent(o) {
  1006 + for (var i in o) {
  1007 +
  1008 + if (o[i] !== null && typeof (o[i]) == "object") {
  1009 + var selectedNode = o[i];
  1010 + var childId = selectedNode._id;
  1011 + if(childId!=undefined)
  1012 + {
  1013 + for (var k = 0; k < $rootScope.contentNotesForSaveCB.length; k++) {
  1014 + if (($rootScope.contentNotesForSaveCB[k]._id == childId)) {
  1015 + $scope.SectionContentForExportCB.push($rootScope.contentNotesForSaveCB[k]);
  1016 + }
  1017 + }
  1018 + }
  1019 +
  1020 + traverseTreeforExportContent(o[i]);
  1021 + }
  1022 +
  1023 + }
  1024 + }
  1025 +
  1026 + traverseTreeforExportContent(strFromParent);
  1027 +
  1028 + $rootScope.dynamicUpdatedJsonForExportCB =
  1029 + {
  1030 + "slideshow": {
  1031 + "presentation": {
  1032 + "structure": {
  1033 + "structure":strFromParent,
  1034 + "_label": parentLevel,
  1035 + "_id": parentId,
  1036 + "_isRoot": "true",
  1037 + "_isBranch": "true",
  1038 + "_isLocked": "false"
  1039 + },
  1040 + "_anchor": "true",
  1041 + "_window_position": "6,10",
  1042 + "_window_size": "828,453" // Apply Dynamic
  1043 + },
  1044 + "content": {
  1045 + "element": $scope.SectionContentForExportCB,
  1046 + }
  1047 + }
  1048 +
  1049 + };
  1050 +
  1051 + //add extension
  1052 + filename += '.json';
  1053 + var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForExportCB, true)], { type: 'text/text' });
  1054 + if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  1055 + window.navigator.msSaveOrOpenBlob(blob, filename);
  1056 + }
  1057 + else {
  1058 + document.execCommand("SaveAs", true, filename);
  1059 +
  1060 + var event = document.createEvent('MouseEvents'),
  1061 + saveElement = document.createElement('a');
  1062 + saveElement.download = filename;
  1063 + saveElement.href = window.URL.createObjectURL(blob);
  1064 + saveElement.dataset.downloadurl = ['text/json', saveElement.download, saveElement.href].join(':');
  1065 + event.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  1066 + saveElement.dispatchEvent(event);
  1067 +
  1068 + }
  1069 + $rootScope.dynamicUpdatedJsonForExportCB = "";
  1070 + $("#filename").val("");
  1071 +
  1072 + }
  1073 +
944 1074
945 $rootScope.DeleteSlideSection = function () { 1075 $rootScope.DeleteSlideSection = function () {
946 var cbCurrentSelectedId = document.getElementById('cbSelect').value; 1076 var cbCurrentSelectedId = document.getElementById('cbSelect').value;
@@ -1206,18 +1336,27 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -1206,18 +1336,27 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1206 console.log($rootScope.contentNotesForSaveCB); 1336 console.log($rootScope.contentNotesForSaveCB);
1207 } 1337 }
1208 1338
1209 - $rootScope.saveCurricullam = function (file_Name) {  
1210 -  
1211 - //$scope.exportToFile(file_Name); 1339 + $rootScope.saveCurricullam = function () {
  1340 + $("#btnExportCB").css({"display":"none"}) ;
  1341 + $("#btnSaveCB").css({"display":"block"}) ;
  1342 + $(".export-curriculum").modal("show").draggable({ handle: ".modal-header" });
  1343 + $(".modal-backdrop").css("opacity", ".5");
  1344 + $(".modal-backdrop").css("z-index", "1200001");
  1345 + }
  1346 +
  1347 + $rootScope.saveMyCurricullam = function () {
  1348 + var filename = document.getElementById("filename").value;
  1349 + if (filename == "" ||filename == " ")
  1350 + {
  1351 + alert("Curriculum name is empty!");
  1352 + return;
  1353 + }
1212 1354
1213 var cbCurrentId = document.getElementById('cbSelect').value; 1355 var cbCurrentId = document.getElementById('cbSelect').value;
1214 - if ($rootScope.structureObjForSaveCB.length == 0) {  
1215 - //$rootScope.structureObjForSaveCB = $rootScope.structure;// only Tree Array  
1216 - //$rootScope.structureObjForSaveCB = $rootScope.stru.slideshow.presentation.structure.structure; 1356 + if ($rootScope.structureObjForSaveCB.length == 0) {
1217 $rootScope.structureObjForSaveCB = $rootScope.stru.structure.structure; 1357 $rootScope.structureObjForSaveCB = $rootScope.stru.structure.structure;
1218 } 1358 }
1219 - if ($rootScope.contentNotesForSaveCB.length == 0) {  
1220 - //$rootScope.contentNotesForSaveCB = $rootScope.cbJsonData.slideshow.content.element; 1359 + if ($rootScope.contentNotesForSaveCB.length == 0) {
1221 $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents;//Assign Dnamic Contents 1360 $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents;//Assign Dnamic Contents
1222 } 1361 }
1223 $rootScope.updatedContentFromEditor(cbCurrentId); 1362 $rootScope.updatedContentFromEditor(cbCurrentId);
@@ -1229,10 +1368,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -1229,10 +1368,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1229 "slideshow": { 1368 "slideshow": {
1230 "presentation": { 1369 "presentation": {
1231 "structure": { 1370 "structure": {
1232 - "structure": //[  
1233 -  
1234 - $rootScope.structureObjForSaveCB,  
1235 - //], 1371 + "structure": $rootScope.structureObjForSaveCB,
1236 "_label": $rootScope.cbTreeFirstLabel, 1372 "_label": $rootScope.cbTreeFirstLabel,
1237 "_id": $rootScope.cbTreeFirstID, 1373 "_id": $rootScope.cbTreeFirstID,
1238 "_isRoot": "true", 1374 "_isRoot": "true",
@@ -1244,27 +1380,22 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -1244,27 +1380,22 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1244 "_window_size": "828,453" // Apply Dynamic 1380 "_window_size": "828,453" // Apply Dynamic
1245 }, 1381 },
1246 "content": { 1382 "content": {
1247 - "element": //[  
1248 -  
1249 - $rootScope.contentNotesForSaveCB,  
1250 - //] 1383 + "element": $rootScope.contentNotesForSaveCB,
1251 } 1384 }
1252 } 1385 }
1253 1386
1254 }; 1387 };
1255 1388
1256 - $scope.slideshow = $rootScope.dynamicUpdatedJsonForSaveCB;  
1257 - $scope.filename = "SandySaveCB.json";  
1258 - var filename = $scope.filename; 1389 + //add extension
  1390 + filename += '.json';
  1391 +
1259 var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForSaveCB, true)], { type: 'text/text' }); 1392 var blob = new Blob([angular.toJson($rootScope.dynamicUpdatedJsonForSaveCB, true)], { type: 'text/text' });
1260 if (window.navigator && window.navigator.msSaveOrOpenBlob) { 1393 if (window.navigator && window.navigator.msSaveOrOpenBlob) {
1261 window.navigator.msSaveOrOpenBlob(blob, filename); 1394 window.navigator.msSaveOrOpenBlob(blob, filename);
1262 } 1395 }
1263 else { 1396 else {
1264 document.execCommand("SaveAs", true, filename); 1397 document.execCommand("SaveAs", true, filename);
1265 - //$("#bo").document.execCommand("SaveAs", true, filename);  
1266 - //angular.element(document.execCommand("SaveAs", false, filename)).scope();  
1267 - 1398 +
1268 var event = document.createEvent('MouseEvents'), 1399 var event = document.createEvent('MouseEvents'),
1269 saveElement = document.createElement('a'); 1400 saveElement = document.createElement('a');
1270 saveElement.download = filename; 1401 saveElement.download = filename;
@@ -1275,8 +1406,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ @@ -1275,8 +1406,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
1275 //window.URL.revokeObjectURL(url); // clean the url.createObjectURL resource 1406 //window.URL.revokeObjectURL(url); // clean the url.createObjectURL resource
1276 } 1407 }
1277 $rootScope.dynamicUpdatedJsonForSaveCB = ""; 1408 $rootScope.dynamicUpdatedJsonForSaveCB = "";
1278 - //$rootScope.contentNotesForSaveCB = [];  
1279 - //$rootScope.structureObjForSaveCB = []; 1409 + $("#filename").val("");
1280 } 1410 }
1281 1411
1282 1412
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -1859,6 +1859,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data @@ -1859,6 +1859,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1859 $("#printAllAVAnchor").addClass("PrintViewer"); 1859 $("#printAllAVAnchor").addClass("PrintViewer");
1860 $("#printPreviewAnchor").addClass("PrintPreview"); 1860 $("#printPreviewAnchor").addClass("PrintPreview");
1861 $("#exportImageAnchor").addClass("exportImage"); 1861 $("#exportImageAnchor").addClass("exportImage");
  1862 + //close while back from cb
  1863 + $rootScope.CloseAnnotationTool();
  1864 + $rootScope.CloseListManager();
  1865 +
1862 } 1866 }
1863 else if ($location.url() == "/curriculum-builder-detail") { 1867 else if ($location.url() == "/curriculum-builder-detail") {
1864 $("#fileMenuAnchor").removeClass("disableFileMenu"); 1868 $("#fileMenuAnchor").removeClass("disableFileMenu");
400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/CBuild-view.html
@@ -38,6 +38,4 @@ @@ -38,6 +38,4 @@
38 </div><!-- /.modal-content --> 38 </div><!-- /.modal-content -->
39 </div><!-- /.modal-dialog --> 39 </div><!-- /.modal-dialog -->
40 </div> 40 </div>
41 - <!-- <input type="file" id="openCBJsonFile1" style="display: none" /> -->  
42 -  
43 </div> 41 </div>
44 \ No newline at end of file 42 \ No newline at end of file
400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-TinyMCEjspanel.html
1 -  
2 -  
3 -  
4 <div class="col-sm-12 nopadding" ng-controller="CurrBuildController"> 1 <div class="col-sm-12 nopadding" ng-controller="CurrBuildController">
5 <div class="col-sm-12 nopadding"> 2 <div class="col-sm-12 nopadding">
6 <div class="form-inline" id="cbEditorTopMenuBar"> 3 <div class="form-inline" id="cbEditorTopMenuBar">
@@ -22,21 +19,9 @@ @@ -22,21 +19,9 @@
22 </button> 19 </button>
23 <div class="form-group"> 20 <div class="form-group">
24 <select id='cbSelect'></select> 21 <select id='cbSelect'></select>
25 -  
26 - <!--<select ng-model="selectedCountry" ng-options="item.countryId as item.name for item in chooseCountries">  
27 - <option value="">Select Account</option>  
28 - </select>-->  
29 - <!--<!--<select class="form-control input-sm">  
30 - <option>What is Curriculum Builder</option>  
31 - <option>Prebuilt Curriculum</option>  
32 - <option>Creating a New Curriculum</option>  
33 - <option>Creating &amp; Capturing Content</option>  
34 - <option>Import &amp; Export Curriculum</option>  
35 - <option>Distributing Curriculum</option>  
36 - </select>-->  
37 <label class="font13" id="slideNumber" style="color:#fff !important">Slide 01 of 06</label> 22 <label class="font13" id="slideNumber" style="color:#fff !important">Slide 01 of 06</label>
38 </div> 23 </div>
39 - <button class="btn btn-black btn-sm " id="hideShowEditor" onclick="editorHideShow()" title="Show/Hide Note"><img title="" alt="" src="../../../content/images/CB/icon-note.png"></button> 24 + <button class="btn btn-black btn-sm " id="hideShowEditor" onclick="editorHideShow()" title="Show/Hide Note"><img alt="" src="../../../content/images/CB/icon-note.png"></button>
40 25
41 <select id='viwerSelect' onchange="viwerSelectOnChange(this)" title="Captured Viewers"> </select> 26 <select id='viwerSelect' onchange="viwerSelectOnChange(this)" title="Captured Viewers"> </select>
42 </div> 27 </div>
@@ -47,10 +32,21 @@ @@ -47,10 +32,21 @@
47 <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> 32 <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>
48 </div>--> 33 </div>-->
49 <div class="col-sm-6 nopadding" title="Add Slide"> 34 <div class="col-sm-6 nopadding" title="Add Slide">
50 - <button class="btn btn-black btn-sm marginTop5" onclick="CBAddNewSlide()"><img src="../../../content/images/CB/icon-addslide.png" alt="" title=""></button> 35 + <button class="btn btn-black btn-sm marginTop5" onclick="CBAddNewSlide()"><img src="../../../content/images/CB/icon-addslide.png" alt=""></button>
51 </div> 36 </div>
52 <div class="col-sm-6 nopadding" title="Delete Current Slide"> 37 <div class="col-sm-6 nopadding" title="Delete Current Slide">
53 - <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> 38 + <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=""></button>
  39 + </div>
  40 +
  41 + <div class="col-sm-6 nopadding" title="Export Curriculum">
  42 + <button id="export_btn" class="btn btn-black btn-sm" style="height: 30px;width: 35px;" title="Export Curriculum" onclick="ExportSection()">
  43 + <img style="top: 5px;height: 20px;width: 25px;position: absolute;left: 5px;" src="../../../content/images/CB/export-cb.png" alt="">
  44 + </button>
  45 + </div>
  46 + <div class="col-sm-6 nopadding" title="Import Curriculum">
  47 + <button id="import_btn" class="btn btn-black btn-sm" style="height: 30px;width: 35px;" title="Import Curriculum" onclick="ImportSection()">
  48 + <img style="top: 5px;height: 20px;width: 25px;position: absolute;left: 5px;" src="../../../content/images/CB/import-cb.png" alt="">
  49 + </button>
54 </div> 50 </div>
55 51
56 52
@@ -141,6 +137,10 @@ @@ -141,6 +137,10 @@
141 137
142 angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().myeditorclick(); 138 angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().myeditorclick();
143 } 139 }
  140 + function ExportSection() {
  141 +
  142 + angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().ExportSection();
  143 + }
144 144
145 //Added Code by Sandeep for User Story-52695 145 //Added Code by Sandeep for User Story-52695
146 //function captureScreen() { 146 //function captureScreen() {
400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-detail.html
@@ -299,9 +299,44 @@ @@ -299,9 +299,44 @@
299 </div> 299 </div>
300 </div> 300 </div>
301 301
302 - </div>  
303 -  
304 - 302 + </div>
  303 +
  304 + <!--Save/Export CB Model-->
  305 + <div class="modal fade export-curriculum ui-draggable in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="z-index: 1200002;">
  306 + <div class="modal-dialog modal-sm" role="document">
  307 + <div class="modal-content">
  308 + <div class="modal-header annotation-modal-header ui-draggable-handle">
  309 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  310 + <h4 class="modal-title" id="">Save As</h4>
  311 + </div>
  312 + <div class="modal-body">
  313 + <div class="row paddTopbtm15">
  314 + <div class="col-sm-12">
  315 + <div class="form-group">
  316 + <label for="filename">Curriculum Name:</label>
  317 + <div class="input-group">
  318 + <input type="text" class="form-control" id="filename" placeholder="enter name.." onkeyup="removeSpaces(this.value);">
  319 + <div class="input-group-addon">.json</div>
  320 + </div>
  321 + </div>
  322 + </div>
  323 + </div>
  324 +
  325 + </div>
  326 + <div class="modal-footer">
  327 + <div class="row">
  328 + <input type="file" id="file1" style="display:none">
  329 + <div class="col-sm-12">
  330 + <button id="btnExportCB" style="float:right" ng-click="ExportCurriculum()" class="btn btn-primary" data-dismiss="modal" type="button">Ok</button>
  331 + <button id="btnSaveCB"style="float:right" ng-click="saveMyCurricullam()" class="btn btn-primary" data-dismiss="modal" type="button">Ok</button>
  332 + </div>
  333 + </div>
  334 + </div>
  335 +
  336 + </div>
  337 + </div>
  338 + </div>
  339 +
305 </div> 340 </div>
306 <div id="resourceModuleDiv"></div> 341 <div id="resourceModuleDiv"></div>
307 <div class="clearfix"></div> 342 <div class="clearfix"></div>
@@ -321,40 +356,13 @@ @@ -321,40 +356,13 @@
321 }); 356 });
322 }); 357 });
323 358
324 - //var allowsubmit = false;  
325 - //$(function () {  
326 - // $('#cbPassword').keyup(function (e) {  
327 - // var pass = $(this).val();  
328 - // //var confpass = $('#cbConfirmPassWord').val();  
329 - // if (pass.length < 3) {  
330 - // $('#errorMsg').text('Password must contain at least 3 characters!');  
331 - // $("#btnOK").attr('disabled', 'disabled');  
332 -  
333 - // } else {  
334 - // $('#errorMsg').text('');  
335 - // allowsubmit = true;  
336 - // //$("#btnOK").removeAttr('disabled');  
337 - // }  
338 - // });  
339 -  
340 - // //on keypress  
341 - // $('#cbConfirmPassWord').keyup(function (e) {  
342 - // var pass = $('#cbPassword').val();  
343 - // var confpass = $(this).val();  
344 - // if (pass == confpass) {  
345 - // $('#errorMsg').text('');  
346 - // allowsubmit = true;  
347 - // $("#btnOK").removeAttr('disabled');  
348 - // } else {  
349 - // $('#errorMsg').text('Password not matching');  
350 - // allowsubmit = false;  
351 - // $("#btnOK").attr('disabled', 'disabled');  
352 - // }  
353 - // });  
354 - //});  
355 -  
356 </script> 359 </script>
357 <script> 360 <script>
  361 + function removeSpaces(string)
  362 + {
  363 + $("#filename").val(string.split(' ').join(''));
  364 + }
  365 +
358 function callEditorOnInit() 366 function callEditorOnInit()
359 { 367 {
360 setTimeout(function () { 368 setTimeout(function () {
@@ -363,7 +371,7 @@ @@ -363,7 +371,7 @@
363 "core": { 371 "core": {
364 "check_callback": true, 372 "check_callback": true,
365 }, 373 },
366 - "plugins": ["dnd"], 374 + //"plugins": ["dnd"],
367 375
368 }).on('ready.jstree',function() 376 }).on('ready.jstree',function()
369 { 377 {
400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-image-jspanel.html deleted
400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-image.html deleted
1 -  
2 -<div id="ImageDiv" style="background-color:white">  
3 - <img id="imgtag" />  
4 -</div>  
400-SOURCECODE/AIAHTML5.Web/content/images/CB/export-cb.png 0 → 100644

1018 Bytes

400-SOURCECODE/AIAHTML5.Web/content/images/CB/import-cb.png 0 → 100644

1.02 KB

400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css
@@ -1336,6 +1336,12 @@ footer .browserIcons @@ -1336,6 +1336,12 @@ footer .browserIcons
1336 opacity:.5; 1336 opacity:.5;
1337 } 1337 }
1338 1338
  1339 +.importExportSection
  1340 +{
  1341 + pointer-events:none;
  1342 + opacity:.5;
  1343 +}
  1344 +
1339 .texteditor 1345 .texteditor
1340 { 1346 {
1341 padding:0px !important; 1347 padding:0px !important;