Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1848 from bookshelf/rg-previous-attributes
Fix inconsistent previous attributes
- Loading branch information
Showing
13 changed files
with
1,004 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
/*global document */ | ||
(function() { | ||
var source = document.getElementsByClassName('prettyprint source linenums'); | ||
var i = 0; | ||
var lineNumber = 0; | ||
var lineId; | ||
var lines; | ||
var totalLines; | ||
var anchorHash; | ||
var source = document.getElementsByClassName('prettyprint source linenums'); | ||
var i = 0; | ||
var lineNumber = 0; | ||
var lineId; | ||
var lines; | ||
var totalLines; | ||
var anchorHash; | ||
|
||
if (source && source[0]) { | ||
anchorHash = document.location.hash.substring(1); | ||
lines = source[0].getElementsByTagName('li'); | ||
totalLines = lines.length; | ||
if (source && source[0]) { | ||
anchorHash = document.location.hash.substring(1); | ||
lines = source[0].getElementsByTagName('li'); | ||
totalLines = lines.length; | ||
|
||
for (; i < totalLines; i++) { | ||
lineNumber++; | ||
lineId = 'line' + lineNumber; | ||
lines[i].id = lineId; | ||
if (lineId === anchorHash) { | ||
lines[i].className += ' selected'; | ||
} | ||
} | ||
for (; i < totalLines; i++) { | ||
lineNumber++; | ||
lineId = 'line' + lineNumber; | ||
lines[i].id = lineId; | ||
if (lineId === anchorHash) { | ||
lines[i].className += ' selected'; | ||
} | ||
} | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
(function() { | ||
var navbarHeight = document.querySelector('.main-navbar').offsetHeight | ||
var navbarHeight = document.querySelector('.main-navbar').offsetHeight; | ||
|
||
function scrollWithOffset() { | ||
var targetElement = document.querySelector(':target') | ||
window.scroll({top: targetElement.offsetTop - navbarHeight}) | ||
var targetElement = document.querySelector(':target'); | ||
window.scroll({top: targetElement.offsetTop - navbarHeight}); | ||
} | ||
|
||
window.addEventListener('hashchange', scrollWithOffset, false) | ||
window.addEventListener('DOMContentLoaded', scrollWithOffset, false) | ||
window.addEventListener('hashchange', scrollWithOffset, false); | ||
window.addEventListener('DOMContentLoaded', scrollWithOffset, false); | ||
|
||
document.getElementById('show-menu').checked = false | ||
}()) | ||
document.getElementById('show-menu').checked = false; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", | ||
/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); | ||
PR.registerLangHandler( | ||
PR.createSimpleLexer( | ||
[['pln', /^[\t\n\f\r ]+/, null, ' \t\r\n']], | ||
[ | ||
['str', /^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/, null], | ||
['str', /^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/, null], | ||
['lang-css-str', /^url\(([^"')]*)\)/i], | ||
['kwd', /^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i, null], | ||
['lang-css-kw', /^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i], | ||
['com', /^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//], | ||
['com', /^(?:<\!--|--\>)/], | ||
['lit', /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i], | ||
['lit', /^#[\da-f]{3,6}/i], | ||
['pln', /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i], | ||
['pun', /^[^\s\w"']+/] | ||
] | ||
), | ||
['css'] | ||
); | ||
PR.registerLangHandler(PR.createSimpleLexer([], [['kwd', /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]), [ | ||
'css-kw' | ||
]); | ||
PR.registerLangHandler(PR.createSimpleLexer([], [['str', /^[^"')]+/]]), ['css-str']); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.