- Fixed a bug where a blank page would be displayed if a user logged out on a
page that visitors could not access. - Fixed a bug in the make printable macro that used the wrong default template. - Added a context menu to inline editing that is accessible by right-click or by left-click-hold on the asset's class icon. - The context menu in the asset manager is now accessible via left-click-hold for more familiarity with mac users. - Added "create shortcut" as a context menu option in the asset manager.
This commit is contained in:
parent
626356fe09
commit
504c88e293
10 changed files with 213 additions and 137 deletions
|
|
@ -43,6 +43,15 @@
|
|||
- Renamed layout asset to page.
|
||||
- CS Post reply URLs are now shortened to an incremented reply number.
|
||||
- Added a Rich Editor Configuration asset.
|
||||
- Fixed a bug where a blank page would be displayed if a user logged out on a
|
||||
page that visitors could not access.
|
||||
- Fixed a bug in the make printable macro that used the wrong default
|
||||
template.
|
||||
- Added a context menu to inline editing that is accessible by right-click
|
||||
or by left-click-hold on the asset's class icon.
|
||||
- The context menu in the asset manager is now accessible via left-click-hold
|
||||
for more familiarity with mac users.
|
||||
- Added "create shortcut" as a context menu option in the asset manager.
|
||||
|
||||
|
||||
6.5.6
|
||||
|
|
|
|||
|
|
@ -805,7 +805,7 @@ manager.disableDisplay(0) is added to the script if parameter is defined.
|
|||
sub getAssetManagerControl {
|
||||
my $self = shift;
|
||||
my $children = shift;
|
||||
my $controlType = shift;
|
||||
my $controlType = shift || "ManageAssets";
|
||||
my $removeRank = 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"});
|
||||
|
|
@ -816,7 +816,7 @@ sub getAssetManagerControl {
|
|||
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);
|
||||
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>
|
||||
|
|
@ -855,8 +855,9 @@ sub getAssetManagerControl {
|
|||
$output .= "labels['view'] = 'View';\n";
|
||||
$output .= "labels['delete'] = 'Delete';\n";
|
||||
$output .= "labels['restore'] = 'Restore';\n";
|
||||
$output .= "labels['shortcut'] = 'Create Shortcut';\n";
|
||||
$output .= "labels['purge'] = 'Purge';\n";
|
||||
$output .= "labels['go'] = 'Go';\n";
|
||||
$output .= "labels['go'] = 'Manage';\n";
|
||||
$output .= "labels['properties'] = 'Properties';\n";
|
||||
$output .= "labels['editTree'] = 'Edit Branch';\n";
|
||||
$output .= "var manager = new AssetManager(assets,columnHeadings,labels,crumbtrail);\n";
|
||||
|
|
@ -1319,7 +1320,7 @@ sub getLineage {
|
|||
my @familyTree = ($lineage =~ /(.{6})/g);
|
||||
while (pop(@familyTree)) {
|
||||
push(@specificFamilyMembers,join("",@familyTree)) if (scalar(@familyTree));
|
||||
last if ($i >= $rules->{ancestorLimit});
|
||||
last if ($i >= $rules->{ancestorLimit} && exists $rules->{ancestorLimit});
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
|
@ -1655,8 +1656,6 @@ sub getToolbar {
|
|||
my $self = shift;
|
||||
my $toolbar = deleteIcon('func=delete',$self->get("url"),WebGUI::International::get(43,"Asset"))
|
||||
.editIcon('func=edit',$self->get("url"))
|
||||
.moveUpIcon('func=promote',$self->get("url"))
|
||||
.moveDownIcon('func=demote',$self->get("url"))
|
||||
.cutIcon('func=cut',$self->get("url"))
|
||||
.copyIcon('func=copy',$self->get("url"));
|
||||
$toolbar .= shortcutIcon('func=createShortcut',$self->get("url")) unless ($self->get("className") =~ /Shortcut/);
|
||||
|
|
@ -1667,8 +1666,8 @@ sub getToolbar {
|
|||
var contextMenu = new contextMenu_create("'.$self->getIcon(1).'","'.$self->getId.'","'.$self->getName.'");
|
||||
contextMenu.addLink("'.$self->getUrl("func=promote").'","Promote");
|
||||
contextMenu.addLink("'.$self->getUrl("func=demote").'","Demote");
|
||||
contextMenu.addLink("'.$self->getUrl("func=createShortcut").'","Create Shortcut");
|
||||
contextMenu.addLink("'.$self->getUrl("func=manageAssets").'","Manage");
|
||||
contextMenu.addLink("'.$self->getUrl.'","View");
|
||||
contextMenu.draw();
|
||||
</script>'.$toolbar;
|
||||
}
|
||||
|
|
@ -2510,6 +2509,7 @@ sub www_createShortcut () {
|
|||
templateId=>'PBtmpl0000000000000140'
|
||||
});
|
||||
$child->cut;
|
||||
return $self->getContainer->www_manageAssets if ($session{form}{proceed} eq "manageAssets");
|
||||
return $self->getContainer->www_view;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1195,7 +1195,7 @@ sub HTMLArea {
|
|||
if ($session{user}{richEditor} eq 'none') {
|
||||
return $var{textarea};
|
||||
} else {
|
||||
return WebGUI::Asset::Template->new($session{user}{richEditor})->process(\%var);
|
||||
#return WebGUI::Asset::Template->new($session{user}{richEditor})->process(\%var);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,11 @@ sub process {
|
|||
} else {
|
||||
$var{'printable.text'} = WebGUI::International::get(53,'Macro_r_printable');
|
||||
}
|
||||
$temp = WebGUI::Asset::Template->newByUrl($param[2] || "default_make_printable")->process(\%var);
|
||||
if ($param[2]) {
|
||||
$temp = WebGUI::Asset::Template->newByUrl($param[2])->process(\%var);
|
||||
} else {
|
||||
$temp = WebGUI::Asset::Template->new("PBtmpl0000000000000045")->process(\%var);
|
||||
}
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ sub www_auth {
|
|||
my $auth;
|
||||
($auth) = WebGUI::SQL->quickArray("select authMethod from users where username=".quote($session{form}{username})) if($session{form}{username});
|
||||
my $authMethod = getInstance($auth);
|
||||
my $methodCall = $session{form}{method} || $_[0] || "init";
|
||||
my $methodCall = shift || $session{form}{method} || "init";
|
||||
if(!$authMethod->isCallable($methodCall)){
|
||||
WebGUI::ErrorHandler::security("access uncallable auth method on page '".$session{page}{title}."' [".$session{page}{pageId}."].");
|
||||
return WebGUI::International::get(1077);
|
||||
|
|
|
|||
|
|
@ -175,9 +175,9 @@ this.remove = function() {
|
|||
//adds http, the hostname, and a trailing parameter delimiter to the url
|
||||
this.getWrappedURL = function() {
|
||||
if (this.url.indexOf("?") == -1) {
|
||||
return "http://" + AssetManager_getManager().tools.getHostName(location.href) + this.url + "?";
|
||||
return this.url + "?";
|
||||
}else {
|
||||
return "http://" + AssetManager_getManager().tools.getHostName(location.href) + this.url + "&";
|
||||
return this.url + "&";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ function AssetManager(assetArrayData,headerArrayData,labels,crumbtrail) {
|
|||
this.keys[3] = "lastUpdate";
|
||||
this.keys[4] = "size";
|
||||
|
||||
this.assetType = "Asset";
|
||||
this.assetType ="Asset";
|
||||
this.sortEnabled = true;
|
||||
this.displayCrumbTrail = true;
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ function AssetManager_buildCrumbTrail() {
|
|||
|
||||
//returns an asset based on a div object
|
||||
function AssetManager_getAsset(obj) {
|
||||
while (obj.tagName!=this.display.topLevelElement && !obj.asset) {
|
||||
while (obj.tagName!=this.display.topLevelElement && obj.tagName != "HTML" && !obj.asset) {
|
||||
obj=this.display.dom? obj.parentNode : obj.parentElement
|
||||
}
|
||||
return obj.asset;
|
||||
|
|
@ -225,7 +225,8 @@ function AssetManager_getAsset(obj) {
|
|||
|
||||
//displays the right click context menu
|
||||
function AssetManager_displayContextMenu(x,y,asset) {
|
||||
manager.contextMenu.render(asset.getContextMenu(),x,y,asset);
|
||||
manager.display.dragStop();
|
||||
manager.contextMenu.render(asset.getContextMenu(),x,y,asset);
|
||||
}
|
||||
|
||||
//returns the asset IDS of all selected assets
|
||||
|
|
@ -294,4 +295,4 @@ function AssetManager_sortGrid(columnIndex) {
|
|||
tableBody.appendChild(rowArray[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -34,10 +34,29 @@ function Display() {
|
|||
this.selectAsset = Display_selectAsset;
|
||||
this.isSelected = Display_isSelected;
|
||||
this.clearSelectedAssets = Display_clearSelectedAssets;
|
||||
//used for the 3 second left mouse button menu - like a mac
|
||||
this.leftClickContextMenuPrimed= false;
|
||||
this.primeLeftClickContextMenu = Display_primeLeftClickContextMenu;
|
||||
this.resetLeftClickContextMenu = Display_resetLeftClickContextMenu;
|
||||
this.displayLeftClickContextMenu = Display_displayLeftClickContextMenu;
|
||||
}
|
||||
|
||||
//---------Method Implementations -------------
|
||||
|
||||
function Display_primeLeftClickContextMenu() {
|
||||
this.leftClickContextMenuPrimed = true;
|
||||
}
|
||||
|
||||
function Display_resetLeftClickContextMenu() {
|
||||
this.leftClickContextMenuPrimed = false;
|
||||
}
|
||||
|
||||
function Display_displayLeftClickContextMenu(x,y) {
|
||||
if (this.leftClickContextMenuPrimed) {
|
||||
manager.displayContextMenu(x,y,this.focusObjects[0]);
|
||||
}
|
||||
}
|
||||
|
||||
//changes the z index of obj to be greater than all other elements
|
||||
function Display_bringToFront(obj) {
|
||||
this.lastZIndex++;
|
||||
|
|
|
|||
|
|
@ -1,121 +1,132 @@
|
|||
|
||||
//--------Constructor--------------------
|
||||
|
||||
function EventManager() {
|
||||
//int document events
|
||||
document.onmousedown=EventManager_documentMouseDown;
|
||||
document.onmouseup=EventManager_documentMouseUp;
|
||||
document.onmousemove=EventManager_documentMouseMove;
|
||||
|
||||
document.onkeydown=EventManager_keyDown;
|
||||
document.onkeyup=EventManager_keyUp;
|
||||
|
||||
this.gridHeaderClick = EventManager_gridHeaderClick;
|
||||
this.gridHeaderMouseOver = EventManager_gridHeaderMouseOver;
|
||||
this.gridHeaderMouseOut = EventManager_gridHeaderMouseOut;
|
||||
|
||||
}
|
||||
|
||||
//---------Method Implementations -------------
|
||||
|
||||
function EventManager_gridHeaderMouseOver(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
|
||||
if (!manager.display.dragEnabled) {
|
||||
var obj =dom? e.target : e.srcElement
|
||||
var parts = obj.className.split("-");
|
||||
obj.className="am-grid-header-over-" + parts[parts.length -1];
|
||||
}
|
||||
}
|
||||
|
||||
function EventManager_gridHeaderMouseOut(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
var obj =dom? e.target : e.srcElement
|
||||
|
||||
var parts = obj.className.split("-");
|
||||
|
||||
obj.className="am-grid-header-" + parts[parts.length -1];
|
||||
|
||||
}
|
||||
|
||||
function EventManager_keyDown(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
manager.display.keyDown(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
function EventManager_keyUp(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
manager.display.keyUp(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function EventManager_documentMouseDown(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
obj =dom? e.target : e.srcElement
|
||||
|
||||
var asset = manager.getAsset(obj);
|
||||
|
||||
if (asset) {
|
||||
|
||||
if (e.button != 2 || (e.button == 2 && !manager.display.isSelected(asset))) {
|
||||
manager.display.selectAsset(asset);
|
||||
}
|
||||
if (e.button != 2) {
|
||||
manager.display.dragStart(asset.div,e.clientX,e.clientY);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.button != 2) {
|
||||
manager.display.dragStart(obj,e.clientX,e.clientY);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function EventManager_documentMouseUp(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
obj =dom? e.target : e.srcElement
|
||||
var asset = manager.getAsset(obj);
|
||||
|
||||
if (asset && e.button == 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (manager.display.contextMenu.owner && (!asset || asset.assetId != manager.display.contextMenu.owner.assetId)) {
|
||||
manager.display.contextMenu.hide();
|
||||
}else {
|
||||
}
|
||||
|
||||
if (!asset && obj.id.indexOf("contextMenuItem") == -1) {
|
||||
manager.display.clearSelectedAssets();
|
||||
}
|
||||
|
||||
manager.display.dragStop();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function EventManager_documentMouseMove(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
manager.display.move(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
function EventManager_gridHeaderClick(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
var e=dom? e : event;
|
||||
var obj =dom? e.target : e.srcElement
|
||||
|
||||
var parts = obj.id.split(".");
|
||||
AssetManager_getManager().sortGrid(parts[parts.length-1]);
|
||||
}
|
||||
|
||||
//--------Constructor--------------------
|
||||
|
||||
function EventManager() {
|
||||
//int document events
|
||||
document.onmousedown=EventManager_documentMouseDown;
|
||||
document.onmouseup=EventManager_documentMouseUp;
|
||||
document.onmousemove=EventManager_documentMouseMove;
|
||||
|
||||
document.onkeydown=EventManager_keyDown;
|
||||
document.onkeyup=EventManager_keyUp;
|
||||
|
||||
this.gridHeaderClick = EventManager_gridHeaderClick;
|
||||
this.gridHeaderMouseOver = EventManager_gridHeaderMouseOver;
|
||||
this.gridHeaderMouseOut = EventManager_gridHeaderMouseOut;
|
||||
|
||||
}
|
||||
|
||||
//---------Method Implementations -------------
|
||||
|
||||
function EventManager_gridHeaderMouseOver(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
|
||||
if (!manager.display.dragEnabled) {
|
||||
var obj =dom? e.target : e.srcElement
|
||||
var parts = obj.className.split("-");
|
||||
obj.className="am-grid-header-over-" + parts[parts.length -1];
|
||||
}
|
||||
}
|
||||
|
||||
function EventManager_gridHeaderMouseOut(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
var obj =dom? e.target : e.srcElement
|
||||
|
||||
var parts = obj.className.split("-");
|
||||
|
||||
obj.className="am-grid-header-" + parts[parts.length -1];
|
||||
|
||||
}
|
||||
|
||||
function EventManager_keyDown(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
manager.display.keyDown(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
function EventManager_keyUp(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
manager.display.keyUp(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function EventManager_documentMouseDown(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
obj =dom? e.target : e.srcElement
|
||||
|
||||
var asset = manager.getAsset(obj);
|
||||
|
||||
if (asset) {
|
||||
|
||||
if (e.button != 2) {
|
||||
manager.display.primeLeftClickContextMenu();
|
||||
setTimeout("AssetManager_getManager().display.displayLeftClickContextMenu(" + e.clientX + "," + e.clientY + ")",1000);
|
||||
}
|
||||
if (e.button != 2 || (e.button == 2 && !manager.display.isSelected(asset))) {
|
||||
manager.display.selectAsset(asset);
|
||||
}
|
||||
if (e.button != 2) {
|
||||
manager.display.dragStart(asset.div,e.clientX,e.clientY);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.button != 2) {
|
||||
manager.display.dragStart(obj,e.clientX,e.clientY);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function EventManager_documentMouseUp(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
obj =dom? e.target : e.srcElement
|
||||
var asset = manager.getAsset(obj);
|
||||
|
||||
if ((asset && e.button == 2) || (manager.display.leftClickContextMenuPrimed && manager.contextMenu.owner == manager.display.focusObjects[0])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//no longer want the left click context menu
|
||||
manager.display.resetLeftClickContextMenu();
|
||||
manager.display.contextMenu.hide();
|
||||
|
||||
if (manager.display.contextMenu.owner && (!asset || asset.assetId != manager.display.contextMenu.owner.assetId)) {
|
||||
manager.display.contextMenu.hide();
|
||||
}else {
|
||||
}
|
||||
|
||||
if (!asset && obj.id.indexOf("contextMenuItem") == -1) {
|
||||
manager.display.clearSelectedAssets();
|
||||
}
|
||||
|
||||
manager.display.dragStop();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function EventManager_documentMouseMove(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
e=dom? e : event;
|
||||
|
||||
//no longer want the left click context menu
|
||||
manager.display.resetLeftClickContextMenu();
|
||||
|
||||
manager.display.move(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
function EventManager_gridHeaderClick(e) {
|
||||
var dom = document.getElementById&&!document.all;
|
||||
var e=dom? e : event;
|
||||
var obj =dom? e.target : e.srcElement
|
||||
|
||||
var parts = obj.id.split(".");
|
||||
AssetManager_getManager().sortGrid(parts[parts.length-1]);
|
||||
}
|
||||
|
|
|
|||
32
www/extras/assetManager/ManageAssets.js
Normal file
32
www/extras/assetManager/ManageAssets.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
//--------Constructor--------------------
|
||||
|
||||
//Creates a new asset object.
|
||||
function ManageAssets() {
|
||||
var asset = new Asset();
|
||||
|
||||
asset.getContextMenu = function () {
|
||||
var arr = new Array();
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["go"],"javascript:" + this.evalReference() + ".go()");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["view"],"javascript:" + this.evalReference() + ".view()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["edit"],"javascript:" + this.evalReference() + ".edit()");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["editTree"],"javascript:" + this.evalReference() + ".editBranch()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["cut"],"javascript:" + this.evalReference() + ".cut()");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["copy"],"javascript:" + this.evalReference() + ".copy()");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["shortcut"],"javascript:" + this.evalReference() + ".shortcut()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["delete"],"javascript:" + this.evalReference() + ".remove()");
|
||||
return arr;
|
||||
}
|
||||
|
||||
|
||||
asset.shortcut = function() {
|
||||
location.href = this.getWrappedURL() + "func=createShortcut&proceed=manageAssets";
|
||||
}
|
||||
|
||||
return asset;
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue