Ignore:
Timestamp:
2013-03-12T13:24:34+13:00 (11 years ago)
Author:
sjm84
Message:

Various fixes and improvements. Also trialling a different look for elements in the visual editor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js

    r27024 r27055  
    225225        _styleFunctions.push(function(){_saveButton.button({icons:{primary:"ui-icon-disk"}, disabled:true})});
    226226       
    227         _swapEditorButton = $("<button>Switch to XML Editor</button>");
     227        _swapEditorButton = $("<button>Switch to XML editor</button>");
    228228        _swapEditorButton.button().click(function()
    229229        {
     
    247247                    _editor.setValue(xmlText);
    248248                    _editor.clearSelection();
     249                    var UndoManager = require("ace/undomanager").UndoManager;
     250                    _editor.getSession().setUndoManager(new UndoManager());
    249251                    _textEditor.show();
    250                     _swapEditorButton.button("option", "label", "Switch to Visual Editor");
     252                    _swapEditorButton.button("option", "label", "Switch to visual editor");
    251253                    _isVisualEditor = false;
     254                    _xmlStatusBar.show();
    252255                }
    253256                else
     
    260263                    _vEditor.selectRootElement();
    261264                    _vEditor.getMainDiv().show();
    262                     _swapEditorButton.button("option", "label", "Switch to XML Editor");
     265                    _swapEditorButton.button("option", "label", "Switch to XML editor");
    263266                    _isVisualEditor = true;
     267                    _xmlStatusBar.hide();
    264268                }
    265269            }
     
    284288        _xmlStatusBar.css("padding", "5px");
    285289        _xmlStatusBar.addClass("ui-corner-all");
     290        _styleFunctions.push(function(){_xmlStatusBar.hide();});
    286291       
    287292        //Check the XML for errors every 2 seconds
     
    315320                    _saveButton.button("option", "disabled", false);
    316321                }
    317                 if(_swapEditorButton.button("option", "label") == "Switch to Visual Editor")
     322                if(_swapEditorButton.button("option", "label") == "Switch to visual editor")
    318323                {
    319324                    _swapEditorButton.button("option", "disabled", false);
     
    446451
    447452                _closeEditorButton.button("option", "disabled", false);
     453                if(_closeEditorButton.button("option", "label") == "Open editor")
     454                {
     455                    _closeEditorButton.button("option", "label", "Close editor");
     456                    _editingDiv.show();
     457                }
    448458            })
    449459            .error(function()
     
    582592    }
    583593   
     594    var fixTitle = function()
     595    {
     596        $("title").text($("title").text().replace(/<[^>]*>/g, ""));
     597    }
     598   
    584599    var resizeContainers = function()
    585600    {
     
    613628
    614629        addMouseEventsToDebugElements(debugElems);
     630        fixTitle();
    615631    }
    616632   
Note: See TracChangeset for help on using the changeset viewer.