- Timestamp:
- 2013-03-26T16:53:38+13:00 (11 years ago)
- 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 323 323 } 324 324 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 325 345 var createDebugDiv = function() 326 346 { … … 346 366 toolBarDiv.append(buttonDiv); 347 367 createButtonDiv(buttonDiv); 368 createFileAndTemplateSelectors(buttonDiv); 348 369 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;"});356 370 357 371 //Populate the file selector … … 381 395 { 382 396 var selectedItem = selectBox.find(":selected"); 397 398 if(!selectedItem.data("fileItem")) 399 { 400 return; 401 } 383 402 384 403 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; … … 392 411 393 412 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 } 394 423 395 424 for(var i = 0; i < templateList.length; i++) … … 411 440 } 412 441 413 var infoContainer = $("< div>", {"class":"gbTemplateContainer ui-state-default ui-corner-all"});442 var infoContainer = $("<option>"); 414 443 415 444 _elements.push(infoContainer); … … 436 465 } 437 466 438 _templateSelector. prepend(infoContainer);467 _templateSelector.children("select").append(infoContainer); 439 468 440 469 //resizeContainers(); … … 560 589 var addMouseEventsToInfoContainer = function(infoContainer, fileName, location, nodename, namespace, name, match) 561 590 { 562 infoContainer. click(function()591 infoContainer.data("changeFunction", function() 563 592 { 564 593 if(_selectedTemplate) … … 579 608 _greenbug.changeCurrentTemplate(location, fileName, nodename, namespace, name, match); 580 609 }); 610 /* 581 611 infoContainer.mouseover(function() 582 612 { … … 589 619 $(this).removeClass("ui-state-active"); 590 620 }); 621 */ 591 622 } 592 623 … … 670 701 } 671 702 672 var infoContainer = $("< div>", {"class":"gbTemplateContainer ui-state-default ui-corner-all"});703 var infoContainer = $("<option>"); 673 704 674 705 _elements.push(infoContainer); … … 696 727 } 697 728 698 _templateSelector. prepend(infoContainer);729 _templateSelector.children("select").append(infoContainer); 699 730 700 731 //resizeContainers(); … … 714 745 { 715 746 clearAll(); 747 _templateSelector.children("select").empty(); 748 _templateSelector.children("select").append("<option>-- Select a template --</option>"); 716 749 } 717 750 }); … … 723 756 } 724 757 758 /* 725 759 var resizeContainers = function() 726 760 { … … 737 771 } 738 772 } 773 */ 739 774 740 775 this.init = function() -
main/trunk/greenstone3/web/interfaces/default/style/core.css
r27110 r27129 918 918 } 919 919 920 #veNavArea{921 width:100%;922 }923 924 920 #veTemplateSelector{ 925 width:75%; 926 float:right; 921 float:left; 922 padding:0.5em; 923 margin:0 0.5em 0 0; 927 924 } 928 925 … … 930 927 float:left; 931 928 padding:0.5em; 929 margin:0 0.5em 0 0 ; 932 930 } 933 931
Note:
See TracChangeset
for help on using the changeset viewer.