Skip to content
Snippets Groups Projects
Unverified Commit 8e60a2bd authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

add At.js and dependencies

parent 04fafdd5
No related branches found
No related tags found
No related merge requests found
Showing
with 2076 additions and 1 deletion
{
"directory": "js/vendor"
}
\ No newline at end of file
......@@ -27,6 +27,7 @@ $eventDispatcher->addListener(
function() {
\OCP\Util::addScript('oc-backbone-webdav');
\OCP\Util::addScript('comments', 'merged');
\OCP\Util::addStyle('comments', 'vendor/At.js/jquery.atwho.min');
\OCP\Util::addStyle('comments', 'comments');
}
);
......
.atwho-view{position:absolute;top:0;left:0;display:none;margin-top:18px;background:#fff;color:#000;border:1px solid #DDD;border-radius:3px;box-shadow:0 0 5px rgba(0,0,0,.1);min-width:120px;z-index:11110!important}.atwho-view .atwho-header{padding:5px;margin:5px;cursor:pointer;border-bottom:solid 1px #eaeff1;color:#6f8092;font-size:11px;font-weight:700}.atwho-view .atwho-header .small{color:#6f8092;float:right;padding-top:2px;margin-right:-5px;font-size:12px;font-weight:400}.atwho-view .atwho-header:hover{cursor:default}.atwho-view .cur{background:#36F;color:#fff}.atwho-view .cur small{color:#fff}.atwho-view strong{color:#36F}.atwho-view .cur strong{color:#fff;font:700}.atwho-view ul{list-style:none;padding:0;margin:auto;max-height:200px;overflow-y:auto}.atwho-view ul li{display:block;padding:5px 10px;border-bottom:1px solid #DDD;cursor:pointer}.atwho-view small{font-size:smaller;color:#777;font-weight:400}
\ No newline at end of file
......@@ -5,5 +5,7 @@
"commentsummarymodel.js",
"commentstabview.js",
"filesplugin.js",
"activitytabviewplugin.js"
"activitytabviewplugin.js",
"vendor/Caret.js/dist/jquery.caret.min.js",
"vendor/At.js/dist/js/jquery.atwho.min.js"
]
{
"name": "At.js",
"version": "1.5.4",
"main": [
"dist/js/jquery.atwho.js",
"dist/css/jquery.atwho.css"
],
"ignore": [
"**/.*",
"node_modules",
"components",
"libs",
"spec"
],
"dependencies": {
"jquery": ">=1.7.0",
"Caret.js": "~0.2.2"
},
"devDependencies": {
"jasmine-jquery": "~2.0.2"
},
"keywords": [
"mention",
"mentions",
"autocomplete",
"autocompletion",
"autosuggest",
"autosuggestion",
"atjs",
"at.js"
],
"homepage": "https://github.com/ichord/At.js",
"_release": "1.5.4",
"_resolution": {
"type": "version",
"tag": "v1.5.4",
"commit": "801c87dc804e37f134def2055b80cbc81ac98652"
},
"_source": "https://github.com/ichord/At.js.git",
"_target": "^1.5.4",
"_originalSource": "jquery.atwho",
"_direct": true
}
\ No newline at end of file
### v1.5.0
add `headerTpl` settings
* 7a41d93 - #375 from vcekov/fix_scroll_position - Valentin Cekov
* ecbf34f - #373 from vcekov/val/fix_key_navigation_interefence_with_mouse - Valentin Cekov
* b68cf84 - #364 from WorktileTech/master - Harold.Luo
* f836f04 - #372 from vcekov/fix_caret_for_space_after_@ - Harold.Luo
* 06cf6bb - Properly set caret position after failed match - Valentin Cekov
* c9ed2e2 - support header template. - htz
### v1.4.0
#### Contenteditable
Pressing `Backspace` will turn the inserted element back to the origin query 'moment'.
* 84edc9f - skip inserted element when moving left or right - ichord
* 25a61d3 - the jQuery npm package is now called jquery. Fixes #338 - Mick Staugaard
* 03ed71f - Merge pull request #351 from mociepka/master - Harold.Luo
* ae00dc3 - Point main script in package json - Michał Ociepka
* c5f31f5 - Merge branch 'dev' into HEAD - ichord
* c399397 - fix contenteditable cursor bug when typing "a" into query - ichord
* 7f4295a - fix previous replacements get clobbered when re-intering the inserted element - ichord
* f00fabd - Merge pull request #354 from lvegerano/master - Harold.Luo
* a42065e - Adds guard to event and dist file - Luis Vegerano
* e4aaa30 - Add option to disable loopUp on click - Luis Vegerano
* c9b7609 - Fix bug where callbacks would run before reaching minLen. Fixes #329. - Mike Leone
* f8692dc - Add support for minLen. Connects to issue #316. - Mike Leone
* fd7d298 - FIX: the value of `isSelecting` - ichord
* c374c93 - FIX: IME typing error - ichord
### v1.3.0
* 7f2189d - fix #294 inserts "" suffix in contenteditable
* bae95d9 - add `tabSelectsMatch` setting to make tab selection optional
* e966aba - Merge pull request #298 from kkirsche/patch-1 - Harold.Luo
* 9f78239 - Remove moot `version` property from bower.json - Kevin Kirsche
### v1.2.0
db09ac7 -> 886613f
* 886613f - add `$.fn.atwho.debug = false` to trigger debug mode
* 6567af9 - Enable default events when nothing is highlighted - Teemu
* 752ad4a - Add scrollDuration option. - Takuru
* bf17d43 - add parameter to allow for a spacebar in the middle of a search so that you can match a first + last name, for example - Feather Knee
* a1d5fe7 - add `reposition` API - ichord
* 9bcb06e - add "onInsert", "onDispaly" arguments to `tplEval` - ichord
* db09ac7 - add `hide` api - ichord
### v1.1.0
* lisafeather/displyTplCallBack - #259
* ADD: `editableAtwhoQueryAttrs` options
* Added setting for 'spaceSelectsMatch' (default false/off)
### v1.0.0
**The naming convention are using camel case**.
It means that every callback and setting's name are switched from underscope_naming to CamelNaming.
Sorry about this.
Future version's naming will follow the rules of http://semver.org constantly.
#### Options:
* Replaced `tpl` with `displayTpl`: display template of dropdown menu items.
In previous versions, At.js will fetch the value of `data-value` to insert; It stops doing it.
Please use the `insertTpl` option to manage the content to insert instead.
The default value is `"<li>${name}</li>"`
* The `insertTpl` option will be used in *textarea* as well.
The default value is `"${atwho-at}${name}"`
#### Callbacks:
* Added `afterMatchFailed` callback to *contentEditable*
It will be invoked after fail to match any query and stopping matching.
Open *examples/hashtas.html* to examine how it work.
* Removed `inserting_wrapper` callback to *contentEditable*
#### Internal changes:
* refactor the `Controller`
Introduced `EditableController` class to control actions of `contenteditable` element.
Introduced `TextareaController` class to control actions of `textarea` element.
Both of them are inherit from the `Controller` class.
* Refactored contentEditable mode
Inserted content are wrapped in a span: `<span class=".atwho-inserted"/>`
Querying content are wrapped in a span: `<span class=".atwho-query"/>`
* Bring back auto-discovery to iframe.
* Fix wrong offset in iframe
* Replaced `iframeStandalone` with `iframeAdRoot`
* All processed events are preventing default and stopping propagation.
### v0.5.2
* e1f6566 - fix error that doesn't display mention list on new line
* 8fe3a54 - can insert multiple node from `inserting_wrapper`
* 4080151 - scroll to top after showing
* 01555f8 - scroll long dropdown list
* 1b8999d - Add spm support
* f2b8e9c - change name in package.json
* b61bfdc - search on click
* b1efd09 - Fixes error with selecting always first item on the list on iOS WebView when using https://github.com/ftlabs/fastclick
* 7ed2890 - Allow accented characters in matcher
### v0.5.1
* 219de3d - fix Goes off screen / gets cropped if there isn't enough room
* 1100c5b - No longer inherits text colour from document
* ce60958 - on more boolean argument for `setIframe` api to work cross-document issues #199
### v0.5.0
* 593893c - refactor inserting of contenteditable
Adding `inserting_wrapper` for customize wrapping inserting content.
Not to insert item as a block in Firefox. check out issue #109.
Removing `getInsertedItems`, `getInsertedIDs` API. You have to collect them on your own.
* 4d3fb8f - have to set IFRAME manually
* 1f13a16 - change space_after to suffix
* b099ebb - fix caret position error after inserting
* 2c47d7a - fix #178 hide view while clicking somewhere else
### v0.4.12
* eeafab1 - fix error: will always call hidden atwho event
* b0f6ceb - Highlighter finds the first occurrence
* da256db - Adds possibility of having empty prefix (at keyword) in controllers
* b884225 - add `space_after` option
* 65d6273 - Passes esc/tab/return keyup events through to emitted hide event
### v0.4.11
* bf938db - add `delay` setting, support delay searching
* a0b5a6f - fix bug: terminate if query out of max_len
* 01d6d5b - add css min file
### v0.4.10
* update jquery dependence version
### v0.4.9
* f317bd7 not lowercase query, add `highlight_first` option
### v0.4.8
* 79bbef4 destroy atwho view container dom
* 0372d65 update bower and component keywords
* 52a41f5 add optional `before_repostion` callback
* cc1c239 Fixes #143 - ichord
### v0.4.7
* resolved #133, #135, #137.
* add `beforeDestroy` event
* wouldn't concat `caret.js` into `dist/js/jquery.atwho.js` any more.
* seperate `jquery.atwho.coffee` into pieces.
* seperate testing.
### v0.4.6
* 2d9ab23 fix `wrong document` error in IE iframe
### v0.4.5
* 664a765 support iframe
### v0.4.4
* 9ac7e75 - improve contentEditable for IE 8
It's still some bugs in IE 8, just DON'T use it
I don't want to spend more time on IE 8.
So it would be the ending fixup. And i will still leave related code for
a while maybe in case anyone want to help to improve it.
Just encourge your users to upgrate the browers or just switch to a
batter one please !!
* a8371b3 - move project page to master from gh-pages.
* 24b6225 - fix bugs #122
* 645e030 - update Caret.js to v0.0.5
### v0.4.3
* e8e7561 update `Caret.js` to `v0.0.4`
### v0.4.2
* 4169b74 - binding data storage to the inputor. issues #121
* 11d053f - reduse querying twice. issues#112
### v0.4.1
* b7721be - fix bug at view id was not been assign. close issues #99
* 407f069 - fix bug: Can not autofocus after click the at-list in FireFox. #95
* 917f033 - fix bug: click do not work in div-contenteditable. close issues #93
### v0.4.0
* update `Caret.js` to `v0.0.2`
* `contenteditable` support !!
* change content of default item template `tpl`
* new rule to insert the `at` : will always remove the `at` from inputor but will add it back from `tpl` in default.
so, if you are using your own `tpl` and want to show the `at` char, you have to do it yourself.
* add `insert_tpl` setting for `contenteditable`.
it will insert `data-value` of li element that eval from `tpl` in default.
* new APIs for `contenteditable`: `getInsertedItemsWithIDs`, `getInsertedItems`, `getInsertedIDs`
### 2013-08-07 - v0.3.2
* bower
* remove `Caret.js` codes and add it as bower dependencies
* remove `display_flag` settings.
* add `start_with_space` settings, default `true`
* change `super_call` function to `call_default`
### 2013-04-28
* release new api `load`, `run`
* add `alias` setting for `load` data or as the view's id
* matching key with a space before it
* register key in settings `{at: "@", data: []}` instead of being a argument
* `max_len` setting for max length to search
* change the default matcher regrex rule: occur at start of line or after whitespace
* will not sort the datay without valid query string
### 2013-04-23
* group all data handlers as `Model` class.
* All callbacks's context would be current `Controller`
### 2013-04-05
* `data` setting will be used to load data either local or remote. If it's String as URL it will preload data from remote by launch a ajax request (every times At.js call `reg` to update settings)
* remove default `remote_filter` from callbacks list.
* add `get_data` and `save_data` function to contoller. They are used to get and save whole data for At.js
* `save_data` will invoke `data_refactor` everytime
* will filter local data which is set in `settings` first and if it get nothing then call `remote_filter` if it's exists in callbacks list that is set by user.
### 2013-04
* remove ability of changing common setting after inputor binded
* can fix list view after matched query in IE now.
* separated core function (get offset of inputor) as a jquery plugins.
### v0.2.0 - 2012-12
**No more testing in IEs browsers.**
#### Note
The name `atWho` was changed to `atwho`.
#### New features
* Customer data handlers(matcher, filter, sorter) and template renders(highlight, template eval) by a group of configurable callbacks.
* Support **AMD**
#### Removed features
* Filter by local data and remote (by ajax) data at the same time.
* Caching
* Mouse event
#### Changed settings
`-` mean removed option
`+` mean new added option
The one that start without `-` or `+` mean not change.
* `-` data: [],
* `+` data: null,
* `-` choose: "data-value",
* `+` search_key: "name",
* `-` callback: null,
* `+` callbacks: DEFAULT_CALLBACKS,
* `+` display_timeout: 300,
* `-` tpl: _DEFAULT_TPL
* `+` tpl: DEFAULT_TPL
* `-` cache: false
Not change settings
* cache: true,
* limit: 5,
* display_flag: true,
### v0.1.7
同步 `jquery-atwho-rails` gem 的版本号
这会是 `v0.1` 的固定版本. 不再有新功能更新.
###v0.1.2 2012-3-23
* box showing above instead of bottom when it get close to the bottom of window
* coffeescript here is.
* every registered character able to have thire own options such as template(`tpl`)
* every inputor (textarea, input) able to have their own registered character and different behavior
even the same character to other inputor
###v0.1.0
* 可以監聽多個字符
multiple char listening.
* 顯示缺省列表.
show default list.
## Contributing
### Code style
**Two** space indent
### Modifying the code
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed.
Test that gulp is installed globally by running `grunt -v` at the command-line. If gulp isn't installed globally, run `npm install -g gulp` to install the latest version.
* Fork and clone the repo.
* Run `npm install` and `bower install` to install all dev dependencies (including grunt).
* Modify the `*.coffee` file.
* Run `gulp` to build this project.
Assuming that you don't see any red, you're ready to go. Just be sure to run `gulp` after making any changes, to ensure that nothing is broken.
### Submitting pull requests
1. Create a new branch, please don't work in your `master` branch directly.
1. Add failing tests for the change you want to make. Run `gulp` to see the tests fail.
1. Fix stuff.
1. Run `gulp` to see if the tests pass. Repeat steps 2-4 until done.
1. Open `_SpecRunner.html` unit test file(s) in actual browser to ensure tests pass everywhere.
1. Update the documentation to reflect any changes.
1. Push to your fork and submit a pull request.
### notes
Please don't edit files in the `dist` subdirectory and *.js files in `src` as they are generated via gulp.
You'll find source code in the `src` subdirectory!
use `bower install` or `component install` to install dependencies first.
### PhantomJS
While gulp can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `_SpecRunner.html` unit test file(s) in _actual_ browsers.
Copyright (c) 2013 chord.luo@gmail.com
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
**An autocompletion library to autocomplete mentions, smileys etc. just like on Github!**
[![Build Status](https://travis-ci.org/ichord/At.js.png)](https://travis-ci.org/ichord/At.js)
#### Notice
At.js now **depends on** [Caret.js](https://github.com/ichord/Caret.js).
Please read [**CHANGELOG.md**](CHANGELOG.md) for more details if you are going to update to new version.
### Demo
http://ichord.github.com/At.js
### Documentation
https://github.com/ichord/At.js/wiki
### Compatibility
* `textarea` - Chrome, Safari, Firefox, IE7+ (maybe IE6)
* `contentEditable` - Chrome, Safari, Firefox, IE9+
### Features Preview
* Support IE 7+ for **textarea**.
* Supports HTML5 [**contentEditable**](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_Editable) elements (NOT including IE 8)
* Can listen to any character and not just '@'. Can set up multiple listeners for different characters with different behavior and data
* Listener events can be bound to multiple inputors.
* Format returned data using templates
* Keyboard controls in addition to mouse
- `Tab` or `Enter` keys select the value
- `Up` and `Down` navigate between values (and `Ctrl-P` and `Ctrl-N` also)
- `Right` and `left` will re-search the keyword.
* Custom data handlers and template renderers using a group of configurable callbacks
* Supports AMD
### Requirements
* jQuery >= 1.7.0.
* [Caret.js](https://github.com/ichord/Caret.js)
(You can use `Component` or `Bower` to install it.)
### Integrating with your Application
Simply include the following files in your HTML and you are good to go.
```html
<link href="css/jquery.atwho.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/jquery.caret.js"></script>
<script src="js/jquery.atwho.js"></script>
```
```javascript
$('#inputor').atwho({
at: "@",
data:['Peter', 'Tom', 'Anne']
})
```
#### Bower & Component
For installing using Bower you can use `jquery.atwho` and for Component please use `ichord/At.js`.
#### Rails
You can include At.js in your `Rails` application using the gem [jquery-atwho-rails](https://github.com/ichord/jquery-atwho-rails).
### Core Team Members
* [@ichord](https://twitter.com/_ichord) (twitter)
{
"name": "At.js",
"version": "1.5.4",
"main": [
"dist/js/jquery.atwho.js",
"dist/css/jquery.atwho.css"
],
"ignore": [
"**/.*",
"node_modules",
"components",
"libs",
"spec"
],
"dependencies": {
"jquery": ">=1.7.0",
"Caret.js": "~0.2.2"
},
"devDependencies": {
"jasmine-jquery": "~2.0.2"
},
"keywords": [
"mention",
"mentions",
"autocomplete",
"autocompletion",
"autosuggest",
"autosuggestion",
"atjs",
"at.js"
]
}
{
"name": "At.js",
"repo": "ichord/At.js",
"description": "Add Github like mentions autocomplete to your application.",
"version": "1.5.4",
"demo": "http://ichord.github.com/At.js",
"dependencies": {
"ichord/Caret.js": "~0.2.2",
"component/jquery": ">= 1.7.0"
},
"main": [
"dist/js/jquery.atwho.js"
],
"scripts": [
"dist/js/jquery.atwho.js"
],
"styles": [
"dist/css/jquery.atwho.css"
],
"license": "MIT",
"keywords": [
"mentions",
"ui",
"mentions",
"autocomplete",
"autocompletion",
"autosuggest",
"autosuggestion",
"atjs",
"at.js"
]
}
\ No newline at end of file
.atwho-view {
position:absolute;
top: 0;
left: 0;
display: none;
margin-top: 18px;
background: white;
color: black;
border: 1px solid #DDD;
border-radius: 3px;
box-shadow: 0 0 5px rgba(0,0,0,0.1);
min-width: 120px;
z-index: 11110 !important;
}
.atwho-view .atwho-header {
padding: 5px;
margin: 5px;
cursor: pointer;
border-bottom: solid 1px #eaeff1;
color: #6f8092;
font-size: 11px;
font-weight: bold;
}
.atwho-view .atwho-header .small {
color: #6f8092;
float: right;
padding-top: 2px;
margin-right: -5px;
font-size: 12px;
font-weight: normal;
}
.atwho-view .atwho-header:hover {
cursor: default;
}
.atwho-view .cur {
background: #3366FF;
color: white;
}
.atwho-view .cur small {
color: white;
}
.atwho-view strong {
color: #3366FF;
}
.atwho-view .cur strong {
color: white;
font:bold;
}
.atwho-view ul {
/* width: 100px; */
list-style:none;
padding:0;
margin:auto;
max-height: 200px;
overflow-y: auto;
}
.atwho-view ul li {
display: block;
padding: 5px 10px;
border-bottom: 1px solid #DDD;
cursor: pointer;
/* border-top: 1px solid #C8C8C8; */
}
.atwho-view small {
font-size: smaller;
color: #777;
font-weight: normal;
}
.atwho-view{position:absolute;top:0;left:0;display:none;margin-top:18px;background:#fff;color:#000;border:1px solid #DDD;border-radius:3px;box-shadow:0 0 5px rgba(0,0,0,.1);min-width:120px;z-index:11110!important}.atwho-view .atwho-header{padding:5px;margin:5px;cursor:pointer;border-bottom:solid 1px #eaeff1;color:#6f8092;font-size:11px;font-weight:700}.atwho-view .atwho-header .small{color:#6f8092;float:right;padding-top:2px;margin-right:-5px;font-size:12px;font-weight:400}.atwho-view .atwho-header:hover{cursor:default}.atwho-view .cur{background:#36F;color:#fff}.atwho-view .cur small{color:#fff}.atwho-view strong{color:#36F}.atwho-view .cur strong{color:#fff;font:700}.atwho-view ul{list-style:none;padding:0;margin:auto;max-height:200px;overflow-y:auto}.atwho-view ul li{display:block;padding:5px 10px;border-bottom:1px solid #DDD;cursor:pointer}.atwho-view small{font-size:smaller;color:#777;font-weight:400}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html>
<html>
<head>
<title>Data Iframe</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ichord.github.io/Caret.js/src/jquery.caret.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.atwho.js"></script>
<script type="text/javascript">
$(function(){
var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你"];
var names = $.map(names,function(value,i) {
return {'id':i,'name':value,'email':value+"@email.com"};
});
viewFrame = parent.frames.viewFrame
var at_config = {
at: "@",
data: names,
displayTpl: "<li>${name} <small>${email}</small></li>"
}
$(viewFrame.document.body)
.atwho('setIframe', viewFrame.frameElement, true)
.atwho(at_config);
});
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="x-ua-compatible" content="IE=Edge"/>
<title>At.js</title>
<style type="text/css">
html, body {
background:#F9F9F9;
padding: 0;
margin: 0;
font: 14px/1.6 "Lucida Grande", "Helvetica", sans-serif;
color: #333;
}
h1,h2,h3,h4 {
font-family: 'PT Sans', sans-serif;
line-height: 40px;
color: inherit;
font-weight: bold;
margin: 10px 0;
text-rendering: optimizelegibility;
}
h2,h3 {
color: gray;
}
strong {
color: #424242;
}
a {
color: #4183C4;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.wrapper {
width: 750px;
padding: 20px;
margin: 0 auto;
}
header {
margin-top:70px;
margin-bottom: 50px;
}
header h1 {
text-align: center;
font-size: 75px;
}
h1 i {
color: rgb(182, 180, 180);
font-style: normal;
font-weight: normal;
}
.inputor {
height: 260px;
width: 90%;
border: 1px solid #dadada;
border-radius: 4px;
padding: 5px 8px;
outline: 0 none;
margin: 10px 0;
background: white;
font-size: inherit;
overflow-y: scroll;
}
.inputor:focus {
border: 1px solid rgb(6, 150, 247);
}
footer {
margin: 30px 0;
}
</style>
</head>
<body>
<div class="container wrapper">
<header>
<h1>At<i>.js</i></h1>
</header>
<div id="main">
<h2>Cross-Document</h2>
<iframe name="dataFrame" src="dataFrame.html" style="display:none;"></iframe>
<iframe name="viewFrame" class="inputor" src="viewFrame.html"></iframe>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>View Iframe</title>
<link rel="stylesheet" href="../../dist/css/jquery.atwho.css" />
</head>
<body contenteditable=true style="height: 100%;">
<p>hello!</p>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="x-ua-compatible" content="IE=Edge"/>
<title>At.js</title>
<link rel="stylesheet" href="../dist/css/jquery.atwho.css" />
<link rel="stylesheet" href="./style.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ichord.github.io/Caret.js/src/jquery.caret.js"></script>
<!-- // <script type="text/javascript" src="../bower_components/jquery/dist/jquery.js"></script> -->
<!-- // <script type="text/javascript" src="../bower_components/Caret.js/dist/jquery.caret.js"></script> -->
<script type="text/javascript" src="../dist/js/jquery.atwho.js"></script>
<script type="text/javascript">
$(function(){
var jeremy = decodeURI("J%C3%A9r%C3%A9my") // Jérémy
var tags = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", jeremy];
$('#editable').atwho({
at: "#",
data: tags,
limit: 200,
callbacks: {
afterMatchFailed: function(at, el) {
// 32 is spacebar
if (at == '#') {
tags.push(el.text().trim().slice(1));
this.model.save(tags);
this.insert(el.text().trim());
return false;
}
}
}
});
});
</script>
<style type="text/css">
/*override atwho's style*/
.atwho-inserted {
color: #4183C4;
}
.atwho-query {
color: #4183C4;
}
</style>
</head>
<body>
<div class="container wrapper">
<header>
<h3>Type `#` to autocomplete tags</h3>
</header>
<div id="main">
<div id="editable" class="inputor" contentEditable="true"></div>
<footer>
<h2>
-> <a class="github" href="https://github.com/ichord/At.js">Fork me on GitHub!</a>
</h2>
</footer>
</div>
</div>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="x-ua-compatible" content="IE=Edge"/>
<title>At.js</title>
<link rel="stylesheet" href="../dist/css/jquery.atwho.css" />
<link rel="stylesheet" type="text/css" href="http://dfimg.com/medium-editor/dist/css/medium-editor.css">
<link rel="stylesheet" type="text/css" href="http://dfimg.com/medium-editor/dist/css/themes/default.css">
<link rel="stylesheet" href="./style.css" />
<!-- // <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> -->
<!-- // <script type="text/javascript" src="http://ichord.github.io/Caret.js/src/jquery.caret.js"></script> -->
<script type="text/javascript" src="../bower_components/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../bower_components/Caret.js/dist/jquery.caret.js"></script>
<script type="text/javascript" src="../dist/js/jquery.atwho.js"></script>
<script src="http://dfimg.com/medium-editor/dist/js/medium-editor.js"></script>
<script type="text/javascript">
$(function(){
var jeremy = decodeURI("J%C3%A9r%C3%A9my") // Jérémy
var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", jeremy];
var editor = new MediumEditor('#editor');
$('#editor').atwho({at: "@", data: names});
});
</script>
</head>
<body>
<div class="container wrapper">
<header>
<h3>Example for medium-editor</h3>
</header>
<div id="main">
<div id="editor" contentEditable>Easy! You should check out MoxieManager!</div>
<footer>
<h2>
-> <a class="github" href="https://github.com/ichord/At.js">Fork me on GitHub!</a>
</h2>
</footer>
</div>
</div>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment