Yahoo! UI Library

imagecropper  2.5.2

Yahoo! UI Library > imagecropper > YAHOO.widget.ImageCropper

Show Private Show Protected

Class YAHOO.widget.ImageCropper - extends YAHOO.util.Element

Creates a Image Cropper control.

Constructor

YAHOO.widget.ImageCropper ( el , attrs )
Parameters:
el <String/HTMLElement> The image element to make croppable.
attrs <Object> Object liternal containing configuration parameters.

Properties

Properties inherited from YAHOO.util.Element:

Properties inherited from YAHOO.util.AttributeProvider:

Methods

destroy

void destroy ( )
Destroys the ImageCropper object and all of it's elements & listeners.
Returns: void

getCropCoords

Object getCropCoords ( )
Returns the coordinates needed to crop the image
Returns: Object
The top, left, height, width and image url of the image being cropped

getCropperById

static Object getCropperById ( )
Get's an ImageCropper object by the HTML id of the image associated with the ImageCropper object.
Returns: Object
The ImageCropper Object

getEl

HTMLElement getEl ( )
Get the HTML reference for the image element.
Returns: HTMLElement
The image element

getMaskEl

HTMLElement getMaskEl ( )
Get the HTML reference for the mask element.
Returns: HTMLElement
The mask element

getResizeEl

HTMLElement getResizeEl ( )
Get the HTML reference for the resize element.
Returns: HTMLElement
The resize element

getResizeMaskEl

HTMLElement getResizeMaskEl ( )
Get the HTML reference for the resizable object's mask element.
Returns: HTMLElement
The resize objects mask element.

getResizeObject

YAHOO.util.Resize getResizeObject ( )
Get the Resize Utility object.
Returns: YAHOO.util.Resize
The Resize instance

getWrapEl

HTMLElement getWrapEl ( )
Get the HTML reference for the wrap element.
Returns: HTMLElement
The wrap element

reset

YAHOO.widget.ImageCropper reset ( )
Resets the crop element back to it's original position
Returns: YAHOO.widget.ImageCropper
The ImageCropper instance

toString

String toString ( )
Returns a string representing the ImageCropper Object.
Returns: String

Events

beforeInitHeightChange

beforeInitHeightChange ( eventInfo )
Fires before the value for the configuration attribute 'initHeight' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeInitialXYChange

beforeInitialXYChange ( eventInfo )
Fires before the value for the configuration attribute 'initialXY' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeInitWidthChange

beforeInitWidthChange ( eventInfo )
Fires before the value for the configuration attribute 'initWidth' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeKeyTickChange

beforeKeyTickChange ( eventInfo )
Fires before the value for the configuration attribute 'keyTick' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMinHeightChange

beforeMinHeightChange ( eventInfo )
Fires before the value for the configuration attribute 'minHeight' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMinWidthChange

beforeMinWidthChange ( eventInfo )
Fires before the value for the configuration attribute 'minWidth' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeRatioChange

beforeRatioChange ( eventInfo )
Fires before the value for the configuration attribute 'ratio' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeShiftKeyTickChange

beforeShiftKeyTickChange ( eventInfo )
Fires before the value for the configuration attribute 'shiftKeyTick' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeStatusChange

beforeStatusChange ( eventInfo )
Fires before the value for the configuration attribute 'status' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeUseKeysChange

beforeUseKeysChange ( eventInfo )
Fires before the value for the configuration attribute 'useKeys' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

dragEvent

dragEvent ( )
Fires when the DragDrop dragEvent

initHeightChange

initHeightChange ( eventInfo )
Fires when the value for the configuration attribute 'initHeight' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

initialXYChange

initialXYChange ( eventInfo )
Fires when the value for the configuration attribute 'initialXY' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

initWidthChange

initWidthChange ( eventInfo )
Fires when the value for the configuration attribute 'initWidth' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

keyTickChange

keyTickChange ( eventInfo )
Fires when the value for the configuration attribute 'keyTick' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

minHeightChange

minHeightChange ( eventInfo )
Fires when the value for the configuration attribute 'minHeight' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

minWidthChange

minWidthChange ( eventInfo )
Fires when the value for the configuration attribute 'minWidth' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

moveEvent

moveEvent ( )
Fires on every element move. Inside these methods: _handleKeyPress, _handleDragEvent, _handleResizeEvent

ratioChange

ratioChange ( eventInfo )
Fires when the value for the configuration attribute 'ratio' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

resizeEvent

resizeEvent ( )
Fires on every element resize.

shiftKeyTickChange

shiftKeyTickChange ( eventInfo )
Fires when the value for the configuration attribute 'shiftKeyTick' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

startResizeEvent

startResizeEvent ( )
Fires when when a resize action is started.

statusChange

statusChange ( eventInfo )
Fires when the value for the configuration attribute 'status' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

useKeysChange

useKeysChange ( eventInfo )
Fires when the value for the configuration attribute 'useKeys' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

Configuration Attributes

initHeight - Number

Set the initlal height of the crop area, defaults to 1/4 of the image height

initialXY - Array

Array of the XY position that we need to set the crop element to when we build it. Defaults to [10, 10]

initWidth - Number

Set the initlal width of the crop area, defaults to 1/4 of the image width

keyTick - Number

The pixel tick for the arrow keys, defaults to 1

minHeight - Number

MinHeight of the crop area, default 50

minWidth - Number

MinWidth of the crop area, default 50.

ratio - Boolean

Set the ratio config option of the Resize Utlility, default false

shiftKeyTick - Number

The pixel tick for shift + the arrow keys, defaults to 10

status - Boolean

Show the Resize Utility status, defaults to true

useKeys - Boolean

Should we use the Arrow keys to position the crop element, defaults to true

Configuration attributes inherited from YAHOO.util.Element:


Copyright © 2007 Yahoo! Inc. All rights reserved.