more updates to the asset manager system
This commit is contained in:
parent
2050de56cd
commit
93536887c2
9 changed files with 269 additions and 146 deletions
|
|
@ -552,6 +552,7 @@ Returns a text string of HTML code for the Asset Manager Control Page. English o
|
|||
sub getAssetManagerControl {
|
||||
my $self = shift;
|
||||
my $children = shift;
|
||||
my $controlType = shift;
|
||||
WebGUI::Style::setLink($session{config}{extrasURL}.'/assetManager/assetManager.css', {rel=>"stylesheet",type=>"text/css"});
|
||||
WebGUI::Style::setScript($session{config}{extrasURL}.'/assetManager/Tools.js', {type=>"text/javascript"});
|
||||
WebGUI::Style::setScript($session{config}{extrasURL}.'/assetManager/ContextMenu.js', {type=>"text/javascript"});
|
||||
|
|
@ -559,6 +560,9 @@ sub getAssetManagerControl {
|
|||
WebGUI::Style::setScript($session{config}{extrasURL}.'/assetManager/Display.js', {type=>"text/javascript"});
|
||||
WebGUI::Style::setScript($session{config}{extrasURL}.'/assetManager/EventManager.js', {type=>"text/javascript"});
|
||||
WebGUI::Style::setScript($session{config}{extrasURL}.'/assetManager/AssetManager.js', {type=>"text/javascript"});
|
||||
WebGUI::Style::setScript($session{config}{extrasURL}.'/assetManager/AssetManagerAsset.js', {type=>"text/javascript"});
|
||||
WebGUI::Style::setScript($session{config}{extrasURL}.'/assetManager/CrumbTrailAsset.js', {type=>"text/javascript"});
|
||||
WebGUI::Style::setScript($session{config}{extrasURL}.'/assetManager/'.$controlType.'.js', {type=>"text/javascript"}) if (defined $controlType);
|
||||
my $output = '
|
||||
<div id="contextMenu" class="contextMenu"></div>
|
||||
<div id="propertiesWindow" class="propertiesWindow"></div>
|
||||
|
|
@ -596,10 +600,14 @@ sub getAssetManagerControl {
|
|||
$output .= "labels['move'] = 'Move';\n";
|
||||
$output .= "labels['view'] = 'View';\n";
|
||||
$output .= "labels['delete'] = 'Delete';\n";
|
||||
$output .= "labels['restore'] = 'Restore';\n";
|
||||
$output .= "labels['purge'] = 'Purge';\n";
|
||||
$output .= "labels['go'] = 'Go';\n";
|
||||
$output .= "labels['properties'] = 'Properties';\n";
|
||||
$output .= "labels['editTree'] = 'Edit Tree';\n";
|
||||
$output .= "var manager = new AssetManager(assets,columnHeadings,labels,crumbtrail); manager.renderAssets();\n</script>\n";
|
||||
$output .= "var manager = new AssetManager(assets,columnHeadings,labels,crumbtrail);\n";
|
||||
$output .= "manager.assetType='".$controlType."';\n" if (defined $controlType);
|
||||
$output .= "manager.renderAssets();\n</script>\n";
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -2310,7 +2318,7 @@ sub www_manageClipboard {
|
|||
$limit = 1;
|
||||
}
|
||||
foreach my $assetData (@{$self->getAssetsInClipboard($limit)}) {
|
||||
push(@assets,WebGUI::Asset->newByDynamicClass($assetData->{assetId},$assetData->{className}));
|
||||
push(@assets,WebGUI::Asset->newByDynamicClass($assetData->{assetId},"ManageClipboard",$assetData->{className}));
|
||||
}
|
||||
return $ac->render($self->getAssetManagerControl(\@assets), $header);
|
||||
}
|
||||
|
|
@ -2344,7 +2352,7 @@ sub www_manageTrash {
|
|||
foreach my $assetData (@{$self->getAssetsInTrash($limit)}) {
|
||||
push(@assets,WebGUI::Asset->newByDynamicClass($assetData->{assetId},$assetData->{className}));
|
||||
}
|
||||
return $ac->render($self->getAssetManagerControl(\@assets), $header);
|
||||
return $ac->render($self->getAssetManagerControl(\@assets,"ManageTrash"), $header);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ function Asset() {
|
|||
//properties
|
||||
this.url = "";
|
||||
this.rank = 1;
|
||||
this.labels = new Array();
|
||||
this.assetId = "";
|
||||
this.type = "";
|
||||
this.title = "";
|
||||
|
|
@ -13,23 +14,23 @@ function Asset() {
|
|||
this.lastUpdate = "";
|
||||
this.icon = "";
|
||||
this.div = null;
|
||||
this.dragEnabled = true;
|
||||
this.allowMultiSelect = true;
|
||||
this.isParent=false;
|
||||
|
||||
//methods
|
||||
this.edit = Asset_edit;
|
||||
this.view = Asset_view;
|
||||
this.go = Asset_go;
|
||||
this.setRank = Asset_setRank;
|
||||
// this.displayProperties = Asset_displayProperties;
|
||||
this.setParent = Asset_setParent;
|
||||
}
|
||||
|
||||
//---------Method Implementations -------------
|
||||
|
||||
this.registerEvents = function() {
|
||||
this.div.ondblclick=Asset_doubleClick;
|
||||
this.div.onmousedown=Asset_mouseDown;
|
||||
this.div.oncontextmenu=Asset_rightClick;
|
||||
|
||||
}
|
||||
|
||||
//Moving to a new parent (move)
|
||||
//----------------------
|
||||
//url + ?||& + func=setParent&assetId= + assetId
|
||||
function Asset_setParent(asset) {
|
||||
this.setParent = function(asset) {
|
||||
//parentURL
|
||||
location.href = "http://" + manager.tools.getHostName(location.href) + manager.tools.addParamDelimiter(this.url) + "func=setParent&assetId="+ asset.assetId;
|
||||
}
|
||||
|
|
@ -38,33 +39,117 @@ function Asset_setParent(asset) {
|
|||
//Set the rank of an asset amongst its siblings (move)
|
||||
//---------------------------------------------
|
||||
//url + ?||& + func=setRank&rank= + newRank
|
||||
function Asset_setRank(rank) {
|
||||
this.setRank = function(rank) {
|
||||
//to child
|
||||
location.href = "http://" + manager.tools.getHostName(location.href) + manager.tools.addParamDelimiter(this.url) + "func=setRank&rank="+ rank;
|
||||
}
|
||||
|
||||
|
||||
//url + ?||& + func=editTree
|
||||
this.editTree = function() {
|
||||
//parentURL
|
||||
location.href = "http://" + manager.tools.getHostName(location.href) + manager.tools.addParamDelimiter(this.url) + "func=editTree";
|
||||
}
|
||||
|
||||
|
||||
//Edit the properties of an asset (edit)
|
||||
//-------------------------------
|
||||
//url + ?||& + func=edit
|
||||
function Asset_edit() {
|
||||
this.edit = function() {
|
||||
location.href = "http://" + manager.tools.getHostName(location.href) + manager.tools.addParamDelimiter(this.url) + "func=edit&proceed=manageAssets";
|
||||
}
|
||||
|
||||
//Edit the properties of an asset (edit)
|
||||
//-------------------------------
|
||||
//url + ?||& + func=edit
|
||||
function Asset_go() {
|
||||
this.go = function() {
|
||||
location.href = "http://" + manager.tools.getHostName(location.href) + manager.tools.addParamDelimiter(this.url) + "func=manageAssets";
|
||||
}
|
||||
|
||||
|
||||
//View an asset (view)
|
||||
//-------------
|
||||
//url + ?||& + func=view
|
||||
function Asset_view() {
|
||||
this.view = function() {
|
||||
location.href = "http://" + manager.tools.getHostName(location.href) + this.url;
|
||||
}
|
||||
|
||||
//displays the right click context menu
|
||||
this.getContextMenu = function () {
|
||||
var arr = new Array();
|
||||
if (AssetManager_getManager().display.overObjects.length == 1) {
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["go"],"javascript:manager.display.contextMenu.owner.go()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["view"],"javascript:manager.display.contextMenu.owner.view()");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["edit"],"javascript:manager.display.contextMenu.owner.edit()");
|
||||
}
|
||||
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["delete"],"javascript:manager.remove()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["cut"],"javascript:AssetManager_getManager().cut()");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["copy"],"javascript:manager.copy()");
|
||||
|
||||
if (AssetManager_getManager().display.overObjects.length ==1) {
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["editTree"],"javascript:manager.display.contextMenu.owner.editTree()");
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
this.select= function() {
|
||||
this.div.className="am-grid-row-over";
|
||||
}
|
||||
|
||||
this.deselect = function() {
|
||||
this.div.className="am-grid-row";
|
||||
}
|
||||
|
||||
}//end object
|
||||
|
||||
//Staic Methods
|
||||
function Asset_doubleClick(e) {
|
||||
alert("here");
|
||||
var dom = document.getElementById&&!document.all;
|
||||
var e=dom? e : event;
|
||||
var obj =dom? e.target : e.srcElement
|
||||
|
||||
AssetManager_getManager().getAsset(obj).go();
|
||||
}
|
||||
|
||||
function Asset_rightClick(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
|
||||
if (!dom) {
|
||||
e.cancelBubble = true;
|
||||
e.returnValue = false;
|
||||
}
|
||||
|
||||
obj =dom? e.target : e.srcElement
|
||||
|
||||
var asset = AssetManager_getManager().getAsset(obj);
|
||||
|
||||
manager.display.contextMenu.owner = asset;
|
||||
manager.displayContextMenu(e.clientX,e.clientY,asset);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function Asset_mouseDown(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
|
||||
//Display_adjustScrollBars(e);
|
||||
|
||||
if (e.button==2) {
|
||||
//this is a hack to get the context menu stuff to work right in IE
|
||||
if (!dom) {
|
||||
e.cancelBubble = true;
|
||||
e.returnValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ function AssetManager(assetArrayData,headerArrayData,labels,crumbtrail) {
|
|||
this.keys[4] = "size";
|
||||
|
||||
this.parentURL = "";
|
||||
|
||||
this.assetType = "Asset";
|
||||
|
||||
|
||||
this.labels = labels;
|
||||
this.crumbtrail = crumbtrail;
|
||||
|
|
@ -29,7 +32,6 @@ function AssetManager(assetArrayData,headerArrayData,labels,crumbtrail) {
|
|||
this.getAsset= AssetManager_getAsset;
|
||||
this.buildCrumbTrail = AssetManager_buildCrumbTrail;
|
||||
this.displayContextMenu = AssetManager_displayContextMenu;
|
||||
this.editTree=AssetManager_editTree;
|
||||
this.remove = AssetManager_remove;
|
||||
this.cut = AssetManager_cut;
|
||||
this.copy = AssetManager_copy;
|
||||
|
|
@ -44,6 +46,9 @@ function AssetManager_getManager() {
|
|||
|
||||
//renders the full asset manager
|
||||
function AssetManager_renderAssets() {
|
||||
|
||||
var parent = this.buildCrumbTrail();
|
||||
|
||||
var gridStr = '<table border="0" cellspacing="0" id="am_grid" class="am-grid"><tbody id="am_grid_body"><tr id="am_grid.headers" class="am-grid-headers">';
|
||||
var eventStr='';
|
||||
var id = "";
|
||||
|
|
@ -51,18 +56,19 @@ function AssetManager_renderAssets() {
|
|||
for (i=0;i<this.columnHeadings.length;i++) {
|
||||
id = 'am_grid.headers.' + i;
|
||||
gridStr+= '<td id="' + id + '" class="am-grid-header-' + i + '">' + this.columnHeadings[i] + '</td>';
|
||||
eventStr += 'document.getElementById("' + id + '").onclick=AssetManager_getManager().eventManager.gridHeaderClick;';
|
||||
eventStr += 'document.getElementById("' + id + '").onmouseover=AssetManager_getManager().eventManager.gridHeaderMouseOver;';
|
||||
eventStr += 'document.getElementById("' + id + '").onmouseout=AssetManager_getManager().eventManager.gridHeaderMouseOut;';
|
||||
if (this.sortEnabled) {
|
||||
eventStr += 'document.getElementById("' + id + '").onclick=AssetManager_getManager().eventManager.gridHeaderClick;';
|
||||
eventStr += 'document.getElementById("' + id + '").onmouseover=AssetManager_getManager().eventManager.gridHeaderMouseOver;';
|
||||
eventStr += 'document.getElementById("' + id + '").onmouseout=AssetManager_getManager().eventManager.gridHeaderMouseOut;';
|
||||
}
|
||||
}
|
||||
|
||||
gridStr+= '</tr>';
|
||||
for (i=0;i<this.assetArrayData.length;i++) {
|
||||
id = 'am_grid.row.'+ i;
|
||||
gridStr += '<tr id="'+ id + '" class="am-grid-row">';
|
||||
|
||||
asset = new Asset();
|
||||
|
||||
|
||||
asset = eval("new " + this.assetType + "()");
|
||||
asset.rank = this.assetArrayData[i][0];
|
||||
asset.title = this.assetArrayData[i][1];
|
||||
asset.type = this.assetArrayData[i][2];
|
||||
|
|
@ -71,16 +77,15 @@ function AssetManager_renderAssets() {
|
|||
asset.url = this.assetArrayData[i][5];
|
||||
asset.assetId = this.assetArrayData[i][6];
|
||||
asset.icon = this.assetArrayData[i][7];
|
||||
this.assets[i]=asset;
|
||||
|
||||
//add the row events
|
||||
eventStr += 'document.getElementById("' + id + '").ondblclick=AssetManager_getManager().eventManager.assetDoubleClick;';
|
||||
eventStr += 'document.getElementById("' + id + '").onmousedown=AssetManager_getManager().eventManager.assetMouseDown;';
|
||||
eventStr += 'document.getElementById("' + id + '").oncontextmenu=AssetManager_getManager().eventManager.assetRightClick;';
|
||||
eventStr += 'document.getElementById("' + id + '").asset = AssetManager_getManager().assets[' + i + '];';
|
||||
eventStr += 'AssetManager_getManager().assets[' + i + '].div = document.getElementById("' + id + '");';
|
||||
|
||||
|
||||
asset.parent = parent;
|
||||
asset.labels = this.labels;
|
||||
var assetIndex = this.assets.length;
|
||||
this.assets[assetIndex]=asset;
|
||||
|
||||
|
||||
eventStr += 'document.getElementById("' + id + '").asset = AssetManager_getManager().assets[' + assetIndex + '];';
|
||||
eventStr += 'AssetManager_getManager().assets[' + assetIndex + '].div = document.getElementById("' + id + '");';
|
||||
|
||||
for (k=0;k<this.columnHeadings.length;k++) {
|
||||
id = 'am_grid.row' + '.' + i + '.col.' + k;
|
||||
gridStr+= '<td id="' + id + '" class="am-grid-col-' + k +'">';
|
||||
|
|
@ -90,15 +95,15 @@ function AssetManager_renderAssets() {
|
|||
}
|
||||
gridStr+=this.assetArrayData[i][k] + '</td>';
|
||||
}
|
||||
}
|
||||
gridStr+='</tr>';
|
||||
|
||||
}
|
||||
gridStr += '</tbody></table>';
|
||||
|
||||
document.getElementById("workspace").innerHTML=gridStr;
|
||||
eval(eventStr);
|
||||
|
||||
this.buildCrumbTrail();
|
||||
for (i=0; i< this.assets.length; i++) {
|
||||
this.assets[i].registerEvents();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -123,21 +128,22 @@ function AssetManager_buildCrumbTrail() {
|
|||
crumbtrail.innerHTML = contents;
|
||||
|
||||
//build assets attach the div properties
|
||||
var lastAsset = null;
|
||||
for (i=0; i< this.crumbtrail.length; i++ ) {
|
||||
var asset = new Asset();
|
||||
var asset = new CrumbTrailAsset();
|
||||
asset.title = this.crumbtrail[i][2];
|
||||
asset.url = this.crumbtrail[i][1];
|
||||
asset.assetId = this.crumbtrail[i][0];
|
||||
asset.div = document.getElementById(this.crumbtrail[i][0]);
|
||||
|
||||
asset.div.ondblclick=AssetManager_getManager().eventManager.assetDoubleClick;
|
||||
asset.div.onmousedown=AssetManager_getManager().eventManager.assetMouseDown;
|
||||
asset.div.oncontextmenu=AssetManager_getManager().eventManager.assetRightClick;
|
||||
|
||||
asset.parent = lastAsset;
|
||||
lastAsset = asset;
|
||||
asset.isParent = true;
|
||||
asset.labels = this.labels;
|
||||
asset.div = document.getElementById(this.crumbtrail[i][0]);
|
||||
document.getElementById(this.crumbtrail[i][0]).asset = asset;
|
||||
this.assets[this.assets.length] = asset;
|
||||
}
|
||||
|
||||
return this.assets[this.assets.length -1];
|
||||
}
|
||||
|
||||
//returns an asset based on a div object
|
||||
|
|
@ -149,35 +155,8 @@ function AssetManager_getAsset(obj) {
|
|||
}
|
||||
|
||||
//displays the right click context menu
|
||||
function AssetManager_displayContextMenu(x,y,asset) {
|
||||
var arr = new Array();
|
||||
if (this.display.overObjects.length == 1) {
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["go"],"javascript:manager.display.contextMenu.owner.go()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["view"],"javascript:manager.display.contextMenu.owner.view()");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["edit"],"javascript:manager.display.contextMenu.owner.edit()");
|
||||
}
|
||||
|
||||
if (!asset.isParent) {
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["delete"],"javascript:manager.remove()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["cut"],"javascript:AssetManager_getManager().cut()");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["copy"],"javascript:manager.copy()");
|
||||
|
||||
if (this.display.overObjects.length ==1) {
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["editTree"],"javascript:manager.editTree()");
|
||||
}
|
||||
}
|
||||
|
||||
manager.contextMenu.render(arr,x,y,asset);
|
||||
}
|
||||
|
||||
|
||||
//url + ?||& + func=editTree
|
||||
function AssetManager_editTree() {
|
||||
//parentURL
|
||||
location.href = this.tools.addParamDelimiter(this.parentURL) + "func=editTree";
|
||||
function AssetManager_displayContextMenu(x,y,asset) {
|
||||
manager.contextMenu.render(asset.getContextMenu(),x,y,asset);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -205,7 +184,7 @@ function AssetManager_remove() {
|
|||
}
|
||||
|
||||
//returns the asset IDS of all selected assets
|
||||
function AssetManager_getSelectedAssetIds() {
|
||||
function AssetManager_getSelectedAssetIds() {
|
||||
var assetIds = "";
|
||||
for (i=0;i<this.display.overObjects.length;i++) {
|
||||
assetIds += "&assetId=" + this.display.overObjects[i].assetId;
|
||||
|
|
|
|||
10
www/extras/assetManager/AssetManagerAsset.js
Normal file
10
www/extras/assetManager/AssetManagerAsset.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
//--------Constructor--------------------
|
||||
|
||||
//Creates a new asset object.
|
||||
function AssetManagerAsset() {
|
||||
var asset = new Asset();
|
||||
return asset;
|
||||
|
||||
}
|
||||
|
||||
32
www/extras/assetManager/CrumbTrailAsset.js
Normal file
32
www/extras/assetManager/CrumbTrailAsset.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
//--------Constructor--------------------
|
||||
|
||||
//Creates a new asset object.
|
||||
function CrumbTrailAsset() {
|
||||
var asset = new Asset();
|
||||
|
||||
asset.dragEnabled = false;
|
||||
asset.allowMultiSelect = false;
|
||||
|
||||
//displays the right click context menu
|
||||
asset.getContextMenu = function () {
|
||||
var arr = new Array();
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["go"],"javascript:manager.display.contextMenu.owner.go()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["view"],"javascript:manager.display.contextMenu.owner.view()");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["edit"],"javascript:manager.display.contextMenu.owner.edit()");
|
||||
return arr;
|
||||
}
|
||||
|
||||
asset.select= function() {
|
||||
this.div.className="am-crumbtrail-over";
|
||||
}
|
||||
|
||||
asset.deselect = function() {
|
||||
this.div.className="am-crumbtrail";
|
||||
}
|
||||
|
||||
return asset;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ function Display_dragStart(firedobj,xCoordinate,yCoordinate) {
|
|||
firedobj=manager.display.dom? firedobj.parentNode : firedobj.parentElement
|
||||
}
|
||||
|
||||
if ((!firedobj.asset || firedobj.asset.isParent)) {
|
||||
if ((!firedobj.asset || !firedobj.asset.dragEnabled)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -103,38 +103,28 @@ function Display_isSelected(asset) {
|
|||
|
||||
//adds an asset to the overobjects array
|
||||
function Display_selectAsset(asset) {
|
||||
if (this.controlKeyDown || this.shiftKeyDown) {
|
||||
if (!asset.allowMultiSelect) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.controlKeyDown && !this.shiftKeyDown) {
|
||||
for (i=0;i<this.overObjects.length;i++) {
|
||||
|
||||
if (asset.isParent) {
|
||||
this.overObjects[i].div.className="am-crumbtrail";
|
||||
}else {
|
||||
this.overObjects[i].div.className="am-grid-row";
|
||||
}
|
||||
for (i=0;i<this.overObjects.length;i++) {
|
||||
this.overObjects[i].deselect();
|
||||
}
|
||||
this.overObjects=new Array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!this.isSelected(asset)) {
|
||||
this.overObjects[this.overObjects.length] = asset;
|
||||
if (asset.isParent) {
|
||||
asset.div.className="am-crumbtrail-over";
|
||||
}else {
|
||||
asset.div.className="am-grid-row-over";
|
||||
}
|
||||
asset.select();
|
||||
}
|
||||
}
|
||||
//Clears out the over objects array
|
||||
function Display_clearSelectedAssets() {
|
||||
for (i=0;i<this.overObjects.length;i++) {
|
||||
if (this.overObjects[i].isParent) {
|
||||
this.overObjects[i].div.className="am-crumbtrail";
|
||||
}else {
|
||||
this.overObjects[i].div.className="am-grid-row";
|
||||
}
|
||||
|
||||
|
||||
this.overObjects[i].deselect();
|
||||
}
|
||||
this.overObjects=new Array();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,6 @@ function EventManager() {
|
|||
this.gridHeaderClick = EventManager_gridHeaderClick;
|
||||
this.gridHeaderMouseOver = EventManager_gridHeaderMouseOver;
|
||||
this.gridHeaderMouseOut = EventManager_gridHeaderMouseOut;
|
||||
this.assetDoubleClick = EventManager_assetDoubleClick;
|
||||
this.assetRightClick = EventManager_assetRightClick;
|
||||
this.assetMouseDown = EventManager_assetMouseDown;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -57,49 +54,7 @@ function EventManager_keyUp(e) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function EventManager_assetDoubleClick(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
var e=dom? e : event;
|
||||
var obj =dom? e.target : e.srcElement
|
||||
|
||||
AssetManager_getManager().getAsset(obj).go();
|
||||
}
|
||||
|
||||
function EventManager_assetRightClick(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
|
||||
if (!dom) {
|
||||
e.cancelBubble = true;
|
||||
e.returnValue = false;
|
||||
}
|
||||
|
||||
obj =dom? e.target : e.srcElement
|
||||
|
||||
var asset = manager.getAsset(obj);
|
||||
|
||||
manager.display.contextMenu.owner = asset;
|
||||
manager.displayContextMenu(e.clientX,e.clientY,asset);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function EventManager_assetMouseDown(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
|
||||
Display_adjustScrollBars(e);
|
||||
|
||||
if (e.button==2) {
|
||||
//this is a hack to get the context menu stuff to work right in IE
|
||||
if (!dom) {
|
||||
e.cancelBubble = true;
|
||||
e.returnValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function EventManager_documentMouseDown(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
|
|
@ -117,8 +72,10 @@ function EventManager_documentMouseDown(e) {
|
|||
manager.display.dragStart(asset.div,e.clientX,e.clientY);
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
manager.display.clearSelectedAssets();
|
||||
}else {
|
||||
if (manager.display.contextMenu.owner == null) {
|
||||
manager.display.clearSelectedAssets();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.button != 2) {
|
||||
|
|
@ -138,7 +95,7 @@ function EventManager_documentMouseUp(e) {
|
|||
if (manager.display.contextMenu.owner && (!asset || asset.assetId != manager.display.contextMenu.owner.assetId)) {
|
||||
manager.display.contextMenu.hide();
|
||||
}else {
|
||||
if (!asset) {
|
||||
if (!asset && manager.display.contextMenu.owner == null) {
|
||||
manager.display.clearSelectedAssets();
|
||||
}
|
||||
|
||||
|
|
|
|||
31
www/extras/assetManager/ManageClipboard.js
Normal file
31
www/extras/assetManager/ManageClipboard.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
//--------Constructor--------------------
|
||||
|
||||
//Creates a new asset object.
|
||||
function ManageClipboard() {
|
||||
var asset = new Asset();
|
||||
|
||||
asset.dragEnabled = false;
|
||||
asset.allowMultiSelect = true;
|
||||
|
||||
//displays the right click context menu
|
||||
asset.getContextMenu = function () {
|
||||
var arr = new Array();
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["restore"],"javascript:manager.display.contextMenu.owner.restore()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["delete"],"javascript:manager.display.contextMenu.owner.delete()");
|
||||
return arr;
|
||||
}
|
||||
|
||||
asset.select= function() {
|
||||
this.div.className="am-crumbtrail-over";
|
||||
}
|
||||
|
||||
asset.deselect = function() {
|
||||
this.div.className="am-crumbtrail";
|
||||
}
|
||||
|
||||
return asset;
|
||||
|
||||
}
|
||||
|
||||
31
www/extras/assetManager/ManageTrash.js
Normal file
31
www/extras/assetManager/ManageTrash.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
//--------Constructor--------------------
|
||||
|
||||
//Creates a new asset object.
|
||||
function ManageTrash() {
|
||||
var asset = new Asset();
|
||||
|
||||
asset.dragEnabled = false;
|
||||
asset.allowMultiSelect = true;
|
||||
|
||||
//displays the right click context menu
|
||||
asset.getContextMenu = function () {
|
||||
var arr = new Array();
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["cut"],"javascript:manager.display.contextMenu.owner.cut()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["purge"],"javascript:manager.display.contextMenu.owner.purge()");
|
||||
return arr;
|
||||
}
|
||||
|
||||
asset.select= function() {
|
||||
this.div.className="am-crumbtrail-over";
|
||||
}
|
||||
|
||||
asset.deselect = function() {
|
||||
this.div.className="am-crumbtrail";
|
||||
}
|
||||
|
||||
return asset;
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue