Lots more Dashboard features/changes.

Internationalization and Help to come.
Default dashlet demos/walkthroughs to come.
This commit is contained in:
Matthew Wilson 2005-12-01 15:46:04 +00:00
parent 440ca63333
commit 09bf2b263f
12 changed files with 369 additions and 281 deletions

View file

@ -205,23 +205,32 @@ $template = <<STOP;
<style type="text/css"> \@import "^Extras;wobject/Dashboard/draggable.css"; </style>
<style type="text/css"> \@import "^Extras;wobject/Dashboard/dashboard.css"; </style>
<script src="^Extras;wobject/Dashboard/draggable.js" type="text/javascript"></script>
<!--[if IE]>
<style type="text/css">
div.dragTitle
{
overflow-x:hidden;
}
</style>
<![endif]-->
<div id="dashboardContainer">
<a name="id<tmpl_var assetId>" id="id<tmpl_var assetId>">
</a>
<table id="dashboardChooserContainer" width="100%" border="0">
<tr>
<td>
<td id="leftBox">
<div style="display:none;cursor: hand;" id="hideNewContentButton" onclick="makeInactive(this);makeInactive(document.getElementById('availableBox'));makeActive(document.getElementById('showNewContentButton'));">Hide New Content List</div>
<div id="availableBox"><div id="availableBox2">
<div id="availableDashlets">
<table cellpadding="0" cellspacing="0" border="0" id="position1" class="dashboardColumn">
<tbody class="availableDashlet">
<tmpl_loop position1_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle"><tmpl_var dashletTitle></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><a href="#"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a><a href="#" onclick="dragable_deleteContent(event,this);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><br /></span></div></div>
<div class="content"><tmpl_var content></div></div></td></tr></tmpl_loop>
<tmpl_loop position1_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle" id="hdrtd<tmpl_var id>_span"><tmpl_var dashletTitle></span></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><tmpl_if canEditUserPrefs><a onclick="dashboard_toggleEditForm(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a></tmpl_if><a onclick="dragable_deleteContent(event,this<tmpl_if canPersonalize>,'true'</tmpl_if>);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><br /></span></div></div>
<div class="content" id="ct<tmpl_var id>_div"><tmpl_var content></div></div></td></tr></tmpl_loop>
</tbody></table>
</div></div></div>
</td>
<td>
<td id="rightBox">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td style="width:80px;"> <div id="showNewContentButton" onclick="makeInactive(this);makeActive(document.getElementById('availableBox'));makeActive(document.getElementById('hideNewContentButton'));">Add New Content</div></td><td>
<tmpl_if showAdmin>
@ -244,9 +253,9 @@ $template = <<STOP;
</p>
</tmpl_if>
</td><td valign="top" class="login">^L("17","","PBtmpl0000000000000092"); ^AdminToggle(Modify the Default User's Perspective,Leave Default User Perspective (Admin Mode));</td></tr></table>
<script language="javascript" src="^Extras;js/at/AjaxRequest.js"></script>
<script language="javascript">
function submitForm(theform,idToReplace) {
<script type="text/javascript" src="^Extras;js/at/AjaxRequest.js"></script>
<script type="text/javascript">
function submitForm(theform,idToReplace,shortcutUrl) {
var status = AjaxRequest.submit(
theform
@ -254,8 +263,22 @@ theform
'parameters':{
},
'onSuccess':function(req){
var myArray = req.responseText.split(/div/mg,1);
document.getElementById(idToReplace).innerHTML = myArray[0];
var myArray = req.responseText.split(/beginDebug/mg,1);
document.getElementById("ct" + idToReplace + "_div").innerHTML = myArray[0];
var existingForm = document.getElementById("form" + idToReplace + "_div");
throwAway = existingForm.parentNode.removeChild(existingForm);
var hoopla = AjaxRequest.get(
{
'url':shortcutUrl
,'parameters':{
'func':"getNewTitle"
}
,'onSuccess':function(req){
var myArr557 = req.responseText.split(/beginDebug/mg,1);
document.getElementById("hdrtd" + idToReplace + "_span").innerHTML = myArr557[0];
}
}
);
}
}
);
@ -272,27 +295,27 @@ function AjaxRequestEnd() { }
<td width="33%">
<table cellpadding="0" cellspacing="0" border="0" id="position2" class="dashboardColumn" width="100%">
<tbody>
<tmpl_loop position2_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle"><tmpl_var dashletTitle></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><a href="#"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a><a href="#" onclick="dragable_deleteContent(event,this);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><br /></span></div></div>
<div class="content"><tmpl_var content></div></div></td></tr></tmpl_loop>
<tmpl_loop position2_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle" id="hdrtd<tmpl_var id>_span"><tmpl_var dashletTitle></span></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><tmpl_if canEditUserPrefs><a onclick="dashboard_toggleEditForm(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a></tmpl_if><a onclick="dragable_deleteContent(event,this<tmpl_if canPersonalize>,'true'</tmpl_if>);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><br /></span></div></div>
<div class="content" id="ct<tmpl_var id>_div"><tmpl_var content></div></div></td></tr></tmpl_loop>
</tbody>
</table>
</td>
<td width="2px" bgcolor="gray">
<td width="2px" bgcolor="gray" height="500px">
</td>
<td width="33%">
<table cellpadding="0" cellspacing="0" border="0" id="position3" class="dashboardColumn" width="100%">
<tbody>
<tmpl_loop position3_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle"><tmpl_var dashletTitle></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><a href="#"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a><a href="#" onclick="dragable_deleteContent(event,this);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><br /></span></div></div>
<div class="content"><tmpl_var content></div></div></td></tr></tmpl_loop>
<tmpl_loop position3_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle"><span class="headerTitle" id="hdrtd<tmpl_var id>_span"><tmpl_var dashletTitle></span></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><tmpl_if canEditUserPrefs><a onclick="dashboard_toggleEditForm(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a></tmpl_if><a onclick="dragable_deleteContent(event,this<tmpl_if canPersonalize>,'true'</tmpl_if>);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><br /></span></div></div>
<div class="content" id="ct<tmpl_var id>_div"><tmpl_var content></div></div></td></tr></tmpl_loop>
</tbody>
</table>
</td>
<td width="2px" bgcolor="gray"></td>
<td width="2px" bgcolor="gray" height="500px"></td>
<td width="33%">
<table cellpadding="0" cellspacing="0" border="0" id="position4" class="dashboardColumn" width="100%">
<tbody>
<tmpl_loop position4_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle"><tmpl_var dashletTitle></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><a href="#"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a><a href="#" onclick="dragable_deleteContent(event,this);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><br /></span></div></div>
<div class="content"><tmpl_var content></div></div></td></tr></tmpl_loop>
<tmpl_loop position4_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle"><span class="headerTitle" id="hdrtd<tmpl_var id>_span"><tmpl_var dashletTitle></span></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><tmpl_if canEditUserPrefs><a onclick="dashboard_toggleEditForm(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a></tmpl_if><a onclick="dragable_deleteContent(event,this<tmpl_if canPersonalize>,'true'</tmpl_if>);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><br /></span></div></div>
<div class="content" id="ct<tmpl_var id>_div"><tmpl_var content></div></div></td></tr></tmpl_loop>
</tbody>
</table>
</td>
@ -302,6 +325,7 @@ function AjaxRequestEnd() { }
<table class="blankTable"><tr id="blank" class="hidden"><td class="blankColumn"><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</td></tr></table></div>
STOP
$newAsset = $folder->addChild({
title=>"Dashboard Default View",
@ -327,7 +351,7 @@ $template = <<STOP;
<tmpl_var description><p />
</tmpl_if>
<tmpl_loop locations.loop>
<tmpl_loop ourLocations.loop>
<table border="0" width="100%">
<tr>
<td rowspan="3" width="55"><img src="<tmpl_var iconUrl>" /></td>

View file

@ -52,13 +52,13 @@ sub handler {
}
my $uploads = $session{config}{uploadsURL};
if ($session{wguri} =~ m/^$uploads/) {
$r->handler('perl-script');
# $r->handler('perl-script');
$r->set_handlers(PerlAccessHandler => \&uploadsHandler);
} else {
$session{requestedUrl} = $session{wguri};
my $gateway = $session{config}{gateway};
$session{requestedUrl} =~ s/^$gateway(.*)$/$1/;
$r->handler('perl-script');
# $r->handler('perl-script');
$r->set_handlers(PerlResponseHandler => \&contentHandler);
$r->set_handlers(PerlTransHandler => sub { return Apache2::Const::OK });
}
@ -153,6 +153,7 @@ sub page {
}
}
$output = tryAssetMethod($asset,$method);
$output = tryAssetMethod($asset,"view") unless ($method eq "view" || $output);
}
}
if ($output eq "") {

View file

@ -74,7 +74,7 @@ sub definition {
# overrideForm=>{fieldType=>'yesNo',defaultValue=>0},
# overrideValue=>{fieldType=>'yesNo',defaultValue=>0},
possibleValues=>{fieldType=>'textarea',defaultValue=>'',label=>'Possible values for this Field. Only applies to selectList and checkList.'},
defaultValue=>{fieldType=>'text',defaultValue=>'',label=>'Default Value for this field.'}
defaultValue=>{fieldType=>'textarea',defaultValue=>'',label=>'Default Value for this field.'}
);
push(@{$definition}, {
@ -170,13 +170,19 @@ sub getUserPref {
my $returnDataType = shift || 'string';
my $returnDataFormat = shift || 'raw';
my $sql = "select userValue from wgFieldUserData where assetId=".quote($fieldId)." and userId=".quote($userId);
WebGUI::ErrorHandler::warn($sql);
# WebGUI::ErrorHandler::warn($sql);
my ($userValue) = WebGUI::SQL->quickArray($sql);
unless ($userValue) {
return '' if $fieldId eq 'skipThisRequest';
$field = WebGUI::Asset->newByDynamicClass($fieldId) unless $field;
return '' unless $field;
$userValue = $field->get("defaultValue");
if ($userId eq '1') {
$userValue = $field->get("defaultValue");
# fall back to wobject defaults if this is blank.
$userValue = WebGUI::Asset->newByDynamicClass($field->getParent->get("shortcutToAssetId"))->get($field->get("fieldName")) if (ref $field->getParent eq 'WebGUI::Asset::Shortcut' && !($userValue) && !($field->get("isUserPref")));
} else {
$userValue = WebGUI::Asset::Field->getUserPref($fieldId,1);
}
}
if ($returnDataType eq 'string' && $returnDataFormat eq 'raw') {
return $userValue;

View file

@ -375,8 +375,8 @@ sub getFieldsList {
$output .= '<tr>';
$output .= '<td class="tableData"><a href="'.$field->getUrl('func=edit').'">'.$field->get("fieldName").'</a></td>';
$output .= '<td class="tableData">';
$output .= WebGUI::Icon::editIcon($field->getUrl('func=edit'));
$output .= WebGUI::Icon::deleteIcon($field->getUrl('func=delete'));
$output .= editIcon('func=edit',$field->getUrl());
$output .= deleteIcon('func=delete',$field->getUrl());
$output .= '</td>';
$output .= '</tr>';
}
@ -607,9 +607,9 @@ sub www_edit {
sub www_getUserPrefsForm {
#This is a form retrieved by "ajax".
my $self = shift;
return '' unless $self->getParent->canPersonalize;
return 'nuhuh' unless $self->getParent->canPersonalize;
my @fielden = $self->getUserPrefs;
my $f = WebGUI::HTMLForm->new(extras=>' onSubmit="submitForm(this,\''.'form_'.$self->getId.'\');return false;"');
my $f = WebGUI::HTMLForm->new(extras=>' onSubmit="submitForm(this,\''.$self->getId.'\',\''.$self->getUrl.'\');return false;"');
$f->hidden(
-name => 'func',
-value => 'saveUserPrefs'
@ -653,9 +653,18 @@ sub www_saveUserPrefs {
foreach my $fieldId (keys %{$session{form}}) {
my $field = WebGUI::Asset->newByDynamicClass($fieldId);
next unless $field;
return 0 unless $field->setUserPref($fieldId,$session{form}{$fieldId});
$field->setUserPref($fieldId,$session{form}{$fieldId});
}
return 1;
return $self->view;
}
#-------------------------------------------------------------------
sub www_getNewTitle {
my $self = shift;
return '' unless $self->getParent->canPersonalize;
my $foo = $self->getShortcut;
my $title = $foo->{_properties}{title};
return $title;
}
#-------------------------------------------------------------------

View file

@ -179,18 +179,24 @@ sub view {
my $t = [Time::HiRes::gettimeofday()] if ($showPerformance);
my $view = $child->view;
$view .= "Asset:".Time::HiRes::tv_interval($t) if ($showPerformance);
$child->{_properties}{title} = $child->getShortcut->get("title") if ref $child eq 'WebGUI::Asset::Shortcut';
$child->{_properties}{title} = $child->getShortcut->get("title") if (ref $child eq 'WebGUI::Asset::Shortcut');
if ($i > $numPositions) {
push(@{$vars{"position1_loop"}},{
id=>$child->getId,
content=>$view,
dashletTitle=>$child->get("title")
dashletTitle=>$child->get("title"),
shortcutUrl=>$child->getUrl,
canPersonalize=>$self->canPersonalize,
canEditUserPrefs=>(($session{user}{userId} ne '1') && (ref $child eq 'WebGUI::Asset::Shortcut') && (scalar($child->getUserPrefs) > 0))
});
} else {
push(@{$vars{"position".$i."_loop"}},{
id=>$child->getId,
content=>$view,
dashletTitle=>$child->get("title")
dashletTitle=>$child->get("title"),
shortcutUrl=>$child->getUrl,
canPersonalize=>$self->canPersonalize,
canEditUserPrefs=>(($session{user}{userId} ne '1') && (ref $child eq 'WebGUI::Asset::Shortcut') && (scalar($child->getUserPrefs) > 0))
});
}
}
@ -207,10 +213,14 @@ sub view {
my $t = [Time::HiRes::gettimeofday()] if ($showPerformance);
my $view = $child->view;
$view .= "Asset:".Time::HiRes::tv_interval($t) if ($showPerformance);
$child->{_properties}{title} = $child->getShortcut->get("title") if (ref $child eq 'WebGUI::Asset::Shortcut');
push(@{$vars{"position1_loop"}},{
id=>$child->getId,
content=>$view,
dashletTitle=>$child->get("title")
dashletTitle=>$child->get("title"),
shortcutUrl=>$child->getUrl,
canPersonalize=>$self->canPersonalize,
canEditUserPrefs=>(($session{user}{userId} ne '1') && (ref $child eq 'WebGUI::Asset::Shortcut') && (scalar($child->getUserPrefs) > 0))
});
}
}
@ -230,9 +240,9 @@ sub view {
#-------------------------------------------------------------------
sub www_setContentPositions {
my $self = shift;
return 'Visitors cannot save settings' if $session{user}{userId} == 1;
return 'Visitors cannot save settings' if($session{user}{userId} eq '1');
return WebGUI::Privilege::insufficient() unless ($self->canPersonalize);
return '' unless $self->get("mapFieldId");
return 'empty' unless $self->get("mapFieldId");
my $success = WebGUI::Asset::Field->setUserPref($self->get("mapFieldId"),$session{form}{map});
return "Map set: ".$session{form}{map} if $success;
return "Map failed to set.";

View file

@ -132,7 +132,7 @@ if (isIn($currCond,'Ice Pellets','Light Ice Pellets','Heavy Ice Pellets','Ice Pe
if (isIn($currCond,'Freezing Rain Snow','Light Freezing Rain Snow','Heavy Freezing Rain Snow','Freezing Drizzle Snow','Light Freezing Drizzle Snow','Heavy Freezing Drizzle Snow','Snow Freezing Rain| Light Snow Freezing Rain','Heavy Snow Freezing Rain','Snow Freezing Drizzle','Light Snow Freezing Drizzle','Heavy Snow Freezing Drizzle')) {return 'mix';}
if (isIn($currCond,'Rain Ice Pellets','Light Rain Ice Pellets','Heavy Rain Ice Pellets','Drizzle Ice Pellets','Light Drizzle Ice Pellets','Heavy Drizzle Ice Pellets','Ice Pellets Rain','Light Ice Pellets Rain','Heavy Ice Pellets Rain','Ice Pellets Drizzle','Light Ice Pellets Drizzle','Heavy Ice Pellets Drizzle')) {return 'raip';}
if (isIn($currCond,'Rain Snow','Light Rain Snow','Heavy Rain Snow','Snow Rain','Light Snow Rain','Heavy Snow Rain','Drizzle Snow','Light Drizzle Snow','Heavy Drizzle Snow','Snow Drizzle','Light Snow Drizzle','Heavy Snow Drizzle')) {return 'rasn';}
if (isIn($currCond,'Rain Showers','Light Rain Showers','Heavy Rain Showers','Rain Showers in Vicinity','Light Showers Rain','Heavy Showers Rain','Showers Rain','Showers Rain in Vicinity','Rain Showers Fog/Mist','Light Rain Showers Fog/Mist','Heavy Rain Showers Fog/Mist','Rain Showers in Vicinity Fog/Mist','Light Showers Rain Fog/Mist','Heavy Showers Rain Fog/Mist','Showers Rain Fog/Mist','Showers Rain in Vicinity Fog/Mist')) {return 'shra';}
if (isIn($currCond,'Rain Showers','Light Rain Showers','Heavy Rain Showers','Rain Showers in Vicinity','Light Showers Rain','Heavy Showers Rain','Showers Rain','Showers Rain in Vicinity','Rain Showers Fog/Mist','Light Rain Showers Fog/Mist','Heavy Rain Showers Fog/Mist','Rain Showers in Vicinity Fog/Mist','Light Showers Rain Fog/Mist','Heavy Showers Rain Fog/Mist','Showers Rain Fog/Mist','Showers Rain in Vicinity Fog/Mist','Light Rain and Breezy')) {return 'shra';}
if (isIn($currCond,'Thunderstorm','Light Thunderstorm Rain','Heavy Thunderstorm Rain','Thunderstorm Rain Fog/Mist','Light Thunderstorm Rain Fog/Mist','Heavy Thunderstorm Rain Fog/Mist','Thunderstorm Showers in Vicinity','| Light Thunderstorm Rain Haze','Heavy Thunderstorm Rain Haze','Thunderstorm Fog','Light Thunderstorm Rain Fog','Heavy Thunderstorm Rain Fog','Thunderstorm Light Rain','Thunderstorm Heavy Rain','Thunderstorm Rain Fog/Mist','Thunderstorm Light Rain Fog/Mist','Thunderstorm Heavy Rain Fog/Mist','Thunderstorm in Vicinity Fog/Mist','Thunderstorm Showers in Vicinity','Thunderstorm in Vicinity','Thunderstorm in Vicinity Haze','Thunderstorm Haze in Vicinity','Thunderstorm Light Rain Haze','Thunderstorm Heavy Rain Haze','Thunderstorm Fog','Thunderstorm Light Rain Fog','Thunderstorm Heavy Rain Fog','Thunderstorm Hail','Light Thunderstorm Rain Hail','Heavy Thunderstorm Rain Hail','Thunderstorm Rain Hail Fog/Mist','Light Thunderstorm Rain Hail Fog/Mist','Heavy Thunderstorm Rain Hail Fog/Mist','Thunderstorm Showers in Vicinity Hail','| Light Thunderstorm Rain Hail Haze','Heavy Thunderstorm Rain Hail Haze','Thunderstorm Hail Fog','Light Thunderstorm Rain Hail Fog','Heavy Thunderstorm Rain Hail Fog','Thunderstorm Light Rain Hail','Thunderstorm Heavy Rain Hail','Thunderstorm Rain Hail Fog/Mist','Thunderstorm Light Rain Hail Fog/Mist','Thunderstorm Heavy Rain Hail Fog/Mist','Thunderstorm in Vicinity Hail Fog/Mist','Thunderstorm Showers in Vicinity Hail','Thunderstorm in Vicinity Hail','Thunderstorm in Vicinity Hail Haze','Thunderstorm Haze in Vicinity Hail','Thunderstorm Light Rain Hail Haze','Thunderstorm Heavy Rain Hail Haze','Thunderstorm Hail Fog','Thunderstorm Light Rain Hail Fog','Thunderstorm Heavy Rain Hail Fog','Thunderstorm Small Hail/Snow Pellets','Thunderstorm Rain Small Hail/Snow Pellets','Light Thunderstorm Rain Small Hail/Snow Pellets','Heavy Thunderstorm Rain Small Hail/Snow Pellets')) {return 'tsra';}
if (isIn($currCond,'Snow','Light Snow','Heavy Snow','Snow Showers','Light Snow Showers','Heavy Snow Showers','Showers Snow','Light Showers Snow','Heavy Showers Snow','Snow Fog/Mist','Light Snow Fog/Mist','Heavy Snow Fog/Mist','Snow Showers Fog/Mist','Light Snow Showers Fog/Mist','Heavy Snow Showers Fog/Mist','Showers Snow Fog/Mist','Light Showers Snow Fog/Mist','Heavy Showers Snow Fog/Mist','Snow Fog','Light Snow Fog','Heavy Snow Fog','Snow Showers Fog','Light Snow Showers Fog','Heavy Snow Showers Fog','Showers Snow Fog','Light Showers Snow Fog','Heavy Showers Snow Fog','Showers in Vicinity Snow','Snow Showers in Vicinity','Snow Showers in Vicinity Fog/Mist','Snow Showers in Vicinity Fog','Low Drifting Snow','Blowing Snow','Snow Low Drifting Snow','Snow Blowing Snow','Light Snow Low Drifting Snow','Light Snow Blowing Snow','Heavy Snow Low Drifting Snow','Heavy Snow Blowing Snow','Thunderstorm Snow','Light Thunderstorm Snow','Heavy Thunderstorm Snow','Snow Grains','Light Snow Grains','Heavy Snow Grains','Heavy Blowing Snow','Blowing Snow in Vicinity')) {return 'sn';}
if (isIn($currCond,'Windy','Fair and Windy','A Few Clouds and Windy','Partly Cloudy and Windy','Mostly Cloudy and Windy','Overcast and Windy')) {return 'wind';}
@ -198,21 +198,17 @@ sub view {
#Set some template variables
#Build list of locations as an array
my $defaults = $self->getValue("locations");
my $defaults = $self->get("locations");
#replace any windows newlines
$defaults =~ s/\r//;
$defaults =~ s/\r//gm;
my @array = split("\n",$defaults);
#trim locations of whitespace
for (my $i = 0; $i < scalar(@array); $i++) {
$array[$i] = $self->_trim($array[$i]);
}
my $data = $self->_getLocationData(\@array);
my @locs = ();
foreach my $location (@array) {
push (@locs, $self->_getLocationData($location));
for (my $i = 0; $i < scalar(@array); $i++) {
$array[$i] = $self->_trim($array[$i]);\
push (@locs, $self->_getLocationData($array[$i]));
}
$var->{'locations.loop'} = \@locs;
$var->{'ourLocations.loop'} = \@locs;
return $self->processTemplate($var, $self->get("templateId"));
}

View file

@ -315,7 +315,7 @@ Creates an HTML formatted string
sub showDebug {
my $text = $WebGUI::Session::session{debug}{'error'};
$text =~ s/\n/\<br \/\>\n/g;
my $output = '<div style="background-color: #800000;color: #ffffff;">'.$text."</div>\n";
my $output = 'beginDebug<br /><div style="background-color: #800000;color: #ffffff;">'.$text."</div>\n";
$text = $WebGUI::Session::session{debug}{'warn'};
$text =~ s/\n/\<br \/\>\n/g;
$output .= '<div style="background-color: #ffdddd;color: #000000;">'.$text."</div>\n";

View file

@ -607,9 +607,10 @@ The database handler. Defaults to the WebGUI database handler.
=cut
sub quote {
my $value = shift;
my $value = shift;
return "''" unless $value;
my $dbh = shift || _getDefaultDb();
return $dbh->quote($value);
return $dbh->quote($value);
}
#-------------------------------------------------------------------

View file

@ -81,7 +81,7 @@ if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0 && typeof(req.onGrou
req.xmlHttpRequest =null;}};
req.process =
function(){if(req.xmlHttpRequest!=null){if(req.generateUniqueUrl && req.method=="GET"){req.parameters["AjaxRequestUniqueId"] =new Date().getTime() + "" + req.requestIndex;}var content =null;
for(var i in req.parameters){if(req.queryString.length>0){req.queryString +="&";}req.queryString +=encodeURIComponent(i) + "=" + encodeURIComponent(req.parameters[i]);}if(req.method=="GET"){if(req.queryString.length>0){req.url +=((req.url.indexOf("?")>-1)?"&":"?") + req.queryString;}}req.xmlHttpRequest.open(req.method,req.url,req.async,req.username,req.password);
for(var i in req.parameters){if(req.queryString.length>0){req.queryString +=";";}req.queryString +=encodeURIComponent(i) + "=" + encodeURIComponent(req.parameters[i]);}if(req.method=="GET"){if(req.queryString.length>0){req.url +=((req.url.indexOf("?")>-1)?";":"?") + req.queryString;}}req.xmlHttpRequest.open(req.method,req.url,req.async,req.username,req.password);
if(req.method=="POST"){if(typeof(req.xmlHttpRequest.setRequestHeader)!="undefined"){req.xmlHttpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');}content =req.queryString;}if(req.timeout>0){setTimeout(req.onTimeoutInternal,req.timeout);}req.xmlHttpRequest.send(content);}};
req.handleArguments =
function(args){for(var i in args){if(typeof(req[i])=="undefined"){req.parameters[i] =args[i];}else{req[i] =args[i];}}};
@ -111,7 +111,7 @@ AjaxRequest.serializeForm =function(theform){var els =theform.elements;
var len =els.length;
var queryString ="";
this.addField =
function(name,value){if(queryString.length>0){queryString +="&";}queryString +=encodeURIComponent(name) + "=" + encodeURIComponent(value);};
function(name,value){if(queryString.length>0){queryString +=";";}queryString +=encodeURIComponent(name) + "=" + encodeURIComponent(value);};
for(var i=0;i<len;i++){var el =els[i];
if(!el.disabled){switch(el.type){case 'text': case 'password': case 'hidden': case 'textarea':
this.addField(el.name,el.value);

View file

@ -1,224 +1,235 @@
body
{
margin: 0;
margin-top: 0;
padding: 0;
}
table.dashboardColumn
{
width: 100%;
background: none;
background-color:transparent;
}
#dashboardContainer
{
font: 11px Lucida Grande, Verdana, Arial, Helvetica, sans serif;
background-color:white;
}
#dashboardChooserContainer
{
margin:0px;
padding:0px;
border:0px;
}
#position1 {
width:200px;
max-width:200px;
width:expression("200px");
}
#position1 td {
margin-top:40px;
padding:5px;
}
tbody.availableDashlet * div.content {
display: none;
}
#availableDashlets * td {
width:200px;
max-width:200px;
width:expression("200px");
}
#availableDashlets * div.content {
width:200px;
max-width:200px;
width:expression("200px");
height:30px;
display:none;
overflow-x:hidden;
overflow-y:hidden;
}
#columnsContainerDiv
{
margin:6px;
}
td
{
vertical-align: top;
}
h1
{
font: 12px Lucida Grande, Verdana, Arial, Helvetica, sans serif;
font-weight:bold;
margin:0px;
margin-bottom:3px;
}
h2
{
font: 19px Verdana;
margin-bottom:0px;
padding-bottom:0px;
}
ul
{
margin-top:2px;
left:-10px;
position:relative;
}
div.weatherTitle
{
font-weight:bold;
color:white;
}
div.content
{
border-bottom:solid orange 1px;
border-top:solid orange 1px;
border-left:solid orange 1px;
border-right:solid orange 1px;
margin-bottom:10px;
width:auto;
padding:5px;
padding-top:10px;
background: #fff url('content_bg.gif') no-repeat top right;
}
div.content a:link, div.content a:visited
{
color:#F48117;
}
table.tableSearch
{
background-color:#F2F2F2;
border:solid #CCC 1px;
width:100%;
}
table.tableSearch td select
{
margin:0px;
padding:0px;
}
div.dragTitle
{
overflow-x:visible;
background: url('dragable_bg.gif');
width:100%;
z-index:998;
border:solid black 0px;
height:22px;
top:0px;
left:0px;
right:30px;
position:absolute;
}
span.headerTitle
{
display:block;
float:left;
z-index:999;
margin-right:10px;
padding-left:9px;
padding-top:2px;
}
span.options
{
display:block;
position:absolute;
top:0px;
right:-1px;
float:right;
z-index:1000;
padding-right:35px;
background: transparent url('dragtitle_bg.gif') no-repeat top right;
}
span.options img {
opacity:0;
filter:alpha(opacity=0);
}
span.options:hover img {
opacity:100;
}
span.optionsHoverIE img {
filter:alpha(opacity=100);
}
div#availableDashlets * span.options:hover {
opacity:0;
filter:alpha(opacity=0);
}
div#availableDashlets * span.options {
display:none;
opacity:0;
top:50px;
filter:alpha(opacity=0);
}
div#availableDashlets * div.dragTrigger {
background: none;
}
#hideNewContentButton,#showNewContentButton {
/* position:absolute;*/
color: #465D94;
font-size: 1.2em;
font-weight: 600;
top: 20px;
cursor: pointer; cursor: hand;
left: 20px;
width:200px;
}
#availableBox {
display:none;
}
#availableBox2 {
padding-top:40px;
border:solid navy 2px;
height: 600px;
width:200px;
max-width:200px;
width:expression("200px");
}
#availableDashlets {
width:200px;
max-width:200px;
width:expression("200px");
}
.availableDashlet
{
width:200px;
max-width:200px;
width:expression("200px");
}
#availableDashlets tbody {
height: 0px;
body
{
margin: 0;
margin-top: 0;
padding: 0;
}
table.dashboardColumn
{
width: 100%;
background: none;
background-color:transparent;
}
.dashboardColumn td {
width:100%;
}
#dashboardContainer
{
font: 11px Lucida Grande, Verdana, Arial, Helvetica, sans serif;
background-color:white;
}
#dashboardChooserContainer
{
margin:0px;
padding:0px;
border:0px;
width:100%;
}
#position1 {
width:200px;
max-width:200px;
width:expression("200px");
}
#position1 td {
margin-top:40px;
padding:5px;
}
tbody.availableDashlet * div.content {
display: none;
}
#availableDashlets * td {
width:200px;
max-width:200px;
}
#availableDashlets * div.content {
width:200px;
max-width:200px;
height:30px;
display:none;
overflow-x:hidden;
overflow-y:hidden;
}
#columnsContainerDiv
{
margin:6px;
}
td
{
vertical-align: top;
}
h1
{
font: 12px Lucida Grande, Verdana, Arial, Helvetica, sans serif;
font-weight:bold;
margin:0px;
margin-bottom:3px;
}
h2
{
font: 19px Verdana;
margin-bottom:0px;
padding-bottom:0px;
}
ul
{
margin-top:2px;
left:-10px;
position:relative;
}
div.weatherTitle
{
font-weight:bold;
color:white;
}
div.content
{
overflow-x:hidden;
border-bottom:solid orange 1px;
border-top:solid orange 1px;
border-left:solid orange 1px;
border-right:solid orange 1px;
margin-bottom:10px;
padding:5px;
padding-top:10px;
background: #fff url('content_bg.gif') no-repeat top right;
}
div.content a:link, div.content a:visited
{
color:#F48117;
}
table.tableSearch
{
background-color:#F2F2F2;
border:solid #CCC 1px;
width:100%;
}
table.tableSearch td select
{
margin:0px;
padding:0px;
}
div.dragTitle
{
overflow-x:visible;
background: url('dragable_bg.gif');
width:100%;
z-index:998;
border:solid black 0px;
height:22px;
top:0px;
left:0px;
right:30px;
position:absolute;
}
span.headerTitle
{
overflow-x:visible;
display:block;
float:left;
z-index:999;
margin-right:10px;
padding-left:9px;
padding-top:2px;
}
span.options
{
display:block;
position:absolute;
top:0px;
right:-1px;
float:right;
z-index:1000;
padding-right:35px;
background: transparent url('dragtitle_bg.gif') no-repeat top right;
}
span.options img {
opacity:0;
filter:alpha(opacity=0);
}
span.options:hover img {
opacity:100;
}
span.optionsHoverIE img {
filter:alpha(opacity=100);
}
div#availableDashlets * span.options:hover {
opacity:0;
filter:alpha(opacity=0);
}
div#availableDashlets * span.options {
display:none;
opacity:0;
top:50px;
filter:alpha(opacity=0);
}
div#availableDashlets * div.dragTrigger {
background: none;
}
#hideNewContentButton,#showNewContentButton {
/* position:absolute;*/
color: #465D94;
font-size: 1.2em;
font-weight: 600;
top: 20px;
cursor: pointer; cursor: hand;
left: 20px;
width:200px;
}
#availableBox {
display:none;
/* width:200px;
max-width:200px;
width:expression("200px");*/
}
#availableBox2 {
padding-top:40px;
border:solid navy 2px;
height: 600px;
/* width:200px;
max-width:200px;
width:expression("200px");*/
}
#availableDashlets {
/* width:200px;
max-width:200px;
width:expression("200px");*/
}
.availableDashlet
{
/* width:200px;
max-width:200px;
width:expression("200px");*/
}
#availableDashlets tbody {
height: 0px;
}
#leftBox {
width:210px;
}
#rightBox {
width:100%;
}

View file

@ -6,6 +6,7 @@ div.dragable:hover
.dragable
{
position: relative;
/*width:100%;*/
border: 1px solid #fff;
}
@ -25,13 +26,14 @@ div.dragTrigger
div.dragging
{
overflow-x:visible;
position: relative;
width: auto;
filter:alpha(opacity=60);
opacity:.60;
cursor: pointer; cursor: hand;
z-index: 2000;
border: 1px dotted #cccccc;
/* border: 1px dotted #cccccc; */
}
div.dragging div.content
@ -74,7 +76,7 @@ div.dragging div.content
{
position: relative;
cursor: pointer; cursor: hand;
background-color: #eeeeee;
background-color: #dddddd;
}
.empty
@ -83,7 +85,7 @@ div.dragging div.content
padding: 0px;
margin: 3px;
width: 100%;
height: 250px;
height: 50px;
}
.blankTable {

View file

@ -124,7 +124,7 @@ function dragable_init(url) {
//window.scroll(10,500);
//set up event handlers
document.onmouseup=dragable_dragStop;
document.onkeydown=dragable_checkKeyEvent;
// document.onkeydown=dragable_checkKeyEvent;
document.onmousemove=dragable_move;
//fill the draggableObject list
@ -216,7 +216,8 @@ function dragable_dragStart(e){
//set the start td
startTD=document.getElementById(fObj.id.substr(0,fObj.id.indexOf("_div")));
// alert("hdr" + fObj.id.substr(0,fObj.id.indexOf("_div")) + "_span");
document.getElementById("hdr" + fObj.id.substr(0,fObj.id.indexOf("_div")) + "_span").style.overflowX="visible";
fObj.className="dragging";
// fObj.style.opacity = '0.6';
// fObj.style.filter = 'alpha(opacity=' + 60 + ')';
@ -403,13 +404,13 @@ function dragable_appendBlankRow(parent) {
// deletes a dashlet (moves it from its current location to the bottom of position 1)
function dragable_deleteContent(e,from) {
function dragable_deleteContent(e,from,postNewContentMap) {
from = dragable_getObjectByClass(from,"dragable");
from = document.getElementById(from.id.substr(0,from.id.indexOf("_div")));
dragable_moveContent(from,document.getElementById('position1').rows[document.getElementById('position1').rows.length - 1],"bottom");
// e.preventDefault();
// e.stopPropagation();
dragable_postNewContentMap();
if (postNewContentMap) {dragable_postNewContentMap();} // This will help avoid meaningless web server hits.
}
//moves a table row from one table to another. from and to are table row objects
@ -478,3 +479,30 @@ function dragable_getContentMap() {
return contentMap;
}
function dashboard_toggleEditForm(event,shortcutId,shortcutUrl) {
//discover if form is there.
var existingForm = document.getElementById("form" + shortcutId + "_div");
if (existingForm) {
var throwAway = existingForm.parentNode.removeChild(existingForm);
return;
}
// Create the new form element.
formDiv = document.createElement("div");
formDiv.id = "form" + shortcutId + "_div";
formDiv.className = "userPrefsForm";
parentDiv = document.getElementById("td" + shortcutId + "_div");
contentDiv = document.getElementById("ct" + shortcutId + "_div");
parentDiv.insertBefore(formDiv,contentDiv);
var hooha = AjaxRequest.get(
{
'url':shortcutUrl
,'parameters':{
'func':"getUserPrefsForm"
}
,'onSuccess':function(req){
var myArr558 = req.responseText.split(/beginDebug/mg,1);
formDiv.innerHTML = myArr558[0];
}
}
);
}