angular-areas

WebJar for angular-areas

Лицензия

Лицензия

MIT
Категории

Категории

Ant Компиляция и сборка Github Инструменты разработки Контроль версий Angular Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

org.webjars.bower
Идентификатор

Идентификатор

github-com-delkant-angular-areas
Последняя версия

Последняя версия

1.0.4
Дата

Дата

Тип

Тип

jar
Описание

Описание

angular-areas
WebJar for angular-areas
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/delkant/angular-areas

Скачать github-com-delkant-angular-areas

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.bower/github-com-delkant-angular-areas/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>github-com-delkant-angular-areas</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/github-com-delkant-angular-areas/
implementation 'org.webjars.bower:github-com-delkant-angular-areas:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.bower/github-com-delkant-angular-areas/
implementation ("org.webjars.bower:github-com-delkant-angular-areas:1.0.4")
'org.webjars.bower:github-com-delkant-angular-areas:jar:1.0.4'
<dependency org="org.webjars.bower" name="github-com-delkant-angular-areas" rev="1.0.4">
  <artifact name="github-com-delkant-angular-areas" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='github-com-delkant-angular-areas', version='1.0.4')
)
libraryDependencies += "org.webjars.bower" % "github-com-delkant-angular-areas" % "1.0.4"
[org.webjars.bower/github-com-delkant-angular-areas "1.0.4"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.bower : angular jar 1.4.8
org.webjars.bower : jquery jar 2.1.4

Модули Проекта

Данный проект не имеет модулей.

angular-areas

Angular Directive ( ng-areas ) that let you select and manipulate multiple areas on an image, create, edit, move and resize them too.

Quick Start

Install with Bower

$ bower install angular-areas

Use like so:

    <div ng-controller="DemoController">
		<img ng-areas="areasArray" ng-areas-width="900"
			ng-areas-allow="{'edit':true, 'move':true, 'resize':true, 'select':true, 'remove':true, 'nudge':false}"
			ng-areas-on-add="onAddArea"
			ng-areas-on-remove="onRemoveArea"
			ng-areas-on-change="onChangeAreas900"
			ng-areas-extend-data="{pageNumber: 1, tag: 'img900px'}"
			ng-src="aImage.jpg">
	</div>

DEMO and example to learn from.

Check out the DEMO

Browser Compatibiilty:

This plugin is fully compatible with every modern browser and IE >= 9.

API Doc

Area

An area is described (when retrieved or set) by a json object:

    {
        x,  // X coordinate (Position)
        y,  // Y coordinate (Position)
        z,  // Z-index (0 when inactive or 100 when focused)
        width,  // Width of the area (Size)
        height  // Height of the area (Size)
    }

Options and parameters

Here is a list of available options for selectAreas, with their default value:

  • ng-areas : Required attribute. Area list areas ([]) : list of areas to add to the image from the beginning (id will be ignored);

    controller i.e.:

   $scope.areasArray = [ {
   	"x" : 557,
   	"y" : 35,
   	"z" : 100,
   	"height" : 130,
   	"width" : 925,
   	"name" : "Menu Options",
   	"cssClass" : "class_red",
   	"id" : 37,
   	"description" : "Menu"
   }, {
   	"x" : 822,
   	"y" : 274,
   	"z" : 0,
   	"height" : 250,
   	"width" : 829,
   	"name" : "AngularJS Main Logo",
   	"cssClass" : "class_red",
   	"id" : 35,
   	"description" : "AngularJS Main Logo"
   } ];
template i.e.: 
 	<img ng-areas="areasArray" src="aImage.jpg">
  • ng-areas-width (0) : When not 0, scale the image to this width (px).

  • ng-areas-extend-data each area will have the properties defined on this JSON object. This can be used when you have multiple images with areas on them and you want to know to what image belongs a area-box. You could also use this to create tags to identify the fields.

  • ng-areas-allow : Json Object

i.e. ng-areas-allow="{'edit':true, 'move':true, 'resize':false, 'select':true, 'remove':false, 'nudge':false}"

  • edit (true) : When set to false, unset allowMove, allowResize, allowSelect and allowDelete
  • move (true) : When set to false, Areas can not be moved with a drag & drop.
  • resize (true) : When set to false, Areas can not be resized.
  • select (true) : When set to false, Areas can not be created.
  • remove (true) : When set to false, Areas can not be removed.
  • nudge (true) : When set to false, Areas can not be moved with arrow keys.

Events handlers

Three events are fired by the plugin:

  • ng-areas-on-remove (null): fired a selected area is removed. arguments : (event, id, areas, area)
  • ng-areas-on-add (null): fired when a selection is released. arguments : (event, id, areas, area)
  • ng-areas-on-change (null) : triggered when the event "changed" is fired. arguments : (event, id, areas, area)

Event listeners / subscribers

So far one event is listening by the plugin:

  • on "ngAreas:renameByAreaId"

usage

	$scope.$broadcast("ngAreas:renameByAreaId", {
   	areaid : areaid,
   	name : "a new Label or Name for this box"
   });

LICENSE

 	MIT

Inspired by https://github.com/360Learning/jquery-select-areas

Версии библиотеки

Версия
1.0.4