text:
<?php
/**
* Message translations.
*
* This file is automatically generated by 'yii translate' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
* Each array element represents the translation (value) of a message (key).
* If the value is empty, the message is considered as not translated.
* Messages that no longer need translation will have their translations
* enclosed between a pair of '@@' marks.
*
* Message string can be used with plural forms format. Check i18n section
* of the guide for details.
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
    'A new app to make scheduling as simple as it should be.' => 'Eine neue App , um die Planung so einfach, wie es sein sollte.',
    'Building Places' => 'Gebäude Places',
    'Coming Soon' => 'kommt Bald',
    'Episode 1' => 'Episode 1',
    'Episode 2' => 'Episode 2',
    'Episode 3' => 'Episode 3',
    'Feature Requirements' => 'Featureanforderungen',
    'Follow' => 'folgen',
    'Follow along with our tutorial series at Tuts+ as we build Meeting Planner step by step. In this episode we talk about startups in general and the goals for our application.' => 'Folgen Sie zusammen mit unseren Tutorials an Tuts + , wie wir bauen Meeting Planner Schritt für Schritt. In dieser Folge uns über Start-ups im Allgemeinen und die Ziele für unsere Anwendung zu sprechen.',
    'Getting Started' => 'Einstieg',
    'In Episode 2, we scope out the features that we\'ll need for a minimum viable product and the database schema that will support it.' => 'In Episode 2 , wir Umfang aus der Features, die wir für mindestens marktfähiges Produkt und das Datenbankschema , die es unterstützen müssen .',
    'In Episode 3, we build code to enable meeting places, integrating with HTML 5 Geolocation, Google Maps and Google Places.' => 'In Episode 3 bauen wir Code Treffpunkte , die Integration mit HTML 5 Geolocation , Google Maps und Google Places zu ermöglichen.',
    'Learn More' => 'Erfahren Sie Mehr',
    'About' => 'über',
    'Add Current Location' => 'Fügen Aufenthaltsort',
    'Add a Google {modelClass}' => 'Fügen Sie ein Google {modelClass}',
    'Are you sure you want to delete this item?' => 'Sind Sie sicher, Sie wollen diesen Inhalt löschen ?',
    'Contact' => 'Kontakt',
    'Create' => 'schaffen',
    'Create {modelClass}' => 'schaffen {modelClass}',
    'Created At' => 'Erstellt am',
    'Created By' => 'Erstellt von',
    'Delete' => 'löschen',
    'Full Address' => 'Vollständige Adresse',
    'Google Place ID' => 'Google Platz ID',
    'Home' => 'Zuhause',
    'ID' => 'Identifikation',
    'Login' => 'Einloggen',
    'Logout' => 'Logout',
    'Meeting Type' => 'Treffen Typ',
    'MeetingPlanner.io' => 'MeetingPlanner.io',
    'Meetings' => 'Meetings',
    'Message' => 'Nachricht',
    'Name' => 'Name',
    'Notes' => 'Aufzeichnungen',
    'Owner ID' => 'Besitzer-ID',
    'Place Type' => 'Platz Typ',
    'Places' => 'Places',
    'Reset' => 'rücksetzen',
    'Search' => 'Suche',
    'Signup' => 'Anmeldung',
    'Slug' => 'Schnecke',
    'Status' => 'Status',
    'Update' => 'Aktualisierung',
    'Update {modelClass}: ' => 'Aktualisierung {modelClass} :',
    'Updated At' => 'aktualisiert An',
    'Vicinity' => 'Umgebung',
    'Website' => 'Webseite',
];


text:
This package provides an Ionic media view for your Meteor application.

##Configuration
If you set the following session variables you can change the behavior of the package. Defaults are provided.

 - `mediaOwnerId` - The collection independent media owners ID

```
 userMediaSetup =
   mm_media_route_path: "/user/:id/media"
   mm_media_route_name: 'userMedia'
   mm_media_route_template: 'mm_media'
   mm_media_back_header_button_url_base: '/user'

 Meteor.startup ->
   CreateMediaRoutes(userMediaSetup)
```

```
 Template.user.helpers
   mediaUrl: ->
     _editUser = Session.get('_editUser')
     "/user/#{_editUser}/media"
```

```
{{>mm_media_control url=mediaUrl}}
```

redpajama_set_name: RedPajamaGithub


text:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class UpdateText : MonoBehaviour {
	private Text text;
	private Slider slider;
	private string label;
	// Use this for initialization
	void Start () {
		text = GetComponent<Text> ();
		slider = GetComponentInParent<Slider> ();
		label = slider.GetComponent<SyncDebugVariables>().label;
		label = label.ToLower ();

	}

	// Update is called once per frame
	void Update () {
		text.text = label;
		text.text += " : ";
		text.text += slider.value;
	}
}


text:
# ember-drag-sort

[![Travis build status](https://img.shields.io/travis/Deveo/ember-drag-sort.svg)](https://travis-ci.org/Deveo/ember-drag-sort)
[![Ember Observer Score](http://emberobserver.com/badges/ember-drag-sort.svg?cache_bust=1)](http://emberobserver.com/addons/ember-drag-sort)
[![npm package version](https://img.shields.io/npm/v/ember-drag-sort.svg)](https://www.npmjs.com/package/ember-drag-sort)
[![license MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/Deveo/ember-drag-sort/blob/gen-1/LICENSE.md)
![ember-versions 1.13+](https://img.shields.io/badge/ember--versions-1.13%2B-yellowgreen.svg)
![node-versions 6+](https://img.shields.io/badge/node--versions-6%2B-yellowgreen.svg)
![ember-cli 2.16.2](https://img.shields.io/badge/uses%20ember--cli-2.16.2-blue.svg)

* [Support](#support)
* [About](#about)
  * [Features](#features)
  * [Missing features](#missing-features)
  * [Browser support](#browser-support)
* [Installation](#installation)
* [Usage](#usage)
  * [Basic usage](#basic-usage)
  * [The drag end action](#the-drag-end-action)
  * [The determine foreign position action](#the-determine-foreign-position-action)
  * [drag-sort-list arguments reference](#drag-sort-list-arguments-reference)
  * [HTML classes](#html-classes)
  * [CSS concerns](#css-concerns)
  * [Events](#events)
* [Test helpers](#test-helpers)
  * [trigger](#trigger)
  * [sort](#sort)
  * [move](#move)
  * [Page object components](#page-object-components)
    * [Importing page object components](#importing-page-object-components)
    * [Including page object components into your page objects](#including-page-object-components-into-your-page-objects)
    * [Extending the dragSortList page object component](#extending-the-dragsortlist-page-object-component)
    * [Extending the dragSortItem page object component](#extending-the-dragsortitem-page-object-component)
    * [Providing the drag handle selector](#providing-the-drag-handle-selector)
    * [Sorting the dragSortList page object component](#sorting-the-dragsortlist-page-object-component)
* [Development](#development)
  * [Do not use npm, use yarn](#do-not-use-npm-use-yarn)
  * [Installation for development](#installation-for-development)
  * [Running](#running)
  * [Branch names](#branch-names)
  * [Updating the table of contents](#updating-the-table-of-contents)
  * [Demo deployment](#demo-deployment)
* [Credits](#credits)
* [License](#license)

## Support

Bug reports and feature requests are very welcome. In case you have something to suggest or report, please file an issue to the [issue queue](https://github.com/Deveo/ember-drag-sort/issues). But first make sure there's no similar issue. ;)

If you're having trouble using this addon in your project, **please file a properly structured question at [StackOverflow](http://stackoverflow.com/questions/ask?tags=ember.js,ember-drag-sort)**. It is important that you use `ember.js` and `ember-drag-sort` tags for your question to be seen.

## About

A drag'n'drop sortable list addon.

### Features

* Dragging between lists.
* Drag handle.
* Nested lists (tree-like structures).
* Strict DDAU: does not mutate the lists while dragging. On drag end, calls an action for you to handle list mutation.
* Disable sorting within a list while still allowing dragging in and out of the list (sort order is determined by host app instead of the user).

### Missing features

Not in active development. PRs welcome!

* Support for horizontal lists ([#6](https://github.com/Deveo/ember-drag-sort/issues/6)).

### Browser support

Tested manually.

Works in desktop browsers:

* IE 10
* IE 11
* Edge
* Chrome
* Firefox
* Safari

Does not work on mobile browsers:

* Safari/iOS: does not support drag'n'drop.
* Firefox/Android: does not support drag'n'drop.
* Chrome/Android: for some reason, does not fire the `dragend` event. Currently, the addon behaves incorrectly on Chrome/Android. If your webapp offers mobile experience, you must manually detect Chrome/Android and disable dragging.

## Installation

Install the addon:

    ember i ember-drag-sort

You'll also need to install a dependency with either npm:

    npm i -D babel-plugin-transform-object-rest-spread

 or Yarn:

    yarn add -D babel-plugin-transform-object-rest-spread

Finally, add this to your `ember-cli-build.js`:

```js
  babel: {
    plugins: [
      'transform-object-rest-spread'
    ]
  }
```

## Usage

### Basic usage

The `drag-sort-list` component accepts two mandatory arguments:

* `items` -- the array of items to sort. *Must* be an Ember array (normally, all arrays in an Ember app are Ember arrays).
* `dragEndAction` -- a closure action that should update elements when sort is complete.

The component accepts a block representing an individual item (the block is rendered multiple times, one per list item). It yields `item` and `index`.

```handlebars
{{#drag-sort-list
  items         = items1
  dragEndAction = (action 'dragEnd')
  as |item|
}}
  {{item.name}}
{{/drag-sort-list}}
```

### The drag end action

It is called on the source list component when the drag'n'drop operation is complete. It's called with a single argument -- an object with the following properties:

| Property      | Type   | Description                                                            |
|:--------------|:-------|:-----------------------------------------------------------------------|
| `group`       | String | Group provided to the `drag-sort-list` component.                      |
| `draggedItem` | <any>  | The list item being dragged.                                           |
| `sourceList`  | Array  | The list where the sorting was initiated.                              |
| `sourceIndex` | Number | The initial index of the item in the source list.                      |
| `targetList`  | Array  | The list where sorting was finished. Will be the same as `sourceList`. |
| `targetIndex` | Number | The resulting index of the dragged item in the target list.            |

When sorting within one list, `targetIndex` assumes that the dragged item is not in the list.

> For example, when your list is `['a', 'b', 'c']` and you put `b` after `c`, `sourceIndex` will be `1` and `targetIndex` will be `2`. The initial index of `c` was `2`, so you could suppose that target index after `c` is `3`.
>
> But `targetIndex` is calculated as if the dragged item `b` is not in the list: `['a', 'c']`. Thus, next index after `c` will be `2`.
>
> This is because the array has three items with indexes `0`, `1` and `2`, so putting an item to position `3` would make no sense.

Here's the reference implementation of the `dragEndAction` action:

```js
  actions: {
    dragEndAction ({sourceList, sourceIndex, targetList, targetIndex}) {
      if (sourceList === targetList && sourceIndex === targetIndex) return

      const item = sourceList.objectAt(sourceIndex)

      sourceList.removeAt(sourceIndex)
      targetList.insertAt(targetIndex, item)
    }
  }
```

The `dragEndAction` action *must* be a closure action.

Correct:

    dragEndAction = (action 'dragEnd')

Incorrect:

    dragEndAction = 'dragEnd'

### The determine foreign position action

You may want to let the user drag items in and out of a list, without letting him rearrange items within a list. In that case the order of items is determined by the app.

Here's a use case. Your CMS allows the admin to put widgets in page areas. The admin panel has a number of lists representing page header, sidebar, footer, etc. The admin is allowed to rearrange widgets to his liking. And there's a list of unused widgets, the admin can drag items to and from that list, but unused items should always be sorted alphabetically.

To achieve that, pass a closure action `determineForeignPositionAction` into the list of unused items. This will prevent the user from sorting items in that list.

When the user drags a foreign items into such a list, the action will be called to determine the position of the item. Essentially, by running that action the `ember-drag-sort` addon asks the host app to suggest desired position of the dragged item.

The action is only called for foreign items. When the user drags an item out of the unsortable list but then drags the item back, it will appear on its original position.

The `determineForeignPositionAction` is called with with a single argument -- an object with the following properties:

| Property      | Type  | Description                                   |
|:--------------|:------|:----------------------------------------------|
| `draggedItem` |       | The item being dragged.                       |
| `items`       | Array | The list where the item should be positioned. |

This action must return an **integer** -- the desired position of the item.

The simplest implementation is to always put the item into the end of the list:

```js
determineForeignPosition ({/* draggedItem,  */items}) {
  return items.length
}
```

To sort items alphabetically, you  can use lodash:

```js
determineForeignPosition ({draggedItem, items}) {
  return _.sortedIndex(items.toArray(), draggedItem)
}
```

Or do it by hand:

```js
determineForeignPosition ({draggedItem, items}) {
    return Ember.A(items.slice()) // make sure not to mutate the list; `Ember.A()` is typically redundant
      .addObject(draggedItem)
      .sortBy('name')
      .indexOf(draggedItem)
}
```

**`determineForeignPositionAction` must not actually sort the list**. It's only purpose is to suggest desired item position, which is necessary to display the placeholder.

**`determineForeignPositionAction` must passed as a closure action**.

Correct:

    determineForeignPositionAction = (action 'determineForeignPosition')

Incorrect:

    determineForeignPositionAction = 'determineForeignPosition'

### drag-sort-list arguments reference

| Argument                         | Type                          | Default value | Description                                                                                |
|:---------------------------------|:------------------------------|:--------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `items`                          | Ember Array                   | <required>    | An array of items to display and offer sorting.                                                                                |
| `dragEndAction`                  | Closure action                | <required>    | This callback will be called on source list when sorting is complete. See above for details.                                                                                |
| `determineForeignPositionAction` | Closure action or `undefined` | `undefined`   | When provided, used to determine the position of the placeholder when dragging a foreign item into the list. When not provided, the user is able to determine the order. See above for details. |
| `group`                          | <any>                         | `undefined`   | Used to restrict dragging between multiple lists to only some of those lists. Typically a string.                                                                                |
| `draggingEnabled`                | Boolean                       | `true`        | Disables sorting. Useful when `dragEndAction` is an async operation.                                                                                |
| `childClass`                     | String                        | `""`          | HTML class applied to list item components.                                                                                |
| `childTagName`                   | String                        | `"div"`       | `tagName` applied to list item components.                                                                                |
| `handle`                         | String or null                | `null`        | Selector of the drag handle element. When provided, items can only be dragged by handle. The handle element must have `draggable="true"` attribute.                                                                                |

### HTML classes

`drag-sort-list` component has HTML class `dragSortList`. It also assumes the following classes dynamically:

| HTML class         | Applied when...                                                                                |
|:-------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `-isEmpty`         | The given list is empty.                                                                                |
| `-draggingEnabled` | Dragging is enabled via the `draggingEnabled` attribute.                                                                                |
| `-isDragging`      | Dragging is in progress and the given list is either a source list or belongs to the same group as the source list.                                                               |
| `-isDraggingOver`  | Dragging is in progress and the placeholder is within the given list. This class is removed from a list when an item is dragged into a different list.                            |
| `-isExpanded`      | Dragging is in progress and the given list is either empty or contains only the dragged item. Used to give some height to the list, so that the item can be dragged back into it. |

The individual item component has HTML class `dragSortItem`. It also assumes the following classes dynamically:

| HTML class          | Applied when...                                                               |
|:--------------------|:------------------------------------------------------------------------------|
| `-isDragged`        | The given item is the one being dragged. Used to hide the item from the list. |
| `-isDraggingOver`   | Dragged item is positioned either above or below the given item.              |
| `-placeholderAbove` | Dragged item is positioned above the given item.                              |
| `-placeholderBelow` | Dragged item is positioned below the given item.                              |

### CSS concerns

When dragging, the dragged item is hidden via the `-isDragged` HTML class that applies `display: none`.

The placeholder (drop target) is shown via the `-placeholderAbove` or `-placeholderBelow` HTML classes. These classes apply padding to the given list item, and the placeholder is an absolutely positioned `:before` pseudo-element. A similar pseudo-element is applied to an `-isExpanded` list (see above).

For sorting to work correctly, you must not apply padding to the list HTML element. If you need some padding on the list, apply it to its parent element.

You must not apply any padding or margin to list item elements either. If you need padding between list items, apply it to HTML elements that you pass into list items.

Avoid collapsing margins between list items and between list item and list. Collapsing margins may cause a [jumping glitch](https://github.com/Deveo/ember-drag-sort/issues/7).

### Events

There's an Ember service called `dragSort`. You can listen to the following events on it, using the [Evented API](https://www.emberjs.com/api/classes/Ember.Evented.html).

Each event is called with as single argument, which is an object with properties. For the description of properties, see `dragEndAction` documentation above.

| Event name | Description                                                                        | Argument properties                                                                                |
|:-----------|:-----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------|
| `start`    | Sorting has started.                                                               | `group`, `draggedItem`, `sourceList`, `sourceIndex`                                                   |
| `sort`     | Dragged item has been moved within a list. The list is referenced as `targetList`. | `group`, `draggedItem`, `sourceList`, `sourceIndex`, `targetList`, `oldTargetIndex`, `newTargetIndex` |
| `move`     | Item has been dragged into a different list.                                       | `group`, `draggedItem`, `sourceList`, `sourceIndex`, `oldTargetList`, `newTargetList`, `targetIndex`  |
| `end`      | Sorting has ended.                                                                 | `group`, `draggedItem`, `sourceList`, `sourceIndex`, `targetList`, `targetIndex`  |

## Test helpers

### trigger

`trigger` is a low-level test helper that can be imported like this:

```js
import trigger from 'ember-drag-sort/utils/trigger'
```

It accepts three arguments:

| Argument    | Type                                     | Description                                                                                |
|:------------|:-----------------------------------------|:-----------------------------------------------------------------------------------------------|
| `element`   | String, DOM element or jQuery collection | Selector or element to trigger an operation on.                                                |
| `eventName` | String                                   | For list: `dragenter`; for list item: `dragstart`, `dragover` or `dragend`.                    |
| `above`     | Boolean                                  | Only for `dragover`. Whether to put placeholder above (`true`) or below (`false`) target item. |

The order of operations is the following:

1. `dragstart` on the element to drag.
2. `dragenter` on target list that the dragged element should be moved into (optional).
3. `dragover` on target element, the one that the dragged element should be dropped next to. Provide third argument to indicate above or below.
4. `dragover` on the dragged element.

After performing the operations, you must [wait for async behavior](https://guides.emberjs.com/v2.13.0/testing/testing-components/#toc_waiting-on-asynchronous-behavior).

See this addon's integration test for example.

### sort

`sort` is a high-level test helper that **moves an item to a new position within the same list**.

It can be imported like this:

```js
import {sort} from 'ember-drag-sort/utils/trigger'
```

It accepts the following arguments:

| Argument      | Type                                     | Required? | Description                                                                                |
|:--------------|:-----------------------------------------|:----------|:--------------------------------------------------------------------------------------------------------------------------------|
| `sourceList`  | String, DOM element or jQuery collection | yes       | Selector or element of the `drag-sort-list` component.                                                                          |
| `sourceIndex` | Integer                                  | yes       | Zero-based index of the item to pick up.                                                                                |
| `targetIndex` | Integer                                  | yes       | Zero-based index of the item to drop picked item on top of, calculated while the picked item is still on its original position. |
| `above`       | Boolean                                  | yes       | Whether to drop picked item above (`true`) or below (`false`) target item.                                                      |

After executing `sort` in a test, perform a wait using `wait`, `andThen` or `await`.

Example:

```js
import {sort} from 'ember-drag-sort/utils/trigger'

test('sorting a list', async function (assert) {
  await visit('/')

  const $list = $('.dragSortList')

  await sort($list, 0, 1, false)

  const expectedTitles = ['Bar', 'Foo', 'Baz', 'Quux']

  assert.equal($list.children().length, 4)

  expectedTitles.forEach((expectedTitle, k) => {
    m = `List #0 item #${k} content title`
    expect($list.children().eq(k).text(), m).equal(expectedTitle)
  })
}))
```

### move

`move` is a high-level test helper that **moves an item from one list into another**.

It can be imported like this:

```js
import {sort} from 'ember-drag-sort/utils/trigger'
```

It accepts the following arguments:

| Argument      | Type                                     | Required?                       | Description                                                                                |
|:--------------|:-----------------------------------------|:--------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sourceList`  | String, DOM element or jQuery collection | yes                             | Selector or element of the source `drag-sort-list` component.                                                                                |
| `sourceIndex` | Integer                                  | yes                             | Zero-based index of the item to pick up.                                                                                |
| `targetList`  | String, DOM element or jQuery collection | yes                             | Selector or element of the target `drag-sort-list` component.                                                                                |
| `targetIndex` | Integer                                  | no                              | Zero-based index of the item to drop picked item on top of, calculated while the picked item is still on its original position. When omitted, adds item to the end of the target list. **Must** be omitted when moving into an empty list. |
| `above`       | Boolean                                  | yes if `targetList` is provided | Whether to drop picked item above (`true`) or below (`false`) target item.                                                                                |

After executing `sort`, perform a wait using `wait`, `andThen` or `await`.

Example:

```js
  const $list0 = $('.dragSortList').eq(0)
  const $list1 = $('.dragSortList').eq(1)

  await move($list0, 0, $list1, 1, false)
```

This will pick the first item from `$list0` and drop it below the second item of `$list1`.

See this addon's acceptance test for example.

### Page object components

This addon provides [page object](http://ember-cli-page-object.js.org) components.

#### Importing page object components

Page object components mixed into your app's `tests/pages/components/` directory

```
import dragSortList from '<your-app-name>/tests/pages/components/drag-sort-list'
import dragSortItem from '<your-app-name>/tests/pages/components/drag-sort-item'
```

Normally, you only need to import `dragSortList`. `dragSortItem` is available as part of `dragSortList`.

When used in a test, **the `dragSortList` page object component offers the following properties and methods**:

| Property          | Type                                                                                | Description                                                       |
|:------------------|:-----------------------------------------------------------------------------------------|:------------------------------------------------------------------|
| `items`           | [Page Object Collection](http://ember-cli-page-object.js.org/docs/v1.8.x/api/collection) | Each item is a `dragSortItem` page object component.              |
| `draggingEnabled` | Boolean                                                                                | Checks for `-draggingEnabled` class on the component (see above). |
| `isDragging`      | Boolean                                                                                | Checks for `-isDragging` class on the component (see above).      |
| `isDraggingOver`  | Boolean                                                                                | Checks for `-isDraggingOver` class on the component (see above).  |
| `isEmpty`         | Boolean                                                                                | Checks for `-isEmpty` class on the component (see above).         |
| `isExpanded`      | Boolean                                                                                | Checks for `-isExpanded` class on the component (see above).      |
| `dragEnter()`     | Method                                                                                | Calls `trigger` helper on current list with `'dragenter'`.        |
| `sort(...)`       | Method                                                                                | Calls `sort` helper on current list. See below for arguments.     |
| `move(...)`       | Method                                                                                | Calls `move` helper on current list. See below for arguments.     |

**The `dragSortItem` page object component offers the following properties and methods**:

| Property           | Type                  | Description                                                                                |
|:-------------------|:----------------------|:---------------------------------------------------------------------------------------------------------------|
| `content`          | Page Object Component | Represents the content of every `dragSortItem`. Available only via the factory imported from `{dragSortList}`. |
| `draggable`        | Boolean               | Whether the item is draggable                                                                                |
| `isDragged`        | Boolean               | Checks for `-isDragged` class on the component (see above).                                                    |
| `isDraggingOver`   | Boolean               | Checks for `-isDraggingOver` class on the component (see above).                                               |
| `placeholderAbove` | Boolean               | Checks for `-placeholderAbove` class on the component (see above).                                             |
| `placeholderBelow` | Boolean               | Checks for `-placeholderBelow` class on the component (see above).                                             |
| `dragStart()`      | Method                | Calls `trigger` helper on current item with `'dragstart'`.                                                     |
| `dragOver(above)`  | Method                | Calls `trigger` helper on current item with `'dragover'` and `above`.                                          |
| `dragEnd()`        | Method                | Calls `trigger` helper on current item with `'dragend'`.                                                       |

Additionally, **both page object components offer the following properties and methods**:

| Property                      | Type              | Description                                                                                |
|:------------------------------|:------------------|:------------------------------------------------------------------------------------------------------------------------------------------|
| `$`                           | jQuery Collection | Current element wrapped in jQuery.                                                                                |
| `empty`                       | Boolean           | Whether current element is empty, ignoring whitespace.                                                                                |
| `exists`                      | Boolean           | Whether current element exists. When element does not exist, returns `false` without raising an exception.                                |
| `index`                       | Integer           | Index of current element within its parent.                                                                                |
| `visible`                     | Boolean           | [PageObject.isVisible](http://ember-cli-page-object.js.org/docs/v1.8.x/api/isVisible).                                                    |
| `attr(string)`                | Method            | Returns given attribute value on current element ([PageObject.attribute](http://ember-cli-page-object.js.org/docs/v1.8.x/api/attribute)). |
| `click()`                     | Method            | [PageObject.clickable](http://ember-cli-page-object.js.org/docs/v1.8.x/api/clickable).                                                    |
| `contains(selectorOrElement)` | Method            | Returns whether given element exists inside current element.                                                                              |
| `hasClass(string)`            | Method            | Returns whether current element has given class.                                                                                |
| `text()`                      | Method            | Returns text of current element ([PageObject.text](http://ember-cli-page-object.js.org/docs/v1.8.x/api/text)).                            |

#### Including page object components into your page objects

Here's how you include `dragSortList` into your page object:

```js
// tests/pages/index.js

import {create, visitable} from 'ember-cli-page-object'
import dragSortList from '<your-app-name>/tests/pages/components/drag-sort-list'

export default create({
  visit:        visitable('/'),
  sortableList: dragSortList
})
```

#### Extending the dragSortList page object component

If you want to provide custom descriptors for the `dragSortList` page object component, use the spread operator:

```js
import {create, hasClass, visitable} from 'ember-cli-page-object'
import dragSortList from '<your-app-name>/tests/pages/components/drag-sort-list'

export default create({
  visit:        visitable('/'),
  sortableList: {
    ...dragSortList,
    isActive: hasClass('active')
  }
})
```

#### Extending the dragSortItem page object component

You can not provide a custom descriptor for `dragSortItem`, but you can describe its content. For example, you can describe the following template:

```handlebars
{{#drag-sort-list
  items         = items
  dragEndAction = (action 'dragEndAction')
  as |item|
}}
  <div class = 'drag-sort-item-content'>
    {{item.name}}
  </div>
{{/drag-sort-list}}
```

...by importing the page object component factory from `{dragSortList}` and passing your item description into it like this:

```js
import {create, visitable} from 'ember-cli-page-object'
import {dragSortList} from '<your-app-name>/tests/pages/components/drag-sort-list'

export default create({
  visit:        visitable('/'),
  sortableList: dragSortList({
    title: text()
  })
})
```

In a test, list items are available as `sortableList.items()`. Item content is available as `sortableList.items(index).content`.

For example, to assert the title of the first item in a list, using the page object from the last example, you can do this:

```js
assert.equal(sortableList.items(0).content.title, "Foo")
```

#### Providing the drag handle selector

If you're using drag handles, you must pass a drag handle selector to the factory as the second argument:

```js
import {create, visitable} from 'ember-cli-page-object'
import {dragSortList} from '<your-app-name>/tests/pages/components/drag-sort-list'

export default create({
  visit:        visitable('/'),
  sortableList: dragSortList({}, '.my-component--drag-handle')
})
```

If you don't want to provide custom list item content, pass an empty object.

This assumes that every list item has a handle with the same selector.

The selector must be discoverable within list item content. In other words, the handle is accessed via `$listItem.find(handleSelector)`.

If you're describing a nested list, use the `>` combinator in your drag handle selector, so that drag handles of child items aren't selected.

#### Sorting the dragSortList page object component

Inside your acceptance test, you can use the `sort` method on the `dragSortList` page object component.

To **rearrange items within a single list**, call `dragSortList.sort()` with three arguments:

| Argument      | Type    | Required | Description                                                                                |
|:--------------|:--------|:---------|:--------------------------------------------------------------------------------------------------------------------------------|
| `sourceIndex` | Integer | yes      | Zero-based index of the item to pick up.                                                                                |
| `targetIndex` | Integer | yes      | Zero-based index of the item to drop picked item on top of, calculated while the picked item is still on its original position. |
| `above`       | Boolean | yes      | Whether to drop picked item above (`true`) or below (`false`) target item.                                                      |

After executing `sort`, perform a wait using `await` or `andThen()`.

Example:

```js
test('sorting a list', async function (assert) {
  await page.visit()

  const list = page.sortableList

  await list.sort(0, 1, false)

  const expectedTitles = ['Bar', 'Foo', 'Baz', 'Quux']

  assert.equal(list.items().count, 4)

  expectedTitles.forEach((expectedTitle, k) => {
    m = `List #0 item #${k} content title`
    expect(list.items(k).content.title, m).equal(expectedTitle)
  })
}))
```

To **move an item from one list to another**, call `dragSortList.move()` with four arguments:

| Argument      | Type                  | Required                        | Description                                                                                |
|:--------------|:----------------------|:--------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sourceIndex` | Integer               | yes                             | Zero-based index of the item to pick up.                                                                                |
| `targetList`  | Page object component | yes                             | The page object of the other sortable list component.                                                                                |
| `targetIndex` | Integer               | no                              | Zero-based index of the item to drop picked item on top of, calculated while the picked item is still on its original position. When omitted, adds item to the end of the target list. **Must** be omitted when moving into an empty list. |
| `above`       | Boolean               | yes if `targetList` is provided | Whether to drop picked item above (`true`) or below (`false`) target item.                                                                                |

After executing `sort`, perform a wait using `await` or `andThen()`.

Example:

```js
const list1 = page.sortableList1
const list2 = page.sortableList2

await list1.sort(0, list2, 1, false)
```

This will pick the first item from `list1` and drop it below the second item of `list2`.

See this addon's acceptance test for example.

## Development

### Do not use npm, use yarn

This project uses [Yarn](https://yarnpkg.com/) to lock dependencies. You can install yarn with `npm i -g yarn`.

### Installation for development

* `git clone <repository-url>` this repository
* `cd ember-drag-sort`
* `yarn install` :warning:

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).

### Running

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).

### Branch names

Main branches are named as `gen-1`, `gen-2`, etc. Default branch on GitHub is where active development happens.

This naming scheme is due to the fact that this project uses SemVer. As a result, major version number will rise very quickly, without any correlation with actual major changes in the app.

The number in the branch name, "generation", is supposed to be incremented in these cases:
* A huge improvement or change happens in the addon.
* There's a change in the addon's API or architecture which introduces a necessity to maintain more than one branch at a time.
* The codebase is started from scratch.

Pull requests are welcome from feature branches. Make sure to discus proposed changes with addon maintainers to avoid wasted effort.

### Updating the table of contents

Maintaining the TOC by hand is extremely tedious. Use [this tiny webapp](https://lolmaus.github.io/tocdown/) to generate the TOC automatically. Enable the first two checkboxes there.

### Demo deployment

This command will deploy the app to https://deveo.github.io/ember-drag-sort/ :

    ember deploy prod

## Credits

Proudly built in [@Deveo](https://github.com/Deveo) by [@lolmaus](https://github.com/lolmaus) and [contributors](https://github.com/Deveo/ember-drag-sort/graphs/contributors).

https://deveo.com

Contains code fragments borrowed from:

* [jgwhite/ember-sortable](https://github.com/jgwhite/ember-sortable) ([MIT](https://github.com/jgwhite/ember-sortable/blob/master/LICENSE.md))

## License

[MIT](https://github.com/Deveo/ember-drag-sort/blob/gen-1/LICENSE.md).


text:
package org.innovateuk.ifs.management.assessment.viewmodel;

import org.innovateuk.ifs.assessment.resource.AssessmentRejectOutcomeValue;

/**
 * Holder of model attributes for a rejected Assessment in the Assessor Progress view.
 */
public class AssessorAssessmentProgressRejectedRowViewModel extends AssessorAssessmentProgressRowViewModel {

    private int totalAssessors;
    private AssessmentRejectOutcomeValue rejectReason;
    private String rejectComment;

    public AssessorAssessmentProgressRejectedRowViewModel(long applicationId,
                                                          String applicationName,
                                                          String leadOrganisation,
                                                          int totalAssessors,
                                                          AssessmentRejectOutcomeValue rejectReason,
                                                          String rejectComment) {
        super(applicationId, applicationName, leadOrganisation);
        this.totalAssessors = totalAssessors;
        this.rejectReason = rejectReason;
        this.rejectComment = rejectComment;
    }

    public int getTotalAssessors() {
        return totalAssessors;
    }

    public AssessmentRejectOutcomeValue getRejectReason() {
        return rejectReason;
    }

    public String getRejectComment() {
        return rejectComment;
    }
}


text:
namespace ex_13_21
{
    using namespace ex_9_4;

    enum class Weekday : char
    {
        mon, tue, wed, thu, fri, sat, sun
    };

    Weekday &operator++(Weekday &wd);

    std::ostream &operator <<(std::ostream &, const Weekday &);

    bool leapyear(const Year &);
    Day days_in_month(const Year &, const Month &);

    // [[noreturn]] functions are not implemented
    //
    Date add_day(const Date &, int days);
    [[noreturn]] Date add_month(const Date &, const int &months);
    Date add_year(const Date &, const Year &years);

    [[noreturn]] Weekday weekday(const Date &);

    Date next(const Date &, Weekday=Weekday::mon);
}

#endif


text:
<?php

namespace DoctrineProxies\__CG__\Concrete\Core\Entity\Page;

/**
 * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR
 */
class Feed extends \Concrete\Core\Entity\Page\Feed implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with
     *      three parameters, being respectively the proxy object to be initialized, the method that triggered the
     *      initialization process and an array of ordered parameters that were passed to that method.
     *
     * @see \Doctrine\Common\Persistence\Proxy::__setInitializer
     */
    public $__initializer__;

    /**
     * @var \Closure the callback responsible of loading properties that need to be copied in the cloned object
     *
     * @see \Doctrine\Common\Persistence\Proxy::__setCloner
     */
    public $__cloner__;

    /**
     * @var boolean flag indicating if this object was already initialized
     *
     * @see \Doctrine\Common\Persistence\Proxy::__isInitialized
     */
    public $__isInitialized__ = false;

    /**
     * @var array properties to be lazy loaded, with keys being the property
     *            names and values being their default values
     *
     * @see \Doctrine\Common\Persistence\Proxy::__getLazyProperties
     */
    public static $lazyPropertiesDefaults = [];

    /**
     * @param \Closure $initializer
     * @param \Closure $cloner
     */
    public function __construct($initializer = null, $cloner = null)
    {

        $this->__initializer__ = $initializer;
        $this->__cloner__      = $cloner;
    }

    /**
     *
     * @return array
     */
    public function __sleep()
    {
        if ($this->__isInitialized__) {
            return ['__isInitialized__', 'itemsPerFeed', 'checkPagePermissions', 'customTopicAttributeKeyHandle', 'customTopicTreeNodeID', 'iconFID', 'pfDescription', 'pfHandle', 'pfTitle', 'pfID', 'cParentID', 'ptID', 'pfIncludeAllDescendents', 'pfDisplayAliases', 'pfContentToDisplay', 'pfAreaHandleToDisplay', 'pfDisplayFeaturedOnly'];
        }

        return ['__isInitialized__', 'itemsPerFeed', 'checkPagePermissions', 'customTopicAttributeKeyHandle', 'customTopicTreeNodeID', 'iconFID', 'pfDescription', 'pfHandle', 'pfTitle', 'pfID', 'cParentID', 'ptID', 'pfIncludeAllDescendents', 'pfDisplayAliases', 'pfContentToDisplay', 'pfAreaHandleToDisplay', 'pfDisplayFeaturedOnly'];
    }

    /**
     *
     */
    public function __wakeup()
    {
        if ( ! $this->__isInitialized__) {
            $this->__initializer__ = function (Feed $proxy) {
                $proxy->__setInitializer(null);
                $proxy->__setCloner(null);

                $existingProperties = get_object_vars($proxy);

                foreach ($proxy->__getLazyProperties() as $property => $defaultValue) {
                    if ( ! array_key_exists($property, $existingProperties)) {
                        $proxy->$property = $defaultValue;
                    }
                }
            };

        }
    }

    /**
     *
     */
    public function __clone()
    {
        $this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', []);
    }

    /**
     * Forces initialization of the proxy
     */
    public function __load()
    {
        $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __isInitialized()
    {
        return $this->__isInitialized__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setInitialized($initialized)
    {
        $this->__isInitialized__ = $initialized;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setInitializer(\Closure $initializer = null)
    {
        $this->__initializer__ = $initializer;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __getInitializer()
    {
        return $this->__initializer__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setCloner(\Closure $cloner = null)
    {
        $this->__cloner__ = $cloner;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific cloning logic
     */
    public function __getCloner()
    {
        return $this->__cloner__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     * @static
     */
    public function __getLazyProperties()
    {
        return self::$lazyPropertiesDefaults;
    }

    /**
     * {@inheritDoc}
     */
    public function getIconFileID()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getIconFileID', []);

        return parent::getIconFileID();
    }

    /**
     * {@inheritDoc}
     */
    public function setIconFileID($iconFID)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setIconFileID', [$iconFID]);

        return parent::setIconFileID($iconFID);
    }

    /**
     * {@inheritDoc}
     */
    public function setParentID($cParentID)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setParentID', [$cParentID]);

        return parent::setParentID($cParentID);
    }

    /**
     * {@inheritDoc}
     */
    public function getParentID()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getParentID', []);

        return parent::getParentID();
    }

    /**
     * {@inheritDoc}
     */
    public function setDescription($pfDescription)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDescription', [$pfDescription]);

        return parent::setDescription($pfDescription);
    }

    /**
     * {@inheritDoc}
     */
    public function getDescription()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDescription', []);

        return parent::getDescription();
    }

    /**
     * {@inheritDoc}
     */
    public function setDisplayAliases($pfDisplayAliases)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDisplayAliases', [$pfDisplayAliases]);

        return parent::setDisplayAliases($pfDisplayAliases);
    }

    /**
     * {@inheritDoc}
     */
    public function getDisplayAliases()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDisplayAliases', []);

        return parent::getDisplayAliases();
    }

    /**
     * {@inheritDoc}
     */
    public function setDisplayFeaturedOnly($pfDisplayFeaturedOnly)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDisplayFeaturedOnly', [$pfDisplayFeaturedOnly]);

        return parent::setDisplayFeaturedOnly($pfDisplayFeaturedOnly);
    }

    /**
     * {@inheritDoc}
     */
    public function getDisplayFeaturedOnly()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDisplayFeaturedOnly', []);

        return parent::getDisplayFeaturedOnly();
    }

    /**
     * {@inheritDoc}
     */
    public function getID()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getID', []);

        return parent::getID();
    }

    /**
     * {@inheritDoc}
     */
    public function setIncludeAllDescendents($pfIncludeAllDescendents)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setIncludeAllDescendents', [$pfIncludeAllDescendents]);

        return parent::setIncludeAllDescendents($pfIncludeAllDescendents);
    }

    /**
     * {@inheritDoc}
     */
    public function getIncludeAllDescendents()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getIncludeAllDescendents', []);

        return parent::getIncludeAllDescendents();
    }

    /**
     * {@inheritDoc}
     */
    public function setTitle($pfTitle)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setTitle', [$pfTitle]);

        return parent::setTitle($pfTitle);
    }

    /**
     * {@inheritDoc}
     */
    public function getTitle()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getTitle', []);

        return parent::getTitle();
    }

    /**
     * {@inheritDoc}
     */
    public function getCustomTopicAttributeKeyHandle()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getCustomTopicAttributeKeyHandle', []);

        return parent::getCustomTopicAttributeKeyHandle();
    }

    /**
     * {@inheritDoc}
     */
    public function setCustomTopicAttributeKeyHandle($customTopicAttributeKeyHandle)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCustomTopicAttributeKeyHandle', [$customTopicAttributeKeyHandle]);

        return parent::setCustomTopicAttributeKeyHandle($customTopicAttributeKeyHandle);
    }

    /**
     * {@inheritDoc}
     */
    public function getCustomTopicTreeNodeID()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getCustomTopicTreeNodeID', []);

        return parent::getCustomTopicTreeNodeID();
    }

    /**
     * {@inheritDoc}
     */
    public function setCustomTopicTreeNodeID($customTopicTreeNodeID)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCustomTopicTreeNodeID', [$customTopicTreeNodeID]);

        return parent::setCustomTopicTreeNodeID($customTopicTreeNodeID);
    }

    /**
     * {@inheritDoc}
     */
    public function setPageTypeID($ptID)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setPageTypeID', [$ptID]);

        return parent::setPageTypeID($ptID);
    }

    /**
     * {@inheritDoc}
     */
    public function getPageTypeID()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPageTypeID', []);

        return parent::getPageTypeID();
    }

    /**
     * {@inheritDoc}
     */
    public function setHandle($pfHandle)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHandle', [$pfHandle]);

        return parent::setHandle($pfHandle);
    }

    /**
     * {@inheritDoc}
     */
    public function getHandle()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHandle', []);

        return parent::getHandle();
    }

    /**
     * {@inheritDoc}
     */
    public function displayShortDescriptionContent()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'displayShortDescriptionContent', []);

        return parent::displayShortDescriptionContent();
    }

    /**
     * {@inheritDoc}
     */
    public function displayAreaContent($arHandle)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'displayAreaContent', [$arHandle]);

        return parent::displayAreaContent($arHandle);
    }

    /**
     * {@inheritDoc}
     */
    public function getTypeOfContentToDisplay()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getTypeOfContentToDisplay', []);

        return parent::getTypeOfContentToDisplay();
    }

    /**
     * {@inheritDoc}
     */
    public function getAreaHandleToDisplay()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getAreaHandleToDisplay', []);

        return parent::getAreaHandleToDisplay();
    }

    /**
     * {@inheritDoc}
     */
    public function getFeedURL()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getFeedURL', []);

        return parent::getFeedURL();
    }

    /**
     * {@inheritDoc}
     */
    public function save()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'save', []);

        return parent::save();
    }

    /**
     * {@inheritDoc}
     */
    public function delete()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'delete', []);

        return parent::delete();
    }

    /**
     * {@inheritDoc}
     */
    public function ignorePermissions()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'ignorePermissions', []);

        return parent::ignorePermissions();
    }

    /**
     * {@inheritDoc}
     */
    public function getPageListObject()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPageListObject', []);

        return parent::getPageListObject();
    }

    /**
     * {@inheritDoc}
     */
    public function getOutput($request = NULL)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getOutput', [$request]);

        return parent::getOutput($request);
    }

    /**
     * {@inheritDoc}
     */
    public function getHeadLinkElement()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHeadLinkElement', []);

        return parent::getHeadLinkElement();
    }

}


text:
package org.spongepowered.common.item.recipe.crafting;

import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.util.NonNullList;
import org.spongepowered.api.CatalogType;

public class SpongeShapelessRecipe extends ShapelessRecipes implements CatalogType {

    private final String id;

    public SpongeShapelessRecipe(String id, String groupName, ItemStack itemStack, NonNullList<Ingredient> ingredients) {
        super(groupName, itemStack, ingredients);
        this.id = id;
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public String getName() {
        return this.getId();
    }

    @Override
    public boolean isDynamic() {
        return true; // For RecipeBook
    }
}


text:
import { filter, identity } from 'ramda';
import React from 'react';

import loadImage from '../../assets/images';
import { PlaySounds } from '../helpers/PlaySounds';
import RoundImageWithButton from './RoundImageWithButton';

const speakerImage = loadImage['speaker']();

const doNothing = () => {
  // do nothing
};
const WordImageWithSounds = ({
  onPlayEnd = doNothing,
  word,
  longSound = false,
  render = identity,
  ...props
}) => {
  const sounds = filter(identity, [
    word.getSound(),
    longSound && word.getLongSound()
  ]);

  return (
    <PlaySounds
      {...props}
      sounds={sounds}
      onPlayEnd={onPlayEnd}
      render={(buttonProps, isRecording) => {
        const button = (
          <RoundImageWithButton
            image={word.getImage()}
            imageSize={200}
            icon={speakerImage}
            buttonSize={40}
            {...buttonProps}
          />
        );

        return render(button, isRecording);
      }}
    />
  );
};

export default WordImageWithSounds;


text:
package io.permazen;

import com.google.common.base.Converter;
import com.google.common.base.Preconditions;

import io.permazen.tuple.Tuple4;

/**
 * Converts {@link Tuple4}s.
 *
 * @param <V1> first converted value
 * @param <V2> second converted value
 * @param <V3> third converted value
 * @param <V4> fouth converted value
 * @param <W1> first wrapped value
 * @param <W2> second wrapped value
 * @param <W3> third wrapped value
 * @param <W4> fourth wrapped value
 */
class Tuple4Converter<V1, V2, V3, V4, W1, W2, W3, W4> extends Converter<Tuple4<V1, V2, V3, V4>, Tuple4<W1, W2, W3, W4>> {

    private final Converter<V1, W1> value1Converter;
    private final Converter<V2, W2> value2Converter;
    private final Converter<V3, W3> value3Converter;
    private final Converter<V4, W4> value4Converter;

    Tuple4Converter(Converter<V1, W1> value1Converter, Converter<V2, W2> value2Converter,
      Converter<V3, W3> value3Converter, Converter<V4, W4> value4Converter) {
        Preconditions.checkArgument(value1Converter != null, "null value1Converter");
        Preconditions.checkArgument(value2Converter != null, "null value2Converter");
        Preconditions.checkArgument(value3Converter != null, "null value3Converter");
        Preconditions.checkArgument(value4Converter != null, "null value4Converter");
        this.value1Converter = value1Converter;
        this.value2Converter = value2Converter;
        this.value3Converter = value3Converter;
        this.value4Converter = value4Converter;
    }

    @Override
    protected Tuple4<W1, W2, W3, W4> doForward(Tuple4<V1, V2, V3, V4> tuple) {
        if (tuple == null)
            return null;
        return new Tuple4<W1, W2, W3, W4>(
          this.value1Converter.convert(tuple.getValue1()),
          this.value2Converter.convert(tuple.getValue2()),
          this.value3Converter.convert(tuple.getValue3()),
          this.value4Converter.convert(tuple.getValue4()));
    }

    @Override
    protected Tuple4<V1, V2, V3, V4> doBackward(Tuple4<W1, W2, W3, W4> tuple) {
        if (tuple == null)
            return null;
        return new Tuple4<V1, V2, V3, V4>(
          this.value1Converter.reverse().convert(tuple.getValue1()),
          this.value2Converter.reverse().convert(tuple.getValue2()),
          this.value3Converter.reverse().convert(tuple.getValue3()),
          this.value4Converter.reverse().convert(tuple.getValue4()));
    }

// Object

    @Override
    public boolean equals(Object obj) {
        if (obj == this)
            return true;
        if (obj == null || obj.getClass() != this.getClass())
            return false;
        final Tuple4Converter<?, ?, ?, ?, ?, ?, ?, ?> that = (Tuple4Converter<?, ?, ?, ?, ?, ?, ?, ?>)obj;
        return this.value1Converter.equals(that.value1Converter)
          && this.value2Converter.equals(that.value2Converter)
          && this.value3Converter.equals(that.value3Converter)
          && this.value4Converter.equals(that.value4Converter);
    }

    @Override
    public int hashCode() {
        return this.value1Converter.hashCode()
          ^ this.value2Converter.hashCode()
          ^ this.value3Converter.hashCode()
          ^ this.value4Converter.hashCode();
    }

    @Override
    public String toString() {
        return this.getClass().getSimpleName()
          + "[value1Converter=" + this.value1Converter
          + ",value2Converter=" + this.value2Converter
          + ",value3Converter=" + this.value3Converter
          + ",value4Converter=" + this.value4Converter
          + "]";
    }
}


text:
package io.github.tehstoneman.betterstorage.item.cardboard;

import io.github.tehstoneman.betterstorage.utils.StackUtils.StackEnchantment;

public final class CardboardRecipeHelper
{
	private CardboardRecipeHelper()
	{}

	/**
	 * Returns additional costs for an enchantment to be put
	 * onto the cardboard item, like silk touch and fortune.
	 */
	public static int getAdditionalEnchantmentCost( StackEnchantment ench )
	{
		/*
		 * if (ench.ench == Enchantment.silkTouch) return 10;
		 * else if (ench.ench == Enchantment.fortune) return 1 + ench.getLevel();
		 * else if (ench.ench == Enchantment.fireAspect) return 2;
		 * else if (ench.ench == Enchantment.thorns) return 1;
		 * else
		 */ return 0;
	}
}


text:
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/html/anchor_element_metrics_sender.h"

#include "base/bind.h"
#include "base/location.h"
#include "base/rand_util.h"
#include "third_party/blink/public/common/browser_interface_broker_proxy.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/loader/navigation_predictor.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/loader/navigation_predictor.mojom-forward.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/html/anchor_element_metrics.h"
#include "third_party/blink/renderer/core/html/html_anchor_element.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer_entry.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/loader/document_loader.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"

namespace blink {
namespace {
static float INTERSECTION_RATIO_THRESHOLD = 0.5f;

}  // namespace

// static
const char AnchorElementMetricsSender::kSupplementName[] =
    "DocumentAnchorElementMetricsSender";

AnchorElementMetricsSender::~AnchorElementMetricsSender() = default;

// static
AnchorElementMetricsSender* AnchorElementMetricsSender::From(
    Document& document) {
  if (!HasAnchorElementMetricsSender(document)) {
    return nullptr;
  }

  AnchorElementMetricsSender* sender =
      Supplement<Document>::From<AnchorElementMetricsSender>(document);
  if (!sender) {
    sender = MakeGarbageCollected<AnchorElementMetricsSender>(document);
    ProvideTo(document, sender);
  }
  return sender;
}

// static
bool AnchorElementMetricsSender::HasAnchorElementMetricsSender(
    Document& document) {
  bool is_feature_enabled =
      base::FeatureList::IsEnabled(features::kNavigationPredictor);
  const KURL& url = document.BaseURL();
  return is_feature_enabled && document.IsInMainFrame() && url.IsValid() &&
         url.ProtocolIs("https");
}

void AnchorElementMetricsSender::MaybeReportClickedMetricsOnClick(
    const HTMLAnchorElement& anchor_element) {
  DCHECK(base::FeatureList::IsEnabled(features::kNavigationPredictor));
  if (!anchor_element.Href().ProtocolIsInHTTPFamily() ||
      !GetRootDocument(anchor_element)->Url().ProtocolIsInHTTPFamily() ||
      !anchor_element.GetDocument().BaseURL().ProtocolIsInHTTPFamily()) {
    return;
  }
  if (!AssociateInterface()) {
    return;
  }
  auto click = mojom::blink::AnchorElementClick::New();
  click->anchor_id = AnchorElementId(anchor_element);
  click->target_url = anchor_element.Href();
  metrics_host_->ReportAnchorElementClick(std::move(click));
}

void AnchorElementMetricsSender::AddAnchorElement(HTMLAnchorElement& element) {
  DCHECK(base::FeatureList::IsEnabled(features::kNavigationPredictor));
  if (!AssociateInterface()) {
    return;
  }

  // Add this element to the set of elements that we will try to report after
  // the next layout.
  anchor_elements_to_report_.insert(&element);
}

void AnchorElementMetricsSender::Trace(Visitor* visitor) const {
  visitor->Trace(anchor_elements_to_report_);
  visitor->Trace(metrics_host_);
  visitor->Trace(intersection_observer_);
  Supplement<Document>::Trace(visitor);
}

bool AnchorElementMetricsSender::AssociateInterface() {
  if (metrics_host_.is_bound())
    return true;

  Document* document = GetSupplementable();
  // Unable to associate since no frame is attached.
  if (!document->GetFrame())
    return false;

  document->GetFrame()->GetBrowserInterfaceBroker().GetInterface(
      metrics_host_.BindNewPipeAndPassReceiver(
          document->GetExecutionContext()->GetTaskRunner(
              TaskType::kInternalDefault)));
  return true;
}

AnchorElementMetricsSender::AnchorElementMetricsSender(Document& document)
    : Supplement<Document>(document),
      metrics_host_(document.GetExecutionContext()) {
  DCHECK(document.IsInMainFrame());

  document.View()->RegisterForLifecycleNotifications(this);
  intersection_observer_ = IntersectionObserver::Create(
      {}, {INTERSECTION_RATIO_THRESHOLD}, &document,
      WTF::BindRepeating(&AnchorElementMetricsSender::UpdateVisibleAnchors,
                         WrapWeakPersistent(this)),
      LocalFrameUkmAggregator::kAnchorElementMetricsIntersectionObserver,
      IntersectionObserver::kDeliverDuringPostLifecycleSteps,
      IntersectionObserver::kFractionOfTarget, 100 /* delay in ms */);
}

void AnchorElementMetricsSender::UpdateVisibleAnchors(
    const HeapVector<Member<IntersectionObserverEntry>>& entries) {
  DCHECK(base::FeatureList::IsEnabled(features::kNavigationPredictor));
  DCHECK(!entries.IsEmpty());
  if (!AssociateInterface()) {
    return;
  }

  for (auto entry : entries) {
    Element* element = entry->target();
    if (!entry->isIntersecting()) {
      // The anchor is leaving the viewport.
      continue;
    }
    //  The anchor is visible.
    HTMLAnchorElement* anchor_element =
        static_cast<HTMLAnchorElement*>(element);
    EnqueueEnteredViewport(*anchor_element);
    intersection_observer_->unobserve(element);
  }
}

void AnchorElementMetricsSender::EnqueueEnteredViewport(
    const HTMLAnchorElement& element) {
  auto msg = mojom::blink::AnchorElementEnteredViewport::New();
  msg->anchor_id = AnchorElementId(element);
  base::TimeDelta time_entered_viewport =
      base::TimeTicks::Now() -
      GetRootDocument(element)->Loader()->GetTiming().NavigationStart();
  msg->navigation_start_to_entered_viewport_ms =
      static_cast<uint64_t>(time_entered_viewport.InMilliseconds());
  entered_viewport_messages_.push_back(std::move(msg));
}

void AnchorElementMetricsSender::DidFinishLifecycleUpdate(
    const LocalFrameView& local_frame_view) {
  // Check that layout is stable. If it is, we can report pending
  // AnchorElements.
  Document* document = local_frame_view.GetFrame().GetDocument();
  if (document->Lifecycle().GetState() <
      DocumentLifecycle::kAfterPerformLayout) {
    return;
  }
  if (!AssociateInterface()) {
    return;
  }

  WTF::Vector<mojom::blink::AnchorElementMetricsPtr> metrics;
  for (const auto& member_element : anchor_elements_to_report_) {
    HTMLAnchorElement& anchor_element = *member_element;
    if (!anchor_element.Href().ProtocolIsInHTTPFamily()) {
      continue;
    }

    // If the anchor doesn't have a valid frame/root document, skip it.
    if (!anchor_element.GetDocument().GetFrame() ||
        !GetRootDocument(anchor_element)) {
      continue;
    }

    // Only anchors with width/height should be evaluated.
    if (!anchor_element.GetLayoutObject() ||
        anchor_element.GetLayoutObject()->AbsoluteBoundingBoxRect().IsEmpty()) {
      continue;
    }
    mojom::blink::AnchorElementMetricsPtr anchor_element_metrics =
        CreateAnchorElementMetrics(anchor_element);

    int sampling_period = base::GetFieldTrialParamByFeatureAsInt(
        blink::features::kNavigationPredictor, "random_anchor_sampling_period",
        100);
    int random = base::RandInt(1, sampling_period);
    if (random == 1) {
      // This anchor element is sampled in.
      if (anchor_element_metrics->ratio_visible_area >=
          INTERSECTION_RATIO_THRESHOLD) {
        // The element is already visible.
        EnqueueEnteredViewport(anchor_element);
      } else {
        // Observe the element until it becomes visible.
        intersection_observer_->observe(&anchor_element);
      }
    }

    metrics.push_back(std::move(anchor_element_metrics));
  }
  // Remove all anchors, including the ones that did not qualify. This means
  // that elements that are inserted in the DOM but have an empty bounding box
  // (e.g. because they're detached from the DOM, or not currently visible)
  // during the next layout will never be reported, unless they are re-inserted
  // into the DOM later or if they enter the viewport.
  anchor_elements_to_report_.clear();
  if (!metrics.IsEmpty()) {
    metrics_host_->ReportNewAnchorElements(std::move(metrics));
  }
  if (!entered_viewport_messages_.IsEmpty()) {
    metrics_host_->ReportAnchorElementsEnteredViewport(
        std::move(entered_viewport_messages_));
    entered_viewport_messages_.clear();
  }
}

}  // namespace blink


text:
namespace cc {

class FakeLayerTreeHostImplClient : public LayerTreeHostImplClient {
 public:
  // LayerTreeHostImplClient implementation.
  virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE {}
  virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE {}
  virtual void OnVSyncParametersChanged(
      base::TimeTicks,
      base::TimeDelta) OVERRIDE {}
  virtual void DidVSync(base::TimeTicks frame_time) OVERRIDE {}
  virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE {}
  virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) OVERRIDE {}
  virtual void SetNeedsRedrawOnImplThread() OVERRIDE {}
  virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE {}
  virtual void SetNeedsCommitOnImplThread() OVERRIDE {}
  virtual void SetNeedsManageTilesOnImplThread() OVERRIDE {}
  virtual void PostAnimationEventsToMainThreadOnImplThread(
      scoped_ptr<AnimationEventsVector> events,
      base::Time wall_clock_time) OVERRIDE {}
  virtual bool ReduceContentsTextureMemoryOnImplThread(
      size_t limit_bytes,
      int priority_cutoff) OVERRIDE;
  virtual void ReduceWastedContentsTextureMemoryOnImplThread() OVERRIDE {}
  virtual void SendManagedMemoryStats() OVERRIDE {}
  virtual bool IsInsideDraw() OVERRIDE;
  virtual void RenewTreePriority() OVERRIDE {}
  virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta)
      OVERRIDE {}
};

}  // namespace cc

#endif  // CC_TEST_FAKE_LAYER_TREE_HOST_IMPL_CLIENT_H_


text:
require "ruf/version"
require 'scala-library-jars'
require 'java'

module Ruf
  java_import 'scala.concurrent.Future'
  java_import 'scala.concurrent.Await'
  java_import 'scala.concurrent.duration.Duration'
  java_import 'scala.concurrent.ExecutionContext'
  java_import 'java.util.concurrent.Executors'

  def self.default_ec
    $default_ec ||= ExecutionContext.fromExecutorService(Executors.newFixedThreadPool(10))
    $default_ec
  end

  def self.shutdown
    $default_ec.shutdown if $default_ec
    $default_ec = nil
  end

  def self.future(l = nil, &block)
    callable = l || block
    Java::scala.concurrent.package.future(callable, default_ec)
  end

  def self.await_result(future, options={})
    Await.result(future, Duration[options[:timeout]])
  end
end


text:
const int AddressFreq = NEXT_FREE;
#define NEXT_FREE   (AddressFreq + sizeof(Frequency))

// address for int 'selected digit'
const int AddressSelDigit = NEXT_FREE;
#define NEXT_FREE   (AddressSelDigit + sizeof(SelOffset))

// address for 'VfoClockOffset' calibration
const int AddressVfoClockOffset = NEXT_FREE;
#define NEXT_FREE   (AddressVfoClockOffset + sizeof(VfoClockOffset))

// address for byte 'contrast'
const int AddressContrast = NEXT_FREE;
#define NEXT_FREE   (AddressContrast + sizeof(LcdContrast))

// address for byte 'brightness'
const int AddressBrightness = NEXT_FREE;
#define NEXT_FREE   (AddressBrightness + sizeof(LcdBrightness))
#endif

// number of frequency save slots in EEPROM
const int NumSaveSlots = 10;

const int SaveFreqBase = NEXT_FREE;
#define NEXT_FREE   (SaveFreqBase + NumSaveSlots * sizeof(Frequency))

//also save the offset for each frequency
const int SaveOffsetBase = NEXT_FREE;
#define NEXT_FREE   (SaveOffsetBase + NumSaveSlots * sizeof(SelOffset);

// additional EEPROM saved items go here

// Given slot number, return freq/offset.
void slot_get(int slot_num, Frequency &freq, SelOffset &offset);
void slot_put(int slot_num, Frequency freq, SelOffset offset);
void eeprom_init(void);

#endif


text:
package com.jetbrains.python.debugger;

import com.intellij.xdebugger.frame.XValueChildrenList;
import com.jetbrains.python.debugger.pydev.PyDebugCallback;

/**
 * @author traff
 */
public class PyReferrersLoader
{
	private final IPyDebugProcess myProcess;

	public PyReferrersLoader(IPyDebugProcess process)
	{
		myProcess = process;
	}

	public void loadReferrers(PyReferringObjectsValue value, PyDebugCallback<XValueChildrenList> callback)
	{
		myProcess.loadReferrers(value, callback);
	}
}


text:
{% load sentry_avatars %}

  {% if avatar_type == 'upload' %}

  {% else %}
    {% if for_email %}
      {% if avatar_type == 'letter_avatar' %}
        {% email_avatar display_name label size False %}
      {% else %}
        {% email_avatar display_name label size True %}
      {% endif %}
    {% else %}
      {% letter_avatar_svg display_name label size %}
      {% if avatar_type == 'gravatar' %}

      {% endif %}
    {% endif %}
  {% endif %}


text:
define( [ "jquery", "../animationComplete", "./transition" ], function( jQuery ) {
//>>excludeEnd("jqmBuildExclude");

(function( $ ) {

	$.mobile.SerialTransition = function() {
		this.init.apply(this, arguments);
	};

	$.extend($.mobile.SerialTransition.prototype, $.mobile.Transition.prototype, {
		sequential: true,

		beforeDoneOut: function() {
			if ( this.$from ) {
				this.cleanFrom();
			}
		},

		beforeStartOut: function( screenHeight, reverseClass, none ) {
			this.$from.animationComplete($.proxy(function() {
				this.doneOut( screenHeight, reverseClass, none );
			}, this ));
		}
	});

})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");


text:
namespace firestep {

enum DisplayStatus {
    // Awaiting serial input
    DISPLAY_WAIT_IDLE = 10, // Awaiting EOL-terminated command
    DISPLAY_WAIT_EOL = 11, // Awaiting remainder of EOL-terminated command
    DISPLAY_WAIT_CAMERA = 12, // Display for camera while awaiting further instructions

    // Awaiting user input
    DISPLAY_WAIT_OPERATOR = 20, // Awaiting EOL-terminated command initiated by operator
    DISPLAY_WAIT_ERROR = 21, // Could not proceed. Awaiting instructions
    DISPLAY_WAIT_CANCELLED = 22, // Request cancelled. Awaiting instructions

    // Ignoring input
    DISPLAY_BUSY = 30, // FireStep is busy but not moving
    DISPLAY_BUSY_MOVING = 31, // FireStep is busy and moving
    DISPLAY_BUSY_CALIBRATING = 32, // FireStep is busy and calibrating
	DISPLAY_EEPROM = 33, // Accessing EEPROM
};

typedef class Display {
    friend class JsonController;
protected:
    uint8_t status;	// DisplayStatus
    uint8_t level; // 0:off, 255:brightest
    uint8_t cameraR; // camera red intensity [0,255]
    uint8_t cameraG; // camera green intensity [0,255]
    uint8_t cameraB; // camera blue intensity [0,255]
public:
    Display() : status(DISPLAY_BUSY), level(127), cameraR(127), cameraG(127), cameraB(127) {}
    virtual void setup(int pin) {
        show();
    }
    virtual void show() {}
    inline DisplayStatus getStatus() {
        return (DisplayStatus) status;
    }
    virtual void setStatus(DisplayStatus status = DISPLAY_WAIT_IDLE) {
        this->status = status;
        show();
    }
    inline uint8_t getLevel() {
        return level;
    }
    virtual void setLevel(uint8_t level = 127) {
        this->level = level;
        show();
    }
} Display;

} // namespace firestep

#endif


text:
@*
 * Copyright 2010-2014 Artima, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *@

@import controllers.Application.scaladocsPageUrl
@import controllers.Application.milestoneScaladoc

@combinedReleaseNotesPage("Scalactic/ScalaTest 2.2.5 Release Notes") {

ScalaTest/Scalactic 2.2.5 Release Notes

ScalaTest/Scalactic 2.2.5 includes just one change from 2.2.4, a bug fix for the DiagrammedAssertions
macro that was accidentally left out of 2.2.4. No source code using
ScalaTest/ScalaUtils 2.0 or higher should break, but from any version other than other 2.2.x releases (with which this release is binary
compatible), you will likely need to do a clean build to upgrade.

For information on how to include ScalaTest in your project, see the download page.
For information on how to use Scalactic in your production code,
see its download page.

Bug fix

Fixed a problem encountered when DiagrammedAssertions was used with new.
    (reported as github issue #577)

            Visit ScalaTest Release Notes for links to the release notes of all previous versions, or
step back in time by visiting the release notes for the previous version.

}


text:
(function () {

    'use strict';

    angular
        .module('starter')
        .controller('attachmentCtrl', attachmentCtrl);

         function attachmentCtrl(dataService, $http, $timeout, $scope, $location) {
            var vm = this;
            vm.maxAttachments = 3;
            vm.maxSize = 60;
            vm.cameraShow = false;
            vm.setAttachCount = 2;
            vm.attachmentsForm = [];
            vm.webcamImages = [];
                                console.log(vm.maxAttachments);

            // get attachment setup
            vm.getInitSetup = function() {
                $http({
                    method: 'GET',
                    url: '/amc-rest-api/attachments-api/settings',
                    headers: {
                        'PrincipalId': 'hudak',
                    },
                }).success(function(data){
                    vm.initSetup = data;
                    vm.maxAttachments = vm.initSetup.maxAttachmentsCount;
                    vm.maxSize = vm.initSetup.maxAttachmentsSizeInMB;
                }).error(function(e){
                    console.log("error", e);
                    vm.attachmentSetup = {
                        "maxAttachmentsSizeInMB": 60,
                        "maxAttachmentsCount": 6
                        }
                    vm.maxAttachments = vm.attachmentSetup.maxAttachmentsCount;
                    vm.maxSize = vm.attachmentSetup.maxAttachmentsSizeInMB;
                    console.log(vm.maxAttachments);
                });
            }
            vm.getInitSetup();

            // url Params set forms
            vm.urlParams = $location.search();
            if(vm.urlParams.pz) {
                vm.pzNumber = vm.urlParams.pz;
            } else {
                vm.pzNumber = 123;
            }
            if(vm.urlParams.npz) {
                vm.npzNumber = vm.urlParams.npz;
            }
            if(vm.urlParams.ziadanka) {
                vm.ziadanka = vm.urlParams.ziadanka;
            }
            if(vm.urlParams.quantity) {
                vm.formNumber = vm.urlParams.quantity;
                for (var i = 1; i <= vm.formNumber; i++) {
                    vm.attachmentsForm.push({name: 'form'+i, id: i})
                }
            } else {
                vm.formNumber = 2;
                for (var i = 1; i <= vm.formNumber; i++) {
                    vm.attachmentsForm.push({name: 'form'+i, id: i})
                }
            }

            // ionic mobile or desktop
            vm.isWebView = ionic.Platform.isWebView();
            vm.isIPad = ionic.Platform.isIPad();
            vm.isIOS = ionic.Platform.isIOS();
            vm.isAndroid = ionic.Platform.isAndroid();
            vm.isWindowsPhone = ionic.Platform.isWindowsPhone();
            vm.currentPlatform = ionic.Platform.platform();

            if (vm.isWebView == false && vm.isIPad == false && vm.isIOS == false && vm.isAndroid == false &&  vm.isWindowsPhone == false ) {
                vm.isDesktop = true;
            } else {
                vm.isDesktop = false;
            }

            // attachment forms
            // vm.attachmentsForm = [{name: 'form1', id: 1}];

            vm.addNewForm = function() {
                vm.formNumber = vm.formNumber +1;
                var newItemNo = vm.formNumber;
                vm.attachmentsForm.push({'name':'form'+newItemNo, id: newItemNo});
            };

            vm.removeForm = function(objId) {
                for(var i = 0; i < vm.attachmentsForm.length; i++) {
                    var obj = vm.attachmentsForm[i];

                    if(obj.name == objId) {
                        vm.attachmentsForm.splice(i, 1);
                    }
                }
            };
            // init function to get brands object
            vm.brandsByIds = function(ids) {
                vm.brand[ids] = {};
                $http({
                    method: 'POST',
                    url: '/amc-rest-api/attachments-api/params/brand-by-ids',
                    headers: {
                        'PrincipalId': 'hudak',
                    }
                }).success(function(data){
                    vm.brand[ids] = data;
                    return data
                }).error(function(e){
                    console.log("error", e);
                    vm.brand[ids] = [
                        {
                            "id": "1",
                            "name": "new business"
                        },
                        {
                            "id": "2",
                            "name": "New business 2"
                        }
                        ];

                }).finally(function () {
                    if (vm.urlParams['brand'+ids]) {
                    console.log('finaly');
                    // set brand
                    vm.attachmentsForm[ids-1].brand = vm.urlParams['brand'+ids];
                    vm.categoriesByIds(ids, vm.attachmentsForm[ids-1].brand, true);
                    }
                });
            }

            // get categories object
            vm.categoriesByIds = function(ids, value, onInit) {
                console.log('categories');
            console.log(ids, value);
            vm.category[ids] = {};

                $http({
                    method: 'POST',
                    url: '/amc-rest-api/attachments-api/params/categories-by-ids',
                    headers: {
                        'PrincipalId': 'hudak',
                    },
                    data: { "brandId": value }

                }).success(function(data){
                    vm.category[ids] = data;
                    return data
                }).error(function(e){
                    console.log("error", e);
                    vm.category[ids] = [{
                            "id": "24",
                            "name": "PODNIKATELIA"
                        },
                        {
                            "id": "10",
                            "name": "Privát - ostatné"
                        },
                        {
                            "id": "33",
                            "name": "Intervencia-podn"
                        },
                        {
                            "id": "6",
                            "name": "MTPL"
                        },
                        {
                            "id": "44",
                            "name": "Intervencia privat"
                        }
                        ];

                console.log(vm.category);

                }).finally(function () {
                    if(onInit) {
                        console.log('onInit category');
                        vm.attachmentsForm[ids - 1].category = vm.urlParams['category' + ids];
                        vm.typesByIds(ids, vm.attachmentsForm[ids - 1].category, true);
                    }
                });
            }

            // get types object
            vm.typesByIds = function(ids, value, onInit) {
                vm.type[ids] = {};
                $http({
                    method: 'POST',
                    url: '/amc-rest-api/attachments-api/params/types-by-ids',
                    headers: {
                        'PrincipalId': 'hudak',
                    },
                    data: { "categoryId": value }
                }).success(function(data){
                    vm.type[ids] = data;
                    return data
                }).error(function(e){
                    console.log("error", e);
                    vm.type[ids] = [{
                            "id": "341",
                            "name": "Doklady o nadobudnutí veci"
                        },
                        {
                            "id": "380",
                            "name": "Nadobúd. doklady k MV (nadšt.)"
                        },
                        {
                            "id": "351",
                            "name": "Schválenie zľavy"
                        },
                        {
                            "id": "370",
                            "name": "Dohoda o uznaní záväzku"
                        },
                        {
                            "id": "361",
                            "name": "Podiel"
                        },
                        {
                            "id": "371",
                            "name": "Doplň. dotazník pre poisteného"
                        },
                        {
                            "id": "384",
                            "name": "Preberaci protokol od vozidla"
                        },
                        {
                            "id": "358",
                            "name": "Žiadanka na storno starej PZ"
                        }];
                console.log(vm.type);

                }).finally(function () {
                    if(onInit) {
                        console.log('onInit type');
                        vm.attachmentsForm[ids - 1].type = vm.urlParams['type' + ids];
                    }
                });
            }

            vm.category = [];
            vm.brand = [];
            vm.type = [];

            // to work with mobile file input
            // $scope.file_changed = function(element, id) {

            //     console.log(element, id);
            // $scope.$apply(function(scope) {
            //     var photofile = element.files[0];
            //     var reader = new FileReader();
            //     reader.onload = function(e) {
            //         // handle onload
            //         console.log('image', e);
            //     };
            //     reader.readAsDataURL(photofile);
            //     console.log('image2: ', photofile);
            //     vm.mobileImages.push(photofile);
            //     });
            // };

            // webcam on desktop
            var result;
            var formId;
            var formName;
            var webcamImage;
            var dataUri;
            vm.hideCam = function() {
                vm.cameraShow = false;
                result.innerHTML = '';
            }
            vm.showCam = function(id, name) {
                formId = id;
                formName = name;
                console.log('formId: ', formId, formName);

            vm.cameraShow = true;
            Webcam.set({
                width: 320,
                height: 240,
                dest_width: 640,
                dest_height: 480,
                image_format: 'jpeg',
                jpeg_quality: 90,
                force_flash: false,
                flip_horiz: false,
                fps: 45,
                upload_name: 'webcamImage'
            });
            var camera = document.getElementById('my_camera');
            result = document.getElementById('my_result');
            Webcam.attach(camera);
            }

            vm.snapshot = function () {
                console.log('camera works');
                Webcam.snap( function(data_uri) {
                    dataUri = data_uri;
                    result.innerHTML = '<img src="'+data_uri+'"/>';
                } );
                webcamImage = 'webcamImage' + formId + '.jpg'
            }
            vm.addWebcamImage = function () {
                for (var i = 0; i < vm.webcamImages.length; i++) {
                    var element = vm.webcamImages[i];
                    if(webcamImage == element.fileName) {
                        vm.webcamImages.splice(i,1)

                    }
                }
                vm.webcam['form' + formId] = webcamImage;
                vm.webcamImages.push( {file: formName, fileName: webcamImage, dataUri: dataUri});
                console.log(vm.webcamImages);
                console.log(vm.attachmentsForm);

                result.innerHTML = '';
                console.log('close');
                vm.cameraShow = false;
            }

            // submit form
            vm.submit = function () {
                vm.fileSize = 0;
                vm.mb = 1000000;
                vm.dataResult = {
                    forms: vm.attachmentsForm,
                    pzNumber: vm.pzNumber,
                    npzNumber: vm.npzNumber,
                    ziadanka: vm.ziadanka,
                    webcam: vm.webcamImages
                };
                console.log(vm.dataResult);

                // file size validation
                for (var i = 0; i < vm.attachmentsForm.length; i++) {
                    if (vm.attachmentsForm[i].file) {
                    var element = vm.attachmentsForm[i].file.size;
                    vm.fileSize += element;
                    console.log('el: ', vm.fileSize);
                    }
                }

                console.log(vm.fileSize / vm.mb);
                vm.fileSize = vm.fileSize / vm.mb;

                // if total size is bigger show alert otherwise post method
                if (vm.fileSize > vm.maxSize) {
                    alert('Velikost priloh presahuje ' + vm.maxSize + 'mb');
                } else {
                dataService.postData(vm.dataResult);
                }
            }
        }
})();


text:
package com.vmware.vim25;

/**
@author Steve Jin (sjin@vmware.com)
*/

public class VAppConfigInfo extends VmConfigInfo
{
  public VAppEntityConfigInfo[] entityConfig;
  public String annotation;
  public String instanceUuid;

  public VAppEntityConfigInfo[] getEntityConfig()
  {
    return this.entityConfig;
  }

  public String getAnnotation()
  {
    return this.annotation;
  }

  public String getInstanceUuid()
  {
    return this.instanceUuid;
  }

  public void setEntityConfig(VAppEntityConfigInfo[] entityConfig)
  {
    this.entityConfig=entityConfig;
  }

  public void setAnnotation(String annotation)
  {
    this.annotation=annotation;
  }

  public void setInstanceUuid(String instanceUuid)
  {
    this.instanceUuid=instanceUuid;
  }
}