Commit ea560b7b authored by Sebastian Reichel's avatar Sebastian Reichel

Imported Upstream version 1.5.2

parent 591f97d8
......@@ -151,11 +151,11 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
var name = String(item.name);
/* Horrible */
name = name.replace(""", "\"");
name = name.replace("&", "&");
name = name.replace("—", "-");
name = name.replace("&lt;", "<");
name = name.replace("&gt;", ">");
name = name.replace(/&quot;/g, "\"");
name = name.replace(/&amp;/g, "&");
name = name.replace(/&mdash;/g, "-");
name = name.replace(/&lt;/g, "<");
name = name.replace(/&gt;/g, ">");
if (item.unread > 0) {
return name + " (" + item.unread + ")";
......
......@@ -70,6 +70,8 @@
$password = db_escape_string($_REQUEST["password"]);
$password_base64 = db_escape_string(base64_decode($_REQUEST["password"]));
if (SINGLE_USER_MODE) $login = "admin";
$result = db_query($link, "SELECT id FROM ttrss_users WHERE login = '$login'");
if (db_num_rows($result) != 0) {
......
This diff is collapsed.
......@@ -71,9 +71,6 @@
define('CHECK_FOR_NEW_VERSION', true);
// Check for new versions of tt-rss automatically.
define('USE_CURL', false);
// Use CURL to fetch remote data instead of PHP built-in fopen()
define('DIGEST_ENABLE', true);
// Global option to enable daily digests. Also toggles the ability of users
// to forward articles by email.
......@@ -85,14 +82,11 @@
// If update daemon and update_feeds should send digests
// Disable if you prefer querying special URL (see wiki)
define('ENABLE_TRANSLATIONS', true);
// Enable support for interface translations
define('MYSQL_CHARSET', 'UTF8');
// Connection charset for MySQL. If you have a legacy database and/or experience
// garbage unicode characters with this option, try setting it to a blank string.
define('DEFAULT_UPDATE_METHOD', 0);
define('DEFAULT_UPDATE_METHOD', 1);
// Which feed parsing library to use as default:
// 0 - Magpie
// 1 - SimplePie
......@@ -189,6 +183,10 @@
// Your OAuth instance authentication information for Twitter, visit
// http://twitter.com/oauth_clients to register your instance.
define('ISCONFIGURED', false);
// Please set this to true if you have read everything above and
// finished setting configuration options.
define('CONFIG_VERSION', 21);
// Expected config version. Please update this option in config.php
// if necessary (after migrating all new options from this file).
......
......@@ -41,7 +41,9 @@ function db_connect($host, $user, $pass, $db) {
}
}
function db_escape_string($s) {
function db_escape_string($s, $strip_tags = true) {
if ($strip_tags) $s = strip_tags($s);
if (DB_TYPE == "pgsql") {
return pg_escape_string($s);
} else {
......
<?php
require_once "functions.php";
$ERRORS[0] = __("Unknown error");
$ERRORS[0] = "";
$ERRORS[1] = __("This program requires XmlHttpRequest " .
"to function properly. Your browser doesn't seem to support it.");
......@@ -24,10 +25,24 @@
$ERRORS[9] = __("Configuration check failed");
$ERRORS[10] = __("Your version of MySQL is not currently supported. Please see
$ERRORS[10] = __("Your version of MySQL is not currently supported. Please see
official site for more information.");
$ERRORS[11] = "[This error is not returned by server]";
$ERRORS[12] = __("SQL escaping test failed, check your database and PHP configuration");
if ($_REQUEST['mode'] == 'js') {
header("Content-Type: text/plain; charset=UTF-8");
print "var ERRORS = [];\n";
foreach ($ERRORS as $id => $error) {
$error = preg_replace("/\n/", "", $error);
$error = preg_replace("/\"/", "\\\"", $error);
print "ERRORS[$id] = \"$error\";\n";
}
}
?>
......@@ -44,7 +44,7 @@ function viewfeed(feed, subop, is_cat, offset) {
/* if (getInitParam("theme") == "" || getInitParam("theme") == "compact") {
if (getInitParam("hide_feedlist") == 1) {
Element.hide("feeds-holder");
}
}
} */
dijit.byId("content-tabs").selectChild(
......@@ -79,7 +79,7 @@ function viewfeed(feed, subop, is_cat, offset) {
return;
}
_infscroll_request_sent = timestamp;
_infscroll_request_sent = timestamp;
}
hideAuxDlg();
......@@ -141,7 +141,7 @@ function viewfeed(feed, subop, is_cat, offset) {
console.log(query);
/* var unread_ctr = -1;
if (!is_cat) unread_ctr = getFeedUnread(feed);
var cache_check = false;
......@@ -149,7 +149,7 @@ function viewfeed(feed, subop, is_cat, offset) {
if (unread_ctr != -1 && !page_offset && !force_nocache && !subop) {
var cache_prefix = "";
if (is_cat) {
cache_prefix = "C:";
} else {
......@@ -163,8 +163,8 @@ function viewfeed(feed, subop, is_cat, offset) {
if (cache_check) {
setActiveFeedId(feed, is_cat);
$("headlines-frame").innerHTML = cache_find_param(cache_prefix + feed,
$("headlines-frame").innerHTML = cache_find_param(cache_prefix + feed,
unread_ctr);
request_counters();
......@@ -181,34 +181,30 @@ function viewfeed(feed, subop, is_cat, offset) {
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
onComplete: function(transport) {
setFeedExpandoIcon(feed, is_cat, 'images/blank_icon.gif');
headlines_callback2(transport, page_offset);
headlines_callback2(transport, page_offset);
} });
// }
} catch (e) {
exception_error("viewfeed", e);
}
}
}
function feedlist_init() {
try {
console.log("in feedlist init");
hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
document.onkeydown = hotkey_handler;
setTimeout("hotkey_prefix_timeout()", 5*1000);
if (!getActiveFeedId()) {
if (getInitParam("cdm_auto_catchup") != 1) {
setTimeout("viewfeed(-3)", 100);
} else {
setTimeout("viewfeed(-5)", 100);
}
}
setTimeout("viewfeed(-3)", 100);
}
console.log("T:" +
console.log("T:" +
getInitParam("cdm_auto_catchup") + " " + getFeedUnread(-3));
hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
......@@ -230,7 +226,7 @@ function request_counters_real() {
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
onComplete: function(transport) {
try {
handle_rpc_json(transport);
} catch (e) {
......@@ -316,7 +312,7 @@ function parse_counters(elems, scheduled_call) {
// TODO: enable new content notification for categories
if (!activeFeedIsCat() && id == getActiveFeedId()
if (!activeFeedIsCat() && id == getActiveFeedId()
&& ctr > getFeedUnread(id) && scheduled_call) {
displayNewContentPrompt(id);
}
......@@ -329,7 +325,7 @@ function parse_counters(elems, scheduled_call) {
if (id > 0) {
if (has_img) {
setFeedIcon(id, false,
setFeedIcon(id, false,
getInitParam("icons_url") + "/" + id + ".ico");
} else {
setFeedIcon(id, false, 'images/blank_icon.gif');
......@@ -337,7 +333,7 @@ function parse_counters(elems, scheduled_call) {
}
}
}
hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
} catch (e) {
......@@ -349,7 +345,7 @@ function getFeedUnread(feed, is_cat) {
try {
var tree = dijit.byId("feedTree");
if (tree && tree.model)
if (tree && tree.model)
return tree.model.getFeedUnread(feed, is_cat);
} catch (e) {
......@@ -370,20 +366,20 @@ function hideOrShowFeeds(hide) {
return tree.hideRead(hide, getInitParam("hide_read_shows_special"));
}
function getFeedName(feed, is_cat) {
function getFeedName(feed, is_cat) {
var tree = dijit.byId("feedTree");
if (tree && tree.model)
if (tree && tree.model)
return tree.model.getFeedValue(feed, is_cat, 'name');
}
function getFeedValue(feed, is_cat, key) {
function getFeedValue(feed, is_cat, key) {
try {
var tree = dijit.byId("feedTree");
if (tree && tree.model)
if (tree && tree.model)
return tree.model.getFeedValue(feed, is_cat, key);
} catch (e) {
//
}
......@@ -394,7 +390,7 @@ function setFeedUnread(feed, is_cat, unread) {
try {
var tree = dijit.byId("feedTree");
if (tree && tree.model)
if (tree && tree.model)
return tree.model.setFeedUnread(feed, is_cat, unread);
} catch (e) {
......@@ -406,7 +402,7 @@ function setFeedValue(feed, is_cat, key, value) {
try {
var tree = dijit.byId("feedTree");
if (tree && tree.model)
if (tree && tree.model)
return tree.model.setFeedValue(feed, is_cat, key, value);
} catch (e) {
......
This diff is collapsed.
This diff is collapsed.
dijit
dojo
dojox
release
util
dependencies = {
layers: [
{
name: "tt-rss-layer.js",
resourceName: "tt-rss-layer",
dependencies: [
"dojo.parser",
"dijit.dijit",
"dojo.NodeList-fx",
"dijit.ColorPalette",
"dijit.Dialog",
"dijit.form.Button",
"dijit.form.CheckBox",
"dijit.form.DropDownButton",
"dijit.form.FilteringSelect",
"dijit.form.Form",
"dijit.form.RadioButton",
"dijit.form.Select",
"dijit.form.SimpleTextarea",
"dijit.form.TextBox",
"dijit.form.ValidationTextBox",
"dijit.InlineEditBox",
"dijit.layout.AccordionContainer",
"dijit.layout.BorderContainer",
"dijit.layout.ContentPane",
"dijit.layout.TabContainer",
"dijit.Menu",
"dijit.ProgressBar",
"dijit.ProgressBar",
"dijit.Toolbar",
"dijit.Tree",
"dijit.tree.dndSource",
"dojo.data.ItemFileWriteStore",
"dojo.parser",
]
}
],
prefixes: [
[ "dijit", "../dijit" ]
]
}
#!/bin/sh
# This script rebuilds customized layer of Dojo for tt-rss
# Place unpacked Dojo source release in this directory and run this script.
# It will automatically replace previous build of Dojo in ../dojo
# Dojo requires Java runtime to build. Further information on rebuilding Dojo
# is available here: http://dojotoolkit.org/reference-guide/build/index.html
if [ -d util/buildscripts/ ]; then
pushd util/buildscripts
./build.sh profileFile=../../profile.js action=clean,release version=1.5.0 releaseName=
popd
if [ -d release/dojo ]; then
rm -rf ../dojo
cp -r release/dojo ..
else
echo $0: ERROR: Dojo build seems to have failed.
fi
else
echo $0: ERROR: Please unpack Dojo source release into current directory.
fi
......@@ -5,35 +5,102 @@
*/
if(!dojo._hasResource["dojo.AdapterRegistry"]){
dojo._hasResource["dojo.AdapterRegistry"]=true;
if(!dojo._hasResource["dojo.AdapterRegistry"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.AdapterRegistry"] = true;
dojo.provide("dojo.AdapterRegistry");
dojo.AdapterRegistry=function(_1){
this.pairs=[];
this.returnWrappers=_1||false;
};
dojo.extend(dojo.AdapterRegistry,{register:function(_2,_3,_4,_5,_6){
this.pairs[((_6)?"unshift":"push")]([_2,_3,_4,_5]);
},match:function(){
for(var i=0;i<this.pairs.length;i++){
var _7=this.pairs[i];
if(_7[1].apply(this,arguments)){
if((_7[3])||(this.returnWrappers)){
return _7[2];
}else{
return _7[2].apply(this,arguments);
}
}
}
throw new Error("No match found");
},unregister:function(_8){
for(var i=0;i<this.pairs.length;i++){
var _9=this.pairs[i];
if(_9[0]==_8){
this.pairs.splice(i,1);
return true;
}
dojo.AdapterRegistry = function(/*Boolean?*/ returnWrappers){
// summary:
// A registry to make contextual calling/searching easier.
// description:
// Objects of this class keep list of arrays in the form [name, check,
// wrap, directReturn] that are used to determine what the contextual
// result of a set of checked arguments is. All check/wrap functions
// in this registry should be of the same arity.
// example:
// | // create a new registry
// | var reg = new dojo.AdapterRegistry();
// | reg.register("handleString",
// | dojo.isString,
// | function(str){
// | // do something with the string here
// | }
// | );
// | reg.register("handleArr",
// | dojo.isArray,
// | function(arr){
// | // do something with the array here
// | }
// | );
// |
// | // now we can pass reg.match() *either* an array or a string and
// | // the value we pass will get handled by the right function
// | reg.match("someValue"); // will call the first function
// | reg.match(["someValue"]); // will call the second
this.pairs = [];
this.returnWrappers = returnWrappers || false; // Boolean
}
return false;
}});
dojo.extend(dojo.AdapterRegistry, {
register: function(/*String*/ name, /*Function*/ check, /*Function*/ wrap, /*Boolean?*/ directReturn, /*Boolean?*/ override){
// summary:
// register a check function to determine if the wrap function or
// object gets selected
// name:
// a way to identify this matcher.
// check:
// a function that arguments are passed to from the adapter's
// match() function. The check function should return true if the
// given arguments are appropriate for the wrap function.
// directReturn:
// If directReturn is true, the value passed in for wrap will be
// returned instead of being called. Alternately, the
// AdapterRegistry can be set globally to "return not call" using
// the returnWrappers property. Either way, this behavior allows
// the registry to act as a "search" function instead of a
// function interception library.
// override:
// If override is given and true, the check function will be given
// highest priority. Otherwise, it will be the lowest priority
// adapter.
this.pairs[((override) ? "unshift" : "push")]([name, check, wrap, directReturn]);
},
match: function(/* ... */){
// summary:
// Find an adapter for the given arguments. If no suitable adapter
// is found, throws an exception. match() accepts any number of
// arguments, all of which are passed to all matching functions
// from the registered pairs.
for(var i = 0; i < this.pairs.length; i++){
var pair = this.pairs[i];
if(pair[1].apply(this, arguments)){
if((pair[3])||(this.returnWrappers)){
return pair[2];
}else{
return pair[2].apply(this, arguments);
}
}
}
throw new Error("No match found");
},
unregister: function(name){
// summary: Remove a named adapter from the registry
// FIXME: this is kind of a dumb way to handle this. On a large
// registry this will be slow-ish and we can use the name as a lookup
// should we choose to trade memory for speed.
for(var i = 0; i < this.pairs.length; i++){
var pair = this.pairs[i];
if(pair[0] == name){
this.pairs.splice(i, 1);
return true;
}
}
return false;
}
});
}
......@@ -5,54 +5,79 @@
*/
if(!dojo._hasResource["dojo.DeferredList"]){
dojo._hasResource["dojo.DeferredList"]=true;
if(!dojo._hasResource["dojo.DeferredList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.DeferredList"] = true;
dojo.provide("dojo.DeferredList");
dojo.DeferredList=function(_1,_2,_3,_4,_5){
var _6=[];
dojo.Deferred.call(this);
var _7=this;
if(_1.length===0&&!_2){
this.resolve([0,[]]);
}
var _8=0;
dojo.forEach(_1,function(_9,i){
_9.then(function(_a){
if(_2){
_7.resolve([i,_a]);
}else{
_b(true,_a);
}
},function(_c){
if(_3){
_7.reject(_c);
}else{
_b(false,_c);
}
if(_4){
return null;
}
throw _c;
});
function _b(_d,_e){
_6[i]=[_d,_e];
_8++;
if(_8===_1.length){
_7.resolve(_6);
}
dojo.DeferredList = function(/*Array*/ list, /*Boolean?*/ fireOnOneCallback, /*Boolean?*/ fireOnOneErrback, /*Boolean?*/ consumeErrors, /*Function?*/ canceller){
// summary:
// Provides event handling for a group of Deferred objects.
// description:
// DeferredList takes an array of existing deferreds and returns a new deferred of its own
// this new deferred will typically have its callback fired when all of the deferreds in
// the given list have fired their own deferreds. The parameters `fireOnOneCallback` and
// fireOnOneErrback, will fire before all the deferreds as appropriate
//
// list:
// The list of deferreds to be synchronizied with this DeferredList
// fireOnOneCallback:
// Will cause the DeferredLists callback to be fired as soon as any
// of the deferreds in its list have been fired instead of waiting until
// the entire list has finished
// fireonOneErrback:
// Will cause the errback to fire upon any of the deferreds errback
// canceller:
// A deferred canceller function, see dojo.Deferred
var resultList = [];
dojo.Deferred.call(this);
var self = this;
if(list.length === 0 && !fireOnOneCallback){
this.resolve([0, []]);
}
var finished = 0;
dojo.forEach(list, function(item, i){
item.then(function(result){
if(fireOnOneCallback){
self.resolve([i, result]);
}else{
addResult(true, result);
}
},function(error){
if(fireOnOneErrback){
self.reject(error);
}else{
addResult(false, error);
}
if(consumeErrors){
return null;
}
throw error;
});
function addResult(succeeded, result){
resultList[i] = [succeeded, result];
finished++;
if(finished === list.length){
self.resolve(resultList);
}
}
});
};
});
};
dojo.DeferredList.prototype=new dojo.Deferred();
dojo.DeferredList.prototype.gatherResults=function(_f){
var d=new dojo.DeferredList(_f,false,true,false);
d.addCallback(function(_10){
var ret=[];
dojo.forEach(_10,function(_11){
ret.push(_11[1]);
});
return ret;
});
return d;
dojo.DeferredList.prototype = new dojo.Deferred();
dojo.DeferredList.prototype.gatherResults= function(deferredList){
// summary:
// Gathers the results of the deferreds for packaging
// as the parameters to the Deferred Lists' callback
var d = new dojo.DeferredList(deferredList, false, true, false);
d.addCallback(function(results){
var ret = [];
dojo.forEach(results, function(result){
ret.push(result[1]);
});
return ret;
});
return d;
};
}
......@@ -5,37 +5,214 @@
*/
if(!dojo._hasResource["dojo.NodeList-fx"]){
dojo._hasResource["dojo.NodeList-fx"]=true;
if(!dojo._hasResource["dojo.NodeList-fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo.NodeList-fx"] = true;
dojo.provide("dojo.NodeList-fx");
dojo.require("dojo.fx");
dojo.extend(dojo.NodeList,{_anim:function(_1,_2,_3){
_3=_3||{};
var a=dojo.fx.combine(this.map(function(_4){
var _5={node:_4};
dojo.mixin(_5,_3);
return _1[_2](_5);
}));
return _3.auto?a.play()&&this:a;
},wipeIn:function(_6){
return this._anim(dojo.fx,"wipeIn",_6);
},wipeOut:function(_7){
return this._anim(dojo.fx,"wipeOut",_7);
},slideTo:function(_8){
return this._anim(dojo.fx,"slideTo",_8);
},fadeIn:function(_9){
return this._anim(dojo,"fadeIn",_9);
},fadeOut:function(_a){
return this._anim(dojo,"fadeOut",_a);
},animateProperty:function(_b){
return this._anim(dojo,"animateProperty",_b);
},anim:function(_c,_d,_e,_f,_10){
var _11=dojo.fx.combine(this.map(function(_12){
return dojo.animateProperty({node:_12,properties:_c,duration:_d||350,easing:_e});