Changeset 31014
- Timestamp:
- 2016-11-01T07:42:03+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/js/hierarchy.js
r30464 r31014 12 12 { 13 13 14 var id = a. parentElement.id;15 //console.log("Try to set ID" + id)14 var id = a.getAttribute("title"); 15 16 16 // If ID defined and not null 17 17 if (id && (id != null)) … … 72 72 { 73 73 if(childExpr.test(key)){ 74 levelItems[key]='<li id="'+key+'" ><button onclick="setHierarchyId(this)" title='+ hierarchyData[key] +'>' + hierarchyData[key] + '</button></li>';74 levelItems[key]='<li id="'+key+'" ><button onclick="setHierarchyId(this)" title='+ hierarchyData[key][0] +'>' + hierarchyData[key][1] + '</button></li>'; 75 75 //console.log(levelItems[key]); 76 76 … … 137 137 var StringData = []; 138 138 var hierarchyData = {}; 139 var expr = /^([0-9]+(?:\.[0-9]+)*)\ ([0-9]+(?:\.[0-9]+)*)\ (.*)/m; 139 //var expr = /^([0-9]+(?:\.[0-9]+)*)\ ([0-9]+(?:\.[0-9]+)*)\ (.*)/m; 140 var expr = /^(\S*|\"[^\"]*\")\ +([0-9]+(?:\.[0-9]+)*)\ +(.*)/m; 140 141 StringData = hierarchyFile.split('\n'); 141 142 for (var i = 0; i < StringData.length; i++) … … 143 144 var result = StringData[i].match(expr); 144 145 // If result not null 145 if (result != null && result [2] != null && result[3] != null)146 if (result != null && result.length == 4) 146 147 { 147 148 // populate hierarchy object 148 hierarchyData[result[2]] = result[3];149 hierarchyData[result[2]] = [result[1], result[3]]; 149 150 } 150 151 … … 242 243 if (SuggestionsMenuExp.test(key)) 243 244 { 244 SuggestionsMenuItems[key]='<li class="hierarchySuggestionsMenu" id="'+key+'" ><button onclick="setHierarchyId(this)" >' + key.substring(String(input).length) + " " + hierarchyData[key] + '</button></li>';245 SuggestionsMenuItems[key]='<li class="hierarchySuggestionsMenu" id="'+key+'" ><button title='+ hierarchyData[key][0] +' onclick="setHierarchyId(this)" >' + key.substring(String(input).length) + " " + hierarchyData[key][1] + '</button></li>'; 245 246 } 246 247
Note:
See TracChangeset
for help on using the changeset viewer.