mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
NEW Side by side editing functionality - first cut (os#7412)
Introduces a preview window that appears when the screen is wide enough, removes old preview button, adds a draft-public switch, adds variety of preview options which are not hooked up yet. Relies on sapphire's f95fadc84416835302fe6c8448054960b5e7ec65
This commit is contained in:
parent
1bf67fd942
commit
639f6e4d95
@ -122,9 +122,9 @@ class SilverStripeNavigatorItem extends ViewableData {
|
||||
|
||||
/**
|
||||
* @return String
|
||||
* Text displayed in watermark
|
||||
* Get the Title of an item
|
||||
*/
|
||||
public function getWatermark() {}
|
||||
public function getTitle() {}
|
||||
|
||||
/**
|
||||
* Optional link to a specific view of this record.
|
||||
@ -191,6 +191,10 @@ class SilverStripeNavigatorItem_CMSLink extends SilverStripeNavigatorItem {
|
||||
);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return _t('ContentController.CMS', 'CMS');
|
||||
}
|
||||
|
||||
public function getLink() {
|
||||
return $this->record->CMSEditLink();
|
||||
}
|
||||
@ -221,7 +225,7 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
|
||||
}
|
||||
}
|
||||
|
||||
public function getWatermark() {
|
||||
public function getTitle() {
|
||||
return _t('ContentController.DRAFTSITE');
|
||||
}
|
||||
|
||||
@ -269,7 +273,7 @@ class SilverStripeNavigatorItem_LiveLink extends SilverStripeNavigatorItem {
|
||||
}
|
||||
}
|
||||
|
||||
public function getWatermark() {
|
||||
public function getTitle() {
|
||||
return _t('ContentController.PUBLISHEDSITE');
|
||||
}
|
||||
|
||||
@ -311,6 +315,10 @@ class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem {
|
||||
return "<a class=\"ss-ui-button\" href=\"$this->recordLink?archiveDate={$this->record->LastEdited}\" target=\"_blank\">". _t('ContentController.ARCHIVEDSITE', 'Preview version') ."</a>";
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return _t('ContentController.VERSION', 'Version').': '.$this->record->LastEdited;
|
||||
}
|
||||
|
||||
public function getMessage() {
|
||||
if($date = Versioned::current_archived_date()) {
|
||||
$dateObj = Datetime::create();
|
||||
|
@ -4,32 +4,26 @@ function windowName(suffix) {
|
||||
}
|
||||
|
||||
(function($) {
|
||||
$('#switchView a.newWindow').live('click',
|
||||
function() {
|
||||
$(document).ready(function() {
|
||||
$('#switchView a.newWindow').on('click', function(e) {
|
||||
var w = window.open(this.href, windowName(this.target));
|
||||
w.focus();
|
||||
return false;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$('#SilverStripeNavigatorLink').live('click',
|
||||
function() {
|
||||
$('#SilverStripeNavigatorLink').on('click', function(e) {
|
||||
$('#SilverStripeNavigatorLinkPopup').toggle();
|
||||
return false;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$('#SilverStripeNavigatorLinkPopup a.close').live('click',
|
||||
function() {
|
||||
$('#SilverStripeNavigatorLinkPopup a.close').on('click', function(e) {
|
||||
$('#SilverStripeNavigatorLinkPopup').hide();
|
||||
return false;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$('#SilverStripeNavigatorLinkPopup input').live('focus',
|
||||
function() {
|
||||
$('#SilverStripeNavigatorLinkPopup input').on('focus',function(e) {
|
||||
this.select();
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
@ -22,11 +22,7 @@
|
||||
<% loop Actions %>
|
||||
$Field
|
||||
<% end_loop %>
|
||||
<% if Controller.LinkPreview %>
|
||||
<a href="$Controller.LinkPreview" class="cms-preview-toggle-link ss-ui-button" data-icon="preview">
|
||||
<% _t('LeftAndMain.PreviewButton', 'Preview') %> »
|
||||
</a>
|
||||
<% end_if %>
|
||||
|
||||
</div>
|
||||
<% end_if %>
|
||||
</div>
|
||||
|
@ -19,11 +19,6 @@
|
||||
<% loop Actions %>
|
||||
$Field
|
||||
<% end_loop %>
|
||||
<% if Controller.LinkPreview %>
|
||||
<a href="$Controller.LinkPreview" class="cms-preview-toggle-link ss-ui-button" data-icon="preview">
|
||||
<% _t('LeftAndMain.PreviewButton', 'Preview') %> »
|
||||
</a>
|
||||
<% end_if %>
|
||||
</div>
|
||||
<% end_if %>
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user