Skip to content

Commit 944b47d

Browse files
committed
view-a-line-bookmarks-by-category.html R4.8
* Fix Octocat logo * Start adding name space * Not add description if already exists * Add no show iframes if notes include "Not CORS or Iframe compatible" * Add links underneath images * Add images array element to bookmark
1 parent 080d6c4 commit 944b47d

File tree

6 files changed

+399
-29
lines changed

6 files changed

+399
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ MindMads that are geared up to display Wardley Maps
4747

4848
## Change Log
4949

50-
### ~ 2019-03-17 ~ Theo
50+
### 2019-03-17 ~ Theo
5151

5252
* Update MindMapping CMS to [TooToo13]( https://pushme-pullyou.github.io/tootoo13/ )
5353

sandbox/opentecture-bookmarks/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,19 @@ Convert bookmark dates to UTC
137137
## Change Log
138138

139139

140+
### 2019-03-17 ~ Theo
141+
142+
CORS workaround working again. Yay!
143+
144+
view-a-line-bookmarks-by-category.html R4.8
145+
146+
* Fix Octocat logo
147+
* Start adding name space
148+
* Not add description if already exists
149+
* Add no show iframes if notes include "Not CORS or Iframe compatible"
150+
* Add links underneath images
151+
* Add images array element to bookmark
152+
140153
### 2019-03-16 ~ Theo
141154

142155
* Update readme

sandbox/opentecture-bookmarks/opentecture-bookmarks-2019-03-17.json

Lines changed: 322 additions & 0 deletions
Large diffs are not rendered by default.

sandbox/opentecture-bookmarks/opentecture-bookmarks.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
{"date_added":"13159178011000000","id":"280339","meta_info":{"last_visited_desktop":"13176876682421159"},"name":"Alice.org - What is Alice?","sync_transaction_version":"6820","type":"url","url":"https://www.alice.org/index.php?page=what_is_alice/what_is_alice","tags":["academia","carnagie-mellon"],"description":"Alice is used to teach students how to code."}
2-
{"date_added":"13159178011000000","id":"280340","name":"Alice: Free, Easy, Interactive 3D Graphics for the WWW","sync_transaction_version":"6821","type":"url","url":"https://www.alice.org/","tags":["academia","carnagie-mellon"],"description":"Alice is used to teach students how to code."}
3-
{"date_added":"13159178008000000","id":"276601","meta_info":{"last_visited_desktop":"13179484380932000"},"name":"10min guide to your first simulation · architecture-building-systems/RC_BuildingSimulator Wiki","notes":"not CORS or Iframe compatible","sync_transaction_version":"9944","type":"url","url":"https://github.com/architecture-building-systems/RC_BuildingSimulator/wiki/10min-guide-to-your-first-simulation","tags":["academia","eth-zurich"],"description":"RC Model of a Building. Contribute to architecture-building-systems/RC_BuildingSimulator development by creating an account on GitHub."}
4-
{"date_added":"13176675582154609","id":"324607","meta_info":{"last_visited_desktop":"13176876744523453"},"name":"Institute without Boundaries – Interdisciplinary Design Strategy","sync_transaction_version":"6828","type":"url","url":"http://institutewithoutboundaries.ca/","tags":["academia","george-brown"],"description":"A post graduate certificate program in Interdisciplinary Design Strategy at George Brown College's Centre for Arts, Design, and Information Technology."}
1+
{"date_added":"13159178011000000","id":"280339","meta_info":{"last_visited_desktop":"13176876682421159"},"name":"Alice.org - What is Alice?","sync_transaction_version":"6820","type":"url","url":"https://www.alice.org/index.php?page=what_is_alice/what_is_alice","images":["https://www.alice.org/wp-content/uploads/2017/05/alice-mobile-v2.png"],"tags":["academia","carnagie-mellon"],"description":"Alice is used to teach students how to code."}
2+
{"date_added":"13159178011000000","id":"280340","name":"Alice: Free, Easy, Interactive 3D Graphics for the WWW","sync_transaction_version":"6821","type":"url","url":"https://www.alice.org/","images":["https://www.alice.org/wp-content/uploads/2017/02/alice-logo.png"],"tags":["academia","carnagie-mellon"],"description":"Alice is used to teach students how to code."}
3+
{"date_added":"13159178008000000","id":"276601","meta_info":{"last_visited_desktop":"13179484380932000"},"name":"10min guide to your first simulation · architecture-building-systems/RC_BuildingSimulator Wiki","notes":"not CORS or Iframe compatible","sync_transaction_version":"9944","type":"url","url":"https://github.com/architecture-building-systems/RC_BuildingSimulator/wiki/10min-guide-to-your-first-simulation","tags":["academia","eth-zurich"],"images":["https://avatars3.githubusercontent.com/u/8478952?s=200&v=4"],"description":"RC Model of a Building. Contribute to architecture-building-systems/RC_BuildingSimulator development by creating an account on GitHub."}
4+
{"date_added":"13176675582154609","id":"324607","meta_info":{"last_visited_desktop":"13176876744523453"},"name":"Institute without Boundaries – Interdisciplinary Design Strategy","sync_transaction_version":"6828","type":"url","url":"http://institutewithoutboundaries.ca/","images":["http://institutewithoutboundaries.ca/wp-content/uploads/2013/11/general-3.png"],"tags":["academia","george-brown"],"description":"A post graduate certificate program in Interdisciplinary Design Strategy at George Brown College's Centre for Arts, Design, and Information Technology."}
55

6-
{"date_added":"13176461174583215","id":"324538","meta_info":{"last_visited_desktop":"13176461174583835"},"name":"NailO | MIT Media Lab","sync_transaction_version":"6831","type":"url","url":"https://nailo.media.mit.edu/","tags":["academia","mit"],"description":"Affective Computing research combines engineering and computer science with psychology, cognitive science, neuroscience, sociology, education, psychophysiology, value-centered design, ethics, and more. We bring together individuals with a diversity of technical, artistic, and human abilities in a collaborative spirit to push the boundaries of what can be achieved to improve human affective experience with technology."}
7-
{"date_added":"13176461225082428","id":"324539","meta_info":{"last_visited_desktop":"13176879137593726"},"name":"Self-Assembly Lab","sync_transaction_version":"7009","type":"url","url":"https://selfassemblylab.mit.edu/","tags":["academia","mit"]}
8-
{"date_added":"13159222430000000","id":"279031","meta_info":{"last_visited_desktop":"13193209801770759"},"name":"Open Source Architecture","notes":"archived version","sync_transaction_version":"22238","type":"url","url":"https://web.archive.org/web/20180708081103/http://senseable.mit.edu:80/osarc/","tags":["academia","mit"],"description":"Open Source Architecture (OSArc) is an emerging paradigm describing new procedures for the design, construction and operation of buildings, infrastructure and spaces. Drawing from references as diverse as open source culture, avant-garde architectural theory, science fiction, language theory, and others, it describes an inclusive approach to spatial design, a collaborative use of design software and a transparent operation throughout the course of a building and city's life cycle."}
6+
{"date_added":"13176461174583215","id":"324538","meta_info":{"last_visited_desktop":"13176461174583835"},"name":"NailO | MIT Media Lab","sync_transaction_version":"6831","type":"url","url":"https://nailo.media.mit.edu/","images":["https://affect.media.mit.edu/images/AClogotinymed.jpg"],"tags":["academia","mit"],"description":"Affective Computing research combines engineering and computer science with psychology, cognitive science, neuroscience, sociology, education, psychophysiology, value-centered design, ethics, and more. We bring together individuals with a diversity of technical, artistic, and human abilities in a collaborative spirit to push the boundaries of what can be achieved to improve human affective experience with technology."}
7+
{"date_added":"13176461225082428","id":"324539","meta_info":{"last_visited_desktop":"13176879137593726"},"name":"Self-Assembly Lab","sync_transaction_version":"7009","type":"url","url":"https://selfassemblylab.mit.edu/","images":["https://static1.squarespace.com/static/58977341414fb5309fc954e6/t/5a68fd0508522944572c6cfe/1518219358915/"],"tags":["academia","mit"]}
8+
{"date_added":"13159222430000000","id":"279031","meta_info":{"last_visited_desktop":"13193209801770759"},"name":"Open Source Architecture","notes":"archived version","sync_transaction_version":"22238","type":"url","url":"http://senseable.mit.edu:80/osarc/","tags":["academia","mit"],"description":"Open Source Architecture (OSArc) is an emerging paradigm describing new procedures for the design, construction and operation of buildings, infrastructure and spaces. Drawing from references as diverse as open source culture, avant-garde architectural theory, science fiction, language theory, and others, it describes an inclusive approach to spatial design, a collaborative use of design software and a transparent operation throughout the course of a building and city's life cycle."}
99
{"date_added":"13176677950137082","id":"324637","meta_info":{"last_visited_desktop":"13176876938358113"},"name":"ODS User Manual v1 by Anton Shynkaruk - issuu","sync_transaction_version":"6845","type":"url","url":"https://issuu.com/antonshynkaruk/docs/ods_manual_v1","tags":["academia","open-design-school"],"description":"Issuu is a digital publishing platform that makes it simple to publish magazines, catalogs, newspapers, books, and more online. Easily share your publications and get them in front of Issuu’s millions of monthly readers. Title: Ods manual v1, Author: Anton Shynkaruk, Name: Ods manual v1, Length: 90 pages, Page: 1, Published: 2017-11-12"}
1010
{"date_added":"13176677313566981","id":"324623","meta_info":{"last_visited_desktop":"13176877236327115"},"name":"Open Design School - About","sync_transaction_version":"6863","type":"url","url":"https://ods.matera-basilicata2019.it/en/about","tags":["academia","open-design-school"],"description":"The Open Design School is one of the pillar projects of Matera 2019. It is a living lab for interdisciplinary experimentation, a platform that will be the main feature of Matera 2019 cultural programme. Its main goal is to produce the infrastructure necessary for Matera 2019. The Open Design School is not a school. It will serve as an instrument of systemic, community-wide capacity building where learning occurs through doing, prototyping and testing, in a continuous creative exchange process between art, science, and technology."}
1111
{"date_added":"13176877267104474","id":"324722","meta_info":{"last_visited_desktop":"13176877267104857"},"name":"Open Design School - Blog","sync_transaction_version":"6866","type":"url","url":"https://ods.matera-basilicata2019.it/en/","tags":["academia","open-design-school"],"description":"OPEN DESIGN SCHOOL / Matera"}

sandbox/opentecture-bookmarks/view-a-line-bookmarks-by-category/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ It is a work-in-progress continuation of exploring, manipulating and hacking the
7272

7373
## Change Log
7474

75+
76+
7577
### 2019-02-19 ~ Theo
7678

7779
view-a-line-bookmarks R4.5

sandbox/opentecture-bookmarks/view-a-line-bookmarks-by-category/r4/view-a-line-bookmarks-by-category.html

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,9 @@ <h1 onclick="navMenu.scrollTop=0;" style="cursor:pointer;text-align:center;" tit
131131

132132
<script>
133133

134-
134+
const VLB = { release: "4.8", date: "2019-03-17" };
135135

136136
let urlJson = "../../opentecture-bookmarks.json";
137-
let urlMd = "../README.md";
138-
const urlCORS = 'https://cors-anywhere.herokuapp.com/';
139-
140137
let jsonLines;
141138
let bookmarks;
142139
let descriptions;
@@ -145,8 +142,13 @@ <h1 onclick="navMenu.scrollTop=0;" style="cursor:pointer;text-align:center;" tit
145142
let index;
146143

147144

145+
let urlMd = "../README.md";
146+
const urlCORS = 'https://cors-anywhere.herokuapp.com/';
147+
148+
149+
148150
const urlSourceCode = "https://github.com/opentecture/mindmapping/tree/master/sandbox/opentecture-bookmarks/view-a-line-bookmarks"
149-
const urlSourceCodeIcon = "https://status.github.com/images/invertocat.png";
151+
const urlSourceCodeIcon = "https://pushme-pullyou.github.io/github-mark-64.png";
150152

151153
const MNU = {};
152154

@@ -383,9 +385,27 @@ <h4 style=margin-bottom:0; >${ subHeader }</h4>
383385

384386
function openInIframe( index ) {
385387

386-
const bookmark = bookmarks[ index ];
388+
bookmark = bookmarks[ index ];
389+
390+
const id = bookmark.id;
391+
392+
393+
if ( !bookmark.notes || bookmark.notes.toLowerCase().includes( "not cors or iframe compatible" ) === false ) {
394+
395+
iframeHTM =
396+
`
397+
<div id=divIframe class="thumbnail-container">
398+
<div class="thumbnail" >
399+
<iframe id=ifr src="${ bookmark.url }" ></iframe>
400+
</div>
401+
</div>
402+
`;
403+
} else {
404+
405+
iframeHTM = "";
406+
407+
}
387408

388-
const id = bookmark.id
389409

390410
commentsFiltered = comments.filter( comment => comment.targetId === id );
391411

@@ -404,6 +424,8 @@ <h4 style=margin-bottom:0; >${ subHeader }</h4>
404424
comments.length + 1
405425
;
406426

427+
428+
407429
divContents.innerHTML =
408430
`
409431
<details open >
@@ -412,18 +434,19 @@ <h4 style=margin-bottom:0; >${ subHeader }</h4>
412434
413435
<h3><a href="${ bookmark.url }" target="_blank">${ bookmark.name}</a></h3>
414436
415-
<div id=divIframe class="thumbnail-container">
416-
<div class="thumbnail" >
417-
<iframe id=ifr src="${ bookmark.url }" ></iframe>
418-
</div>
419-
</div>
437+
${ iframeHTM }
420438
421439
<p>${ bookmark.notes || "" }</p>
422440
441+
<p>
442+
<img style=background-color:#ddd;max-width:50rem; src="${ bookmark.images ? bookmark.images[ 0 ] : `` }" >
443+
<p>
444+
445+
423446
<hr>
424447
425448
<p>Description: ${ bookmark.description || "" }</p>
426-
449+
427450
<p>Tags: ${ bookmark.tags }</p>
428451
429452
${ commentText }
@@ -516,23 +539,28 @@ <h3><a href="${ bookmark.url }" target="_blank">${ bookmark.name}</a></h3>
516539

517540

518541

542+
/////////
543+
519544
function parseHtmlGetDescription( xhr ) {
520545

521-
const response = xhr.target.response;
546+
VLB.source = xhr.target.response;
522547
//console.log( 'response', response );
523548

524-
description = response.match( /name="description" content="(.*?)"/i );
549+
description = VLB.source.match( /name="description" content="(.*?)"/i );
525550

526551
description = description ? description[ 1 ] : "";
527552

528-
txtBookmarks.value = txtBookmarks.value.replace( /\t]/, `],"description":"${ description }"` );
553+
txt = txtBookmarks.value.match( /"description": "(.*?)"/i );
529554

530-
//console.log( 'description', description );
555+
if ( txt && txt[ 1 ].length === 0 ) {
531556

532-
texts = response.match( /\<img (.*?)>/gi )
533-
images = texts.map( text => text.match( /src="(.*?)"/i )[ 1 ] );
557+
txtBookmarks.value = txtBookmarks.value.replace( /\t]/, `],"description":"${ description }"` );
558+
559+
} else {
534560

535-
console.log( '', images );
561+
console.log( 'description exits', txt, description );
562+
563+
}
536564

537565
}
538566

@@ -542,9 +570,14 @@ <h3><a href="${ bookmark.url }" target="_blank">${ bookmark.name}</a></h3>
542570

543571
let htm = "";
544572

573+
texts = VLB.source.match( /\<img (.*?)>/gi )
574+
images = texts.map( text => text.match( /src="(.*?)"/i )[ 1 ] );
575+
576+
console.log( 'images', images );
577+
545578
for ( image of images ) {
546579

547-
htm += `<img src="${ image }" ><br>`;
580+
htm += `<p style=background-color:#eee; ><img src="${ image }" ><br>${ image }</p>`;
548581

549582
}
550583

0 commit comments

Comments
 (0)