link.setAttribute('href', url);
} else {
link.setAttribute('href', 'javascript:;'); // for linky-ness
- link.onclick = function() { openils.XUL.newTabEasy(url, null, null, true) };
+ if (window.IAMBROWSER) {
+ link.onclick = function() { xulG.relay_url(url) };
+ } else {
+ link.onclick = function() { openils.XUL.newTabEasy(url, null, null, true) };
+ }
}
}
resolve : resolver
});
+ $routeProvider.when('/acq/legacy/:noun/:verb/:record', {
+ template: eframe_template,
+ controller: 'EmbedAcqCtl',
+ resolve : resolver
+ });
+
// default page
$routeProvider.otherwise({
templateUrl : './t_splash',
}])
.controller('EmbedAcqCtl',
- ['$scope','$routeParams','$location','egCore',
-function($scope , $routeParams , $location , egCore) {
+ ['$scope','$routeParams','$location','$window','$timeout','egCore',
+function($scope , $routeParams , $location , $window , $timeout , egCore) {
+
+ var relay_url = function(url) {
+ if (url.match(/\/eg\/acq/)) {
+ var munged_url = egCore.env.basePath +
+ url.replace(/^.*?\/eg\/acq\//, "acq/legacy/");
+ $timeout(function() { $window.open(munged_url, '_blank') });
+ } else if (url.match(/\/eg\/vandelay/)) {
+ var munged_url = egCore.env.basePath +
+ url.replace(/^.*?\/eg\/vandelay\/vandelay/, "cat/catalog/vandelay");
+ $timeout(function() { $window.open(munged_url, '_blank') });
+ }
+ }
$scope.funcs = {
ses : egCore.auth.token(),
+ relay_url : relay_url
}
var acq_path = '/eg/acq/' +
- $routeParams.noun + '/' + $routeParams.verb + location.search;
+ $routeParams.noun + '/' + $routeParams.verb +
+ ((typeof $routeParams.record != 'undefined') ? '/' + $routeParams.record : '')
+ location.search;
$scope.min_height = 2000; // give lots of space to start