That mass renames continue! Protoread is now Protopub, and that sounds good to me.

This commit is contained in:
Samuel Clay 2010-05-14 09:32:38 -04:00
parent 5e193f7279
commit 3ca7fcefca
27 changed files with 175 additions and 175 deletions

View file

@ -3,7 +3,7 @@
"pk": 1,
"model": "rss_feeds.feed",
"fields": {
"feed_address": "%(PROTOREAD_DIR)s/apps/analyzer/fixtures/brownstoner.xml",
"feed_address": "%(PROTOPUB_DIR)s/apps/analyzer/fixtures/brownstoner.xml",
"days_to_trim": 90,
"feed_link": "http://brownstoner.com",
"num_subscribers": 0,

View file

@ -3,7 +3,7 @@
"pk": 1,
"model": "rss_feeds.feed",
"fields": {
"feed_address": "%(PROTOREAD_DIR)s/apps/analyzer/fixtures/brownstoner2.xml",
"feed_address": "%(PROTOPUB_DIR)s/apps/analyzer/fixtures/brownstoner2.xml",
"days_to_trim": 90,
"feed_link": "http://brownstoner.com",
"num_subscribers": 0,

View file

@ -3,7 +3,7 @@
"pk": 4,
"model": "rss_feeds.feed",
"fields": {
"feed_address": "%(PROTOREAD_DIR)s/apps/analyzer/fixtures/gothamist1.xml",
"feed_address": "%(PROTOPUB_DIR)s/apps/analyzer/fixtures/gothamist1.xml",
"days_to_trim": 90,
"feed_link": "http://gothamist.com",
"num_subscribers": 0,

View file

@ -3,7 +3,7 @@
"pk": 4,
"model": "rss_feeds.feed",
"fields": {
"feed_address": "%(PROTOREAD_DIR)s/apps/analyzer/fixtures/gothamist2.xml",
"feed_address": "%(PROTOPUB_DIR)s/apps/analyzer/fixtures/gothamist2.xml",
"days_to_trim": 90,
"feed_link": "http://gothamist.com",
"num_subscribers": 0,

View file

@ -3,7 +3,7 @@
"pk": 1,
"model": "rss_feeds.feed",
"fields": {
"feed_address": "%(PROTOREAD_DIR)s/apps/rss_feeds/fixtures/gawker1.xml",
"feed_address": "%(PROTOPUB_DIR)s/apps/rss_feeds/fixtures/gawker1.xml",
"days_to_trim": 90,
"feed_link": "http://gawker.com",
"num_subscribers": 0,

View file

@ -3,7 +3,7 @@
"pk": 1,
"model": "rss_feeds.feed",
"fields": {
"feed_address": "%(PROTOREAD_DIR)s/apps/rss_feeds/fixtures/gawker2.xml",
"feed_address": "%(PROTOPUB_DIR)s/apps/rss_feeds/fixtures/gawker2.xml",
"days_to_trim": 90,
"feed_link": "http://gawker.com",
"num_subscribers": 0,

View file

@ -3,7 +3,7 @@
"pk": 4,
"model": "rss_feeds.feed",
"fields": {
"feed_address": "%(PROTOREAD_DIR)s/apps/rss_feeds/fixtures/gothamist_aug_2009_1.xml",
"feed_address": "%(PROTOPUB_DIR)s/apps/rss_feeds/fixtures/gothamist_aug_2009_1.xml",
"days_to_trim": 90,
"feed_link": "http://gothamist.com",
"num_subscribers": 0,

View file

@ -3,7 +3,7 @@
"pk": 4,
"model": "rss_feeds.feed",
"fields": {
"feed_address": "%(PROTOREAD_DIR)s/apps/rss_feeds/fixtures/gothamist_aug_2009_2.xml",
"feed_address": "%(PROTOPUB_DIR)s/apps/rss_feeds/fixtures/gothamist_aug_2009_2.xml",
"days_to_trim": 90,
"feed_link": "http://gothamist.com",
"num_subscribers": 0,

View file

@ -3,7 +3,7 @@
"pk": 5,
"model": "rss_feeds.feed",
"fields": {
"feed_address": "%(PROTOREAD_DIR)s/apps/rss_feeds/fixtures/slashdot1.xml",
"feed_address": "%(PROTOPUB_DIR)s/apps/rss_feeds/fixtures/slashdot1.xml",
"days_to_trim": 90,
"feed_link": "http://slashdot.com",
"num_subscribers": 0,

View file

@ -3,7 +3,7 @@
"pk": 5,
"model": "rss_feeds.feed",
"fields": {
"feed_address": "%(PROTOREAD_DIR)s/apps/rss_feeds/fixtures/slashdot2.xml",
"feed_address": "%(PROTOPUB_DIR)s/apps/rss_feeds/fixtures/slashdot2.xml",
"days_to_trim": 90,
"feed_link": "http://slashdot.com",
"num_subscribers": 0,

View file

@ -22,7 +22,7 @@ import datetime
import hashlib
from utils.diff import HTMLDiff
USER_AGENT = 'Protoread v1.0 - protoread.com'
USER_AGENT = 'Protopub v1.0 - protopub.com'
ENTRY_NEW, ENTRY_UPDATED, ENTRY_SAME, ENTRY_ERR = range(4)
@ -62,7 +62,7 @@ class Feed(models.Model):
def update(self, force=False, feed=None, single_threaded=False):
from utils import feed_fetcher
try:
self.feed_address = self.feed_address % {'PROTOREAD_DIR': settings.PROTOREAD_DIR}
self.feed_address = self.feed_address % {'PROTOPUB_DIR': settings.PROTOPUB_DIR}
except:
pass

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd">
<allow-access-from domain="*.protoread.com" />
<allow-access-from domain="*.protopub.com" />
<allow-access-from domain="pr.local.host" />
<allow-access-from domain="media.protoread" />
<allow-access-from domain="media.protopub" />
<site-control permitted-cross-domain-policies="master-only"/>
</cross-domain-policy>

View file

@ -1171,7 +1171,7 @@ form.opml_import_form input {
position: absolute;
bottom: -1px;
margin-left: 244px;
background: transparent url('../img/reader/protoread_logo.png') no-repeat 0 0;
background: transparent url('../img/reader/protopub_logo.png') no-repeat 0 0;
height: 52px;
right: 250px;
width: 242px;
@ -1181,7 +1181,7 @@ form.opml_import_form input {
margin: 0 auto;
height: 376px;
width: 600px;
background: transparent url('../img/reader/protoread_splash_image.png') no-repeat 0 0;
background: transparent url('../img/reader/protopub_splash_image.png') no-repeat 0 0;
}
#NB-splash .NB-splash-links {

View file

@ -71,9 +71,9 @@
ajaxFn.xhrID = xhrID;
o.xhrID = xhrID;
// PROTOREAD.log(['add', o, o.queue, this.opts, this.requests[xhrID], this.qName]);
// PROTOPUB.log(['add', o, o.queue, this.opts, this.requests[xhrID], this.qName]);
o.beforeSend = function(xhr, opts){
// PROTOREAD.log(['o.beforeSend', xhr, opts]);
// PROTOPUB.log(['o.beforeSend', xhr, opts]);
var ret = beforeSend.call(this, xhr, opts);
if(ret === false){
that._removeXHR(xhrID);
@ -82,20 +82,20 @@
return ret;
};
o.complete = function(xhr, status){
// PROTOREAD.log(['o.complete', xhr, status, o]);
// PROTOPUB.log(['o.complete', xhr, status, o]);
that._complete.call(that, this, origCom, xhr, status, xhrID, o);
xhr = null;
};
o.success = function(data, status, xhr){
// PROTOREAD.log(['o.success', data, status]);
// PROTOPUB.log(['o.success', data, status]);
that._success.call(that, this, origSuc, data, status, xhr, o);
xhr = null;
};
//always add some error callback
o.error = function(ahr, status, errorStr){
// PROTOREAD.log(['o.error', errorStr, status]);
// PROTOPUB.log(['o.error', errorStr, status]);
ahr = (ahr || {});
var httpStatus = ahr.status,
content = ahr.responseXML || ahr.responseText
@ -115,7 +115,7 @@
}
if(o.queue){
// PROTOREAD.log(['Queueing', o.queue, this.qName]);
// PROTOPUB.log(['Queueing', o.queue, this.qName]);
$.queue(document, this.qName, ajaxFn);
if(this.inProgress < o.maxRequests){
$.dequeue(document, this.qName);
@ -136,7 +136,7 @@
that._success.call(that, o.context || o, origSuc, cache[id], 'success', {}, o);
}, 0);
} else {
// PROTOREAD.log(['create_ajax', o, o.complete, o.error, o.success]);
// PROTOPUB.log(['create_ajax', o, o.complete, o.error, o.success]);
that.requests[id] = $.ajax(o);
}
if(that.inProgress === 1){
@ -159,7 +159,7 @@
return ret;
},
_complete: function(context, origFn, xhr, status, xhrID, o){
// PROTOREAD.log(['complete', o]);
// PROTOPUB.log(['complete', o]);
if(this._isAbort(xhr, o)){
status = 'abort';
o.abort.call(context, xhr, status, o);
@ -178,7 +178,7 @@
xhr = null;
},
_success: function(context, origFn, data, status, xhr, o){
// PROTOREAD.log(['_success', data, status]);
// PROTOPUB.log(['_success', data, status]);
var that = this;
if(this._isAbort(xhr, o)){
xhr = null;
@ -203,7 +203,7 @@
xhr = null;
},
getData: function(id){
// PROTOREAD.log(['getData', id]);
// PROTOPUB.log(['getData', id]);
if( id ){
var ret = this.requests[id];
if(!ret && this.opts.queue) {
@ -220,7 +220,7 @@
};
},
abort: function(id){
// PROTOREAD.log(['abort', id]);
// PROTOPUB.log(['abort', id]);
var xhr;
if(id){
xhr = this.getData(id);
@ -251,7 +251,7 @@
});
},
clear: function(shouldAbort){
// PROTOREAD.log(['clear', shouldAbort]);
// PROTOPUB.log(['clear', shouldAbort]);
$(document).clearQueue(this.qName);
if(shouldAbort){
this.abort();

View file

@ -1,11 +1,11 @@
if (typeof PROTOREAD == 'undefined') PROTOREAD = {};
if (typeof PROTOREAD.Globals == 'undefined') PROTOREAD.Globals = {};
if (typeof PROTOPUB == 'undefined') PROTOPUB = {};
if (typeof PROTOPUB.Globals == 'undefined') PROTOPUB.Globals = {};
/* ============================= */
/* = Core Protoread Javascript = */
/* = Core Protopub Javascript = */
/* ============================= */
PROTOREAD.log = function(msg) {
PROTOPUB.log = function(msg) {
try {
if (typeof o == "object")
{
@ -39,7 +39,7 @@ PROTOREAD.log = function(msg) {
var elemTop = $elem.offset().top - docOffset;
var elemBottom = elemTop + $elem.outerHeight();
// PROTOREAD.log(['isScrollVisible', docViewTop, docViewBottom, docOffset, elemTop, elemBottom]);
// PROTOPUB.log(['isScrollVisible', docViewTop, docViewBottom, docOffset, elemTop, elemBottom]);
return ((elemTop >= docViewTop) && (elemBottom <= docViewBottom));
}

View file

@ -1,10 +1,10 @@
PROTOREAD.AssetModel = function() {
PROTOPUB.AssetModel = function() {
var _Reader = null;
return {
reader: function(){
if(!_Reader){
_Reader = new PROTOREAD.AssetModel.Reader();
_Reader = new PROTOPUB.AssetModel.Reader();
_Reader.init();
} else {
_Reader.init();
@ -13,7 +13,7 @@ PROTOREAD.AssetModel = function() {
},
preferences: function(){
if(!_Prefs){
_Prefs = new PROTOREAD.AssetModel.Preferences();
_Prefs = new PROTOPUB.AssetModel.Preferences();
_Prefs.init();
} else {
_Prefs.init();
@ -23,7 +23,7 @@ PROTOREAD.AssetModel = function() {
};
}();
PROTOREAD.AssetModel.Reader = function() {
PROTOPUB.AssetModel.Reader = function() {
this.feeds = {};
this.folders = [];
this.stories = {};
@ -31,7 +31,7 @@ PROTOREAD.AssetModel.Reader = function() {
this.classifiers = {};
};
PROTOREAD.AssetModel.Reader.prototype = {
PROTOPUB.AssetModel.Reader.prototype = {
init: function() {
this.ajax = {};
@ -60,19 +60,19 @@ PROTOREAD.AssetModel.Reader.prototype = {
type: 'POST',
dataType: 'json',
beforeSend: function() {
// PROTOREAD.log(['beforeSend', options]);
// PROTOPUB.log(['beforeSend', options]);
$.isFunction(options['beforeSend']) && options['beforeSend']();
return true;
},
success: function(o) {
// PROTOREAD.log(['make_request 1', o]);
// PROTOPUB.log(['make_request 1', o]);
if ($.isFunction(callback)) {
callback(o);
}
},
error: function(e) {
// PROTOREAD.log(['AJAX Error', e]);
// PROTOPUB.log(['AJAX Error', e]);
if ($.isFunction(error_callback)) {
error_callback();
}
@ -93,10 +93,10 @@ PROTOREAD.AssetModel.Reader.prototype = {
}
}
if (!read && PROTOREAD.Globals.is_authenticated) {
if (!read && PROTOPUB.Globals.is_authenticated) {
if (!(feed_id in this.read_stories)) { this.read_stories[feed_id] = []; }
this.read_stories[feed_id].push(story_id);
PROTOREAD.log(['Marking Read', this.read_stories, story_id]);
PROTOPUB.log(['Marking Read', this.read_stories, story_id]);
var story_ids = new Array(this.read_stories[feed_id]);
this.make_request('/reader/mark_story_as_read', {
@ -126,7 +126,7 @@ PROTOREAD.AssetModel.Reader.prototype = {
}
}
PROTOREAD.log(['Like', opinion, this.stories[s].opinion]);
PROTOPUB.log(['Like', opinion, this.stories[s].opinion]);
if (opinion != 1) {
this.make_request('/reader/mark_story_as_like',
{
@ -147,7 +147,7 @@ PROTOREAD.AssetModel.Reader.prototype = {
break;
}
}
PROTOREAD.log(['Dislike', opinion, this.stories[s].opinion]);
PROTOPUB.log(['Dislike', opinion, this.stories[s].opinion]);
if (opinion != -1) {
this.make_request('/reader/mark_story_as_dislike',
{
@ -186,7 +186,7 @@ PROTOREAD.AssetModel.Reader.prototype = {
return self.load_feed_precallback(data, feed_id, callback, first_load);
};
// PROTOREAD.log(['load_feed', feed_id, page, first_load, callback, pre_callback]);
// PROTOPUB.log(['load_feed', feed_id, page, first_load, callback, pre_callback]);
if (feed_id) {
this.make_request('/reader/load_single_feed',
{
@ -202,7 +202,7 @@ PROTOREAD.AssetModel.Reader.prototype = {
},
load_feed_precallback: function(data, feed_id, callback, first_load) {
// PROTOREAD.log(['pre_callback', data]);
// PROTOPUB.log(['pre_callback', data]);
if (feed_id != this.feed_id) {
this.stories = data.stories;
this.feed_tags = data.feed_tags;
@ -248,7 +248,7 @@ PROTOREAD.AssetModel.Reader.prototype = {
var feed = feeds[f];
for (var k in feed) {
if (self.feeds[f][k] != feed[k]) {
// PROTOREAD.log(['New Feed', self.feeds[f][k], feed[k], f, k]);
// PROTOPUB.log(['New Feed', self.feeds[f][k], feed[k], f, k]);
self.feeds[f][k] = feed[k];
if (!(f in updated_feeds)) {
updated_feeds.push(f);
@ -260,7 +260,7 @@ PROTOREAD.AssetModel.Reader.prototype = {
callback(updated_feeds);
};
if (PROTOREAD.Globals.is_authenticated) {
if (PROTOPUB.Globals.is_authenticated) {
this.make_request('/reader/refresh_feeds', {}, pre_callback);
}
},
@ -269,11 +269,11 @@ PROTOREAD.AssetModel.Reader.prototype = {
var self = this;
var pre_callback = function(data) {
// PROTOREAD.log(['refresh_feed pre_callback', data]);
// PROTOPUB.log(['refresh_feed pre_callback', data]);
self.load_feed_precallback(data, feed_id, callback);
};
// PROTOREAD.log(['refresh_feed', feed_id, page, first_load, callback, pre_callback]);
// PROTOPUB.log(['refresh_feed', feed_id, page, first_load, callback, pre_callback]);
if (feed_id) {
this.make_request('/reader/load_single_feed',
{
@ -370,12 +370,12 @@ PROTOREAD.AssetModel.Reader.prototype = {
PROTOREAD.AssetModel.Preferences = function() {
PROTOPUB.AssetModel.Preferences = function() {
this.feeds = {};
this.stories = {};
};
PROTOREAD.AssetModel.Preferences.prototype = {
PROTOPUB.AssetModel.Preferences.prototype = {
init: function() {
return;

View file

@ -1,6 +1,6 @@
(function($) {
PROTOREAD.Reader = function() {
PROTOPUB.Reader = function() {
var self = this;
this.$feed_list = $('#feed_list');
this.$story_titles = $('#story_titles');
@ -10,7 +10,7 @@
this.$story_iframe = $('.NB-feed-frame');
this.$intelligence_slider = $('.NB-intelligence-slider');
this.model = PROTOREAD.AssetModel.reader();
this.model = PROTOPUB.AssetModel.reader();
this.options = {};
this.google_favicon_url = 'http://www.google.com/s2/favicons?domain_url=';
this.story_view = 'page';
@ -45,14 +45,14 @@
this.setup_feed_refresh();
};
PROTOREAD.Reader.prototype = {
PROTOPUB.Reader.prototype = {
// =================
// = Node Creation =
// =================
make_story_title: function(story) {
var unread_view = PROTOREAD.Globals.unread_view;
var unread_view = PROTOPUB.Globals.unread_view;
var read = story.read_status
? 'read'
: '';
@ -363,7 +363,7 @@
navigate_story_titles_to_story: function(story) {
var $next_story = this.find_story_in_story_titles(story);
if ($next_story && $next_story.length && $next_story.is(':visible') && !$next_story.hasClass('selected')) {
// PROTOREAD.log(['navigate_story_titles_to_story', story, $next_story]);
// PROTOPUB.log(['navigate_story_titles_to_story', story, $next_story]);
this.push_current_story_on_history();
this.scroll_story_titles_to_show_selected_story_title($next_story);
@ -378,7 +378,7 @@
if (direction == -1) {
dir = '-';
}
// PROTOREAD.log(['page_in_story', this.$story_pane, direction, page_height, scroll_height]);
// PROTOPUB.log(['page_in_story', this.$story_pane, direction, page_height, scroll_height]);
if (this.story_view == 'page') {
this.$story_iframe.scrollTo({top:dir+'='+scroll_height, left:'+=0'}, 150);
} else if (this.story_view == 'feed' || this.story_view == 'story') {
@ -410,7 +410,7 @@
var $feed_list = this.$feed_list.empty();
var folders = this.model.folders;
var feeds = this.model.feeds;
// PROTOREAD.log(['Making feeds', {'folders': folders, 'feeds': feeds}]);
// PROTOPUB.log(['Making feeds', {'folders': folders, 'feeds': feeds}]);
$('#story_taskbar').css({'display': 'block'});
@ -587,7 +587,7 @@
this.show_feedbar_loading();
this.make_content_pane_feed_counter(feed_id);
this.switch_taskbar_view(this.story_view);
// PROTOREAD.log(['open_feed', this.flags, this.active_feed, feed_id]);
// PROTOPUB.log(['open_feed', this.flags, this.active_feed, feed_id]);
this.model.load_feed(feed_id, 0, true, $.rescope(this.post_open_feed, this));
this.load_iframe(feed_id);
this.flags['opening_feed'] = false;
@ -613,7 +613,7 @@
}
if (this.active_feed == feed_id) {
// PROTOREAD.log(['post_open_feed', data.stories, this.flags]);
// PROTOPUB.log(['post_open_feed', data.stories, this.flags]);
this.flags['feed_view_positions_calculated'] = false;
this.story_titles_clear_loading_endbar();
this.create_story_titles(stories);
@ -662,7 +662,7 @@
}
$story_titles.append($story_title);
}
// PROTOREAD.log(['create_story_titles', stories]);
// PROTOPUB.log(['create_story_titles', stories]);
if (!stories || stories.length == 0) {
var $end_stories_line = $.make('div', {
className: 'NB-story-titles-end-stories-line'
@ -687,7 +687,7 @@
make_story_feed_entries: function(stories, first_load, refresh_load) {
var $feed_view = this.$feed_view;
var self = this;
var unread_view = PROTOREAD.Globals.unread_view;
var unread_view = PROTOPUB.Globals.unread_view;
var $stories;
if (first_load) {
@ -740,7 +740,7 @@
} else {
(function($story, story, image_count) {
$('img', $story).load(function() {
// PROTOREAD.log(['Loaded image', $story, story, image_count]);
// PROTOPUB.log(['Loaded image', $story, story, image_count]);
if (image_count == 1) {
self.flags.feed_view_images_loaded[story.id] = true;
} else {
@ -769,9 +769,9 @@
var story = stories[story_index];
var $story = self.cache.feed_view_stories[story.id];
// PROTOREAD.log(['Appending $story', $story, self.flags.feed_view_images_loaded[story.id]]);
// PROTOPUB.log(['Appending $story', $story, self.flags.feed_view_images_loaded[story.id]]);
if (self.flags.feed_view_images_loaded[story.id]) {
// PROTOREAD.log(['Feed view story pre-loaded', $('img', $story).length + " images", $story, story_index]);
// PROTOPUB.log(['Feed view story pre-loaded', $('img', $story).length + " images", $story, story_index]);
self.determine_feed_view_story_position($story, story);
self.process_stories_location_in_feed_view(story_index+1);
} else {
@ -779,22 +779,22 @@
(function($story, story, story_index) {
// In case the images don't load, move on to the next story
var story_load = setTimeout(function() {
// PROTOREAD.log(['Feed view story did not load in time', $('img', $story).length + " images", $story, story_index]);
// PROTOPUB.log(['Feed view story did not load in time', $('img', $story).length + " images", $story, story_index]);
story_load = false;
self.determine_feed_view_story_position($story, story);
self.process_stories_location_in_feed_view(story_index+1);
}, 2000);
// PROTOREAD.log(['Feed view story not loaded', $('img', $story).length + " images", $story, story_index]);
// PROTOPUB.log(['Feed view story not loaded', $('img', $story).length + " images", $story, story_index]);
// Load each image, loading next story on last image
var recheck = function() {
if (self.flags.feed_view_images_loaded[story.id] && story_load) {
// PROTOREAD.log(['Feed view story finally loaded', $('img', $story).length + " images", $story, story_index]);
// PROTOPUB.log(['Feed view story finally loaded', $('img', $story).length + " images", $story, story_index]);
clearTimeout(story_load);
self.determine_feed_view_story_position($story, story);
self.process_stories_location_in_feed_view(story_index+1);
} else if (story_load) {
// PROTOREAD.log(['Feed view story loading...', $('img', $story).length + " images", $story, story_index]);
// PROTOPUB.log(['Feed view story loading...', $('img', $story).length + " images", $story, story_index]);
setTimeout(recheck, 200);
}
};
@ -805,10 +805,10 @@
}
} else if (stories[story_index]
&& stories[story_index]['story_feed_id'] != this.active_feed) {
PROTOREAD.log(['Switched off feed early']);
PROTOPUB.log(['Switched off feed early']);
} else {
self.flags['feed_view_positions_calculated'] = true;
PROTOREAD.log(['Feed view entirely loaded', stories.length + " stories"]);
PROTOPUB.log(['Feed view entirely loaded', stories.length + " stories"]);
var $feed_view = this.$feed_view;
var $stories = $('.NB-feed-stories', $feed_view);
var $endbar = $.make('div', { className: 'NB-feed-story-endbar' });
@ -824,7 +824,7 @@
this.cache.feed_view_story_positions[position] = story;
this.cache.feed_view_story_positions_keys.push(position);
this.cache.feed_view_story_positions_keys.sort(function(a,b) {return a>b;});
// PROTOREAD.log(['Positioning story', position, $story, story, this.cache.feed_view_story_positions_keys]);
// PROTOPUB.log(['Positioning story', position, $story, story, this.cache.feed_view_story_positions_keys]);
}
},
@ -868,20 +868,20 @@
if (self.iframe_scroll
&& self.flags.iframe_scroll_snap_back_prepared
&& $story_iframe.contents().scrollTop() == 0) {
PROTOREAD.log(['Snap back, loaded, scroll', self.iframe_scroll]);
PROTOPUB.log(['Snap back, loaded, scroll', self.iframe_scroll]);
$story_iframe.contents().scrollTop(self.iframe_scroll);
self.flags.iframe_scroll_snap_back_prepared = false;
}
});
}, 50);
// PROTOREAD.log(['iFrame domain', $story_iframe.attr('src').indexOf('/reader/load_feed_page?feed_id='+feed_id), $story_iframe.attr('src')]);
// PROTOPUB.log(['iFrame domain', $story_iframe.attr('src').indexOf('/reader/load_feed_page?feed_id='+feed_id), $story_iframe.attr('src')]);
if ($story_iframe.attr('src').indexOf('/reader/load_feed_page?feed_id='+feed_id) != -1) {
var iframe_link_attacher = function() {
var num_links = $story_iframe.contents().find('a').length;
// PROTOREAD.log(['Finding links', self.iframe_link_attacher_num_links, num_links]);
// PROTOPUB.log(['Finding links', self.iframe_link_attacher_num_links, num_links]);
if (self.iframe_link_attacher_num_links != num_links) {
// PROTOREAD.log(['Found new links', num_links, self.iframe_link_attacher_num_links]);
// PROTOPUB.log(['Found new links', num_links, self.iframe_link_attacher_num_links]);
self.iframe_link_attacher_num_links = num_links;
$story_iframe.contents().find('a')
.unbind('click.NB-taskbar')
@ -915,7 +915,7 @@
e.preventDefault();
var $footnote = $('a[name='+href.substr(1)+'], [id='+href.substr(1)+']',
$story_iframe.contents());
// PROTOREAD.log(['Footnote', $footnote, href, href.substr(1)]);
// PROTOPUB.log(['Footnote', $footnote, href, href.substr(1)]);
$story_iframe.contents().scrollTo($footnote, 600, {
axis: 'y',
easing: 'easeInOutQuint',
@ -1052,7 +1052,7 @@
open_feed_intelligence_modal: function(score) {
var feed_id = this.active_feed;
PROTOREAD.classifier = new PROTOREAD.ReaderClassifierFeed(feed_id, score);
PROTOPUB.classifier = new PROTOPUB.ReaderClassifierFeed(feed_id, score);
},
// ===================
@ -1063,7 +1063,7 @@
var self = this;
var $story_pane = this.$story_pane;
// PROTOREAD.log(['$button', $button, this.flags['page_view_showing_feed_view'], $button.hasClass('NB-active'), story_not_found]);
// PROTOPUB.log(['$button', $button, this.flags['page_view_showing_feed_view'], $button.hasClass('NB-active'), story_not_found]);
var $taskbar_buttons = $('.NB-taskbar .task_button_view');
var $feed_view = this.$feed_view;
var $story_iframe = this.$story_iframe;
@ -1154,7 +1154,7 @@
var $stories = $('.NB-feed-stories', $feed_view);
var story = this.active_story;
// PROTOREAD.log(['Showing feed view', this.story_view, this.flags['page_view_showing_feed_view']]);
// PROTOPUB.log(['Showing feed view', this.story_view, this.flags['page_view_showing_feed_view']]);
if (this.story_view == 'page' && this.flags['page_view_showing_feed_view']) {
this.show_correct_story_titles_in_unread_view({'animate': false});
} else if (this.story_view == 'feed') {
@ -1203,7 +1203,7 @@
var $iframe_story = this.find_story_in_story_iframe(story);
this.active_story = story;
// PROTOREAD.log(['Story', story, this.flags.iframe_view_loaded, skip_scrolls]);
// PROTOPUB.log(['Story', story, this.flags.iframe_view_loaded, skip_scrolls]);
this.mark_story_title_as_selected($st);
this.mark_story_as_read(story.id, $st);
@ -1239,7 +1239,7 @@
this.show_correct_stories_in_page_and_feed_view();
}
// PROTOREAD.log(['Opening story', feed_position, iframe_position, feed_position in this.cache.feed_view_story_positions_keys, iframe_position in this.cache.iframe_story_positions_keys]);
// PROTOPUB.log(['Opening story', feed_position, iframe_position, feed_position in this.cache.feed_view_story_positions_keys, iframe_position in this.cache.iframe_story_positions_keys]);
// if (feed_position && !(feed_position in this.cache.feed_view_story_positions_keys)) {
// this.process_stories_location_in_feed_view(0, true);
// }
@ -1249,7 +1249,7 @@
},
switch_to_correct_view: function(found_story_in_page) {
// PROTOREAD.log(['Found story', found_story_in_page, this.story_view, this.flags.iframe_view_loaded, this.flags['page_view_showing_feed_view']]);
// PROTOPUB.log(['Found story', found_story_in_page, this.story_view, this.flags.iframe_view_loaded, this.flags['page_view_showing_feed_view']]);
if (found_story_in_page === false) {
// Story not found, show in feed view with link to page view
if (this.story_view == 'page' && !this.flags['page_view_showing_feed_view']) {
@ -1270,7 +1270,7 @@
var self = this;
var $feed_view = this.$feed_view;
// PROTOREAD.log(['scroll_to_story_in_story_feed', story, $story]);
// PROTOPUB.log(['scroll_to_story_in_story_feed', story, $story]);
if ($story && $story.length) {
if (this.story_view == 'feed' || this.flags['page_view_showing_feed_view']) {
@ -1342,7 +1342,7 @@
for (var s in stories) {
var story = stories[s];
var $story = this.find_story_in_story_iframe(story, $iframe);
// PROTOREAD.log(['Pre-fetching', $story, $iframe, story.story_title]);
// PROTOPUB.log(['Pre-fetching', $story, $iframe, story.story_title]);
if (!$story || !$story.length || this.flags['iframe_fetching_story_locations']) break;
}
}
@ -1375,7 +1375,7 @@
if (story && story['story_feed_id'] == this.active_feed) {
var $story = this.find_story_in_story_iframe(story, $iframe);
// PROTOREAD.log(['Prefetching story', s, story.story_title, $story]);
// PROTOPUB.log(['Prefetching story', s, story.story_title, $story]);
setTimeout(function() {
if ((stories.length-1) >= (s+1)
@ -1389,12 +1389,12 @@
self.fetch_story_locations_in_story_frame(s+1, false, $iframe);
self.flags.iframe_story_locations_fetched = false;
} else {
PROTOREAD.log(['iFrame view entirely loaded', (s-2) + ' stories', self.cache.iframe_stories]);
PROTOPUB.log(['iFrame view entirely loaded', (s-2) + ' stories', self.cache.iframe_stories]);
self.flags.iframe_story_locations_fetched = true;
}
}, 50);
} else if (story && story['story_feed_id'] != this.active_feed) {
PROTOREAD.log(['Switched off iframe early']);
PROTOPUB.log(['Switched off iframe early']);
}
},
@ -1413,7 +1413,7 @@
if (node && node.nodeType == 3) {
// if (node.data.indexOf(story.story_title.substr(0, 20)) >= 0) {
// PROTOREAD.log(['found', {
// PROTOPUB.log(['found', {
// node: node.data.replace(/&nbsp;|[^a-z0-9-]/gi, ''),
// title: title
// }]);
@ -1443,7 +1443,7 @@
$('h1,h2,h3,h4,h5,h6', $iframe).filter(':visible').each(function() {
pos = $(this).text().replace(/&nbsp;|[^a-z0-9-,]/gi, '')
.indexOf(title);
// PROTOREAD.log(['Search headers', title, pos, $(this), $(this).text()]);
// PROTOPUB.log(['Search headers', title, pos, $(this), $(this).text()]);
if (pos >= 0) {
$stories.push($(this));
return false;
@ -1456,14 +1456,14 @@
$('.post,.postProp,#postContent', $iframe).filter(':visible').each(function() {
pos = $(this).text().replace(/&nbsp;|[^a-z0-9-,]/gi, '')
.indexOf(title);
// PROTOREAD.log(['Search .post', title, pos, $(this), $(this).text().replace(/&nbsp;|[^a-z0-9-,]/gi, '')]);
// PROTOPUB.log(['Search .post', title, pos, $(this), $(this).text().replace(/&nbsp;|[^a-z0-9-,]/gi, '')]);
if (pos >= 0) {
$stories.push($(this));
return false;
}
});
}
// PROTOREAD.log(['Found stories', $stories, story.story_title]);
// PROTOPUB.log(['Found stories', $stories, story.story_title]);
var max_size = 0;
var $story;
@ -1484,7 +1484,7 @@
this.cache.iframe_story_positions_keys.push(position);
}
// PROTOREAD.log(['Found story', $story]);
// PROTOPUB.log(['Found story', $story]);
return $story;
},
@ -1521,7 +1521,7 @@
var $this = $(this);
if ($this.data('story_id') == story.id) {
$story_title = $this;
// PROTOREAD.log(['Finding story in story titles', $this, story]);
// PROTOPUB.log(['Finding story in story titles', $this, story]);
return false;
}
});
@ -1544,7 +1544,7 @@
var unread_count_positive = feed.ps;
var unread_count_neutral = feed.nt;
var unread_count_negative = feed.ng;
// PROTOREAD.log(['marked read', unread_count_positive, unread_count_neutral, unread_count_negative, $story_title.is('.NB-story-positive'), $story_title.is('.NB-story-neutral'), $story_title.is('.NB-story-negative')]);
// PROTOPUB.log(['marked read', unread_count_positive, unread_count_neutral, unread_count_negative, $story_title.is('.NB-story-positive'), $story_title.is('.NB-story-neutral'), $story_title.is('.NB-story-negative')]);
if ($story_title.is('.NB-story-positive')) {
var count = Math.max(unread_count_positive-1, 0);
@ -1623,13 +1623,13 @@
mark_story_as_like: function(story_id, $button) {
var feed_id = this.active_feed;
PROTOREAD.classifier = new PROTOREAD.ReaderClassifierStory(story_id, feed_id, 1);
PROTOPUB.classifier = new PROTOPUB.ReaderClassifierStory(story_id, feed_id, 1);
},
mark_story_as_dislike: function(story_id, $button) {
var feed_id = this.active_feed;
PROTOREAD.classifier = new PROTOREAD.ReaderClassifierStory(story_id, feed_id, -1);
PROTOPUB.classifier = new PROTOPUB.ReaderClassifierStory(story_id, feed_id, -1);
},
// ==========
@ -1771,7 +1771,7 @@
$.targetIs(e, { tagSelector: '#story_titles .story' }, function($t, $p){
e.preventDefault();
e.stopPropagation();
// PROTOREAD.log(['Story dblclick', $t]);
// PROTOPUB.log(['Story dblclick', $t]);
var story_id = $('.story_id', $t).text();
var story = self.find_story_in_stories(story_id);
self.open_story_link(story, $t);
@ -1779,7 +1779,7 @@
$.targetIs(e, { tagSelector: '#feed_list .feed' }, function($t, $p){
e.preventDefault();
e.stopPropagation();
// PROTOREAD.log(['Feed dblclick', $('.feed_id', $t), $t]);
// PROTOPUB.log(['Feed dblclick', $('.feed_id', $t), $t]);
var feed_id = $t.data('feed_id');
self.open_feed_link(feed_id, $t);
});
@ -1794,7 +1794,7 @@
var full_height = ($last_story.offset() && $last_story.offset().top) + $last_story.height() - container_offset;
var visible_height = $('#story_titles').height();
var scroll_y = $('#story_titles').scrollTop();
// PROTOREAD.log(['Story_titles Scroll', full_height, container_offset, visible_height, scroll_y]);
// PROTOPUB.log(['Story_titles Scroll', full_height, container_offset, visible_height, scroll_y]);
if (full_height <= visible_height) {
this.load_page_of_feed_stories();
@ -1810,11 +1810,11 @@
var positions = this.cache.iframe_story_positions_keys;
var closest = this.closest(from_top, positions);
var story = this.cache.iframe_story_positions[positions[closest]];
// PROTOREAD.log(['Scroll iframe', from_top, closest, positions[closest], this.cache.iframe_story_positions[positions[closest]]]);
// PROTOPUB.log(['Scroll iframe', from_top, closest, positions[closest], this.cache.iframe_story_positions[positions[closest]]]);
this.navigate_story_titles_to_story(story);
this.iframe_scroll = from_top;
this.flags.iframe_scroll_snap_back_prepared = false;
// PROTOREAD.log(['Setting snap back', this.iframe_scroll]);
// PROTOPUB.log(['Setting snap back', this.iframe_scroll]);
}
},
@ -1834,11 +1834,11 @@
var closest = this.closest(from_top, positions);
var story = this.cache.iframe_story_positions[positions[closest]];
this.flags['mousemove_timeout'] = true;
// PROTOREAD.log(['Mousemove iframe', from_top, closest, positions[closest], this.cache.iframe_story_positions[positions[closest]]]);
// PROTOPUB.log(['Mousemove iframe', from_top, closest, positions[closest], this.cache.iframe_story_positions[positions[closest]]]);
this.navigate_story_titles_to_story(story);
this.iframe_scroll = from_top;
this.flags.iframe_scroll_snap_back_prepared = false;
// PROTOREAD.log(['Setting snap back', this.iframe_scroll]);
// PROTOPUB.log(['Setting snap back', this.iframe_scroll]);
}
},
@ -1851,7 +1851,7 @@
index = parseInt(i, 10);
closest = Math.abs(array[index] - value);
} else if (next_value > 50) {
// PROTOREAD.log(['Not Closest', index, next_value, value, closest]);
// PROTOPUB.log(['Not Closest', index, next_value, value, closest]);
return index;
}
}
@ -1869,7 +1869,7 @@
var positions = this.cache.feed_view_story_positions_keys;
var closest = this.closest(from_top, positions);
var story = this.cache.feed_view_story_positions[positions[closest]];
// PROTOREAD.log(['Scroll feed view', from_top, e, closest, positions[closest], this.cache.feed_view_story_positions_keys, positions, self.cache]);
// PROTOPUB.log(['Scroll feed view', from_top, e, closest, positions[closest], this.cache.feed_view_story_positions_keys, positions, self.cache]);
this.navigate_story_titles_to_story(story);
}
},
@ -1895,7 +1895,7 @@
var closest = this.closest(from_top, positions);
var story = this.cache.feed_view_story_positions[positions[closest]];
this.flags['mousemove_timeout'] = true;
// PROTOREAD.log(['Mousemove feed view', from_top, closest, positions[closest]]);
// PROTOPUB.log(['Mousemove feed view', from_top, closest, positions[closest]]);
this.navigate_story_titles_to_story(story);
}
},
@ -1917,13 +1917,13 @@
clearInterval(this.flags['bouncing_callout']);
PROTOREAD.add_feed = new PROTOREAD.ReaderAddFeed();
PROTOPUB.add_feed = new PROTOPUB.ReaderAddFeed();
},
open_manage_feed_modal: function() {
var feed_id = this.active_feed;
PROTOREAD.manage_feed = new PROTOREAD.ReaderManageFeed(feed_id);
PROTOPUB.manage_feed = new PROTOPUB.ReaderManageFeed(feed_id);
},
// ================
@ -1933,7 +1933,7 @@
load_intelligence_slider: function() {
var self = this;
var $slider = this.$intelligence_slider;
var unread_view = PROTOREAD.Globals.unread_view;
var unread_view = PROTOPUB.Globals.unread_view;
this.switch_feed_view_unread_view(unread_view);
@ -1942,7 +1942,7 @@
min: -1,
max: 1,
step: 1,
value: PROTOREAD.Globals.unread_view,
value: PROTOPUB.Globals.unread_view,
slide: function(e, ui) {
self.switch_feed_view_unread_view(ui.value);
},
@ -1959,7 +1959,7 @@
var unread_view_name = this.get_unread_view_name(unread_view);
var $next_story_button = $('.task_story_next_unread');
PROTOREAD.Globals.unread_view = unread_view;
PROTOPUB.Globals.unread_view = unread_view;
$feed_list.removeClass('unread_view_positive')
.removeClass('unread_view_neutral')
@ -1987,7 +1987,7 @@
if (!visible_only) {
total = feed.ng + feed.nt + feed.ps;
} else {
var unread_view = PROTOREAD.Globals.unread_view;
var unread_view = PROTOPUB.Globals.unread_view;
var unread_view_name = this.get_unread_view_name(unread_view);
if (unread_view_name == 'positive') {
total = feed.ps;
@ -2002,7 +2002,7 @@
show_correct_story_titles_in_unread_view: function(options) {
var self = this;
var unread_view = PROTOREAD.Globals.unread_view;
var unread_view = PROTOPUB.Globals.unread_view;
var $story_titles = this.$story_titles;
var unread_view_name = this.get_unread_view_name(unread_view);
var $stories_show, $stories_hide;
@ -2037,7 +2037,7 @@
if (!this.flags['feed_view_positions_calculated']
|| $stories_show.filter(':visible').length != $stories_show.length
|| $stories_hide.filter(':visible').length != 0) {
// PROTOREAD.log(['Show/Hide stories', $stories_show.filter(':visible').length, $stories_show.length, $stories_hide.filter(':visible').length, $stories_hide.length]);
// PROTOPUB.log(['Show/Hide stories', $stories_show.filter(':visible').length, $stories_show.length, $stories_hide.filter(':visible').length, $stories_hide.length]);
setTimeout(function() {
if (!self.flags['feed_view_positions_calculated']) {
self.process_stories_location_in_feed_view(0, true);
@ -2046,13 +2046,13 @@
}
}
// PROTOREAD.log(['Showing correct stories', this.story_view, this.flags['feed_view_positions_calculated'], unread_view_name, $stories_show.length, $stories_hide.length]);
// PROTOPUB.log(['Showing correct stories', this.story_view, this.flags['feed_view_positions_calculated'], unread_view_name, $stories_show.length, $stories_hide.length]);
if (options['animate']) {
$stories_hide.slideUp(500);
$stories_show.slideDown(500);
setTimeout(function() {
var $story = self.find_story_in_story_titles(self.active_story);
// PROTOREAD.log(['$story', $story]);
// PROTOPUB.log(['$story', $story]);
if ($story && $story.length && $story.is(':visible')) {
var story = self.active_story;
self.active_story = null; // Set is in open_story(), which allows it to scroll.
@ -2139,11 +2139,11 @@
$feed_on_page.replaceWith($feed);
$('.unread_count', $feed).corner('4px');
if (feed_id == this.active_feed) {
PROTOREAD.log(['UPDATING INLINE', feed.feed_title, $feed, $feed_on_page]);
PROTOPUB.log(['UPDATING INLINE', feed.feed_title, $feed, $feed_on_page]);
var limit = $('.story', this.$story_titles).length;
this.model.refresh_feed(feed_id, $.rescope(this.post_refresh_active_feed, this), limit);
} else {
PROTOREAD.log(['UPDATING', feed.feed_title, $feed, $feed_on_page]);
PROTOPUB.log(['UPDATING', feed.feed_title, $feed, $feed_on_page]);
}
}
},
@ -2191,7 +2191,7 @@
$new_story = this.make_story_title(story);
$new_story.css({'display': 'none'});
$first_story.before($new_story);
PROTOREAD.log(['New story', $new_story, $first_story]);
PROTOPUB.log(['New story', $new_story, $first_story]);
}
}
if (new_stories.length) {
@ -2208,7 +2208,7 @@
// ===========
save_profile: function(key, value) {
PROTOREAD.Globals[key] = value;
PROTOPUB.Globals[key] = value;
},
// ========
@ -2245,7 +2245,7 @@
$(document).ready(function() {
PROTOREAD.reader = new PROTOREAD.Reader();
PROTOPUB.reader = new PROTOPUB.Reader();
});

View file

@ -1,13 +1,13 @@
PROTOREAD.ReaderAddFeed = function(feed_id, score, options) {
PROTOPUB.ReaderAddFeed = function(feed_id, score, options) {
var defaults = {};
this.options = $.extend({}, defaults, options);
this.model = PROTOREAD.AssetModel.reader();
this.model = PROTOPUB.AssetModel.reader();
this.google_favicon_url = 'http://www.google.com/s2/favicons?domain_url=';
this.runner();
};
PROTOREAD.ReaderAddFeed.prototype = {
PROTOPUB.ReaderAddFeed.prototype = {
runner: function() {
this.make_modal();
@ -176,7 +176,7 @@ PROTOREAD.ReaderAddFeed.prototype = {
var $loading = $('.NB-fieldset.NB-add-opml .NB-loading');
$loading.addClass('NB-active');
// PROTOREAD.log(['Uploading']);
// PROTOPUB.log(['Uploading']);
$.ajaxFileUpload({
url: '/opml/opml_upload',
secureuri: false,
@ -185,13 +185,13 @@ PROTOREAD.ReaderAddFeed.prototype = {
success: function (data, status)
{
$loading.removeClass('NB-active');
PROTOREAD.reader.load_feeds();
PROTOPUB.reader.load_feeds();
$.modal.close();
},
error: function (data, status, e)
{
$loading.removeClass('NB-active');
PROTOREAD.log(['Error', data, status, e]);
PROTOPUB.log(['Error', data, status, e]);
}
});
@ -232,12 +232,12 @@ PROTOREAD.ReaderAddFeed.prototype = {
},
post_save_add_url: function(e, data) {
PROTOREAD.log(['Data', data]);
PROTOPUB.log(['Data', data]);
var $loading = $('.NB-loading', '.NB-fieldset.NB-add-add-url');
$loading.removeClass('NB-active');
if (data.code > 0) {
PROTOREAD.reader.load_feeds();
PROTOPUB.reader.load_feeds();
$.modal.close();
} else {
var $error = $('.NB-error', '.NB-fieldset.NB-add-add-url');
@ -260,12 +260,12 @@ PROTOREAD.ReaderAddFeed.prototype = {
},
post_save_add_folder: function(e, data) {
PROTOREAD.log(['Data', data]);
PROTOPUB.log(['Data', data]);
var $loading = $('.NB-loading', '.NB-fieldset.NB-add-add-folder');
$loading.removeClass('NB-active');
if (data.code > 0) {
PROTOREAD.reader.load_feeds();
PROTOPUB.reader.load_feeds();
$.modal.close();
} else {
var $error = $('.NB-error', '.NB-fieldset.NB-add-add-folder');

View file

@ -1,4 +1,4 @@
PROTOREAD.ReaderClassifierFeed = function(feed_id, score, options) {
PROTOPUB.ReaderClassifierFeed = function(feed_id, score, options) {
var defaults = {};
this.flags = {
@ -8,13 +8,13 @@ PROTOREAD.ReaderClassifierFeed = function(feed_id, score, options) {
this.feed_id = feed_id;
this.score = score;
this.options = $.extend({}, defaults, options);
this.model = PROTOREAD.AssetModel.reader();
this.model = PROTOPUB.AssetModel.reader();
this.google_favicon_url = 'http://www.google.com/s2/favicons?domain_url=';
this.runner_feed();
};
PROTOREAD.ReaderClassifierStory = function(story_id, feed_id, score, options) {
PROTOPUB.ReaderClassifierStory = function(story_id, feed_id, score, options) {
var defaults = {};
this.flags = {
@ -25,7 +25,7 @@ PROTOREAD.ReaderClassifierStory = function(story_id, feed_id, score, options) {
this.feed_id = feed_id;
this.score = score;
this.options = $.extend({}, defaults, options);
this.model = PROTOREAD.AssetModel.reader();
this.model = PROTOPUB.AssetModel.reader();
this.google_favicon_url = 'http://www.google.com/s2/favicons?domain_url=';
this.runner_story();
};
@ -69,7 +69,7 @@ var classifier = {
var feed = this.feed;
var opinion = (this.score == 1 ? 'like_' : 'dislike_');
PROTOREAD.log(['Make feed', feed, this.feed_authors, this.feed_tags]);
PROTOPUB.log(['Make feed', feed, this.feed_authors, this.feed_tags]);
this.$classifier = $.make('div', { className: 'NB-classifier NB-modal' }, [
this.make_modal_intelligence_slider(),
@ -115,7 +115,7 @@ var classifier = {
var feed = this.feed;
var opinion = (this.score == 1 ? 'like_' : 'dislike_');
PROTOREAD.log(['Make Story', story, feed]);
PROTOPUB.log(['Make Story', story, feed]);
// HTML entities decoding.
story.story_title = $('<div/>').html(story.story_title).text();
@ -475,11 +475,11 @@ var classifier = {
var story_id = this.story_id;
var data = this.serialize_classifier();
PROTOREAD.reader.update_opinions(this.$classifier, this.feed_id);
PROTOPUB.reader.update_opinions(this.$classifier, this.feed_id);
$save.text('Saving...').addClass('NB-disabled').attr('disabled', true);
this.model.save_classifier_publisher(data, function() {
PROTOREAD.reader.force_feed_refresh();
PROTOPUB.reader.force_feed_refresh();
$.modal.close();
});
},
@ -489,16 +489,16 @@ var classifier = {
var story_id = this.story_id;
var data = this.serialize_classifier();
PROTOREAD.reader.update_opinions(this.$classifier, this.feed_id);
PROTOPUB.reader.update_opinions(this.$classifier, this.feed_id);
$save.text('Saving...').addClass('NB-disabled').attr('disabled', true);
this.model.save_classifier_story(story_id, data, function() {
PROTOREAD.reader.force_feed_refresh();
PROTOPUB.reader.force_feed_refresh();
$.modal.close();
});
}
};
PROTOREAD.ReaderClassifierStory.prototype = classifier;
PROTOREAD.ReaderClassifierFeed.prototype = classifier;
PROTOPUB.ReaderClassifierStory.prototype = classifier;
PROTOPUB.ReaderClassifierFeed.prototype = classifier;

View file

@ -1,8 +1,8 @@
PROTOREAD.ReaderManageFeed = function(feed_id, options) {
PROTOPUB.ReaderManageFeed = function(feed_id, options) {
var defaults = {};
this.options = $.extend({}, defaults, options);
this.model = PROTOREAD.AssetModel.reader();
this.model = PROTOPUB.AssetModel.reader();
this.feed_id = feed_id;
this.google_favicon_url = 'http://www.google.com/s2/favicons?domain_url=';
this.counters = {
@ -11,7 +11,7 @@ PROTOREAD.ReaderManageFeed = function(feed_id, options) {
this.runner();
};
PROTOREAD.ReaderManageFeed.prototype = {
PROTOPUB.ReaderManageFeed.prototype = {
runner: function() {
this.feeds = this.model.get_feeds();
@ -171,8 +171,8 @@ PROTOREAD.ReaderManageFeed.prototype = {
if (!$('.NB-classifier', $classifiers).length) {
var $empty_classifier = $.make('div', { className: 'NB-classifier-empty' }, [
'No opinions yet. Use the ',
$.make('img', { src: PROTOREAD.Globals.MEDIA_URL + 'img/reader/thumbs-down.png', className: 'NB-dislike' }),
$.make('img', { src: PROTOREAD.Globals.MEDIA_URL + 'img/reader/thumbs-up.png', className: 'NB-like' }),
$.make('img', { src: PROTOPUB.Globals.MEDIA_URL + 'img/reader/thumbs-down.png', className: 'NB-dislike' }),
$.make('img', { src: PROTOPUB.Globals.MEDIA_URL + 'img/reader/thumbs-up.png', className: 'NB-like' }),
' buttons next to stories.'
]);
$classifiers.append($empty_classifier);
@ -316,11 +316,11 @@ PROTOREAD.ReaderManageFeed.prototype = {
var $save = $('.NB-modal input[type=submit]');
var data = this.serialize_classifier();
PROTOREAD.reader.update_opinions(this.$manage, this.feed_id);
PROTOPUB.reader.update_opinions(this.$manage, this.feed_id);
$save.text('Saving...').addClass('NB-disabled').attr('disabled', true);
this.model.save_classifier_publisher(data, function() {
PROTOREAD.reader.force_feed_refresh();
PROTOPUB.reader.force_feed_refresh();
$.modal.close();
});
},
@ -331,7 +331,7 @@ PROTOREAD.ReaderManageFeed.prototype = {
var feed_id = this.feed_id;
this.model.delete_publisher(feed_id, function() {
PROTOREAD.reader.delete_feed(feed_id);
PROTOPUB.reader.delete_feed(feed_id);
$.modal.close();
});
},

View file

@ -7,11 +7,11 @@ import os
# ===========================
CURRENT_DIR = os.path.dirname(__file__)
PROTOREAD_DIR = CURRENT_DIR
PROTOPUB_DIR = CURRENT_DIR
TEMPLATE_DIRS = (''.join([CURRENT_DIR, '/templates']),)
MEDIA_ROOT = ''.join([CURRENT_DIR, '/media'])
UTILS_ROOT = ''.join([CURRENT_DIR, '/utils'])
LOG_FILE = ''.join([CURRENT_DIR, '/logs/protoread.log'])
LOG_FILE = ''.join([CURRENT_DIR, '/logs/protopub.log'])
# ==============
# = PYTHONPATH =
@ -45,9 +45,9 @@ SECRET_KEY = '6yx-@2u@v$)-=fqm&tc8lhk3$6d68+c7gd%p$q2@o7b4o8-*fz'
# = Enviornment =
# ===============
PRODUCTION = __file__.find('/home/conesus/protoread') == 0
DEV_SERVER1 = __file__.find('/Users/conesus/Projects/protoread') == 0
DEV_SERVER2 = __file__.find('/Users/conesus/protoread') == 0
PRODUCTION = __file__.find('/home/conesus/protopub') == 0
DEV_SERVER1 = __file__.find('/Users/conesus/Projects/protopub') == 0
DEV_SERVER2 = __file__.find('/Users/conesus/protopub') == 0
DEVELOPMENT = DEV_SERVER1 or DEV_SERVER2
logging.basicConfig(level=logging.INFO,
@ -88,7 +88,7 @@ COMPRESS_JS = {
'source_filenames': (
'js/jquery-1.4.2.js',
'js/jquery.easing.js',
'js/jquery.protoread.js',
'js/jquery.protopub.js',
'js/jquery.scrollTo.js',
'js/jquery.timers.js',
'js/jquery.corners.js',
@ -107,11 +107,11 @@ COMPRESS_JS = {
'js/jquery.layout.js',
'js/jquery.tinysort.js',
'js/jquery.fieldselection.js',
'js/protoread/assetmodel.js',
'js/protoread/reader.js',
'js/protoread/reader_classifier.js',
'js/protoread/reader_add_feed.js',
'js/protoread/reader_manage_feed.js',
'js/protopub/assetmodel.js',
'js/protopub/reader.js',
'js/protopub/reader_classifier.js',
'js/protopub/reader_add_feed.js',
'js/protopub/reader_manage_feed.js',
),
'output_filename': 'js/all-compressed-?.js'
}
@ -156,7 +156,7 @@ DEBUG_TOOLBAR_PANELS = (
# = Miscellaneous Settings =
# ==========================
AUTH_PROFILE_MODULE = 'protoread.UserProfile'
AUTH_PROFILE_MODULE = 'protopub.UserProfile'
TEST_DATABASE_COLLATION = 'utf8_general_ci'
ROOT_URLCONF = 'urls'
INTERNAL_IPS = ('127.0.0.1',)

View file

@ -1,3 +1,3 @@
<h1>It's a 404!</h1>
<p><a href="{% url index %}">Return to Protoread</a></p>
<p><a href="{% url index %}">Return to Protopub</a></p>

View file

@ -2,4 +2,4 @@
<p>The error has been e-mailed and will hopefully be fixed so you won't have to see this again.</p>
<p><a href="{% url index %}">Return to Protoread</a></p>
<p><a href="{% url index %}">Return to Protopub</a></p>

View file

@ -2,7 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>{% block title %}Protoread{% endblock %}</title>
<title>{% block title %}Protopub{% endblock %}</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link rel="shortcut icon" HREF="/media/img/favicon.png">
@ -12,8 +12,8 @@
<script type="text/javascript" charset="utf-8">
var PROTOREAD = {};
PROTOREAD.Globals = {
var PROTOPUB = {};
PROTOPUB.Globals = {
'is_authenticated': {% if user.is_authenticated %}true{% else %}false{% endif %},
'is_anonymous': {% if user.is_anonymous %}true{% else %}false{% endif %},
'username': "{{ user.username|safe }}",

View file

@ -1,6 +1,6 @@
<script>
PROTOREAD.Globals = {
PROTOPUB.Globals = {
logged_in: '{{ user }}'
};

View file

@ -2,7 +2,7 @@
{% block content %}
<h1 class="NB-splash-heading">Protoread</h1>
<h1 class="NB-splash-heading">Protopub</h1>
<h2 class="NB-splash-heading">- A feed reader with intelligence.</h2>
<div id="NB-splash">

View file

@ -23,8 +23,8 @@ import socket
# http://feedjack.googlecode.com
VERSION = '0.9'
URL = 'http://www.protoread.com/'
USER_AGENT = 'Protoread %s - %s' % (VERSION, URL)
URL = 'http://www.protopub.com/'
USER_AGENT = 'Protopub %s - %s' % (VERSION, URL)
SLOWFEED_WARNING = 10
ENTRY_NEW, ENTRY_UPDATED, ENTRY_SAME, ENTRY_ERR = range(4)
FEED_OK, FEED_SAME, FEED_ERRPARSE, FEED_ERRHTTP, FEED_ERREXC = range(5)