From 1bfcaaf026de7ea67be1b2079487038a97ccb4e6 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 15 Aug 2015 14:16:16 +1000 Subject: [PATCH] Use prettify on plugin details page --- modules/system/assets/css/updates/details.css | 1 + modules/system/assets/js/updates/details.js | 25 +++++++++++++++++++ modules/system/assets/js/updates/install.js | 2 +- .../system/assets/less/updates/details.less | 1 + modules/system/controllers/Updates.php | 1 + 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 modules/system/assets/js/updates/details.js diff --git a/modules/system/assets/css/updates/details.css b/modules/system/assets/css/updates/details.css index 4df6b3f9f..3acfcc4fe 100644 --- a/modules/system/assets/css/updates/details.css +++ b/modules/system/assets/css/updates/details.css @@ -27,6 +27,7 @@ } .plugin-details-content pre { display: block; + border: none; padding: 10px 10px 10px 20px; font-size: 13px; word-break: break-all; diff --git a/modules/system/assets/js/updates/details.js b/modules/system/assets/js/updates/details.js new file mode 100644 index 000000000..66dd86cbe --- /dev/null +++ b/modules/system/assets/js/updates/details.js @@ -0,0 +1,25 @@ +/* + * Details page + */ + ++function ($) { "use strict"; + + var UpdateDetails = function () { + this.init() + } + + UpdateDetails.prototype.init = function() { + + $(document).ready(function() { + $('.plugin-details-content pre').addClass('prettyprint') + prettyPrint() + }) + + } + + if ($.oc === undefined) + $.oc = {} + + $.oc.updateDetails = new UpdateDetails; + +}(window.jQuery); diff --git a/modules/system/assets/js/updates/install.js b/modules/system/assets/js/updates/install.js index 52af5e52f..a68ef29ca 100644 --- a/modules/system/assets/js/updates/install.js +++ b/modules/system/assets/js/updates/install.js @@ -19,7 +19,7 @@ this.dataSet = {} - $(document).ready(function(){ + $(document).ready(function() { self.bindSearch('#pluginSearchInput') self.bindSearch('#themeSearchInput') diff --git a/modules/system/assets/less/updates/details.less b/modules/system/assets/less/updates/details.less index e3a6d3ece..73e49c475 100644 --- a/modules/system/assets/less/updates/details.less +++ b/modules/system/assets/less/updates/details.less @@ -23,6 +23,7 @@ pre { display: block; + border: none; padding: 10px 10px 10px (@padding-standard + @padding-container); font-size: 13px; word-break: break-all; diff --git a/modules/system/controllers/Updates.php b/modules/system/controllers/Updates.php index 1662747a4..b8133dbe7 100644 --- a/modules/system/controllers/Updates.php +++ b/modules/system/controllers/Updates.php @@ -104,6 +104,7 @@ class Updates extends Controller { try { $this->pageTitle = 'system::lang.updates.details_title'; + $this->addJs('/modules/system/assets/js/updates/details.js', 'core'); $this->addCss('/modules/system/assets/css/updates/details.css', 'core'); $readmeFiles = ['README.md', 'readme.md'];