- Timestamp:
- 2013-04-10T12:45:37+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js
r27153 r27163 549 549 _vEditor.selectRootElement(); 550 550 551 _vEditor.setFileLocation(location); 552 _vEditor.setFileName(fileName); 553 551 554 if(!_isVisualEditor) 552 555 { … … 604 607 _greenbug.changeCurrentTemplate(location, fileName, nodename, namespace, name, match); 605 608 }); 609 } 610 611 //Turns a filename into it's location (i.e. interface/site/collection) and name 612 this.fileNameToLocationAndName = function(filepath) 613 { 614 var location; 615 var fileName; 616 //Use the filepath to work out where this file is from 617 if(filepath.search(/[\/\\]interfaces[\/\\]/) != -1) 618 { 619 location = "interface"; 620 fileName = filepath.replace(/.*[\/\\]transform[\/\\]/, ""); 621 } 622 else if(filepath.search(/[\/\\]sites[\/\\].*[\/\\]collect[\/\\].*[\/\\]etc[\/\\]/) != -1) 623 { 624 location = "collectionConfig"; 625 fileName = filepath.replace(/.*[\/\\]sites[\/\\].*[\/\\]collect[\/\\].*[\/\\]etc[\/\\]/, ""); 626 } 627 else if(filepath.search(/[\/\\]sites[\/\\].*[\/\\]collect[\/\\].*[\/\\]transform[\/\\]/) != -1) 628 { 629 location = "collection"; 630 fileName = filepath.replace(/.*[\/\\]sites[\/\\].*[\/\\]collect[\/\\].*[\/\\]transform[\/\\]/, ""); 631 } 632 else if(filepath.search(/[\/\\]sites[\/\\].*[\/\\]transform[\/\\]/) != -1) 633 { 634 location = "site"; 635 fileName = filepath.replace(/.*[\/\\]sites[\/\\].*[\/\\]transform[\/\\]/, ""); 636 } 637 638 return {location:location, filename:fileName}; 606 639 } 607 640 … … 668 701 var match = $(this).attr("match"); 669 702 670 var location; 671 var fileName; 672 //Use the filepath to work out where this file is from 673 if(filepath.search(/[\/\\]interfaces[\/\\]/) != -1) 674 { 675 location = "interface"; 676 fileName = filepath.replace(/.*[\/\\]transform[\/\\]/, ""); 677 } 678 else if(filepath.search(/[\/\\]sites[\/\\].*[\/\\]collect[\/\\].*[\/\\]etc[\/\\]/) != -1) 679 { 680 location = "collectionConfig"; 681 fileName = filepath.replace(/.*[\/\\]sites[\/\\].*[\/\\]collect[\/\\].*[\/\\]etc[\/\\]/, ""); 682 } 683 else if(filepath.search(/[\/\\]sites[\/\\].*[\/\\]collect[\/\\].*[\/\\]transform[\/\\]/) != -1) 684 { 685 location = "collection"; 686 fileName = filepath.replace(/.*[\/\\]sites[\/\\].*[\/\\]collect[\/\\].*[\/\\]transform[\/\\]/, ""); 687 } 688 else if(filepath.search(/[\/\\]sites[\/\\].*[\/\\]transform[\/\\]/) != -1) 689 { 690 location = "site"; 691 fileName = filepath.replace(/.*[\/\\]sites[\/\\].*[\/\\]transform[\/\\]/, ""); 692 } 703 var file = _greenbug.fileNameToLocationAndName(filepath); 693 704 694 705 var infoContainer = $("<option>"); … … 696 707 _elements.push(infoContainer); 697 708 698 addChangeEventToInfoContainer(infoContainer, file Name,location, nodename, namespace, name, match);709 addChangeEventToInfoContainer(infoContainer, file.filename, file.location, nodename, namespace, name, match); 699 710 700 711 if(name && name.length > 0)
Note:
See TracChangeset
for help on using the changeset viewer.