Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and enhancements. [10] #1574

Merged
merged 12 commits into from
Apr 9, 2017
Merged

Fixes and enhancements. [10] #1574

merged 12 commits into from
Apr 9, 2017

Conversation

ivan-nginx
Copy link
Collaborator

@ivan-nginx ivan-nginx commented Apr 7, 2017

PART 1. Some small fixes.

Files modified:

  1. UPD: ru language. 2eee68f
  2. FIX: scroll percent now count only content div. 4bd315d

What's this?

  1. Update russian language for feat: add the configure for declare copyright on posts #1497.
  2. Scroll percent count only post content (without comments iframe preloading, for ex.).

PART 2. Add save_scroll option.

Option for saving vertical scroll position on each post/page in cookies.

Files modified:

  1. ADD: save_scroll option in config. 16f97aa
  2. ADD: save_scroll option in layout. c858f8e
  3. ADD: save_scroll option in third-party. [bridge] 29b94d3
  4. ADD: save_scroll API script (js.cookie v2.1.4). 94287c5
  5. FIX: save_scroll main script file. [4] 0070675

How to use?

In Next _config.yml:

# Automatically saving scroll position on each post/page in cookies.
save_scroll: true

@@ -0,0 +1,25 @@
/* global NexT: true */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'NexT' is defined but never used.


// Read position from cookie
if (Cookies.get('scroll-cookie') !== undefined) {
var cvalues = Cookies.get('scroll-cookie').split('|');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.

});

// Read position from cookie
if (Cookies.get('scroll-cookie') !== undefined) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.

$(window).on('scroll', function() {
clearTimeout(timeout);
timeout = setTimeout(function () {
Cookies.set('scroll-cookie', ($(window).scrollTop() + '|' + rpath), { path: '' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.


// Write position in cookie
var timeout;
$(window).on('scroll', function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.


key = encodeURIComponent(String(key));
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
key = key.replace(/[\(\)]/g, escape);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'escape' is not defined.

registeredInModuleLoader = true;
}
if (typeof exports === 'object') {
module.exports = factory();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'module' is not defined.

;(function (factory) {
var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) {
define(factory);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'define' is not defined.

*/
;(function (factory) {
var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'define' is not defined.

var result = {};
for (; i < arguments.length; i++) {
var attributes = arguments[ i ];
for (var key in attributes) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.

@@ -0,0 +1,25 @@
/* global NexT: true */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'NexT' is defined but never used.


// Read position from cookie
if (Cookies.get('scroll-cookie') !== undefined) {
var cvalues = Cookies.get('scroll-cookie').split('|');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.

});

// Read position from cookie
if (Cookies.get('scroll-cookie') !== undefined) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.

$(window).on('scroll', function() {
clearTimeout(timeout);
timeout = setTimeout(function () {
Cookies.set('scroll-cookie', ($(window).scrollTop() + '|' + rpath), { path: '' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.


// Write position in cookie
var timeout;
$(window).on('scroll', function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.


key = encodeURIComponent(String(key));
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
key = key.replace(/[\(\)]/g, escape);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'escape' is not defined.

registeredInModuleLoader = true;
}
if (typeof exports === 'object') {
module.exports = factory();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'module' is not defined.

;(function (factory) {
var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) {
define(factory);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'define' is not defined.

*/
;(function (factory) {
var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'define' is not defined.

var result = {};
for (; i < arguments.length; i++) {
var attributes = arguments[ i ];
for (var key in attributes) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.

@@ -0,0 +1,25 @@
/* global NexT: true */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'NexT' is defined but never used.


// Read position from cookie
if (Cookies.get('scroll-cookie') !== undefined) {
var cvalues = Cookies.get('scroll-cookie').split('|');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.

});

// Read position from cookie
if (Cookies.get('scroll-cookie') !== undefined) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.

$(window).on('scroll', function() {
clearTimeout(timeout);
timeout = setTimeout(function () {
Cookies.set('scroll-cookie', ($(window).scrollTop() + '|' + rpath), { path: '' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.


// Write position in cookie
var timeout;
$(window).on('scroll', function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.


key = encodeURIComponent(String(key));
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
key = key.replace(/[\(\)]/g, escape);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'escape' is not defined.

registeredInModuleLoader = true;
}
if (typeof exports === 'object') {
module.exports = factory();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'module' is not defined.

;(function (factory) {
var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) {
define(factory);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'define' is not defined.

*/
;(function (factory) {
var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'define' is not defined.

var result = {};
for (; i < arguments.length; i++) {
var attributes = arguments[ i ];
for (var key in attributes) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.

});

// Read position from cookie
if (Cookies.get("scroll-cookie") !== undefined) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Cookies' is not defined.


// Read position from cookie
if (Cookies.get("scroll-cookie") !== undefined) {
var cvalues = Cookies.get('scroll-cookie').split('|');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.

$(window).on("scroll", function() {
clearTimeout(timeout);
timeout = setTimeout(function () {
Cookies.set('scroll-cookie', ($(window).scrollTop() + '|' + rpath), { path: '' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.

@@ -0,0 +1,23 @@
$(document).ready(function() {

// Set relative link path (without domain): https://stackoverflow.com/questions/3955959/whats-an-easy-way-to-get-the-url-in-the-current-window-minus-the-domain-name

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

$(window).on("scroll", function() {
clearTimeout(timeout);
timeout = setTimeout(function () {
Cookies.set("scroll-cookie", ($(window).scrollTop() + '|' + rpath), { path: '' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.

$(window).on("scroll", function() {
clearTimeout(timeout);
timeout = setTimeout(function () {
Cookies.set("scroll-cookie", ($(window).scrollTop() + '|' + rpath), { path: '' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed double and single quotes.
'Cookies' is not defined.

@iissnan iissnan merged commit 9334f79 into iissnan:master Apr 9, 2017
@iissnan
Copy link
Owner

iissnan commented Apr 9, 2017

Thanks. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants