From ae29c38f19ef0875447057084f5874ab8679aaa2 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Mon, 7 Sep 2015 13:06:07 -0700 Subject: [PATCH 1/6] Maintain cursor position while cleaning up the folder name value (fixes #144) --- themes/grav/js/pages-all.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/themes/grav/js/pages-all.js b/themes/grav/js/pages-all.js index 69172579..acf0e7b4 100644 --- a/themes/grav/js/pages-all.js +++ b/themes/grav/js/pages-all.js @@ -163,8 +163,14 @@ $(function(){ $('input[name="folder"]').on('input', function(e){ + var start = this.selectionStart, + end = this.selectionEnd; + value = $(this).val().toLowerCase().replace(/\s/g, '-').replace(/[^a-z0-9_\-]/g, ''); $(this).val(value); + + // restore cursor position + this.setSelectionRange(start, end); }); childrenToggles.on('click', function () { From 55bad8dd0ba4e13fa3b008d77831120f9024306d Mon Sep 17 00:00:00 2001 From: Benny Date: Mon, 7 Sep 2015 22:07:22 +0200 Subject: [PATCH 2/6] Reduce complexity of Install/Uninstall gpm action This PR reduces the complexity of checking the visibility status of the GPM action "Install/Uninstall". This action field is only hidden on those plugins with a `enabled.type: hidden` field and shown otherwise. This PR especially accounts for plugins which have an `enabled: true` property, but their `enabled` option in the blueprint is located elsewhere (e.g. wrapped in a section field). --- themes/grav/templates/partials/plugins-list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/grav/templates/partials/plugins-list.html.twig b/themes/grav/templates/partials/plugins-list.html.twig index 7a52dab0..42476fed 100644 --- a/themes/grav/templates/partials/plugins-list.html.twig +++ b/themes/grav/templates/partials/plugins-list.html.twig @@ -23,7 +23,7 @@ v{{ plugin.version }} - {% if (not installing and plugin.form.fields.enabled and (plugin.form.fields.enabled.type != 'hidden')) %} + {% if (not installing and (plugin.form.fields.enabled.type != 'hidden')) %} From 68774774c25835c21d55db04acdc3c6747b6ed92 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Mon, 7 Sep 2015 13:07:33 -0700 Subject: [PATCH 3/6] Added input fields to the exclusion list of draggable elements in Collections (fixes #142) --- themes/grav/js/admin-all.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/themes/grav/js/admin-all.js b/themes/grav/js/admin-all.js index cc389de0..856c9542 100644 --- a/themes/grav/js/admin-all.js +++ b/themes/grav/js/admin-all.js @@ -436,10 +436,13 @@ $(function () { template = el.find('[data-collection-template="new"]').html(); // make sortable - new Sortable(holder[0], { onUpdate: function () { - if (isArray) - reIndex(el); - } }); + new Sortable(holder[0], { + filter: '.form-input-wrapper', + onUpdate: function () { + if (isArray) + reIndex(el); + } + }); // hook up delete el.on('click', '[data-action="delete"]', function (e) { From 8381795f31ce90e619b13fa750c272a6303a2865 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Mon, 7 Sep 2015 13:44:12 -0700 Subject: [PATCH 4/6] Fixed Chartist issue with Firefox (fixes #138) --- themes/grav/js/admin-all.js | 5 ++++- themes/grav/templates/dashboard.html.twig | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/themes/grav/js/admin-all.js b/themes/grav/js/admin-all.js index 856c9542..96ee77c8 100644 --- a/themes/grav/js/admin-all.js +++ b/themes/grav/js/admin-all.js @@ -18,6 +18,8 @@ var bytesToSize = function(bytes) { return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i]; }; +var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; + $(function () { jQuery.substitute = function(str, sub) { return str.replace(/\{(.+?)\}/g, function($0, $1) { @@ -71,7 +73,8 @@ $(function () { startAngle: 0, total: 100, showLabel: false, - height: 150 + height: 150, + chartPadding: !isFirefox ? 5 : 10 }; UpdatesChart = Chartist.Pie('.updates-chart .ct-chart', data, options); diff --git a/themes/grav/templates/dashboard.html.twig b/themes/grav/templates/dashboard.html.twig index 544c6d0d..013cb5e4 100644 --- a/themes/grav/templates/dashboard.html.twig +++ b/themes/grav/templates/dashboard.html.twig @@ -52,7 +52,8 @@ startAngle: 0, total: 100, showLabel: false, - height: 150 + height: 150, + chartPadding: !isFirefox ? 5 : 10 }; Chartist.Pie('.backups-chart .ct-chart', data, options); @@ -80,7 +81,7 @@ }; var options = { height: 164, - chartPadding:5, + chartPadding: !isFirefox ? 5 : 25, axisX: { showGrid: false, From 6c61372311a0219001ff5a9c54d9684549f42d6e Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 7 Sep 2015 15:39:11 -0600 Subject: [PATCH 5/6] Add lang strings for ignore files/folder from system.yaml --- languages.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/languages.yaml b/languages.yaml index e3ae1eef..185ce479 100644 --- a/languages.yaml +++ b/languages.yaml @@ -424,6 +424,10 @@ en: DEFAULT_DATE_FORMAT: Page date format DEFAULT_DATE_FORMAT_HELP: Page date format used by Grav. By default, Grav attempts to guess your date format, however you can specifiy a format using PHP's date syntax (e.g.: Y-m-d H:i) DEFAULT_DATE_FORMAT_PLACEHOLDER: Guess automatically if blank + IGNORE_FILES: Ignore files + IGNORE_FILES_HELP: Files to ignore when processing pages + IGNORE_FOLDERS: Ignore folders + IGNORE_FOLDERS_HELP: Folders to ignore when processing pages es: PLUGIN_ADMIN: ADMIN_BETA_MSG: ¡Está es una versión Beta! Utilízala bajo tu propio riesgo... From 330d20098172b2b5735a600303d2d2a6200a49a2 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 7 Sep 2015 16:59:51 -0600 Subject: [PATCH 6/6] some more new lang strings --- languages.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/languages.yaml b/languages.yaml index 185ce479..85242340 100644 --- a/languages.yaml +++ b/languages.yaml @@ -311,7 +311,7 @@ en: HOME_REDIRECT_INCLUDE_LANGUAGE: Home redirect include language HOME_REDIRECT_INCLUDE_LANGUAGE_HELP : "Include language in home redirect (/en)" HOME_REDIRECT_INCLUDE_ROUTE: Home redirect include route - HOME_REDIRECT_INCLUDE_ROUTE: "Include route in home redirect (/blog)" + HOME_REDIRECT_INCLUDE_ROUTE_HELP: "Include route in home redirect (/blog)" HTTP_HEADERS: HTTP Headers EXPIRES: Expires EXPIRES_HELP: "Sets the expires header. The value is in seconds." @@ -428,6 +428,10 @@ en: IGNORE_FILES_HELP: Files to ignore when processing pages IGNORE_FOLDERS: Ignore folders IGNORE_FOLDERS_HELP: Folders to ignore when processing pages + HTTP_ACCEPT_LANGUAGE: Set language from browser + HTTP_ACCEPT_LANGUAGE_HELP: You can opt to try to set the language based on `http_accept_language` header tag in the browser + OVERRIDE_LOCALE: Override locale + OVERRIDE_LOCALE_HELP: Override the locale setting in PHP based on the current language es: PLUGIN_ADMIN: ADMIN_BETA_MSG: ¡Está es una versión Beta! Utilízala bajo tu propio riesgo...