Changeset 26645 for main/trunk


Ignore:
Timestamp:
2013-01-10T14:08:17+13:00 (11 years ago)
Author:
sjm84
Message:

The editor is now resizable

File:
1 edited

Legend:

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

    r26640 r26645  
    3333        _mainDiv.css(
    3434        {
    35             "position":"fixed",
    36             "font-size":"0.7em",
    37             "bottom":"0px", 
    38             "height":"40px",
     35            "position":"fixed",
     36            "font-size":"0.7em",
     37            "bottom":"0px",
    3938            "width":"100%",
    40             "background":"white", 
    41             "border":"1px black solid", 
     39            "background":"white",
     40            "border":"1px black solid",
    4241            "padding":"5px",
    4342            "z-index":100
     
    5150        toolBarDiv.append(buttonDiv);
    5251        _textDiv = $("<div>");
    53         _textDiv.css({"overflow":"auto", "width":"100%", "height":"260px"});
     52        _textDiv.css({"overflow":"auto", "width":"100%"});
    5453
    5554        var pickElementButton = $("<input type=\"button\" value=\"Enable debugging\">");
     
    9392                $(this).val("Open editor");
    9493                _editingDiv.hide();
    95                 _mainDiv.css("height", (_mainDiv.height() - 200) + "px");
    9694            }
    9795            else
     
    9997                $(this).val("Close editor");
    10098                _editingDiv.show();
    101                 _mainDiv.css("height", (_mainDiv.height() + 200) + "px");
    10299            }
    103100        });
     
    187184        });
    188185       
    189         var minimiseButton = $("<img>", {"src":gs.imageURLs.expand});
     186        var minimiseButton = $("<img>", {"src":gs.imageURLs.collapse});
    190187        minimiseButton.css({"cursor":"pointer", "float":"right", "margin-right":"20px"});
    191188        minimiseButton.click(function()
     
    195192                _textDiv.hide();
    196193                $(this).attr("src", gs.imageURLs.expand);
    197                 _mainDiv.css("height", (_mainDiv.height() - 260) + "px");
    198194            }
    199195            else
     
    201197                _textDiv.show();
    202198                $(this).attr("src", gs.imageURLs.collapse);
    203                 _mainDiv.css("height", (_mainDiv.height() + 260) + "px");
    204199            }
    205200        });
     
    280275                }
    281276           
    282                 var editArea = $("<div>", {"id":"textEditor"});
    283                 editArea.css({"width":"100%", "height":"180px"});
    284                 editArea.val(template);
     277                var textEditor = $("<div>", {"id":"textEditor"});
     278                textEditor.css({"width":"100%"});
     279                textEditor.val(template);
    285280               
    286281                _editingDiv.empty();
    287                 _editingDiv.append(editArea);
    288                 _editingDiv.css({"height":"190px"});
     282                _editingDiv.append($("<p>" + filepath + "</p>"));
     283                _editingDiv.append(textEditor);
    289284               
    290285                _editor = ace.edit("textEditor");
     
    293288                _editor.setValue(template);
    294289                _editor.clearSelection();
    295                 console.log(_editor);
    296                
    297                 _mainDiv.css({"height":"500px"});
     290               
     291                textEditor.css({"min-height":"200px", "border-top":"5px solid #444"});
     292                textEditor.resizable({handles: 'n', resize:function()
     293                {
     294                    textEditor.css({top:"0px"});
     295                }});
    298296               
    299297                _closeEditorButton.removeAttr("disabled");
     
    371369                    var infoContainer = $("<div>");
    372370                    infoContainer.css({"cursor":"pointer", "border":"1px dashed #AAAAAA", "margin":"5px"});
    373                     var fromDIV = $("<div>");
    374371                    var elementDIV = $("<div>");
    375372
    376373                    elementDIV.css("font-size", "1.1em");
    377                     fromDIV.css("font-size", "0.9em");
    378 
    379                     infoContainer.append(fromDIV);
     374
    380375                    infoContainer.append(elementDIV);
    381376                   
     
    397392                        attrstr += this.name + "=\"" + this.value + "\" ";
    398393                    });
    399                    
    400                     fromDIV.text("From " + filepath + ":");
     394
    401395                    elementDIV.text("<" + fullNodename + " " + attrstr + ">");
    402396                   
Note: See TracChangeset for help on using the changeset viewer.