1app.factory('GeneralService', function($http, $q) { 2 3 var factory = { 4 getBaseURL : getBaseURL, 5 getFiltriMode : getFiltriMode, 6 setFiltriMode : setFiltriMode 7 }; 8 return factory; 9 10 this.filtriMode = {filtri:false, internal:false}; 11 12 function getBaseURL() { 13 var url = location.href; 14 var baseURL = url.substring(0, url.indexOf('/', 14)); 15 16 if (baseURL.indexOf('http://localhost') !== -1) { 17 // Base Url for localhost 18 var url = location.href; 19 var pathname = location.pathname; 20 var index1 = url.indexOf(pathname); 21 var index2 = url.indexOf("/", index1 + 1); 22 var baseLocalUrl = url.substr(0, index2); 23 return baseLocalUrl + "/legacyapi/rs/it/jacms"; 24 } else { 25 // Root Url for domain name 26 var pathname = location.pathname; 27 pathname = pathname.split('/')[1]; 28 return baseURL + "/" + pathname + "/legacyapi/rs/it/jacms"; 29 } 30 }; 31 32 function getFiltriMode() { 33 return this.filtriMode; 34 } 35 36 function setFiltriMode(show, interno, pagina) { 37 var categoria = []; 38 var type = ""; 39 if(pagina !== undefined){ 40 categoria = pagina.split(","); 41 if (categoria[1].includes("Amministrazione")) 42 type = "Amministrazione"; 43 if (categoria[1].includes("Novit")) 44 type = "Novità " 45 if (categoria[1].includes("Servizi")) 46 type = "Servizi" 47 if (categoria[1].includes("Documenti")) 48 type = "Documenti" 49 } 50 this.filtriMode = {filtri:show, internal:interno, categoria: type}; 51 } 52 53});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.