Commit ae05380d authored by Romain Loth's avatar Romain Loth

tina: update most old jquery libs, replace bootstrap js by bootstrap-native...

tina: update most old jquery libs, replace bootstrap js by bootstrap-native js, fix bug in MS Edge on modal hiding and clean up some html
parent 4235677e
This diff is collapsed.
/**
* @preserve
* Project: Bootstrap Hover Dropdown
* Author: Cameron Spear
* Version: v2.0.10
* Contributors: Mattia Larentis
* Dependencies: Bootstrap's Dropdown plugin, jQuery
* Description: A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience.
* License: MIT
* Homepage: http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/
*/
!function($,n,e){var o=$();$.fn.dropdownHover=function(e){return"ontouchstart"in document?this:(o=o.add(this.parent()),this.each(function(){function t(e){o.find(":focus").blur(),h.instantlyCloseOthers===!0&&o.removeClass("open"),n.clearTimeout(c),i.addClass("open"),r.trigger(a)}var r=$(this),i=r.parent(),d={delay:500,instantlyCloseOthers:!0},s={delay:$(this).data("delay"),instantlyCloseOthers:$(this).data("close-others")},a="show.bs.dropdown",u="hide.bs.dropdown",h=$.extend(!0,{},d,e,s),c;i.hover(function(n){return i.hasClass("open")||r.is(n.target)?void t(n):!0},function(){c=n.setTimeout(function(){i.removeClass("open"),r.trigger(u)},h.delay)}),r.hover(function(n){return i.hasClass("open")||i.is(n.target)?void t(n):!0}),i.find(".dropdown-submenu").each(function(){var e=$(this),o;e.hover(function(){n.clearTimeout(o),e.children(".dropdown-menu").show(),e.siblings().children(".dropdown-menu").hide()},function(){var t=e.children(".dropdown-menu");o=n.setTimeout(function(){t.hide()},h.delay)})})}))},$(document).ready(function(){$('[data-hover="dropdown"]').dropdownHover()})}(jQuery,this);
\ No newline at end of file
/* =========================================================
* bootstrap-modal.js v2.0.2
* http://twitter.github.com/bootstrap/javascript.html#modals
* =========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */
!function( $ ){
"use strict"
/* MODAL CLASS DEFINITION
* ====================== */
var Modal = function ( content, options ) {
this.options = options
this.$element = $(content)
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
}
Modal.prototype = {
constructor: Modal
, toggle: function () {
return this[!this.isShown ? 'show' : 'hide']()
}
, show: function () {
var that = this
if (this.isShown) return
$('body').addClass('modal-open')
this.isShown = true
this.$element.trigger('show')
escape.call(this)
backdrop.call(this, function () {
var transition = $.support.transition && that.$element.hasClass('fade')
!that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
that.$element
.show()
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element.addClass('in')
transition ?
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
that.$element.trigger('shown')
})
}
, hide: function ( e ) {
e && e.preventDefault()
if (!this.isShown) return
var that = this
this.isShown = false
$('body').removeClass('modal-open')
escape.call(this)
this.$element
.trigger('hide')
.removeClass('in')
$.support.transition && this.$element.hasClass('fade') ?
hideWithTransition.call(this) :
hideModal.call(this)
}
}
/* MODAL PRIVATE METHODS
* ===================== */
function hideWithTransition() {
var that = this
, timeout = setTimeout(function () {
that.$element.off($.support.transition.end)
hideModal.call(that)
}, 500)
this.$element.one($.support.transition.end, function () {
clearTimeout(timeout)
hideModal.call(that)
})
}
function hideModal( that ) {
this.$element
.hide()
.trigger('hidden')
backdrop.call(this)
}
function backdrop( callback ) {
var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
var doAnimate = $.support.transition && animate
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
if (this.options.backdrop != 'static') {
this.$backdrop.click($.proxy(this.hide, this))
}
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
doAnimate ?
this.$backdrop.one($.support.transition.end, callback) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade')?
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
removeBackdrop.call(this)
} else if (callback) {
callback()
}
}
function removeBackdrop() {
this.$backdrop.remove()
this.$backdrop = null
}
function escape() {
var that = this
if (this.isShown && this.options.keyboard) {
$(document).on('keyup.dismiss.modal', function ( e ) {
e.which == 27 && that.hide()
})
} else if (!this.isShown) {
$(document).off('keyup.dismiss.modal')
}
}
/* MODAL PLUGIN DEFINITION
* ======================= */
$.fn.modal = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('modal')
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]()
else if (options.show) data.show()
})
}
$.fn.modal.defaults = {
backdrop: true
, keyboard: true
, show: true
}
$.fn.modal.Constructor = Modal
/* MODAL DATA-API
* ============== */
$(function () {
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
e.preventDefault()
$target.modal(option)
})
})
}( window.jQuery );
\ No newline at end of file
This diff is collapsed.
/* ===================================================
* bootstrap-transition.js v2.0.2
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
!function( $ ) {
$(function () {
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support && {
end: (function () {
var transitionEnd = "TransitionEnd"
// if ( $.browser.webkit ) {
// transitionEnd = "webkitTransitionEnd"
// } else if ( $.browser.mozilla ) {
// transitionEnd = "transitionend"
// } else if ( $.browser.opera ) {
// transitionEnd = "oTransitionEnd"
// }
return transitionEnd
}())
}
})()
})
}( window.jQuery );
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
body{padding-top:50px}#banner{border-bottom:0}.page-header h1{font-size:4em}.bs-docs-section{margin-top:8em}.affix{top:70px}footer{margin:5em 0}footer li{float:left;margin-right:1.5em;margin-bottom:1.5em}footer p{margin-bottom:0;clear:left}.splash{padding:6em 0 2em;color:#fff;text-align:center;background:-webkit-linear-gradient(70deg,#080f1f 30%,#2b4b5a 87%,#435e67 100%);background:-o-linear-gradient(70deg,#080f1f 30%,#2b4b5a 87%,#435e67 100%);background:-ms-linear-gradient(70deg,#080f1f 30%,#2b4b5a 87%,#435e67 100%);background:-moz-linear-gradient(70deg,#080f1f 30%,#2b4b5a 87%,#435e67 100%);background:linear-gradient(20deg,#080f1f 30%,#2b4b5a 87%,#435e67 100%);background-attachment:fixed;background-color:#1c2533}.splash .alert{margin:4em 0 2em}.splash h1{font-size:4em}.splash #social{margin-top:6em}.section-tout{padding:4em 0 3em;background-color:#eaf1f1;border-top:1px solid rgba(255,255,255,0.1);border-bottom:1px solid rgba(0,0,0,0.1)}.section-tout [class^="icon-"]{margin-right:.5em}.section-tout p{margin-bottom:3em}.section-preview{padding:4em 0 4em}.section-preview .preview{margin-bottom:4em;background-color:#eaf1f1;border:1px solid rgba(0,0,0,0.1);border-radius:6px}.section-preview .preview .image{padding:5px}.section-preview .preview .image img{border:1px solid rgba(0,0,0,0.1)}.section-preview .preview .options{padding:0 2em 2em;text-align:center}.section-preview .preview .options p{margin-bottom:2em}.section-preview .dropdown-menu{text-align:left}.section-preview .lead{margin-bottom:2em}@media(max-width:767px){.section-preview .image img{width:100%}}.bsa .one .bsa_it_ad{background-color:transparent!important;border:none!important}.bsa .one .bsa_it_ad .bsa_it_t,.bsa .one .bsa_it_ad .bsa_it_d{color:inherit!important}.bsa .one .bsa_it_p{display:none}
$('[data-toggle="tooltip"]').tooltip();
\ No newline at end of file
(function(){
var bsa = document.createElement('script');
bsa.type = 'text/javascript';
bsa.async = true;
bsa.src = 'http://s3.buysellads.com/ac/bsa.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);
})();
\ No newline at end of file
This diff is collapsed.
......@@ -17,6 +17,7 @@ text-align: center;
line-height: 8px;
font-size: 8px;
font-family: "Lucida Grande", "Trebuchet MS";
padding: 13px 0 0 0;
}
.fsslider > * {
position: absolute;
......
This diff is collapsed.
geomap
======
Plotting data from countries on a worldmap (raphael JS+ sqlite)
.geomapCont {
margin:auto;
width:80%;
text-align:center;
white-space: nowrap;
}
.distBar {
width:200px;
height:10px;
border-radius:3px;
border:1px solid #848484;
display: inline-block;
-moz-border-radius: 0px 0px 0px 0px;
-webkit-border-radius: 0px 0px 0px 0px;
background: -moz-linear-gradient(center left, #FFFF00 0%,#FF0000 100%);
background: -webkit-gradient(linear, left bottom, right bottom, color-stop(0, #FFFF00),color-stop(1, #FF0000));
}
.min,.max {
width:100px;
height:100px;
display: inline-block;
}
.mapTooltip {
position:absolute;/*position:fixed;*/
background-color : #fff;
moz-opacity:0.70;
opacity: 0.70;
filter:alpha(opacity=70);
border-radius:10px;
padding : 10px;
z-index: 1000;
max-width: 200px;
display:none;
color:#343434;
}
.mapLegend {
}
.map, .therange{
/* IE10 Consumer Preview */
background-image: -ms-radial-gradient(left top, ellipse farthest-corner, #FFFFFF 0%, #45CDFF 100%);
/* Mozilla Firefox */
background-image: -moz-radial-gradient(left top, ellipse farthest-corner, #FFFFFF 0%, #45CDFF 100%);
/* Opera */
background-image: -o-radial-gradient(left top, ellipse farthest-corner, #FFFFFF 0%, #45CDFF 100%);
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(radial, left top, 0, left top, 994, color-stop(0, #FFFFFF), color-stop(1, #45CDFF));
/* Webkit (Chrome 11+) */
background-image: -webkit-radial-gradient(left top, ellipse farthest-corner, #FFFFFF 0%, #45CDFF 100%);
/* W3C Markup, IE10 Release Preview */
background-image: radial-gradient(ellipse farthest-corner at left top, #FFFFFF 0%, #45CDFF 100%);
position:relative;
}
.zoomIn, .zoomOut {
background-color:#fff;
border:1px solid #ccc;
color:#000;
width:15px;
height:15px;
line-height: 15px;
text-align:center;
border-radius:3px;
cursor:pointer;
position:absolute;
top : 10px;
font-weight:bold;
left : 10px;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
}
.zoomOut {
top:30px;
}
This diff is collapsed.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Demo</title>
<link rel="stylesheet" type="text/css" href="css/geo.css" />
</head>
<body>
<div class="geomapCont">
</div>
<script src="../libs/jquery/jquery-1.9.1.js" charset="utf-8" ></script>
<script src="js/jquery.mousewheel.js" charset="utf-8"></script>
<script src="js/raphael/raphael-min.js" charset="utf-8" ></script>
<script src="js/jquery.mapael.js" charset="utf-8" ></script>
<script src="js/maps/world_countries.js" charset="utf-8" ></script>
<script src="examples.js" charset="utf-8" ></script>
</body>
</html>
var CC={};
CC["AF"]="Afghanistan";
CC["AL"]="Albania";
CC["DZ"]="Algeria";
CC["AO"]="Angola";
CC["AR"]="Argentina";
CC["AM"]="Armenia";
CC["AU"]="Australia";
CC["AT"]="Austria";
CC["AZ"]="Azerbaijan";
CC["BD"]="Bangladesh";
CC["BY"]="Belarus";
CC["BE"]="Belgium";
CC["BZ"]="Belize";
CC["BJ"]="Benin";
CC["BT"]="Bhutan";
CC["VE"]="Bolivarian Republic of Venezuela";
CC["BA"]="Bosnia and Herzegovina";
CC["BW"]="Botswana";
CC["BR"]="Brazil";
CC["BN"]="Brunei Darussalam";
CC["BG"]="Bulgaria";
CC["BF"]="Burkina Faso";
CC["BI"]="Burundi";
CC["KH"]="Cambodia";
CC["CM"]="Cameroon";
CC["CA"]="Canada";
CC["CF"]="Central African Republic";
CC["TD"]="Chad";
CC["CL"]="Chile";
CC["CN"]="China";
CC["CO"]="Colombia";
CC["CG"]="Congo";
CC["CR"]="Costa Rica";
CC["HR"]="Croatia";
CC["CU"]="Cuba";
CC["CY"]="Cyprus";
CC["CZ"]="Czech Republic";
CC["KP"]="Democratic People\u2019s Republic of Korea";
CC["DK"]="Denmark";
CC["DJ"]="Djibouti";
CC["DO"]="Dominican Republic";
CC["EC"]="Ecuador";
CC["EG"]="Egypt";
CC["SV"]="El Salvador";
CC["GQ"]="Equatorial Guinea";
CC["ER"]="Eritrea";
CC["EE"]="Estonia";
CC["ET"]="Ethiopia";
CC["FK"]="Falkland Islands (Malvinas)";
CC["FJ"]="Fiji";
CC["FI"]="Finland";
CC["FR"]="France";
CC["GF"]="French Guiana";
CC["GA"]="Gabon";
CC["GM"]="Gambia";
CC["GE"]="Georgia";
CC["DE"]="Germany";
CC["GH"]="Ghana";
CC["GR"]="Greece";
CC["GL"]="Greenland";
CC["GT"]="Guatemala";
CC["GN"]="Guinea";
CC["GW"]="Guinea-Bissau";
CC["GY"]="Guyana";
CC["HT"]="Haiti";
CC["HN"]="Honduras";
CC["HU"]="Hungary";
CC["IS"]="Iceland";
CC["IN"]="India";
CC["ID"]="Indonesia";
CC["IQ"]="Iraq";
CC["IE"]="Ireland";
CC["IR"]="Islamic Republic of Iran";
CC["IL"]="Israel";
CC["IT"]="Italy";
CC["CI"]="Ivory Coast";
CC["JM"]="Jamaica";
CC["JP"]="Japan";
CC["JO"]="Jordan";
CC["KZ"]="Kazakhstan";
CC["KE"]="Kenya";
CC["KW"]="Kuwait";
CC["KG"]="Kyrgyzstan";
CC["LA"]="Lao People\u2019s Democratic Republic";
CC["LV"]="Latvia";
CC["LB"]="Lebanon";
CC["LS"]="Lesotho";
CC["LR"]="Liberia";
CC["LY"]="Libyan Arab Jamahiriya";
CC["LT"]="Lithuania";
CC["LU"]="Luxembourg";
CC["MG"]="Madagascar";
CC["MW"]="Malawi";
CC["MY"]="Malaysia";
CC["ML"]="Mali";
CC["MR"]="Mauritania";
CC["MX"]="Mexico";
CC["MN"]="Mongolia";
CC["MA"]="Morocco";
CC["MZ"]="Mozambique";
CC["MM"]="Myanmar";
CC["NA"]="Namibia";
CC["NP"]="Nepal";
CC["NL"]="Netherlands";
CC["NC"]="New Caledonia";
CC["NZ"]="New Zealand";
CC["NI"]="Nicaragua";
CC["NE"]="Niger";
CC["NG"]="Nigeria";
CC["NO"]="Norway";
CC["PS"]="Occupied Palestinian Territory";
CC["OM"]="Oman";
CC["PK"]="Pakistan";
CC["PA"]="Panama";
CC["PG"]="Papua New Guinea";
CC["PY"]="Paraguay";
CC["PE"]="Peru";
CC["PH"]="Philippines";
CC["BO"]="Plurinational State of Bolivia";
CC["PL"]="Poland";
CC["PT"]="Portugal";
CC["TW"]="Province of China Taiwan";
CC["PR"]="Puerto Rico";
CC["QA"]="Qatar";
CC["KR"]="Republic of Korea";
CC["MD"]="Republic of Moldova";
CC["RO"]="Romania";
CC["RU"]="Russian Federation";
CC["RW"]="Rwanda";
CC["SA"]="Saudi Arabia";
CC["SN"]="Senegal";
CC["RS"]="Serbia";
CC["SL"]="Sierra Leone";
CC["SK"]="Slovakia";
CC["SB"]="Solomon Islands";
CC["SO"]="Somalia";
CC["ZA"]="South Africa";
CC["ES"]="Spain";
CC["LK"]="Sri Lanka";
CC["SD"]="Sudan";
CC["SR"]="Suriname";
CC["SJ"]="Svalbard and Jan Mayen";
CC["SZ"]="Swaziland";
CC["SE"]="Sweden";
CC["CH"]="Switzerland";
CC["SY"]="Syrian Arab Republic";
CC["TJ"]="Tajikistan";
CC["TH"]="Thailand";
CC["CD"]="The Democratic Republic of the Congo";
CC["MK"]="The Former Yugoslav Republic of Macedonia";
CC["TL"]="Timor-Leste";
CC["TG"]="Togo";
CC["TN"]="Tunisia";
CC["TR"]="Turkey";
CC["TM"]="Turkmenistan";
CC["UG"]="Uganda";
CC["UA"]="Ukraine";
CC["AE"]="United Arab Emirates";
CC["GB"]="United Kingdom";
CC["TZ"]="United Republic of Tanzania";
CC["US"]="United States";
CC["UY"]="Uruguay";
CC["UZ"]="Uzbekistan";
CC["VU"]="Vanuatu";
CC["VN"]="Viet Nam";
CC["EH"]="Western Sahara";
CC["YE"]="Yemen";
CC["ZM"]="Zambia";
CC["ZW"]="Zimbabwe";
CC["TZ"]="Tanzania";
This diff is collapsed.
This diff is collapsed.
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
* Licensed under the MIT License (LICENSE.txt).
*
* Version: 3.1.6
*
* Requires: jQuery 1.2.2+
*/
(function (factory) {
if ( typeof define === 'function' && define.amd ) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS style for Browserify
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
slice = Array.prototype.slice,
nullLowestDeltaTimeout, lowestDelta;
if ( $.event.fixHooks ) {
for ( var i = toFix.length; i; ) {
$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
}
}
$.event.special.mousewheel = {
version: '3.1.6',
setup: function() {
if ( this.addEventListener ) {
for ( var i = toBind.length; i; ) {
this.addEventListener( toBind[--i], handler, false );
}
} else {
this.onmousewheel = handler;
}
},
teardown: function() {
if ( this.removeEventListener ) {
for ( var i = toBind.length; i; ) {
this.removeEventListener( toBind[--i], handler, false );
}
} else {
this.onmousewheel = null;
}
}
};
$.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
},
unmousewheel: function(fn) {
return this.unbind('mousewheel', fn);
}
});
function handler(event) {
var orgEvent = event || window.event,
args = slice.call(arguments, 1),
delta = 0,
deltaX = 0,
deltaY = 0,
absDelta = 0;
event = $.event.fix(orgEvent);
event.type = 'mousewheel';
// Old school scrollwheel delta
if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaX = deltaY * -1;
deltaY = 0;
}
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
delta = deltaY === 0 ? deltaX : deltaY;
// New school wheel delta (wheel event)
if ( 'deltaY' in orgEvent ) {
deltaY = orgEvent.deltaY * -1;
delta = deltaY;
}
if ( 'deltaX' in orgEvent ) {
deltaX = orgEvent.deltaX;
if ( deltaY === 0 ) { delta = deltaX * -1; }
}
// No change actually happened, no reason to go any further
if ( deltaY === 0 && deltaX === 0 ) { return; }
// Store lowest absolute delta to normalize the delta values
absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
if ( !lowestDelta || absDelta < lowestDelta ) {
lowestDelta = absDelta;
}
// Get a whole, normalized value for the deltas
delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
// Add information to the event object
event.deltaX = deltaX;
event.deltaY = deltaY;
event.deltaFactor = lowestDelta;
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
// Clearout lowestDelta after sometime to better
// handle multiple device types that give different
// a different lowestDelta
// Ex: trackpad = 3 and mouse wheel = 120
if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
return ($.event.dispatch || $.event.handle).apply(this, args);
}
function nullLowestDelta() {
lowestDelta = null;
}
}));
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1">
<file>
<url>php/mapael.php</url>
<bookmark id="1">
<name/>
<line>142</line>
<key/>
</bookmark>
</file>
</editor-bookmarks>
</project-private>
include.path=${php.global.include.path}
php.version=PHP_53
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=true
web.root=.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>geomap</name>
</data>
</configuration>
</project>
<?
//localhost/ColorGradient/ColorGradient.php?steps=5
class ColorGenerator {
public $steps;
public $thecolors = array();
public $begin = 0xFF0000;
public $end = 0xFFFF00;
public function __construct($nbsteps = "") {
$this->steps = $nbsteps;
}
public function getColours() {
$theColorBegin = $this->begin;
$theColorEnd = $this->end;
$theNumSteps = $this->steps; //255;
$theColorBegin = (($theColorBegin >= 0x000000) && ($theColorBegin <= 0xffffff)) ? $theColorBegin : 0x000000;
$theColorEnd = (($theColorEnd >= 0x000000) && ($theColorEnd <= 0xffffff)) ? $theColorEnd : 0xffffff;
$theNumSteps = (($theNumSteps > 0) && ($theNumSteps < 256)) ? $theNumSteps : 16;
//printf("<p>values ares: (color begin: 0x%06X), (color end: 0x%06X), (number of steps: %d)</p>\n", $theColorBegin, $theColorEnd, $theNumSteps);
$theR0 = ($theColorBegin & 0xff0000) >> 16;
$theG0 = ($theColorBegin & 0x00ff00) >> 8;
$theB0 = ($theColorBegin & 0x0000ff) >> 0;
$theR1 = ($theColorEnd & 0xff0000) >> 16;
$theG1 = ($theColorEnd & 0x00ff00) >> 8;
$theB1 = ($theColorEnd & 0x0000ff) >> 0;
// return the interpolated value between pBegin and pEnd
function interpolate($pBegin, $pEnd, $pStep, $pMax) {
if ($pBegin < $pEnd) {
return (($pEnd - $pBegin) * ($pStep / $pMax)) + $pBegin;
} else {
return (($pBegin - $pEnd) * (1 - ($pStep / $pMax))) + $pEnd;
}
}
// generate gradient swathe now
for ($i = 0; $i <= $this->steps; $i++) {
$theR = interpolate($theR0, $theR1, $i, $theNumSteps);
$theG = interpolate($theG0, $theG1, $i, $theNumSteps);
$theB = interpolate($theB0, $theB1, $i, $theNumSteps);
$theVal = ((($theR << 8) | $theG) << 8) | $theB;
array_push($this->thecolors, strtoupper(dechex($theVal)));
}
}
}
?>
<?php
class scanTree {
public $root;
public $dbs = array();
public function __construct($rootpath = "") {
$this->root = $rootpath;
}
public function getDirectoryTree($dir) {
$folder = array();
$dbs = array();
$gexfs = array();
$dataFolder = $this->root . $dir;
$files = scandir($dataFolder);
foreach ($files as $f) {
if ($f != "." and $f != ".." and $f[strlen($f) - 1] != "~") {
if (is_dir($dataFolder . "/" . $f)) {
//pr("Dir: ".$f);
$subfolder = $f;
$this->getDirectoryTree($dir . "/" . $subfolder);
} else {
//pr("File: ".$f);
if ((strpos($f, '.db')) or (strpos($f, '.sqlite')) or (strpos($f, '.sqlite3')))
array_push($dbs, $dir."/".$f);
//$dir . "/" .
}
}
}
array_push($this->dbs, $dbs);
}
}
?>
<?php
// Common parameters for all function proposing insight into the corpora
header('Content-Type: application/json');
ini_set('display_errors', 'On');
error_reporting(E_ALL);
$mainpath=dirname(dirname(getcwd()))."/"; // -> /var/www/ademe/data/
$db=json_decode($_GET["db"]);
$dbname="";
foreach($db as $d){
if (strpos($d, 'graph.db') !== false){
$db=$d;
break;
}
}
if($mainpath=="//") $mainpath="";
if ( is_array($db) ) $db = $db[0];
echo "[$mainpath] this is the mainpath\n";
echo "[$db] this is the db\n";
echo "sqlite:" .$mainpath.$db."\n";
echo "sqlite:" ."../../community.db";
//$dbname=$db[0];//getDB($mainpath);//'homework-20750-1-homework-db.db';;
$base = new PDO("sqlite:" .$db);
echo "succeed\n";
$max_item_displayed=6;
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
// Common parameters for all function proposing insight into the corpora
$mainpath=dirname(dirname(getcwd()))."/"; // -> /var/www/ademe/data/
$db=json_decode($_GET["db"]);
$dbname="";
foreach($db as $d){
if (strpos($d, 'graph.db') !== false){
$db=$d;
break;
}
}
if($mainpath=="//") $mainpath="";
if ( is_array($db) ) $db = $db[0];
//$dbname=$db[0];//getDB($mainpath);//'homework-20750-1-homework-db.db';;
$base = new PDO("sqlite:" .$mainpath.$db);
$max_item_displayed=6;
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment