};
}
}
+ if (hasSelection && !multiple) {
+ res.items = $.extend(res.items, {
+ 'sep_extends': '---------',
+ 'cover_1': {
+ isHtmlName: true,
+ name: TRANSLATIONS.cover_page_1,
+ callback: function () {
+ $this.coverPage(1);
+ },
+ }
+ });
+ if (!$this.linkeditor.single) {
+ res.items = $.extend(res.items, {
+ 'cover_double_1': {
+ isHtmlName: true,
+ name: TRANSLATIONS.cover_doublepage_1,
+ callback: function () {
+ $this.coverPage(1, true);
+ },
+ }
+ });
+ }
+ }
if (hasSelection) {
res.items = $.extend(res.items, {
'sep0': '---------',
max = Math.max(max, parseFloat($(this).attr('fb-' + b)) + parseFloat($(this).attr('fb-' + l)));
});
return {min: min, max: max, side: b, length: l};
+ },
+
+ coverPage(margin, double) {
+ if (double === undefined) {
+ double = true;
+ }
+ if (margin === undefined) {
+ margin = 0;
+ }
+ var link = this.getCurrentSelection().eq(0);
+ var rect = {
+ x: -margin,
+ y: -margin,
+ width: this.linkeditor.fw + margin * 2,
+ height: this.linkeditor.ph + margin * 2,
+ };
+ if (!this.linkeditor.single && !double) {
+ if (parseFloat($(link).attr('fb-left')) > this.linkeditor.pw) {
+ rect.x = this.linkeditor.pw - margin;
+ }
+ rect.width = this.linkeditor.pw + margin * 2;
+ }
+ link.attr('fb-left', rect.x).attr('fb-top', rect.y).attr('fb-width', rect.width).attr('fb-height', rect.height);
+ this.linkeditor.hasChanged();
}
};
'cut'=>__('Couper'),
'paste_here'=>__('Coller ici'),
'paste_in_place'=>__('Coller en place'),
+ 'cover_page_1'=>__('Recouvrir la page avec une marge de :margin',['margin'=>'1px']),
+ 'cover_doublepage_1'=>__('Recouvrir la double-page avec une marge de :margin',['margin'=>'1px']),
];
$rulers=!count($rulers)?'{}':json_encode($rulers);