Merge branch 'v3'

Conflicts:
	.gitignore
	CHANGELOG.md
	Gruntfile.coffee
	LICENSE
	builds/4chan-X.js
	builds/4chan-X.meta.js
	builds/4chan-X.user.js
	builds/crx/manifest.json
	builds/crx/script.js
	latest.js
	package.json
	src/General/Config.coffee
This commit is contained in:
Zixaphir 2013-06-01 09:00:56 -07:00
commit 2c2a40c0c9
10 changed files with 35 additions and 103 deletions

6
.gitignore vendored
View File

@ -4,6 +4,12 @@ node_modules/
tmp-crx/
tmp-userjs/
tmp-userscript/
<<<<<<< HEAD
builds/4chan-X.zip
Gruntfile.js
builds/4chan-*
=======
builds/4chan-X-Chrome.zip
builds/4chan-X-Opera.nex
Gruntfile.js
>>>>>>> v3

View File

@ -1,3 +1,6 @@
**seaweedchan**:
- Small bug fixes
### v2.0.6
*2013-05-29*

View File

@ -82,6 +82,9 @@ module.exports = (grunt) ->
dest: 'builds/crx/'
expand: true
flatten: true
opera:
files:
'builds/<%= pkg.name %>.nex': 'builds/<%= pkg.name %>.zip'
coffee:
script:
@ -200,6 +203,7 @@ module.exports = (grunt) ->
grunt.registerTask 'release', [
'default'
'compress:crx'
'copy:opera'
'shell:commit'
'shell:push'
]

View File

@ -5278,6 +5278,9 @@
if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link']) {
return;
}
if (Conf['Reply Hiding Buttons']) {
$.addClass(doc, "reply-hide");
}
this.db = new DataBoard('hiddenPosts');
return Post.prototype.callbacks.push({
name: 'Reply Hiding',

View File

@ -5274,6 +5274,9 @@
if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link']) {
return;
}
if (Conf['Reply Hiding Buttons']) {
$.addClass(doc, "reply-hide");
}
this.db = new DataBoard('hiddenPosts');
return Post.prototype.callbacks.push({
name: 'Reply Hiding',

View File

@ -117,7 +117,6 @@
'Thread Expansion': [true, 'Add buttons to expand threads.'],
'Index Navigation': [false, 'Add buttons to navigate between threads.'],
'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'],
'Check for Updates': [true, 'Check for updated versions of appchan x.'],
'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'],
'Remove Spoilers': [false, 'Remove all spoilers in text.'],
'Indicate Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled.']
@ -5276,6 +5275,9 @@
if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !Conf['Reply Hiding Link']) {
return;
}
if (Conf['Reply Hiding Buttons']) {
$.addClass(doc, "reply-hide");
}
this.db = new DataBoard('hiddenPosts');
return Post.prototype.callbacks.push({
name: 'Reply Hiding',
@ -14736,8 +14738,7 @@
}
Main.callbackNodes(Thread, threads);
Main.callbackNodesDB(Post, posts, function() {
$.event('4chanXInitFinished');
return Main.checkUpdate();
return $.event('4chanXInitFinished');
});
if (styleSelector = $.id('styleSelector')) {
passLink = $.el('a', {
@ -14757,8 +14758,7 @@
err = _error;
new Notification('warning', 'Cookies need to be enabled on 4chan for appchan x to properly function.', 30);
}
$.event('4chanXInitFinished');
return Main.checkUpdate();
return $.event('4chanXInitFinished');
},
callbackNodes: function(klass, nodes) {
var callback, err, errors, i, len, node, _i, _len, _ref;
@ -14865,40 +14865,6 @@
obj.callback.isAddon = true;
return Klass.prototype.callbacks.push(obj.callback);
},
message: function(e) {
var el, version;
version = e.data.version;
if (version && version !== g.VERSION) {
el = $.el('span', {
innerHTML: "Update: appchan x v" + version + " is out, get it <a href=http://zixaphir.github.com/appchan-x/ target=_blank>here</a>."
});
return new Notification('info', el, 120);
}
},
checkUpdate: function() {
var now;
if (!(Conf['Check for Updates'] && Main.isThisPageLegit())) {
return;
}
now = Date.now();
return $.get('lastchecked', 0, function(_arg) {
var lastchecked;
lastchecked = _arg.lastchecked;
if (lastchecked > now - $.DAY) {
return;
}
return $.ready(function() {
$.on(window, 'message', Main.message);
$.set('lastchecked', now);
return $.add(d.head, $.el('script', {
src: 'https://github.com/zixaphir/appchan-x/raw/master/latest.js'
}));
});
});
},
handleErrors: function(errors) {
var div, error, logs, _i, _len;

View File

@ -2,6 +2,9 @@ PostHiding =
init: ->
return if g.VIEW is 'catalog' or !Conf['Reply Hiding Buttons'] and !Conf['Reply Hiding Link']
if Conf['Reply Hiding Buttons']
$.addClass doc, "reply-hide"
@db = new DataBoard 'hiddenPosts'
Post::callbacks.push
name: 'Reply Hiding'

View File

@ -49,10 +49,12 @@ Config =
false
'Add buttons to navigate to top / bottom of thread.'
]
<% if (type !== 'crx') { %>
'Check for Updates': [
true
'Check for updated versions of <%= meta.name %>.'
]
<% } %>
'Color User IDs': [
false
'Assign unique colors to user IDs on boards that use them'

View File

@ -194,7 +194,9 @@ Main =
Main.callbackNodes Thread, threads
Main.callbackNodesDB Post, posts, ->
$.event '4chanXInitFinished'
<% if (type !== 'crx') { %>
Main.checkUpdate()
<% } %>
if styleSelector = $.id 'styleSelector'
passLink = $.el 'a',
@ -214,7 +216,9 @@ Main =
new Notification 'warning', 'Cookies need to be enabled on 4chan for <%= meta.name %> to properly function.', 30
$.event '4chanXInitFinished'
<% if (type !== 'crx') { %>
Main.checkUpdate()
<% } %>
callbackNodes: (klass, nodes) ->
# get the nodes' length only once
@ -288,6 +292,7 @@ Main =
obj.callback.isAddon = true
Klass::callbacks.push obj.callback
<% if (type !== 'crx') { %>
message: (e) ->
{version} = e.data
if version and version isnt g.VERSION
@ -306,6 +311,7 @@ Main =
$.set 'lastchecked', now
$.add d.head, $.el 'script',
src: '<%= meta.repo %>raw/<%= meta.mainBranch %>/latest.js'
<% } %>
handleErrors: (errors) ->
unless errors instanceof Array

View File

@ -1,64 +0,0 @@
/* General */
:root.tomorrow .dialog {
background-color: #282A2E;
border-color: #111;
}
/* Header */
:root.tomorrow #header-bar, :root.tomorrow #notifications {
font-size: 9pt;
color: #C5C8C6;
}
:root.tomorrow #header-bar a, :root.tomorrow #notifications a {
color: #81A2BE;
}
/* Settings */
:root.tomorrow #fourchanx-settings fieldset {
border-color: #111;
}
/* Quote */
:root.tomorrow .backlink.deadlink {
color: #81A2BE !important;
}
:root.tomorrow .inline {
border-color: #111;
background-color: rgba(0, 0, 0, .14);
}
/* QR */
.tomorrow #dump-list::-webkit-scrollbar-thumb {
background-color: #282A2E;
border-color: #111;
}
:root.tomorrow .qr-preview {
background-color: rgba(255, 255, 255, .15);
}
:root.tomorrow #qr .field {
background-color: rgb(26, 27, 29);
color: rgb(197,200,198);
border-color: rgb(40, 41, 42);
}
:root.tomorrow #qr .field:focus {
border-color: rgb(129, 162, 190) !important;
background-color: rgb(30,32,36);
}
/* Menu */
:root.tomorrow #menu {
color: #C5C8C6;
}
:root.tomorrow .entry {
border-bottom: 1px solid #111;
font-size: 10pt;
}
:root.tomorrow .focused.entry {
background: rgba(0, 0, 0, .33);
}
/* Watcher Favicon */
:root.tomorrow .watch-thread-link
{
background-image: url("data:image/svg+xml,<svg viewBox='0 0 26 26' preserveAspectRatio='true' xmlns='http://www.w3.org/2000/svg'><path fill='rgb(197,200,198)' d='M24.132,7.971c-2.203-2.205-5.916-2.098-8.25,0.235L15.5,8.588l-0.382-0.382c-2.334-2.333-6.047-2.44-8.25-0.235c-2.204,2.203-2.098,5.916,0.235,8.249l8.396,8.396l8.396-8.396C26.229,13.887,26.336,10.174,24.132,7.971z'/></svg>");
}