Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
167 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,69 @@ | |||
#mt-test-buttons { | |||
position: fixed; | |||
bottom: 20px; | |||
right: 20px; | |||
z-index: 100; | |||
} | |||
|
|||
/* button basics from github */ | |||
a.minibutton { | |||
outline: none; | |||
display:inline-block; | |||
height:23px; | |||
padding:0 0 0 3px; | |||
font-size:11px; | |||
font-weight:bold; | |||
color:#333; | |||
text-shadow:1px 1px 0 #fff; | |||
background:url(/static/art/minibutton_matrix.png) 0 0 no-repeat; | |||
white-space:nowrap; | |||
border:none; | |||
overflow:visible; | |||
cursor:pointer; | |||
text-decoration:none; | |||
vertical-align: middle; | |||
} | |||
|
|||
a.minibutton>span { | |||
display:block; | |||
height:23px; | |||
padding:0 10px 0 8px; | |||
line-height:23px; | |||
background:url(/static/art/minibutton_matrix.png) 100% 0 no-repeat; | |||
} | |||
a.btn-no-txt>span { | |||
padding: 0 15px 0 8px; | |||
text-indent: -9999px; | |||
} | |||
|
|||
a.minibutton:hover, a.minibutton:focus, a.minibutton.selected { | |||
color:#fff; | |||
text-decoration:none; | |||
text-shadow:-1px -1px 0 rgba(0,0,0,0.3); | |||
background-position:0 -30px; | |||
} | |||
a.minibutton:hover>span, a.minibutton:focus>span, a.minibutton.selected>span {background-position:100% -30px;} | |||
|
|||
a.minibutton.mousedown{background-position:0 -60px; } | |||
a.minibutton.mousedown>span{background-position:100% -60px; } | |||
|
|||
/* icons */ | |||
a.minibutton .icon { | |||
float:left; | |||
margin-left:-4px; | |||
width:18px; | |||
height:22px; | |||
background:url(/static/art/minibutton_icons.png) 0 0 no-repeat; | |||
} | |||
|
|||
a.btn-download .icon {background-position:-40px 0;} | |||
a.btn-download:hover .icon, a.btn-download:focus .icon {background-position:-40px -25px;} | |||
|
|||
a.btn-left .icon {background-position:-161px 1px;} | |||
a.btn-left:hover .icon, a.btn-left:focus .icon {background-position:-161px -24px;} | |||
|
|||
a.btn-right .icon {background-position:-178px 1px;} | |||
a.btn-right:hover .icon, a.btn-right:focus .icon {background-position:-178px -24px;} | |||
|
|||
a.btn-source .icon {background-position:-211px 0px;} | |||
a.btn-source:hover .icon, a.btn-right:focus .icon {background-position:-211px -24px;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,81 +1,91 @@ | |||
var makeActions = function(tests){ | var makeActions = function(tests){ | ||
try { | try { | ||
if (!$('actions')) new Element('dt', {'id': 'actions'}).inject($('mt-content'), 'top'); | if (!$('actions')) new Element('dt', {'id': 'actions'}).inject($('mt-content'), 'top'); | ||
tests.each(function(test, i) { | tests.each(function(test, i) { | ||
new Element('dt').adopt( | new Element('dt').adopt( | ||
new Element('a', { | new Element('a', { | ||
text: test.title, | text: test.title, | ||
events: { | events: { | ||
click: test.fn | click: test.fn | ||
}, | }, | ||
id: 'test-' + i | id: 'test-' + i | ||
}) | }) | ||
).inject('actions'); | ).inject('actions'); | ||
if (test.description) new Element('dd', { text: test.description }).inject('actions'); | if (test.description) new Element('dd', { text: test.description }).inject('actions'); | ||
}); | }); | ||
} catch(e) { | } catch(e) { | ||
alert('Could not create actions. Check console for details.'); | alert('Could not create actions. Check console for details.'); | ||
console.log('Ensure you have Core/Element.Event - plus its dependencies.', e); | console.log('Ensure you have Core/Element.Event - plus its dependencies.', e); | ||
} | } | ||
}; | }; | ||
var log = function(msg) { | var log = function(msg) { | ||
var type = function(obj){ | if (!log.log_wrapper) { | ||
if (obj == undefined) return false; | log.log_wrapper = document.createElement('div'); | ||
if (obj.nodeName){ | log.log_wrapper.id = 'mt-log-wrapper'; | ||
switch (obj.nodeType){ | log.log_element = document.createElement('div'); | ||
case 1: return 'element'; | log.log_element.id = 'mt-log'; | ||
case 3: return (/\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace'; | log.log_wrapper.appendChild(log.log_element); | ||
} | document.body.appendChild(log.log_wrapper); | ||
} else if (typeof obj.length == 'number'){ | } | ||
if (obj.callee) return 'arguments'; |
|
||
} |
|
||
return typeof obj; | var type = function(obj){ | ||
}; | if (obj == undefined) return false; | ||
var parse = function(){ | if (obj.nodeName){ | ||
var str = ''; | switch (obj.nodeType){ | ||
for (var i = 0; i < arguments.length; i++) { | case 1: return 'element'; | ||
var value = arguments[i]; | case 3: return (/\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace'; | ||
switch (type(value)) { | } | ||
case 'element': | } else if (typeof obj.length == 'number'){ | ||
str += value.tagName.toLowerCase(); | if (obj.callee) return 'arguments'; | ||
if (value.id) str += '#' + value.id; | } | ||
if (value.className) str += value.className.split(' ').join('.'); | return typeof obj; | ||
break; | }; | ||
var parse = function(){ | |||
var str = ''; | |||
for (var i = 0; i < arguments.length; i++) { | |||
var value = arguments[i]; | |||
switch (type(value)) { | |||
case 'element': | |||
str += value.tagName.toLowerCase(); | |||
if (value.id) str += '#' + value.id; | |||
if (value.className) str += value.className.split(' ').join('.'); | |||
break; | |||
|
|
||
case 'array': | case 'array': | ||
str +='['; | str +='['; | ||
var results = []; | var results = []; | ||
for (var index = 0; index < value.length; index++) { | for (var index = 0; index < value.length; index++) { | ||
results.push(parse(value[index])); | results.push(parse(value[index])); | ||
} | } | ||
str += results.join(', ') + ']'; | str += results.join(', ') + ']'; | ||
break; | break; | ||
|
|
||
case 'object': | case 'object': | ||
var objs = []; | var objs = []; | ||
for (name in value) { | for (name in value) { | ||
if (type(value[name]) != 'object') { | if (type(value[name]) != 'object') { | ||
objs.push(name + ': ' + parse(value[name])); | objs.push(name + ': ' + parse(value[name])); | ||
} else { | } else { | ||
objs.push(name + ': (object)'); | objs.push(name + ': (object)'); | ||
} | } | ||
} | } | ||
str += '{' + objs.join(', ') + '}'; | str += '{' + objs.join(', ') + '}'; | ||
break; | break; | ||
|
|
||
case 'function': | case 'function': | ||
str += '(function)'; | str += '(function)'; | ||
break; | break; | ||
|
|
||
case 'boolean': | case 'boolean': | ||
str += String(value); | str += String(value); | ||
break; | break; | ||
|
|
||
default: str += value; | default: str += value; | ||
} | } | ||
if (i != (arguments.length - 1)) str += ' '; | if (i != (arguments.length - 1)) str += ' '; | ||
} | } | ||
return str; | return str; | ||
}; | }; | ||
document.getElementById('mt-log').innerHTML += parse.apply(this, arguments) + '<br/>'; | document.getElementById('mt-log').innerHTML += parse.apply(this, arguments) + '<br/>'; | ||
}; | }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1 +1,5 @@ | |||
${test} | ${test} | ||
<link rel="stylesheet" href="/static/css/minibuttons.css" type="text/css" media="screen" title="no title" charset="utf-8"> | |||
<%namespace name="components" file="test_components.mako" /> | |||
${components.nav(current=current)} | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,5 @@ | |||
<%namespace name="components" file="test_components.mako" /> | <%namespace name="components" file="test_components.mako" /> | ||
${components.header(title=title, projects=projects, current=current, next=next, previous=previous, excluded_tests=excluded_tests)} | ${components.header(title=title, projects=projects, current=current, next=next, previous=previous, excluded_tests=excluded_tests)} | ||
${test} | ${test} | ||
${components.nav(current=current)} | |||
${components.footer()} | ${components.footer()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters