-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a custom field-type `DBFocusPoint`. Move all focus point calculations into this class. Remove unneeded InterventionBackend. * Changed translation files to simply use the `db_FocusPoint` fieldname. * Changed FocusPointField to behave more like a normal FormField. * Renamed Test-class to open up naming possibilites for future test-classes :) * Implement migration task and auto-migration. * Added react component. * Update to CSS and SVG for gradient & crosshair. * Flipped Y-Coordinate to have consistent math (-1 top/left, 1 bottom/right). * Added more unit-tests. * Added documentation about the build-tools.
- Loading branch information
Showing
44 changed files
with
6,122 additions
and
713 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
.sass-cache | ||
.DS_Store | ||
npm-debug.log | ||
node_modules/ | ||
coverage/ | ||
/**/*.js.map | ||
/**/*.css.map | ||
artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
Name: focuspoint-fieldtypes | ||
After: corefieldtypes | ||
--- | ||
SilverStripe\Core\Injector\Injector: | ||
FocusPoint: | ||
class: JonoM\FocusPoint\FieldType\DBFocusPoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Build Tools | ||
|
||
This module uses [webpack](https://webpack.js.org/) to build JS and CSS files. | ||
This is in line with how the SilverStripe core-modules build their client-assets. | ||
|
||
## Writing CSS | ||
|
||
We use [SASS](http://sass-lang.com/) to write CSS. The build-tools include an auto-prefixer that will add browser-prefixes if needed. | ||
|
||
## Writing JavaScript | ||
|
||
JavaScript should be written as ES6. | ||
Plain JavaScript file should use the `.js` extension, while React components use `.jsx`. | ||
The files will be transpiled to a single (browser consumable) JavaScript file using webpack and babel. | ||
|
||
## Building JS and CSS | ||
|
||
First of all, you need to install the [yarn](https://yarnpkg.com/en/) package manager on your system. | ||
Then do the following: | ||
|
||
```bash | ||
cd ./vendor/jonom/focuspoint | ||
yarn | ||
``` | ||
|
||
This will install all the npm dependencies in `node_modules` | ||
|
||
#### Development | ||
|
||
During development, you can use the following command to create a development build: | ||
|
||
```bash | ||
yarn run dev | ||
``` | ||
|
||
There's also a "watch" command that will watch your files and build new JS and CSS every time you change a file: | ||
|
||
```bash | ||
yarn run watch | ||
``` | ||
|
||
#### Release | ||
|
||
To create a release build, do: | ||
|
||
```bash | ||
yarn run build | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* global document */ | ||
import React from 'react'; | ||
import Injector from 'lib/Injector'; | ||
import registerComponents from './registerComponents'; | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
registerComponents(); | ||
|
||
//TODO: Consider adding the focus-field directly at the UploadField level | ||
/* | ||
Injector.transform( | ||
'focuspoint-uploadfield', | ||
(updater) => { | ||
} | ||
); | ||
*/ | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Injector from 'lib/Injector'; | ||
import FocusPointField from 'components/FocusPointField'; | ||
import FocusPointPicker from 'components/FocusPointPicker'; | ||
|
||
const registerComponents = () => { | ||
Injector.component.register('FocusPointField', FocusPointField); | ||
Injector.component.register('FocusPointPicker', FocusPointPicker); | ||
}; | ||
|
||
export default registerComponents; |
Oops, something went wrong.