}
})
-.directive("egPhyscharWizard", function () {
+.directive("egPhyscharWizard", ['$sce', function ($sce) {
return {
restrict: 'E',
replace: true,
// step==0 means we are currently selecting the type
$scope.step = 0;
+ // position and offset of the "subfields" we're
+ // currently editing; this is maintained as a convenience
+ // for the highlighting of the currently active position
+ $scope.offset = 0;
+ $scope.len = 1;
+
if (!$scope.field.data)
$scope.field.data = '';
var promise;
if ($scope.step == 0) {
+ $scope.offset = 0;
+ $scope.len = 1;
promise = egTagTable.getPhysCharTypeMap();
} else {
promise = current_subfield().then(
var after = value.substr(slot[0] + slot[1]);
$scope.field.data =
before + new_val.substr(0, slot[1]) + after;
+ $scope.offset = slot[0];
+ $scope.len = slot[1];
});
}
return (opt.ptype_key() == current_ptype())})[0];
} else {
get_step_slot().then(function(slot) {
+ $scope.offset = slot[0];
+ $scope.len = slot[1];
var val = String.prototype.substr.apply(
$scope.field.data, slot);
if (val) {
})
}
}
+
+ $scope.highlightedFieldData = function() {
+ if (
+ $scope.len && $scope.field.data &&
+ $scope.field.data.length > 0 &&
+ $scope.field.data.length >= $scope.offset
+ ) {
+ return $sce.trustAsHtml(
+ $scope.field.data.substring(0, $scope.offset) +
+ '<span class="active-physchar">' +
+ $scope.field.data.substr($scope.offset, $scope.len) +
+ '</span>' +
+ $scope.field.data.substr($scope.offset + $scope.len)
+ );
+ } else {
+ return $scope.field.data;
+ }
+ };
+
set_values_for_step();
}
]
}
-})
+}])
.directive("egMarcEditAuthorityBrowser", function () {