forked from directus/v8-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13538b0
commit a0e978b
Showing
6 changed files
with
54 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
define(['core/UIView'], function(UIView) { | ||
return UIView.extend({ | ||
prefix: 'customs/uis/' | ||
}); | ||
}); |
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,15 @@ | ||
<?php | ||
|
||
use Directus\Bootstrap; | ||
use Directus\View\JsonView; | ||
|
||
// Slim App | ||
$app = Bootstrap::get('app'); | ||
|
||
// Simple GET endpoint example | ||
$app->get('/example', function() { | ||
return JsonView::render([ | ||
'item 1', | ||
'item 2' | ||
]); | ||
}); |
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,2 +1,3 @@ | ||
* | ||
!.gitignore | ||
!.gitignore | ||
!_example |
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,29 @@ | ||
define(['core/UIComponent', 'core/BaseUIView'], function(UIComponent, UIView) { | ||
var charactersLimit = 100; | ||
var Input = UIView.extend({ | ||
template: '_example/templates/input', | ||
events: { | ||
'keyup textarea': 'updateCount' | ||
}, | ||
updateCount: function(event) { | ||
var textLength = event.currentTarget.value.length; | ||
var textRemaining = charactersLimit - textLength; | ||
this.$el.find('#count').text(textRemaining); | ||
}, | ||
serialize: function() { | ||
return { | ||
maxLength: charactersLimit, | ||
charactersRemaining: charactersLimit | ||
} | ||
} | ||
}); | ||
|
||
var Component = UIComponent.extend({ | ||
id: 'textlimit', | ||
dataTypes: ['TEXT'], | ||
Input: Input | ||
}); | ||
|
||
|
||
return Component; | ||
}); |
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,2 @@ | ||
<textarea maxLength="{{maxLength}}"></textarea> | ||
<span id="count">{{charactersRemaining}}</span> |