Merge pull request #765 from CharlieMarshall/rss

fix / make RSS widget textarea full width & remove whitespaces
This commit is contained in:
Renato Botelho 2013-08-05 16:07:26 -07:00
commit 4455188278
10 changed files with 99 additions and 18 deletions

View File

@ -1197,3 +1197,12 @@ div#log span.log-protocol-mini-header {
.thermal_sensors_widget_scale100 { position: absolute; height: 9px; width: 1px; left: 100%; margin-top: -6px; background-color: lightgray; z-index: 0; font-size: 0; }
.thermal_sensors_widget_mark100 { position: absolute; width: 15px; left: 96%; margin-top: -12px; font: 6pt Arial, sans-serif; text-align: left; color: #575757; }
/* widget textarea styles - full width */
.textarea_widget {
width: 100%;
resize:vertical;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* IE 8+ */
}

View File

@ -1291,3 +1291,12 @@ table.sortable thead {
.thermal_sensors_widget_scale100 { position: absolute; height: 9px; width: 1px; left: 100%; margin-top: -6px; background-color: lightgray; z-index: 0; font-size: 0; }
.thermal_sensors_widget_mark100 { position: absolute; width: 15px; left: 96%; margin-top: -12px; font: 6pt Arial, sans-serif; text-align: left; color: #575757; }
/* widget textarea styles - full width */
.textarea_widget {
width: 100%;
resize:vertical;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* IE 8+ */
}

View File

@ -1261,3 +1261,12 @@ table.sortable thead {
.thermal_sensors_widget_scale100 { position: absolute; height: 9px; width: 1px; left: 100%; margin-top: -6px; background-color: lightgray; z-index: 0; font-size: 0; }
.thermal_sensors_widget_mark100 { position: absolute; width: 15px; left: 96%; margin-top: -12px; font: 6pt Arial, sans-serif; text-align: left; color: #575757; }
/* widget textarea styles - full width */
.textarea_widget {
width: 100%;
resize:vertical;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* IE 8+ */
}

View File

@ -1292,3 +1292,12 @@ table.sortable thead {
.thermal_sensors_widget_scale100 { position: absolute; height: 9px; width: 1px; left: 100%; margin-top: -6px; background-color: lightgray; z-index: 0; font-size: 0; }
.thermal_sensors_widget_mark100 { position: absolute; width: 15px; left: 96%; margin-top: -12px; font: 6pt Arial, sans-serif; text-align: left; color: #575757; }
/* widget textarea styles - full width */
.textarea_widget {
width: 100%;
resize:vertical;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* IE 8+ */
}

View File

@ -1015,3 +1015,12 @@ table.sortable thead {
.thermal_sensors_widget_scale100 { position: absolute; height: 9px; width: 1px; left: 100%; margin-top: -6px; background-color: lightgray; z-index: 0; font-size: 0; }
.thermal_sensors_widget_mark100 { position: absolute; width: 15px; left: 96%; margin-top: -12px; font: 6pt Arial, sans-serif; text-align: left; color: #575757; }
/* widget textarea styles - full width */
.textarea_widget {
width: 100%;
resize:vertical;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* IE 8+ */
}

View File

@ -1024,3 +1024,12 @@ table.sortable thead {
.thermal_sensors_widget_scale100 { position: absolute; height: 9px; width: 1px; left: 100%; margin-top: -6px; background-color: lightgray; z-index: 0; font-size: 0; }
.thermal_sensors_widget_mark100 { position: absolute; width: 15px; left: 96%; margin-top: -12px; font: 6pt Arial, sans-serif; text-align: left; color: #575757; }
/* widget textarea styles - full width */
.textarea_widget {
width: 100%;
resize:vertical;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* IE 8+ */
}

View File

@ -1403,3 +1403,12 @@ table.sortable thead {
.thermal_sensors_widget_scale100 { position: absolute; height: 9px; width: 1px; left: 100%; margin-top: -6px; background-color: lightgray; z-index: 0; font-size: 0; }
.thermal_sensors_widget_mark100 { position: absolute; width: 15px; left: 96%; margin-top: -12px; font: 6pt Arial, sans-serif; text-align: left; color: #575757; }
/* widget textarea styles - full width */
.textarea_widget {
width: 100%;
resize:vertical;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* IE 8+ */
}

View File

@ -1364,3 +1364,12 @@ table.sortable thead {
.thermal_sensors_widget_scale100 { position: absolute; height: 9px; width: 1px; left: 100%; margin-top: -6px; background-color: lightgray; z-index: 0; font-size: 0; }
.thermal_sensors_widget_mark100 { position: absolute; width: 15px; left: 96%; margin-top: -12px; font: 6pt Arial, sans-serif; text-align: left; color: #575757; }
/* widget textarea styles - full width */
.textarea_widget {
width: 100%;
resize:vertical;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* IE 8+ */
}

View File

@ -1300,3 +1300,12 @@ table.sortable thead {
.thermal_sensors_widget_scale100 { position: absolute; height: 9px; width: 1px; left: 100%; margin-top: -6px; background-color: lightgray; z-index: 0; font-size: 0; }
.thermal_sensors_widget_mark100 { position: absolute; width: 15px; left: 96%; margin-top: -12px; font: 6pt Arial, sans-serif; text-align: left; color: #575757; }
/* widget textarea styles - full width */
.textarea_widget {
width: 100%;
resize:vertical;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* IE 8+ */
}

View File

@ -42,8 +42,8 @@ if($_POST['rssfeed']) {
}
// Use saved feed and max items
if($config['widgets']['rssfeed'])
$rss_feed_s = explode(",", $config['widgets']['rssfeed']);
if($config['widgets']['rssfeed'])
$rss_feed_s = explode(",", $config['widgets']['rssfeed']);
if($config['widgets']['rssmaxitems'])
$max_items = $config['widgets']['rssmaxitems'];
@ -59,19 +59,19 @@ if(!$rss_feed_s) {
$rss_feed_s = "http://blog.pfsense.org";
$config['widgets']['rssfeed'] = "http://blog.pfsense.org";
}
if(!$max_items)
$max_items = 10;
if(!$rsswidgetheight)
$rsswidgetheight = 300;
if(!$rsswidgettextlength)
$rsswidgettextlength = 140; // oh twitter, how do we love thee?
if($config['widgets']['rssfeed'])
if($config['widgets']['rssfeed'])
$textarea_txt = str_replace(",", "\n", $config['widgets']['rssfeed']);
else
else
$textarea_txt = "";
?>
@ -80,51 +80,51 @@ else
<div id="rss-settings" class="widgetconfigdiv" style="display:none;">
<form action="/widgets/widgets/rss.widget.php" method="post" name="iformc">
<textarea name="rssfeed" class="formfld unknown" id="rssfeed" cols="40" rows="3"><?=$textarea_txt;?></textarea>
<textarea name="rssfeed" class="formfld unknown textarea_widget" id="rssfeed" cols="40" rows="3"><?=$textarea_txt;?></textarea>
<br/>
<table summary="rss widget">
<tr>
<td align="right">
Display number of items:
Display number of items:
</td>
<td>
<select name='rssmaxitems' id='rssmaxitems'>
<option value='<?= $max_items ?>'><?= $max_items ?></option>
<?php
for($x=100; $x<5100; $x=$x+100)
for($x=100; $x<5100; $x=$x+100)
echo "<option value='{$x}'>{$x}</option>\n";
?>
</select>
</td>
</tr>
<tr>
<td align="right">
Widget height:
<td align="right">
Widget height:
</td>
<td>
<select name='rsswidgetheight' id='rsswidgetheight'>
<option value='<?= $rsswidgetheight ?>'><?= $rsswidgetheight ?>px</option>
<?php
for($x=100; $x<5100; $x=$x+100)
for($x=100; $x<5100; $x=$x+100)
echo "<option value='{$x}'>{$x}px</option>\n";
?>
</select>
</td>
</tr>
<tr>
<td align="right">
<td align="right">
Show how many characters from story:
</td>
<td>
<select name='rsswidgettextlength' id='rsswidgettextlength'>
<option value='<?= $rsswidgettextlength ?>'><?= $rsswidgettextlength ?></option>
<?php
for($x=10; $x<5100; $x=$x+10)
for($x=10; $x<5100; $x=$x+10)
echo "<option value='{$x}'>{$x}</option>\n";
?>
</select>
</td>
</tr>
</tr>
<tr>
<td>
&nbsp;
@ -150,7 +150,7 @@ else
if(strlen($string) > $length)
return (preg_match('/^(.*)\W.*$/', substr($string, 0, $length+1), $matches) ? $matches[1] : substr($string, 0, $length)) . $replacer;
return $string;
}
}
$feed = new SimplePie();
$feed->set_cache_location("/tmp/simplepie/");
$feed->set_feed_url($rss_feed_s);
@ -169,10 +169,10 @@ else
$counter++;
if($counter > $max_items)
break;
echo "<hr/>";
echo "<hr/>";
}
?>
</div>
</div>
<!-- needed to display the widget settings menu -->
<script type="text/javascript">