diff --git a/4chan_x.user.js b/4chan_x.user.js index c235e49fa..a0b6d1bd1 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -473,6 +473,7 @@ } $.extend(r, callbacks); $.extend(r.upload, upCallbacks); + r.withCredentials = type === 'post'; r.send(form); return r; }, @@ -521,11 +522,19 @@ } }, addStyle: function(css) { - var style; + var f, style; style = $.el('style', { textContent: css }); - $.add(d.head || d.documentElement, style); + f = function() { + var root; + if (root = d.head || d.documentElement) { + return $.add(root, style); + } else { + return setTimeout(f, 20); + } + }; + f(); return style; }, x: function(path, root) { @@ -1092,8 +1101,11 @@ return (_ref2 = $.id('boardNavDesktopFoot')) != null ? _ref2.hidden = true : void 0; }, initFeatures: function() { + var settings; if (Conf['Disable 4chan\'s extension']) { - localStorage.setItem('4chan-settings', '{"disableAll":true}'); + settings = JSON.parse(localStorage.getItem('4chan-settings')) || {}; + settings.disableAll = true; + localStorage.setItem('4chan-settings', JSON.stringify(settings)); } if (Conf['Resurrect Quotes']) { try { @@ -1243,7 +1255,7 @@ settings: function() { return alert('Here be settings'); }, - css: "/* general */\n.dialog.reply {\n display: block;\n border: 1px solid rgba(0, 0, 0, .25);\n padding: 0;\n}\n.move {\n cursor: move;\n}\nlabel {\n cursor: pointer;\n}\na[href=\"javascript:;\"] {\n text-decoration: none;\n}\n.warning {\n color: red;\n}\n\n/* 4chan style fixes */\n.opContainer, .op {\n display: block !important;\n}\n.post {\n overflow: visible !important;\n}\n\n/* fixed, z-index */\n#qp, #ihover,\n#updater, #stats,\n#boardNavDesktop.reply,\n#qr, #watcher {\n position: fixed;\n}\n#qp, #ihover {\n z-index: 100;\n}\n#updater, #stats {\n z-index: 90;\n}\n#boardNavDesktop.reply:hover {\n z-index: 80;\n}\n#qr {\n z-index: 50;\n}\n#watcher {\n z-index: 30;\n}\n#boardNavDesktop.reply {\n z-index: 10;\n}\n\n\n/* header */\nbody.fourchan_x {\n margin-top: 2.5em;\n}\n#boardNavDesktop.reply {\n border-width: 0 0 1px;\n padding: 4px;\n top: 0;\n right: 0;\n left: 0;\n transition: opacity .1s ease-in-out;\n -o-transition: opacity .1s ease-in-out;\n -moz-transition: opacity .1s ease-in-out;\n -webkit-transition: opacity .1s ease-in-out;\n}\n#boardNavDesktop.reply:not(:hover) {\n opacity: .4;\n transition: opacity 1.5s .5s ease-in-out;\n -o-transition: opacity 1.5s .5s ease-in-out;\n -moz-transition: opacity 1.5s .5s ease-in-out;\n -webkit-transition: opacity 1.5s .5s ease-in-out;\n}\n#boardNavDesktop.reply a {\n margin: -1px;\n}\n#settings {\n float: right;\n}\n\n/* thread updater */\n#updater {\n text-align: right;\n}\n#updater:not(:hover) {\n background: none;\n border: none;\n}\n#updater input[type=number] {\n width: 4em;\n}\n#updater:not(:hover) > div:not(.move) {\n display: none;\n}\n.new {\n color: limegreen;\n}\n\n/* quote */\n.quotelink.deadlink {\n text-decoration: underline !important;\n}\n.deadlink:not(.quotelink) {\n text-decoration: none !important;\n}\n.inlined {\n opacity: .5;\n}\n#qp input, .forwarded {\n display: none;\n}\n.quotelink.forwardlink,\n.backlink.forwardlink {\n text-decoration: none;\n border-bottom: 1px dashed;\n}\n.inline {\n border: 1px solid rgba(128, 128, 128, .5);\n display: table;\n margin: 2px 0;\n}\n.inline .post {\n border: 0 !important;\n display: table !important;\n margin: 0 !important;\n padding: 1px 2px !important;\n}\n#qp {\n padding: 2px 2px 5px;\n}\n#qp .post {\n border: none;\n margin: 0;\n padding: 0;\n}\n#qp img {\n max-height: 300px;\n max-width: 500px;\n}\n.qphl {\n outline: 2px solid rgba(216, 94, 49, .7);\n}\n\n/* file */\n.fileText:hover .fntrunc,\n.fileText:not(:hover) .fnfull {\n display: none;\n}\n#ihover {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n max-height: 100%;\n max-width: 75%;\n padding-bottom: 16px;\n}" + css: "/* general */\n.dialog.reply {\n display: block;\n border: 1px solid rgba(0, 0, 0, .25);\n padding: 0;\n}\n.move {\n cursor: move;\n}\nlabel {\n cursor: pointer;\n}\na[href=\"javascript:;\"] {\n text-decoration: none;\n}\n.warning {\n color: red;\n}\n\n/* 4chan style fixes */\n.opContainer, .op {\n display: block !important;\n}\n.post {\n overflow: visible !important;\n}\n\n/* fixed, z-index */\n#qp, #ihover,\n#updater, #stats,\n#boardNavDesktop.reply,\n#qr, #watcher {\n position: fixed;\n}\n#qp, #ihover {\n z-index: 100;\n}\n#updater, #stats {\n z-index: 90;\n}\n#boardNavDesktop.reply:hover {\n z-index: 80;\n}\n#qr {\n z-index: 50;\n}\n#watcher {\n z-index: 30;\n}\n#boardNavDesktop.reply {\n z-index: 10;\n}\n\n\n/* header */\nbody.fourchan_x {\n margin-top: 2.5em;\n}\n#boardNavDesktop.reply {\n border-width: 0 0 1px;\n padding: 4px;\n top: 0;\n right: 0;\n left: 0;\n transition: opacity .1s ease-in-out;\n -o-transition: opacity .1s ease-in-out;\n -moz-transition: opacity .1s ease-in-out;\n -webkit-transition: opacity .1s ease-in-out;\n}\n#boardNavDesktop.reply:not(:hover) {\n opacity: .4;\n transition: opacity 1.5s .5s ease-in-out;\n -o-transition: opacity 1.5s .5s ease-in-out;\n -moz-transition: opacity 1.5s .5s ease-in-out;\n -webkit-transition: opacity 1.5s .5s ease-in-out;\n}\n#boardNavDesktop.reply a {\n margin: -1px;\n}\n#settings {\n float: right;\n}\n\n/* thread updater */\n#updater {\n text-align: right;\n}\n#updater:not(:hover) {\n background: none;\n border: none;\n}\n#updater input[type=number] {\n width: 4em;\n}\n#updater:not(:hover) > div:not(.move) {\n display: none;\n}\n.new {\n color: limegreen;\n}\n\n/* quote */\n.quotelink.deadlink {\n text-decoration: underline !important;\n}\n.deadlink:not(.quotelink) {\n text-decoration: none !important;\n}\n.inlined {\n opacity: .5;\n}\n#qp input, .forwarded {\n display: none;\n}\n.quotelink.forwardlink,\n.backlink.forwardlink {\n text-decoration: none;\n border-bottom: 1px dashed;\n}\n.inline {\n border: 1px solid rgba(128, 128, 128, .5);\n display: table;\n margin: 2px 0;\n}\n.inline .post {\n border: 0 !important;\n display: table !important;\n margin: 0 !important;\n padding: 1px 2px !important;\n}\n#qp {\n padding: 2px 2px 5px;\n}\n#qp .post {\n border: none;\n margin: 0;\n padding: 0;\n}\n#qp img {\n max-height: 300px;\n max-width: 500px;\n}\n.qphl {\n box-shadow: 0 0 0 2px rgba(216, 94, 49, .7);\n}\n\n/* file */\n.fileText:hover .fntrunc,\n.fileText:not(:hover) .fnfull {\n display: none;\n}\n#ihover {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n max-height: 100%;\n max-width: 75%;\n padding-bottom: 16px;\n}" }; Redirect = { @@ -1519,7 +1531,7 @@ container = $.el('div', { id: "pc" + postID, className: "postContainer " + (isOP ? 'op' : 'reply') + "Container", - innerHTML: (isOP ? '' : "
>>
") + ("
") + ("
") + ("") + ("" + (name || '') + "") + tripcode + capcodeStart + capcode + userID + flag + sticky + closed + ("
" + subject) + ("
" + date) + '
' + ("No.") + ("" + postID + "") + '
' + '
' + (isOP ? fileHTML : '') + ("
") + (" ") + ("" + subject + " ") + ("") + emailStart + ("" + (name || '') + "") + tripcode + capcodeStart + emailEnd + capcode + userID + flag + sticky + closed + ' ' + ("" + date + " ") + "" + ("No.") + ("" + postID + "") + '' + '
' + (isOP ? '' : fileHTML) + ("
" + (comment || '') + "
") + '
' + innerHTML: (isOP ? '' : "
>>
") + ("
") + ("
") + ("") + ("" + (name || '') + "") + tripcode + capcodeStart + capcode + userID + flag + sticky + closed + ("
" + subject) + ("
" + date) + '
' + ("No.") + ("" + postID + "") + '
' + '
' + (isOP ? fileHTML : '') + ("
") + (" ") + ("" + subject + " ") + ("") + emailStart + ("" + (name || '') + "") + tripcode + capcodeStart + emailEnd + capcode + userID + flag + sticky + closed + ' ' + ("" + date + " ") + "" + ("No.") + ("" + postID + "") + '' + '
' + (isOP ? '' : fileHTML) + ("
" + (comment || '') + "
") + '
' }); _ref = $$('.quotelink', container); for (_i = 0, _len = _ref.length; _i < _len; _i++) { diff --git a/changelog b/changelog index e812ffd98..ac40866e3 100644 --- a/changelog +++ b/changelog @@ -8,6 +8,19 @@ alpha master +2.35.3 +- Mayhem + Larger Comment text input by default for 4chan Pass users and on /f/ (no captcha). + +2.35.2 +- Mayhem + Fix 4chan Pass with QR on Firefox. + +2.35.1 +- Mayhem + Add support for 4chan Pass. + You can now use 'Enter' in keybind combinations. + 2.35.0 - Mayhem Use 4chan's API to fetch posts for: diff --git a/latest.js b/latest.js index 48fe59683..72c0783fb 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'2.35.0'},'*') \ No newline at end of file +postMessage({version:'2.35.3'},'*') \ No newline at end of file diff --git a/script.coffee b/script.coffee index f6c34b33d..d76499a1b 100644 --- a/script.coffee +++ b/script.coffee @@ -357,6 +357,7 @@ $.extend $, r.setRequestHeader key, val $.extend r, callbacks $.extend r.upload, upCallbacks + r.withCredentials = type is 'post' r.send form r cache: (-> @@ -387,8 +388,16 @@ $.extend $, addStyle: (css) -> style = $.el 'style', textContent: css - # XXX Only Chrome has no d.head on document-start. - $.add d.head or d.documentElement, style + # That's terrible. + # XXX tmp fix for scriptish: + # https://github.com/scriptish/scriptish/issues/16 + f = -> + # XXX Only Chrome has no d.head on document-start. + if root = d.head or d.documentElement + $.add root, style + else + setTimeout f, 20 + f() style x: (path, root=d.body) -> # XPathResult.ANY_UNORDERED_NODE_TYPE === 8 @@ -847,7 +856,9 @@ Main = initFeatures: -> if Conf['Disable 4chan\'s extension'] - localStorage.setItem '4chan-settings', '{"disableAll":true}' + settings = JSON.parse(localStorage.getItem '4chan-settings') or {} + settings.disableAll = true + localStorage.setItem '4chan-settings', JSON.stringify settings if Conf['Resurrect Quotes'] try @@ -1127,7 +1138,7 @@ body.fourchan_x { max-width: 500px; } .qphl { - outline: 2px solid rgba(216, 94, 49, .7); + box-shadow: 0 0 0 2px rgba(216, 94, 49, .7); } /* file */ @@ -1450,7 +1461,7 @@ Build = "" + "No." + "