diff --git a/modules b/modules deleted file mode 160000 index 6c27b009..00000000 --- a/modules +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6c27b00983932299702cbcf8e6188062a75c9403 diff --git a/modules/admin_ui_toggle/admin_ui_toggle.info.yml b/modules/admin_ui_toggle/admin_ui_toggle.info.yml new file mode 100644 index 00000000..4bafb7b7 --- /dev/null +++ b/modules/admin_ui_toggle/admin_ui_toggle.info.yml @@ -0,0 +1,7 @@ +name: Admin UI Toggle +type: module +description: 'Provides the Admin UI Toggle block' +package: Sector +core: 8.x +dependencies: + - block \ No newline at end of file diff --git a/modules/admin_ui_toggle/admin_ui_toggle.libraries.yml b/modules/admin_ui_toggle/admin_ui_toggle.libraries.yml new file mode 100644 index 00000000..de629c36 --- /dev/null +++ b/modules/admin_ui_toggle/admin_ui_toggle.libraries.yml @@ -0,0 +1,11 @@ +admin-ui-toggle: + version: VERSION + css: + component: + css/admin-ui-toggle.css: {} + js: + js/admin_ui_toggle.js: {} + dependencies: + - core/jquery + - core/jquery.once + - core/drupal \ No newline at end of file diff --git a/modules/admin_ui_toggle/admin_ui_toggle.module b/modules/admin_ui_toggle/admin_ui_toggle.module new file mode 100644 index 00000000..a820777e --- /dev/null +++ b/modules/admin_ui_toggle/admin_ui_toggle.module @@ -0,0 +1,11 @@ + [ + ], + ]; +} \ No newline at end of file diff --git a/modules/admin_ui_toggle/css/admin-ui-toggle.css b/modules/admin_ui_toggle/css/admin-ui-toggle.css new file mode 100644 index 00000000..47707ad1 --- /dev/null +++ b/modules/admin_ui_toggle/css/admin-ui-toggle.css @@ -0,0 +1,40 @@ +body.admin-ui-hide {padding-top:0px!important;} +.admin-ui-hide #toolbar-bar {display:none!important;} +.admin-ui-hide .contextual-links-wrapper {display:none!important;} +.admin-ui-hide .tabs--primary {display:none!important;} +.admin-ui-hide .alert {display:none!important;} +html body.admin-ui-hide.toolbar-bar {margin-top: 0!important;} +.admin-ui-toggle p { + margin:0;padding:0; +} +.block-admin-ui-toggle { + display: flex; +} +.admin-ui-toggle button { + position: fixed; + top:0; + right:150px; + border: none; + outline:none; + z-index: 9999; +} +.admin-ui-toggle button:before { + content: 'Hide menu'; + font-size: 12px; + line-height: 1; +} +.admin-ui-toggle.ui-is-hidden button:before { + content: 'Show menu'; +} +.admin-ui-toggle button .fa-toggle-off { + display: none; +} +.admin-ui-toggle button .fa-toggle-on { + display: block; +} +.admin-ui-hide .admin-ui-toggle button .fa-toggle-off { + display: block; +} +.admin-ui-hide .admin-ui-toggle button .fa-toggle-on { + display: none; +} \ No newline at end of file diff --git a/modules/admin_ui_toggle/js/admin_ui_toggle.js b/modules/admin_ui_toggle/js/admin_ui_toggle.js new file mode 100644 index 00000000..da15fd14 --- /dev/null +++ b/modules/admin_ui_toggle/js/admin_ui_toggle.js @@ -0,0 +1,18 @@ +(function ($, Drupal) { + + 'use strict'; + + Drupal.behaviors.admin_ui_toggle = { + attach: function (context, settings) { + $("button",".admin-ui-toggle").on('click', function(evt){ + $("body").toggleClass("admin-ui-hide"); + if ($("body").hasClass('admin-ui-hide')) { + $('.admin-ui-toggle').addClass('ui-is-hidden'); + } else { + $('.admin-ui-toggle').removeClass('ui-is-hidden'); + } + evt.preventDefault(); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file diff --git a/modules/admin_ui_toggle/src/Plugin/Block/AdminUiToggle.php b/modules/admin_ui_toggle/src/Plugin/Block/AdminUiToggle.php new file mode 100644 index 00000000..c256cabf --- /dev/null +++ b/modules/admin_ui_toggle/src/Plugin/Block/AdminUiToggle.php @@ -0,0 +1,32 @@ + 'admin_ui_toggle', + '#attached' => [ + 'library' => [ + 'admin_ui_toggle/admin-ui-toggle' + ], + ], + ); + } +} \ No newline at end of file diff --git a/modules/admin_ui_toggle/templates/admin-ui-toggle.html.twig b/modules/admin_ui_toggle/templates/admin-ui-toggle.html.twig new file mode 100644 index 00000000..83758b3e --- /dev/null +++ b/modules/admin_ui_toggle/templates/admin-ui-toggle.html.twig @@ -0,0 +1,7 @@ +{% block content %} +
+

+ +

+
+{% endblock %} diff --git a/modules/composer.json b/modules/composer.json new file mode 100644 index 00000000..3a3d7bb6 --- /dev/null +++ b/modules/composer.json @@ -0,0 +1,13 @@ +{ + "name": "sparksi/sector_modules", + "description": "Project-specific modules for the Sector D8 project", + "type": "drupal-custom-module", + "license": "GPL-2.0+", + "minimum-stability": "dev", + "authors": [ + { + "name": "Sparks Interactive", + "role": "Development" + } + ] +} \ No newline at end of file diff --git a/modules/plain_text/README.md b/modules/plain_text/README.md new file mode 100644 index 00000000..7dd8f865 --- /dev/null +++ b/modules/plain_text/README.md @@ -0,0 +1,9 @@ +Plain text module + +Probably needs a better name.. + +This module creates a checkbox at at /admin/config/content/formats/manage/{format}. +If this checkbox is ticked then all text pasted in the ckeditor using this text +format will have all formatting stripped. + +This retains the integrity of the Paste from word toolbar button. \ No newline at end of file diff --git a/modules/plain_text/js/plain_text.js b/modules/plain_text/js/plain_text.js new file mode 100644 index 00000000..b444953d --- /dev/null +++ b/modules/plain_text/js/plain_text.js @@ -0,0 +1,52 @@ +/** + * @file + * + * JS file for making sure that intercepts paste events from Ctrl/CMd+V and + * right click and strips the formatting from them using proper Jquery + * functions. + * + * @ignore + */ + +(function ($, Drupal, drupalSettings, _) { + + 'use strict'; + + Drupal.ckeditor = Drupal.ckeditor || {}; + + Drupal.behaviors.plaintext = { + attach: function () { + // Checks if the CKEDITOR currently exists + if (typeof CKEDITOR !== 'undefined') { + CKEDITOR.on('instanceReady', function (i) { + // Gets the editor instance. + var editor = i.editor; + // The paste from word dialog shows up by default on any paste event. + // We don't want that, so this disables it. + editor.config.pasteFromWordPromptCleanup = false; + // Paste event. + editor.on('paste', function (e) { + // Checks if the PlainText config is true, if its false, don't apply + // the processing to the text. + if(editor.config.PlainText === true) { + console.log(e); + console.log(editor); + // Paste events that aren't the pastefromword paste dialog creates + // this $ object inside the editor. We check if it exists. + // + // If it exists it means the paste should be stripped. + if (e.data.dataTransfer.$) { + // Not 100% sure if this is needed. Will test. + e.data.type = 'text'; + + var text = ''; + // Strip the tags using the jQuery.text function. + e.data.dataValue = jQuery(e.data.dataValue).text(); + } + } + }); + }); + } + } + } +})(jQuery, Drupal, drupalSettings, _); \ No newline at end of file diff --git a/modules/plain_text/plain_text.info.yml b/modules/plain_text/plain_text.info.yml new file mode 100644 index 00000000..0107ca26 --- /dev/null +++ b/modules/plain_text/plain_text.info.yml @@ -0,0 +1,5 @@ +name: Plain Text +type: module +description: 'Plain text plugin for ckeditor' +package: Sector +core: 8.x \ No newline at end of file diff --git a/modules/plain_text/plain_text.libraries.yml b/modules/plain_text/plain_text.libraries.yml new file mode 100644 index 00000000..b8f7a128 --- /dev/null +++ b/modules/plain_text/plain_text.libraries.yml @@ -0,0 +1,7 @@ +plain-text: + version: VERSION + js: + js/plain_text.js: {} + dependencies: + - core/jquery + - core/drupal \ No newline at end of file diff --git a/modules/plain_text/plain_text.module b/modules/plain_text/plain_text.module new file mode 100644 index 00000000..371e80a8 --- /dev/null +++ b/modules/plain_text/plain_text.module @@ -0,0 +1,26 @@ +filters()->getAll(); + $format_filter_config = $format_filter['plain_text_filter']->getConfiguration(); + if($format_filter_config['status']) { + $settings['editor']['formats'][$text_format_id]['editorSettings']['PlainText'] = TRUE; + } + } +} \ No newline at end of file diff --git a/modules/plain_text/src/Plugin/Filter/PlainTextFilter.php b/modules/plain_text/src/Plugin/Filter/PlainTextFilter.php new file mode 100644 index 00000000..9547660a --- /dev/null +++ b/modules/plain_text/src/Plugin/Filter/PlainTextFilter.php @@ -0,0 +1,24 @@ + [ + ], + 'search_desktop_fly_out_control_block' => [ + ], + 'search_api_box' => [ + ], + 'search_api_box_mobile' => [ + ], + ]; +} diff --git a/modules/sector_blocks/src/Plugin/Block/ResponsiveMenuControls.php b/modules/sector_blocks/src/Plugin/Block/ResponsiveMenuControls.php new file mode 100644 index 00000000..31abe544 --- /dev/null +++ b/modules/sector_blocks/src/Plugin/Block/ResponsiveMenuControls.php @@ -0,0 +1,25 @@ + +
+ + Open main menu + + + Close main menu + +
+ + +{% endblock %} \ No newline at end of file diff --git a/modules/sector_blocks/templates/search-api-box-mobile.html.twig b/modules/sector_blocks/templates/search-api-box-mobile.html.twig new file mode 100644 index 00000000..804c9893 --- /dev/null +++ b/modules/sector_blocks/templates/search-api-box-mobile.html.twig @@ -0,0 +1,18 @@ +{% block content %} + +{% endblock %} \ No newline at end of file diff --git a/modules/sector_blocks/templates/search-api-box.html.twig b/modules/sector_blocks/templates/search-api-box.html.twig new file mode 100644 index 00000000..afb9aa81 --- /dev/null +++ b/modules/sector_blocks/templates/search-api-box.html.twig @@ -0,0 +1,18 @@ +{% block content %} + +{% endblock %} \ No newline at end of file diff --git a/modules/sector_blocks/templates/search-desktop-fly-out-control-block.html.twig b/modules/sector_blocks/templates/search-desktop-fly-out-control-block.html.twig new file mode 100644 index 00000000..32202304 --- /dev/null +++ b/modules/sector_blocks/templates/search-desktop-fly-out-control-block.html.twig @@ -0,0 +1,10 @@ +{% block content %} + +{% endblock %} \ No newline at end of file diff --git a/modules/sector_default_content/content/block_content/0ec32025-9e59-47d7-a6bb-911254a8a617.json b/modules/sector_default_content/content/block_content/0ec32025-9e59-47d7-a6bb-911254a8a617.json new file mode 100644 index 00000000..18a174e7 --- /dev/null +++ b/modules/sector_default_content/content/block_content/0ec32025-9e59-47d7-a6bb-911254a8a617.json @@ -0,0 +1,68 @@ +{ + "_links": { + "self": { + "href": "http:\/\/default\/block\/7?_format=hal_json" + }, + "type": { + "href": "http:\/\/drupal.org\/rest\/type\/block_content\/basic" + } + }, + "id": [ + { + "value": 30 + } + ], + "uuid": [ + { + "value": "0ec32025-9e59-47d7-a6bb-911254a8a617" + } + ], + "revision_id": [ + { + "value": 30 + } + ], + "langcode": [ + { + "value": "en", + "lang": "en" + } + ], + "type": [ + { + "target_id": "basic" + } + ], + "info": [ + { + "value": "Sector Sample Block - Section promotion", + "lang": "en" + } + ], + "changed": [ + { + "value": 1473916469, + "lang": "en" + } + ], + "revision_translation_affected": [ + { + "value": true, + "lang": "en" + } + ], + "default_langcode": [ + { + "value": true, + "lang": "en" + } + ], + "body": [ + { + "value": "

This sample block is shared across sidebars of the content types page to promote internal or external content inside a section.<\/p>\n\n

Read more<\/a><\/p>\n", + "format": "full_html", + "summary": null, + "lang": "en" + } + ] +} \ No newline at end of file diff --git a/modules/sector_default_content/content/block_content/3aa78e0e-4475-480d-9cb5-e2bdbafb2b43.json b/modules/sector_default_content/content/block_content/3aa78e0e-4475-480d-9cb5-e2bdbafb2b43.json new file mode 100644 index 00000000..fc6c832f --- /dev/null +++ b/modules/sector_default_content/content/block_content/3aa78e0e-4475-480d-9cb5-e2bdbafb2b43.json @@ -0,0 +1,68 @@ +{ + "_links": { + "self": { + "href": "http:\/\/default\/block\/6?_format=hal_json" + }, + "type": { + "href": "http:\/\/drupal.org\/rest\/type\/block_content\/basic" + } + }, + "id": [ + { + "value": 31 + } + ], + "uuid": [ + { + "value": "3aa78e0e-4475-480d-9cb5-e2bdbafb2b43" + } + ], + "revision_id": [ + { + "value": 31 + } + ], + "langcode": [ + { + "value": "en", + "lang": "en" + } + ], + "type": [ + { + "target_id": "basic" + } + ], + "info": [ + { + "value": "Sector Sample Block - Search help", + "lang": "en" + } + ], + "changed": [ + { + "value": 1473916469, + "lang": "en" + } + ], + "revision_translation_affected": [ + { + "value": true, + "lang": "en" + } + ], + "default_langcode": [ + { + "value": true, + "lang": "en" + } + ], + "body": [ + { + "value": "