Fixing issue 74

This commit is contained in:
Nathan Adams 2014-12-21 13:54:06 -06:00
parent f597b1ac25
commit 7a8b6343f8
3 changed files with 2419 additions and 31 deletions

View File

@ -148,7 +148,7 @@ class IDF_FileUtil
// a list of extensions that we know // a list of extensions that we know
// And document the types best we can: // And document the types best we can:
// po is a translation file in indefero - tried text/plain but the syntax highlight JS library didn't like it // po is a translation file in indefero - tried text/plain but the syntax highlight JS library didn't like it
$ext_hack = array("po" => "application/octet-stream"); $ext_hack = array("po" => "text/plain");
$info = pathinfo($file); $info = pathinfo($file);
$res = array('application/octet-stream', $res = array('application/octet-stream',
$info['basename'], $info['basename'],

View File

@ -50,6 +50,48 @@
<link rel="stylesheet" type="text/css" href="{media '/idf/css/syntaxhighlight/shThemeDefault.css'}" /> <link rel="stylesheet" type="text/css" href="{media '/idf/css/syntaxhighlight/shThemeDefault.css'}" />
{/if} {/if}
{literal}
<script type="text/javascript">
$.event.special.tripleclick = {
setup: function(data, namespaces) {
var elem = this, $elem = jQuery(elem);
$elem.bind('click', jQuery.event.special.tripleclick.handler);
},
teardown: function(namespaces) {
var elem = this, $elem = jQuery(elem);
$elem.unbind('click', jQuery.event.special.tripleclick.handler)
},
handler: function(event) {
var elem = this, $elem = jQuery(elem), clicks = $elem.data('clicks') || 0, start = $elem.data('startTimeTC') || 0;
if ((new Date().getTime() - start)>= 1000) {
clicks = 0;
}
clicks += 1;
if(clicks === 1) {
start = new Date().getTime();
}
if ( clicks === 3 ) {
clicks = 0;
// set event type to "tripleclick"
event.type = "tripleclick";
// let jQuery handle the triggering of "tripleclick" event handlers
jQuery.event.handle.apply(this, arguments)
}
$elem.data('clicks', clicks);
$elem.data('startTimeTC', start);
}
};
</script>
{/literal}
{appversion} {appversion}
</head> </head>
<body> <body>
@ -133,6 +175,9 @@ $(document).ready(function(){
<script type="text/javascript" src="{media '/idf/js/allowtabs.js'}"></script> <script type="text/javascript" src="{media '/idf/js/allowtabs.js'}"></script>
<script type="application/javascript"> <script type="application/javascript">
{literal} {literal}
function path() function path()
{ {
var args = arguments, var args = arguments,
@ -209,34 +254,10 @@ $(function() {
}); });
function lineWrap(){
var wrap = function () {
var elems = document.getElementsByClassName('syntaxhighlighter');
for (var j = 0; j < elems.length; ++j) {
var sh = elems[j];
var gLines = sh.getElementsByClassName('gutter')[0].getElementsByClassName('line');
var cLines = sh.getElementsByClassName('code')[0].getElementsByClassName('line');
var stand = 15;
for (var i = 0; i < gLines.length; ++i) {
var h = $(cLines[i]).height();
if (h != stand) {
console.log(i);
gLines[i].setAttribute('style', 'height: ' + h + 'px !important;');
}
}
}
};
var whenReady = function () {
if ($('.syntaxhighlighter').length === 0) {
setTimeout(whenReady, 800);
} else {
wrap();
}
};
whenReady();
};
lineWrap();
$(window).resize(function(){lineWrap()});
{/literal} {/literal}
</script> </script>

File diff suppressed because one or more lines are too long