sfu-natlang / lensingwikipedia

Lensing Wikipedia is an interface to visually browse through human history as represented in Wikipedia. This the source code that runs the website:
http://lensingwikipedia.cs.sfu.ca
Other
11 stars 4 forks source link

Unable to add new tab #119

Closed avacariu closed 9 years ago

avacariu commented 9 years ago

I'm trying to add a "Compare" tab. I've added the necessary tags to index.html, and I've added a compare.js which should (as far I can tell) create an empty div.

Unfortunately, none of this works as it should. Now, when I click on the tabs, the following happens.

  1. Click Facet -- works fine
  2. Click Timeline -- works fine
  3. Click Comparison -- shows the map
  4. Click Map -- still shows the map
  5. Click Text -- still shows the map

I've added my code in the following commit: ab08357735b0a4e8b741ce0a8dd923fa05383214

Is there something I missed?

theq629 commented 9 years ago

It looks like the change on line 37 of index.html is lacking </div>. Map is right after it in the list. Could that be it?

avacariu commented 9 years ago

Thanks! You're right, that was probably what caused the Map to be shown as the Comparison (since the div I was creating in compare.js is empty), but unfortunately it looks I'm still missing something.

Now the issue I'm having is that the Comparison, Map, and Text tabs all contain whatever I put in the #comparetab div.

I've decided to move the comparison tab to the end as a workaround for now; I'll try to figure out this bug later.

theq629 commented 9 years ago

We should probably just move the tab generation code to Javascript to remove all the duplication and avoid this kind of issue.

theq629 commented 9 years ago

I've just pushed a refactoring of the tab generation code to the factorouttabcode branch. This gets rid of the tab part of the HTML snippets, and adds a javascript list of tab information which is slightly longer but I think easier to edit. When convenient please try merging that into your branch and see if it works for you.

avacariu commented 9 years ago

It works! Thanks!

I didn't merge the code into my branch, though, because that branch is too far behind master (and would've caused merge conflicts). I just copied and pasted the code in.