Skip to content

Commit 7cfa3c7

Browse files
committed
Remove broken plugin spotlight from the front page
It was never fully migrated from the fiji.github.io site. I briefly tried dropping in the missing slugify function, and it could be made to work, but I'd like to have a group discussion before deciding to add a plugin carousel to the imagej.net wiki.
1 parent 682a9f5 commit 7cfa3c7

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

index.html

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -150,54 +150,3 @@ <h2>Free &amp; Open Source</h2>
150150
</div>
151151
</div>
152152
</div>
153-
154-
<!-- Spotlight -->
155-
<!-- Bootstrap core JavaScript
156-
================================================== -->
157-
<!-- Placed at the end of the document so the pages load faster -->
158-
<script src="/assets/js/jquery-3.4.1.min.js"></script>
159-
<script>
160-
let first = true;
161-
const MAX_PLUGIN_COUNT = 6; // controls max number of tabs shown
162-
163-
$.getJSON("/plugins.json", function(json) {
164-
let plugins = json.plugins;
165-
// Fisher-Yates shuffle; see: https://javascript.info/task/shuffle
166-
for (let i = plugins.length - 1; i > 0; i--) {
167-
let j = Math.floor(Math.random() * (i + 1)); // random index from 0 to i
168-
[plugins[i], plugins[j]] = [plugins[j], plugins[i]]; // swap elements
169-
}
170-
if (plugins.length > MAX_PLUGIN_COUNT){
171-
plugins = plugins.slice(0,MAX_PLUGIN_COUNT);
172-
}
173-
plugins.map(function(val){
174-
// generating the tab header
175-
let nameSlug = 'plugin-' + slugify(val.name);
176-
let tabString = `
177-
<li class="nav-item">
178-
<a class="nav-link ${first ? 'active' : ''}" id="${nameSlug}-tab-header" data-toggle="tab" href="#${nameSlug}-tab" role="tab" aria-controls="${nameSlug}" aria-selected="true">${val.name}</a>
179-
</li>
180-
`
181-
182-
// generating the tab panel
183-
let paneString = `
184-
<div class="tab-pane fade ${first ? 'show active' : ''}" id="${nameSlug}-tab" role="tabpanel" aria-labelledby="${nameSlug}-tab-header">
185-
${val.imgUrl ?
186-
'<img class="img-fluid img-plugin" alt="image showing ' + val.name + ' in action" src = "' + val.imgUrl + '" /> <hr />'
187-
: ''
188-
}
189-
<h5 class="card-title">${val.name}</h5>
190-
<p class="card-text">${val.description}</p>
191-
<a href="${val.link}" class="btn btn-primary">More information</a>
192-
</div>
193-
`
194-
$("#plugin-tabs").append(tabString);
195-
$("#plugin-tab-content").append(paneString);
196-
197-
198-
if (first){
199-
first = false;
200-
}
201-
})
202-
});
203-
</script>

0 commit comments

Comments
 (0)