curriculum-builder-TinyMCEjspanel.html 6.82 KB
<div class="col-sm-12 nopadding" ng-controller="CurrBuildController">
    <div class="col-sm-12 nopadding">
        <div class="form-inline" id="cbEditorTopMenuBar">
            <!-- <button class="btn btn-primary btn-sm">
                <img src="../../../content/images/CB/anchor-icon.png" alt="" title="">
            </button> -->

            <button id="btnRenameSlide" class="btn btn-black btn-sm" title="Rename Slide" onclick="cbRenameModelShow()">
                <img src="../../../content/images/CB/icon-tasks.png" alt="">
            </button>
            <button id="btnLocking" class="btn btn-black btn-sm" title="Lock" onclick="cbPasswordModelShow()">
                <img id="iconimage" src="../../../content/images/CB/unlock.png" />
            </button>
            <button class="btn btn-black btn-sm" title="Back" onclick="cbBack()">
                <img src="../../../content/images/CB/icon-back.png" alt="">
            </button>
            <button class="btn btn-black btn-sm" title="Forward" onclick="cbNext()">
                <img src="../../../content/images/CB/icon-next.png" alt="">
            </button>
            <div class="form-group">
                <select id='cbSelect'></select>
                <label class="font13" id="slideNumber" style="color:#fff !important">Slide  01 of 06</label>
            </div>
            <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>

            <select id='viwerSelect' onchange="viwerSelectOnChange(this)" title="Captured Viewers"> </select>
        </div>
    </div>
    <div class="col-sm-1 nopadding" id="cbEditorLeftSideBar" style="display:none">
        <div class="col-sm-6 nopadding" title="Add Slide">
            <button class="btn btn-black btn-sm marginTop5" onclick="CBAddNewSlide()"><img src="../../../content/images/CB/icon-addslide.png" alt=""></button>
        </div>
        <div class="col-sm-6 nopadding" title="Delete Current Slide">
            <button id="deletecurrentslide" 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>
        </div>

        <div class="col-sm-6 nopadding" title="Export Curriculum from here">
            <button id="export_btn" class="btn btn-black btn-sm" style="height: 30px;width: 35px;"  title="Export Curriculum from here"  onclick="ExportSection()">
                <img style="top: 5px;height: 20px;width: 25px;position: absolute;left: 5px;" src="../../../content/images/CB/export-cb.png" alt="">
            </button>
        </div>
        <div class="col-sm-6 nopadding" title="Import Curriculum">
            <button id="import_btn" class="btn btn-black btn-sm" style="height: 30px;width: 35px;"  title="Import Curriculum"  onclick="ImportSection()">
                <img style="top: 5px;height: 20px;width: 25px;position: absolute;left: 5px;"  src="../../../content/images/CB/import-cb.png" alt="">
            </button>
        </div>



    </div>
    <div class="col-sm-12 nopadding" id="cbEditorRightSideBar">
        <textarea id="CBTextArea" style="margin-top: 37px;"></textarea>
    </div>

</div>


<script type="text/javascript">

    $(document).ready(function () {
        tinymce.remove();
        tinymce.init({
            selector: "#CBTextArea",
            init_instance_callback: function (editor) {
                editor.on('click', function (e) {
                    myeditorclick();

                });
                editor.setContent('');
            },
            setup: function (editor) {
                editor.on('init', function () {
                    //birendra
                    // call after initilization
                    callEditorOnInit();                 
                });
            },
            plugins: 'advlist, lists, autolink, link, anchor, print, preview, searchreplace, fullscreen, hr',
            menubar: 'file edit view insert format',
            toolbar: 'undo redo |fontsizeselect fontselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist | forecolor backcolor | link anchor | formatselect |strikethrough | outdent indent | removeformat | fullscreen  preview  print',
            height: 450,
            toolbar_drawer: 'sliding',
            content_style: ".mce-content-body {font-size:14pt;font-family:Arial;}"

        });

    });

    var previous;

    $("#cbSelect").on('focus', function () {
        previous = document.getElementById('cbSelect').value;
    }).change(function() {      
        cbSelectOnChange(this,previous);
        previous = this.value;
    });

    //Modified code by Sandeep for fixed bug TicketNo: 49226(6)
    function editorHideShow() {

        $("#cbEditorRightSideBar").toggle();
       // $("#cbEditorLeftSideBar").toggle();
    }

    function cbRenameModelShow() {
        angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().cbRenameModelShow();

    }
    function cbPasswordModelShow() {
        angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().cbPasswordModelShow();

    }

    function cbBack() {
        angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().cbBack();
    }
    function cbNext() {
        angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().cbNext();

    }
    function CBAddNewSlide() {
        angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().CBAddSlide();
    }
    function CBDeleteSlide() {

        angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().showDeleteSlideModel();
    }
    function cbSelectOnChange(obj,prevValue) {

        angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().cbSelectOnChange(obj,prevValue);
    }
    function myeditorclick() {

        angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().myeditorclick();
    }
    function ExportSection() {

    angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().ExportSection();
    }
    function ImportSection() {

    angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().ImportSection();
    }

    //Added Code by Sandeep for User Story-52695
    //function captureScreen() {

    //    angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().captureScreen();

    //}

    //Added Code by Sandeep for User Story-52696
    function viwerSelectOnChange(obj) {

        angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope().viwerSelectOnChange(obj);
    }

</script>