Changeset 27129 for main


Ignore:
Timestamp:
2013-03-26T16:53:38+13:00 (11 years ago)
Author:
sjm84
Message:

Moving the file selector and changing/moving the template selector

Location:
main/trunk/greenstone3/web/interfaces/default
Files:
2 edited

Legend:

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

    r27128 r27129  
    323323    }
    324324   
     325    var createFileAndTemplateSelectors = function(buttonDiv)
     326    {
     327        _templateSelector = $("<div>", {"id":"veTemplateSelector", "class":"ui-state-default ui-corner-all"});
     328        _templateSelector.append($("<span>Templates: <span>"));
     329        var templateSelectBox = $("<select>").append("<option>-- No templates --</option>");
     330        templateSelectBox.change(function()
     331        {
     332            var selected = templateSelectBox.find(":selected");
     333            var changeFunction = selected.data("changeFunction");
     334            if(changeFunction)
     335            {
     336                changeFunction();
     337            }
     338        });
     339        _templateSelector.append(templateSelectBox);
     340        _fileSelector = $("<div>", {"id":"veFileSelector", "class":"ui-state-default ui-corner-all"});
     341        buttonDiv.append(_fileSelector);
     342        buttonDiv.append(_templateSelector);
     343    }
     344   
    325345    var createDebugDiv = function()
    326346    {
     
    346366        toolBarDiv.append(buttonDiv);
    347367        createButtonDiv(buttonDiv);
     368        createFileAndTemplateSelectors(buttonDiv);
    348369        createXMLStatusBar(buttonDiv);
    349        
    350         _navArea = $("<div>", {"id":"veNavArea"});
    351         _templateSelector = $("<div>", {"id":"veTemplateSelector"});
    352         _fileSelector = $("<div>", {"id":"veFileSelector", "class":"ui-state-default ui-corner-all"});
    353         _navArea.append(_fileSelector);
    354         _navArea.append(_templateSelector);
    355         _navArea.append("<div>", {style:"clear:both;"});
    356370       
    357371        //Populate the file selector
     
    381395            {
    382396                var selectedItem = selectBox.find(":selected");
     397               
     398                if(!selectedItem.data("fileItem"))
     399                {
     400                    return;
     401                }
    383402               
    384403                var getURL = gs.xsltParams.library_name + "?a=g&rt=r&s=GetTemplateListFromFile&s1.fileName=" + selectedItem.data("fileItem").path + "&s1.locationName=" + selectedItem.data("fileItem").location + "&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.siteName=" + gs.xsltParams.site_name + "&s1.collectionName=" + gs.cgiParams.c;
     
    392411                   
    393412                    clearAll();
     413                   
     414                    _templateSelector.children("select").empty();
     415                    if(templateList.length == 0)
     416                    {
     417                        _templateSelector.children("select").append("<option>-- No templates --</option>");
     418                    }
     419                    else
     420                    {
     421                        _templateSelector.children("select").append("<option>-- Select a template --</option>");
     422                    }
    394423                   
    395424                    for(var i = 0; i < templateList.length; i++)
     
    411440                        }
    412441                       
    413                         var infoContainer = $("<div>", {"class":"gbTemplateContainer ui-state-default ui-corner-all"});
     442                        var infoContainer = $("<option>");
    414443                       
    415444                        _elements.push(infoContainer);
     
    436465                        }
    437466                       
    438                         _templateSelector.prepend(infoContainer);
     467                        _templateSelector.children("select").append(infoContainer);
    439468                       
    440469                        //resizeContainers();
     
    560589    var addMouseEventsToInfoContainer = function(infoContainer, fileName, location, nodename, namespace, name, match)
    561590    {
    562         infoContainer.click(function()
     591        infoContainer.data("changeFunction", function()
    563592        {
    564593            if(_selectedTemplate)
     
    579608            _greenbug.changeCurrentTemplate(location, fileName, nodename, namespace, name, match);
    580609        });
     610        /*
    581611        infoContainer.mouseover(function()
    582612        {
     
    589619            $(this).removeClass("ui-state-active");
    590620        });
     621        */
    591622    }
    592623
     
    670701                    }
    671702
    672                     var infoContainer = $("<div>", {"class":"gbTemplateContainer ui-state-default ui-corner-all"});
     703                    var infoContainer = $("<option>");
    673704
    674705                    _elements.push(infoContainer);
     
    696727                    }
    697728
    698                     _templateSelector.prepend(infoContainer);
     729                    _templateSelector.children("select").append(infoContainer);
    699730
    700731                    //resizeContainers();
     
    714745            {
    715746                clearAll();
     747                _templateSelector.children("select").empty();
     748                _templateSelector.children("select").append("<option>-- Select a template --</option>");
    716749            }
    717750        });
     
    723756    }
    724757   
     758    /*
    725759    var resizeContainers = function()
    726760    {
     
    737771        }
    738772    }
     773    */
    739774   
    740775    this.init = function()
  • main/trunk/greenstone3/web/interfaces/default/style/core.css

    r27110 r27129  
    918918}
    919919
    920 #veNavArea{
    921     width:100%;
    922 }
    923 
    924920#veTemplateSelector{
    925     width:75%;
    926     float:right;
     921    float:left;
     922    padding:0.5em;
     923    margin:0 0.5em 0 0;
    927924}
    928925
     
    930927    float:left;
    931928    padding:0.5em;
     929    margin:0 0.5em 0 0 ;
    932930}
    933931
Note: See TracChangeset for help on using the changeset viewer.