Browse Source

Move language tag into hidden info.

tags/v1.0^2
Benjamin Attal 10 years ago
parent
commit
65a1c2e9dc
3 changed files with 7 additions and 11 deletions
  1. +1
    -1
      static/css/lib/highlight.css
  2. +5
    -5
      static/js/index.js
  3. +1
    -5
      static/sass/index.sass

+ 1
- 1
static/css/lib/highlight.css View File

@@ -2,7 +2,7 @@ td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125% }
.highlighttable { background-color: #49483e; width: inherit; }
.hll { background-color: rgba(255, 255, 0, 0.5); width: inherit; display: block; }
.hll { display: block }
{ background: #272822; color: #f8f8f2 }
.c { color: #75715e } /* Comment */
.err { color: #960050; background-color: #1e0010 } /* Error */


+ 5
- 5
static/js/index.js View File

@@ -50,7 +50,7 @@ var codeExample = '<table class="highlighttable"><tr><td class="linenos"><div cl
searchBar.onkeyup = typingTimer;

var testCodelet = {
'code_url': 'https://github.com/earwig/bitshift/blob/develop/app.py',
'url': 'https://github.com/earwig/bitshift/blob/develop/app.py',
'filename': 'app.py',
'language': 'python',
'date_created': 'May 10, 2014',
@@ -156,7 +156,7 @@ function createResult(codelet) {
var title = document.createElement("span"),
site = document.createElement("span"),
dateModified = document.createElement("div"),
language = document.createElement("span"),
language = document.createElement("div"),
dateCreated = document.createElement("div"),
authors = document.createElement("div");

@@ -175,10 +175,10 @@ function createResult(codelet) {
authors.id = 'authors';

//Add the bulk of the html
title.innerHTML = 'File <a href="' + codelet.code_url + '">'
title.innerHTML = 'File <a href="' + codelet.url + '">'
+ codelet.filename + '</a>';
site.innerHTML = 'on <a href="' + codelet.origin[1] + '">' + codelet.origin[0] +'</a>';
language.innerHTML = codelet.language;
language.innerHTML = 'Language: <span>' + codelet.language + '</span>';
dateModified.innerHTML = 'Last modified: <span>' + codelet.date_modified + '</span>';
// Needs to be changed from int to string on the server
dateCreated.innerHTML = 'Created: <span>' + codelet.date_created + '</span>';
@@ -209,6 +209,7 @@ function createResult(codelet) {
//Finish and append elements to parent elements
hiddenInfo.appendChild(dateCreated);
hiddenInfo.appendChild(dateModified);
hiddenInfo.appendChild(language);
hiddenInfo.appendChild(authors);

hiddenInfoContainer.appendChild(hiddenInfo);
@@ -219,7 +220,6 @@ function createResult(codelet) {

displayInfo.appendChild(title);
displayInfo.appendChild(site);
displayInfo.appendChild(language);

newDiv.appendChild(displayInfo);
newDiv.appendChild(table);


+ 1
- 5
static/sass/index.sass View File

@@ -372,11 +372,7 @@ div#hidden-info
color: #5CADFF
float: right

#date-created
display: block


#date-modified
div
display: block

#authors


Loading…
Cancel
Save