help uses popup window, recolor infoBox, use subscribe dialog in prefs

This commit is contained in:
Andrew Dolgov 2007-05-14 06:41:04 +01:00
parent 144f32d941
commit 442d77f1cc
8 changed files with 119 additions and 34 deletions

View File

@ -1389,6 +1389,22 @@ function infobox_callback() {
}
}
function helpbox_callback() {
if (xmlhttp.readyState == 4) {
var box = document.getElementById('helpBox');
var shadow = document.getElementById('helpBoxShadow');
if (box) {
box.innerHTML=xmlhttp.responseText;
if (shadow) {
shadow.style.display = "block";
} else {
box.style.display = "block";
}
}
notify("");
}
}
function addFilter() {
if (!xmlhttp_ready(xmlhttp)) {

View File

@ -4,30 +4,22 @@
if (!$_GET["noheaders"]) {
print "<html><head>
<title>Tiny Tiny RSS : Help</title>
<link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">
<script type=\"text/javascript\" src=\"prototype.js\"></script>
<script type=\"text/javascript\" src=\"functions.js?$script_dt_add\"></script>
<link rel=\"stylesheet\" href=\"utility.css\" type=\"text/css\">
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
</head><body>";
}
$tid = sprintf("%d", $_GET["tid"]);
print "<div id=\"infoBoxTitle\">".__('Help')."</div>";
print "<div class='infoBoxContents'>";
if (file_exists("help/$tid.php")) {
include("help/$tid.php");
} else {
print "<p>".__("Help topic not found.")."</p>";
}
print "</div>";
print "<div align='center'>
<input type='submit' class='button'
onclick=\"closeInfoBox()\" value=\"".__('Close this window')."\"></div>";
onclick=\"javascript:window.close()\"
value=\"".__('Close this window')."\"></div>";
if (!$_GET["noheaders"]) {
print "</body></html>";

View File

@ -47,8 +47,9 @@
print "<form id='feed_add_form' onsubmit='return false'>";
print "<input type=\"hidden\" name=\"op\" value=\"pref-feeds\">";
print "<input type=\"hidden\" name=\"quiet\" value=\"1\">";
print "<input type=\"hidden\" name=\"quiet\" value=\"0\">";
print "<input type=\"hidden\" name=\"subop\" value=\"add\">";
print "<input type=\"hidden\" name=\"from\" value=\"tt-rss\">";
print "<table width='100%'>
<tr><td>Feed URL:</td><td>

View File

@ -479,6 +479,7 @@
print "</div></body></html>";
return;
}
}
}
@ -589,8 +590,6 @@
}
}
set_pref($link, "_PREFS_ACTIVE_TAB", "feedConfig");
print "<div class=\"prefGenericAddBox\">
<input id=\"fadd_cat\"
onkeypress=\"return filterCR(event, addFeedCat)\"
@ -732,6 +731,8 @@
if ($quiet) return;
set_pref($link, "_PREFS_ACTIVE_TAB", "feedConfig");
$result = db_query($link, "SELECT COUNT(id) AS num_errors
FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
@ -758,13 +759,17 @@
onclick=\"javascript:updateFeedList()\" value=\"".__('Search')."\">
</div>";
print "<input id=\"fadd_link\"
/* print "<input id=\"fadd_link\"
onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
onchange=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
size=\"40\">
<input type=\"submit\" class=\"button\"
disabled=\"true\" id=\"fadd_submit_btn\"
onclick=\"addFeed()\" value=\"".__('Subscribe')."\">";
onclick=\"addFeed()\" value=\"".__('Subscribe')."\">"; */
print "<input onclick=\"javascript:displayDlg('quickAddFeed')\"
type=\"submit\" id=\"fadd_subscribe_btn\"
class=\"button\" value=\"".__('Subscribe to feed')."\">";
if (ENABLE_FEED_BROWSER && !SINGLE_USER_MODE) {
print " <input type=\"submit\" class=\"button\"

View File

@ -54,6 +54,35 @@ function feedlist_callback() {
}
}
/* stub for subscription dialog */
function dlg_frefresh_callback() {
if (xmlhttp.readyState == 4) {
// setTimeout("updateFeedList()", 500);
try {
var container = document.getElementById('prefContent');
container.innerHTML=xmlhttp.responseText;
selectTab("feedConfig", true);
if (caller_subop) {
var tuple = caller_subop.split(":");
if (tuple[0] == 'editFeed') {
window.setTimeout('editFeed('+tuple[1]+')', 100);
}
caller_subop = false;
}
if (typeof correctPNG != 'undefined') {
correctPNG();
}
notify("");
} catch (e) {
exception_error("feedlist_callback", e);
}
}
}
function filterlist_callback() {
var container = document.getElementById('prefContent');
if (xmlhttp.readyState == 4) {
@ -705,7 +734,7 @@ function labelTest() {
function displayHelpInfobox(topic_id) {
if (!xmlhttp_ready(xmlhttp)) {
/* if (!xmlhttp_ready(xmlhttp)) {
printLockingError();
return
}
@ -713,10 +742,15 @@ function displayHelpInfobox(topic_id) {
notify_progress("Loading help...");
xmlhttp.open("GET", "backend.php?op=help&tid=" +
param_escape(topic_id) + "&noheaders=1", true);
param_escape(topic_id), true);
xmlhttp.onreadystatechange=infobox_callback;
xmlhttp.send(null);
xmlhttp.onreadystatechange=helpbox_callback;
xmlhttp.send(null); */
var url = "backend.php?op=help&tid=" + param_escape(topic_id);
var w = window.open(url, "ttrss_help",
"status=0,toolbar=0,location=0,width=400,height=450,menubar=0");
}

View File

@ -459,6 +459,27 @@ div.helpResponse {
border : 1px solid #f0f0f0;
}
#infoBoxTitle {
border-width : 1px 1px 1px 1px;
border-style : solid;
border-color : #99d67a;
background-color : #99d67a;
padding : 2px;
color : white;
}
#infoBox {
border-width : 1px 1px 1px 1px;
border-style : solid;
border-color : #99d67a;
position : relative;
bottom : 2px;
right : 2px;
padding-bottom : 5px;
background-color : #f8fcf5;
}
/*
#infoBoxTitle {
border-width : 1px 1px 1px 1px;
border-style : solid;
@ -468,7 +489,6 @@ div.helpResponse {
color : white;
}
#infoBox {
border-width : 1px 1px 1px 1px;
border-style : solid;
@ -477,11 +497,8 @@ div.helpResponse {
bottom : 2px;
right : 2px;
padding-bottom : 5px;
background-image : url("images/prefs-content.png");
background-position : top left;
background-repeat : repeat-x;
background-color : white;
}
background-color : #f7faff;
} */
#infoBoxShadow {
background-image : url("images/shadow.png");
@ -491,7 +508,7 @@ div.helpResponse {
z-index : 3;
position : absolute;
display : none;
}
}
div.infoBoxContents {
padding : 10px;
@ -914,7 +931,7 @@ ul.userFeedList {
height : 300px;
overflow : auto;
list-style-type : none;
border : 1px solid #88b0f0;
border : 1px solid #99d67a;
background-color : white;
margin : 0px 0px 5px 0px;
padding : 0px;
@ -932,7 +949,7 @@ ul.labelTestResults {
list-style-type : none;
margin : 0px 0px 5px 0px;
padding : 0px;
border : 1px solid #88b0f0;
border : 1px solid #99d67a;
background-color : white;
}
@ -942,7 +959,7 @@ ul.filterTestResults {
list-style-type : none;
margin : 0px 0px 5px 0px;
padding : 0px;
border : 1px solid #88b0f0;
border : 1px solid #99d67a;
background-color : white;
}
@ -952,7 +969,7 @@ ul.browseFeedList {
list-style-type : none;
margin : 0px 0px 5px 0px;
padding : 0px;
border : 1px solid #88b0f0;
border : 1px solid #99d67a;
background-color : white;
}

View File

@ -476,8 +476,13 @@ function quickMenuGo(opid) {
if (opid == "qmcRemoveFeed") {
var actid = getActiveFeedId();
if (!actid || activeFeedIsCat()) {
if (activeFeedIsCat()) {
alert("You can't unsubscribe from the category.");
return;
}
if (!actid) {
alert("Please select some feed first.");
return;
}
@ -640,7 +645,7 @@ function editFeedDlg(feed) {
return;
}
if (feed <= 0 || active_feed_is_cat || tagsAreDisplayed()) {
if (feed <= 0 || activeFeedIsCat() || tagsAreDisplayed()) {
alert("You can't edit this kind of feed.");
return;
}

View File

@ -61,3 +61,18 @@ div.error {
width : 50%;
}
h1 {
color : #88b0f0;
font-size : 16pt;
border-width : 0px 0px 1px 0px;
border-color : black;
border-style : solid;
}
h2 {
color : #88b0f0;
font-size : 14pt;
border-width : 0px 0px 1px 0px;
border-color : black;
border-style : solid;
}