diff --git a/less/categories.less b/less/categories.less index 7bc8288..7b73232 100644 --- a/less/categories.less +++ b/less/categories.less @@ -35,7 +35,6 @@ line-height: 22px; margin: 0; margin-left: 62px; - width: 85%; strong { color: @gray-dark; diff --git a/less/category.less b/less/category.less index f9e950e..d5c003b 100644 --- a/less/category.less +++ b/less/category.less @@ -50,7 +50,6 @@ .transition(.2s ease-in-out opacity); } - width: 50px; float: left; } @@ -70,8 +69,13 @@ font-size: 10px; background: lighten(@gray-lighter, 2.5%); padding: 5px; + white-space: nowrap; } } + + .fa-stack { + font-size: 90%; + } } &:last-child li { @@ -84,6 +88,8 @@ font-weight: bold; } } + + } .category, .categories, .subcategory { diff --git a/less/mobile.less b/less/mobile.less index 3a45f44..448a70c 100644 --- a/less/mobile.less +++ b/less/mobile.less @@ -1,8 +1,17 @@ -#menu { + +.slideout-menu { + position: fixed; + left: auto; + top: 0; + bottom: 0; + right: 0; + z-index: 0; + width: 256px; + overflow-y: auto; + -webkit-overflow-scrolling: touch; display: none; } - @media (max-width: 980px) { body { padding-top: 0; @@ -20,6 +29,7 @@ } #menu { + padding-top: 100px; background-color: #1D1F20; background-image: linear-gradient(145deg, #1D1F20, #404348); @@ -69,7 +79,7 @@ .counter { font-style: normal; - + &:after { left: 5px; top: -1px; @@ -120,19 +130,6 @@ } } - .slideout-menu { - position: fixed; - left: auto; - top: 0; - bottom: 0; - right: 0; - z-index: 0; - width: 256px; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - display: none; - } - .slideout-panel { position: relative; z-index: 1; @@ -148,7 +145,7 @@ .slideout-open .slideout-menu { display: block; } - + .slideout-open { overflow-y: hidden; height: 100%; diff --git a/less/topic.less b/less/topic.less index 36a1b2b..ce04f0d 100644 --- a/less/topic.less +++ b/less/topic.less @@ -2,7 +2,7 @@ h1 { line-height: 40px; margin-bottom: 30px; - + .topic-title { font-size: 28px; color:inherit; @@ -64,6 +64,19 @@ right: 25px; } + .bookmarked { + position: absolute; + top: 1px; + padding-top: 3px; + border-radius: 4px; + right: 72px; + font-size: 10px; + padding-bottom: 4px; + background: darken(@brand-info, 20%); + opacity: 0; + .transition(0.75s ease-in-out opacity); + } + [component="post/upvote"], [component="post/downvote"] { color: @gray-light; } @@ -110,9 +123,10 @@ .post-tools { text-transform: lowercase; - :before { + a::before { content: "\2022\0020"; } + a { .pointer; } @@ -241,13 +255,17 @@ border-color: darken(@brand-info, 20%); box-shadow: 0px 0px 1px @brand-info; } + + &.highlight .bookmarked { + opacity: 1; + } } .content { .fix-lists; blockquote { - font-size: 85%; + font-size: 12px; } > blockquote { @@ -305,6 +323,25 @@ } } } + + .pagination-block { + position: fixed; + width: 100%; + background-color: #eee; + bottom: 0px; + left: 0px; + z-index: 100; + + .wrapper { + padding: 5px 0px 5px 0px; + } + .progress-bar { + background-color: @brand-info; + display:block; + z-index: -1; + position: absolute; + } + } } .thread_active_users { diff --git a/lib/modules/slideout.min.js b/lib/modules/slideout.min.js index e381bf0..ba1afcf 100644 --- a/lib/modules/slideout.min.js +++ b/lib/modules/slideout.min.js @@ -1 +1,485 @@ -!function(t){var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Slideout=t()}(function(){var t,e,n;return function i(t,e,n){function o(s,a){if(!e[s]){if(!t[s]){var u=typeof require=="function"&&require;if(!a&&u)return u(s,!0);if(r)return r(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return o(n?n:e)},l,l.exports,i,t,e,n)}return e[s].exports}var r=typeof require=="function"&&require;for(var s=0;st._tolerance?t.open():t.close()}t._moved=false});this.panel.addEventListener(l.move,function(e){if(s||t._preventOpen||typeof e.touches==="undefined"){return}var n=e.touches[0].clientX-t._startOffsetX;var i=t._currentOffsetX=n;if(Math.abs(i)>t._padding){return}if(Math.abs(n)>20){t._opening=true;var o=n*t._orientation;if(t._opened&&o>0||!t._opened&&o<0){return}if(o<=0){i=n+t._padding*t._orientation;t._opening=false}if(!t._moved&&u.className.search("slideout-open")===-1){u.className+=" slideout-open"}t.panel.style[p+"transform"]=t.panel.style.transform="translate3d("+i+"px, 0, 0)";t.emit("translate",i);t._moved=true}})};e.exports=d},{decouple:2,emitter:3}],2:[function(t,e,n){"use strict";var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function o(t,e,n){var o,r=false;function s(t){o=t;a()}function a(){if(!r){i(u);r=true}}function u(){n.call(t,o);r=false}t.addEventListener(e,s,false)}e.exports=o},{}],3:[function(t,e,n){"use strict";var i=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};n.__esModule=true;var o=function(){function t(){i(this,t)}t.prototype.on=function e(t,n){this._eventCollection=this._eventCollection||{};this._eventCollection[t]=this._eventCollection[t]||[];this._eventCollection[t].push(n);return this};t.prototype.once=function n(t,e){var n=this;function i(){n.off(t,i);e.apply(this,arguments)}i.listener=e;this.on(t,i);return this};t.prototype.off=function o(t,e){var n=undefined;if(!this._eventCollection||!(n=this._eventCollection[t])){return this}n.forEach(function(t,i){if(t===e||t.listener===e){n.splice(i,1)}});if(n.length===0){delete this._eventCollection[t]}return this};t.prototype.emit=function r(t){var e=this;for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o self._tolerance) ? self.open() : self.close(); + } + self._moved = false; + }; + this.panel.addEventListener(touch.end, this._onTouchEndFn); + + /** + * Translates panel on touchmove + */ + this._onTouchMoveFn = function(eve) { + self.emit('touchmove', eve.target); + if (scrolling || self._preventOpen || typeof eve.touches === 'undefined') { return; } + + var dif_x = eve.touches[0].clientX - self._startOffsetX; + var translateX = self._currentOffsetX = dif_x; + + if (Math.abs(translateX) > self._padding) { return; } + + if (Math.abs(dif_x) > 20) { + self._opening = true; + + var oriented_dif_x = dif_x * self._orientation; + if (self._opened && oriented_dif_x > 0 || !self._opened && oriented_dif_x < 0) { return; } + if (oriented_dif_x <= 0) { + translateX = dif_x + self._padding * self._orientation; + self._opening = false; + } + + if (!self._moved && html.className.search('slideout-open') === -1) { + html.className += ' slideout-open'; + } + + self.panel.style[prefix + 'transform'] = self.panel.style.transform = 'translate3d(' + translateX + 'px, 0, 0)'; + self.emit('translate', translateX, eve.target); + self._moved = true; + } + + }; + this.panel.addEventListener(touch.move, this._onTouchMoveFn); +}; + +Slideout.prototype.enableTouch = function() { + this._touch = true; + return this; +}; + +Slideout.prototype.disableTouch = function() { + this._touch = false; + return this; +}; + +Slideout.prototype.destroy = function() { + // Close before clean + this.close(); + + // Remove event listeners + doc.removeEventListener(touch.move, this._preventMove); + this.panel.removeEventListener(touch.start, this._resetTouchFn); + this.panel.removeEventListener('touchcancel', this._onTouchCancelFn); + this.panel.removeEventListener(touch.end, this._onTouchEndFn); + this.panel.removeEventListener(touch.move, this._onTouchMoveFn); + doc.removeEventListener('scroll', this._onScrollFn); + + // Remove methods + this.open = this.close = function() {}; + + // Return the instance so it can be easily dereferenced + return this; +}; + +/** + * Expose Slideout + */ +module.exports = Slideout; + +},{"decouple":2,"emitter":3}],2:[function(require,module,exports){ +'use strict'; + +var requestAnimFrame = (function() { + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + function (callback) { + window.setTimeout(callback, 1000 / 60); + }; +}()); + +function decouple(node, event, fn) { + var eve, + tracking = false; + + function captureEvent(e) { + eve = e; + track(); + } + + function track() { + if (!tracking) { + requestAnimFrame(update); + tracking = true; + } + } + + function update() { + fn.call(node, eve); + tracking = false; + } + + node.addEventListener(event, captureEvent, false); + return captureEvent; +} + +/** + * Expose decouple + */ +module.exports = decouple; + +},{}],3:[function(require,module,exports){ +"use strict"; + +var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; + +exports.__esModule = true; +/** + * Creates a new instance of Emitter. + * @class + * @returns {Object} Returns a new instance of Emitter. + * @example + * // Creates a new instance of Emitter. + * var Emitter = require('emitter'); + * + * var emitter = new Emitter(); + */ + +var Emitter = (function () { + function Emitter() { + _classCallCheck(this, Emitter); + } + + /** + * Adds a listener to the collection for the specified event. + * @memberof! Emitter.prototype + * @function + * @param {String} event - The event name. + * @param {Function} listener - A listener function to add. + * @returns {Object} Returns an instance of Emitter. + * @example + * // Add an event listener to "foo" event. + * emitter.on('foo', listener); + */ + + Emitter.prototype.on = function on(event, listener) { + // Use the current collection or create it. + this._eventCollection = this._eventCollection || {}; + + // Use the current collection of an event or create it. + this._eventCollection[event] = this._eventCollection[event] || []; + + // Appends the listener into the collection of the given event + this._eventCollection[event].push(listener); + + return this; + }; + + /** + * Adds a listener to the collection for the specified event that will be called only once. + * @memberof! Emitter.prototype + * @function + * @param {String} event - The event name. + * @param {Function} listener - A listener function to add. + * @returns {Object} Returns an instance of Emitter. + * @example + * // Will add an event handler to "foo" event once. + * emitter.once('foo', listener); + */ + + Emitter.prototype.once = function once(event, listener) { + var self = this; + + function fn() { + self.off(event, fn); + listener.apply(this, arguments); + } + + fn.listener = listener; + + this.on(event, fn); + + return this; + }; + + /** + * Removes a listener from the collection for the specified event. + * @memberof! Emitter.prototype + * @function + * @param {String} event - The event name. + * @param {Function} listener - A listener function to remove. + * @returns {Object} Returns an instance of Emitter. + * @example + * // Remove a given listener. + * emitter.off('foo', listener); + */ + + Emitter.prototype.off = function off(event, listener) { + + var listeners = undefined; + + // Defines listeners value. + if (!this._eventCollection || !(listeners = this._eventCollection[event])) { + return this; + } + + listeners.forEach(function (fn, i) { + if (fn === listener || fn.listener === listener) { + // Removes the given listener. + listeners.splice(i, 1); + } + }); + + // Removes an empty event collection. + if (listeners.length === 0) { + delete this._eventCollection[event]; + } + + return this; + }; + + /** + * Execute each item in the listener collection in order with the specified data. + * @memberof! Emitter.prototype + * @function + * @param {String} event - The name of the event you want to emit. + * @param {...Object} data - Data to pass to the listeners. + * @returns {Object} Returns an instance of Emitter. + * @example + * // Emits the "foo" event with 'param1' and 'param2' as arguments. + * emitter.emit('foo', 'param1', 'param2'); + */ + + Emitter.prototype.emit = function emit(event) { + var _this = this; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var listeners = undefined; + + // Defines listeners value. + if (!this._eventCollection || !(listeners = this._eventCollection[event])) { + return this; + } + + // Clone listeners + listeners = listeners.slice(0); + + listeners.forEach(function (fn) { + return fn.apply(_this, args); + }); + + return this; + }; + + return Emitter; +})(); + +/** + * Exports Emitter + */ +exports["default"] = Emitter; +module.exports = exports["default"]; +},{}]},{},[1])(1) +}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJpbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9kZWNvdXBsZS9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9lbWl0dGVyL2Rpc3QvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUNBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFD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50cy5sZW5ndGgsIGFyZ3MgPSBBcnJheShfbGVuID4gMSA/IF9sZW4gLSAxIDogMCksIF9rZXkgPSAxOyBfa2V5IDwgX2xlbjsgX2tleSsrKSB7XG4gICAgICBhcmdzW19rZXkgLSAxXSA9IGFyZ3VtZW50c1tfa2V5XTtcbiAgICB9XG5cbiAgICB2YXIgbGlzdGVuZXJzID0gdW5kZWZpbmVkO1xuXG4gICAgLy8gRGVmaW5lcyBsaXN0ZW5lcnMgdmFsdWUuXG4gICAgaWYgKCF0aGlzLl9ldmVudENvbGxlY3Rpb24gfHwgIShsaXN0ZW5lcnMgPSB0aGlzLl9ldmVudENvbGxlY3Rpb25bZXZlbnRdKSkge1xuICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgLy8gQ2xvbmUgbGlzdGVuZXJzXG4gICAgbGlzdGVuZXJzID0gbGlzdGVuZXJzLnNsaWNlKDApO1xuXG4gICAgbGlzdGVuZXJzLmZvckVhY2goZnVuY3Rpb24gKGZuKSB7XG4gICAgICByZXR1cm4gZm4uYXBwbHkoX3RoaXMsIGFyZ3MpO1xuICAgIH0pO1xuXG4gICAgcmV0dXJuIHRoaXM7XG4gIH07XG5cbiAgcmV0dXJuIEVtaXR0ZXI7XG59KSgpO1xuXG4vKipcbiAqIEV4cG9ydHMgRW1pdHRlclxuICovXG5leHBvcnRzW1wiZGVmYXVsdFwiXSA9IEVtaXR0ZXI7XG5tb2R1bGUuZXhwb3J0cyA9IGV4cG9ydHNbXCJkZWZhdWx0XCJdOyJdfQ== \ No newline at end of file diff --git a/lib/persona.js b/lib/persona.js index bfd56f2..14530bf 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -6,7 +6,6 @@ $(document).ready(function() { setupNProgress(); setupTaskbar(); setupEditedByIcon(); - setupPaginator(); setupMobileMenu(); var env = utils.findBootstrapEnvironment(); @@ -88,81 +87,13 @@ $(document).ready(function() { $(window).on('action:posts.loaded', activateEditedTooltips); } - function setupPaginator() { - function appendPageNumber(ev, data) { - var el = data.after ? data.after : data.before; - if (!el) { - return; - } - var page = Math.ceil((el.attr('data-index') - 1) / config.postsPerPage), - handle = $('
' + page + '
'), - shadow = $('
'); - - el.append(handle); - el.append(shadow); - - handle.tooltip({ - title: 'Slide to paginate', - placement: 'auto left' - }); - - var dragging = false, originalX = 0, toPage = page; - handle.on('touchstart', function(ev) { - dragging = true; - originalX = ev.originalEvent.touches[0].clientX; - }); - - $('#content').on('touchend', function() { - if (dragging === true) { - dragging = false; - if (page !== toPage) { - ajaxify.go('topic/' + ajaxify.data.slug + '/' + (toPage * config.postsPerPage)); - } - - shadow.removeClass('active'); - } - }); - - $('#content').on('touchmove', function(ev) { - if (!dragging) { - return; - } - - var distance = ev.originalEvent.touches[0].clientX - originalX, - handlePos = parseInt(handle.css('left'), 10), - postWidth = handle.parents('[component="post"]').width(); - - toPage = Math.ceil((handlePos + distance) / postWidth * ajaxify.data.pageCount); - - if (toPage >= ajaxify.data.pageCount) { - toPage = (ajaxify.data.pageCount - 1); - } - - if (toPage < 0) { - toPage = 0; - } - - if (parseInt(handle.html(), 10) !== toPage) { - handle.html(toPage); - handle.removeClass('animated'); - setTimeout(function() { handle.addClass('animated');}, 10); - } - - shadow.addClass('active'); - shadow.css('left', toPage / ajaxify.data.pageCount * postWidth + 'px'); - }); - - handle.css('left', page / ajaxify.data.pageCount * handle.parents('[component="post"]').width() + 'px'); - } - - $(window).on('action:posts.loading', appendPageNumber); - } - function setupMobileMenu() { if (!window.addEventListener) { return; } + $('#menu').removeClass('hidden'); + var slideout = new Slideout({ 'panel': document.getElementById('panel'), 'menu': document.getElementById('menu'), @@ -172,7 +103,6 @@ $(document).ready(function() { }); $('#mobile-menu').on('click', function() { - $('#menu').show(); slideout.toggle(); }); @@ -180,11 +110,7 @@ $(document).ready(function() { slideout.close(); }); - $(window).on('resize', function() { - slideout.close(); - }); - - $(window).on('action:ajaxify.start', function() { + $(window).on('resize action:ajaxify.start', function() { slideout.close(); }); @@ -194,8 +120,6 @@ $(document).ready(function() { } function openingMenu() { - $('#menu').show(); - $('#header-menu').css({ 'top': $(window).scrollTop() + 'px', 'position': 'absolute' @@ -211,9 +135,13 @@ $(document).ready(function() { }); } - slideout.on('beforeopen', openingMenuAndLoad); slideout.on('open', openingMenuAndLoad); - slideout.on('translate', openingMenu); + slideout.on('touchmove', function(target) { + var $target = $(target); + if ($target.length && ($target.is('code') || $target.parents('code').length)) { + slideout._preventOpen = true; + } + }); slideout.on('close', function() { $('#header-menu').css({ @@ -221,7 +149,6 @@ $(document).ready(function() { 'position': 'fixed' }); $('.slideout-open').removeClass('slideout-open'); - $('#menu').hide(); }); $('#menu [data-section="navigation"] ul').html($('#main-nav').html() + ($('#logged-out-menu').html() || '')); diff --git a/modules.less b/modules.less index ec1d8e7..5f41036 100644 --- a/modules.less +++ b/modules.less @@ -1,3 +1,2 @@ @import "modules/taskbar"; -@import "modules/alerts"; -@import "modules/paginator"; \ No newline at end of file +@import "modules/alerts"; \ No newline at end of file diff --git a/modules/paginator.less b/modules/paginator.less deleted file mode 100644 index e8a69dc..0000000 --- a/modules/paginator.less +++ /dev/null @@ -1,41 +0,0 @@ -.topic { - .page-number { - position: absolute; - bottom: 6px; - background: rgb(219, 68, 55); - padding: 4px; - width: 26px; - height: 26px; - text-align: center; - border-radius: 50%; - color: white; - font-size: 11px; - z-index: 1; - - .user-select(none); - - &.animated { - -webkit-animation-name: bounceIn; - animation-name: bounceIn; - -webkit-animation-duration: 0.5s; - animation-duration: 0.5s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - } - } - - .shadow.active { - border-radius: 50%; - width: 13px; - height: 13px; - border: 1px solid #333; - position: absolute; - bottom: 13px; - } - - @media (min-width: @screen-md-min) { - .page-number { - display: none; - } - } -} \ No newline at end of file diff --git a/package.json b/package.json index d398fd6..99c1140 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "nodebb-theme-persona", - "version": "3.0.23", + "version": "3.0.38", "nbbpm": { - "compatibility": "^0.9.0" + "compatibility": "^0.8.2" }, "description": "Persona theme for NodeBB", "main": "theme.less", diff --git a/templates/account/edit.tpl b/templates/account/edit.tpl index 207582d..19f6445 100644 --- a/templates/account/edit.tpl +++ b/templates/account/edit.tpl @@ -145,6 +145,7 @@
+
@@ -155,10 +156,8 @@
+ - - - diff --git a/templates/footer.tpl b/templates/footer.tpl index e93b664..ff8493d 100644 --- a/templates/footer.tpl +++ b/templates/footer.tpl @@ -1,7 +1,7 @@ -
+
diff --git a/templates/header.tpl b/templates/header.tpl index 9d3d860..c0da56e 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -38,7 +38,7 @@ -
+ diff --git a/templates/partials/modals/upload_picture_from_url_modal.tpl b/templates/partials/modals/upload_picture_from_url_modal.tpl index b8d1222..f2a5545 100644 --- a/templates/partials/modals/upload_picture_from_url_modal.tpl +++ b/templates/partials/modals/upload_picture_from_url_modal.tpl @@ -1,4 +1,4 @@ -