Merge pull request #38 from nextcloud/UpdateDependencies
Update dependencies
This commit is contained in:
commit
ede9f5fdd2
58 changed files with 2116 additions and 1678 deletions
1
Makefile
1
Makefile
|
@ -185,7 +185,6 @@ appstore:
|
|||
--exclude=/js/vendor/angular-ui-select/composer.json \
|
||||
--exclude=/js/vendor/angular-ui-select/deploy-docs.sh \
|
||||
--exclude=/js/vendor/jstzdetect/jstz.js \
|
||||
--exclude=/js/vendor/davclient.js/index.html \
|
||||
--exclude=/js/vendor/ical.js/build/benchmark \
|
||||
--exclude=/js/vendor/ical.js/lib \
|
||||
--exclude=/js/vendor/ical.js/samples \
|
||||
|
|
|
@ -26,7 +26,7 @@ module.exports = function(grunt) {
|
|||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-wrap');
|
||||
grunt.loadNpmTasks('grunt-karma');
|
||||
// grunt.loadNpmTasks('grunt-karma');
|
||||
|
||||
grunt.initConfig({
|
||||
meta: {
|
||||
|
@ -93,8 +93,8 @@ module.exports = function(grunt) {
|
|||
}
|
||||
}
|
||||
});
|
||||
grunt.registerTask('ci', ['karma:continuous']);
|
||||
grunt.registerTask('js', ['concat', 'wrap']);
|
||||
// grunt.registerTask('ci', ['karma:continuous']);
|
||||
grunt.registerTask('js', ['concat']);
|
||||
grunt.registerTask('default', 'js');
|
||||
grunt.registerTask('build', ['concat', 'wrap']);
|
||||
grunt.registerTask('build', ['concat']);
|
||||
};
|
||||
|
|
|
@ -63,18 +63,18 @@ angular.module('Tasks').factory('Request', [
|
|||
if (defaultConfig.method === 'GET') {
|
||||
defaultConfig.params = defaultConfig.data;
|
||||
}
|
||||
return this.$http(defaultConfig).success((function(_this) {
|
||||
return function(data, status, headers, config) {
|
||||
return this.$http(defaultConfig).then((function(_this) {
|
||||
return function(response) {
|
||||
var name, ref, value;
|
||||
ref = data.data;
|
||||
ref = response.data.data;
|
||||
for (name in ref) {
|
||||
value = ref[name];
|
||||
_this.publisher.publishDataTo(value, name);
|
||||
}
|
||||
return defaultData.onSuccess(data, status, headers, config);
|
||||
return defaultData.onSuccess(response.data, response.status, response.headers, response.config);
|
||||
};
|
||||
})(this)).error(function(data, status, headers, config) {
|
||||
return defaultData.onFailure(data, status, headers, config);
|
||||
})(this)).catch(function(response) {
|
||||
return defaultData.onFailure(response.data, response.status, response.headers, response.config);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -6,12 +6,11 @@
|
|||
"angular-route": "1.5.5",
|
||||
"angular-animate": "1.5.5",
|
||||
"angular-sanitize": "1.5.5",
|
||||
"angular-ui-select": "https://github.com/angular-ui/ui-select.git#v0.17.0",
|
||||
"angular-draganddrop": "https://github.com/marceljuenemann/angular-drag-and-drop-lists.git#v1.4.0",
|
||||
"angular-ui-select": "https://github.com/angular-ui/ui-select.git#v0.19.8",
|
||||
"angular-draganddrop": "https://github.com/marceljuenemann/angular-drag-and-drop-lists.git#v2.1.0",
|
||||
"jquery-timepicker": "",
|
||||
"ical.js": "~1.1.2",
|
||||
"jstzdetect": "",
|
||||
"davclient.js": "https://github.com/evert/davclient.js.git"
|
||||
"ical.js": "~1.2.2",
|
||||
"jstzdetect": ""
|
||||
},
|
||||
"devDependencies": {},
|
||||
"homepage": "https://github.com/nextcloud/tasks",
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/**
|
||||
* Nextcloud - Tasks - v0.9.5
|
||||
*
|
||||
|
@ -4652,18 +4651,18 @@ angular.module('Tasks').factory('Request', [
|
|||
if (defaultConfig.method === 'GET') {
|
||||
defaultConfig.params = defaultConfig.data;
|
||||
}
|
||||
return this.$http(defaultConfig).success((function(_this) {
|
||||
return function(data, status, headers, config) {
|
||||
return this.$http(defaultConfig).then((function(_this) {
|
||||
return function(response) {
|
||||
var name, ref, value;
|
||||
ref = data.data;
|
||||
ref = response.data.data;
|
||||
for (name in ref) {
|
||||
value = ref[name];
|
||||
_this.publisher.publishDataTo(value, name);
|
||||
}
|
||||
return defaultData.onSuccess(data, status, headers, config);
|
||||
return defaultData.onSuccess(response.data, response.status, response.headers, response.config);
|
||||
};
|
||||
})(this)).error(function(data, status, headers, config) {
|
||||
return defaultData.onFailure(data, status, headers, config);
|
||||
})(this)).catch(function(response) {
|
||||
return defaultData.onFailure(response.data, response.status, response.headers, response.config);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -4945,4 +4944,3 @@ angular.module('Tasks').service('VTodoService', ['DavClient', 'RandomStringServi
|
|||
// };
|
||||
|
||||
}]);
|
||||
|
||||
|
|
12
js/vendor/angular-draganddrop/.bower.json
vendored
12
js/vendor/angular-draganddrop/.bower.json
vendored
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"name": "angular-drag-and-drop-lists",
|
||||
"main": "angular-drag-and-drop-lists.js",
|
||||
"version": "1.4.0",
|
||||
"version": "2.1.0",
|
||||
"homepage": "https://github.com/marceljuenemann/angular-drag-and-drop-lists",
|
||||
"authors": [
|
||||
"Marcel Juenemann <mail@marcel-juenemann.de>"
|
||||
"Marcel Juenemann <marcel@juenemann.cc>"
|
||||
],
|
||||
"description": "Angular directives for sorting nested lists using the HTML5 Drag & Drop API",
|
||||
"keywords": [
|
||||
|
@ -27,13 +27,13 @@
|
|||
"test",
|
||||
"tests"
|
||||
],
|
||||
"_release": "1.4.0",
|
||||
"_release": "2.1.0",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.4.0",
|
||||
"commit": "141e13919b30578ed53d079bdd269fb99b20f78f"
|
||||
"tag": "2.1.0",
|
||||
"commit": "7e98e194a8d66fa735bf6dc7c3e39886287b914e"
|
||||
},
|
||||
"_source": "https://github.com/marceljuenemann/angular-drag-and-drop-lists.git",
|
||||
"_target": "v1.4.0",
|
||||
"_target": "v2.1.0",
|
||||
"_originalSource": "https://github.com/marceljuenemann/angular-drag-and-drop-lists.git"
|
||||
}
|
41
js/vendor/angular-draganddrop/CHANGELOG.md
vendored
41
js/vendor/angular-draganddrop/CHANGELOG.md
vendored
|
@ -1,3 +1,42 @@
|
|||
# 2.1.0 (2017-01-15)
|
||||
|
||||
## Changes
|
||||
|
||||
- **Custom callbacks with dnd-callback**: The new `dnd-callback` attribute allows for communication between the source and target scopes. For example, this can be used to access information about the object being dragged during dragover, or to transfer objects without serialization, which allows to use complex objects that contain functions references and prototypes. [Demo](https://jsfiddle.net/Ldxffyod/1/)
|
||||
- **Drop effects fixed and extended**: Most of the bugs around drop effect have been fixed. You can now use move, copy and link, or a combination of them. Drop effects can be restricted using `dnd-effect-allowed` on both the source and target element, and if there are multiple options, the user can choose one using modifier keys (Ctrl or Alt). See the [design document](https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Drop-Effects-Design) for more details. Drop effects don't work on IE9. They do work accross browser tabs if `dnd-external-sources` is activated, although the source restrictions are lost in Safari and IE.
|
||||
- **New dragleave handler**: Previously, the dragleave handler used a timeout to determine whether the placeholder needs to be removed from a `dnd-list`. The new implementation utilizes `document.elementFromPoint` to determine whether the mouse cursor is outside the target list.
|
||||
- **Remove dndDraggingSource without timeout**: Fixes problems with ngAnimate (#121).
|
||||
|
||||
## Tested browsers
|
||||
|
||||
- Chrome 55 (Mac, Ubuntu & Windows 7)
|
||||
- Firefox 50 (Ubuntu)
|
||||
- Safari 10 (MacOS)
|
||||
- Microsoft Edge 20 (Windows 10 emulator)
|
||||
- Internet Explorer 11 (Windows 7)
|
||||
- Internet Explorer 9 (Windows 7 emulator)
|
||||
|
||||
|
||||
# 2.0.0 (2016-12-25)
|
||||
|
||||
## Changes
|
||||
|
||||
There have been some major changes to how the directive works internally, although these changes should not affect users of the library.
|
||||
|
||||
- **Simpler placeholder positioning algorithm**: The logic for placeholder positiong is unchanged, i.e. the placeholder will be placed after an element if the mouse cursor is in the second half of the element it is hovering over, otherwise it is placed before it. However, the implementation of this algorithm was massively simplified by using `getBoundingClientRect`. As a result, developers are no longer required to have `position: relative` on the list and list item elements.
|
||||
- **New dataTransfer algorithm**: The directive now uses custom mime types in modern browsers, and falls back to using `Text` in non-standard comform browsers. As a result, dragged elements can no longer be dropped into arbitrary input fields. More details on how this works can be found in the [design document](https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Data-Transfer-Design). **Breaking change:** As mime types are used, all dnd-type attributes are automatically converted to lower case.
|
||||
- **Internal test infrastructure**: The mocks used for drag and drop events in unit tests are now much nicer.
|
||||
|
||||
## Tested browsers
|
||||
|
||||
- Chrome 55 (Mac, Ubuntu & Windows 10)
|
||||
- Firefox 50 (Ubuntu)
|
||||
- Safari 10 (Mac)
|
||||
- Microsoft Edge 20 (Windows 10)
|
||||
- Internet Explorer 11 (Windows 10)
|
||||
- Internet Explorer 9 (Windows Vista)
|
||||
|
||||
|
||||
# 1.4.0 (2016-02-06)
|
||||
|
||||
## Features
|
||||
|
@ -98,7 +137,7 @@ Initial release
|
|||
- bower.json
|
||||
- package.json
|
||||
- JS files
|
||||
- Minify and test (npm run-script minify)
|
||||
- Minify and test (npm run-script minify, check semicolon at EOF)
|
||||
- Test different OS & browsers (npm start)
|
||||
- Update README and CHANGELOG
|
||||
- Merge to master
|
||||
|
|
70
js/vendor/angular-draganddrop/README.md
vendored
70
js/vendor/angular-draganddrop/README.md
vendored
|
@ -18,31 +18,27 @@ Internet Explorer 8 or lower is *not supported*, but all modern browsers are (se
|
|||
|
||||
|
||||
## Download & Installation
|
||||
Download `angular-drag-and-drop-lists.js` (or the minified version) and include it in your application. If you use bower, you can of course just add it via bower. Add the `dndLists` module as dependency to your angular app.
|
||||
* Download `angular-drag-and-drop-lists.js` (or the minified version) and include it in your application. If you use bower or npm, just include the `angular-drag-and-drop-lists` package.
|
||||
* Add the `dndLists` module as a dependency to your angular app.
|
||||
|
||||
## dnd-draggable directive
|
||||
Use the dnd-draggable directive to make your element draggable
|
||||
|
||||
**Attributes**
|
||||
* `dnd-draggable` Required attribute. The value has to be an object that represents the data of the element. In case of a drag and drop operation the object will be serialized and unserialized on the receiving end.
|
||||
* `dnd-effect-allowed` Use this attribute to limit the operations that can be performed. Options are:
|
||||
* `move` The drag operation will move the element. This is the default
|
||||
* `copy` The drag operation will copy the element. There will be a copy cursor.
|
||||
* `copyMove` The user can choose between copy and move by pressing the ctrl or shift key.
|
||||
* *Not supported in IE:* In Internet Explorer this option will be the same as `copy`.
|
||||
* *Not fully supported in Chrome on Windows:* In the Windows version of Chrome the cursor will always be the move cursor. However, when the user drops an element and has the ctrl key pressed, we will perform a copy anyways.
|
||||
* HTML5 also specifies the `link` option, but this library does not actively support it yet, so use it at your own risk.
|
||||
* [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-type` Use this attribute if you have different kinds of items in your application and you want to limit which items can be dropped into which lists. Combine with dnd-allowed-types on the dnd-list(s). This attribute should evaluate to a string, although this restriction is not enforced (at the moment). [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
* `dnd-disable-if` You can use this attribute to dynamically disable the draggability of the element. This is useful if you have certain list items that you don't want to be draggable, or if you want to disable drag & drop completely without having two different code branches (e.g. only allow for admins). *Note*: If your element is not draggable, the user is probably able to select text or images inside of it. Since a selection is always draggable, this breaks your UI. You most likely want to disable user selection via CSS (see [user-select](http://stackoverflow.com/a/4407335)). [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
* `dnd-effect-allowed` Use this attribute to limit the operations that can be performed. Valid options are `move`, `copy` and `link`, as well as `all`, `copyMove`, `copyLink` and `linkMove`, while `move` is the default value. The semantics of these operations are up to you and have to be implemented using the callbacks described below. If you allow multiple options, the user can choose between them by using the modifier keys (OS specific). The cursor will be changed accordingly, expect for IE and Edge, where this is not supported. Note that the implementation of this attribute is very buggy in IE9. This attribute works together with `dnd-external-sources` except on Safari and IE, where the restriction will be lost when dragging accross browser tabs. [Design document](https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Drop-Effects-Design) [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-type` Use this attribute if you have different kinds of items in your application and you want to limit which items can be dropped into which lists. Combine with dnd-allowed-types on the dnd-list(s). This attribute must be a lower case string. Upper case characters can be used, but will be converted to lower case automatically. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
* `dnd-disable-if` You can use this attribute to dynamically disable the draggability of the element. This is useful if you have certain list items that you don't want to be draggable, or if you want to disable drag & drop completely without having two different code branches (e.g. only allow for admins). [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
|
||||
**Callbacks**
|
||||
* `dnd-dragstart` Callback that is invoked when the element was dragged. The original dragstart event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-moved` Callback that is invoked when the element was moved. Usually you will remove your element from the original list in this callback, since the directive is not doing that for you automatically. The original dragend event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-copied` Same as dnd-moved, just that it is called when the element was copied instead of moved. The original dragend event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-linked` Same as dnd-moved, just that it is called when the element was linked instead of moved. The original dragend event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-canceled` Callback that is invoked if the element was dragged, but the operation was canceled and the element was not dropped. The original dragend event will be provided in the local event variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-dragstart` Callback that is invoked when the element was dragged. The original dragstart event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-dragend` Callback that is invoked when the drag operation ended. Available local variables are `event` and `dropEffect`. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-selected` Callback that is invoked when the element was clicked but not dragged. The original click event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/nested)
|
||||
* `dnd-callback` Custom callback that is passed to dropzone callbacks and can be used to communicate between source and target scopes. The dropzone can pass user defined variables to this callback. This can be used to transfer objects without serialization, see [Demo](https://jsfiddle.net/Ldxffyod/1/).
|
||||
|
||||
**CSS classes**
|
||||
* `dndDragging` This class will be added to the element while the element is being dragged. It will affect both the element you see while dragging and the source element that stays at it's position. Do not try to hide the source element with this class, because that will abort the drag operation.
|
||||
|
@ -50,33 +46,29 @@ Use the dnd-draggable directive to make your element draggable
|
|||
|
||||
## dnd-list directive
|
||||
|
||||
Use the dnd-list attribute to make your list element a dropzone. Usually you will add a single li element as child with the ng-repeat directive. If you don't do that, we will not be able to position the dropped element correctly. If you want your list to be sortable, also add the dnd-draggable directive to your li element(s). Both the dnd-list and it's direct children must have position: relative CSS style, otherwise the positioning algorithm will not be able to determine the correct placeholder position in all browsers.
|
||||
Use the dnd-list attribute to make your list element a dropzone. Usually you will add a single li element as child with the ng-repeat directive. If you don't do that, we will not be able to position the dropped element correctly. If you want your list to be sortable, also add the dnd-draggable directive to your li element(s).
|
||||
|
||||
**Attributes**
|
||||
* `dnd-list` Required attribute. The value has to be the array in which the data of the dropped element should be inserted.
|
||||
* `dnd-allowed-types` Optional array of allowed item types. When used, only items that had a matching dnd-type attribute will be dropable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
* `dnd-list` Required attribute. The value has to be the array in which the data of the dropped element should be inserted. The value can be blank if used with a custom dnd-drop handler that handles the insertion on its own.
|
||||
* `dnd-allowed-types` Optional array of allowed item types. When used, only items that had a matching dnd-type attribute will be dropable. Upper case characters will automatically be converted to lower case. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
* `dnd-effect-allowed` Optional string expression that limits the drop effects that can be performed on the list. See dnd-effect-allowed on dnd-draggable for more details on allowed options. The default value is `all`.
|
||||
* `dnd-disable-if` Optional boolean expression. When it evaluates to true, no dropping into the list is possible. Note that this also disables rearranging items inside the list. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
* `dnd-horizontal-list` Optional boolean expression. When it evaluates to true, the positioning algorithm will use the left and right halfs of the list items instead of the upper and lower halfs. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-external-sources` Optional boolean expression. When it evaluates to true, the list accepts drops from sources outside of the current browser tab. This allows to drag and drop accross different browser tabs. Note that this will allow to drop arbitrary text into the list, thus it is highly recommended to implement the dnd-drop callback to check the incoming element for sanity. Furthermore, the dnd-type of external sources can not be determined, therefore do not rely on restrictions of dnd-allowed-type. Also note that this feature does not work very well in Internet Explorer. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-external-sources` Optional boolean expression. When it evaluates to true, the list accepts drops from sources outside of the current browser tab, which allows to drag and drop accross different browser tabs. The only major browser for which this is currently not working is Microsoft Edge. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
|
||||
**Callbacks**
|
||||
* `dnd-dragover` Optional expression that is invoked when an element is dragged over the list. If the expression is set, but does not return true, the element is not allowed to be dropped. The following variables will be available:
|
||||
* `event` The original dragover event sent by the browser.
|
||||
* `index` The position in the list at which the element would be dropped.
|
||||
* `type` The `dnd-type` set on the dnd-draggable, or undefined if unset.
|
||||
* `type` The `dnd-type` set on the dnd-draggable, or undefined if unset. Will be null for drops from external sources in IE and Edge, since we don't know the type in those cases.
|
||||
* `external` Whether the element was dragged from an external source. See `dnd-external-sources`.
|
||||
* `dropEffect` The dropEffect that is going to be performed, see dnd-effect-allowed.
|
||||
* `callback` If dnd-callback was set on the source element, this is a function reference to the callback. The callback can be invoked with custom variables like this: `callback({var1: value1, var2: value2})`. The callback will be executed on the scope of the source element. If dnd-external-sources was set and external is true, this callback will not be available.
|
||||
* [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-drop` Optional expression that is invoked when an element is dropped on the list.
|
||||
* The following variables will be available:
|
||||
* `event` The original drop event sent by the browser.
|
||||
* `index` The position in the list at which the element would be dropped.
|
||||
* `item` The transferred object.
|
||||
* `type` The dnd-type set on the dnd-draggable, or undefined if unset.
|
||||
* `external` Whether the element was dragged from an external source. See `dnd-external-sources`.
|
||||
* The return value determines the further handling of the drop:
|
||||
* `false` The drop will be canceled and the element won't be inserted.
|
||||
* `true` Signalises that the drop is allowed, but the dnd-drop callback will take care of inserting the element.
|
||||
* Otherwise: All other return values will be treated as the object to insert into the array. In most cases you simply want to return the `item` parameter, but there are no restrictions on what you can return.
|
||||
* `dnd-drop` Optional expression that is invoked when an element is dropped on the list. The same variables as for dnd-dragover will be available, with the exception that type is always known and therefore never null. There will also be an `item` variable, which is the transferred object. The return value determines the further handling of the drop:
|
||||
* `falsy` The drop will be canceled and the element won't be inserted.
|
||||
* `true` Signalises that the drop is allowed, but the dnd-drop callback will take care of inserting the element.
|
||||
* Otherwise: All other return values will be treated as the object to insert into the array. In most cases you simply want to return the `item` parameter, but there are no restrictions on what you can return.
|
||||
* `dnd-inserted` Optional expression that is invoked after a drop if the element was actually inserted into the list. The same local variables as for `dnd-drop` will be available. Note that for reorderings inside the same list the old element will still be in the list due to the fact that `dnd-moved` was not called yet. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
|
||||
**CSS classes**
|
||||
|
@ -99,28 +91,26 @@ Use the `dnd-handle` directive within a `dnd-nodrag` element in order to allow d
|
|||
|
||||
[Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
|
||||
## Required CSS styles
|
||||
Both the dnd-list and it's children require relative positioning, so that the directive can determine the mouse position relative to the list and thus calculate the correct drop position.
|
||||
|
||||
<pre>
|
||||
ul[dnd-list], ul[dnd-list] > li {
|
||||
position: relative;
|
||||
}
|
||||
</pre>
|
||||
## Recommended CSS styles
|
||||
It is recommended that you apply the following CSS styles:
|
||||
|
||||
* If your application is about moving elements by drag and drop, it is recommended that you hide the source element while dragging, i.e. setting `display: none` on the `.dndDraggingSource` class.
|
||||
* If your application allows to drop elements into empty lists, you need to ensure that empty lists never have a height or width of zero, e.g. by setting a `min-width`.
|
||||
* You should style the `.dndPlaceholder` class accordingly.
|
||||
|
||||
**Note:** Previous versions of this directive required `postion: relative` on certain elements, but this is no longer required.
|
||||
|
||||
## Why another drag & drop library?
|
||||
There are tons of other drag & drop libraries out there, but none of them met my three requirements:
|
||||
|
||||
* **Angular:** If you use angular.js, you really don't want to throw a bunch of jQuery into your app. Instead you want to use libraries that were build the "angular way" and support **two-way data binding** to update your data model automatically.
|
||||
* **Angular:** If you use angular.js, you really don't want to throw a bunch of jQuery into your app. Instead you want to use libraries that were built the "angular way" and support **two-way data binding** to update your data model automatically.
|
||||
* **Nested lists:** If you want to build a **WYSIWYG editor** or have some fancy **tree structure**, the library has to support nested lists.
|
||||
* **HTML5 drag & drop:** Most drag & drop applications you'll find on the internet use pure JavaScript drag & drop. But with the arrival of HTML5 we can delegate most of the work to the browser. For example: If you want to show the user what he's currently dragging, you'll have to update the position of the element all the time and set it below the mouse pointer. In HTML5 the browser will do that for you! But you can not only save code lines, you can also offer a more **native user experience**: If you click on an element in a pure JavaScript drag & drop implementation, it will usually start the drag operation. But remember what happens when you click an icon on your desktop: The icon will be selected, not dragged! This is the native behaviour you can bring to your web application with HTML5.
|
||||
* **HTML5 drag & drop:** Most drag & drop applications you'll find on the internet use pure JavaScript drag & drop. But with the arrival of HTML5 we can delegate most of the work to the browser. For example: If you want to show the user what they are currently dragging, you'll have to update the position of the element all the time and set it below the mouse pointer. In HTML5 the browser will do that for you! But you can not only save code lines, you can also offer a more **native user experience**: If you click on an element in a pure JavaScript drag & drop implementation, it will usually start the drag operation. But remember what happens when you click an icon on your desktop: The icon will be selected, not dragged! This is the native behaviour you can bring to your web application with HTML5.
|
||||
|
||||
If this doesn't fit your requirements, check out one of the other awesome drag & drop libraries:
|
||||
|
||||
* [angular-ui-tree](https://github.com/JimLiu/angular-ui-tree): Very similar to this library, but does not use the HTML5 API. Therefore you need to write some more markup to see what you are dragging and it will create another DOM node that you have to style. However, if you plan to support touch devices this is probably your best choice.
|
||||
* [angular-dragdrop](https://github.com/ganarajpr/angular-dragdrop): One of many libraries with the same name. This one uses the HTML5 API, but if you want to build (nested) sortable lists, you're on your own, because it does not calculate the correct element position for you.
|
||||
* [angular-dragdrop](https://github.com/angular-dragdrop/angular-dragdrop): One of many libraries with the same name. This one uses the HTML5 API, but if you want to build (nested) sortable lists, you're on your own, because it does not calculate the correct element position for you.
|
||||
* [more...](https://www.google.de/search?q=angular+drag+and+drop)
|
||||
|
||||
|
||||
|
@ -128,7 +118,7 @@ If this doesn't fit your requirements, check out one of the other awesome drag &
|
|||
|
||||
Copyright (c) 2014 [Marcel Juenemann](mailto:marcel@juenemann.cc)
|
||||
|
||||
Copyright (c) 2014-2016 Google Inc.
|
||||
Copyright (c) 2014-2017 Google Inc.
|
||||
|
||||
This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.
|
||||
|
||||
|
|
|
@ -1,13 +1,23 @@
|
|||
/**
|
||||
* angular-drag-and-drop-lists v1.4.0
|
||||
* angular-drag-and-drop-lists v2.1.0
|
||||
*
|
||||
* Copyright (c) 2014 Marcel Juenemann marcel@juenemann.cc
|
||||
* Copyright (c) 2014-2016 Google Inc.
|
||||
* Copyright (c) 2014-2017 Google Inc.
|
||||
* https://github.com/marceljuenemann/angular-drag-and-drop-lists
|
||||
*
|
||||
* License: MIT
|
||||
*/
|
||||
angular.module('dndLists', [])
|
||||
(function(dndLists) {
|
||||
|
||||
// In standard-compliant browsers we use a custom mime type and also encode the dnd-type in it.
|
||||
// However, IE and Edge only support a limited number of mime types. The workarounds are described
|
||||
// in https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Data-Transfer-Design
|
||||
var MIME_TYPE = 'application/x-dnd';
|
||||
var EDGE_MIME_TYPE = 'application/json';
|
||||
var MSIE_MIME_TYPE = 'Text';
|
||||
|
||||
// All valid HTML5 drop effects, in the order in which we prefer to use them.
|
||||
var ALL_EFFECTS = ['move', 'copy', 'link'];
|
||||
|
||||
/**
|
||||
* Use the dnd-draggable attribute to make your element draggable
|
||||
|
@ -16,45 +26,44 @@ angular.module('dndLists', [])
|
|||
* - dnd-draggable Required attribute. The value has to be an object that represents the data
|
||||
* of the element. In case of a drag and drop operation the object will be
|
||||
* serialized and unserialized on the receiving end.
|
||||
* - dnd-selected Callback that is invoked when the element was clicked but not dragged.
|
||||
* The original click event will be provided in the local event variable.
|
||||
* - dnd-effect-allowed Use this attribute to limit the operations that can be performed. Options:
|
||||
* - "move": The drag operation will move the element. This is the default.
|
||||
* - "copy": The drag operation will copy the element. Shows a copy cursor.
|
||||
* - "copyMove": The user can choose between copy and move by pressing the
|
||||
* ctrl or shift key. *Not supported in IE:* In Internet Explorer this
|
||||
* option will be the same as "copy". *Not fully supported in Chrome on
|
||||
* Windows:* In the Windows version of Chrome the cursor will always be the
|
||||
* move cursor. However, when the user drops an element and has the ctrl
|
||||
* key pressed, we will perform a copy anyways.
|
||||
* - HTML5 also specifies the "link" option, but this library does not
|
||||
* actively support it yet, so use it at your own risk.
|
||||
* - dnd-moved Callback that is invoked when the element was moved. Usually you will
|
||||
* remove your element from the original list in this callback, since the
|
||||
* directive is not doing that for you automatically. The original dragend
|
||||
* event will be provided in the local event variable.
|
||||
* - dnd-canceled Callback that is invoked if the element was dragged, but the operation was
|
||||
* canceled and the element was not dropped. The original dragend event will
|
||||
* be provided in the local event variable.
|
||||
* - dnd-copied Same as dnd-moved, just that it is called when the element was copied
|
||||
* instead of moved. The original dragend event will be provided in the local
|
||||
* event variable.
|
||||
* - dnd-dragstart Callback that is invoked when the element was dragged. The original
|
||||
* dragstart event will be provided in the local event variable.
|
||||
* - dnd-dragend Callback that is invoked when the drag operation ended. Available local
|
||||
* variables are event and dropEffect.
|
||||
* - dnd-effect-allowed Use this attribute to limit the operations that can be performed. Valid
|
||||
* options are "move", "copy" and "link", as well as "all", "copyMove",
|
||||
* "copyLink" and "linkMove". The semantics of these operations are up to you
|
||||
* and have to be implemented using the callbacks described below. If you
|
||||
* allow multiple options, the user can choose between them by using the
|
||||
* modifier keys (OS specific). The cursor will be changed accordingly,
|
||||
* expect for IE and Edge, where this is not supported.
|
||||
* - dnd-type Use this attribute if you have different kinds of items in your
|
||||
* application and you want to limit which items can be dropped into which
|
||||
* lists. Combine with dnd-allowed-types on the dnd-list(s). This attribute
|
||||
* should evaluate to a string, although this restriction is not enforced.
|
||||
* must be a lower case string. Upper case characters can be used, but will
|
||||
* be converted to lower case automatically.
|
||||
* - dnd-disable-if You can use this attribute to dynamically disable the draggability of the
|
||||
* element. This is useful if you have certain list items that you don't want
|
||||
* to be draggable, or if you want to disable drag & drop completely without
|
||||
* having two different code branches (e.g. only allow for admins).
|
||||
* **Note**: If your element is not draggable, the user is probably able to
|
||||
* select text or images inside of it. Since a selection is always draggable,
|
||||
* this breaks your UI. You most likely want to disable user selection via
|
||||
* CSS (see user-select).
|
||||
*
|
||||
* Callbacks:
|
||||
* - dnd-dragstart Callback that is invoked when the element was dragged. The original
|
||||
* dragstart event will be provided in the local event variable.
|
||||
* - dnd-moved Callback that is invoked when the element was moved. Usually you will
|
||||
* remove your element from the original list in this callback, since the
|
||||
* directive is not doing that for you automatically. The original dragend
|
||||
* event will be provided in the local event variable.
|
||||
* - dnd-copied Same as dnd-moved, just that it is called when the element was copied
|
||||
* instead of moved, so you probably want to implement a different logic.
|
||||
* - dnd-linked Same as dnd-moved, just that it is called when the element was linked
|
||||
* instead of moved, so you probably want to implement a different logic.
|
||||
* - dnd-canceled Callback that is invoked if the element was dragged, but the operation was
|
||||
* canceled and the element was not dropped. The original dragend event will
|
||||
* be provided in the local event variable.
|
||||
* - dnd-dragend Callback that is invoked when the drag operation ended. Available local
|
||||
* variables are event and dropEffect.
|
||||
* - dnd-selected Callback that is invoked when the element was clicked but not dragged.
|
||||
* The original click event will be provided in the local event variable.
|
||||
* - dnd-callback Custom callback that is passed to dropzone callbacks and can be used to
|
||||
* communicate between source and target scopes. The dropzone can pass user
|
||||
* defined variables to this callback.
|
||||
*
|
||||
* CSS classes:
|
||||
* - dndDragging This class will be added to the element while the element is being
|
||||
|
@ -66,13 +75,12 @@ angular.module('dndLists', [])
|
|||
* it's source position, and not the "element" that the user is dragging with
|
||||
* his mouse pointer.
|
||||
*/
|
||||
.directive('dndDraggable', ['$parse', '$timeout', 'dndDropEffectWorkaround', 'dndDragTypeWorkaround',
|
||||
function($parse, $timeout, dndDropEffectWorkaround, dndDragTypeWorkaround) {
|
||||
dndLists.directive('dndDraggable', ['$parse', '$timeout', function($parse, $timeout) {
|
||||
return function(scope, element, attr) {
|
||||
// Set the HTML5 draggable attribute on the element
|
||||
// Set the HTML5 draggable attribute on the element.
|
||||
element.attr("draggable", "true");
|
||||
|
||||
// If the dnd-disable-if attribute is set, we have to watch that
|
||||
// If the dnd-disable-if attribute is set, we have to watch that.
|
||||
if (attr.dndDisableIf) {
|
||||
scope.$watch(attr.dndDisableIf, function(disabled) {
|
||||
element.attr("draggable", !disabled);
|
||||
|
@ -89,31 +97,51 @@ angular.module('dndLists', [])
|
|||
// Check whether the element is draggable, since dragstart might be triggered on a child.
|
||||
if (element.attr('draggable') == 'false') return true;
|
||||
|
||||
// Serialize the data associated with this element. IE only supports the Text drag type
|
||||
event.dataTransfer.setData("Text", angular.toJson(scope.$eval(attr.dndDraggable)));
|
||||
// Initialize global state.
|
||||
dndState.isDragging = true;
|
||||
dndState.itemType = attr.dndType && scope.$eval(attr.dndType).toLowerCase();
|
||||
|
||||
// Only allow actions specified in dnd-effect-allowed attribute
|
||||
event.dataTransfer.effectAllowed = attr.dndEffectAllowed || "move";
|
||||
// Set the allowed drop effects. See below for special IE handling.
|
||||
dndState.dropEffect = "none";
|
||||
dndState.effectAllowed = attr.dndEffectAllowed || ALL_EFFECTS[0];
|
||||
event.dataTransfer.effectAllowed = dndState.effectAllowed;
|
||||
|
||||
// Add CSS classes. See documentation above
|
||||
// Internet Explorer and Microsoft Edge don't support custom mime types, see design doc:
|
||||
// https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Data-Transfer-Design
|
||||
var item = scope.$eval(attr.dndDraggable);
|
||||
var mimeType = MIME_TYPE + (dndState.itemType ? ('-' + dndState.itemType) : '');
|
||||
try {
|
||||
event.dataTransfer.setData(mimeType, angular.toJson(item));
|
||||
} catch (e) {
|
||||
// Setting a custom MIME type did not work, we are probably in IE or Edge.
|
||||
var data = angular.toJson({item: item, type: dndState.itemType});
|
||||
try {
|
||||
event.dataTransfer.setData(EDGE_MIME_TYPE, data);
|
||||
} catch (e) {
|
||||
// We are in Internet Explorer and can only use the Text MIME type. Also note that IE
|
||||
// does not allow changing the cursor in the dragover event, therefore we have to choose
|
||||
// the one we want to display now by setting effectAllowed.
|
||||
var effectsAllowed = filterEffects(ALL_EFFECTS, dndState.effectAllowed);
|
||||
event.dataTransfer.effectAllowed = effectsAllowed[0];
|
||||
event.dataTransfer.setData(MSIE_MIME_TYPE, data);
|
||||
}
|
||||
}
|
||||
|
||||
// Add CSS classes. See documentation above.
|
||||
element.addClass("dndDragging");
|
||||
$timeout(function() { element.addClass("dndDraggingSource"); }, 0);
|
||||
|
||||
// Workarounds for stupid browsers, see description below
|
||||
dndDropEffectWorkaround.dropEffect = "none";
|
||||
dndDragTypeWorkaround.isDragging = true;
|
||||
|
||||
// Save type of item in global state. Usually, this would go into the dataTransfer
|
||||
// typename, but we have to use "Text" there to support IE
|
||||
dndDragTypeWorkaround.dragType = attr.dndType ? scope.$eval(attr.dndType) : undefined;
|
||||
|
||||
// Try setting a proper drag image if triggered on a dnd-handle (won't work in IE).
|
||||
if (event._dndHandle && event.dataTransfer.setDragImage) {
|
||||
event.dataTransfer.setDragImage(element[0], 0, 0);
|
||||
}
|
||||
|
||||
// Invoke callback
|
||||
// Invoke dragstart callback and prepare extra callback for dropzone.
|
||||
$parse(attr.dndDragstart)(scope, {event: event});
|
||||
if (attr.dndCallback) {
|
||||
var callback = $parse(attr.dndCallback);
|
||||
dndState.callback = function(params) { return callback(scope, params || {}); };
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
@ -130,27 +158,22 @@ angular.module('dndLists', [])
|
|||
// the used effect, but Chrome has not implemented that field correctly. On Windows
|
||||
// it always sets it to 'none', while Chrome on Linux sometimes sets it to something
|
||||
// else when it's supposed to send 'none' (drag operation aborted).
|
||||
var dropEffect = dndDropEffectWorkaround.dropEffect;
|
||||
scope.$apply(function() {
|
||||
switch (dropEffect) {
|
||||
case "move":
|
||||
$parse(attr.dndMoved)(scope, {event: event});
|
||||
break;
|
||||
case "copy":
|
||||
$parse(attr.dndCopied)(scope, {event: event});
|
||||
break;
|
||||
case "none":
|
||||
$parse(attr.dndCanceled)(scope, {event: event});
|
||||
break;
|
||||
}
|
||||
var dropEffect = dndState.dropEffect;
|
||||
var cb = {copy: 'dndCopied', link: 'dndLinked', move: 'dndMoved', none: 'dndCanceled'};
|
||||
$parse(attr[cb[dropEffect]])(scope, {event: event});
|
||||
$parse(attr.dndDragend)(scope, {event: event, dropEffect: dropEffect});
|
||||
});
|
||||
|
||||
// Clean up
|
||||
dndState.isDragging = false;
|
||||
dndState.callback = undefined;
|
||||
element.removeClass("dndDragging");
|
||||
$timeout(function() { element.removeClass("dndDraggingSource"); }, 0);
|
||||
dndDragTypeWorkaround.isDragging = false;
|
||||
element.removeClass("dndDraggingSource");
|
||||
event.stopPropagation();
|
||||
|
||||
// In IE9 it is possible that the timeout from dragstart triggers after the dragend handler.
|
||||
$timeout(function() { element.removeClass("dndDraggingSource"); }, 0);
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -176,43 +199,58 @@ angular.module('dndLists', [])
|
|||
if (this.dragDrop) this.dragDrop();
|
||||
});
|
||||
};
|
||||
}])
|
||||
}]);
|
||||
|
||||
/**
|
||||
* Use the dnd-list attribute to make your list element a dropzone. Usually you will add a single
|
||||
* li element as child with the ng-repeat directive. If you don't do that, we will not be able to
|
||||
* position the dropped element correctly. If you want your list to be sortable, also add the
|
||||
* dnd-draggable directive to your li element(s). Both the dnd-list and it's direct children must
|
||||
* have position: relative CSS style, otherwise the positioning algorithm will not be able to
|
||||
* determine the correct placeholder position in all browsers.
|
||||
* dnd-draggable directive to your li element(s).
|
||||
*
|
||||
* Attributes:
|
||||
* - dnd-list Required attribute. The value has to be the array in which the data of
|
||||
* the dropped element should be inserted.
|
||||
* the dropped element should be inserted. The value can be blank if used
|
||||
* with a custom dnd-drop handler that always returns true.
|
||||
* - dnd-allowed-types Optional array of allowed item types. When used, only items that had a
|
||||
* matching dnd-type attribute will be dropable.
|
||||
* matching dnd-type attribute will be dropable. Upper case characters will
|
||||
* automatically be converted to lower case.
|
||||
* - dnd-effect-allowed Optional string expression that limits the drop effects that can be
|
||||
* performed in the list. See dnd-effect-allowed on dnd-draggable for more
|
||||
* details on allowed options. The default value is all.
|
||||
* - dnd-disable-if Optional boolean expresssion. When it evaluates to true, no dropping
|
||||
* into the list is possible. Note that this also disables rearranging
|
||||
* items inside the list.
|
||||
* - dnd-horizontal-list Optional boolean expresssion. When it evaluates to true, the positioning
|
||||
* algorithm will use the left and right halfs of the list items instead of
|
||||
* the upper and lower halfs.
|
||||
* - dnd-external-sources Optional boolean expression. When it evaluates to true, the list accepts
|
||||
* drops from sources outside of the current browser tab. This allows to
|
||||
* drag and drop accross different browser tabs. The only major browser
|
||||
* that does not support this is currently Microsoft Edge.
|
||||
*
|
||||
* Callbacks:
|
||||
* - dnd-dragover Optional expression that is invoked when an element is dragged over the
|
||||
* list. If the expression is set, but does not return true, the element is
|
||||
* not allowed to be dropped. The following variables will be available:
|
||||
* - event: The original dragover event sent by the browser.
|
||||
* - index: The position in the list at which the element would be dropped.
|
||||
* - type: The dnd-type set on the dnd-draggable, or undefined if unset.
|
||||
* - type: The dnd-type set on the dnd-draggable, or undefined if non was
|
||||
* set. Will be null for drops from external sources in IE and Edge,
|
||||
* since we don't know the type in those cases.
|
||||
* - dropEffect: One of move, copy or link, see dnd-effect-allowed.
|
||||
* - external: Whether the element was dragged from an external source.
|
||||
* - callback: If dnd-callback was set on the source element, this is a
|
||||
* function reference to the callback. The callback can be invoked with
|
||||
* custom variables like this: callback({var1: value1, var2: value2}).
|
||||
* The callback will be executed on the scope of the source element. If
|
||||
* dnd-external-sources was set and external is true, this callback will
|
||||
* not be available.
|
||||
* - dnd-drop Optional expression that is invoked when an element is dropped on the
|
||||
* list. The following variables will be available:
|
||||
* - event: The original drop event sent by the browser.
|
||||
* - index: The position in the list at which the element would be dropped.
|
||||
* - item: The transferred object.
|
||||
* - type: The dnd-type set on the dnd-draggable, or undefined if unset.
|
||||
* - external: Whether the element was dragged from an external source.
|
||||
* The return value determines the further handling of the drop:
|
||||
* - false: The drop will be canceled and the element won't be inserted.
|
||||
* list. The same variables as for dnd-dragover will be available, with the
|
||||
* exception that type is always known and therefore never null. There
|
||||
* will also be an item variable, which is the transferred object. The
|
||||
* return value determines the further handling of the drop:
|
||||
* - falsy: The drop will be canceled and the element won't be inserted.
|
||||
* - true: Signalises that the drop is allowed, but the dnd-drop
|
||||
* callback already took care of inserting the element.
|
||||
* - otherwise: All other return values will be treated as the object to
|
||||
|
@ -223,13 +261,6 @@ angular.module('dndLists', [])
|
|||
* dnd-drop will be available. Note that for reorderings inside the same
|
||||
* list the old element will still be in the list due to the fact that
|
||||
* dnd-moved was not called yet.
|
||||
* - dnd-external-sources Optional boolean expression. When it evaluates to true, the list accepts
|
||||
* drops from sources outside of the current browser tab. This allows to
|
||||
* drag and drop accross different browser tabs. Note that this will allow
|
||||
* to drop arbitrary text into the list, thus it is highly recommended to
|
||||
* implement the dnd-drop callback to check the incoming element for
|
||||
* sanity. Furthermore, the dnd-type of external sources can not be
|
||||
* determined, therefore do not rely on restrictions of dnd-allowed-type.
|
||||
*
|
||||
* CSS classes:
|
||||
* - dndPlaceholder When an element is dragged over the list, a new placeholder child
|
||||
|
@ -238,18 +269,16 @@ angular.module('dndLists', [])
|
|||
* by creating a child element with dndPlaceholder class.
|
||||
* - dndDragover Will be added to the list while an element is dragged over the list.
|
||||
*/
|
||||
.directive('dndList', ['$parse', '$timeout', 'dndDropEffectWorkaround', 'dndDragTypeWorkaround',
|
||||
function($parse, $timeout, dndDropEffectWorkaround, dndDragTypeWorkaround) {
|
||||
dndLists.directive('dndList', ['$parse', function($parse) {
|
||||
return function(scope, element, attr) {
|
||||
// While an element is dragged over the list, this placeholder element is inserted
|
||||
// at the location where the element would be inserted after dropping
|
||||
// at the location where the element would be inserted after dropping.
|
||||
var placeholder = getPlaceholderElement();
|
||||
var placeholderNode = placeholder[0];
|
||||
var listNode = element[0];
|
||||
placeholder.remove();
|
||||
|
||||
var horizontal = attr.dndHorizontalList && scope.$eval(attr.dndHorizontalList);
|
||||
var externalSources = attr.dndExternalSources && scope.$eval(attr.dndExternalSources);
|
||||
var placeholderNode = placeholder[0];
|
||||
var listNode = element[0];
|
||||
var listSettings = {};
|
||||
|
||||
/**
|
||||
* The dragenter event is fired when a dragged element or text selection enters a valid drop
|
||||
|
@ -259,7 +288,18 @@ angular.module('dndLists', [])
|
|||
*/
|
||||
element.on('dragenter', function (event) {
|
||||
event = event.originalEvent || event;
|
||||
if (!isDropAllowed(event)) return true;
|
||||
|
||||
// Calculate list properties, so that we don't have to repeat this on every dragover event.
|
||||
var types = attr.dndAllowedTypes && scope.$eval(attr.dndAllowedTypes);
|
||||
listSettings = {
|
||||
allowedTypes: angular.isArray(types) && types.join('|').toLowerCase().split('|'),
|
||||
disabled: attr.dndDisableIf && scope.$eval(attr.dndDisableIf),
|
||||
externalSources: attr.dndExternalSources && scope.$eval(attr.dndExternalSources),
|
||||
horizontal: attr.dndHorizontalList && scope.$eval(attr.dndHorizontalList)
|
||||
};
|
||||
|
||||
var mimeType = getMimeType(event.dataTransfer.types);
|
||||
if (!mimeType || !isDropAllowed(getItemType(mimeType))) return true;
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
|
@ -270,62 +310,58 @@ angular.module('dndLists', [])
|
|||
element.on('dragover', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
|
||||
if (!isDropAllowed(event)) return true;
|
||||
// Check whether the drop is allowed and determine mime type.
|
||||
var mimeType = getMimeType(event.dataTransfer.types);
|
||||
var itemType = getItemType(mimeType);
|
||||
if (!mimeType || !isDropAllowed(itemType)) return true;
|
||||
|
||||
// First of all, make sure that the placeholder is shown
|
||||
// This is especially important if the list is empty
|
||||
// Make sure the placeholder is shown, which is especially important if the list is empty.
|
||||
if (placeholderNode.parentNode != listNode) {
|
||||
element.append(placeholder);
|
||||
}
|
||||
|
||||
if (event.target !== listNode) {
|
||||
if (event.target != listNode) {
|
||||
// Try to find the node direct directly below the list node.
|
||||
var listItemNode = event.target;
|
||||
while (listItemNode.parentNode !== listNode && listItemNode.parentNode) {
|
||||
while (listItemNode.parentNode != listNode && listItemNode.parentNode) {
|
||||
listItemNode = listItemNode.parentNode;
|
||||
}
|
||||
|
||||
if (listItemNode.parentNode === listNode && listItemNode !== placeholderNode) {
|
||||
// If the mouse pointer is in the upper half of the child element,
|
||||
// we place it before the child element, otherwise below it.
|
||||
if (isMouseInFirstHalf(event, listItemNode)) {
|
||||
listNode.insertBefore(placeholderNode, listItemNode);
|
||||
if (listItemNode.parentNode == listNode && listItemNode != placeholderNode) {
|
||||
// If the mouse pointer is in the upper half of the list item element,
|
||||
// we position the placeholder before the list item, otherwise after it.
|
||||
var rect = listItemNode.getBoundingClientRect();
|
||||
if (listSettings.horizontal) {
|
||||
var isFirstHalf = event.clientX < rect.left + rect.width / 2;
|
||||
} else {
|
||||
listNode.insertBefore(placeholderNode, listItemNode.nextSibling);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// This branch is reached when we are dragging directly over the list element.
|
||||
// Usually we wouldn't need to do anything here, but the IE does not fire it's
|
||||
// events for the child element, only for the list directly. Therefore, we repeat
|
||||
// the positioning algorithm for IE here.
|
||||
if (isMouseInFirstHalf(event, placeholderNode, true)) {
|
||||
// Check if we should move the placeholder element one spot towards the top.
|
||||
// Note that display none elements will have offsetTop and offsetHeight set to
|
||||
// zero, therefore we need a special check for them.
|
||||
while (placeholderNode.previousElementSibling
|
||||
&& (isMouseInFirstHalf(event, placeholderNode.previousElementSibling, true)
|
||||
|| placeholderNode.previousElementSibling.offsetHeight === 0)) {
|
||||
listNode.insertBefore(placeholderNode, placeholderNode.previousElementSibling);
|
||||
}
|
||||
} else {
|
||||
// Check if we should move the placeholder element one spot towards the bottom
|
||||
while (placeholderNode.nextElementSibling &&
|
||||
!isMouseInFirstHalf(event, placeholderNode.nextElementSibling, true)) {
|
||||
listNode.insertBefore(placeholderNode,
|
||||
placeholderNode.nextElementSibling.nextElementSibling);
|
||||
var isFirstHalf = event.clientY < rect.top + rect.height / 2;
|
||||
}
|
||||
listNode.insertBefore(placeholderNode,
|
||||
isFirstHalf ? listItemNode : listItemNode.nextSibling);
|
||||
}
|
||||
}
|
||||
|
||||
// In IE we set a fake effectAllowed in dragstart to get the correct cursor, we therefore
|
||||
// ignore the effectAllowed passed in dataTransfer. We must also not access dataTransfer for
|
||||
// drops from external sources, as that throws an exception.
|
||||
var ignoreDataTransfer = mimeType == MSIE_MIME_TYPE;
|
||||
var dropEffect = getDropEffect(event, ignoreDataTransfer);
|
||||
if (dropEffect == 'none') return stopDragover();
|
||||
|
||||
// At this point we invoke the callback, which still can disallow the drop.
|
||||
// We can't do this earlier because we want to pass the index of the placeholder.
|
||||
if (attr.dndDragover && !invokeCallback(attr.dndDragover, event, getPlaceholderIndex())) {
|
||||
if (attr.dndDragover && !invokeCallback(attr.dndDragover, event, dropEffect, itemType)) {
|
||||
return stopDragover();
|
||||
}
|
||||
|
||||
element.addClass("dndDragover");
|
||||
// Set dropEffect to modify the cursor shown by the browser, unless we're in IE, where this
|
||||
// is not supported. This must be done after preventDefault in Firefox.
|
||||
event.preventDefault();
|
||||
if (!ignoreDataTransfer) {
|
||||
event.dataTransfer.dropEffect = dropEffect;
|
||||
}
|
||||
|
||||
element.addClass("dndDragover");
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
@ -338,51 +374,54 @@ angular.module('dndLists', [])
|
|||
element.on('drop', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
|
||||
if (!isDropAllowed(event)) return true;
|
||||
// Check whether the drop is allowed and determine mime type.
|
||||
var mimeType = getMimeType(event.dataTransfer.types);
|
||||
var itemType = getItemType(mimeType);
|
||||
if (!mimeType || !isDropAllowed(itemType)) return true;
|
||||
|
||||
// The default behavior in Firefox is to interpret the dropped element as URL and
|
||||
// forward to it. We want to prevent that even if our drop is aborted.
|
||||
event.preventDefault();
|
||||
|
||||
// Unserialize the data that was serialized in dragstart. According to the HTML5 specs,
|
||||
// the "Text" drag type will be converted to text/plain, but IE does not do that.
|
||||
var data = event.dataTransfer.getData("Text") || event.dataTransfer.getData("text/plain");
|
||||
var transferredObject;
|
||||
// Unserialize the data that was serialized in dragstart.
|
||||
try {
|
||||
transferredObject = JSON.parse(data);
|
||||
var data = JSON.parse(event.dataTransfer.getData(mimeType));
|
||||
} catch(e) {
|
||||
return stopDragover();
|
||||
}
|
||||
|
||||
// Drops with invalid types from external sources might not have been filtered out yet.
|
||||
if (mimeType == MSIE_MIME_TYPE || mimeType == EDGE_MIME_TYPE) {
|
||||
itemType = data.type || undefined;
|
||||
data = data.item;
|
||||
if (!isDropAllowed(itemType)) return stopDragover();
|
||||
}
|
||||
|
||||
// Special handling for internal IE drops, see dragover handler.
|
||||
var ignoreDataTransfer = mimeType == MSIE_MIME_TYPE;
|
||||
var dropEffect = getDropEffect(event, ignoreDataTransfer);
|
||||
if (dropEffect == 'none') return stopDragover();
|
||||
|
||||
// Invoke the callback, which can transform the transferredObject and even abort the drop.
|
||||
var index = getPlaceholderIndex();
|
||||
if (attr.dndDrop) {
|
||||
transferredObject = invokeCallback(attr.dndDrop, event, index, transferredObject);
|
||||
if (!transferredObject) {
|
||||
return stopDragover();
|
||||
}
|
||||
data = invokeCallback(attr.dndDrop, event, dropEffect, itemType, index, data);
|
||||
if (!data) return stopDragover();
|
||||
}
|
||||
|
||||
// The drop is definitely going to happen now, store the dropEffect.
|
||||
dndState.dropEffect = dropEffect;
|
||||
if (!ignoreDataTransfer) {
|
||||
event.dataTransfer.dropEffect = dropEffect;
|
||||
}
|
||||
|
||||
// Insert the object into the array, unless dnd-drop took care of that (returned true).
|
||||
if (transferredObject !== true) {
|
||||
if (data !== true) {
|
||||
scope.$apply(function() {
|
||||
scope.$eval(attr.dndList).splice(index, 0, transferredObject);
|
||||
scope.$eval(attr.dndList).splice(index, 0, data);
|
||||
});
|
||||
}
|
||||
invokeCallback(attr.dndInserted, event, index, transferredObject);
|
||||
|
||||
// In Chrome on Windows the dropEffect will always be none...
|
||||
// We have to determine the actual effect manually from the allowed effects
|
||||
if (event.dataTransfer.dropEffect === "none") {
|
||||
if (event.dataTransfer.effectAllowed === "copy" ||
|
||||
event.dataTransfer.effectAllowed === "move") {
|
||||
dndDropEffectWorkaround.dropEffect = event.dataTransfer.effectAllowed;
|
||||
} else {
|
||||
dndDropEffectWorkaround.dropEffect = event.ctrlKey ? "copy" : "move";
|
||||
}
|
||||
} else {
|
||||
dndDropEffectWorkaround.dropEffect = event.dataTransfer.dropEffect;
|
||||
}
|
||||
invokeCallback(attr.dndInserted, event, dropEffect, itemType, index, data);
|
||||
|
||||
// Clean up
|
||||
stopDragover();
|
||||
|
@ -393,37 +432,118 @@ angular.module('dndLists', [])
|
|||
/**
|
||||
* We have to remove the placeholder when the element is no longer dragged over our list. The
|
||||
* problem is that the dragleave event is not only fired when the element leaves our list,
|
||||
* but also when it leaves a child element -- so practically it's fired all the time. As a
|
||||
* workaround we wait a few milliseconds and then check if the dndDragover class was added
|
||||
* again. If it is there, dragover must have been called in the meantime, i.e. the element
|
||||
* is still dragging over the list. If you know a better way of doing this, please tell me!
|
||||
* but also when it leaves a child element. Therefore, we determine whether the mouse cursor
|
||||
* is still pointing to an element inside the list or not.
|
||||
*/
|
||||
element.on('dragleave', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
|
||||
element.removeClass("dndDragover");
|
||||
$timeout(function() {
|
||||
if (!element.hasClass("dndDragover")) {
|
||||
placeholder.remove();
|
||||
}
|
||||
}, 100);
|
||||
var newTarget = document.elementFromPoint(event.clientX, event.clientY);
|
||||
if (listNode.contains(newTarget) && !event._dndPhShown) {
|
||||
// Signalize to potential parent lists that a placeholder is already shown.
|
||||
event._dndPhShown = true;
|
||||
} else {
|
||||
stopDragover();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Checks whether the mouse pointer is in the first half of the given target element.
|
||||
*
|
||||
* In Chrome we can just use offsetY, but in Firefox we have to use layerY, which only
|
||||
* works if the child element has position relative. In IE the events are only triggered
|
||||
* on the listNode instead of the listNodeItem, therefore the mouse positions are
|
||||
* relative to the parent element of targetNode.
|
||||
* Given the types array from the DataTransfer object, returns the first valid mime type.
|
||||
* A type is valid if it starts with MIME_TYPE, or it equals MSIE_MIME_TYPE or EDGE_MIME_TYPE.
|
||||
*/
|
||||
function isMouseInFirstHalf(event, targetNode, relativeToParent) {
|
||||
var mousePointer = horizontal ? (event.offsetX || event.layerX)
|
||||
: (event.offsetY || event.layerY);
|
||||
var targetSize = horizontal ? targetNode.offsetWidth : targetNode.offsetHeight;
|
||||
var targetPosition = horizontal ? targetNode.offsetLeft : targetNode.offsetTop;
|
||||
targetPosition = relativeToParent ? targetPosition : 0;
|
||||
return mousePointer < targetPosition + targetSize / 2;
|
||||
function getMimeType(types) {
|
||||
if (!types) return MSIE_MIME_TYPE; // IE 9 workaround.
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
if (types[i] == MSIE_MIME_TYPE || types[i] == EDGE_MIME_TYPE ||
|
||||
types[i].substr(0, MIME_TYPE.length) == MIME_TYPE) {
|
||||
return types[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the type of the item from the dndState, or from the mime type for items from
|
||||
* external sources. Returns undefined if no item type was set and null if the item type could
|
||||
* not be determined.
|
||||
*/
|
||||
function getItemType(mimeType) {
|
||||
if (dndState.isDragging) return dndState.itemType || undefined;
|
||||
if (mimeType == MSIE_MIME_TYPE || mimeType == EDGE_MIME_TYPE) return null;
|
||||
return (mimeType && mimeType.substr(MIME_TYPE.length + 1)) || undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks various conditions that must be fulfilled for a drop to be allowed, including the
|
||||
* dnd-allowed-types attribute. If the item Type is unknown (null), the drop will be allowed.
|
||||
*/
|
||||
function isDropAllowed(itemType) {
|
||||
if (listSettings.disabled) return false;
|
||||
if (!listSettings.externalSources && !dndState.isDragging) return false;
|
||||
if (!listSettings.allowedTypes || itemType === null) return true;
|
||||
return itemType && listSettings.allowedTypes.indexOf(itemType) != -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines which drop effect to use for the given event. In Internet Explorer we have to
|
||||
* ignore the effectAllowed field on dataTransfer, since we set a fake value in dragstart.
|
||||
* In those cases we rely on dndState to filter effects. Read the design doc for more details:
|
||||
* https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Data-Transfer-Design
|
||||
*/
|
||||
function getDropEffect(event, ignoreDataTransfer) {
|
||||
var effects = ALL_EFFECTS;
|
||||
if (!ignoreDataTransfer) {
|
||||
effects = filterEffects(effects, event.dataTransfer.effectAllowed);
|
||||
}
|
||||
if (dndState.isDragging) {
|
||||
effects = filterEffects(effects, dndState.effectAllowed);
|
||||
}
|
||||
if (attr.dndEffectAllowed) {
|
||||
effects = filterEffects(effects, attr.dndEffectAllowed);
|
||||
}
|
||||
// MacOS automatically filters dataTransfer.effectAllowed depending on the modifier keys,
|
||||
// therefore the following modifier keys will only affect other operating systems.
|
||||
if (!effects.length) {
|
||||
return 'none';
|
||||
} else if (event.ctrlKey && effects.indexOf('copy') != -1) {
|
||||
return 'copy';
|
||||
} else if (event.altKey && effects.indexOf('link') != -1) {
|
||||
return 'link';
|
||||
} else {
|
||||
return effects[0];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Small helper function that cleans up if we aborted a drop.
|
||||
*/
|
||||
function stopDragover() {
|
||||
placeholder.remove();
|
||||
element.removeClass("dndDragover");
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes a callback with some interesting parameters and returns the callbacks return value.
|
||||
*/
|
||||
function invokeCallback(expression, event, dropEffect, itemType, index, item) {
|
||||
return $parse(expression)(scope, {
|
||||
callback: dndState.callback,
|
||||
dropEffect: dropEffect,
|
||||
event: event,
|
||||
external: !dndState.isDragging,
|
||||
index: index !== undefined ? index : getPlaceholderIndex(),
|
||||
item: item || undefined,
|
||||
type: itemType
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* We use the position of the placeholder node to determine at which position of the array the
|
||||
* object needs to be inserted
|
||||
*/
|
||||
function getPlaceholderIndex() {
|
||||
return Array.prototype.indexOf.call(listNode.children, placeholderNode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -440,77 +560,8 @@ angular.module('dndLists', [])
|
|||
});
|
||||
return placeholder || angular.element("<li class='dndPlaceholder'></li>");
|
||||
}
|
||||
|
||||
/**
|
||||
* We use the position of the placeholder node to determine at which position of the array the
|
||||
* object needs to be inserted
|
||||
*/
|
||||
function getPlaceholderIndex() {
|
||||
return Array.prototype.indexOf.call(listNode.children, placeholderNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks various conditions that must be fulfilled for a drop to be allowed
|
||||
*/
|
||||
function isDropAllowed(event) {
|
||||
// Disallow drop from external source unless it's allowed explicitly.
|
||||
if (!dndDragTypeWorkaround.isDragging && !externalSources) return false;
|
||||
|
||||
// Check mimetype. Usually we would use a custom drag type instead of Text, but IE doesn't
|
||||
// support that.
|
||||
if (!hasTextMimetype(event.dataTransfer.types)) return false;
|
||||
|
||||
// Now check the dnd-allowed-types against the type of the incoming element. For drops from
|
||||
// external sources we don't know the type, so it will need to be checked via dnd-drop.
|
||||
if (attr.dndAllowedTypes && dndDragTypeWorkaround.isDragging) {
|
||||
var allowed = scope.$eval(attr.dndAllowedTypes);
|
||||
if (angular.isArray(allowed) && allowed.indexOf(dndDragTypeWorkaround.dragType) === -1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check whether droping is disabled completely
|
||||
if (attr.dndDisableIf && scope.$eval(attr.dndDisableIf)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Small helper function that cleans up if we aborted a drop.
|
||||
*/
|
||||
function stopDragover() {
|
||||
placeholder.remove();
|
||||
element.removeClass("dndDragover");
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes a callback with some interesting parameters and returns the callbacks return value.
|
||||
*/
|
||||
function invokeCallback(expression, event, index, item) {
|
||||
return $parse(expression)(scope, {
|
||||
event: event,
|
||||
index: index,
|
||||
item: item || undefined,
|
||||
external: !dndDragTypeWorkaround.isDragging,
|
||||
type: dndDragTypeWorkaround.isDragging ? dndDragTypeWorkaround.dragType : undefined
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the dataTransfer object contains a drag type that we can handle. In old versions
|
||||
* of IE the types collection will not even be there, so we just assume a drop is possible.
|
||||
*/
|
||||
function hasTextMimetype(types) {
|
||||
if (!types) return true;
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
if (types[i] === "Text" || types[i] === "text/plain") return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}])
|
||||
}]);
|
||||
|
||||
/**
|
||||
* Use the dnd-nodrag attribute inside of dnd-draggable elements to prevent them from starting
|
||||
|
@ -518,7 +569,7 @@ angular.module('dndLists', [])
|
|||
* dnd-draggable elements or create specific handle elements. Note: This directive does not work
|
||||
* in Internet Explorer 9.
|
||||
*/
|
||||
.directive('dndNodrag', function() {
|
||||
dndLists.directive('dndNodrag', function() {
|
||||
return function(scope, element, attr) {
|
||||
// Set as draggable so that we can cancel the events explicitly
|
||||
element.attr("draggable", "true");
|
||||
|
@ -551,7 +602,7 @@ angular.module('dndLists', [])
|
|||
}
|
||||
});
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* Use the dnd-handle directive within a dnd-nodrag element in order to allow dragging with that
|
||||
|
@ -561,7 +612,7 @@ angular.module('dndLists', [])
|
|||
* can work around this by styling the handle element differently when it is being dragged. Use
|
||||
* the CSS selector .dndDragging:not(.dndDraggingSource) [dnd-handle] for that.
|
||||
*/
|
||||
.directive('dndHandle', function() {
|
||||
dndLists.directive('dndHandle', function() {
|
||||
return function(scope, element, attr) {
|
||||
element.attr("draggable", "true");
|
||||
|
||||
|
@ -570,21 +621,30 @@ angular.module('dndLists', [])
|
|||
event._dndHandle = true;
|
||||
});
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* This workaround handles the fact that Internet Explorer does not support drag types other than
|
||||
* "Text" and "URL". That means we can not know whether the data comes from one of our elements or
|
||||
* is just some other data like a text selection. As a workaround we save the isDragging flag in
|
||||
* here. When a dropover event occurs, we only allow the drop if we are already dragging, because
|
||||
* that means the element is ours.
|
||||
* Filters an array of drop effects using a HTML5 effectAllowed string.
|
||||
*/
|
||||
.factory('dndDragTypeWorkaround', function(){ return {} })
|
||||
function filterEffects(effects, effectAllowed) {
|
||||
if (effectAllowed == 'all') return effects;
|
||||
return effects.filter(function(effect) {
|
||||
return effectAllowed.toLowerCase().indexOf(effect) != -1;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Chrome on Windows does not set the dropEffect field, which we need in dragend to determine
|
||||
* whether a drag operation was successful. Therefore we have to maintain it in this global
|
||||
* variable. The bug report for that has been open for years:
|
||||
* https://code.google.com/p/chromium/issues/detail?id=39399
|
||||
* For some features we need to maintain global state. This is done here, with these fields:
|
||||
* - callback: A callback function set at dragstart that is passed to internal dropzone handlers.
|
||||
* - dropEffect: Set in dragstart to "none" and to the actual value in the drop handler. We don't
|
||||
* rely on the dropEffect passed by the browser, since there are various bugs in Chrome and
|
||||
* Safari, and Internet Explorer defaults to copy if effectAllowed is copyMove.
|
||||
* - effectAllowed: Set in dragstart based on dnd-effect-allowed. This is needed for IE because
|
||||
* setting effectAllowed on dataTransfer might result in an undesired cursor.
|
||||
* - isDragging: True between dragstart and dragend. Falsy for drops from external sources.
|
||||
* - itemType: The item type of the dragged element set via dnd-type. This is needed because IE
|
||||
* and Edge don't support custom mime types that we can use to transfer this information.
|
||||
*/
|
||||
.factory('dndDropEffectWorkaround', function(){ return {} });
|
||||
var dndState = {};
|
||||
|
||||
})(angular.module('dndLists', []));
|
||||
|
|
|
@ -1,35 +1,49 @@
|
|||
/**
|
||||
* angular-drag-and-drop-lists v1.4.0
|
||||
* angular-drag-and-drop-lists v2.1.0
|
||||
*
|
||||
* Copyright (c) 2014 Marcel Juenemann marcel@juenemann.cc
|
||||
* Copyright (c) 2014-2016 Google Inc.
|
||||
* Copyright (c) 2014-2017 Google Inc.
|
||||
* https://github.com/marceljuenemann/angular-drag-and-drop-lists
|
||||
*
|
||||
* License: MIT
|
||||
*/
|
||||
angular.module("dndLists",[]).directive("dndDraggable",["$parse","$timeout","dndDropEffectWorkaround","dndDragTypeWorkaround",function(e,n,r,t){return function(a,d,o){d.attr("draggable","true"),o.dndDisableIf&&a.$watch(o.dndDisableIf,function(e){d.attr("draggable",!e)}),d.on("dragstart",function(i){return i=i.originalEvent||i,"false"==d.attr("draggable")?!0:(i.dataTransfer.setData("Text",angular.toJson(a.$eval(o.dndDraggable))),i.dataTransfer.effectAllowed=o.dndEffectAllowed||"move",d.addClass("dndDragging"),n(function(){d.addClass("dndDraggingSource")},0),r.dropEffect="none",t.isDragging=!0,t.dragType=o.dndType?a.$eval(o.dndType):void 0,i._dndHandle&&i.dataTransfer.setDragImage&&i.dataTransfer.setDragImage(d[0],0,0),e(o.dndDragstart)(a,{event:i}),void i.stopPropagation())}),d.on("dragend",function(i){i=i.originalEvent||i
|
||||
var f=r.dropEffect
|
||||
a.$apply(function(){switch(f){case"move":e(o.dndMoved)(a,{event:i})
|
||||
break
|
||||
case"copy":e(o.dndCopied)(a,{event:i})
|
||||
break
|
||||
case"none":e(o.dndCanceled)(a,{event:i})}e(o.dndDragend)(a,{event:i,dropEffect:f})}),d.removeClass("dndDragging"),n(function(){d.removeClass("dndDraggingSource")},0),t.isDragging=!1,i.stopPropagation()}),d.on("click",function(n){o.dndSelected&&(n=n.originalEvent||n,a.$apply(function(){e(o.dndSelected)(a,{event:n})}),n.stopPropagation())}),d.on("selectstart",function(){this.dragDrop&&this.dragDrop()})}}]).directive("dndList",["$parse","$timeout","dndDropEffectWorkaround","dndDragTypeWorkaround",function(e,n,r,t){return function(a,d,o){function i(e,n,r){var t=E?e.offsetX||e.layerX:e.offsetY||e.layerY,a=E?n.offsetWidth:n.offsetHeight,d=E?n.offsetLeft:n.offsetTop
|
||||
return d=r?d:0,d+a/2>t}function f(){var e
|
||||
return angular.forEach(d.children(),function(n){var r=angular.element(n)
|
||||
r.hasClass("dndPlaceholder")&&(e=r)}),e||angular.element("<li class='dndPlaceholder'></li>")}function l(){return Array.prototype.indexOf.call(D.children,v)}function g(e){if(!t.isDragging&&!y)return!1
|
||||
if(!c(e.dataTransfer.types))return!1
|
||||
if(o.dndAllowedTypes&&t.isDragging){var n=a.$eval(o.dndAllowedTypes)
|
||||
if(angular.isArray(n)&&-1===n.indexOf(t.dragType))return!1}return o.dndDisableIf&&a.$eval(o.dndDisableIf)?!1:!0}function s(){return p.remove(),d.removeClass("dndDragover"),!0}function u(n,r,d,o){return e(n)(a,{event:r,index:d,item:o||void 0,external:!t.isDragging,type:t.isDragging?t.dragType:void 0})}function c(e){if(!e)return!0
|
||||
for(var n=0;n<e.length;n++)if("Text"===e[n]||"text/plain"===e[n])return!0
|
||||
return!1}var p=f(),v=p[0],D=d[0]
|
||||
p.remove()
|
||||
var E=o.dndHorizontalList&&a.$eval(o.dndHorizontalList),y=o.dndExternalSources&&a.$eval(o.dndExternalSources)
|
||||
d.on("dragenter",function(e){return e=e.originalEvent||e,g(e)?void e.preventDefault():!0}),d.on("dragover",function(e){if(e=e.originalEvent||e,!g(e))return!0
|
||||
if(v.parentNode!=D&&d.append(p),e.target!==D){for(var n=e.target;n.parentNode!==D&&n.parentNode;)n=n.parentNode
|
||||
n.parentNode===D&&n!==v&&(i(e,n)?D.insertBefore(v,n):D.insertBefore(v,n.nextSibling))}else if(i(e,v,!0))for(;v.previousElementSibling&&(i(e,v.previousElementSibling,!0)||0===v.previousElementSibling.offsetHeight);)D.insertBefore(v,v.previousElementSibling)
|
||||
else for(;v.nextElementSibling&&!i(e,v.nextElementSibling,!0);)D.insertBefore(v,v.nextElementSibling.nextElementSibling)
|
||||
return o.dndDragover&&!u(o.dndDragover,e,l())?s():(d.addClass("dndDragover"),e.preventDefault(),e.stopPropagation(),!1)}),d.on("drop",function(e){if(e=e.originalEvent||e,!g(e))return!0
|
||||
!function(e){function n(e,n){return"all"==n?e:e.filter(function(e){return-1!=n.toLowerCase().indexOf(e)})}var a="application/x-dnd",r="application/json",t="Text",d=["move","copy","link"]
|
||||
e.directive("dndDraggable",["$parse","$timeout",function(e,i){return function(l,f,c){f.attr("draggable","true"),c.dndDisableIf&&l.$watch(c.dndDisableIf,function(e){f.attr("draggable",!e)}),f.on("dragstart",function(s){if(s=s.originalEvent||s,"false"==f.attr("draggable"))return!0
|
||||
o.isDragging=!0,o.itemType=c.dndType&&l.$eval(c.dndType).toLowerCase(),o.dropEffect="none",o.effectAllowed=c.dndEffectAllowed||d[0],s.dataTransfer.effectAllowed=o.effectAllowed
|
||||
var g=l.$eval(c.dndDraggable),u=a+(o.itemType?"-"+o.itemType:"")
|
||||
try{s.dataTransfer.setData(u,angular.toJson(g))}catch(p){var v=angular.toJson({item:g,type:o.itemType})
|
||||
try{s.dataTransfer.setData(r,v)}catch(p){var D=n(d,o.effectAllowed)
|
||||
s.dataTransfer.effectAllowed=D[0],s.dataTransfer.setData(t,v)}}if(f.addClass("dndDragging"),i(function(){f.addClass("dndDraggingSource")},0),s._dndHandle&&s.dataTransfer.setDragImage&&s.dataTransfer.setDragImage(f[0],0,0),e(c.dndDragstart)(l,{event:s}),c.dndCallback){var y=e(c.dndCallback)
|
||||
o.callback=function(e){return y(l,e||{})}}s.stopPropagation()}),f.on("dragend",function(n){n=n.originalEvent||n,l.$apply(function(){var a=o.dropEffect,r={copy:"dndCopied",link:"dndLinked",move:"dndMoved",none:"dndCanceled"}
|
||||
e(c[r[a]])(l,{event:n}),e(c.dndDragend)(l,{event:n,dropEffect:a})}),o.isDragging=!1,o.callback=void 0,f.removeClass("dndDragging"),f.removeClass("dndDraggingSource"),n.stopPropagation(),i(function(){f.removeClass("dndDraggingSource")},0)}),f.on("click",function(n){c.dndSelected&&(n=n.originalEvent||n,l.$apply(function(){e(c.dndSelected)(l,{event:n})}),n.stopPropagation())}),f.on("selectstart",function(){this.dragDrop&&this.dragDrop()})}}]),e.directive("dndList",["$parse",function(e){return function(i,l,f){function c(e){if(!e)return t
|
||||
for(var n=0;n<e.length;n++)if(e[n]==t||e[n]==r||e[n].substr(0,a.length)==a)return e[n]
|
||||
return null}function s(e){return o.isDragging?o.itemType||void 0:e==t||e==r?null:e&&e.substr(a.length+1)||void 0}function g(e){return E.disabled?!1:E.externalSources||o.isDragging?E.allowedTypes&&null!==e?e&&-1!=E.allowedTypes.indexOf(e):!0:!1}function u(e,a){var r=d
|
||||
return a||(r=n(r,e.dataTransfer.effectAllowed)),o.isDragging&&(r=n(r,o.effectAllowed)),f.dndEffectAllowed&&(r=n(r,f.dndEffectAllowed)),r.length?e.ctrlKey&&-1!=r.indexOf("copy")?"copy":e.altKey&&-1!=r.indexOf("link")?"link":r[0]:"none"}function p(){return T.remove(),l.removeClass("dndDragover"),!0}function v(n,a,r,t,d,l){return e(n)(i,{callback:o.callback,dropEffect:r,event:a,external:!o.isDragging,index:void 0!==d?d:D(),item:l||void 0,type:t})}function D(){return Array.prototype.indexOf.call(m.children,h)}function y(){var e
|
||||
return angular.forEach(l.children(),function(n){var a=angular.element(n)
|
||||
a.hasClass("dndPlaceholder")&&(e=a)}),e||angular.element("<li class='dndPlaceholder'></li>")}var T=y()
|
||||
T.remove()
|
||||
var h=T[0],m=l[0],E={}
|
||||
l.on("dragenter",function(e){e=e.originalEvent||e
|
||||
var n=f.dndAllowedTypes&&i.$eval(f.dndAllowedTypes)
|
||||
E={allowedTypes:angular.isArray(n)&&n.join("|").toLowerCase().split("|"),disabled:f.dndDisableIf&&i.$eval(f.dndDisableIf),externalSources:f.dndExternalSources&&i.$eval(f.dndExternalSources),horizontal:f.dndHorizontalList&&i.$eval(f.dndHorizontalList)}
|
||||
var a=c(e.dataTransfer.types)
|
||||
return a&&g(s(a))?void e.preventDefault():!0}),l.on("dragover",function(e){e=e.originalEvent||e
|
||||
var n=c(e.dataTransfer.types),a=s(n)
|
||||
if(!n||!g(a))return!0
|
||||
if(h.parentNode!=m&&l.append(T),e.target!=m){for(var r=e.target;r.parentNode!=m&&r.parentNode;)r=r.parentNode
|
||||
if(r.parentNode==m&&r!=h){var d=r.getBoundingClientRect()
|
||||
if(E.horizontal)var o=e.clientX<d.left+d.width/2
|
||||
else var o=e.clientY<d.top+d.height/2
|
||||
m.insertBefore(h,o?r:r.nextSibling)}}var i=n==t,D=u(e,i)
|
||||
return"none"==D?p():f.dndDragover&&!v(f.dndDragover,e,D,a)?p():(e.preventDefault(),i||(e.dataTransfer.dropEffect=D),l.addClass("dndDragover"),e.stopPropagation(),!1)}),l.on("drop",function(e){e=e.originalEvent||e
|
||||
var n=c(e.dataTransfer.types),a=s(n)
|
||||
if(!n||!g(a))return!0
|
||||
e.preventDefault()
|
||||
var n,t=e.dataTransfer.getData("Text")||e.dataTransfer.getData("text/plain")
|
||||
try{n=JSON.parse(t)}catch(d){return s()}var i=l()
|
||||
return o.dndDrop&&(n=u(o.dndDrop,e,i,n),!n)?s():(n!==!0&&a.$apply(function(){a.$eval(o.dndList).splice(i,0,n)}),u(o.dndInserted,e,i,n),"none"===e.dataTransfer.dropEffect?"copy"===e.dataTransfer.effectAllowed||"move"===e.dataTransfer.effectAllowed?r.dropEffect=e.dataTransfer.effectAllowed:r.dropEffect=e.ctrlKey?"copy":"move":r.dropEffect=e.dataTransfer.dropEffect,s(),e.stopPropagation(),!1)}),d.on("dragleave",function(e){e=e.originalEvent||e,d.removeClass("dndDragover"),n(function(){d.hasClass("dndDragover")||p.remove()},100)})}}]).directive("dndNodrag",function(){return function(e,n,r){n.attr("draggable","true"),n.on("dragstart",function(e){e=e.originalEvent||e,e._dndHandle||(e.dataTransfer.types&&e.dataTransfer.types.length||e.preventDefault(),e.stopPropagation())}),n.on("dragend",function(e){e=e.originalEvent||e,e._dndHandle||e.stopPropagation()})}}).directive("dndHandle",function(){return function(e,n,r){n.attr("draggable","true"),n.on("dragstart dragend",function(e){e=e.originalEvent||e,e._dndHandle=!0})}}).factory("dndDragTypeWorkaround",function(){return{}}).factory("dndDropEffectWorkaround",function(){return{}})
|
||||
try{var d=JSON.parse(e.dataTransfer.getData(n))}catch(l){return p()}if((n==t||n==r)&&(a=d.type||void 0,d=d.item,!g(a)))return p()
|
||||
var y=n==t,T=u(e,y)
|
||||
if("none"==T)return p()
|
||||
var h=D()
|
||||
return f.dndDrop&&(d=v(f.dndDrop,e,T,a,h,d),!d)?p():(o.dropEffect=T,y||(e.dataTransfer.dropEffect=T),d!==!0&&i.$apply(function(){i.$eval(f.dndList).splice(h,0,d)}),v(f.dndInserted,e,T,a,h,d),p(),e.stopPropagation(),!1)}),l.on("dragleave",function(e){e=e.originalEvent||e
|
||||
var n=document.elementFromPoint(e.clientX,e.clientY)
|
||||
m.contains(n)&&!e._dndPhShown?e._dndPhShown=!0:p()})}}]),e.directive("dndNodrag",function(){return function(e,n,a){n.attr("draggable","true"),n.on("dragstart",function(e){e=e.originalEvent||e,e._dndHandle||(e.dataTransfer.types&&e.dataTransfer.types.length||e.preventDefault(),e.stopPropagation())}),n.on("dragend",function(e){e=e.originalEvent||e,e._dndHandle||e.stopPropagation()})}}),e.directive("dndHandle",function(){return function(e,n,a){n.attr("draggable","true"),n.on("dragstart dragend",function(e){e=e.originalEvent||e,e._dndHandle=!0})}})
|
||||
var o={}}(angular.module("dndLists",[]));
|
||||
|
|
4
js/vendor/angular-draganddrop/bower.json
vendored
4
js/vendor/angular-draganddrop/bower.json
vendored
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"name": "angular-drag-and-drop-lists",
|
||||
"main": "angular-drag-and-drop-lists.js",
|
||||
"version": "1.4.0",
|
||||
"version": "2.1.0",
|
||||
"homepage": "https://github.com/marceljuenemann/angular-drag-and-drop-lists",
|
||||
"authors": [
|
||||
"Marcel Juenemann <mail@marcel-juenemann.de>"
|
||||
"Marcel Juenemann <marcel@juenemann.cc>"
|
||||
],
|
||||
"description": "Angular directives for sorting nested lists using the HTML5 Drag & Drop API",
|
||||
"keywords": [
|
||||
|
|
10
js/vendor/angular-ui-select/.bower.json
vendored
10
js/vendor/angular-ui-select/.bower.json
vendored
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"name": "angular-ui-select",
|
||||
"version": "0.17.0",
|
||||
"homepage": "https://github.com/angular-ui/ui-select",
|
||||
"authors": [
|
||||
"AngularUI"
|
||||
|
@ -29,13 +28,14 @@
|
|||
"angular-sanitize": ">=1.2.18",
|
||||
"angular-mocks": ">=1.2.18"
|
||||
},
|
||||
"_release": "0.17.0",
|
||||
"version": "0.19.8",
|
||||
"_release": "0.19.8",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v0.17.0",
|
||||
"commit": "c41b8928a846288583cd977b48a499d35a53ac45"
|
||||
"tag": "v0.19.8",
|
||||
"commit": "fc6502179847b41f864be042d432eec32e8530c4"
|
||||
},
|
||||
"_source": "https://github.com/angular-ui/ui-select.git",
|
||||
"_target": "v0.17.0",
|
||||
"_target": "v0.19.8",
|
||||
"_originalSource": "https://github.com/angular-ui/ui-select.git"
|
||||
}
|
142
js/vendor/angular-ui-select/CHANGELOG.md
vendored
142
js/vendor/angular-ui-select/CHANGELOG.md
vendored
|
@ -1,7 +1,143 @@
|
|||
<a name="0.16.1"></a>
|
||||
## [0.16.1](https://github.com/angular-ui/ui-select/compare/v0.16.1...v0.16.1) (2016-05-11)
|
||||
<a name="0.19.8"></a>
|
||||
## [0.19.8](https://github.com/angular-ui/ui-select/compare/v0.19.7...v0.19.8) (2017-04-15)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.19.6"></a>
|
||||
## [0.19.6](https://github.com/angular-ui/ui-select/compare/v0.19.6...v0.19.6) (2017-04-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lockedItems:** Properly unlock locked items when lock conditions change ([10ee076](https://github.com/angular-ui/ui-select/commit/10ee076)), closes [#1824](https://github.com/angular-ui/ui-select/issues/1824)
|
||||
* **select-spinner:** fix spec test ([2d62e0b](https://github.com/angular-ui/ui-select/commit/2d62e0b))
|
||||
* **spec:** Use exceptionHandler to test errors. (#1879) ([b549db9](https://github.com/angular-ui/ui-select/commit/b549db9)), closes [#1877](https://github.com/angular-ui/ui-select/issues/1877)
|
||||
* **spinner-class:** add glyphicon to default spinner class, update css. Fixes #1893. ([c8f69db](https://github.com/angular-ui/ui-select/commit/c8f69db)), closes [#1893](https://github.com/angular-ui/ui-select/issues/1893)
|
||||
* **uiSelectChoices:** prevent template element from being modified (#1850) ([7aabdc4](https://github.com/angular-ui/ui-select/commit/7aabdc4)), closes [#1851](https://github.com/angular-ui/ui-select/issues/1851)
|
||||
* **uiSelectCtrl:** Reset refreshing flag even if async request errors ([be60430](https://github.com/angular-ui/ui-select/commit/be60430)), closes [#1833](https://github.com/angular-ui/ui-select/issues/1833)
|
||||
* **uiSelectMatch:** set model value to `null` when cleared ([f711ec2](https://github.com/angular-ui/ui-select/commit/f711ec2)), closes [#863](https://github.com/angular-ui/ui-select/issues/863)
|
||||
* **uiSelectMultiple:** Don't call onSelectCallback if limit already reached ([b7ac99a](https://github.com/angular-ui/ui-select/commit/b7ac99a)), closes [#1836](https://github.com/angular-ui/ui-select/issues/1836)
|
||||
|
||||
### Features
|
||||
|
||||
* **Header & Footer:** Add header & footer to the dropdown list. ([f65bad1](https://github.com/angular-ui/ui-select/commit/f65bad1))
|
||||
* **uiSelectSingle:** add option to avoid backspace resetting the model ([7413321](https://github.com/angular-ui/ui-select/commit/7413321)), closes [#926](https://github.com/angular-ui/ui-select/issues/926) [#525](https://github.com/angular-ui/ui-select/issues/525)
|
||||
|
||||
|
||||
|
||||
<a name="0.19.5"></a>
|
||||
## [0.19.5](https://github.com/angular-ui/ui-select/compare/v0.19.5...v0.19.5) (2016-10-24)
|
||||
|
||||
## Reverted
|
||||
|
||||
* **Bug fix:** Search input isn't blocked ([0d81493](https://github.com/angular-ui/ui-select/commit/0d81493))
|
||||
|
||||
<a name="0.19.4"></a>
|
||||
## [0.19.4](https://github.com/angular-ui/ui-select/compare/v0.19.4...v0.19.4) (2016-10-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bootstrap:** add aria-expanded to the multiple select ([6766754](https://github.com/angular-ui/ui-select/commit/6766754)), closes [#1775](https://github.com/angular-ui/ui-select/issues/1775)
|
||||
* ensure aria-activedescendant is correct ([e3be4d1](https://github.com/angular-ui/ui-select/commit/e3be4d1))
|
||||
* only apply listbox role when open ([e902ffc](https://github.com/angular-ui/ui-select/commit/e902ffc))
|
||||
* **bootstrap:** add search role ([f3194bf](https://github.com/angular-ui/ui-select/commit/f3194bf))
|
||||
|
||||
### Features
|
||||
|
||||
* **selectize:** add support for multiple selection ([ff8071d](https://github.com/angular-ui/ui-select/commit/ff8071d)), closes [#295](https://github.com/angular-ui/ui-select/issues/295) [#1787](https://github.com/angular-ui/ui-select/issues/1787)
|
||||
|
||||
<a name="0.19.3"></a>
|
||||
## [0.19.3](https://github.com/angular-ui/ui-select/compare/v0.19.3...v0.19.3) (2016-08-17)
|
||||
|
||||
|
||||
<a name="0.19.2"></a>
|
||||
## [0.19.2](https://github.com/angular-ui/ui-select/compare/v0.19.0...v0.19.2) (2016-08-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bootstrap layout:** Restrict selected length to ui-select-container (#1680) ([01055c5](https://github.com/angular-ui/ui-select/commit/01055c5)), closes [#1576](https://github.com/angular-ui/ui-select/issues/1576)
|
||||
* **release:** bump version with built files ([76cf9c3](https://github.com/angular-ui/ui-select/commit/76cf9c3))
|
||||
|
||||
<a name="0.19.1"></a>
|
||||
## [0.19.1](https://github.com/angular-ui/ui-select/compare/v0.19.0...v0.19.1) (2016-08-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bootstrap layout:** Restrict selected length to ui-select-container (#1680) ([01055c5](https://github.com/angular-ui/ui-select/commit/01055c5)), closes [#1576](https://github.com/angular-ui/ui-select/issues/1576)
|
||||
|
||||
<a name="0.19.0"></a>
|
||||
# [0.19.0](https://github.com/angular-ui/ui-select/compare/v0.19.0...v0.19.0) (2016-08-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bootstrap layout:** Restrict selected length to ui-select-container (#1680) ([01055c5](https://github.com/angular-ui/ui-select/commit/01055c5)), closes [#1576](https://github.com/angular-ui/ui-select/issues/1576)
|
||||
|
||||
<a name="0.18.1"></a>
|
||||
## [0.18.1](https://github.com/angular-ui/ui-select/compare/v0.18.1...v0.18.1) (2016-08-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bootstrap:** remove anchor tag in choices ([b15189d](https://github.com/angular-ui/ui-select/commit/b15189d))
|
||||
* **uiSelect:** remove flicker on search change ([81c33d0](https://github.com/angular-ui/ui-select/commit/81c33d0)), closes [#1298](https://github.com/angular-ui/ui-select/issues/1298) [#1594](https://github.com/angular-ui/ui-select/issues/1594) [#1557](https://github.com/angular-ui/ui-select/issues/1557)
|
||||
* **uiSelectController:** Select by click on non-multiple tagging (bis) (#1727) ([3dfde71](https://github.com/angular-ui/ui-select/commit/3dfde71))
|
||||
|
||||
### Features
|
||||
|
||||
* **events:** add open-close callback ([21bcd5e](https://github.com/angular-ui/ui-select/commit/21bcd5e)), closes [#432](https://github.com/angular-ui/ui-select/issues/432) [#1153](https://github.com/angular-ui/ui-select/issues/1153)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **repeatParserService:** track groups by name ([1770038](https://github.com/angular-ui/ui-select/commit/1770038)), closes [#1721](https://github.com/angular-ui/ui-select/issues/1721) [#1722](https://github.com/angular-ui/ui-select/issues/1722)
|
||||
|
||||
<a name="0.18.1"></a>
|
||||
## [0.18.1](https://github.com/angular-ui/ui-select/compare/v0.18.0...v0.18.1) (2016-07-10)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **isDisabled:** do not modify item ([b95bf9f](https://github.com/angular-ui/ui-select/commit/b95bf9f)), closes [#1200](https://github.com/angular-ui/ui-select/issues/1200) [#1661](https://github.com/angular-ui/ui-select/issues/1661)
|
||||
* **isLocked:** do not modify item ([c01d363](https://github.com/angular-ui/ui-select/commit/c01d363)), closes [#1269](https://github.com/angular-ui/ui-select/issues/1269) [#514](https://github.com/angular-ui/ui-select/issues/514)
|
||||
* **removeSelected:** fix incorrect removal of preselected item ([32b7924](https://github.com/angular-ui/ui-select/commit/32b7924)), closes [#1672](https://github.com/angular-ui/ui-select/issues/1672)
|
||||
* **searchEnabled:** watch evaluated attribute value ([4503295](https://github.com/angular-ui/ui-select/commit/4503295)), closes [#505](https://github.com/angular-ui/ui-select/issues/505)
|
||||
* **select2:** Up-direction when using global theme ([5336dc5](https://github.com/angular-ui/ui-select/commit/5336dc5)), closes [#1674](https://github.com/angular-ui/ui-select/issues/1674)
|
||||
* **Selectize:** hide input box when selected data is 0 ([e179dc6](https://github.com/angular-ui/ui-select/commit/e179dc6)), closes [#1304](https://github.com/angular-ui/ui-select/issues/1304)
|
||||
* **tagging:** infite digest loops when name is similar ([fcd9bc5](https://github.com/angular-ui/ui-select/commit/fcd9bc5)), closes [#1693](https://github.com/angular-ui/ui-select/issues/1693)
|
||||
* **tagging:** Support paste with tagging enabled and tagging-label="false" ([668a0f3](https://github.com/angular-ui/ui-select/commit/668a0f3)), closes [#1668](https://github.com/angular-ui/ui-select/issues/1668)
|
||||
* **uiSelectMultiple:** $select.refreshItems is not a function ([a41a7fc](https://github.com/angular-ui/ui-select/commit/a41a7fc))
|
||||
* **uiSelectMultiple:** Allow duplicates in $select.selected ([9f5d6ec](https://github.com/angular-ui/ui-select/commit/9f5d6ec)), closes [#1688](https://github.com/angular-ui/ui-select/issues/1688)
|
||||
* **uiSelectMultiple:** tolerate null/undefined view value ([0c29b64](https://github.com/angular-ui/ui-select/commit/0c29b64))
|
||||
* **uiSelectNoChoice:** support Select2 theme ([e59e008](https://github.com/angular-ui/ui-select/commit/e59e008)), closes [#1608](https://github.com/angular-ui/ui-select/issues/1608)
|
||||
* **uiSelectNoChoice:** support Selectize theme ([a7210c4](https://github.com/angular-ui/ui-select/commit/a7210c4)), closes [#1692](https://github.com/angular-ui/ui-select/issues/1692)
|
||||
|
||||
<a name="0.18.0"></a>
|
||||
## [0.18.0](https://github.com/angular-ui/ui-select/compare/v0.17.1...v0.18.0) (2016-06-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **positioning:** stop flicker when closed ([ca4d09e](https://github.com/angular-ui/ui-select/commit/ca4d09e))
|
||||
* **positioning:** wait for animation to complete ([aa90dd8](https://github.com/angular-ui/ui-select/commit/aa90dd8)), closes [#1593](https://github.com/angular-ui/ui-select/issues/1593)
|
||||
* search input width resizing ([5c8cf86](https://github.com/angular-ui/ui-select/commit/5c8cf86)), closes [#1575](https://github.com/angular-ui/ui-select/issues/1575)
|
||||
* **uiSelectCtrl:** Prevent error when using ngAnimate < v1.4 ([8becac3](https://github.com/angular-ui/ui-select/commit/8becac3)), closes [#1626](https://github.com/angular-ui/ui-select/issues/1626)
|
||||
* **uiSelectNoChoice:** make compatible with Angular 1.5 ([c944307](https://github.com/angular-ui/ui-select/commit/c944307)), closes [#1609](https://github.com/angular-ui/ui-select/issues/1609)
|
||||
* **uiSelectNoChoice:** support bootstrap-multiple ([9d29307](https://github.com/angular-ui/ui-select/commit/9d29307)), closes [#1614](https://github.com/angular-ui/ui-select/issues/1614) [#1615](https://github.com/angular-ui/ui-select/issues/1615)
|
||||
|
||||
### Features
|
||||
|
||||
* **limit:** Change multi-select limit attr (#1632) ([f5888fb](https://github.com/angular-ui/ui-select/commit/f5888fb))
|
||||
* **removeSelected:** Implement removeSelected property for multiple selects ([3ad084f](https://github.com/angular-ui/ui-select/commit/3ad084f))
|
||||
|
||||
<a name="0.17.1"></a>
|
||||
## [0.17.1](https://github.com/angular-ui/ui-select/compare/v0.17.0...v0.17.1) (2016-05-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **parserResult:** Ignore undefined parserResult when using custom tpl ([cee24e5](https://github.com/angular-ui/ui-select/commit/cee24e5)), closes [#1597](https://github.com/angular-ui/ui-select/issues/1597)
|
||||
* **select2:** hide dropdown if there are no items to show (same as #1588 for bootstrap) ([4c561ac](https://github.com/angular-ui/ui-select/commit/4c561ac))
|
||||
|
||||
<a name="0.17.0"></a>
|
||||
## [0.17.0](https://github.com/angular-ui/ui-select/compare/v0.16.1...v0.17.0) (2016-05-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **a11y:** prevent list from being focusable ([4e9ab7e](https://github.com/angular-ui/ui-select/commit/4e9ab7e)), closes [#898](https://github.com/angular-ui/ui-select/issues/898)
|
||||
|
@ -33,8 +169,6 @@
|
|||
* **uiSelectCtrl:** moving activate events out of $timeout ([926f462](https://github.com/angular-ui/ui-select/commit/926f462))
|
||||
* change test in ctrl.isActive ([d6c14d4](https://github.com/angular-ui/ui-select/commit/d6c14d4))
|
||||
|
||||
|
||||
|
||||
<a name="0.16.1"></a>
|
||||
# [0.16.1](https://github.com/angular-ui/ui-select/compare/v0.16.0...v0.16.1) (2016-03-23)
|
||||
|
||||
|
|
2
js/vendor/angular-ui-select/CONTRIBUTING.md
vendored
2
js/vendor/angular-ui-select/CONTRIBUTING.md
vendored
|
@ -42,6 +42,8 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
|
|||
support for markdown and templating via @ngdoc tag). To see how we document our APIs, please check
|
||||
out the existing ngdocs and see [this wiki page][ngDocs].
|
||||
|
||||
**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
|
||||
|
||||
## <a name="commit"></a> Git Commit Guidelines
|
||||
|
||||
We have very precise rules over how our git commit messages can be formatted for maintenance of the changelog and semvar versioning. This leads to **more
|
||||
|
|
3
js/vendor/angular-ui-select/README.md
vendored
3
js/vendor/angular-ui-select/README.md
vendored
|
@ -1,4 +1,5 @@
|
|||
# AngularJS ui-select [![Build Status](https://travis-ci.org/angular-ui/ui-select.svg?branch=master)](https://travis-ci.org/angular-ui/ui-select) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular-ui/ui-select?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
# AngularJS ui-select [![Build Status](https://travis-ci.org/angular-ui/ui-select.svg?branch=master)](https://travis-ci.org/angular-ui/ui-select) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular-ui/ui-select?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
|
||||
|
||||
|
||||
AngularJS-native version of [Select2](http://ivaynberg.github.io/select2/) and [Selectize](http://brianreavis.github.io/selectize.js/). [http://angular-ui.github.io/ui-select/](http://angular-ui.github.io/ui-select/)
|
||||
|
||||
|
|
3
js/vendor/angular-ui-select/bower.json
vendored
3
js/vendor/angular-ui-select/bower.json
vendored
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"name": "angular-ui-select",
|
||||
"version": "0.17.0",
|
||||
"name": "angular-ui-select",
|
||||
"homepage": "https://github.com/angular-ui/ui-select",
|
||||
"authors": [
|
||||
"AngularUI"
|
||||
|
|
6
js/vendor/angular-ui-select/deploy-docs.sh
vendored
6
js/vendor/angular-ui-select/deploy-docs.sh
vendored
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -e
|
||||
|
||||
[[ $TRAVIS_SECURE_ENV_VARS == "true" ]] || { echo "No github key avaliable, aborting publishing"; exit 0; }
|
||||
|
||||
|
@ -27,5 +27,5 @@ git config user.email "travisci@users.noreply.github.com"
|
|||
git commit -m "docs(*): new deploy (angular-ui/ui-select@${ID_REF})"
|
||||
|
||||
|
||||
git push origin --quiet
|
||||
#> /dev/null 2>&1
|
||||
git push origin --quiet
|
||||
#> /dev/null 2>&1
|
||||
|
|
125
js/vendor/angular-ui-select/dist/select.css
vendored
125
js/vendor/angular-ui-select/dist/select.css
vendored
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* ui-select
|
||||
* http://github.com/angular-ui/ui-select
|
||||
* Version: 0.16.0 - 2016-03-23T20:51:56.678Z
|
||||
* Version: 0.19.7 - 2017-04-15T14:28:36.790Z
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
|
@ -54,12 +54,14 @@ body > .select2-container.open {
|
|||
}
|
||||
|
||||
/* Handle up direction Select2 */
|
||||
.ui-select-container[theme="select2"].direction-up .ui-select-match {
|
||||
.ui-select-container[theme="select2"].direction-up .ui-select-match,
|
||||
.ui-select-container.select2.direction-up .ui-select-match {
|
||||
border-radius: 4px; /* FIXME hardcoded value :-/ */
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
.ui-select-container[theme="select2"].direction-up .ui-select-dropdown {
|
||||
.ui-select-container[theme="select2"].direction-up .ui-select-dropdown,
|
||||
.ui-select-container.select2.direction-up .ui-select-dropdown {
|
||||
border-radius: 4px; /* FIXME hardcoded value :-/ */
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
|
@ -71,13 +73,25 @@ body > .select2-container.open {
|
|||
|
||||
margin-top: -4px; /* FIXME hardcoded value :-/ */
|
||||
}
|
||||
.ui-select-container[theme="select2"].direction-up .ui-select-dropdown .select2-search {
|
||||
.ui-select-container[theme="select2"].direction-up .ui-select-dropdown .select2-search,
|
||||
.ui-select-container.select2.direction-up .ui-select-dropdown .select2-search {
|
||||
margin-top: 4px; /* FIXME hardcoded value :-/ */
|
||||
}
|
||||
.ui-select-container[theme="select2"].direction-up.select2-dropdown-open .ui-select-match {
|
||||
.ui-select-container[theme="select2"].direction-up.select2-dropdown-open .ui-select-match,
|
||||
.ui-select-container.select2.direction-up.select2-dropdown-open .ui-select-match {
|
||||
border-bottom-color: #5897fb;
|
||||
}
|
||||
|
||||
.ui-select-container[theme="select2"] .ui-select-dropdown .ui-select-search-hidden,
|
||||
.ui-select-container[theme="select2"] .ui-select-dropdown .ui-select-search-hidden input{
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
min-height: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border:0;
|
||||
}
|
||||
|
||||
/* Selectize theme */
|
||||
|
||||
/* Helper class to show styles when focus */
|
||||
|
@ -86,10 +100,15 @@ body > .select2-container.open {
|
|||
}
|
||||
|
||||
/* Fix input width for Selectize theme */
|
||||
.selectize-control > .selectize-input > input {
|
||||
.selectize-control.single > .selectize-input > input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Fix line break when there's at least one item selected with the Selectize theme */
|
||||
.selectize-control.multi > .selectize-input > input {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
/* Fix dropdown width for Selectize theme */
|
||||
.selectize-control > .selectize-dropdown {
|
||||
width: 100%;
|
||||
|
@ -103,10 +122,19 @@ body > .select2-container.open {
|
|||
/* Handle up direction Selectize */
|
||||
.ui-select-container[theme="selectize"].direction-up .ui-select-dropdown {
|
||||
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
|
||||
|
||||
margin-top: -2px; /* FIXME hardcoded value :-/ */
|
||||
}
|
||||
|
||||
.ui-select-container[theme="selectize"] input.ui-select-search-hidden{
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
min-height: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border:0;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
/* Bootstrap theme */
|
||||
|
||||
/* Helper class to show styles when focus */
|
||||
|
@ -149,6 +177,15 @@ body > .select2-container.open {
|
|||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
.ui-select-bootstrap .ui-select-search-hidden{
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
min-height: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border:0;
|
||||
}
|
||||
|
||||
.ui-select-bootstrap > .ui-select-match > .btn{
|
||||
/* Instead of center because of .btn */
|
||||
text-align: left !important;
|
||||
|
@ -161,7 +198,7 @@ body > .select2-container.open {
|
|||
}
|
||||
|
||||
/* See Scrollable Menu with Bootstrap 3 http://stackoverflow.com/questions/19227496 */
|
||||
.ui-select-bootstrap > .ui-select-choices {
|
||||
.ui-select-bootstrap > .ui-select-choices ,.ui-select-bootstrap > .ui-select-no-choice {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-height: 200px;
|
||||
|
@ -200,7 +237,11 @@ body > .ui-select-bootstrap.open {
|
|||
position: relative;
|
||||
}
|
||||
|
||||
.ui-select-multiple .ui-select-match-item.dropping-before:before {
|
||||
.ui-select-multiple .ui-select-match-item.dropping .ui-select-match-close {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.ui-select-multiple:hover .ui-select-match-item.dropping-before:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
@ -210,7 +251,7 @@ body > .ui-select-bootstrap.open {
|
|||
border-left: 1px solid #428bca;
|
||||
}
|
||||
|
||||
.ui-select-multiple .ui-select-match-item.dropping-after:after {
|
||||
.ui-select-multiple:hover .ui-select-match-item.dropping-after:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
@ -220,7 +261,8 @@ body > .ui-select-bootstrap.open {
|
|||
border-right: 1px solid #428bca;
|
||||
}
|
||||
|
||||
.ui-select-bootstrap .ui-select-choices-row>a {
|
||||
.ui-select-bootstrap .ui-select-choices-row>span {
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
padding: 3px 20px;
|
||||
clear: both;
|
||||
|
@ -230,21 +272,21 @@ body > .ui-select-bootstrap.open {
|
|||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ui-select-bootstrap .ui-select-choices-row>a:hover, .ui-select-bootstrap .ui-select-choices-row>a:focus {
|
||||
.ui-select-bootstrap .ui-select-choices-row>span:hover, .ui-select-bootstrap .ui-select-choices-row>span:focus {
|
||||
text-decoration: none;
|
||||
color: #262626;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.ui-select-bootstrap .ui-select-choices-row.active>a {
|
||||
.ui-select-bootstrap .ui-select-choices-row.active>span {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
outline: 0;
|
||||
background-color: #428bca;
|
||||
}
|
||||
|
||||
.ui-select-bootstrap .ui-select-choices-row.disabled>a,
|
||||
.ui-select-bootstrap .ui-select-choices-row.active.disabled>a {
|
||||
.ui-select-bootstrap .ui-select-choices-row.disabled>span,
|
||||
.ui-select-bootstrap .ui-select-choices-row.active.disabled>span {
|
||||
color: #777;
|
||||
cursor: not-allowed;
|
||||
background-color: #fff;
|
||||
|
@ -265,3 +307,56 @@ body > .ui-select-bootstrap.open {
|
|||
.ui-select-container[theme="bootstrap"].direction-up .ui-select-dropdown {
|
||||
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.ui-select-bootstrap .ui-select-match-text {
|
||||
width: 100%;
|
||||
padding-right: 1em;
|
||||
}
|
||||
.ui-select-bootstrap .ui-select-match-text span {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.ui-select-bootstrap .ui-select-toggle > a.btn {
|
||||
position: absolute;
|
||||
height: 10px;
|
||||
right: 10px;
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
/* Spinner */
|
||||
.ui-select-refreshing.glyphicon {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
padding: 8px 27px;
|
||||
}
|
||||
|
||||
@-webkit-keyframes ui-select-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
@keyframes ui-select-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
.ui-select-spin {
|
||||
-webkit-animation: ui-select-spin 2s infinite linear;
|
||||
animation: ui-select-spin 2s infinite linear;
|
||||
}
|
||||
|
||||
.ui-select-refreshing.ng-animate {
|
||||
-webkit-animation: none 0s;
|
||||
}
|
||||
|
|
770
js/vendor/angular-ui-select/dist/select.js
vendored
770
js/vendor/angular-ui-select/dist/select.js
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
1
js/vendor/angular-ui-select/dist/select.min.css.map
vendored
Normal file
1
js/vendor/angular-ui-select/dist/select.min.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
js/vendor/angular-ui-select/dist/select.min.js.map
vendored
Normal file
1
js/vendor/angular-ui-select/dist/select.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -14,7 +14,7 @@ app.filter('propsFilter', function() {
|
|||
|
||||
if (angular.isArray(items)) {
|
||||
var keys = Object.keys(props);
|
||||
|
||||
|
||||
items.forEach(function(item) {
|
||||
var itemMatches = false;
|
||||
|
||||
|
@ -150,6 +150,8 @@ app.controller('DemoCtrl', function ($scope, $http, $timeout, $interval) {
|
|||
vm.person.selectedValue = vm.peopleObj[3];
|
||||
vm.person.selectedSingle = 'Samantha';
|
||||
vm.person.selectedSingleKey = '5';
|
||||
// To run the demos with a preselected person object, uncomment the line below.
|
||||
//vm.person.selected = vm.person.selectedValue;
|
||||
|
||||
vm.people = [
|
||||
{ name: 'Adam', email: 'adam@email.com', age: 12, country: 'United States' },
|
||||
|
@ -175,6 +177,7 @@ app.controller('DemoCtrl', function ($scope, $http, $timeout, $interval) {
|
|||
vm.multipleDemo.selectedPeople2 = vm.multipleDemo.selectedPeople;
|
||||
vm.multipleDemo.selectedPeopleWithGroupBy = [vm.people[8], vm.people[6]];
|
||||
vm.multipleDemo.selectedPeopleSimple = ['samantha@email.com','wladimir@email.com'];
|
||||
vm.multipleDemo.removeSelectIsFalse = [vm.people[2], vm.people[0]];
|
||||
|
||||
vm.appendToBodyDemo = {
|
||||
remainingToggleTime: 0,
|
||||
|
|
|
@ -164,7 +164,6 @@ section {
|
|||
text-shadow: 0 1px 0 rgba(0,0,0,.15);
|
||||
color: #cdbfe3;
|
||||
background-color: #563d7c;
|
||||
background-image: url(header.png);
|
||||
}
|
||||
|
||||
.bs-header a {
|
||||
|
|
4
js/vendor/angular-ui-select/docs/index.html
vendored
4
js/vendor/angular-ui-select/docs/index.html
vendored
|
@ -135,7 +135,7 @@
|
|||
<a href="http://angularjs.org" target="_blank">AngularJS</a> (requires AngularJS 1.2.x or higher, tested with 1.5.3).
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://angularjs.org" target="_blank">Angular-Sanitze</a> (the version should match your version of angular.js).
|
||||
<a href="http://angularjs.org" target="_blank">Angular-Sanitize</a> (the version should match your version of angular.js).
|
||||
</li>
|
||||
<li>
|
||||
The matching CSS for your the theme you wish to use:
|
||||
|
@ -188,4 +188,4 @@
|
|||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
<title>AngularJS ui-select</title>
|
||||
|
||||
<!--
|
||||
IE8 support, see AngularJS Internet Explorer Compatibility http://docs.angularjs.org/guide/ie
|
||||
IE8 support, see AngularJS Internet Explorer Compatibility https://docs.angularjs.org/guide/ie
|
||||
For Firefox 3.6, you will also need to include jQuery and ECMAScript 5 shim
|
||||
-->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.js"></script>
|
||||
<script>
|
||||
document.createElement('ui-select');
|
||||
document.createElement('ui-select-match');
|
||||
|
@ -18,8 +18,8 @@
|
|||
</script>
|
||||
<![endif]-->
|
||||
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js"></script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular-sanitize.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular-sanitize.js"></script>
|
||||
|
||||
<!-- ui-select files -->
|
||||
<script src="./dist/select.js"></script>
|
||||
|
@ -28,11 +28,11 @@
|
|||
<script src="./assets/demo.js"></script>
|
||||
|
||||
<!-- themes -->
|
||||
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.css">
|
||||
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.css">
|
||||
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.default.css">
|
||||
<!-- <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.bootstrap2.css"> -->
|
||||
<!--<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.bootstrap3.css">-->
|
||||
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.default.css">
|
||||
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.bootstrap2.css"> -->
|
||||
<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.bootstrap3.css">-->
|
||||
|
||||
<style>
|
||||
body {
|
||||
|
|
9
js/vendor/angular-ui-select/package.json
vendored
9
js/vendor/angular-ui-select/package.json
vendored
|
@ -7,7 +7,7 @@
|
|||
"url": "git://github.com/angular-ui/ui-select.git"
|
||||
},
|
||||
"style": "dist/select.css",
|
||||
"version": "0.17.0",
|
||||
"version": "0.19.8",
|
||||
"devDependencies": {
|
||||
"angular": "^1.2.18",
|
||||
"angular-mocks": "^1.2.18",
|
||||
|
@ -19,12 +19,12 @@
|
|||
"gulp": "^3.9.1",
|
||||
"gulp-angular-templatecache": "^1.8.0",
|
||||
"gulp-bump": "^1.0.0",
|
||||
"gulp-conventional-changelog": "^0.7.0",
|
||||
"gulp-concat": "^2.6.0",
|
||||
"gulp-conventional-changelog": "^0.7.0",
|
||||
"gulp-filenames": "^2.0.0",
|
||||
"gulp-footer": "^1.0.5",
|
||||
"gulp-git": "^1.4.0",
|
||||
"gulp-header": "^1.7.1",
|
||||
"gulp-footer": "^1.0.5",
|
||||
"gulp-jshint": "^2.0.0",
|
||||
"gulp-load-plugins": "^1.1.0",
|
||||
"gulp-minify-css": "^1.2.4",
|
||||
|
@ -40,12 +40,13 @@
|
|||
"jshint-stylish": "~0.3.0",
|
||||
"karma": "^0.12.16",
|
||||
"karma-chrome-launcher": "^0.1.3",
|
||||
"karma-coverage": "~0.2",
|
||||
"karma-firefox-launcher": "~0.1",
|
||||
"karma-jasmine": "~0.2",
|
||||
"karma-ng-html2js-preprocessor": "^0.1.0",
|
||||
"karma-phantomjs-launcher": "~0.1.4",
|
||||
"karma-coverage": "~0.2",
|
||||
"run-sequence": "^1.1.5",
|
||||
"streamqueue": "^1.1.1",
|
||||
"title-case": "^1.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
32
js/vendor/davclient.js/.bower.json
vendored
32
js/vendor/davclient.js/.bower.json
vendored
|
@ -1,32 +0,0 @@
|
|||
{
|
||||
"name": "davclient.js",
|
||||
"version": "0.0.1",
|
||||
"authors": [
|
||||
"Evert Pot <me@evertpot.com>"
|
||||
],
|
||||
"description": "A WebDAV, CalDAV and CardDAV client for browsers.",
|
||||
"main": "lib/client.js",
|
||||
"keywords": [
|
||||
"webdav",
|
||||
"caldav",
|
||||
"carddav"
|
||||
],
|
||||
"license": "MIT",
|
||||
"homepage": "http://sabre.io/",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
"_release": "0.0.1",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "0.0.1",
|
||||
"commit": "2d054c63ba5bf7f7d40de904a742f3ad9c71e63c"
|
||||
},
|
||||
"_source": "https://github.com/evert/davclient.js.git",
|
||||
"_target": "*",
|
||||
"_originalSource": "https://github.com/evert/davclient.js.git"
|
||||
}
|
27
js/vendor/davclient.js/LICENSE
vendored
27
js/vendor/davclient.js/LICENSE
vendored
|
@ -1,27 +0,0 @@
|
|||
Copyright (C) 2013-2014 fruux GmbH (https://fruux.com/)
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name Sabre nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
23
js/vendor/davclient.js/bower.json
vendored
23
js/vendor/davclient.js/bower.json
vendored
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
"name": "davclient.js",
|
||||
"version": "0.0.1",
|
||||
"authors": [
|
||||
"Evert Pot <me@evertpot.com>"
|
||||
],
|
||||
"description": "A WebDAV, CalDAV and CardDAV client for browsers.",
|
||||
"main": "lib/client.js",
|
||||
"keywords": [
|
||||
"webdav",
|
||||
"caldav",
|
||||
"carddav"
|
||||
],
|
||||
"license": "MIT",
|
||||
"homepage": "http://sabre.io/",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
28
js/vendor/davclient.js/index.html
vendored
28
js/vendor/davclient.js/index.html
vendored
|
@ -1,28 +0,0 @@
|
|||
<!DOCTYPE html!>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script src="lib/client.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script>
|
||||
|
||||
var client = new dav.Client({
|
||||
baseUrl : 'http://moz.fruux.net//',
|
||||
userName : 'user1',
|
||||
password : 'password'
|
||||
});
|
||||
|
||||
client.propFind('/', ['{DAV:}current-user-principal']).then(
|
||||
function(result) {
|
||||
console.log(result);
|
||||
},
|
||||
function(err) {
|
||||
console.log(err);
|
||||
}
|
||||
);
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
66
js/vendor/davclient.js/karma.conf.js
vendored
66
js/vendor/davclient.js/karma.conf.js
vendored
|
@ -1,66 +0,0 @@
|
|||
// Karma configuration
|
||||
// Generated on Tue Sep 01 2015 12:55:42 GMT+0200 (CEST)
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
|
||||
// base path that will be used to resolve all patterns (eg. files, exclude)
|
||||
basePath: '',
|
||||
|
||||
|
||||
// frameworks to use
|
||||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'lib/*.js',
|
||||
'tests/*.js'
|
||||
],
|
||||
|
||||
|
||||
// list of files to exclude
|
||||
exclude: [
|
||||
],
|
||||
|
||||
|
||||
// preprocess matching files before serving them to the browser
|
||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||
preprocessors: {
|
||||
},
|
||||
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress'
|
||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||
reporters: ['progress'],
|
||||
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
|
||||
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors: true,
|
||||
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
|
||||
|
||||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: ['PhantomJS', 'Firefox', 'Chrome'],
|
||||
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, Karma captures browsers, runs the tests and exits
|
||||
singleRun: false
|
||||
})
|
||||
}
|
398
js/vendor/davclient.js/lib/client.js
vendored
398
js/vendor/davclient.js/lib/client.js
vendored
|
@ -1,398 +0,0 @@
|
|||
if (typeof dav == 'undefined') { dav = {}; };
|
||||
|
||||
dav._XML_CHAR_MAP = {
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'&': '&',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
};
|
||||
|
||||
dav._escapeXml = function(s) {
|
||||
return s.replace(/[<>&"']/g, function (ch) {
|
||||
return dav._XML_CHAR_MAP[ch];
|
||||
});
|
||||
};
|
||||
|
||||
dav.Client = function(options) {
|
||||
var i;
|
||||
for(i in options) {
|
||||
this[i] = options[i];
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
dav.Client.prototype = {
|
||||
|
||||
baseUrl : null,
|
||||
|
||||
userName : null,
|
||||
|
||||
password : null,
|
||||
|
||||
|
||||
xmlNamespaces : {
|
||||
'DAV:' : 'd'
|
||||
},
|
||||
|
||||
/**
|
||||
* Generates a propFind request.
|
||||
*
|
||||
* @param {string} url Url to do the propfind request on
|
||||
* @param {Array} properties List of properties to retrieve.
|
||||
* @param {Object} [headers] headers
|
||||
* @return {Promise}
|
||||
*/
|
||||
propFind : function(url, properties, depth, headers) {
|
||||
|
||||
if(typeof depth == "undefined") {
|
||||
depth = 0;
|
||||
}
|
||||
|
||||
headers = headers || {};
|
||||
|
||||
headers['Depth'] = depth;
|
||||
headers['Content-Type'] = 'application/xml; charset=utf-8';
|
||||
|
||||
var body =
|
||||
'<?xml version="1.0"?>\n' +
|
||||
'<d:propfind ';
|
||||
var namespace;
|
||||
for (namespace in this.xmlNamespaces) {
|
||||
body += ' xmlns:' + this.xmlNamespaces[namespace] + '="' + namespace + '"';
|
||||
}
|
||||
body += '>\n' +
|
||||
' <d:prop>\n';
|
||||
|
||||
for(var ii in properties) {
|
||||
|
||||
var property = this.parseClarkNotation(properties[ii]);
|
||||
if (this.xmlNamespaces[property.namespace]) {
|
||||
body+=' <' + this.xmlNamespaces[property.namespace] + ':' + property.name + ' />\n';
|
||||
} else {
|
||||
body+=' <x:' + property.name + ' xmlns:x="' + property.namespace + '" />\n';
|
||||
}
|
||||
|
||||
}
|
||||
body+=' </d:prop>\n';
|
||||
body+='</d:propfind>';
|
||||
|
||||
return this.request('PROPFIND', url, headers, body).then(
|
||||
function(result) {
|
||||
|
||||
if (depth===0) {
|
||||
return {
|
||||
status: result.status,
|
||||
body: result.body[0],
|
||||
xhr: result.xhr
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
status: result.status,
|
||||
body: result.body,
|
||||
xhr: result.xhr
|
||||
};
|
||||
}
|
||||
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Generates a propPatch request.
|
||||
*
|
||||
* @param {string} url Url to do the proppatch request on
|
||||
* @param {Array} properties List of properties to store.
|
||||
* @param {Object} [headers] headers
|
||||
* @return {Promise}
|
||||
*/
|
||||
propPatch : function(url, properties, headers) {
|
||||
headers = headers || {};
|
||||
|
||||
headers['Content-Type'] = 'application/xml; charset=utf-8';
|
||||
|
||||
var body =
|
||||
'<?xml version="1.0"?>\n' +
|
||||
'<d:propertyupdate ';
|
||||
var namespace;
|
||||
for (namespace in this.xmlNamespaces) {
|
||||
body += ' xmlns:' + this.xmlNamespaces[namespace] + '="' + namespace + '"';
|
||||
}
|
||||
body += '>\n' +
|
||||
' <d:set>\n' +
|
||||
' <d:prop>\n';
|
||||
|
||||
for(var ii in properties) {
|
||||
|
||||
var property = this.parseClarkNotation(ii);
|
||||
var propName;
|
||||
var propValue = properties[ii];
|
||||
if (this.xmlNamespaces[property.namespace]) {
|
||||
propName = this.xmlNamespaces[property.namespace] + ':' + property.name;
|
||||
} else {
|
||||
propName = 'x:' + property.name + ' xmlns:x="' + property.namespace + '"';
|
||||
}
|
||||
body += ' <' + propName + '>' + dav._escapeXml(propValue) + '</' + propName + '>\n';
|
||||
}
|
||||
body+=' </d:prop>\n';
|
||||
body+=' </d:set>\n';
|
||||
body+='</d:propertyupdate>';
|
||||
|
||||
return this.request('PROPPATCH', url, headers, body).then(
|
||||
function(result) {
|
||||
return {
|
||||
status: result.status,
|
||||
body: result.body,
|
||||
xhr: result.xhr
|
||||
};
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Performs a HTTP request, and returns a Promise
|
||||
*
|
||||
* @param {string} method HTTP method
|
||||
* @param {string} url Relative or absolute url
|
||||
* @param {Object} headers HTTP headers as an object.
|
||||
* @param {string} body HTTP request body.
|
||||
* @return {Promise}
|
||||
*/
|
||||
request : function(method, url, headers, body) {
|
||||
|
||||
var self = this;
|
||||
var xhr = this.xhrProvider();
|
||||
headers = headers || {};
|
||||
|
||||
if (this.userName) {
|
||||
headers['Authorization'] = 'Basic ' + btoa(this.userName + ':' + this.password);
|
||||
// xhr.open(method, this.resolveUrl(url), true, this.userName, this.password);
|
||||
}
|
||||
xhr.open(method, this.resolveUrl(url), true);
|
||||
var ii;
|
||||
for(ii in headers) {
|
||||
xhr.setRequestHeader(ii, headers[ii]);
|
||||
}
|
||||
|
||||
// Work around for edge
|
||||
if (body === undefined) {
|
||||
xhr.send();
|
||||
} else {
|
||||
xhr.send(body);
|
||||
}
|
||||
|
||||
return new Promise(function(fulfill, reject) {
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
|
||||
if (xhr.readyState !== 4) {
|
||||
return;
|
||||
}
|
||||
|
||||
var resultBody = xhr.response;
|
||||
if (xhr.status === 207) {
|
||||
resultBody = self.parseMultiStatus(xhr.response);
|
||||
}
|
||||
|
||||
fulfill({
|
||||
body: resultBody,
|
||||
status: xhr.status,
|
||||
xhr: xhr
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
xhr.ontimeout = function() {
|
||||
|
||||
reject(new Error('Timeout exceeded'));
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns an XMLHttpRequest object.
|
||||
*
|
||||
* This is in its own method, so it can be easily overridden.
|
||||
*
|
||||
* @return {XMLHttpRequest}
|
||||
*/
|
||||
xhrProvider : function() {
|
||||
|
||||
return new XMLHttpRequest();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Parses a property node.
|
||||
*
|
||||
* Either returns a string if the node only contains text, or returns an
|
||||
* array of non-text subnodes.
|
||||
*
|
||||
* @param {Object} propNode node to parse
|
||||
* @return {string|Array} text content as string or array of subnodes, excluding text nodes
|
||||
*/
|
||||
_parsePropNode: function(propNode) {
|
||||
var content = null;
|
||||
if (propNode.childNodes && propNode.childNodes.length > 0) {
|
||||
var subNodes = [];
|
||||
// filter out text nodes
|
||||
for (var j = 0; j < propNode.childNodes.length; j++) {
|
||||
var node = propNode.childNodes[j];
|
||||
if (node.nodeType === 1) {
|
||||
subNodes.push(node);
|
||||
}
|
||||
}
|
||||
if (subNodes.length) {
|
||||
content = subNodes;
|
||||
}
|
||||
}
|
||||
|
||||
return content || propNode.textContent || propNode.text || '';
|
||||
},
|
||||
|
||||
/**
|
||||
* Parses a multi-status response body.
|
||||
*
|
||||
* @param {string} xmlBody
|
||||
* @param {Array}
|
||||
*/
|
||||
parseMultiStatus : function(xmlBody) {
|
||||
|
||||
var parser = new DOMParser();
|
||||
var doc = parser.parseFromString(xmlBody, "application/xml");
|
||||
|
||||
var resolver = function(foo) {
|
||||
var ii;
|
||||
for(ii in this.xmlNamespaces) {
|
||||
if (this.xmlNamespaces[ii] === foo) {
|
||||
return ii;
|
||||
}
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
var responseIterator = doc.evaluate('/d:multistatus/d:response', doc, resolver, XPathResult.ANY_TYPE, null);
|
||||
|
||||
var result = [];
|
||||
var responseNode = responseIterator.iterateNext();
|
||||
|
||||
while(responseNode) {
|
||||
|
||||
var response = {
|
||||
href : null,
|
||||
propStat : []
|
||||
};
|
||||
|
||||
response.href = doc.evaluate('string(d:href)', responseNode, resolver, XPathResult.ANY_TYPE, null).stringValue;
|
||||
|
||||
var propStatIterator = doc.evaluate('d:propstat', responseNode, resolver, XPathResult.ANY_TYPE, null);
|
||||
var propStatNode = propStatIterator.iterateNext();
|
||||
|
||||
while(propStatNode) {
|
||||
|
||||
var propStat = {
|
||||
status : doc.evaluate('string(d:status)', propStatNode, resolver, XPathResult.ANY_TYPE, null).stringValue,
|
||||
properties : [],
|
||||
};
|
||||
|
||||
var propIterator = doc.evaluate('d:prop/*', propStatNode, resolver, XPathResult.ANY_TYPE, null);
|
||||
|
||||
var propNode = propIterator.iterateNext();
|
||||
while(propNode) {
|
||||
var content = this._parsePropNode(propNode);
|
||||
propStat.properties['{' + propNode.namespaceURI + '}' + propNode.localName] = content;
|
||||
propNode = propIterator.iterateNext();
|
||||
|
||||
}
|
||||
response.propStat.push(propStat);
|
||||
propStatNode = propStatIterator.iterateNext();
|
||||
|
||||
|
||||
}
|
||||
|
||||
result.push(response);
|
||||
responseNode = responseIterator.iterateNext();
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Takes a relative url, and maps it to an absolute url, using the baseUrl
|
||||
*
|
||||
* @param {string} url
|
||||
* @return {string}
|
||||
*/
|
||||
resolveUrl : function(url) {
|
||||
|
||||
// Note: this is rudamentary.. not sure yet if it handles every case.
|
||||
if (/^https?:\/\//i.test(url)) {
|
||||
// absolute
|
||||
return url;
|
||||
}
|
||||
|
||||
var baseParts = this.parseUrl(this.baseUrl);
|
||||
if (url.charAt('/')) {
|
||||
// Url starts with a slash
|
||||
return baseParts.root + url;
|
||||
}
|
||||
|
||||
// Url does not start with a slash, we need grab the base url right up until the last slash.
|
||||
var newUrl = baseParts.root + '/';
|
||||
if (baseParts.path.lastIndexOf('/')!==-1) {
|
||||
newUrl = newUrl = baseParts.path.subString(0, baseParts.path.lastIndexOf('/')) + '/';
|
||||
}
|
||||
newUrl+=url;
|
||||
return url;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Parses a url and returns its individual components.
|
||||
*
|
||||
* @param {String} url
|
||||
* @return {Object}
|
||||
*/
|
||||
parseUrl : function(url) {
|
||||
|
||||
var parts = url.match(/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/);
|
||||
var result = {
|
||||
url : parts[0],
|
||||
scheme : parts[1],
|
||||
host : parts[3],
|
||||
port : parts[4],
|
||||
path : parts[5],
|
||||
query : parts[6],
|
||||
fragment : parts[7],
|
||||
};
|
||||
result.root =
|
||||
result.scheme + '://' +
|
||||
result.host +
|
||||
(result.port ? ':' + result.port : '');
|
||||
|
||||
return result;
|
||||
|
||||
},
|
||||
|
||||
parseClarkNotation : function(propertyName) {
|
||||
|
||||
var result = propertyName.match(/^{([^}]+)}(.*)$/);
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
name : result[2],
|
||||
namespace : result[1]
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
35
js/vendor/davclient.js/package.json
vendored
35
js/vendor/davclient.js/package.json
vendored
|
@ -1,35 +0,0 @@
|
|||
{
|
||||
"name": "davclient.js",
|
||||
"version": "0.0.1",
|
||||
"description": "WebDAV, CalDAV and CardDAV client for javascript",
|
||||
"main": "lib/client.js",
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "./node_modules/karma/bin/karma start --single-run --browsers PhantomJS"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/evert/davclient.js.git"
|
||||
},
|
||||
"keywords": [
|
||||
"webdav",
|
||||
"caldav",
|
||||
"carddav"
|
||||
],
|
||||
"author": "Evert Pot",
|
||||
"license": "BSD-3-Clause",
|
||||
"bugs": {
|
||||
"url": "https://github.com/evert/davclient.js/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jasmine-core": "^2.3.4",
|
||||
"karma": "^0.13.9",
|
||||
"karma-chrome-launcher": "^0.2.0",
|
||||
"karma-firefox-launcher": "^0.1.6",
|
||||
"karma-jasmine": "^0.3.6",
|
||||
"karma-phantomjs-launcher": "^0.2.1",
|
||||
"phantomjs": "^1.9.18"
|
||||
}
|
||||
}
|
12
js/vendor/ical.js/.bower.json
vendored
12
js/vendor/ical.js/.bower.json
vendored
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ical.js",
|
||||
"version": "1.1.2",
|
||||
"version": "1.2.2",
|
||||
"homepage": "https://github.com/mozilla-comm/ical.js",
|
||||
"authors": [
|
||||
"Philipp Kewisch <mozilla@kewis.ch>",
|
||||
|
@ -31,13 +31,13 @@
|
|||
"coverage",
|
||||
"junk"
|
||||
],
|
||||
"_release": "1.1.2",
|
||||
"_release": "1.2.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.1.2",
|
||||
"commit": "40298c09541ecb32c92077e2d1ca22d297eac28e"
|
||||
"tag": "v1.2.2",
|
||||
"commit": "a4e882f941ddca2e81373d93c53256017ce04011"
|
||||
},
|
||||
"_source": "git://github.com/mozilla-comm/ical.js.git",
|
||||
"_target": "~1.1.2",
|
||||
"_source": "https://github.com/mozilla-comm/ical.js.git",
|
||||
"_target": "~1.2.2",
|
||||
"_originalSource": "ical.js"
|
||||
}
|
4
js/vendor/ical.js/CONTRIBUTING.md
vendored
4
js/vendor/ical.js/CONTRIBUTING.md
vendored
|
@ -23,8 +23,8 @@ that doesn't affect the API or just adds methods and you don't want to waste
|
|||
time discussing it, feel free to just send a pull request and we'll see.
|
||||
|
||||
When you send a pull request, don't forget to call `grunt package` to ensure the
|
||||
browser build in `build/ical.js` is updated. This should be done in a separate
|
||||
commit.
|
||||
browser build in `build/ical.js`, its minified counterpart and the source map
|
||||
is updated. These files should be put into a separate commit.
|
||||
|
||||
Also, you should check for linter errors and run the tests using `grunt
|
||||
linters` and `grunt test-node`. See the next section for details on tests. As
|
||||
|
|
90
js/vendor/ical.js/Gruntfile.js
vendored
90
js/vendor/ical.js/Gruntfile.js
vendored
|
@ -3,6 +3,14 @@
|
|||
var path = require('path');
|
||||
|
||||
module.exports = function(grunt) {
|
||||
function loadOptionalTask(name) {
|
||||
var root = path.resolve('node_modules');
|
||||
var tasksdir = path.join(root, name, 'tasks');
|
||||
if (grunt.file.exists(tasksdir)) {
|
||||
grunt.loadNpmTasks(name);
|
||||
}
|
||||
}
|
||||
|
||||
var pkg = grunt.file.readJSON('package.json');
|
||||
grunt.initConfig({
|
||||
pkg: pkg,
|
||||
|
@ -21,20 +29,37 @@ module.exports = function(grunt) {
|
|||
unit: ['test/*_test.js'],
|
||||
acceptance: ['test/acceptance/*_test.js'],
|
||||
performance: ['test/performance/*_test.js']
|
||||
},
|
||||
validator: {
|
||||
dev: 'https://rawgit.com/mozilla-comm/ical.js/master/build/ical.js',
|
||||
prod: 'https://cdn.rawgit.com/mozilla-comm/ical.js/<%= travis.commit %>/build/ical.js',
|
||||
dest: 'validator.html'
|
||||
}
|
||||
},
|
||||
|
||||
concat: {
|
||||
options: {
|
||||
separator: '',
|
||||
process: function(src, filepath) {
|
||||
return src.replace('"use strict";', '');
|
||||
}
|
||||
separator: ''
|
||||
},
|
||||
|
||||
dist: {
|
||||
options: {
|
||||
process: function(src, filepath) {
|
||||
return src.replace('"use strict";', '');
|
||||
}
|
||||
},
|
||||
src: ['<%= libinfo.absfiles %>'],
|
||||
dest: 'build/ical.js'
|
||||
},
|
||||
|
||||
validator: {
|
||||
options: {
|
||||
process: function(src, filepath) {
|
||||
return src.replace(grunt.config('libinfo.validator.dev'), grunt.config('libinfo.validator.prod'));
|
||||
}
|
||||
},
|
||||
src: ['sandbox/validator.html'],
|
||||
dest: '<%= libinfo.validator.dest %>'
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -72,6 +97,10 @@ module.exports = function(grunt) {
|
|||
single: ['mochacli:single', 'node-inspector'],
|
||||
},
|
||||
|
||||
eslint: {
|
||||
src: ['<%= libinfo.absfiles %>']
|
||||
},
|
||||
|
||||
mochacli: {
|
||||
options: {
|
||||
ui: 'tdd',
|
||||
|
@ -154,39 +183,6 @@ module.exports = function(grunt) {
|
|||
},
|
||||
},
|
||||
|
||||
jshint: {
|
||||
options: {
|
||||
"globalstrict": true,
|
||||
"eqeqeq": false,
|
||||
"-W041": false,
|
||||
"strict": false,
|
||||
"proto": true,
|
||||
"shadow": true
|
||||
},
|
||||
lib: {
|
||||
options: {
|
||||
predef: ['ICAL']
|
||||
},
|
||||
src: ['<%= libinfo.absfiles %>']
|
||||
},
|
||||
ICALTester: {
|
||||
src: ['tools/ICALTester/**/*.js']
|
||||
}
|
||||
},
|
||||
gjslint: {
|
||||
options: {
|
||||
flags: ['--flagfile .gjslintrc'],
|
||||
reporter: {
|
||||
name: 'console'
|
||||
}
|
||||
},
|
||||
lib: {
|
||||
src: ['<%= libinfo.absfiles %>']
|
||||
},
|
||||
ICALTester: {
|
||||
src: ['tools/ICALTester/**/*.js']
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
sourceMap: true,
|
||||
|
@ -227,16 +223,16 @@ module.exports = function(grunt) {
|
|||
|
||||
'gh-pages': {
|
||||
options: {
|
||||
clone: 'jsdoc-stage',
|
||||
clone: 'ghpages-stage',
|
||||
only: '<%= libinfo.doc %>',
|
||||
user: {
|
||||
name: 'Travis CI',
|
||||
email: 'builds@travis-ci.org',
|
||||
},
|
||||
repo: 'git@github.com:mozilla-comm/ical.js.git',
|
||||
message: 'Update API Documentation for <%= travis.commit %>'
|
||||
message: 'Update API documentation and validator for <%= travis.commit %>'
|
||||
},
|
||||
src: '<%= libinfo.doc %>/**'
|
||||
src: ['<%= libinfo.doc %>/**', '<%= libinfo.validator.dest %>']
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -249,31 +245,31 @@ module.exports = function(grunt) {
|
|||
|
||||
grunt.loadNpmTasks('grunt-concurrent');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-coveralls');
|
||||
grunt.loadNpmTasks('grunt-gjslint');
|
||||
grunt.loadNpmTasks('grunt-gh-pages');
|
||||
grunt.loadNpmTasks('grunt-jsdoc');
|
||||
grunt.loadNpmTasks('grunt-karma');
|
||||
grunt.loadNpmTasks('grunt-mocha-cli');
|
||||
grunt.loadNpmTasks('grunt-mocha-istanbul');
|
||||
grunt.loadNpmTasks('grunt-node-inspector');
|
||||
grunt.loadNpmTasks('grunt-release');
|
||||
grunt.loadNpmTasks('gruntify-eslint');
|
||||
|
||||
loadOptionalTask('grunt-node-inspector');
|
||||
|
||||
grunt.loadTasks('tasks');
|
||||
|
||||
grunt.registerTask('default', ['package']);
|
||||
grunt.registerTask('package', ['concat', 'uglify']);
|
||||
grunt.registerTask('package', ['concat:dist', 'uglify']);
|
||||
grunt.registerTask('coverage', 'mocha_istanbul');
|
||||
grunt.registerTask('linters', ['jshint', 'gjslint', 'check-browser-build']);
|
||||
grunt.registerTask('linters', ['eslint', 'check-browser-build']);
|
||||
grunt.registerTask('test-server', ['test-agent-config', 'run-test-server']);
|
||||
grunt.registerTask('test', ['test-browser', 'test-node']);
|
||||
|
||||
grunt.registerTask('doc-ci', ['jsdoc', 'run-on-master-leader:run-with-env:GITHUB_SSH_KEY:gh-pages']);
|
||||
grunt.registerTask('ghpages-ci', ['jsdoc', 'concat:validator', 'run-on-master-leader:run-with-env:GITHUB_SSH_KEY:gh-pages']);
|
||||
grunt.registerTask('unit-ci', ['test-node:unit', 'test-node:acceptance', 'run-on-master-leader:karma:ci']);
|
||||
grunt.registerTask('coverage-ci', ['coverage', 'coveralls']);
|
||||
grunt.registerTask('test-ci', ['check-browser-build', 'linters', 'unit-ci', 'coverage-ci', 'doc-ci']);
|
||||
grunt.registerTask('test-ci', ['check-browser-build', 'linters', 'unit-ci', 'coverage-ci', 'ghpages-ci']);
|
||||
|
||||
// Additional tasks:
|
||||
// - tests.js: performance-update, test-node, test-browser,
|
||||
|
|
15
js/vendor/ical.js/README.md
vendored
15
js/vendor/ical.js/README.md
vendored
|
@ -152,10 +152,13 @@ output in the `api/` subdirectory.
|
|||
|
||||
### Packaging
|
||||
When you are done with your work, you can run `grunt package` to create the
|
||||
single-file build for use in the browser. This file needs to be checked in (in
|
||||
a separate commit) and can be found in [build/ical.js](build/ical.js). Please
|
||||
see [CONTRIBUTING.md](CONTRIBUTING.md) for more details.
|
||||
single-file build for use in the browser, including its minified counterpart
|
||||
and the source map. These files need to be checked in (in a separate commit)
|
||||
and can be found in [build/ical.js](build/ical.js),
|
||||
[build/ical.min.js](build/ical.min.js) and
|
||||
[build/ical.min.js.map](build/ical.min.js.map). Please see
|
||||
[CONTRIBUTING.md](CONTRIBUTING.md) for more details.
|
||||
|
||||
Running the `package` target will also create a minified version in
|
||||
`build/ical.min.js`. This file is not pushed to the repository at the moment,
|
||||
but you can use it for front end projects.
|
||||
## License
|
||||
ical.js is licensed under the
|
||||
[Mozilla Public License](https://www.mozilla.org/MPL/2.0/), version 2.0.
|
||||
|
|
2
js/vendor/ical.js/bower.json
vendored
2
js/vendor/ical.js/bower.json
vendored
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ical.js",
|
||||
"version": "1.1.2",
|
||||
"version": "1.2.2",
|
||||
"homepage": "https://github.com/mozilla-comm/ical.js",
|
||||
"authors": [
|
||||
"Philipp Kewisch <mozilla@kewis.ch>",
|
||||
|
|
474
js/vendor/ical.js/build/ical.js
vendored
474
js/vendor/ical.js/build/ical.js
vendored
|
@ -9,14 +9,9 @@
|
|||
if (typeof module === 'object') {
|
||||
// CommonJS, where exports may be different each time.
|
||||
ICAL = module.exports;
|
||||
} else /* istanbul ignore next */ if (typeof window !== 'undefined') {
|
||||
if (typeof ICAL !== 'object') {
|
||||
/** @ignore */
|
||||
this.ICAL = {};
|
||||
}
|
||||
} else /* istanbul ignore next */ {
|
||||
// ...?
|
||||
ICAL = {};
|
||||
} else if (typeof ICAL !== 'object') {/* istanbul ignore next */
|
||||
/** @ignore */
|
||||
this.ICAL = {};
|
||||
}
|
||||
/* jshint ignore:end */
|
||||
|
||||
|
@ -301,7 +296,7 @@ ICAL.helpers = {
|
|||
/**
|
||||
* Poor-man's cross-browser object extension. Doesn't support all the
|
||||
* features, but enough for our usage. Note that the target's properties are
|
||||
* always overwritten with the source properties.
|
||||
* not overwritten with the source properties.
|
||||
*
|
||||
* @example
|
||||
* var child = ICAL.helpers.extend(parent, {
|
||||
|
@ -315,7 +310,7 @@ ICAL.helpers = {
|
|||
extend: function(source, target) {
|
||||
for (var key in source) {
|
||||
var descr = Object.getOwnPropertyDescriptor(source, key);
|
||||
if (descr) {
|
||||
if (descr && !Object.getOwnPropertyDescriptor(target, key)) {
|
||||
Object.defineProperty(target, key, descr);
|
||||
}
|
||||
}
|
||||
|
@ -337,7 +332,42 @@ ICAL.helpers = {
|
|||
ICAL.design = (function() {
|
||||
'use strict';
|
||||
|
||||
var ICAL_NEWLINE = /\\\\|\\;|\\,|\\[Nn]/g;
|
||||
var FROM_ICAL_NEWLINE = /\\\\|\\;|\\,|\\[Nn]/g;
|
||||
var TO_ICAL_NEWLINE = /\\|;|,|\n/g;
|
||||
var FROM_VCARD_NEWLINE = /\\\\|\\,|\\[Nn]/g;
|
||||
var TO_VCARD_NEWLINE = /\\|,|\n/g;
|
||||
|
||||
function createTextType(fromNewline, toNewline) {
|
||||
var result = {
|
||||
matches: /.*/,
|
||||
|
||||
fromICAL: function(aValue, structuredEscape) {
|
||||
return replaceNewline(aValue, fromNewline, structuredEscape);
|
||||
},
|
||||
|
||||
toICAL: function(aValue, structuredEscape) {
|
||||
var regEx = toNewline;
|
||||
if (structuredEscape)
|
||||
regEx = new RegExp(regEx.source + '|' + structuredEscape);
|
||||
return aValue.replace(regEx, function(str) {
|
||||
switch (str) {
|
||||
case "\\":
|
||||
return "\\\\";
|
||||
case ";":
|
||||
return "\\;";
|
||||
case ",":
|
||||
return "\\,";
|
||||
case "\n":
|
||||
return "\\n";
|
||||
/* istanbul ignore next */
|
||||
default:
|
||||
return str;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
// default types used multiple times
|
||||
var DEFAULT_TYPE_TEXT = { defaultType: "text" };
|
||||
|
@ -368,13 +398,14 @@ ICAL.design = (function() {
|
|||
}
|
||||
}
|
||||
|
||||
function replaceNewline(value) {
|
||||
function replaceNewline(value, newline, structuredEscape) {
|
||||
// avoid regex when possible.
|
||||
if (value.indexOf('\\') === -1) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return value.replace(ICAL_NEWLINE, replaceNewlineReplace);
|
||||
if (structuredEscape)
|
||||
newline = new RegExp(newline.source + '|\\\\' + structuredEscape);
|
||||
return value.replace(newline, replaceNewlineReplace);
|
||||
}
|
||||
|
||||
var commonProperties = {
|
||||
|
@ -437,37 +468,6 @@ ICAL.design = (function() {
|
|||
return String(aValue);
|
||||
}
|
||||
},
|
||||
text: {
|
||||
matches: /.*/,
|
||||
|
||||
fromICAL: function(aValue, aName) {
|
||||
return replaceNewline(aValue);
|
||||
},
|
||||
|
||||
toICAL: function escape(aValue, aName) {
|
||||
return aValue.replace(/\\|;|,|\n/g, function(str) {
|
||||
switch (str) {
|
||||
case "\\":
|
||||
return "\\\\";
|
||||
case ";":
|
||||
return "\\;";
|
||||
case ",":
|
||||
return "\\,";
|
||||
case "\n":
|
||||
return "\\n";
|
||||
/* istanbul ignore next */
|
||||
default:
|
||||
return str;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
uri: {
|
||||
// TODO
|
||||
/* ... */
|
||||
},
|
||||
|
||||
"utc-offset": {
|
||||
toICAL: function(aValue) {
|
||||
if (aValue.length < 7) {
|
||||
|
@ -512,6 +512,12 @@ ICAL.design = (function() {
|
|||
var icalParams = {
|
||||
// Although the syntax is DQUOTE uri DQUOTE, I don't think we should
|
||||
// enfoce anything aside from it being a valid content line.
|
||||
//
|
||||
// At least some params require - if multi values are used - DQUOTEs
|
||||
// for each of its values - e.g. delegated-from="uri1","uri2"
|
||||
// To indicate this, I introduced the new k/v pair
|
||||
// multiValueSeparateDQuote: true
|
||||
//
|
||||
// "ALTREP": { ... },
|
||||
|
||||
// CN just wants a param-value
|
||||
|
@ -525,11 +531,13 @@ ICAL.design = (function() {
|
|||
|
||||
"delegated-from": {
|
||||
valueType: "cal-address",
|
||||
multiValue: ","
|
||||
multiValue: ",",
|
||||
multiValueSeparateDQuote: true
|
||||
},
|
||||
"delegated-to": {
|
||||
valueType: "cal-address",
|
||||
multiValue: ","
|
||||
multiValue: ",",
|
||||
multiValueSeparateDQuote: true
|
||||
},
|
||||
// "DIR": { ... }, // See ALTREP
|
||||
"encoding": {
|
||||
|
@ -544,7 +552,8 @@ ICAL.design = (function() {
|
|||
// "LANGUAGE": { ... }, // See ALTREP
|
||||
"member": {
|
||||
valueType: "cal-address",
|
||||
multiValue: ","
|
||||
multiValue: ",",
|
||||
multiValueSeparateDQuote: true
|
||||
},
|
||||
"partstat": {
|
||||
// TODO These values are actually different per-component
|
||||
|
@ -591,6 +600,12 @@ ICAL.design = (function() {
|
|||
|
||||
// When adding a value here, be sure to add it to the parameter types!
|
||||
var icalValues = ICAL.helpers.extend(commonValues, {
|
||||
text: createTextType(FROM_ICAL_NEWLINE, TO_ICAL_NEWLINE),
|
||||
|
||||
uri: {
|
||||
// TODO
|
||||
/* ... */
|
||||
},
|
||||
|
||||
"binary": {
|
||||
decorate: function(aString) {
|
||||
|
@ -619,15 +634,9 @@ ICAL.design = (function() {
|
|||
fromICAL: function(aValue) {
|
||||
// from: 20120901
|
||||
// to: 2012-09-01
|
||||
var result = aValue.substr(0, 4) + '-' +
|
||||
aValue.substr(4, 2) + '-' +
|
||||
aValue.substr(6, 2);
|
||||
|
||||
if (aValue[8] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
return result;
|
||||
return aValue.substr(0, 4) + '-' +
|
||||
aValue.substr(4, 2) + '-' +
|
||||
aValue.substr(6, 2);
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
|
@ -639,15 +648,9 @@ ICAL.design = (function() {
|
|||
return aValue;
|
||||
}
|
||||
|
||||
var result = aValue.substr(0, 4) +
|
||||
aValue.substr(5, 2) +
|
||||
aValue.substr(8, 2);
|
||||
|
||||
if (aValue[10] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
return result;
|
||||
return aValue.substr(0, 4) +
|
||||
aValue.substr(5, 2) +
|
||||
aValue.substr(8, 2);
|
||||
}
|
||||
},
|
||||
"date-time": {
|
||||
|
@ -661,7 +664,7 @@ ICAL.design = (function() {
|
|||
aValue.substr(11, 2) + ':' +
|
||||
aValue.substr(13, 2);
|
||||
|
||||
if (aValue[15] === 'Z') {
|
||||
if (aValue[15] && aValue[15] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
|
@ -686,7 +689,7 @@ ICAL.design = (function() {
|
|||
// SS
|
||||
aValue.substr(17, 2);
|
||||
|
||||
if (aValue[19] === 'Z') {
|
||||
if (aValue[19] && aValue[19] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
|
@ -748,7 +751,7 @@ ICAL.design = (function() {
|
|||
toICAL: function(data) {
|
||||
var str = "";
|
||||
for (var k in data) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!Object.prototype.hasOwnProperty.call(data, k)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -760,7 +763,9 @@ ICAL.design = (function() {
|
|||
val = icalValues.date.toICAL(val);
|
||||
}
|
||||
} else if (k == "wkst") {
|
||||
val = ICAL.Recur.numericDayToIcalDay(val);
|
||||
if (typeof val === 'number') {
|
||||
val = ICAL.Recur.numericDayToIcalDay(val);
|
||||
}
|
||||
} else if (Array.isArray(val)) {
|
||||
val = val.join(",");
|
||||
}
|
||||
|
@ -883,6 +888,8 @@ ICAL.design = (function() {
|
|||
|
||||
// When adding a value here, be sure to add it to the parameter types!
|
||||
var vcardValues = ICAL.helpers.extend(commonValues, {
|
||||
text: createTextType(FROM_VCARD_NEWLINE, TO_VCARD_NEWLINE),
|
||||
uri: createTextType(FROM_VCARD_NEWLINE, TO_VCARD_NEWLINE),
|
||||
|
||||
date: {
|
||||
decorate: function(aValue) {
|
||||
|
@ -1045,7 +1052,7 @@ ICAL.design = (function() {
|
|||
};
|
||||
|
||||
var vcardProperties = ICAL.helpers.extend(commonProperties, {
|
||||
"adr": DEFAULT_TYPE_TEXT_STRUCTURED,
|
||||
"adr": { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
"anniversary": DEFAULT_TYPE_DATE_ANDOR_TIME,
|
||||
"bday": DEFAULT_TYPE_DATE_ANDOR_TIME,
|
||||
"caladruri": DEFAULT_TYPE_URI,
|
||||
|
@ -1065,7 +1072,7 @@ ICAL.design = (function() {
|
|||
"n": { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
"nickname": DEFAULT_TYPE_TEXT_MULTI,
|
||||
"note": DEFAULT_TYPE_TEXT,
|
||||
"org": DEFAULT_TYPE_TEXT_STRUCTURED,
|
||||
"org": { defaultType: "text", structuredValue: ";" },
|
||||
"photo": DEFAULT_TYPE_URI,
|
||||
"related": DEFAULT_TYPE_URI,
|
||||
"rev": { defaultType: "timestamp" },
|
||||
|
@ -1078,6 +1085,95 @@ ICAL.design = (function() {
|
|||
"xml": DEFAULT_TYPE_TEXT
|
||||
});
|
||||
|
||||
var vcard3Values = ICAL.helpers.extend(commonValues, {
|
||||
binary: icalValues.binary,
|
||||
date: vcardValues.date,
|
||||
"date-time": vcardValues["date-time"],
|
||||
"phone-number": {
|
||||
// TODO
|
||||
/* ... */
|
||||
},
|
||||
uri: icalValues.uri,
|
||||
text: icalValues.text,
|
||||
time: icalValues.time,
|
||||
vcard: icalValues.text,
|
||||
"utc-offset": {
|
||||
toICAL: function(aValue) {
|
||||
return aValue.substr(0, 7);
|
||||
},
|
||||
|
||||
fromICAL: function(aValue) {
|
||||
return aValue.substr(0, 7);
|
||||
},
|
||||
|
||||
decorate: function(aValue) {
|
||||
return ICAL.UtcOffset.fromString(aValue);
|
||||
},
|
||||
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var vcard3Params = {
|
||||
"type": {
|
||||
valueType: "text",
|
||||
multiValue: ","
|
||||
},
|
||||
"value": {
|
||||
// since the value here is a 'type' lowercase is used.
|
||||
values: ["text", "uri", "date", "date-time", "phone-number", "time",
|
||||
"boolean", "integer", "float", "utc-offset", "vcard", "binary"],
|
||||
allowXName: true,
|
||||
allowIanaToken: true
|
||||
}
|
||||
};
|
||||
|
||||
var vcard3Properties = ICAL.helpers.extend(commonProperties, {
|
||||
fn: DEFAULT_TYPE_TEXT,
|
||||
n: { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
nickname: DEFAULT_TYPE_TEXT_MULTI,
|
||||
photo: { defaultType: "binary", allowedTypes: ["binary", "uri"] },
|
||||
bday: {
|
||||
defaultType: "date-time",
|
||||
allowedTypes: ["date-time", "date"],
|
||||
detectType: function(string) {
|
||||
return (string.indexOf('T') === -1) ? 'date' : 'date-time';
|
||||
}
|
||||
},
|
||||
|
||||
adr: { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
label: DEFAULT_TYPE_TEXT,
|
||||
|
||||
tel: { defaultType: "phone-number" },
|
||||
email: DEFAULT_TYPE_TEXT,
|
||||
mailer: DEFAULT_TYPE_TEXT,
|
||||
|
||||
tz: { defaultType: "utc-offset", allowedTypes: ["utc-offset", "text"] },
|
||||
geo: { defaultType: "float", structuredValue: ";" },
|
||||
|
||||
title: DEFAULT_TYPE_TEXT,
|
||||
role: DEFAULT_TYPE_TEXT,
|
||||
logo: { defaultType: "binary", allowedTypes: ["binary", "uri"] },
|
||||
agent: { defaultType: "vcard", allowedTypes: ["vcard", "text", "uri"] },
|
||||
org: DEFAULT_TYPE_TEXT_STRUCTURED,
|
||||
|
||||
note: DEFAULT_TYPE_TEXT_MULTI,
|
||||
prodid: DEFAULT_TYPE_TEXT,
|
||||
rev: {
|
||||
defaultType: "date-time",
|
||||
allowedTypes: ["date-time", "date"],
|
||||
detectType: function(string) {
|
||||
return (string.indexOf('T') === -1) ? 'date' : 'date-time';
|
||||
}
|
||||
},
|
||||
"sort-string": DEFAULT_TYPE_TEXT,
|
||||
sound: { defaultType: "binary", allowedTypes: ["binary", "uri"] },
|
||||
|
||||
class: DEFAULT_TYPE_TEXT,
|
||||
key: { defaultType: "binary", allowedTypes: ["binary", "text"] }
|
||||
});
|
||||
|
||||
/**
|
||||
* iCalendar design set
|
||||
|
@ -1090,7 +1186,7 @@ ICAL.design = (function() {
|
|||
};
|
||||
|
||||
/**
|
||||
* vCard design set
|
||||
* vCard 4.0 design set
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
var vcardSet = {
|
||||
|
@ -1099,6 +1195,16 @@ ICAL.design = (function() {
|
|||
property: vcardProperties
|
||||
};
|
||||
|
||||
/**
|
||||
* vCard 3.0 design set
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
var vcard3Set = {
|
||||
value: vcard3Values,
|
||||
param: vcard3Params,
|
||||
property: vcard3Properties
|
||||
};
|
||||
|
||||
/**
|
||||
* The design data, used by the parser to determine types for properties and
|
||||
* other metadata needed to produce correct jCard/jCal data.
|
||||
|
@ -1155,6 +1261,7 @@ ICAL.design = (function() {
|
|||
*/
|
||||
components: {
|
||||
vcard: vcardSet,
|
||||
vcard3: vcard3Set,
|
||||
vevent: icalSet,
|
||||
vtodo: icalSet,
|
||||
vjournal: icalSet,
|
||||
|
@ -1177,6 +1284,12 @@ ICAL.design = (function() {
|
|||
*/
|
||||
vcard: vcardSet,
|
||||
|
||||
/**
|
||||
* The design set for vCard (rfc2425/rfc2426/rfc7095) components.
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
vcard3: vcard3Set,
|
||||
|
||||
/**
|
||||
* Gets the design set for the given component name.
|
||||
*
|
||||
|
@ -1253,12 +1366,20 @@ ICAL.stringify = (function() {
|
|||
stringify.component = function(component, designSet) {
|
||||
var name = component[0].toUpperCase();
|
||||
var result = 'BEGIN:' + name + LINE_ENDING;
|
||||
designSet = designSet || design.getDesignSet(component[0]);
|
||||
|
||||
var props = component[1];
|
||||
var propIdx = 0;
|
||||
var propLen = props.length;
|
||||
|
||||
var designSetName = component[0];
|
||||
// rfc6350 requires that in vCard 4.0 the first component is the VERSION
|
||||
// component with as value 4.0, note that 3.0 does not have this requirement.
|
||||
if (designSetName === 'vcard' && component[1].length > 0 &&
|
||||
!(component[1][0][0] === "version" && component[1][0][3] === "4.0")) {
|
||||
designSetName = "vcard3";
|
||||
}
|
||||
designSet = designSet || design.getDesignSet(designSetName);
|
||||
|
||||
for (; propIdx < propLen; propIdx++) {
|
||||
result += stringify.property(props[propIdx], designSet) + LINE_ENDING;
|
||||
}
|
||||
|
@ -1283,9 +1404,11 @@ ICAL.stringify = (function() {
|
|||
* jCal/jCard property array
|
||||
* @param {ICAL.design.designSet} designSet
|
||||
* The design data to use for this property
|
||||
* @param {Boolean} noFold
|
||||
* If true, the line is not folded
|
||||
* @return {String} The iCalendar/vCard string
|
||||
*/
|
||||
stringify.property = function(property, designSet) {
|
||||
stringify.property = function(property, designSet, noFold) {
|
||||
var name = property[0].toUpperCase();
|
||||
var jsName = property[0];
|
||||
var params = property[1];
|
||||
|
@ -1300,6 +1423,9 @@ ICAL.stringify = (function() {
|
|||
if (params.hasOwnProperty(paramName)) {
|
||||
var multiValue = (paramName in designSet.param) && designSet.param[paramName].multiValue;
|
||||
if (multiValue && Array.isArray(value)) {
|
||||
if (designSet.param[paramName].multiValueSeparateDQuote) {
|
||||
multiValue = '"' + multiValue + '"';
|
||||
}
|
||||
value = value.map(stringify._rfc6868Unescape);
|
||||
value = stringify.multiValue(value, multiValue, "unknown", null, designSet);
|
||||
} else {
|
||||
|
@ -1365,21 +1491,21 @@ ICAL.stringify = (function() {
|
|||
|
||||
if (multiValue && structuredValue) {
|
||||
line += stringify.multiValue(
|
||||
property[3], structuredValue, valueType, multiValue, designSet
|
||||
property[3], structuredValue, valueType, multiValue, designSet, structuredValue
|
||||
);
|
||||
} else if (multiValue) {
|
||||
line += stringify.multiValue(
|
||||
property.slice(3), multiValue, valueType, null, designSet
|
||||
property.slice(3), multiValue, valueType, null, designSet, false
|
||||
);
|
||||
} else if (structuredValue) {
|
||||
line += stringify.multiValue(
|
||||
property[3], structuredValue, valueType, null, designSet
|
||||
property[3], structuredValue, valueType, null, designSet, structuredValue
|
||||
);
|
||||
} else {
|
||||
line += stringify.value(property[3], valueType, designSet);
|
||||
line += stringify.value(property[3], valueType, designSet, false);
|
||||
}
|
||||
|
||||
return ICAL.helpers.foldline(line);
|
||||
return noFold ? line : ICAL.helpers.foldline(line);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1422,16 +1548,16 @@ ICAL.stringify = (function() {
|
|||
*
|
||||
* @return {String} iCalendar/vCard string for value
|
||||
*/
|
||||
stringify.multiValue = function(values, delim, type, innerMulti, designSet) {
|
||||
stringify.multiValue = function(values, delim, type, innerMulti, designSet, structuredValue) {
|
||||
var result = '';
|
||||
var len = values.length;
|
||||
var i = 0;
|
||||
|
||||
for (; i < len; i++) {
|
||||
if (innerMulti && Array.isArray(values[i])) {
|
||||
result += stringify.multiValue(values[i], innerMulti, type, null, designSet);
|
||||
result += stringify.multiValue(values[i], innerMulti, type, null, designSet, structuredValue);
|
||||
} else {
|
||||
result += stringify.value(values[i], type, designSet);
|
||||
result += stringify.value(values[i], type, designSet, structuredValue);
|
||||
}
|
||||
|
||||
if (i !== (len - 1)) {
|
||||
|
@ -1452,9 +1578,9 @@ ICAL.stringify = (function() {
|
|||
* (like boolean, date-time, etc..)
|
||||
* @return {String} iCalendar/vCard value for single value
|
||||
*/
|
||||
stringify.value = function(value, type, designSet) {
|
||||
stringify.value = function(value, type, designSet, structuredValue) {
|
||||
if (type in designSet.value && 'toICAL' in designSet.value[type]) {
|
||||
return designSet.value[type].toICAL(value);
|
||||
return designSet.value[type].toICAL(value, structuredValue);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
@ -1752,19 +1878,24 @@ ICAL.parse = (function() {
|
|||
|
||||
var result;
|
||||
if (multiValue && structuredValue) {
|
||||
value = parser._parseMultiValue(value, structuredValue, valueType, [], multiValue, state.designSet);
|
||||
value = parser._parseMultiValue(value, structuredValue, valueType, [], multiValue, state.designSet, structuredValue);
|
||||
result = [name, params, valueType, value];
|
||||
} else if (multiValue) {
|
||||
result = [name, params, valueType];
|
||||
parser._parseMultiValue(value, multiValue, valueType, result, null, state.designSet);
|
||||
parser._parseMultiValue(value, multiValue, valueType, result, null, state.designSet, false);
|
||||
} else if (structuredValue) {
|
||||
value = parser._parseMultiValue(value, structuredValue, valueType, [], null, state.designSet);
|
||||
value = parser._parseMultiValue(value, structuredValue, valueType, [], null, state.designSet, structuredValue);
|
||||
result = [name, params, valueType, value];
|
||||
} else {
|
||||
value = parser._parseValue(value, valueType, state.designSet);
|
||||
value = parser._parseValue(value, valueType, state.designSet, false);
|
||||
result = [name, params, valueType, value];
|
||||
}
|
||||
|
||||
// rfc6350 requires that in vCard 4.0 the first component is the VERSION
|
||||
// component with as value 4.0, note that 3.0 does not have this requirement.
|
||||
if (state.component[0] === 'vcard' && state.component[1].length === 0 &&
|
||||
!(name === 'version' && value === '4.0')) {
|
||||
state.designSet = design.getDesignSet("vcard3");
|
||||
}
|
||||
state.component[1].push(result);
|
||||
};
|
||||
|
||||
|
@ -1778,9 +1909,9 @@ ICAL.parse = (function() {
|
|||
* @param {Object} designSet The design data to use for this value
|
||||
* @return {Object} varies on type
|
||||
*/
|
||||
parser._parseValue = function(value, type, designSet) {
|
||||
parser._parseValue = function(value, type, designSet, structuredValue) {
|
||||
if (type in designSet.value && 'fromICAL' in designSet.value[type]) {
|
||||
return designSet.value[type].fromICAL(value);
|
||||
return designSet.value[type].fromICAL(value, structuredValue);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
@ -1802,7 +1933,7 @@ ICAL.parse = (function() {
|
|||
var result = {};
|
||||
var name, lcname;
|
||||
var value, valuePos = -1;
|
||||
var type, multiValue;
|
||||
var type, multiValue, mvdelim;
|
||||
|
||||
// find the next '=' sign
|
||||
// use lastParam and pos to find name
|
||||
|
@ -1818,10 +1949,33 @@ ICAL.parse = (function() {
|
|||
}
|
||||
lcname = name.toLowerCase();
|
||||
|
||||
if (lcname in designSet.param && designSet.param[lcname].valueType) {
|
||||
type = designSet.param[lcname].valueType;
|
||||
} else {
|
||||
type = DEFAULT_PARAM_TYPE;
|
||||
}
|
||||
|
||||
if (lcname in designSet.param) {
|
||||
multiValue = designSet.param[lcname].multiValue;
|
||||
if (designSet.param[lcname].multiValueSeparateDQuote) {
|
||||
mvdelim = parser._rfc6868Escape('"' + multiValue + '"');
|
||||
}
|
||||
}
|
||||
|
||||
var nextChar = line[pos + 1];
|
||||
if (nextChar === '"') {
|
||||
valuePos = pos + 2;
|
||||
pos = helpers.unescapedIndexOf(line, '"', valuePos);
|
||||
if (multiValue && pos != -1) {
|
||||
var extendedValue = true;
|
||||
while (extendedValue) {
|
||||
if (line[pos + 1] == multiValue && line[pos + 2] == '"') {
|
||||
pos = helpers.unescapedIndexOf(line, '"', pos + 3);
|
||||
} else {
|
||||
extendedValue = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pos === -1) {
|
||||
throw new ParserError(
|
||||
'invalid line (no matching double quote) "' + line + '"'
|
||||
|
@ -1852,24 +2006,16 @@ ICAL.parse = (function() {
|
|||
pos = false;
|
||||
} else {
|
||||
lastParam = nextPos;
|
||||
pos = nextPos;
|
||||
}
|
||||
|
||||
value = line.substr(valuePos, nextPos - valuePos);
|
||||
}
|
||||
|
||||
if (lcname in designSet.param && designSet.param[lcname].valueType) {
|
||||
type = designSet.param[lcname].valueType;
|
||||
} else {
|
||||
type = DEFAULT_PARAM_TYPE;
|
||||
}
|
||||
|
||||
if (lcname in designSet.param) {
|
||||
multiValue = designSet.param[lcname].multiValue;
|
||||
}
|
||||
|
||||
value = parser._rfc6868Escape(value);
|
||||
if (multiValue) {
|
||||
result[lcname] = parser._parseMultiValue(value, multiValue, type, [], null, designSet);
|
||||
var delimiter = mvdelim || multiValue;
|
||||
result[lcname] = parser._parseMultiValue(value, delimiter, type, [], null, designSet);
|
||||
} else {
|
||||
result[lcname] = parser._parseValue(value, type, designSet);
|
||||
}
|
||||
|
@ -1907,29 +2053,32 @@ ICAL.parse = (function() {
|
|||
* @param {ICAL.design.designSet} designSet The design data for this value
|
||||
* @return {?|Array.<?>} Either an array of results, or the first result
|
||||
*/
|
||||
parser._parseMultiValue = function(buffer, delim, type, result, innerMulti, designSet) {
|
||||
parser._parseMultiValue = function(buffer, delim, type, result, innerMulti, designSet, structuredValue) {
|
||||
var pos = 0;
|
||||
var lastPos = 0;
|
||||
var value;
|
||||
if (delim.length === 0) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
// split each piece
|
||||
while ((pos = helpers.unescapedIndexOf(buffer, delim, lastPos)) !== -1) {
|
||||
value = buffer.substr(lastPos, pos - lastPos);
|
||||
if (innerMulti) {
|
||||
value = parser._parseMultiValue(value, innerMulti, type, [], null, designSet);
|
||||
value = parser._parseMultiValue(value, innerMulti, type, [], null, designSet, structuredValue);
|
||||
} else {
|
||||
value = parser._parseValue(value, type, designSet);
|
||||
value = parser._parseValue(value, type, designSet, structuredValue);
|
||||
}
|
||||
result.push(value);
|
||||
lastPos = pos + 1;
|
||||
lastPos = pos + delim.length;
|
||||
}
|
||||
|
||||
// on the last piece take the rest of string
|
||||
value = buffer.substr(lastPos);
|
||||
if (innerMulti) {
|
||||
value = parser._parseMultiValue(value, innerMulti, type, [], null, designSet);
|
||||
value = parser._parseMultiValue(value, innerMulti, type, [], null, designSet, structuredValue);
|
||||
} else {
|
||||
value = parser._parseValue(value, type, designSet);
|
||||
value = parser._parseValue(value, type, designSet, structuredValue);
|
||||
}
|
||||
result.push(value);
|
||||
|
||||
|
@ -1957,7 +2106,7 @@ ICAL.parse = (function() {
|
|||
do {
|
||||
pos = buffer.indexOf('\n', lastPos) + 1;
|
||||
|
||||
if (buffer[pos - 2] === '\r') {
|
||||
if (pos > 1 && buffer[pos - 2] === '\r') {
|
||||
newlineOffset = 2;
|
||||
} else {
|
||||
newlineOffset = 1;
|
||||
|
@ -2277,15 +2426,17 @@ ICAL.Component = (function() {
|
|||
},
|
||||
|
||||
_removeObjectByIndex: function(jCalIndex, cache, index) {
|
||||
cache = cache || [];
|
||||
// remove cached version
|
||||
if (cache && cache[index]) {
|
||||
if (cache[index]) {
|
||||
var obj = cache[index];
|
||||
if ("parent" in obj) {
|
||||
obj.parent = null;
|
||||
}
|
||||
cache.splice(index, 1);
|
||||
}
|
||||
|
||||
cache.splice(index, 1);
|
||||
|
||||
// remove it from the jCal
|
||||
this.jCal[jCalIndex].splice(index, 1);
|
||||
},
|
||||
|
@ -2714,20 +2865,30 @@ ICAL.Property = (function() {
|
|||
/**
|
||||
* Gets a parameter on the property.
|
||||
*
|
||||
* @param {String} name Property name (lowercase)
|
||||
* @return {String} Property value
|
||||
* @param {String} name Property name (lowercase)
|
||||
* @return {Array|String} Property value
|
||||
*/
|
||||
getParameter: function(name) {
|
||||
return this.jCal[PROP_INDEX][name];
|
||||
if (name in this.jCal[PROP_INDEX]) {
|
||||
return this.jCal[PROP_INDEX][name];
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets a parameter on the property.
|
||||
*
|
||||
* @param {String} name The parameter name
|
||||
* @param {String} value The parameter value
|
||||
* @param {String} name The parameter name
|
||||
* @param {Array|String} value The parameter value
|
||||
*/
|
||||
setParameter: function(name, value) {
|
||||
var lcname = name.toLowerCase();
|
||||
if (typeof value === "string" &&
|
||||
lcname in this._designSet.param &&
|
||||
'multiValue' in this._designSet.param[lcname]) {
|
||||
value = [value];
|
||||
}
|
||||
this.jCal[PROP_INDEX][name] = value;
|
||||
},
|
||||
|
||||
|
@ -2881,9 +3042,9 @@ ICAL.Property = (function() {
|
|||
* The string representation of this component.
|
||||
* @return {String}
|
||||
*/
|
||||
toICAL: function() {
|
||||
toICALString: function() {
|
||||
return ICAL.stringify.property(
|
||||
this.jCal, this._designSet
|
||||
this.jCal, this._designSet, true
|
||||
);
|
||||
}
|
||||
};
|
||||
|
@ -2891,10 +3052,12 @@ ICAL.Property = (function() {
|
|||
/**
|
||||
* Create an {@link ICAL.Property} by parsing the passed iCalendar string.
|
||||
*
|
||||
* @param {String} str The iCalendar string to parse
|
||||
* @param {String} str The iCalendar string to parse
|
||||
* @param {ICAL.design.designSet=} designSet The design data to use for this property
|
||||
* @return {ICAL.Property} The created iCalendar property
|
||||
*/
|
||||
Property.fromString = function(str) {
|
||||
return new Property(ICAL.parse.property(str));
|
||||
Property.fromString = function(str, designSet) {
|
||||
return new Property(ICAL.parse.property(str, designSet));
|
||||
};
|
||||
|
||||
return Property;
|
||||
|
@ -3656,7 +3819,7 @@ ICAL.Binary = (function() {
|
|||
var propsToCopy = ["weeks", "days", "hours",
|
||||
"minutes", "seconds", "isNegative"];
|
||||
for (var key in propsToCopy) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!propsToCopy.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -4191,7 +4354,7 @@ ICAL.Binary = (function() {
|
|||
} else {
|
||||
var props = aComponent.getAllProperties("rdate");
|
||||
for (var rdatekey in props) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!props.hasOwnProperty(rdatekey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -4576,7 +4739,7 @@ ICAL.TimezoneService = (function() {
|
|||
/**
|
||||
* Returns a clone of the time object.
|
||||
*
|
||||
* @return {ICAL.Duration} The cloned object
|
||||
* @return {ICAL.Time} The cloned object
|
||||
*/
|
||||
clone: function() {
|
||||
return new ICAL.Time(this._time, this.zone);
|
||||
|
@ -5592,7 +5755,7 @@ ICAL.TimezoneService = (function() {
|
|||
|
||||
var zone;
|
||||
|
||||
if (aValue[19] === 'Z') {
|
||||
if (aValue[19] && aValue[19] === 'Z') {
|
||||
zone = 'Z';
|
||||
} else if (prop) {
|
||||
zone = prop.getParameter('tzid');
|
||||
|
@ -5792,6 +5955,7 @@ ICAL.TimezoneService = (function() {
|
|||
*
|
||||
* Also, normalization is not yet implemented for this class!
|
||||
*
|
||||
* @alias ICAL.VCardTime
|
||||
* @class
|
||||
* @extends {ICAL.Time}
|
||||
* @param {Object} data The data for the time instance
|
||||
|
@ -5819,7 +5983,7 @@ ICAL.TimezoneService = (function() {
|
|||
|
||||
this.fromData(data, zone);
|
||||
};
|
||||
ICAL.helpers.inherits(ICAL.Time, ICAL.VCardTime, {
|
||||
ICAL.helpers.inherits(ICAL.Time, ICAL.VCardTime, /** @lends ICAL.VCardTime */ {
|
||||
|
||||
/**
|
||||
* The class identifier.
|
||||
|
@ -6266,7 +6430,7 @@ ICAL.TimezoneService = (function() {
|
|||
}
|
||||
|
||||
for (var k in this.parts) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.parts.hasOwnProperty(k)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -6668,7 +6832,9 @@ ICAL.RecurIterator = (function() {
|
|||
this.occurrence_number = options.occurrence_number;
|
||||
|
||||
this.days = options.days || [];
|
||||
this.last = ICAL.helpers.formatClassType(options.last, ICAL.Time);
|
||||
if (options.last) {
|
||||
this.last = ICAL.helpers.formatClassType(options.last, ICAL.Time);
|
||||
}
|
||||
|
||||
this.by_indices = options.by_indices;
|
||||
|
||||
|
@ -6779,7 +6945,7 @@ ICAL.RecurIterator = (function() {
|
|||
|
||||
// Check every weekday in BYDAY with relative dow and pos.
|
||||
for (var i in this.by_data.BYDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYDAY.hasOwnProperty(i)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7086,8 +7252,12 @@ ICAL.RecurIterator = (function() {
|
|||
|
||||
// For the case of more than one occurrence in one month
|
||||
// we have to be sure to start searching after the last
|
||||
// found date or at the last BYMONTHDAY.
|
||||
while (byMonthDay[dateIdx] <= lastDay && dateIdx < dateLen - 1) {
|
||||
// found date or at the last BYMONTHDAY, unless we are
|
||||
// initializing the iterator because in this case we have
|
||||
// to consider the last found date too.
|
||||
while (byMonthDay[dateIdx] <= lastDay &&
|
||||
!(isInit && byMonthDay[dateIdx] == lastDay) &&
|
||||
dateIdx < dateLen - 1) {
|
||||
dateIdx++;
|
||||
}
|
||||
}
|
||||
|
@ -7108,7 +7278,12 @@ ICAL.RecurIterator = (function() {
|
|||
lastDay -= 1;
|
||||
}
|
||||
|
||||
while (!dataIsValid) {
|
||||
// Use a counter to avoid an infinite loop with malformed rules.
|
||||
// Stop checking after 4 years so we consider also a leap year.
|
||||
var monthsCounter = 48;
|
||||
|
||||
while (!dataIsValid && monthsCounter) {
|
||||
monthsCounter--;
|
||||
// increment the current date. This is really
|
||||
// important otherwise we may fall into the infinite
|
||||
// loop trap. The initial date takes care of the case
|
||||
|
@ -7166,6 +7341,13 @@ ICAL.RecurIterator = (function() {
|
|||
}
|
||||
}
|
||||
|
||||
if (monthsCounter <= 0) {
|
||||
// Checked 4 years without finding a Byday that matches
|
||||
// a Bymonthday. Maybe the rule is not correct.
|
||||
throw new Error("Malformed values in BYDAY combined with BYMONTHDAY parts");
|
||||
}
|
||||
|
||||
|
||||
return dataIsValid;
|
||||
},
|
||||
|
||||
|
@ -7514,7 +7696,7 @@ ICAL.RecurIterator = (function() {
|
|||
this.days.push(t1.dayOfYear());
|
||||
} else if (partCount == 1 && "BYMONTH" in parts) {
|
||||
for (var monthkey in this.by_data.BYMONTH) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYMONTH.hasOwnProperty(monthkey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7526,7 +7708,7 @@ ICAL.RecurIterator = (function() {
|
|||
}
|
||||
} else if (partCount == 1 && "BYMONTHDAY" in parts) {
|
||||
for (var monthdaykey in this.by_data.BYMONTHDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYMONTHDAY.hasOwnProperty(monthdaykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7545,14 +7727,14 @@ ICAL.RecurIterator = (function() {
|
|||
"BYMONTHDAY" in parts &&
|
||||
"BYMONTH" in parts) {
|
||||
for (var monthkey in this.by_data.BYMONTH) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYMONTH.hasOwnProperty(monthkey)) {
|
||||
continue;
|
||||
}
|
||||
var month_ = this.by_data.BYMONTH[monthkey];
|
||||
var daysInMonth = ICAL.Time.daysInMonth(month_, aYear);
|
||||
for (var monthdaykey in this.by_data.BYMONTHDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYMONTHDAY.hasOwnProperty(monthdaykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7578,7 +7760,7 @@ ICAL.RecurIterator = (function() {
|
|||
this.days = this.days.concat(this.expand_by_day(aYear));
|
||||
} else if (partCount == 2 && "BYDAY" in parts && "BYMONTH" in parts) {
|
||||
for (var monthkey in this.by_data.BYMONTH) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYMONTH.hasOwnProperty(monthkey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7614,7 +7796,7 @@ ICAL.RecurIterator = (function() {
|
|||
}
|
||||
} else {
|
||||
for (var daycodedkey in this.by_data.BYDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYDAY.hasOwnProperty(daycodedkey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7654,7 +7836,7 @@ ICAL.RecurIterator = (function() {
|
|||
var expandedDays = this.expand_by_day(aYear);
|
||||
|
||||
for (var daykey in expandedDays) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!expandedDays.hasOwnProperty(daykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7671,7 +7853,7 @@ ICAL.RecurIterator = (function() {
|
|||
var expandedDays = this.expand_by_day(aYear);
|
||||
|
||||
for (var daykey in expandedDays) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!expandedDays.hasOwnProperty(daykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7687,7 +7869,7 @@ ICAL.RecurIterator = (function() {
|
|||
var expandedDays = this.expand_by_day(aYear);
|
||||
|
||||
for (var daykey in expandedDays) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!expandedDays.hasOwnProperty(daykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7732,7 +7914,7 @@ ICAL.RecurIterator = (function() {
|
|||
var end_year_day = tmp.dayOfYear();
|
||||
|
||||
for (var daykey in this.by_data.BYDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYDAY.hasOwnProperty(daykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7775,7 +7957,7 @@ ICAL.RecurIterator = (function() {
|
|||
|
||||
is_day_in_byday: function is_day_in_byday(tt) {
|
||||
for (var daykey in this.by_data.BYDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYDAY.hasOwnProperty(daykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -7979,7 +8161,7 @@ ICAL.RecurExpansion = (function() {
|
|||
*
|
||||
* var expand = new ICAL.RecurExpansion({
|
||||
* component: event,
|
||||
* start: event.getFirstPropertyValue('DTSTART')
|
||||
* dtstart: event.getFirstPropertyValue('dtstart')
|
||||
* });
|
||||
*
|
||||
* // remember there are infinite rules
|
||||
|
|
6
js/vendor/ical.js/lib/ical/component.js
vendored
6
js/vendor/ical.js/lib/ical/component.js
vendored
|
@ -276,15 +276,17 @@ ICAL.Component = (function() {
|
|||
},
|
||||
|
||||
_removeObjectByIndex: function(jCalIndex, cache, index) {
|
||||
cache = cache || [];
|
||||
// remove cached version
|
||||
if (cache && cache[index]) {
|
||||
if (cache[index]) {
|
||||
var obj = cache[index];
|
||||
if ("parent" in obj) {
|
||||
obj.parent = null;
|
||||
}
|
||||
cache.splice(index, 1);
|
||||
}
|
||||
|
||||
cache.splice(index, 1);
|
||||
|
||||
// remove it from the jCal
|
||||
this.jCal[jCalIndex].splice(index, 1);
|
||||
},
|
||||
|
|
244
js/vendor/ical.js/lib/ical/design.js
vendored
244
js/vendor/ical.js/lib/ical/design.js
vendored
|
@ -13,7 +13,42 @@
|
|||
ICAL.design = (function() {
|
||||
'use strict';
|
||||
|
||||
var ICAL_NEWLINE = /\\\\|\\;|\\,|\\[Nn]/g;
|
||||
var FROM_ICAL_NEWLINE = /\\\\|\\;|\\,|\\[Nn]/g;
|
||||
var TO_ICAL_NEWLINE = /\\|;|,|\n/g;
|
||||
var FROM_VCARD_NEWLINE = /\\\\|\\,|\\[Nn]/g;
|
||||
var TO_VCARD_NEWLINE = /\\|,|\n/g;
|
||||
|
||||
function createTextType(fromNewline, toNewline) {
|
||||
var result = {
|
||||
matches: /.*/,
|
||||
|
||||
fromICAL: function(aValue, structuredEscape) {
|
||||
return replaceNewline(aValue, fromNewline, structuredEscape);
|
||||
},
|
||||
|
||||
toICAL: function(aValue, structuredEscape) {
|
||||
var regEx = toNewline;
|
||||
if (structuredEscape)
|
||||
regEx = new RegExp(regEx.source + '|' + structuredEscape);
|
||||
return aValue.replace(regEx, function(str) {
|
||||
switch (str) {
|
||||
case "\\":
|
||||
return "\\\\";
|
||||
case ";":
|
||||
return "\\;";
|
||||
case ",":
|
||||
return "\\,";
|
||||
case "\n":
|
||||
return "\\n";
|
||||
/* istanbul ignore next */
|
||||
default:
|
||||
return str;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
// default types used multiple times
|
||||
var DEFAULT_TYPE_TEXT = { defaultType: "text" };
|
||||
|
@ -44,13 +79,14 @@ ICAL.design = (function() {
|
|||
}
|
||||
}
|
||||
|
||||
function replaceNewline(value) {
|
||||
function replaceNewline(value, newline, structuredEscape) {
|
||||
// avoid regex when possible.
|
||||
if (value.indexOf('\\') === -1) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return value.replace(ICAL_NEWLINE, replaceNewlineReplace);
|
||||
if (structuredEscape)
|
||||
newline = new RegExp(newline.source + '|\\\\' + structuredEscape);
|
||||
return value.replace(newline, replaceNewlineReplace);
|
||||
}
|
||||
|
||||
var commonProperties = {
|
||||
|
@ -113,37 +149,6 @@ ICAL.design = (function() {
|
|||
return String(aValue);
|
||||
}
|
||||
},
|
||||
text: {
|
||||
matches: /.*/,
|
||||
|
||||
fromICAL: function(aValue, aName) {
|
||||
return replaceNewline(aValue);
|
||||
},
|
||||
|
||||
toICAL: function escape(aValue, aName) {
|
||||
return aValue.replace(/\\|;|,|\n/g, function(str) {
|
||||
switch (str) {
|
||||
case "\\":
|
||||
return "\\\\";
|
||||
case ";":
|
||||
return "\\;";
|
||||
case ",":
|
||||
return "\\,";
|
||||
case "\n":
|
||||
return "\\n";
|
||||
/* istanbul ignore next */
|
||||
default:
|
||||
return str;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
uri: {
|
||||
// TODO
|
||||
/* ... */
|
||||
},
|
||||
|
||||
"utc-offset": {
|
||||
toICAL: function(aValue) {
|
||||
if (aValue.length < 7) {
|
||||
|
@ -188,6 +193,12 @@ ICAL.design = (function() {
|
|||
var icalParams = {
|
||||
// Although the syntax is DQUOTE uri DQUOTE, I don't think we should
|
||||
// enfoce anything aside from it being a valid content line.
|
||||
//
|
||||
// At least some params require - if multi values are used - DQUOTEs
|
||||
// for each of its values - e.g. delegated-from="uri1","uri2"
|
||||
// To indicate this, I introduced the new k/v pair
|
||||
// multiValueSeparateDQuote: true
|
||||
//
|
||||
// "ALTREP": { ... },
|
||||
|
||||
// CN just wants a param-value
|
||||
|
@ -201,11 +212,13 @@ ICAL.design = (function() {
|
|||
|
||||
"delegated-from": {
|
||||
valueType: "cal-address",
|
||||
multiValue: ","
|
||||
multiValue: ",",
|
||||
multiValueSeparateDQuote: true
|
||||
},
|
||||
"delegated-to": {
|
||||
valueType: "cal-address",
|
||||
multiValue: ","
|
||||
multiValue: ",",
|
||||
multiValueSeparateDQuote: true
|
||||
},
|
||||
// "DIR": { ... }, // See ALTREP
|
||||
"encoding": {
|
||||
|
@ -220,7 +233,8 @@ ICAL.design = (function() {
|
|||
// "LANGUAGE": { ... }, // See ALTREP
|
||||
"member": {
|
||||
valueType: "cal-address",
|
||||
multiValue: ","
|
||||
multiValue: ",",
|
||||
multiValueSeparateDQuote: true
|
||||
},
|
||||
"partstat": {
|
||||
// TODO These values are actually different per-component
|
||||
|
@ -267,6 +281,12 @@ ICAL.design = (function() {
|
|||
|
||||
// When adding a value here, be sure to add it to the parameter types!
|
||||
var icalValues = ICAL.helpers.extend(commonValues, {
|
||||
text: createTextType(FROM_ICAL_NEWLINE, TO_ICAL_NEWLINE),
|
||||
|
||||
uri: {
|
||||
// TODO
|
||||
/* ... */
|
||||
},
|
||||
|
||||
"binary": {
|
||||
decorate: function(aString) {
|
||||
|
@ -295,15 +315,9 @@ ICAL.design = (function() {
|
|||
fromICAL: function(aValue) {
|
||||
// from: 20120901
|
||||
// to: 2012-09-01
|
||||
var result = aValue.substr(0, 4) + '-' +
|
||||
aValue.substr(4, 2) + '-' +
|
||||
aValue.substr(6, 2);
|
||||
|
||||
if (aValue[8] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
return result;
|
||||
return aValue.substr(0, 4) + '-' +
|
||||
aValue.substr(4, 2) + '-' +
|
||||
aValue.substr(6, 2);
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
|
@ -315,15 +329,9 @@ ICAL.design = (function() {
|
|||
return aValue;
|
||||
}
|
||||
|
||||
var result = aValue.substr(0, 4) +
|
||||
aValue.substr(5, 2) +
|
||||
aValue.substr(8, 2);
|
||||
|
||||
if (aValue[10] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
return result;
|
||||
return aValue.substr(0, 4) +
|
||||
aValue.substr(5, 2) +
|
||||
aValue.substr(8, 2);
|
||||
}
|
||||
},
|
||||
"date-time": {
|
||||
|
@ -337,7 +345,7 @@ ICAL.design = (function() {
|
|||
aValue.substr(11, 2) + ':' +
|
||||
aValue.substr(13, 2);
|
||||
|
||||
if (aValue[15] === 'Z') {
|
||||
if (aValue[15] && aValue[15] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
|
@ -362,7 +370,7 @@ ICAL.design = (function() {
|
|||
// SS
|
||||
aValue.substr(17, 2);
|
||||
|
||||
if (aValue[19] === 'Z') {
|
||||
if (aValue[19] && aValue[19] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
|
@ -424,7 +432,7 @@ ICAL.design = (function() {
|
|||
toICAL: function(data) {
|
||||
var str = "";
|
||||
for (var k in data) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!Object.prototype.hasOwnProperty.call(data, k)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -436,7 +444,9 @@ ICAL.design = (function() {
|
|||
val = icalValues.date.toICAL(val);
|
||||
}
|
||||
} else if (k == "wkst") {
|
||||
val = ICAL.Recur.numericDayToIcalDay(val);
|
||||
if (typeof val === 'number') {
|
||||
val = ICAL.Recur.numericDayToIcalDay(val);
|
||||
}
|
||||
} else if (Array.isArray(val)) {
|
||||
val = val.join(",");
|
||||
}
|
||||
|
@ -559,6 +569,8 @@ ICAL.design = (function() {
|
|||
|
||||
// When adding a value here, be sure to add it to the parameter types!
|
||||
var vcardValues = ICAL.helpers.extend(commonValues, {
|
||||
text: createTextType(FROM_VCARD_NEWLINE, TO_VCARD_NEWLINE),
|
||||
uri: createTextType(FROM_VCARD_NEWLINE, TO_VCARD_NEWLINE),
|
||||
|
||||
date: {
|
||||
decorate: function(aValue) {
|
||||
|
@ -721,7 +733,7 @@ ICAL.design = (function() {
|
|||
};
|
||||
|
||||
var vcardProperties = ICAL.helpers.extend(commonProperties, {
|
||||
"adr": DEFAULT_TYPE_TEXT_STRUCTURED,
|
||||
"adr": { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
"anniversary": DEFAULT_TYPE_DATE_ANDOR_TIME,
|
||||
"bday": DEFAULT_TYPE_DATE_ANDOR_TIME,
|
||||
"caladruri": DEFAULT_TYPE_URI,
|
||||
|
@ -741,7 +753,7 @@ ICAL.design = (function() {
|
|||
"n": { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
"nickname": DEFAULT_TYPE_TEXT_MULTI,
|
||||
"note": DEFAULT_TYPE_TEXT,
|
||||
"org": DEFAULT_TYPE_TEXT_STRUCTURED,
|
||||
"org": { defaultType: "text", structuredValue: ";" },
|
||||
"photo": DEFAULT_TYPE_URI,
|
||||
"related": DEFAULT_TYPE_URI,
|
||||
"rev": { defaultType: "timestamp" },
|
||||
|
@ -754,6 +766,95 @@ ICAL.design = (function() {
|
|||
"xml": DEFAULT_TYPE_TEXT
|
||||
});
|
||||
|
||||
var vcard3Values = ICAL.helpers.extend(commonValues, {
|
||||
binary: icalValues.binary,
|
||||
date: vcardValues.date,
|
||||
"date-time": vcardValues["date-time"],
|
||||
"phone-number": {
|
||||
// TODO
|
||||
/* ... */
|
||||
},
|
||||
uri: icalValues.uri,
|
||||
text: icalValues.text,
|
||||
time: icalValues.time,
|
||||
vcard: icalValues.text,
|
||||
"utc-offset": {
|
||||
toICAL: function(aValue) {
|
||||
return aValue.substr(0, 7);
|
||||
},
|
||||
|
||||
fromICAL: function(aValue) {
|
||||
return aValue.substr(0, 7);
|
||||
},
|
||||
|
||||
decorate: function(aValue) {
|
||||
return ICAL.UtcOffset.fromString(aValue);
|
||||
},
|
||||
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var vcard3Params = {
|
||||
"type": {
|
||||
valueType: "text",
|
||||
multiValue: ","
|
||||
},
|
||||
"value": {
|
||||
// since the value here is a 'type' lowercase is used.
|
||||
values: ["text", "uri", "date", "date-time", "phone-number", "time",
|
||||
"boolean", "integer", "float", "utc-offset", "vcard", "binary"],
|
||||
allowXName: true,
|
||||
allowIanaToken: true
|
||||
}
|
||||
};
|
||||
|
||||
var vcard3Properties = ICAL.helpers.extend(commonProperties, {
|
||||
fn: DEFAULT_TYPE_TEXT,
|
||||
n: { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
nickname: DEFAULT_TYPE_TEXT_MULTI,
|
||||
photo: { defaultType: "binary", allowedTypes: ["binary", "uri"] },
|
||||
bday: {
|
||||
defaultType: "date-time",
|
||||
allowedTypes: ["date-time", "date"],
|
||||
detectType: function(string) {
|
||||
return (string.indexOf('T') === -1) ? 'date' : 'date-time';
|
||||
}
|
||||
},
|
||||
|
||||
adr: { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
label: DEFAULT_TYPE_TEXT,
|
||||
|
||||
tel: { defaultType: "phone-number" },
|
||||
email: DEFAULT_TYPE_TEXT,
|
||||
mailer: DEFAULT_TYPE_TEXT,
|
||||
|
||||
tz: { defaultType: "utc-offset", allowedTypes: ["utc-offset", "text"] },
|
||||
geo: { defaultType: "float", structuredValue: ";" },
|
||||
|
||||
title: DEFAULT_TYPE_TEXT,
|
||||
role: DEFAULT_TYPE_TEXT,
|
||||
logo: { defaultType: "binary", allowedTypes: ["binary", "uri"] },
|
||||
agent: { defaultType: "vcard", allowedTypes: ["vcard", "text", "uri"] },
|
||||
org: DEFAULT_TYPE_TEXT_STRUCTURED,
|
||||
|
||||
note: DEFAULT_TYPE_TEXT_MULTI,
|
||||
prodid: DEFAULT_TYPE_TEXT,
|
||||
rev: {
|
||||
defaultType: "date-time",
|
||||
allowedTypes: ["date-time", "date"],
|
||||
detectType: function(string) {
|
||||
return (string.indexOf('T') === -1) ? 'date' : 'date-time';
|
||||
}
|
||||
},
|
||||
"sort-string": DEFAULT_TYPE_TEXT,
|
||||
sound: { defaultType: "binary", allowedTypes: ["binary", "uri"] },
|
||||
|
||||
class: DEFAULT_TYPE_TEXT,
|
||||
key: { defaultType: "binary", allowedTypes: ["binary", "text"] }
|
||||
});
|
||||
|
||||
/**
|
||||
* iCalendar design set
|
||||
|
@ -766,7 +867,7 @@ ICAL.design = (function() {
|
|||
};
|
||||
|
||||
/**
|
||||
* vCard design set
|
||||
* vCard 4.0 design set
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
var vcardSet = {
|
||||
|
@ -775,6 +876,16 @@ ICAL.design = (function() {
|
|||
property: vcardProperties
|
||||
};
|
||||
|
||||
/**
|
||||
* vCard 3.0 design set
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
var vcard3Set = {
|
||||
value: vcard3Values,
|
||||
param: vcard3Params,
|
||||
property: vcard3Properties
|
||||
};
|
||||
|
||||
/**
|
||||
* The design data, used by the parser to determine types for properties and
|
||||
* other metadata needed to produce correct jCard/jCal data.
|
||||
|
@ -831,6 +942,7 @@ ICAL.design = (function() {
|
|||
*/
|
||||
components: {
|
||||
vcard: vcardSet,
|
||||
vcard3: vcard3Set,
|
||||
vevent: icalSet,
|
||||
vtodo: icalSet,
|
||||
vjournal: icalSet,
|
||||
|
@ -853,6 +965,12 @@ ICAL.design = (function() {
|
|||
*/
|
||||
vcard: vcardSet,
|
||||
|
||||
/**
|
||||
* The design set for vCard (rfc2425/rfc2426/rfc7095) components.
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
vcard3: vcard3Set,
|
||||
|
||||
/**
|
||||
* Gets the design set for the given component name.
|
||||
*
|
||||
|
|
2
js/vendor/ical.js/lib/ical/duration.js
vendored
2
js/vendor/ical.js/lib/ical/duration.js
vendored
|
@ -156,7 +156,7 @@
|
|||
var propsToCopy = ["weeks", "days", "hours",
|
||||
"minutes", "seconds", "isNegative"];
|
||||
for (var key in propsToCopy) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!propsToCopy.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
|
|
15
js/vendor/ical.js/lib/ical/helpers.js
vendored
15
js/vendor/ical.js/lib/ical/helpers.js
vendored
|
@ -9,14 +9,9 @@
|
|||
if (typeof module === 'object') {
|
||||
// CommonJS, where exports may be different each time.
|
||||
ICAL = module.exports;
|
||||
} else /* istanbul ignore next */ if (typeof window !== 'undefined') {
|
||||
if (typeof ICAL !== 'object') {
|
||||
/** @ignore */
|
||||
this.ICAL = {};
|
||||
}
|
||||
} else /* istanbul ignore next */ {
|
||||
// ...?
|
||||
ICAL = {};
|
||||
} else if (typeof ICAL !== 'object') {/* istanbul ignore next */
|
||||
/** @ignore */
|
||||
this.ICAL = {};
|
||||
}
|
||||
/* jshint ignore:end */
|
||||
|
||||
|
@ -301,7 +296,7 @@ ICAL.helpers = {
|
|||
/**
|
||||
* Poor-man's cross-browser object extension. Doesn't support all the
|
||||
* features, but enough for our usage. Note that the target's properties are
|
||||
* always overwritten with the source properties.
|
||||
* not overwritten with the source properties.
|
||||
*
|
||||
* @example
|
||||
* var child = ICAL.helpers.extend(parent, {
|
||||
|
@ -315,7 +310,7 @@ ICAL.helpers = {
|
|||
extend: function(source, target) {
|
||||
for (var key in source) {
|
||||
var descr = Object.getOwnPropertyDescriptor(source, key);
|
||||
if (descr) {
|
||||
if (descr && !Object.getOwnPropertyDescriptor(target, key)) {
|
||||
Object.defineProperty(target, key, descr);
|
||||
}
|
||||
}
|
||||
|
|
75
js/vendor/ical.js/lib/ical/parse.js
vendored
75
js/vendor/ical.js/lib/ical/parse.js
vendored
|
@ -275,19 +275,24 @@ ICAL.parse = (function() {
|
|||
|
||||
var result;
|
||||
if (multiValue && structuredValue) {
|
||||
value = parser._parseMultiValue(value, structuredValue, valueType, [], multiValue, state.designSet);
|
||||
value = parser._parseMultiValue(value, structuredValue, valueType, [], multiValue, state.designSet, structuredValue);
|
||||
result = [name, params, valueType, value];
|
||||
} else if (multiValue) {
|
||||
result = [name, params, valueType];
|
||||
parser._parseMultiValue(value, multiValue, valueType, result, null, state.designSet);
|
||||
parser._parseMultiValue(value, multiValue, valueType, result, null, state.designSet, false);
|
||||
} else if (structuredValue) {
|
||||
value = parser._parseMultiValue(value, structuredValue, valueType, [], null, state.designSet);
|
||||
value = parser._parseMultiValue(value, structuredValue, valueType, [], null, state.designSet, structuredValue);
|
||||
result = [name, params, valueType, value];
|
||||
} else {
|
||||
value = parser._parseValue(value, valueType, state.designSet);
|
||||
value = parser._parseValue(value, valueType, state.designSet, false);
|
||||
result = [name, params, valueType, value];
|
||||
}
|
||||
|
||||
// rfc6350 requires that in vCard 4.0 the first component is the VERSION
|
||||
// component with as value 4.0, note that 3.0 does not have this requirement.
|
||||
if (state.component[0] === 'vcard' && state.component[1].length === 0 &&
|
||||
!(name === 'version' && value === '4.0')) {
|
||||
state.designSet = design.getDesignSet("vcard3");
|
||||
}
|
||||
state.component[1].push(result);
|
||||
};
|
||||
|
||||
|
@ -301,9 +306,9 @@ ICAL.parse = (function() {
|
|||
* @param {Object} designSet The design data to use for this value
|
||||
* @return {Object} varies on type
|
||||
*/
|
||||
parser._parseValue = function(value, type, designSet) {
|
||||
parser._parseValue = function(value, type, designSet, structuredValue) {
|
||||
if (type in designSet.value && 'fromICAL' in designSet.value[type]) {
|
||||
return designSet.value[type].fromICAL(value);
|
||||
return designSet.value[type].fromICAL(value, structuredValue);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
@ -325,7 +330,7 @@ ICAL.parse = (function() {
|
|||
var result = {};
|
||||
var name, lcname;
|
||||
var value, valuePos = -1;
|
||||
var type, multiValue;
|
||||
var type, multiValue, mvdelim;
|
||||
|
||||
// find the next '=' sign
|
||||
// use lastParam and pos to find name
|
||||
|
@ -341,10 +346,33 @@ ICAL.parse = (function() {
|
|||
}
|
||||
lcname = name.toLowerCase();
|
||||
|
||||
if (lcname in designSet.param && designSet.param[lcname].valueType) {
|
||||
type = designSet.param[lcname].valueType;
|
||||
} else {
|
||||
type = DEFAULT_PARAM_TYPE;
|
||||
}
|
||||
|
||||
if (lcname in designSet.param) {
|
||||
multiValue = designSet.param[lcname].multiValue;
|
||||
if (designSet.param[lcname].multiValueSeparateDQuote) {
|
||||
mvdelim = parser._rfc6868Escape('"' + multiValue + '"');
|
||||
}
|
||||
}
|
||||
|
||||
var nextChar = line[pos + 1];
|
||||
if (nextChar === '"') {
|
||||
valuePos = pos + 2;
|
||||
pos = helpers.unescapedIndexOf(line, '"', valuePos);
|
||||
if (multiValue && pos != -1) {
|
||||
var extendedValue = true;
|
||||
while (extendedValue) {
|
||||
if (line[pos + 1] == multiValue && line[pos + 2] == '"') {
|
||||
pos = helpers.unescapedIndexOf(line, '"', pos + 3);
|
||||
} else {
|
||||
extendedValue = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pos === -1) {
|
||||
throw new ParserError(
|
||||
'invalid line (no matching double quote) "' + line + '"'
|
||||
|
@ -375,24 +403,16 @@ ICAL.parse = (function() {
|
|||
pos = false;
|
||||
} else {
|
||||
lastParam = nextPos;
|
||||
pos = nextPos;
|
||||
}
|
||||
|
||||
value = line.substr(valuePos, nextPos - valuePos);
|
||||
}
|
||||
|
||||
if (lcname in designSet.param && designSet.param[lcname].valueType) {
|
||||
type = designSet.param[lcname].valueType;
|
||||
} else {
|
||||
type = DEFAULT_PARAM_TYPE;
|
||||
}
|
||||
|
||||
if (lcname in designSet.param) {
|
||||
multiValue = designSet.param[lcname].multiValue;
|
||||
}
|
||||
|
||||
value = parser._rfc6868Escape(value);
|
||||
if (multiValue) {
|
||||
result[lcname] = parser._parseMultiValue(value, multiValue, type, [], null, designSet);
|
||||
var delimiter = mvdelim || multiValue;
|
||||
result[lcname] = parser._parseMultiValue(value, delimiter, type, [], null, designSet);
|
||||
} else {
|
||||
result[lcname] = parser._parseValue(value, type, designSet);
|
||||
}
|
||||
|
@ -430,29 +450,32 @@ ICAL.parse = (function() {
|
|||
* @param {ICAL.design.designSet} designSet The design data for this value
|
||||
* @return {?|Array.<?>} Either an array of results, or the first result
|
||||
*/
|
||||
parser._parseMultiValue = function(buffer, delim, type, result, innerMulti, designSet) {
|
||||
parser._parseMultiValue = function(buffer, delim, type, result, innerMulti, designSet, structuredValue) {
|
||||
var pos = 0;
|
||||
var lastPos = 0;
|
||||
var value;
|
||||
if (delim.length === 0) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
// split each piece
|
||||
while ((pos = helpers.unescapedIndexOf(buffer, delim, lastPos)) !== -1) {
|
||||
value = buffer.substr(lastPos, pos - lastPos);
|
||||
if (innerMulti) {
|
||||
value = parser._parseMultiValue(value, innerMulti, type, [], null, designSet);
|
||||
value = parser._parseMultiValue(value, innerMulti, type, [], null, designSet, structuredValue);
|
||||
} else {
|
||||
value = parser._parseValue(value, type, designSet);
|
||||
value = parser._parseValue(value, type, designSet, structuredValue);
|
||||
}
|
||||
result.push(value);
|
||||
lastPos = pos + 1;
|
||||
lastPos = pos + delim.length;
|
||||
}
|
||||
|
||||
// on the last piece take the rest of string
|
||||
value = buffer.substr(lastPos);
|
||||
if (innerMulti) {
|
||||
value = parser._parseMultiValue(value, innerMulti, type, [], null, designSet);
|
||||
value = parser._parseMultiValue(value, innerMulti, type, [], null, designSet, structuredValue);
|
||||
} else {
|
||||
value = parser._parseValue(value, type, designSet);
|
||||
value = parser._parseValue(value, type, designSet, structuredValue);
|
||||
}
|
||||
result.push(value);
|
||||
|
||||
|
@ -480,7 +503,7 @@ ICAL.parse = (function() {
|
|||
do {
|
||||
pos = buffer.indexOf('\n', lastPos) + 1;
|
||||
|
||||
if (buffer[pos - 2] === '\r') {
|
||||
if (pos > 1 && buffer[pos - 2] === '\r') {
|
||||
newlineOffset = 2;
|
||||
} else {
|
||||
newlineOffset = 1;
|
||||
|
|
32
js/vendor/ical.js/lib/ical/property.js
vendored
32
js/vendor/ical.js/lib/ical/property.js
vendored
|
@ -207,20 +207,30 @@ ICAL.Property = (function() {
|
|||
/**
|
||||
* Gets a parameter on the property.
|
||||
*
|
||||
* @param {String} name Property name (lowercase)
|
||||
* @return {String} Property value
|
||||
* @param {String} name Property name (lowercase)
|
||||
* @return {Array|String} Property value
|
||||
*/
|
||||
getParameter: function(name) {
|
||||
return this.jCal[PROP_INDEX][name];
|
||||
if (name in this.jCal[PROP_INDEX]) {
|
||||
return this.jCal[PROP_INDEX][name];
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets a parameter on the property.
|
||||
*
|
||||
* @param {String} name The parameter name
|
||||
* @param {String} value The parameter value
|
||||
* @param {String} name The parameter name
|
||||
* @param {Array|String} value The parameter value
|
||||
*/
|
||||
setParameter: function(name, value) {
|
||||
var lcname = name.toLowerCase();
|
||||
if (typeof value === "string" &&
|
||||
lcname in this._designSet.param &&
|
||||
'multiValue' in this._designSet.param[lcname]) {
|
||||
value = [value];
|
||||
}
|
||||
this.jCal[PROP_INDEX][name] = value;
|
||||
},
|
||||
|
||||
|
@ -374,9 +384,9 @@ ICAL.Property = (function() {
|
|||
* The string representation of this component.
|
||||
* @return {String}
|
||||
*/
|
||||
toICAL: function() {
|
||||
toICALString: function() {
|
||||
return ICAL.stringify.property(
|
||||
this.jCal, this._designSet
|
||||
this.jCal, this._designSet, true
|
||||
);
|
||||
}
|
||||
};
|
||||
|
@ -384,10 +394,12 @@ ICAL.Property = (function() {
|
|||
/**
|
||||
* Create an {@link ICAL.Property} by parsing the passed iCalendar string.
|
||||
*
|
||||
* @param {String} str The iCalendar string to parse
|
||||
* @param {String} str The iCalendar string to parse
|
||||
* @param {ICAL.design.designSet=} designSet The design data to use for this property
|
||||
* @return {ICAL.Property} The created iCalendar property
|
||||
*/
|
||||
Property.fromString = function(str) {
|
||||
return new Property(ICAL.parse.property(str));
|
||||
Property.fromString = function(str, designSet) {
|
||||
return new Property(ICAL.parse.property(str, designSet));
|
||||
};
|
||||
|
||||
return Property;
|
||||
|
|
2
js/vendor/ical.js/lib/ical/recur.js
vendored
2
js/vendor/ical.js/lib/ical/recur.js
vendored
|
@ -296,7 +296,7 @@
|
|||
}
|
||||
|
||||
for (var k in this.parts) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.parts.hasOwnProperty(k)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ ICAL.RecurExpansion = (function() {
|
|||
*
|
||||
* var expand = new ICAL.RecurExpansion({
|
||||
* component: event,
|
||||
* start: event.getFirstPropertyValue('DTSTART')
|
||||
* dtstart: event.getFirstPropertyValue('dtstart')
|
||||
* });
|
||||
*
|
||||
* // remember there are infinite rules
|
||||
|
|
50
js/vendor/ical.js/lib/ical/recur_iterator.js
vendored
50
js/vendor/ical.js/lib/ical/recur_iterator.js
vendored
|
@ -139,7 +139,9 @@ ICAL.RecurIterator = (function() {
|
|||
this.occurrence_number = options.occurrence_number;
|
||||
|
||||
this.days = options.days || [];
|
||||
this.last = ICAL.helpers.formatClassType(options.last, ICAL.Time);
|
||||
if (options.last) {
|
||||
this.last = ICAL.helpers.formatClassType(options.last, ICAL.Time);
|
||||
}
|
||||
|
||||
this.by_indices = options.by_indices;
|
||||
|
||||
|
@ -250,7 +252,7 @@ ICAL.RecurIterator = (function() {
|
|||
|
||||
// Check every weekday in BYDAY with relative dow and pos.
|
||||
for (var i in this.by_data.BYDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYDAY.hasOwnProperty(i)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -557,8 +559,12 @@ ICAL.RecurIterator = (function() {
|
|||
|
||||
// For the case of more than one occurrence in one month
|
||||
// we have to be sure to start searching after the last
|
||||
// found date or at the last BYMONTHDAY.
|
||||
while (byMonthDay[dateIdx] <= lastDay && dateIdx < dateLen - 1) {
|
||||
// found date or at the last BYMONTHDAY, unless we are
|
||||
// initializing the iterator because in this case we have
|
||||
// to consider the last found date too.
|
||||
while (byMonthDay[dateIdx] <= lastDay &&
|
||||
!(isInit && byMonthDay[dateIdx] == lastDay) &&
|
||||
dateIdx < dateLen - 1) {
|
||||
dateIdx++;
|
||||
}
|
||||
}
|
||||
|
@ -579,7 +585,12 @@ ICAL.RecurIterator = (function() {
|
|||
lastDay -= 1;
|
||||
}
|
||||
|
||||
while (!dataIsValid) {
|
||||
// Use a counter to avoid an infinite loop with malformed rules.
|
||||
// Stop checking after 4 years so we consider also a leap year.
|
||||
var monthsCounter = 48;
|
||||
|
||||
while (!dataIsValid && monthsCounter) {
|
||||
monthsCounter--;
|
||||
// increment the current date. This is really
|
||||
// important otherwise we may fall into the infinite
|
||||
// loop trap. The initial date takes care of the case
|
||||
|
@ -637,6 +648,13 @@ ICAL.RecurIterator = (function() {
|
|||
}
|
||||
}
|
||||
|
||||
if (monthsCounter <= 0) {
|
||||
// Checked 4 years without finding a Byday that matches
|
||||
// a Bymonthday. Maybe the rule is not correct.
|
||||
throw new Error("Malformed values in BYDAY combined with BYMONTHDAY parts");
|
||||
}
|
||||
|
||||
|
||||
return dataIsValid;
|
||||
},
|
||||
|
||||
|
@ -985,7 +1003,7 @@ ICAL.RecurIterator = (function() {
|
|||
this.days.push(t1.dayOfYear());
|
||||
} else if (partCount == 1 && "BYMONTH" in parts) {
|
||||
for (var monthkey in this.by_data.BYMONTH) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYMONTH.hasOwnProperty(monthkey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -997,7 +1015,7 @@ ICAL.RecurIterator = (function() {
|
|||
}
|
||||
} else if (partCount == 1 && "BYMONTHDAY" in parts) {
|
||||
for (var monthdaykey in this.by_data.BYMONTHDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYMONTHDAY.hasOwnProperty(monthdaykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1016,14 +1034,14 @@ ICAL.RecurIterator = (function() {
|
|||
"BYMONTHDAY" in parts &&
|
||||
"BYMONTH" in parts) {
|
||||
for (var monthkey in this.by_data.BYMONTH) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYMONTH.hasOwnProperty(monthkey)) {
|
||||
continue;
|
||||
}
|
||||
var month_ = this.by_data.BYMONTH[monthkey];
|
||||
var daysInMonth = ICAL.Time.daysInMonth(month_, aYear);
|
||||
for (var monthdaykey in this.by_data.BYMONTHDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYMONTHDAY.hasOwnProperty(monthdaykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1049,7 +1067,7 @@ ICAL.RecurIterator = (function() {
|
|||
this.days = this.days.concat(this.expand_by_day(aYear));
|
||||
} else if (partCount == 2 && "BYDAY" in parts && "BYMONTH" in parts) {
|
||||
for (var monthkey in this.by_data.BYMONTH) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYMONTH.hasOwnProperty(monthkey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1085,7 +1103,7 @@ ICAL.RecurIterator = (function() {
|
|||
}
|
||||
} else {
|
||||
for (var daycodedkey in this.by_data.BYDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYDAY.hasOwnProperty(daycodedkey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1125,7 +1143,7 @@ ICAL.RecurIterator = (function() {
|
|||
var expandedDays = this.expand_by_day(aYear);
|
||||
|
||||
for (var daykey in expandedDays) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!expandedDays.hasOwnProperty(daykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1142,7 +1160,7 @@ ICAL.RecurIterator = (function() {
|
|||
var expandedDays = this.expand_by_day(aYear);
|
||||
|
||||
for (var daykey in expandedDays) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!expandedDays.hasOwnProperty(daykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1158,7 +1176,7 @@ ICAL.RecurIterator = (function() {
|
|||
var expandedDays = this.expand_by_day(aYear);
|
||||
|
||||
for (var daykey in expandedDays) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!expandedDays.hasOwnProperty(daykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1203,7 +1221,7 @@ ICAL.RecurIterator = (function() {
|
|||
var end_year_day = tmp.dayOfYear();
|
||||
|
||||
for (var daykey in this.by_data.BYDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYDAY.hasOwnProperty(daykey)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1246,7 +1264,7 @@ ICAL.RecurIterator = (function() {
|
|||
|
||||
is_day_in_byday: function is_day_in_byday(tt) {
|
||||
for (var daykey in this.by_data.BYDAY) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!this.by_data.BYDAY.hasOwnProperty(daykey)) {
|
||||
continue;
|
||||
}
|
||||
|
|
37
js/vendor/ical.js/lib/ical/stringify.js
vendored
37
js/vendor/ical.js/lib/ical/stringify.js
vendored
|
@ -60,12 +60,20 @@ ICAL.stringify = (function() {
|
|||
stringify.component = function(component, designSet) {
|
||||
var name = component[0].toUpperCase();
|
||||
var result = 'BEGIN:' + name + LINE_ENDING;
|
||||
designSet = designSet || design.getDesignSet(component[0]);
|
||||
|
||||
var props = component[1];
|
||||
var propIdx = 0;
|
||||
var propLen = props.length;
|
||||
|
||||
var designSetName = component[0];
|
||||
// rfc6350 requires that in vCard 4.0 the first component is the VERSION
|
||||
// component with as value 4.0, note that 3.0 does not have this requirement.
|
||||
if (designSetName === 'vcard' && component[1].length > 0 &&
|
||||
!(component[1][0][0] === "version" && component[1][0][3] === "4.0")) {
|
||||
designSetName = "vcard3";
|
||||
}
|
||||
designSet = designSet || design.getDesignSet(designSetName);
|
||||
|
||||
for (; propIdx < propLen; propIdx++) {
|
||||
result += stringify.property(props[propIdx], designSet) + LINE_ENDING;
|
||||
}
|
||||
|
@ -90,9 +98,11 @@ ICAL.stringify = (function() {
|
|||
* jCal/jCard property array
|
||||
* @param {ICAL.design.designSet} designSet
|
||||
* The design data to use for this property
|
||||
* @param {Boolean} noFold
|
||||
* If true, the line is not folded
|
||||
* @return {String} The iCalendar/vCard string
|
||||
*/
|
||||
stringify.property = function(property, designSet) {
|
||||
stringify.property = function(property, designSet, noFold) {
|
||||
var name = property[0].toUpperCase();
|
||||
var jsName = property[0];
|
||||
var params = property[1];
|
||||
|
@ -107,6 +117,9 @@ ICAL.stringify = (function() {
|
|||
if (params.hasOwnProperty(paramName)) {
|
||||
var multiValue = (paramName in designSet.param) && designSet.param[paramName].multiValue;
|
||||
if (multiValue && Array.isArray(value)) {
|
||||
if (designSet.param[paramName].multiValueSeparateDQuote) {
|
||||
multiValue = '"' + multiValue + '"';
|
||||
}
|
||||
value = value.map(stringify._rfc6868Unescape);
|
||||
value = stringify.multiValue(value, multiValue, "unknown", null, designSet);
|
||||
} else {
|
||||
|
@ -172,21 +185,21 @@ ICAL.stringify = (function() {
|
|||
|
||||
if (multiValue && structuredValue) {
|
||||
line += stringify.multiValue(
|
||||
property[3], structuredValue, valueType, multiValue, designSet
|
||||
property[3], structuredValue, valueType, multiValue, designSet, structuredValue
|
||||
);
|
||||
} else if (multiValue) {
|
||||
line += stringify.multiValue(
|
||||
property.slice(3), multiValue, valueType, null, designSet
|
||||
property.slice(3), multiValue, valueType, null, designSet, false
|
||||
);
|
||||
} else if (structuredValue) {
|
||||
line += stringify.multiValue(
|
||||
property[3], structuredValue, valueType, null, designSet
|
||||
property[3], structuredValue, valueType, null, designSet, structuredValue
|
||||
);
|
||||
} else {
|
||||
line += stringify.value(property[3], valueType, designSet);
|
||||
line += stringify.value(property[3], valueType, designSet, false);
|
||||
}
|
||||
|
||||
return ICAL.helpers.foldline(line);
|
||||
return noFold ? line : ICAL.helpers.foldline(line);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -229,16 +242,16 @@ ICAL.stringify = (function() {
|
|||
*
|
||||
* @return {String} iCalendar/vCard string for value
|
||||
*/
|
||||
stringify.multiValue = function(values, delim, type, innerMulti, designSet) {
|
||||
stringify.multiValue = function(values, delim, type, innerMulti, designSet, structuredValue) {
|
||||
var result = '';
|
||||
var len = values.length;
|
||||
var i = 0;
|
||||
|
||||
for (; i < len; i++) {
|
||||
if (innerMulti && Array.isArray(values[i])) {
|
||||
result += stringify.multiValue(values[i], innerMulti, type, null, designSet);
|
||||
result += stringify.multiValue(values[i], innerMulti, type, null, designSet, structuredValue);
|
||||
} else {
|
||||
result += stringify.value(values[i], type, designSet);
|
||||
result += stringify.value(values[i], type, designSet, structuredValue);
|
||||
}
|
||||
|
||||
if (i !== (len - 1)) {
|
||||
|
@ -259,9 +272,9 @@ ICAL.stringify = (function() {
|
|||
* (like boolean, date-time, etc..)
|
||||
* @return {String} iCalendar/vCard value for single value
|
||||
*/
|
||||
stringify.value = function(value, type, designSet) {
|
||||
stringify.value = function(value, type, designSet, structuredValue) {
|
||||
if (type in designSet.value && 'toICAL' in designSet.value[type]) {
|
||||
return designSet.value[type].toICAL(value);
|
||||
return designSet.value[type].toICAL(value, structuredValue);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
|
4
js/vendor/ical.js/lib/ical/time.js
vendored
4
js/vendor/ical.js/lib/ical/time.js
vendored
|
@ -97,7 +97,7 @@
|
|||
/**
|
||||
* Returns a clone of the time object.
|
||||
*
|
||||
* @return {ICAL.Duration} The cloned object
|
||||
* @return {ICAL.Time} The cloned object
|
||||
*/
|
||||
clone: function() {
|
||||
return new ICAL.Time(this._time, this.zone);
|
||||
|
@ -1113,7 +1113,7 @@
|
|||
|
||||
var zone;
|
||||
|
||||
if (aValue[19] === 'Z') {
|
||||
if (aValue[19] && aValue[19] === 'Z') {
|
||||
zone = 'Z';
|
||||
} else if (prop) {
|
||||
zone = prop.getParameter('tzid');
|
||||
|
|
2
js/vendor/ical.js/lib/ical/timezone.js
vendored
2
js/vendor/ical.js/lib/ical/timezone.js
vendored
|
@ -333,7 +333,7 @@
|
|||
} else {
|
||||
var props = aComponent.getAllProperties("rdate");
|
||||
for (var rdatekey in props) {
|
||||
/* istanbul ignore else */
|
||||
/* istanbul ignore if */
|
||||
if (!props.hasOwnProperty(rdatekey)) {
|
||||
continue;
|
||||
}
|
||||
|
|
3
js/vendor/ical.js/lib/ical/vcard_time.js
vendored
3
js/vendor/ical.js/lib/ical/vcard_time.js
vendored
|
@ -18,6 +18,7 @@
|
|||
*
|
||||
* Also, normalization is not yet implemented for this class!
|
||||
*
|
||||
* @alias ICAL.VCardTime
|
||||
* @class
|
||||
* @extends {ICAL.Time}
|
||||
* @param {Object} data The data for the time instance
|
||||
|
@ -45,7 +46,7 @@
|
|||
|
||||
this.fromData(data, zone);
|
||||
};
|
||||
ICAL.helpers.inherits(ICAL.Time, ICAL.VCardTime, {
|
||||
ICAL.helpers.inherits(ICAL.Time, ICAL.VCardTime, /** @lends ICAL.VCardTime */ {
|
||||
|
||||
/**
|
||||
* The class identifier.
|
||||
|
|
54
js/vendor/ical.js/package.json
vendored
54
js/vendor/ical.js/package.json
vendored
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ical.js",
|
||||
"version": "1.1.2",
|
||||
"version": "1.2.2",
|
||||
"author": "Philipp Kewisch",
|
||||
"contributors": [
|
||||
"Github Contributors (https://github.com/mozilla-comm/ical.js/graphs/contributors)"
|
||||
|
@ -21,36 +21,34 @@
|
|||
],
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"benchmark": "~1.0",
|
||||
"benchmark": "~2.1.1",
|
||||
"biased-opener": "^0.2.5",
|
||||
"chai": "~3.0",
|
||||
"chai": "~3.5",
|
||||
"closure-linter-wrapper": "^1.0.1",
|
||||
"coveralls": "^2.11.2",
|
||||
"grunt": "^0.4.5",
|
||||
"coveralls": "^2.11.11",
|
||||
"grunt": "^1.0.1",
|
||||
"grunt-concurrent": "^2.0.0",
|
||||
"grunt-contrib-concat": "^0.5.1",
|
||||
"grunt-contrib-jshint": "^0.11.2",
|
||||
"grunt-contrib-uglify": "^0.9.1",
|
||||
"grunt-contrib-concat": "^1.0.0",
|
||||
"grunt-contrib-uglify": "^2.0.0",
|
||||
"grunt-coveralls": "^1.0.0",
|
||||
"grunt-gh-pages": "^0.10.0",
|
||||
"grunt-gjslint": "^0.2.0",
|
||||
"grunt-jsdoc": "^0.6.4",
|
||||
"grunt-karma": "^0.11.0",
|
||||
"grunt-mocha-cli": "^1.13.0",
|
||||
"grunt-mocha-istanbul": "^2.4.0",
|
||||
"grunt-node-inspector": "^0.2.0",
|
||||
"grunt-release": "^0.13.0",
|
||||
"istanbul": "^0.3.14",
|
||||
"karma": "^0.12.36",
|
||||
"grunt-gh-pages": "^1.0.0",
|
||||
"grunt-jsdoc": "^2.0.0",
|
||||
"grunt-karma": "^1.0.0",
|
||||
"grunt-mocha-cli": "^2.0.0",
|
||||
"grunt-mocha-istanbul": "^5.0.1",
|
||||
"grunt-release": "^0.14.0",
|
||||
"gruntify-eslint": "^2.0.0",
|
||||
"istanbul": "^0.4.2",
|
||||
"karma": "^1.0.0",
|
||||
"karma-chai": "^0.1.0",
|
||||
"karma-mocha": "^0.2.0",
|
||||
"karma-sauce-launcher": "^0.2.11",
|
||||
"karma-spec-reporter": "0.0.19",
|
||||
"karma-mocha": "^1.1.1",
|
||||
"karma-sauce-launcher": "^1.0.0",
|
||||
"karma-spec-reporter": "^0.0.26",
|
||||
"minami": "^1.1.0",
|
||||
"mocha": "~2.2",
|
||||
"mocha": "~2.5.3",
|
||||
"node-static": "^0.7.6",
|
||||
"open": "0.0.5",
|
||||
"sync-exec": "^0.5.0",
|
||||
"sync-exec": "^0.6.0",
|
||||
"test-agent": "~0.28.2"
|
||||
},
|
||||
"license": "MPL-2.0",
|
||||
|
@ -60,16 +58,16 @@
|
|||
"scripts": {
|
||||
"test": "grunt test-node"
|
||||
},
|
||||
"files": [
|
||||
"build/ical.js",
|
||||
"build/ical.min.js",
|
||||
"lib/ical/*.js"
|
||||
],
|
||||
"saucelabs": {
|
||||
"SL_Chrome": {
|
||||
"base": "SauceLabs",
|
||||
"browserName": "chrome"
|
||||
},
|
||||
"SL_InternetExplorer9": {
|
||||
"base": "SauceLabs",
|
||||
"browserName": "internet explorer",
|
||||
"version": 9
|
||||
},
|
||||
"SL_Firefox": {
|
||||
"base": "SauceLabs",
|
||||
"browserName": "firefox"
|
||||
|
|
112
js/vendor/ical.js/sandbox/validator.html
vendored
112
js/vendor/ical.js/sandbox/validator.html
vendored
|
@ -1,6 +1,23 @@
|
|||
<html>
|
||||
<head>
|
||||
<script type="text/javascript" src="../build/ical.js"></script>
|
||||
<!-- Note this code is pretty fugly, it needs to be rewritten -->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
#descr {
|
||||
width: 42em;
|
||||
}
|
||||
input[type="submit"] {
|
||||
font-size: 1.2em;
|
||||
border-radius: 5px;
|
||||
border: 1px solid black;
|
||||
margin-top: 1ex;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="https://rawgit.com/mozilla-comm/ical.js/master/build/ical.js"></script>
|
||||
<script type="text/javascript">
|
||||
function stringError(e) {
|
||||
return "Error: " + e +
|
||||
|
@ -13,59 +30,51 @@
|
|||
var duration = document.getElementById("duration");
|
||||
|
||||
var data = document.getElementById("data");
|
||||
var decorate = document.getElementById("decorate").checked;
|
||||
|
||||
var error = document.getElementById("error");
|
||||
var results = document.getElementById("results");
|
||||
|
||||
var serialize_error = document.getElementById("serialize_error");
|
||||
var reserialized = document.getElementById("reserialized");
|
||||
|
||||
var undecorate_error = document.getElementById("undecorate_error");
|
||||
var undecorated = document.getElementById("undecorated");
|
||||
|
||||
var sourceResult, jsonResult, icalResult, component;
|
||||
var jcalres = document.getElementById("jcal");
|
||||
var icalres = document.getElementById("ical");
|
||||
|
||||
duration.textContent = '';
|
||||
error.textContent = serialize_error.textContent = undecorate_error.textContent = "";
|
||||
results.textContent = reserialized.textContent = undecorated.textContent = "";
|
||||
error.textContent = jcalres.textContent = icalres.textContent = "";
|
||||
|
||||
var beginTime = Date.now();
|
||||
|
||||
var jcal, from;
|
||||
try {
|
||||
// First load the source representation
|
||||
sourceResult = ICAL.parse(data.value)
|
||||
|
||||
// Try to jsonify it
|
||||
jsonResult = JSON.stringify(sourceResult, null, " ");
|
||||
results.textContent = jsonResult;
|
||||
} catch (e) {
|
||||
error.textContent = stringError(e);
|
||||
}
|
||||
|
||||
try {
|
||||
// Try to reserialize it
|
||||
icalResult = ICAL.stringify(JSON.parse(jsonResult));
|
||||
reserialized.textContent = icalResult;
|
||||
} catch (e) {
|
||||
serialize_error.textContent = stringError(e);
|
||||
}
|
||||
|
||||
if (decorate) {
|
||||
|
||||
component = new ICAL.Component(sourceResult[1]);
|
||||
|
||||
jcal = JSON.parse(data.value);
|
||||
from = "json";
|
||||
} catch (jsonerr) {
|
||||
try {
|
||||
// Try to jsonify it
|
||||
jsonResult = JSON.stringify(component, null, " ");
|
||||
undecorated.textContent = jsonResult;
|
||||
} catch (e) {
|
||||
undecorate_error.textContent = stringError(e);
|
||||
jcal = ICAL.parse(data.value);
|
||||
from = "ical";
|
||||
} catch (icalerr) {
|
||||
error.textContent = "Couldn't parse as iCalendar:\n" +
|
||||
stringError(icalerr) + "\n\nNor as jCal:\n" +
|
||||
stringError(jsonerr);
|
||||
}
|
||||
}
|
||||
|
||||
if (from == "json") {
|
||||
ical = ICAL.stringify(jcal);
|
||||
jcal = ICAL.parse(ical);
|
||||
} else if (from == "ical") {
|
||||
ical = ICAL.stringify(jcal);
|
||||
} else {
|
||||
ical = jcal = null;
|
||||
}
|
||||
|
||||
var totalRuntime = Date.now() - beginTime;
|
||||
duration.textContent = 'Total Runtime: ' + totalRuntime;
|
||||
duration.textContent = 'Total Runtime: ' + totalRuntime + ' ms';
|
||||
|
||||
try {
|
||||
jcalres.textContent = jcal ? JSON.stringify(jcal, null, " ") : "";
|
||||
icalres.textContent = ical;
|
||||
document.getElementById("jcalbox").style.display = "";
|
||||
document.getElementById("icalbox").style.display = "";
|
||||
} catch (e) {
|
||||
error.textContent = stringError(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -74,19 +83,22 @@
|
|||
</head>
|
||||
<body>
|
||||
<form method="post" action="#" onsubmit="return validate()">
|
||||
<h1>iCalendar / jCal Validator</h1>
|
||||
<p id="descr">This validator form takes either iCalendar or jCal data. iCalendar data will be parsed to jCal and re-serialized to iCalendar. Similarly, jCal data will be parsed to iCalendar and re-serialized to jCal.</p>
|
||||
<textarea id="data" rows="20" cols="80"></textarea><br/>
|
||||
<input type="checkbox" id="decorate">Decorate</input>
|
||||
<input type="submit" value="Validate"/><br/>
|
||||
<input type="submit" value="Validate" /><br/>
|
||||
<p id="duration"></p>
|
||||
<hr>
|
||||
<pre id="error"></pre>
|
||||
<pre id="results"></pre>
|
||||
<hr>
|
||||
<pre id="serialize_error"></pre>
|
||||
<pre id="reserialized"></pre>
|
||||
<hr>
|
||||
<pre id="undecorate_error"></pre>
|
||||
<pre id="undecorated"></pre>
|
||||
<div id="jcalbox" style="display: none">
|
||||
<h2>jCal Representation</h2>
|
||||
<pre id="jcal"></pre>
|
||||
<hr>
|
||||
</div>
|
||||
<div id="icalbox" style="display: none">
|
||||
<h2>iCalendar Representation</h2>
|
||||
<pre id="ical"></pre>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
2
js/vendor/ical.js/tasks/tests.js
vendored
2
js/vendor/ical.js/tasks/tests.js
vendored
|
@ -17,7 +17,7 @@ module.exports = function(grunt) {
|
|||
var done = this.async();
|
||||
grunt.util.spawn({
|
||||
cmd: 'git',
|
||||
args: ['diff', '--shortstat', 'build/ical.js'],
|
||||
args: ['diff', '--shortstat', 'build/ical.js', 'build/ical.min.js', 'build/ical.min.js.map'],
|
||||
}, function(error, result, code) {
|
||||
if (result.stdout.length) {
|
||||
grunt.fail.fatal('Browser build is not up to date, please run `grunt package`');
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
script('tasks', 'vendor/jstzdetect/jstz.min');
|
||||
script('tasks', 'public/app');
|
||||
script('tasks', 'vendor/jquery-timepicker/jquery.ui.timepicker');
|
||||
script('tasks', 'vendor/davclient.js/lib/client');
|
||||
script('tasks', 'vendor/ical.js/build/ical');
|
||||
style('tasks', 'style');
|
||||
style('tasks', 'vendor/angularui/ui-select/select2');
|
||||
|
|
Loading…
Reference in a new issue