Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 488337
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/scriptResolver.js (-26 / +24 lines)
Lines 213-244 Link Here
213
       		if(typeof(path2) === 'undefined') {
213
       		if(typeof(path2) === 'undefined') {
214
       			return typeof(file) === 'undefined';
214
       			return typeof(file) === 'undefined';
215
       		}
215
       		}
216
       		if(file.contentType && meta.contentType && file.contentType.name === meta.contentType.name) {
216
   			//get rid of extensions and compare the names
217
       			//get rid of extensions and compare the names
217
   			var loc = file.location ? file.location : file.Location;
218
       			var loc = file.location ? file.location : file.Location;
218
   			if(!loc) {
219
       			if(!loc) {
219
   				return false;
220
       				return false;
220
   			}
221
       			}
221
   			var idx = loc.lastIndexOf('.');
222
       			var idx = loc.lastIndexOf('.');
222
   			var p1 = loc;
223
       			var p1 = loc;
223
   			if(idx > -1) {
224
       			if(idx > -1) {
224
      			p1 = loc.slice(0, idx);
225
	      			p1 = loc.slice(0, idx);
225
      		}
226
	      		}
226
      		if(path2 === p1) {
227
	      		if(path2 === p1) {
227
      			return true; //could be that only the extension was missing from the other path
228
	      			return true; //could be that only the extension was missing from the other path
228
      		}
229
	      		}
229
      		idx = path2.lastIndexOf('.');
230
	      		idx = path2.lastIndexOf('.');
230
   			var p2 = path2;
231
       			var p2 = path2;
231
   			if(idx > -1) {
232
       			if(idx > -1) {
232
      			p2 = path2.slice(0, idx);
233
	      			p2 = path2.slice(0, idx);
233
      		}
234
	      		}
234
      		if(p1 === p2) {
235
	      		if(p1 === p2) {
235
      			return true;
236
	      			return true;
236
      		} else if(p1 === decodeURIComponent(p2)) {
237
	      		} else if(p1 === decodeURIComponent(p2)) {
237
      			return true;
238
	      			return true;
238
      		}
239
	      		}
239
      		return false;
240
	      		return false;
241
       		}
242
       },
240
       },
243
241
244
       /**
242
       /**

Return to bug 488337