more asset manager changes

This commit is contained in:
JT Smith 2004-12-21 04:33:26 +00:00
parent 9d5353cf8f
commit 95bac10986
15 changed files with 247 additions and 99 deletions

View file

@ -17,8 +17,9 @@ function Asset() {
//methods
this.edit = Asset_edit;
this.view = Asset_view;
this.go = Asset_go;
this.setRank = Asset_setRank;
this.displayProperties = Asset_displayProperties;
// this.displayProperties = Asset_displayProperties;
this.setParent = Asset_setParent;
}
@ -49,6 +50,14 @@ function Asset_edit() {
location.href = "http://" + manager.tools.getHostName(location.href) + manager.tools.addParamDelimiter(this.url) + "func=edit&afterEdit=assetManager";
}
//Edit the properties of an asset (edit)
//-------------------------------
//url + ?||& + func=edit
function Asset_go() {
location.href = "http://" + manager.tools.getHostName(location.href) + manager.tools.addParamDelimiter(this.url) + "func=manageAssets";
}
//View an asset (view)
//-------------
//url + ?||& + func=view
@ -56,16 +65,16 @@ function Asset_view() {
location.href = "http://" + manager.tools.getHostName(location.href) + this.url;
}
function Asset_displayProperties() {
html = "<table border='0'><tr><td class=\"propertiesMenuName\">Title:</td><td class=\"propertiesMenuValue\">" + this.title + "</td></tr>";
html+="<tr><td class=\"propertiesMenuName\">Rank:</td><td class=\"propertiesMenuValue\">" + this.rank + "</td></tr>"
html+="<tr><td class=\"propertiesMenuName\">Asset ID:</td><td class=\"propertiesMenuValue\">" + this.assetId + "</td></tr>"
html+="<tr><td class=\"propertiesMenuName\">Asset Type:</td><td class=\"propertiesMenuValue\">" + this.type + "</td></tr>"
html+="<tr><td class=\"propertiesMenuName\">Size:</td><td class=\"propertiesMenuValue\">" + this.size + "</td></tr>"
html+="<tr><td class=\"propertiesMenuName\">Last Updated:</td><td class=\"propertiesMenuValue\">" + this.lastUpdate + "</td></tr>"
html+="</table>";
manager.display.displayPropertiesWindow(html);
}
//function Asset_displayProperties() {
// html = "<table border='0'><tr><td class=\"propertiesMenuName\">Title:</td><td class=\"propertiesMenuValue\">" + this.title + "</td></tr>";
// html+="<tr><td class=\"propertiesMenuName\">Rank:</td><td class=\"propertiesMenuValue\">" + this.rank + "</td></tr>"
// html+="<tr><td class=\"propertiesMenuName\">Asset ID:</td><td class=\"propertiesMenuValue\">" + this.assetId + "</td></tr>"
// html+="<tr><td class=\"propertiesMenuName\">Asset Type:</td><td class=\"propertiesMenuValue\">" + this.type + "</td></tr>"
// html+="<tr><td class=\"propertiesMenuName\">Size:</td><td class=\"propertiesMenuValue\">" + this.size + "</td></tr>"
// html+="<tr><td class=\"propertiesMenuName\">Last Updated:</td><td class=\"propertiesMenuValue\">" + this.lastUpdate + "</td></tr>"
// html+="</table>";
// manager.display.displayPropertiesWindow(html);
//}

View file

@ -42,7 +42,7 @@ function AssetManager_getManager() {
function AssetManager_renderAssets() {
var gridStr = '<table border="1" id="am_grid" class="am-grid"><tbody id="am_grid_body"><tr id="am_grid.headers" class="am-grid-header">';
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 = "";
@ -107,14 +107,14 @@ function AssetManager_renderAssets() {
function AssetManager_buildCrumbTrail() {
var crumbtrail = document.getElementById("crumbtrail");
var contents = "<table><tr>";
var contents = '<table><tr>';
var parentAssets = new Array();
for (i=0;i<this.crumbtrail.length;i++) {
contents += '<td id="' + this.crumbtrail[i][0] + '" class="crumbtrail">' + this.crumbtrail[i][2] + '</td>';
contents += '<td id="' + this.crumbtrail[i][0] + '" class="am-crumbtrail">' + this.crumbtrail[i][2] + '</td>';
if (i != this.crumbtrail.length -1) {
contents += "<td>&nbsp;->&nbsp;</td>";
contents += "<td>&nbsp;/&nbsp;</td>";
}
}
@ -155,28 +155,30 @@ function AssetManager_getAsset(obj) {
return obj.asset;
}
function AssetManager_displayContextMenu(x,y) {
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()");
}
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 (!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()");
arr[arr.length] = new ContextMenuItem(this.labels["properties"],"javascript:manager.display.contextMenu.owner.displayProperties()");
}
// alert("x = " + x + " y= " + y);
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,this);
manager.contextMenu.render(arr,x,y,asset);
}
@ -240,11 +242,11 @@ function AssetManager_sortGrid(columnIndex) {
if (colHeader.sortOrder==">") {
colHeader.sortOrder="<";
document.getElementById('am_grid.headers.' + columnIndex).innerHTML = this.columnHeadings[columnIndex] + " (up)";
document.getElementById('am_grid.headers.' + columnIndex).innerHTML = this.columnHeadings[columnIndex] + ' <img src="/extras/assetManager/up.gif" />';
}else {
colHeader.sortOrder=">";
document.getElementById('am_grid.headers.' + columnIndex).innerHTML = this.columnHeadings[columnIndex] + "(down)";
document.getElementById('am_grid.headers.' + columnIndex).innerHTML = this.columnHeadings[columnIndex] + ' <img src="/extras/assetManager/down.gif" />';
}

View file

@ -62,11 +62,14 @@ function ContextMenu_render(contextMenuItemArray,x,y,owner) {
if (y > parseInt(this.contextMenu.offsetHeight)) {
this.contextMenu.style.top = (y + document.body.scrollTop - this.contextMenu.offsetHeight -1) + "px";
// this.contextMenu.style.top = (y + document.body.scrollTop - this.contextMenu.offsetHeight -1) + "px";
this.contextMenu.style.top = (y + window.scrollY - this.contextMenu.offsetHeight -1) + "px";
}else {
this.contextMenu.style.top = (y + document.body.scrollTop + 3) + "px";
// this.contextMenu.style.top = (y + document.body.scrollTop + 3) + "px";
this.contextMenu.style.top = (y + window.scrollY + 3) + "px";
}
this.contextMenu.style.left= (x + document.body.scrollLeft) + "px";
//this.contextMenu.style.left= (x + document.body.scrollLeft) + "px";
this.contextMenu.style.left= (x + window.scrollX) + "px";
manager.display.bringToFront(this.contextMenu);

View file

@ -168,7 +168,7 @@ function Display_selectAsset(asset) {
// debug(this.overObjects.length);
if (!this.controlKeyDown && !this.shiftKeyDown) {
for (i=0;i<this.overObjects.length;i++) {
this.overObjects[i].div.style.backgroundColor="white";
this.overObjects[i].div.className="am-grid-row";
}
this.overObjects=new Array();
}
@ -176,7 +176,7 @@ function Display_selectAsset(asset) {
if (!this.isSelected(asset)) {
this.overObjects[this.overObjects.length] = asset;
asset.div.style.backgroundColor = "red";
asset.div.className="am-grid-row-over";
}
}
@ -207,13 +207,16 @@ function Display_move(e){
}
if (this.overObjects[0] != this.focusObjects[0]) {
var act = this.spy(this.dom? e.pageX: (e.clientX + document.body.scrollLeft),this.dom? e.pageY: (e.clientY + document.body.scrollTop));
//var act = this.spy(this.dom? e.pageX: (e.clientX + document.body.scrollLeft),this.dom? e.pageY: (e.clientY + document.body.scrollTop));
var act = this.spy(this.dom? e.pageX: (e.clientX + window.scrollX),this.dom? e.pageY: (e.clientY + window.scrollY));
document.getElementById("dragImage").style.display = "block";
document.getElementById("dragImage").style.top = this.dom? (e.clientY+ 15 + document.body.scrollTop) + "px" : (event.clientY + 15) + "px";
// document.getElementById("dragImage").style.top = this.dom? (e.clientY+ 15 + document.body.scrollTop) + "px" : (event.clientY + 15) + "px";
document.getElementById("dragImage").style.top = this.dom? (e.clientY+ 15 + window.scrollY) + "px" : (event.clientY + 15) + "px";
// debug(document.body.scrollTop);
//debug(window.scrollY);
document.getElementById("dragImage").style.left = this.dom? (e.clientX + 5 + document.body.scrollTop) + "px" : (event.clientX + 5) + "px";
//document.getElementById("dragImage").style.left = this.dom? (e.clientX + 5 + document.body.scrollTop) + "px" : (event.clientX + 5) + "px";
document.getElementById("dragImage").style.left = this.dom? (e.clientX + 5 + window.scrollX) + "px" : (event.clientX + 5) + "px";
}
}

View file

@ -38,7 +38,7 @@ function EventManager_assetDoubleClick(e) {
var e=dom? e : event;
var obj =dom? e.target : e.srcElement
AssetManager_getManager().getAsset(obj).edit();
AssetManager_getManager().getAsset(obj).go();
}
function EventManager_assetRightClick(e) {
@ -55,7 +55,7 @@ function EventManager_assetRightClick(e) {
var asset = manager.getAsset(obj);
manager.display.contextMenu.owner = asset;
manager.displayContextMenu(e.clientX,e.clientY);
manager.displayContextMenu(e.clientX,e.clientY,asset);
return false;
}

View file

@ -1,30 +1,163 @@
.am-grid {height: 100%; font: menu;}
.am-grid-headers {background-color:blue}
.am-grid-header-0 {width: 50px; background-color: threedlightshadow; cursor:move;}
.am-grid-header-1 {width: 200px; cursor:move;}
.am-grid-header-2 {cursor:move;}
.am-grid-header-3 {cursor:move;}
.am-grid-header-4 {cursor:move;}
.am-grid-row {}
.am-grid-col-0 {width: 50px; background-color: threedlightshadow; cursor:move;}
.am-grid-col-1 {width: 200px; cursor:move;}
.am-grid-col-2 {cursor:move;}
.am-grid-col-3 {cursor:move;}
.am-grid-col-4 {cursor:move;}
.contextMenu{position: absolute; top: 0; left:0; font-size: 12px; display:none; text-decoration: none; background-color:#F0F0F0; border-bottom: 3px groove #999999; border-top: 0px groove #999999; border-right: 3px groove #999999; border-left: 0px groove #999999;}
.contextMenu A{ font-size: 12px; text-decoration: none;}
.contextMenuTabOver{background-color: darkblue; text-decoration: none; width:100%; color: #ffffff; font-size: 12px;}
.contextMenuTab, .contextMenuTab A{background-color: #F0F0F0; width:100%; text-decoration: none; font-size: 12px; color:#000000;}
.propertiesWindow{position:absolute; display:none; background-color:#F2F2F2;}
.propertiesWindowDrag{position:absolute; background-image: url(/images/transparent.gif)}
.propertiesMenuName{font-weight:700; font-size:12px}
.propertiesMenuValue{font-size:12px;}
.dragIdentifier{position:absolute; display: none; border: 3px dotted black; font-size: 12;}
#crumbtrail{
color: #3E697E;
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, Arial, sans-serif;
}
.am-grid {
height: 100%;
font: menu;
}
.am-grid-headers {
background-color:#ffffff;
font-weight: 700;
cursor: pointer;
/*background-color: #BCD4DF; */
}
.am-grid-header-0 {
width: 10px;
background-color: #F2F3F4;
border-left: 1px solid #fff;
border-right: 1px solid #7F949F;
border-bottom: 2px solid #7F949F;
padding: 0 10px 0 0;
text-align: right;
}
.am-grid-header-0 img{
padding: 0 3px 0 3px;
}
.am-grid-header-0 .over{
width: 10px;
background-color: #F2F3F4;
border-left: 1px solid #fff;
border-right: 1px solid #7F949F;
border-bottom: 2px solid #EA5600;
padding: 0 10px 0 0;
text-align: right;
}
.am-grid-header-1 {
width: 200px;
background-color: #F2F3F4;
border-left: 1px solid #fff;
border-right: 1px solid #7F949F;
border-bottom: 2px solid #7F949F;
padding: 0 0 0 10px;
}
.am-grid-header-1 img{
padding: 0 3px 0 3px;
}
.am-grid-header-2 {
width: 50px;
background-color: #F2F3F4;
border-left: 1px solid #fff;
border-right: 1px solid #7F949F;
border-bottom: 2px solid #7F949F;
padding: 0 0 0 10px;
}
.am-grid-header-2 img{
padding: 0 3px 0 3px;
}
.am-grid-header-3 {
width: 150px;
background-color: #F2F3F4;
border-left: 1px solid #fff;
border-right: 1px solid #7F949F;
border-bottom: 2px solid #7F949F;
padding: 0 0 0 10px;
}
.am-grid-header-3 img{
padding: 0 3px 0 3px;
}
.am-grid-header-4 {
width: 50px;
background-color: #F2F3F4;
border-left: 1px solid #fff;
border-right: 1px solid #7F949F;
border-bottom: 2px solid #7F949F;
padding: 0 10px 0 0 ;
text-align: right;
}
.am-grid-header-4 img{
padding: 0 3px 0 3px;
}
.am-grid-row {
color: #000;
}
.am-grid-row-over {
background-color: #C0D2DA;
color: #000;
font-weight: bold;
}
.am-grid-col-0 {
width: 50px;
cursor:move;
text-align: right;
padding: 0 10px 7px 0;
}
.am-grid-col-1 {
width: 200px;
cursor:move;
padding: 0 0 7px 10px;
vertical-align: middle;
}
.am-grid-col-1 img{
margin: 0px 10px 0 0;
}
.am-grid-col-2 {
cursor:move;
padding: 0 0 7px 10px;
}
.am-grid-col-3 {
cursor:move;
padding: 0 0 7px 10px;
}
.am-grid-col-4 {
cursor:move;
text-align: right;
padding: 0 10px 7px 10px;
}
.am-crumbtrail {
font-size: 12px;
}
.am-crumbtrail-header {
font-size: 12px;
font-weight: 700;
}
.contextMenu{
position: absolute;
top: 0;
left:0;
font-size: 12px;
display:none;
text-decoration: none;
background-color:#F0F0F0;
border-bottom: 3px groove #999999;
border-top: 0px groove #999999;
border-right: 3px groove #999999;
border-left: 0px groove #999999;}
.contextMenu A{ font-size: 12px; text-decoration: none;}
.contextMenuTabOver{
background-color: #C3CFD4;
text-decoration: none;
width:100%;
color: #154C66;
font-size: 12px;
}
.contextMenuTab, .contextMenuTab A{background-color: #F0F0F0; width:100%; text-decoration: none; font-size: 12px; color:#000000;}
.dragIdentifier{
position:absolute;
display: none;
border: 1px dashed #405F6E;
font-size: 12;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 64 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B