diff --git a/README.md b/README.md
index 1d35a1b..59a1188 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ This module extends the `TextField`, `TextareaField` and `HTMLEditorField` class
## Requirements
-SilverStripe 3.1+ (3.3 tested)
+SilverStripe 4.0+ (3.1+ in previous releases)
## Installation
@@ -16,10 +16,6 @@ SilverStripe 3.1+ (3.3 tested)
[Packagist listing](https://packagist.org/packages/jonom/silverstripe-text-target-length) and [installation instructions](http://doc.silverstripe.org/framework/en/trunk/installation/composer#adding-modules-to-your-project)
-### Manually
-
-I promise it's worth your time to learn how to use Composer. If painless updating isn't your thing though you can download and extract this project, rename the module folder 'text-target-length', place it in your project root and run a dev/build?flush=1.
-
## How to use
With the module installed you can call call `setTargetLength()` on `TextField`, `TextareaField` and `HTMLEditorField` form fields.
diff --git a/_config.php b/_config.php
index 8093b43..a4abe2d 100644
--- a/_config.php
+++ b/_config.php
@@ -1,6 +1,2 @@
owner;
$idealCharCount = (int)$idealCharCount;
- if (!$idealCharCount > 0) return $field;
+ if (!$idealCharCount > 0) return $field;
- // Set defaults
- if ($minCharCount === null) $minCharCount = round($idealCharCount * .75);
- if ($maxCharCount === null) $maxCharCount = round($idealCharCount * 1.25);
+ // Set defaults
+ if ($minCharCount === null) $minCharCount = round($idealCharCount * .75);
+ if ($maxCharCount === null) $maxCharCount = round($idealCharCount * 1.25);
- // Validate
- if (!($maxCharCount >= $idealCharCount && $idealCharCount >= $minCharCount)) return $field;
+ // Validate
+ if (!($maxCharCount >= $idealCharCount && $idealCharCount >= $minCharCount)) return $field;
- // Activate
- $field->addExtraClass('target-length');
- $field->setAttribute('data-target-ideal-length', $idealCharCount);
- $field->setAttribute('data-target-min-length', $minCharCount);
- $field->setAttribute('data-target-max-length', $maxCharCount);
+ // Activate
+ $field->addExtraClass('target-length');
+ $field->setAttribute('data-target-ideal-length', $idealCharCount);
+ $field->setAttribute('data-target-min-length', $minCharCount);
+ $field->setAttribute('data-target-max-length', $maxCharCount);
$field->setAttribute('data-hint-length-target', _t('TextTargetLength.LengthTarget', 'Length target: {value}% {remark}'));
$field->setAttribute('data-hint-length-tooshort', _t('TextTargetLength.LengthTooShort', 'Keep going!'));
@@ -41,11 +45,11 @@ public function setTargetLength($idealCharCount, $minCharCount = null, $maxCharC
$field->setAttribute('data-hint-length-adequate', _t('TextTargetLength.LengthAdequate', 'Okay'));
$field->setAttribute('data-hint-length-ideal', _t('TextTargetLength.LengthIdeal', 'Great!'));
- Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery/jquery.js');
- Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
- Requirements::javascript(TEXTTARGETLENGTH_DIR.'/javascript/text-target-length.js');
- Requirements::css(TEXTTARGETLENGTH_DIR.'/css/text-target-length.css');
+ Requirements::javascript('silverstripe/admin:thirdparty/jquery/jquery.js');
+ Requirements::javascript('silverstripe/admin:thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
+ Requirements::javascript('jonom/silverstripe-text-target-length:client/javascript/text-target-length.js');
+ Requirements::css('jonom/silverstripe-text-target-length:client/css/text-target-length.css');
- return $field;
- }
+ return $field;
+ }
}