Merge pull request #687 from creative-commoners/pulls/5.0/unerror-the-js

FIX javascript errors enacting default functionality
This commit is contained in:
Robbie Averill 2017-11-20 17:36:23 +13:00 committed by GitHub
commit 3e3450614b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 43 additions and 38 deletions

View File

@ -1 +1 @@
!function(e){function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}var t={};i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},i.p="",i(i.s=2)}([function(e,i){window.jQuery.entwine("ss",function(e){var i=null;e(".uf-field-editor .ss-gridfield-items").entwine({onmatch:function(){var t=0,n=0,o=e(".uf-field-editor .ss-gridfield-buttonrow").addClass("sticky-buttons"),r=e(".cms-content-header.north").first().height()+parseInt(e(".sticky-buttons").css("padding-top"),10),s=e(".uf-field-editor");this._super(),this.find(".ss-gridfield-item").each(function(i,o){switch(e(o).data("class")){case"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep":return void(n=0);case"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroup":t=++n;break;case"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd":t=n--;break;default:t=n}for(e(o).toggleClass("infieldgroup",t>0),i=1;i<=5;i++)e(o).toggleClass("infieldgroup-level-"+i,t>=i)}),i=setInterval(function(){var e=s.offset().top;o.width("100%"),e>r||0===e?o.removeClass("sticky-buttons"):o.addClass("sticky-buttons")},300)},onunmatch:function(){this._super(),clearInterval(i)}}),e(".uf-field-editor .ss-gridfield-buttonrow .action").entwine({onclick:function(e){this._super(e),this.trigger("addnewinline")}}),e(".uf-field-editor").entwine({onmatch:function(){var i=this;this._super(),this.on("addnewinline",function(){i.one("reload",function(){var t=i.find(".ss-gridfield-item").last(),n=null;"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd"===t.attr("data-class")?(n=t,n.prev().find(".col-Title input").focus(),t=n.add(n.prev()),n.css("visibility","hidden")):t.find(".col-Title input").focus(),t.addClass("flashBackground"),e(".cms-content-fields").scrollTop(e(".cms-content-fields")[0].scrollHeight),n&&n.css("visibility","visible")})})},onummatch:function(){this._super()}})})},function(e,i,t){"use strict";var n=t(3),o=t.n(n),r=this;o.a.entwine("ss",function(){var e={updateFormatSpecificFields:function(){var e=o()('input[name="SendPlain"]').is(":checked");o()(".field.toggle-html-only")[e?"hide":"show"](),o()(".field.toggle-plain-only")[e?"show":"hide"]()}};o()("#Form_ItemEditForm .EmailRecipientForm").entwine({onmatch:function(){e.updateFormatSpecificFields()},onunmatch:function(){r._super()}}),o()('#Form_ItemEditForm .EmailRecipientForm input[name="SendPlain"]').entwine({onchange:function(){e.updateFormatSpecificFields()}})})},function(e,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=t(0);t.n(n),t(1)},function(e,i){e.exports=jQuery}]);
!function(e){function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}var t={};i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},i.p="",i(i.s=3)}([function(e,i){e.exports=jQuery},function(e,i,t){"use strict";var n=t(0);t.n(n).a.entwine("ss",function(e){var i=null;e(".uf-field-editor .ss-gridfield-items").entwine({onmatch:function(){var t=0,n=0,o=e(".uf-field-editor .ss-gridfield-buttonrow").addClass("sticky-buttons"),r=e(".cms-content-header.north").first().height()+parseInt(e(".sticky-buttons").css("padding-top"),10),s=e(".uf-field-editor");this._super(),this.find(".ss-gridfield-item").each(function(i,o){switch(e(o).data("class")){case"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep":return void(n=0);case"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroup":t=++n;break;case"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd":t=n--;break;default:t=n}e(o).toggleClass("infieldgroup",t>0);for(var r=1;r<=5;r++)e(o).toggleClass("infieldgroup-level-"+r,t>=r)}),i=setInterval(function(){var e=s.offset().top;o.width("100%"),e>r||0===e?o.removeClass("sticky-buttons"):o.addClass("sticky-buttons")},300)},onunmatch:function(){this._super(),clearInterval(i)}}),e(".uf-field-editor .ss-gridfield-buttonrow .action").entwine({onclick:function(e){this._super(e),this.trigger("addnewinline")}}),e(".uf-field-editor").entwine({onmatch:function(){var i=this;this._super(),this.on("addnewinline",function(){i.one("reload",function(){var t=i.find(".ss-gridfield-item").last(),n=null;"SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd"===t.attr("data-class")?(n=t,n.prev().find(".col-Title input").focus(),t=n.add(n.prev()),n.css("visibility","hidden")):t.find(".col-Title input").focus(),t.addClass("flashBackground"),e(".cms-content-fields").scrollTop(e(".cms-content-fields")[0].scrollHeight),n&&n.css("visibility","visible")})})},onummatch:function(){this._super()}})})},function(e,i,t){"use strict";var n=t(0),o=this;t.n(n).a.entwine("ss",function(e){var i={updateFormatSpecificFields:function(){var i=e('input[name="SendPlain"]').is(":checked");e(".field.toggle-html-only")[i?"hide":"show"](),e(".field.toggle-plain-only")[i?"show":"hide"]()}};e("#Form_ItemEditForm .EmailRecipientForm").entwine({onmatch:function(){i.updateFormatSpecificFields()},onunmatch:function(){o._super()}}),e('#Form_ItemEditForm .EmailRecipientForm input[name="SendPlain"]').entwine({onchange:function(){i.updateFormatSpecificFields()}})})},function(e,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),t(1),t(2)}]);

View File

@ -1 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap 0725b68c82e72a079f59","webpack:///./client/src/bundles/FieldEditor.js","webpack:///./client/src/bundles/Recipient.js","webpack:///./client/src/bundles/bundle-cms.js","webpack:///external \"jQuery\""],"names":["window","jQuery","entwine","$","stickyHeaderInterval","onmatch","i","thisLevel","depth","$buttonrow","addClass","navHeight","first","height","parseInt","css","fieldEditor","_super","find","each","el","data","toggleClass","setInterval","offsetTop","offset","top","width","removeClass","onunmatch","clearInterval","onclick","e","trigger","on","one","$newField","last","$groupEnd","attr","prev","focus","add","scrollTop","scrollHeight","onummatch","recipient","updateFormatSpecificFields","sendPlainChecked","is","onchange"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;AC5DAA,OAAOC,MAAP,CAAcC,OAAd,CAAsB,IAAtB,EAA4B,UAACC,CAAD,EAAO;AACjC,MAAIC,uBAAuB,IAA3B;;AAEAD,IAAE,sCAAF,EAA0CD,OAA1C,CAAkD;AAChDG,WADgD,qBACtC;AACR,UAAIC,IAAI,CAAR;AACA,UAAIC,YAAY,CAAhB;AACA,UAAIC,QAAQ,CAAZ;AACA,UAAMC,aAAaN,EAAE,0CAAF,EAA8CO,QAA9C,CAAuD,gBAAvD,CAAnB;AACA,UAAMC,YAAYR,EAAE,2BAAF,EAA+BS,KAA/B,GAAuCC,MAAvC,KACdC,SAASX,EAAE,iBAAF,EAAqBY,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AAA,CAAE,yBAAF,EAA6B6C,mBAAmB,MAAnB,GAA4B,MAAzD;AACA7C,MAAA,8CAAAA,CAAE,0BAAF,EAA8B6C,mBAAmB,MAAnB,GAA4B,MAA1D;AACD;AAPe,GAAlB;;AAUA7C,EAAA,8CAAAA,CAAE,wCAAF,EAA4CD,OAA5C,CAAoD;AAClDG,aAAS,mBAAM;AACbyC,gBAAUC,0BAAV;AACD,KAHiD;;AAKlDlB,eAAW,qBAAM;AACf,YAAKZ,MAAL;AACD;AAPiD,GAApD;;AAUAd,EAAA,8CAAAA,CAAE,gEAAF,EAAoED,OAApE,CAA4E;AAC1EgD,cAAU,oBAAM;AACdJ,gBAAUC,0BAAV;AACD;AAHyE,GAA5E;AAKD,CA1BD,E;;;;;;;;;;;;ACLA;;;;;;;ACDA,wB","file":"js/userforms-cms.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0725b68c82e72a079f59","/**\n * form builder behaviour.\n */\n\nwindow.jQuery.entwine('ss', ($) => {\n let stickyHeaderInterval = null;\n\n $('.uf-field-editor .ss-gridfield-items').entwine({\n onmatch() {\n let i = 0;\n let thisLevel = 0;\n let depth = 0;\n const $buttonrow = $('.uf-field-editor .ss-gridfield-buttonrow').addClass('sticky-buttons');\n const navHeight = $('.cms-content-header.north').first().height()\n + parseInt($('.sticky-buttons').css('padding-top'), 10);\n const fieldEditor = $('.uf-field-editor');\n\n this._super();\n\n // Loop through all rows and set necessary styles\n this.find('.ss-gridfield-item').each((i, el) => {\n switch ($(el).data('class')) {\n case 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep': {\n depth = 0;\n return;\n }\n case 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup': {\n thisLevel = ++depth;\n break;\n }\n case 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd': {\n thisLevel = depth--;\n break;\n }\n default: {\n thisLevel = depth;\n }\n }\n\n $(el).toggleClass('infieldgroup', thisLevel > 0);\n for (i = 1; i <= 5; i++) {\n $(el).toggleClass(`infieldgroup-level-${i}`, thisLevel >= i);\n }\n });\n\n // Make sure gridfield buttons stick to top of page when user scrolls down\n stickyHeaderInterval = setInterval(() => {\n const offsetTop = fieldEditor.offset().top;\n $buttonrow.width('100%');\n if (offsetTop > navHeight || offsetTop === 0) {\n $buttonrow.removeClass('sticky-buttons');\n } else {\n $buttonrow.addClass('sticky-buttons');\n }\n }, 300);\n },\n onunmatch() {\n this._super();\n\n clearInterval(stickyHeaderInterval);\n },\n });\n\n // When new fields are added.\n $('.uf-field-editor .ss-gridfield-buttonrow .action').entwine({\n onclick(e) {\n this._super(e);\n\n this.trigger('addnewinline');\n },\n });\n\n $('.uf-field-editor').entwine({\n onmatch() {\n this._super();\n\n // When the 'Add field' button is clicked set a one time listener.\n // When the GridField is reloaded focus on the newly added field.\n this.on('addnewinline', () => {\n this.one('reload', () => {\n // If fieldgroup, focus on the start marker\n let $newField = this.find('.ss-gridfield-item').last();\n let $groupEnd = null;\n if ($newField.attr('data-class') === 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd') {\n $groupEnd = $newField;\n $groupEnd.prev().find('.col-Title input').focus();\n $newField = $groupEnd.add($groupEnd.prev());\n $groupEnd.css('visibility', 'hidden');\n } else {\n $newField.find('.col-Title input').focus();\n }\n\n $newField.addClass('flashBackground');\n $('.cms-content-fields').scrollTop($('.cms-content-fields')[0].scrollHeight);\n if ($groupEnd) {\n $groupEnd.css('visibility', 'visible');\n }\n });\n });\n },\n onummatch() {\n this._super();\n },\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/FieldEditor.js","/**\n * Email recipient behaviour.\n */\n\nimport $ from 'jquery';\n\n$.entwine('ss', () => {\n const recipient = {\n // Some fields are only visible when HTML email are being sent.\n updateFormatSpecificFields: () => {\n const sendPlainChecked = $('input[name=\"SendPlain\"]').is(':checked');\n\n $('.field.toggle-html-only')[sendPlainChecked ? 'hide' : 'show']();\n $('.field.toggle-plain-only')[sendPlainChecked ? 'show' : 'hide']();\n },\n };\n\n $('#Form_ItemEditForm .EmailRecipientForm').entwine({\n onmatch: () => {\n recipient.updateFormatSpecificFields();\n },\n\n onunmatch: () => {\n this._super();\n },\n });\n\n $('#Form_ItemEditForm .EmailRecipientForm input[name=\"SendPlain\"]').entwine({\n onchange: () => {\n recipient.updateFormatSpecificFields();\n },\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/Recipient.js","// Used for CMS form fields\nimport 'bundles/FieldEditor.js';\nimport 'bundles/Recipient.js';\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/bundle-cms.js","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 3\n// module chunks = 0"],"sourceRoot":""}
{"version":3,"sources":["webpack:///webpack/bootstrap 68068778ece7b00e18f0","webpack:///external \"jQuery\"","webpack:///./client/src/bundles/FieldEditor.js","webpack:///./client/src/bundles/Recipient.js","webpack:///./client/src/bundles/bundle-cms.js"],"names":["jQuery","entwine","$","stickyHeaderInterval","onmatch","thisLevel","depth","$buttonrow","addClass","navHeight","first","height","parseInt","css","fieldEditor","_super","find","each","index","el","data","toggleClass","i","setInterval","offsetTop","offset","top","width","removeClass","onunmatch","clearInterval","onclick","e","trigger","on","one","$newField","last","$groupEnd","fqcn","attr","prev","focus","add","scrollTop","scrollHeight","onummatch","recipient","updateFormatSpecificFields","sendPlainChecked","is","onchange"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AChEA,wB;;;;;;;;;;;ACIA;;AA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,cAAIP,SAAJ,EAAe;AACbA,sBAAUzB,GAAV,CAAc,YAAd,EAA4B,SAA5B;AACD;AACF,SAnBD;AAoBD,OArBD;AAsBD,KA5B2B;AA6B5BiC,aA7B4B,uBA6BhB;AACV,WAAK/B,MAAL;AACD;AA/B2B,GAA9B;AAiCD,CApGD,E;;;;;;;;;;;ACFA;;AAEA,8CAAAf,CAAOC,OAAP,CAAe,IAAf,EAAqB,UAACC,CAAD,EAAO;AAC1B,MAAM6C,YAAY;AAEhBC,gCAA4B,sCAAM;AAChC,UAAMC,mBAAmB/C,EAAE,yBAAF,EAA6BgD,EAA7B,CAAgC,UAAhC,CAAzB;;AAEAhD,QAAE,yBAAF,EAA6B+C,mBAAmB,MAAnB,GAA4B,MAAzD;AACA/C,QAAE,0BAAF,EAA8B+C,mBAAmB,MAAnB,GAA4B,MAA1D;AACD;AAPe,GAAlB;;AAUA/C,IAAE,wCAAF,EAA4CD,OAA5C,CAAoD;AAClDG,aAAS,mBAAM;AACb2C,gBAAUC,0BAAV;AACD,KAHiD;;AAKlDnB,eAAW,qBAAM;AACf,YAAKd,MAAL;AACD;AAPiD,GAApD;;AAUAb,IAAE,gEAAF,EAAoED,OAApE,CAA4E;AAC1EkD,cAAU,oBAAM;AACdJ,gBAAUC,0BAAV;AACD;AAHyE,GAA5E;AAKD,CA1BD,E;;;;;;;;;;;ACLA","file":"js/userforms-cms.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 68068778ece7b00e18f0","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0","/**\n * form builder behaviour.\n */\n\nimport jQuery from 'jquery';\n\njQuery.entwine('ss', ($) => {\n let stickyHeaderInterval = null;\n\n $('.uf-field-editor .ss-gridfield-items').entwine({\n onmatch() {\n let thisLevel = 0;\n let depth = 0;\n const $buttonrow = $('.uf-field-editor .ss-gridfield-buttonrow').addClass('sticky-buttons');\n const navHeight = $('.cms-content-header.north').first().height()\n + parseInt($('.sticky-buttons').css('padding-top'), 10);\n const fieldEditor = $('.uf-field-editor');\n\n this._super();\n\n // Loop through all rows and set necessary styles\n this.find('.ss-gridfield-item').each((index, el) => {\n switch ($(el).data('class')) {\n case 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep': {\n depth = 0;\n return;\n }\n case 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup': {\n thisLevel = ++depth;\n break;\n }\n case 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd': {\n thisLevel = depth--;\n break;\n }\n default: {\n thisLevel = depth;\n }\n }\n\n $(el).toggleClass('infieldgroup', thisLevel > 0);\n for (let i = 1; i <= 5; i++) {\n $(el).toggleClass(`infieldgroup-level-${i}`, thisLevel >= i);\n }\n });\n\n // Make sure gridfield buttons stick to top of page when user scrolls down\n stickyHeaderInterval = setInterval(() => {\n const offsetTop = fieldEditor.offset().top;\n $buttonrow.width('100%');\n if (offsetTop > navHeight || offsetTop === 0) {\n $buttonrow.removeClass('sticky-buttons');\n } else {\n $buttonrow.addClass('sticky-buttons');\n }\n }, 300);\n },\n onunmatch() {\n this._super();\n\n clearInterval(stickyHeaderInterval);\n },\n });\n\n // When new fields are added.\n $('.uf-field-editor .ss-gridfield-buttonrow .action').entwine({\n onclick(e) {\n this._super(e);\n\n this.trigger('addnewinline');\n },\n });\n\n $('.uf-field-editor').entwine({\n onmatch() {\n this._super();\n\n // When the 'Add field' button is clicked set a one time listener.\n // When the GridField is reloaded focus on the newly added field.\n this.on('addnewinline', () => {\n this.one('reload', () => {\n // If fieldgroup, focus on the start marker\n let $newField = this.find('.ss-gridfield-item').last();\n let $groupEnd = null;\n const fqcn = 'SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd';\n if ($newField.attr('data-class') === fqcn) {\n $groupEnd = $newField;\n $groupEnd.prev().find('.col-Title input').focus();\n $newField = $groupEnd.add($groupEnd.prev());\n $groupEnd.css('visibility', 'hidden');\n } else {\n $newField.find('.col-Title input').focus();\n }\n\n $newField.addClass('flashBackground');\n $('.cms-content-fields').scrollTop($('.cms-content-fields')[0].scrollHeight);\n if ($groupEnd) {\n $groupEnd.css('visibility', 'visible');\n }\n });\n });\n },\n onummatch() {\n this._super();\n },\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/FieldEditor.js","/**\n * Email recipient behaviour.\n */\n\nimport jQuery from 'jquery';\n\njQuery.entwine('ss', ($) => {\n const recipient = {\n // Some fields are only visible when HTML email are being sent.\n updateFormatSpecificFields: () => {\n const sendPlainChecked = $('input[name=\"SendPlain\"]').is(':checked');\n\n $('.field.toggle-html-only')[sendPlainChecked ? 'hide' : 'show']();\n $('.field.toggle-plain-only')[sendPlainChecked ? 'show' : 'hide']();\n },\n };\n\n $('#Form_ItemEditForm .EmailRecipientForm').entwine({\n onmatch: () => {\n recipient.updateFormatSpecificFields();\n },\n\n onunmatch: () => {\n this._super();\n },\n });\n\n $('#Form_ItemEditForm .EmailRecipientForm input[name=\"SendPlain\"]').entwine({\n onchange: () => {\n recipient.updateFormatSpecificFields();\n },\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/Recipient.js","// Used for CMS form fields\nimport 'bundles/FieldEditor.js';\nimport 'bundles/Recipient.js';\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/bundle-cms.js"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"version":3,"sources":["webpack:///./client/src/styles/userforms-cms.scss?61a4","webpack:///./bundle-cms.scss?b4af"],"names":[],"mappings":"AAAA,iBACE,iBCCD,uDDKK,YCDL,oHDKO,gBCAP,0DDIO,qBACA,sBACA,gBACA,mBCAP,qEDGS,uBCCT,+DDIO,gBCAP,wEDIO,0HCAP,+EDIO,YCAP,mEDIO,UACA,kBACA,cCAP,yEDGS,gBCCT,sFDGS,+CACA,eACA,iBCCT,8IDOO,gBCFP,6JDOO,mBCFP,oRDSO,mBACA,WCJP,6IDQO,gBACA,WACA,eACA,iBCJP,+ODQQ,6BCJR,uKDSS,WCLT,6KDUW,cCNX,4IDcQ,6BCVR,4JDcO,gBACA,iBACA,cCVP,+IDgBO,gCCZP,oPDgBS,aCZT,iKDgBO,aCZP,iCDkBG,eACA,SACA,UACA,mBACA,gCACA,aACA,kBCdH,+CDiBK,gBCbL,qDDiBK","file":"styles/userforms-cms.css","sourcesContent":[".uf-field-editor {\n padding-bottom: 0;\n\n // Row styles\n .grid-field__table {\n // Standard rows\n .ss-gridfield-item {\n height: 46px;\n\n &,\n &:hover {\n background: $white;\n }\n\n td {\n border-right-width: 0;\n vertical-align: middle;\n padding-top: 6px;\n padding-bottom: 6px;\n\n &:last-child {\n border-right-width: 1px;\n }\n }\n\n .handle {\n min-height: 46px;\n }\n\n &.flash-background {\n animation: flash-background 2s linear;\n }\n\n &.ui-sortable-placeholder {\n height: 50px;\n }\n\n .form-group {\n padding: 0;\n margin-bottom: 2px;\n color: $gray-700;\n\n &:after {\n border-bottom: 0;\n }\n\n .form__field-label {\n flex: auto;\n max-width: 100%;\n padding-bottom: 0;\n }\n }\n }\n\n .ss-gridfield-item.infieldgroup {\n &,\n &:hover {\n background: $white;\n }\n\n .col-reorder,\n .handle {\n background: $gray-200;\n }\n }\n\n .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] {\n &,\n &:hover {\n background: $gray-650;\n color: $white;\n }\n\n label {\n font-weight: bold;\n color: $white;\n font-size: 15px;\n padding-bottom: 0;\n }\n\n + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] td {\n border-top: 3px solid $gray-200;\n }\n\n .grid-field__icon-action {\n &:before {\n color: $white;\n }\n\n &:hover {\n &:before {\n color: $gray-650;\n }\n }\n }\n }\n\n .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] {\n td {\n border-top: 3px solid $gray-200;\n }\n\n .form__field-label {\n font-weight: bold;\n padding-bottom: 0;\n color: $gray-700;\n }\n }\n\n .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] {\n td {\n border-bottom: 3px solid $gray-200;\n }\n\n + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] {\n border-top: 0;\n }\n\n .col-buttons .action {\n display: none;\n }\n }\n }\n\n .sticky-buttons {\n position: fixed;\n top: 73px;\n z-index: 2;\n background: $body-bg;\n border-bottom: 1px solid $border-color-light;\n padding: 12px;\n margin-left: -12px;\n\n & button.action {\n margin-bottom: 0;\n }\n\n ~ .ss-gridfield-table {\n margin-top: 73px;\n }\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/styles/userforms-cms.scss",".uf-field-editor {\n padding-bottom: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item {\n height: 46px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item,\n.uf-field-editor .grid-field__table .ss-gridfield-item:hover {\n background: #fff;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item td {\n border-right-width: 0;\n vertical-align: middle;\n padding-top: 6px;\n padding-bottom: 6px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item td:last-child {\n border-right-width: 1px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .handle {\n min-height: 46px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.flash-background {\n animation: flash-background 2s linear;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.ui-sortable-placeholder {\n height: 50px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .form-group {\n padding: 0;\n margin-bottom: 2px;\n color: #4f5861;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .form-group:after {\n border-bottom: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .form-group .form__field-label {\n flex: auto;\n max-width: 100%;\n padding-bottom: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup,\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup:hover {\n background: #fff;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup .col-reorder,\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup .handle {\n background: #e7e9ec;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"],\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"]:hover {\n background: #66727d;\n color: #fff;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] label {\n font-weight: bold;\n color: #fff;\n font-size: 15px;\n padding-bottom: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] td {\n border-top: 3px solid #e7e9ec;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] .grid-field__icon-action:before {\n color: #fff;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] .grid-field__icon-action:hover:before {\n color: #66727d;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] td {\n border-top: 3px solid #e7e9ec;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] .form__field-label {\n font-weight: bold;\n padding-bottom: 0;\n color: #4f5861;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] td {\n border-bottom: 3px solid #e7e9ec;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] {\n border-top: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] .col-buttons .action {\n display: none;\n}\n\n.uf-field-editor .sticky-buttons {\n position: fixed;\n top: 73px;\n z-index: 2;\n background: #f6f7f8;\n border-bottom: 1px solid #e5e8eb;\n padding: 12px;\n margin-left: -12px;\n}\n\n.uf-field-editor .sticky-buttons button.action {\n margin-bottom: 0;\n}\n\n.uf-field-editor .sticky-buttons ~ .ss-gridfield-table {\n margin-top: 73px;\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./bundle-cms.scss"],"sourceRoot":""}
{"version":3,"sources":["webpack:///./client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/client/src/styles/userforms-cms.scss?cdcf","webpack:///./client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/bundle-cms.scss?a5bb"],"names":[],"mappings":"AAAA,iBACE,iBCCD,uDDKK,YCDL,oHDKO,gBCAP,0DDIO,qBACA,sBACA,gBACA,mBCAP,qEDGS,uBCCT,+DDIO,gBCAP,wEDIO,0HCAP,+EDIO,YCAP,mEDIO,UACA,kBACA,cCAP,yEDGS,gBCCT,sFDGS,+CACA,eACA,iBCCT,8IDOO,gBCFP,6JDOO,mBCFP,oRDSO,mBACA,WCJP,6IDQO,gBACA,WACA,eACA,iBCJP,+ODQQ,6BCJR,uKDSS,WCLT,6KDUW,cCNX,4IDcQ,6BCVR,4JDcO,gBACA,iBACA,cCVP,+IDgBO,gCCZP,oPDgBS,aCZT,iKDgBO,aCZP,iCDkBG,eACA,SACA,UACA,mBACA,gCACA,aACA,kBCdH,+CDiBK,gBCbL,qDDiBK","file":"styles/userforms-cms.css","sourcesContent":[".uf-field-editor {\n padding-bottom: 0;\n\n // Row styles\n .grid-field__table {\n // Standard rows\n .ss-gridfield-item {\n height: 46px;\n\n &,\n &:hover {\n background: $white;\n }\n\n td {\n border-right-width: 0;\n vertical-align: middle;\n padding-top: 6px;\n padding-bottom: 6px;\n\n &:last-child {\n border-right-width: 1px;\n }\n }\n\n .handle {\n min-height: 46px;\n }\n\n &.flash-background {\n animation: flash-background 2s linear;\n }\n\n &.ui-sortable-placeholder {\n height: 50px;\n }\n\n .form-group {\n padding: 0;\n margin-bottom: 2px;\n color: $gray-700;\n\n &:after {\n border-bottom: 0;\n }\n\n .form__field-label {\n flex: auto;\n max-width: 100%;\n padding-bottom: 0;\n }\n }\n }\n\n .ss-gridfield-item.infieldgroup {\n &,\n &:hover {\n background: $white;\n }\n\n .col-reorder,\n .handle {\n background: $gray-200;\n }\n }\n\n .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] {\n &,\n &:hover {\n background: $gray-650;\n color: $white;\n }\n\n label {\n font-weight: bold;\n color: $white;\n font-size: 15px;\n padding-bottom: 0;\n }\n\n + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] td {\n border-top: 3px solid $gray-200;\n }\n\n .grid-field__icon-action {\n &:before {\n color: $white;\n }\n\n &:hover {\n &:before {\n color: $gray-650;\n }\n }\n }\n }\n\n .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] {\n td {\n border-top: 3px solid $gray-200;\n }\n\n .form__field-label {\n font-weight: bold;\n padding-bottom: 0;\n color: $gray-700;\n }\n }\n\n .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] {\n td {\n border-bottom: 3px solid $gray-200;\n }\n\n + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] {\n border-top: 0;\n }\n\n .col-buttons .action {\n display: none;\n }\n }\n }\n\n .sticky-buttons {\n position: fixed;\n top: 73px;\n z-index: 2;\n background: $body-bg;\n border-bottom: 1px solid $border-color-light;\n padding: 12px;\n margin-left: -12px;\n\n & button.action {\n margin-bottom: 0;\n }\n\n ~ .ss-gridfield-table {\n margin-top: 73px;\n }\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/client/src/styles/userforms-cms.scss",".uf-field-editor {\n padding-bottom: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item {\n height: 46px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item,\n.uf-field-editor .grid-field__table .ss-gridfield-item:hover {\n background: #fff;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item td {\n border-right-width: 0;\n vertical-align: middle;\n padding-top: 6px;\n padding-bottom: 6px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item td:last-child {\n border-right-width: 1px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .handle {\n min-height: 46px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.flash-background {\n animation: flash-background 2s linear;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.ui-sortable-placeholder {\n height: 50px;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .form-group {\n padding: 0;\n margin-bottom: 2px;\n color: #4f5861;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .form-group:after {\n border-bottom: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item .form-group .form__field-label {\n flex: auto;\n max-width: 100%;\n padding-bottom: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup,\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup:hover {\n background: #fff;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup .col-reorder,\n.uf-field-editor .grid-field__table .ss-gridfield-item.infieldgroup .handle {\n background: #e7e9ec;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"],\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"]:hover {\n background: #66727d;\n color: #fff;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] label {\n font-weight: bold;\n color: #fff;\n font-size: 15px;\n padding-bottom: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] td {\n border-top: 3px solid #e7e9ec;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] .grid-field__icon-action:before {\n color: #fff;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFormStep\"] .grid-field__icon-action:hover:before {\n color: #66727d;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] td {\n border-top: 3px solid #e7e9ec;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroup\"] .form__field-label {\n font-weight: bold;\n padding-bottom: 0;\n color: #4f5861;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] td {\n border-bottom: 3px solid #e7e9ec;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] + .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] {\n border-top: 0;\n}\n\n.uf-field-editor .grid-field__table .ss-gridfield-item[data-class=\"SilverStripe\\\\UserForms\\\\Model\\\\EditableFormField\\\\EditableFieldGroupEnd\"] .col-buttons .action {\n display: none;\n}\n\n.uf-field-editor .sticky-buttons {\n position: fixed;\n top: 73px;\n z-index: 2;\n background: #f6f7f8;\n border-bottom: 1px solid #e5e8eb;\n padding: 12px;\n margin-left: -12px;\n}\n\n.uf-field-editor .sticky-buttons button.action {\n margin-bottom: 0;\n}\n\n.uf-field-editor .sticky-buttons ~ .ss-gridfield-table {\n margin-top: 73px;\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/bundle-cms.scss"],"sourceRoot":""}

View File

@ -1 +1 @@
{"version":3,"sources":["webpack:///./client/src/styles/userforms.scss?1f22","webpack:///./bundle.scss?6663"],"names":[],"mappings":"AAEA,6BAEI,kBACA,WACA,mBCFH,iCDMG,kBACA,WACA,mBCFH,iCDMG,cACA,kBCFH,wCDMG,qBACA,qBCFH,iEDKK,UCDL,qCDMG,kBACA,MACA,WCFH,+BDQG,cCJH,sCDQG,qBACA,qBCJH,UDSC,WACA,WACA,eCLD,6BDQG,cCJH,gBDSC,yBACA,kBACA,YACA,gBACA,mBCLD,uBDQG,iBACA,kBACA,SACA,WCJH,aDSC,WACA,cCLD,uBDSC,eCLD,gBDSC,kBACA","file":"styles/userforms.css","sourcesContent":["// Lightweight base styles for the front-end form.\n\n.userform-progress {\n .progress {\n position: relative;\n height: 1em;\n background: $gray-200;\n }\n\n .progress-bar {\n position: absolute;\n height: 1em;\n background: $gray-650;\n }\n\n .step-buttons {\n margin-left: 0;\n position: relative;\n }\n\n .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n\n &.viewed .step-button-jump {\n opacity: 1;\n }\n }\n\n .step-button-jump {\n position: absolute;\n top: 0;\n opacity: .7;\n }\n}\n\n.step-navigation {\n .step-buttons {\n margin-left: 0;\n }\n\n .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n }\n}\n\n.userform {\n clear: both;\n width: 100%;\n max-width: 100%;\n\n .field label.right {\n color: $gray-800;\n }\n}\n\n.userformsgroup {\n border: 1px solid $gray-300;\n border-radius: 4px;\n padding: 8px;\n margin-top: 12px;\n margin-bottom: 12px;\n\n > legend {\n padding-left: 4px;\n padding-right: 4px;\n border: 0;\n width: auto;\n }\n}\n\n.right-title {\n clear: both;\n display: block;\n}\n\n.checkbox .right-title {\n display: inline;\n}\n\n.userform .left {\n margin-bottom: 5px;\n font-weight: bold;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/styles/userforms.scss",".userform-progress .progress {\n position: relative;\n height: 1em;\n background: #e7e9ec;\n}\n\n.userform-progress .progress-bar {\n position: absolute;\n height: 1em;\n background: #66727d;\n}\n\n.userform-progress .step-buttons {\n margin-left: 0;\n position: relative;\n}\n\n.userform-progress .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n}\n\n.userform-progress .step-button-wrapper.viewed .step-button-jump {\n opacity: 1;\n}\n\n.userform-progress .step-button-jump {\n position: absolute;\n top: 0;\n opacity: .7;\n}\n\n.step-navigation .step-buttons {\n margin-left: 0;\n}\n\n.step-navigation .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n}\n\n.userform {\n clear: both;\n width: 100%;\n max-width: 100%;\n}\n\n.userform .field label.right {\n color: #383f45;\n}\n\n.userformsgroup {\n border: 1px solid #d3d8dc;\n border-radius: 4px;\n padding: 8px;\n margin-top: 12px;\n margin-bottom: 12px;\n}\n\n.userformsgroup > legend {\n padding-left: 4px;\n padding-right: 4px;\n border: 0;\n width: auto;\n}\n\n.right-title {\n clear: both;\n display: block;\n}\n\n.checkbox .right-title {\n display: inline;\n}\n\n.userform .left {\n margin-bottom: 5px;\n font-weight: bold;\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./bundle.scss"],"sourceRoot":""}
{"version":3,"sources":["webpack:///./client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/client/src/styles/userforms.scss?cda5","webpack:///./client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/bundle.scss?5b3a"],"names":[],"mappings":"AAEA,6BAEI,kBACA,WACA,mBCFH,iCDMG,kBACA,WACA,mBCFH,iCDMG,cACA,kBCFH,wCDMG,qBACA,qBCFH,iEDKK,UCDL,qCDMG,kBACA,MACA,WCFH,+BDQG,cCJH,sCDQG,qBACA,qBCJH,UDSC,WACA,WACA,eCLD,6BDQG,cCJH,gBDSC,yBACA,kBACA,YACA,gBACA,mBCLD,uBDQG,iBACA,kBACA,SACA,WCJH,aDSC,WACA,cCLD,uBDSC,eCLD,gBDSC,kBACA","file":"styles/userforms.css","sourcesContent":["// Lightweight base styles for the front-end form.\n\n.userform-progress {\n .progress {\n position: relative;\n height: 1em;\n background: $gray-200;\n }\n\n .progress-bar {\n position: absolute;\n height: 1em;\n background: $gray-650;\n }\n\n .step-buttons {\n margin-left: 0;\n position: relative;\n }\n\n .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n\n &.viewed .step-button-jump {\n opacity: 1;\n }\n }\n\n .step-button-jump {\n position: absolute;\n top: 0;\n opacity: .7;\n }\n}\n\n.step-navigation {\n .step-buttons {\n margin-left: 0;\n }\n\n .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n }\n}\n\n.userform {\n clear: both;\n width: 100%;\n max-width: 100%;\n\n .field label.right {\n color: $gray-800;\n }\n}\n\n.userformsgroup {\n border: 1px solid $gray-300;\n border-radius: 4px;\n padding: 8px;\n margin-top: 12px;\n margin-bottom: 12px;\n\n > legend {\n padding-left: 4px;\n padding-right: 4px;\n border: 0;\n width: auto;\n }\n}\n\n.right-title {\n clear: both;\n display: block;\n}\n\n.checkbox .right-title {\n display: inline;\n}\n\n.userform .left {\n margin-bottom: 5px;\n font-weight: bold;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/client/src/styles/userforms.scss",".userform-progress .progress {\n position: relative;\n height: 1em;\n background: #e7e9ec;\n}\n\n.userform-progress .progress-bar {\n position: absolute;\n height: 1em;\n background: #66727d;\n}\n\n.userform-progress .step-buttons {\n margin-left: 0;\n position: relative;\n}\n\n.userform-progress .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n}\n\n.userform-progress .step-button-wrapper.viewed .step-button-jump {\n opacity: 1;\n}\n\n.userform-progress .step-button-jump {\n position: absolute;\n top: 0;\n opacity: .7;\n}\n\n.step-navigation .step-buttons {\n margin-left: 0;\n}\n\n.step-navigation .step-button-wrapper {\n display: inline-block;\n list-style-type: none;\n}\n\n.userform {\n clear: both;\n width: 100%;\n max-width: 100%;\n}\n\n.userform .field label.right {\n color: #383f45;\n}\n\n.userformsgroup {\n border: 1px solid #d3d8dc;\n border-radius: 4px;\n padding: 8px;\n margin-top: 12px;\n margin-bottom: 12px;\n}\n\n.userformsgroup > legend {\n padding-left: 4px;\n padding-right: 4px;\n border: 0;\n width: auto;\n}\n\n.right-title {\n clear: both;\n display: block;\n}\n\n.checkbox .right-title {\n display: inline;\n}\n\n.userform .left {\n margin-bottom: 5px;\n font-weight: bold;\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/styles/C:/Users/dwagstaff/work/testymctestface/vendor/silverstripe/userforms/bundle.scss"],"sourceRoot":""}

View File

@ -2,12 +2,13 @@
* form builder behaviour.
*/
window.jQuery.entwine('ss', ($) => {
import jQuery from 'jquery';
jQuery.entwine('ss', ($) => {
let stickyHeaderInterval = null;
$('.uf-field-editor .ss-gridfield-items').entwine({
onmatch() {
let i = 0;
let thisLevel = 0;
let depth = 0;
const $buttonrow = $('.uf-field-editor .ss-gridfield-buttonrow').addClass('sticky-buttons');
@ -18,7 +19,7 @@ window.jQuery.entwine('ss', ($) => {
this._super();
// Loop through all rows and set necessary styles
this.find('.ss-gridfield-item').each((i, el) => {
this.find('.ss-gridfield-item').each((index, el) => {
switch ($(el).data('class')) {
case 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFormStep': {
depth = 0;
@ -38,7 +39,7 @@ window.jQuery.entwine('ss', ($) => {
}
$(el).toggleClass('infieldgroup', thisLevel > 0);
for (i = 1; i <= 5; i++) {
for (let i = 1; i <= 5; i++) {
$(el).toggleClass(`infieldgroup-level-${i}`, thisLevel >= i);
}
});
@ -81,7 +82,8 @@ window.jQuery.entwine('ss', ($) => {
// If fieldgroup, focus on the start marker
let $newField = this.find('.ss-gridfield-item').last();
let $groupEnd = null;
if ($newField.attr('data-class') === 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd') {
const fqcn = 'SilverStripe\\UserForms\\Model\\EditableFormField\\EditableFieldGroupEnd';
if ($newField.attr('data-class') === fqcn) {
$groupEnd = $newField;
$groupEnd.prev().find('.col-Title input').focus();
$newField = $groupEnd.add($groupEnd.prev());

View File

@ -2,9 +2,9 @@
* Email recipient behaviour.
*/
import $ from 'jquery';
import jQuery from 'jquery';
$.entwine('ss', () => {
jQuery.entwine('ss', ($) => {
const recipient = {
// Some fields are only visible when HTML email are being sent.
updateFormatSpecificFields: () => {

View File

@ -2,9 +2,10 @@
* @file Manages the multi-step navigation.
*/
import $ from 'jquery';
import jQuery from 'jquery';
import i18n from 'i18n';
$(document).ready(() => {
jQuery(document).ready(($) => {
// A reference to the UserForm instance.
let userform = null;
@ -17,14 +18,14 @@ $(document).ready(() => {
* @func show
* @desc Show the form step. Looks after aria attributes too.
*/
show: () => {
show() {
this.$el.attr('aria-hidden', false).show();
},
/**
* @func hide
* @desc Hide the form step. Looks after aria attributes too.
*/
hide: () => {
hide() {
this.$el.attr('aria-hidden', true).hide();
},
};
@ -40,7 +41,7 @@ $(document).ready(() => {
this.$el = element instanceof $ ? element : $(element);
// Set the error container's heading.
this.$el.find('h4').text(window.ss.i18n._t('UserForms.ERROR_CONTAINER_HEADER',
this.$el.find('h4').text(i18n._t('UserForms.ERROR_CONTAINER_HEADER',
'Please correct the following errors and try again:'));
return this;
@ -51,15 +52,15 @@ $(document).ready(() => {
* @return boolean
* @desc Checks if the error container has any error messages.
*/
ErrorContainer.prototype.hasErrors = () => (
this.$el.find('.error-list').children().length > 0
);
ErrorContainer.prototype.hasErrors = function hasErrors() {
return this.$el.find('.error-list').children().length > 0;
};
/**
* @func removeErrorMessage
* @desc Removes an error message from the error container.
*/
ErrorContainer.prototype.removeErrorMessage = (fieldId) => {
ErrorContainer.prototype.removeErrorMessage = function removeErrorMessage(fieldId) {
this.$el.find(`#${fieldId}-top-error`).remove();
// If there are no more error then hide the container.
@ -73,7 +74,7 @@ $(document).ready(() => {
* @param {object} step - FormStep instance.
* @desc Adds a link to a form step as an error message.
*/
ErrorContainer.prototype.addStepLink = (step) => {
ErrorContainer.prototype.addStepLink = function addStepLink(step) {
const itemID = `${step.$el.attr('id')}-error-link`;
let $itemElement = this.$el.find(`#${itemID}`);
const stepID = step.$el.attr('id');
@ -99,7 +100,7 @@ $(document).ready(() => {
* @param {object} step - FormStep instance.
* @desc Removes a step link from the error container.
*/
ErrorContainer.prototype.removeStepLink = (fieldId) => {
ErrorContainer.prototype.removeStepLink = function removeStepLink(fieldId) {
const stepID = $(`#${fieldId}`).closest('.form-step').attr('id');
this.$el.find(`#${stepID}-error-link`).remove();
@ -116,7 +117,7 @@ $(document).ready(() => {
* @param {object} message - The error message to display (html escaped).
* @desc Update an error message (displayed at the top of the form).
*/
ErrorContainer.prototype.updateErrorMessage = ($input, message) => {
ErrorContainer.prototype.updateErrorMessage = function updateErrorMessage($input, message) {
const inputID = $input.attr('id');
let anchor = `#${inputID}`;
const elementID = `${inputID}-top-error`;
@ -148,8 +149,8 @@ $(document).ready(() => {
messageElement
.attr('id', elementID)
.find('a')
.attr('href', location.pathname + location.search + anchor)
.html(message);
.attr('href', location.pathname + location.search + anchor)
.html(message);
this.$el.find('ul').append(messageElement);
@ -231,9 +232,9 @@ $(document).ready(() => {
* @returns {Boolean}
*/
// Because the element itself could be visible but 0 height, so check visibility of button
FormStep.prototype.conditionallyHidden = () => (
!this.$elButton.find('button').is(':visible')
);
FormStep.prototype.conditionallyHidden = function conditionallyHidden() {
return !this.$elButton.find('button').is(':visible');
};
/**
* @func ProgressBar
@ -306,7 +307,7 @@ $(document).ready(() => {
* @param {number} stepID - Zero based index of the new step.
* @desc Update the progress element to show a new step.
*/
ProgressBar.prototype.update = (stepID) => {
ProgressBar.prototype.update = function update(stepID) {
const $newStepElement = $($('.form-step')[stepID]);
let stepNumber = 0;
let barWidth = stepID / (this.$buttons.length - 1) * 100;
@ -401,7 +402,7 @@ $(document).ready(() => {
* @param {number} stepID - Zero based ID of the current step.
* @desc Updates the form actions element to reflect the current state of the page.
*/
FormActions.prototype.update = () => {
FormActions.prototype.update = function update() {
const numberOfSteps = userform.steps.length;
const stepID = userform.currentStep ? userform.currentStep.id : 0;
let i = null;
@ -549,7 +550,7 @@ $(document).ready(() => {
* @param {object} step - An instance of FormStep.
* @desc Adds a step to the UserForm.
*/
UserForm.prototype.addStep = (step) => {
UserForm.prototype.addStep = function addStep(step) {
// Make sure we're dealing with a form step.
if (!step instanceof FormStep) {
return;
@ -566,7 +567,7 @@ $(document).ready(() => {
* @param {object} step - An instance of FormStep.
* @desc Sets the step the user is currently on.
*/
UserForm.prototype.setCurrentStep = (step) => {
UserForm.prototype.setCurrentStep = function setCurrentStep(step) {
// Make sure we're dealing with a form step.
if (!(step instanceof FormStep)) {
return;
@ -586,7 +587,7 @@ $(document).ready(() => {
* @param {boolean} [direction] - Defaults to forward (true).
* @desc Jumps to a specific form step.
*/
UserForm.prototype.jumpToStep = (stepNumber, direction) => {
UserForm.prototype.jumpToStep = function jumpToStep(stepNumber, direction) {
const targetStep = this.steps[stepNumber];
let isValid = false;
const forward = direction === void 0 ? true : direction;
@ -632,7 +633,7 @@ $(document).ready(() => {
* @func UserForm.nextStep
* @desc Advances the form to the next step.
*/
UserForm.prototype.nextStep = () => {
UserForm.prototype.nextStep = function nextStep() {
this.jumpToStep(this.steps.indexOf(this.currentStep) + 1, true);
};
@ -640,7 +641,7 @@ $(document).ready(() => {
* @func UserForm.prevStep
* @desc Goes back one step (not bound to browser history).
*/
UserForm.prototype.prevStep = () => {
UserForm.prototype.prevStep = function prevStep() {
this.jumpToStep(this.steps.indexOf(this.currentStep) - 1, false);
};
@ -731,7 +732,7 @@ $(document).ready(() => {
const form = $('form.userform');
if (typeof form.areYouSure !== 'undefined') {
form.areYouSure({
message: window.ss.i18n._t('UserForms.LEAVE_CONFIRMATION', 'You have unsaved changes!'),
message: i18n._t('UserForms.LEAVE_CONFIRMATION', 'You have unsaved changes!'),
});
}
}

View File

@ -55,6 +55,7 @@ class UserDefinedFormController extends PageController
Requirements::javascript(
'silverstripe/userforms:client/thirdparty/jquery-validate/jquery.validate.min.js'
);
Requirements::javascript('silverstripe/admin:client/dist/js/i18n.js');
Requirements::add_i18n_javascript('silverstripe/userforms:client/lang');
Requirements::javascript('silverstripe/userforms:client/dist/js/userforms.js');

View File

@ -32,6 +32,7 @@ const config = [
},
devtool: (ENV !== 'production') ? 'source-map' : '',
resolve: resolveJS(ENV, PATHS),
externals: externalJS(ENV, PATHS),
module: moduleJS(ENV, PATHS),
plugins: pluginJS(ENV, PATHS),
},