Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #4725: fix all violations from the tenth part of idea violations
- Loading branch information
Showing
8 changed files
with
89 additions
and
65 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
'use strict'; | ||
/*jslint browser: true*/ | ||
/*global window */ | ||
(function () { | ||
"use strict"; | ||
window.addEventListener("load", function () { | ||
var url = window.location.href; | ||
var anchors = document.getElementsByTagName("h2"); | ||
[].forEach.call(anchors, function (anchorItem) { | ||
var name = anchorItem.childNodes[0].name; | ||
var link = "" + url + "#" + name + ""; | ||
|
||
function main() { | ||
var url = window.location.href; | ||
var anchors = document.getElementsByTagName('h2'); | ||
var mass = []; | ||
for (var i = 0; i < anchors.length; i++) { | ||
mass.push(anchors[i].childNodes[0].name); | ||
} | ||
var links = []; | ||
for(i = 0; i < mass.length; i++) { | ||
links.push('' + url + '#' + mass[i] + ''); | ||
} | ||
for(i = 0; i < anchors.length; i++) { | ||
var anchor = document.createElement('div'); | ||
anchor.className = 'anchor'; | ||
anchor.innerHTML += '<a href="' + links[i] + '"><img src="images/anchor.png"></a>'; | ||
anchors[i].appendChild(anchor); | ||
} | ||
var a = document.createElement("a"); | ||
a.setAttribute("href", link); | ||
|
||
} | ||
var image = document.createElement("img"); | ||
image.setAttribute("src", "images/anchor.png"); | ||
|
||
var anchor = document.createElement("div"); | ||
anchor.className = "anchor"; | ||
|
||
a.appendChild(image); | ||
anchor.appendChild(a); | ||
anchorItem.appendChild(anchor); | ||
}); | ||
}); | ||
}()); | ||
|
||
window.addEventListener('load', main); |
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