What comes *first* and therefore is *chief* ?
@@ -2486,7 +2488,7 @@ https://pad.xpub.nl/p/HTML_Finale
Wikipedia edit wars:
Conflict of interest or non-neutrality.
-
When wikipedia administrators/editors
+
When Wikipedia administrators/editors
keep going back and fourth
with statements in Wikipedia
due to a lack of source.
@@ -2923,7 +2925,7 @@ https://pad.xpub.nl/p/HTML_Finale
3.2
Providing 'tools' for activation
3.3
The influence of design
3.4
Content and personality
- 3.6
Digital influence on zines collaborative publising
+ 3.6
Digital influence on zines collaborative publishing
3.7
On open tools for collaborative publishing
3.8
Creating hard copies: customising content
3.9
Recources & links
@@ -3142,10 +3144,83 @@ popup_button.addEventListener("click", function (e) {
document.getElementsByTagName("body")[0].classList.add("pagedjs");
- $.getScript("https://unpkg.com/pagedjs/dist/paged.polyfill.js", function(data, textStatus, jqxhr) {})
+ $.getScript("https://unpkg.com/pagedjs/dist/paged.polyfill.js", function(data, textStatus, jqxhr) {
+
+
+
+
+ class handlers extends Paged.Handler {
+ constructor(chunker, polisher, caller) {
+ super(chunker, polisher, caller);
+ }
+
+ beforeParsed(content){
+ createToc({
+ content: content,
+ tocElement: '#my-toc-content',
+ titleElements: [ '.mw-content-ltr h2', 'h3' ]
+ });
+ }
+
+ }
+ Paged.registerHandlers(handlers);
+
+
+
+ })
//window.print();
};
+
+
+
+
+ //TOC
+ function createToc(config){
+ const content = config.content;
+ const tocElement = config.tocElement;
+ const titleElements = config.titleElements;
+
+ let tocElementDiv = content.querySelector(tocElement);
+ let tocUl = document.createElement("ul");
+ tocUl.id = "list-toc-generated";
+ tocElementDiv.appendChild(tocUl);
+
+ // add class to all title elements let tocElementNbr = 0;
+ for(var i= 0; i < titleElements.length; i++){
+
+ let titleHierarchy = i + 1;
+ let titleElement = content.querySelectorAll(titleElements[i]);
+
+
+ titleElement.forEach(function(element) {
+
+ // add classes to the element element.classList.add("title-element");
+ element.setAttribute("data-title-level", titleHierarchy);
+
+ // add id if doesn't exist tocElementNbr++;
+ idElement = element.id;
+ if(idElement == ''){
+ element.id = 'title-element-' + tocElementNbr;
+ }
+ let newIdElement = element.id;
+
+ });
+
+ }
+
+ // create toc list let tocElements = content.querySelectorAll(".title-element");
+
+ for(var i= 0; i < tocElements.length; i++){
+ let tocElement = tocElements[i];
+ let tocNewLi = document.createElement("li");
+ tocNewLi.classList.add("toc-element");
+ tocNewLi.classList.add("toc-element-level-" + tocElement.dataset.titleLevel);
+ tocNewLi.innerHTML = '
' + tocElement.innerHTML + '';
+ tocUl.appendChild(tocNewLi);
+ }
+
+ }