diff --git a/.travis.yml b/.travis.yml index 0861ed8..9f1d072 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,6 @@ sudo: false language: php - # Support PHP 5.3 -dist: precise - matrix: include: - php: 5.3 diff --git a/client/src/bundles/FieldEditor.js b/client/src/bundles/FieldEditor.js index 5e9b14e..ff825aa 100644 --- a/client/src/bundles/FieldEditor.js +++ b/client/src/bundles/FieldEditor.js @@ -8,8 +8,8 @@ $(".uf-field-editor tbody").entwine({ onmatch: function() { - var i, - thisLevel, + var i, + thisLevel, depth = 0, $buttonrow = $('.uf-field-editor .ss-gridfield-buttonrow').addClass('stickyButtons'), navHeight = $('.cms-content-header.north').height() + parseInt($('.stickyButtons').css('padding-top'), 10), @@ -17,7 +17,7 @@ self = this; this._super(); - + // Loop through all rows and set necessary styles this.find('.ss-gridfield-item').each(function() { switch($(this).data('class')) { @@ -37,7 +37,7 @@ thisLevel = depth; } } - + $(this).toggleClass('inFieldGroup', thisLevel > 0); for(i = 1; i <= 5; i++) { $(this).toggleClass('inFieldGroup-level-'+i, thisLevel >= i); @@ -76,7 +76,7 @@ var self = this; this._super(); - + // When the 'Add field' button is clicked set a one time listener. // When the GridField is reloaded focus on the newly added field. this.on('addnewinline', function () { @@ -92,19 +92,11 @@ $newField.find('.col-Title input').focus(); } - // animate the row positioning (add the first class) - if (document.createElement('div').style.animationName !== void 0) { - $newField.addClass('newField'); + $newField.addClass('flashBackground'); + $(".cms-content-fields").scrollTop($(".cms-content-fields")[0].scrollHeight); + if($groupEnd) { + $groupEnd.css('visibility', 'visible'); } - - // Once the animation has completed - setTimeout(function () { - $newField.removeClass('newField').addClass('flashBackground'); - $(".cms-content-fields").scrollTop($(".cms-content-fields")[0].scrollHeight); - if($groupEnd) { - $groupEnd.css('visibility', 'visible'); - } - }, 500); }); }); }, diff --git a/client/src/bundles/Recipient.js b/client/src/bundles/Recipient.js index 0bae6bf..0e97c57 100644 --- a/client/src/bundles/Recipient.js +++ b/client/src/bundles/Recipient.js @@ -5,12 +5,11 @@ (function ($) { $(document).ready(function () { + var sendPlain = $('input[name="SendPlain"]'); var recipient = { // Some fields are only visible when HTML email are being sent. updateFormatSpecificFields: function () { - var sendPlainChecked = $('#SendPlain') - .find('input[type="checkbox"]') - .is(':checked'); + var sendPlainChecked = sendPlain.is(':checked'); $(".field.toggle-html-only")[sendPlainChecked ? 'hide' : 'show'](); $(".field.toggle-plain-only")[sendPlainChecked ? 'show' : 'hide'](); @@ -27,7 +26,7 @@ } }); - $('#SendPlain').entwine({ + sendPlain.entwine({ onchange: function () { recipient.updateFormatSpecificFields(); } diff --git a/client/src/styles/userforms-cms.scss b/client/src/styles/userforms-cms.scss index 814200c..a15abbc 100644 --- a/client/src/styles/userforms-cms.scss +++ b/client/src/styles/userforms-cms.scss @@ -2,11 +2,6 @@ * Animations */ -@keyframes rowSlide { - 0% {top: 20%;} - 100% {top: 80%;} -} - @keyframes flashBackground { 0% {background-color: white;} 10% {background-color: #dcfedd;} @@ -44,11 +39,6 @@ min-height: 46px; } - &.newField { - position: fixed; - animation: rowSlide .5s ease forwards; - } - &.flashBackground { animation: flashBackground 2s linear; } diff --git a/code/model/editableformfields/EditableCheckboxGroupField.php b/code/model/editableformfields/EditableCheckboxGroupField.php index c36f7fa..b78a66f 100755 --- a/code/model/editableformfields/EditableCheckboxGroupField.php +++ b/code/model/editableformfields/EditableCheckboxGroupField.php @@ -18,8 +18,9 @@ class EditableCheckboxGroupField extends EditableMultipleOptionField public function getFormField() { - $field = new UserFormsCheckboxSetField($this->Name, $this->EscapedTitle, $this->getOptionsMap()); - $field->setFieldHolderTemplate('UserFormsMultipleOptionField_holder'); + $field = UserFormsCheckboxSetField::create($this->Name, $this->EscapedTitle, $this->getOptionsMap()) + ->setFieldHolderTemplate('UserFormsMultipleOptionField_holder') + ->setTemplate('UserFormsCheckboxSetField'); // Set the default checked items $defaultCheckedItems = $this->getDefaultOptions(); diff --git a/code/model/editableformfields/EditableFileField.php b/code/model/editableformfields/EditableFileField.php index f272925..b81a1f2 100755 --- a/code/model/editableformfields/EditableFileField.php +++ b/code/model/editableformfields/EditableFileField.php @@ -45,10 +45,14 @@ class EditableFileField extends EditableFormField ) ); - $fields->addFieldToTab("Root.Main", new LiteralField("FileUploadWarning", - "
"), "Type"); + $fields->addFieldToTab("Root.Main", new LiteralField( + "FileUploadWarning", + " " + ), "Type"); $fields->addFieldToTab( 'Root.Main', @@ -57,6 +61,8 @@ class EditableFileField extends EditableFormField ->setDescription("Note: Maximum php allowed size is {$this->getPHPMaxFileSizeMB()} MB") ); + $fields->removeByName('Default'); + return $fields; } diff --git a/code/model/editableformfields/EditableRadioField.php b/code/model/editableformfields/EditableRadioField.php index 2129bb4..d58262b 100755 --- a/code/model/editableformfields/EditableRadioField.php +++ b/code/model/editableformfields/EditableRadioField.php @@ -28,8 +28,9 @@ class EditableRadioField extends EditableMultipleOptionField public function getFormField() { - $field = OptionsetField::create($this->Name, $this->EscapedTitle, $this->getOptionsMap()); - $field->setFieldHolderTemplate('UserFormsMultipleOptionField_holder'); + $field = OptionsetField::create($this->Name, $this->EscapedTitle, $this->getOptionsMap()) + ->setFieldHolderTemplate('UserFormsMultipleOptionField_holder') + ->setTemplate('UserFormsOptionSetField'); // Set default item $defaultOption = $this->getDefaultOptions()->first(); diff --git a/code/model/recipients/UserDefinedForm_EmailRecipient.php b/code/model/recipients/UserDefinedForm_EmailRecipient.php index 52ad3fd..a92deef 100644 --- a/code/model/recipients/UserDefinedForm_EmailRecipient.php +++ b/code/model/recipients/UserDefinedForm_EmailRecipient.php @@ -261,12 +261,9 @@ class UserDefinedForm_EmailRecipient extends DataObject ->addExtraClass('toggle-html-only'), TextareaField::create('EmailBody', _t('UserDefinedForm.EMAILBODY', 'Body')) ->addExtraClass('toggle-plain-only'), - LiteralField::create( - 'EmailPreview', - '