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
|
* @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.
|
* Optional link to a specific view of this record.
|
||||||
@ -190,6 +190,10 @@ class SilverStripeNavigatorItem_CMSLink extends SilverStripeNavigatorItem {
|
|||||||
_t('ContentController.CMS', 'CMS')
|
_t('ContentController.CMS', 'CMS')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getTitle() {
|
||||||
|
return _t('ContentController.CMS', 'CMS');
|
||||||
|
}
|
||||||
|
|
||||||
public function getLink() {
|
public function getLink() {
|
||||||
return $this->record->CMSEditLink();
|
return $this->record->CMSEditLink();
|
||||||
@ -221,7 +225,7 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWatermark() {
|
public function getTitle() {
|
||||||
return _t('ContentController.DRAFTSITE');
|
return _t('ContentController.DRAFTSITE');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +273,7 @@ class SilverStripeNavigatorItem_LiveLink extends SilverStripeNavigatorItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWatermark() {
|
public function getTitle() {
|
||||||
return _t('ContentController.PUBLISHEDSITE');
|
return _t('ContentController.PUBLISHEDSITE');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,6 +314,10 @@ class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem {
|
|||||||
$this->recordLink = $this->record->AbsoluteLink();
|
$this->recordLink = $this->record->AbsoluteLink();
|
||||||
return "<a class=\"ss-ui-button\" href=\"$this->recordLink?archiveDate={$this->record->LastEdited}\" target=\"_blank\">". _t('ContentController.ARCHIVEDSITE', 'Preview version') ."</a>";
|
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() {
|
public function getMessage() {
|
||||||
if($date = Versioned::current_archived_date()) {
|
if($date = Versioned::current_archived_date()) {
|
||||||
|
@ -4,32 +4,26 @@ function windowName(suffix) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
(function($) {
|
(function($) {
|
||||||
$('#switchView a.newWindow').live('click',
|
$(document).ready(function() {
|
||||||
function() {
|
$('#switchView a.newWindow').on('click', function(e) {
|
||||||
var w = window.open(this.href, windowName(this.target));
|
var w = window.open(this.href, windowName(this.target));
|
||||||
w.focus();
|
w.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
$('#SilverStripeNavigatorLink').live('click',
|
$('#SilverStripeNavigatorLink').on('click', function(e) {
|
||||||
function() {
|
|
||||||
$('#SilverStripeNavigatorLinkPopup').toggle();
|
$('#SilverStripeNavigatorLinkPopup').toggle();
|
||||||
return false;
|
return false;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
$('#SilverStripeNavigatorLinkPopup a.close').on('click', function(e) {
|
||||||
$('#SilverStripeNavigatorLinkPopup a.close').live('click',
|
|
||||||
function() {
|
|
||||||
$('#SilverStripeNavigatorLinkPopup').hide();
|
$('#SilverStripeNavigatorLinkPopup').hide();
|
||||||
return false;
|
return false;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
$('#SilverStripeNavigatorLinkPopup input').on('focus',function(e) {
|
||||||
$('#SilverStripeNavigatorLinkPopup input').live('focus',
|
|
||||||
function() {
|
|
||||||
this.select();
|
this.select();
|
||||||
}
|
});
|
||||||
);
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
@ -22,11 +22,7 @@
|
|||||||
<% loop Actions %>
|
<% loop Actions %>
|
||||||
$Field
|
$Field
|
||||||
<% end_loop %>
|
<% 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>
|
</div>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,11 +19,6 @@
|
|||||||
<% loop Actions %>
|
<% loop Actions %>
|
||||||
$Field
|
$Field
|
||||||
<% end_loop %>
|
<% 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>
|
</div>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user