-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
95 changed files
with
31,780 additions
and
248 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,175 @@ | ||
/*! SWE 3.1.4 2019044T1413 */ | ||
!function(e){function t(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t){$(function(){"use strict";$("form").filter('[action*="//find.search.qld.gov.au/"]').not(".qg-funnelback-search").each(function(){function e(){c.empty()}function t(e){o[0].value=e,setTimeout(function(){o[0].setSelectionRange(l.length,o[0].value.length)},0)}function n(e){var n=c.find("a"),a=n.filter(".focus");a.length>0?(e=(n.index(a)+e)%n.length,a.removeClass("focus")):e=e>-1?0:-1,n=n.eq(e),n.addClass("focus"),t(n.text())}var a=this,o=$(a.elements.query).filter('[name="query"]'),r=o.val(),l="";o.attr("role","combobox").attr("autocomplete","off").attr("aria-autocomplete","both");var c=$('<ul role="listbox" class="listbox" aria-busy="true"/>').generateId("suggestbox");o.after(c),o.attr("aria-owns",c.attr("id")),c.on("click","a",function(t){t.preventDefault(),o.val($(this).text()).get(0).focus(),e()});var i={alt:18,backspace:8,delete:46,down:40,enter:13,escape:27,left:37,right:39,tab:9,up:38};$(document).on("click",function(t){o.is(t.target)?t.stopImmediatePropagation():e()}),o.on("keydown",function(t){switch(t.which){case i.up:case i.down:n(t.which===i.down?1:-1);break;case i.tab:e()}}),o.on("keyup",function(t){switch(t.which){case i.escape:case i.enter:e()}}),o.on("input",function(){if(l=this.value,l.length<3)return void e();$.ajax({cache:!0,dataType:"jsonp",url:"https://find.search.qld.gov.au/s/suggest.json?",data:{collection:$(a.elements.collection).filter('[name="collection"]').val()||"qld-gov",profile:$(a.elements.profile).filter('[name="profile"]').val()||"qld_preview",show:7,partial_query:l}}).done(function(t){if(t.length<1)return void e();var n=new RegExp(l.replace(/([.+*?\[^\]$(){}=!<>|:-\\,])/g,"\\$1"),"g"),a=l.replace(/</g,"<");c.html($.map(t,function(e){var t=e.replace(/</g,"<").replace(n,"<mark>"+a+"</mark>");return'<li><a href="https://find.search.qld.gov.au/s/search.html?collection=qld-gov&profile=qld&query='+encodeURIComponent(e)+'">'+t+"</a></li>"}).join("\n")),r=o.val(),c.attr("aria-busy","false")})})})})}]); | ||
// onready | ||
$(function() { | ||
'use strict'; | ||
|
||
var MAX_SUGGESTIONS = 7; | ||
|
||
// TODO refactor this so functions are not created for every search form found on the page | ||
|
||
// setup for each form | ||
// TODO hardcoded to find.search.qld.gov.au | ||
$( 'form' ).filter( '[action*="//find.search.qld.gov.au/"]' ).not('.qg-funnelback-search').each(function() { | ||
var form = this; | ||
var searchField = $( form.elements.query ).filter( '[name="query"]' ); | ||
var lastSearch = searchField.val(); | ||
var userTyped = ''; | ||
|
||
// ARIA | ||
searchField | ||
.attr( 'role', 'combobox' ) | ||
.attr( 'autocomplete', 'off' ) | ||
// both? or list? http://www.w3.org/TR/2011/CR-wai-aria-20110118/states_and_properties#aria-autocomplete | ||
.attr( 'aria-autocomplete', 'both' ); | ||
|
||
// make the search box wider on focus | ||
// keep it wide while interacting with the search form (box, button, autosuggest list) | ||
|
||
// create the suggestion box | ||
var suggestions = $( '<ul role="listbox" class="listbox" aria-busy="true"/>' ).generateId( 'suggestbox' ); | ||
searchField.after( suggestions ); | ||
searchField.attr( 'aria-owns', suggestions.attr( 'id' )); | ||
|
||
function closeSuggestions() { | ||
suggestions.empty(); | ||
} | ||
|
||
function prefillInput( value ) { | ||
searchField[0].value = value; | ||
// console.log( 'prefilling', value, userTyped ); | ||
// http://stackoverflow.com/questions/12047648/setselectionrange-with-on-click-in-chrome-does-not-select-on-second-click | ||
setTimeout(function() { | ||
searchField[0].setSelectionRange( userTyped.length, searchField[0].value.length ); | ||
}, 0 ); | ||
} | ||
|
||
function moveFocus( n ) { | ||
var a = suggestions.find( 'a' ); | ||
var focus = a.filter( '.focus' ); | ||
if ( focus.length > 0 ) { | ||
n = ( a.index( focus ) + n ) % a.length; | ||
focus.removeClass( 'focus' ); | ||
} else { | ||
n = n > -1 ? 0 : -1; | ||
} | ||
a = a.eq( n ); | ||
a.addClass( 'focus' ); | ||
prefillInput( a.text() ); | ||
} | ||
|
||
// TODO how can we run this on both search forms (content and header) but show suggestions in the appropriate place? | ||
|
||
suggestions.on( 'click', 'a', function( event ) { | ||
// should this submit? no. see ARIA instructions | ||
event.preventDefault(); | ||
|
||
searchField.val( $( this ).text() ).get( 0 ).focus(); | ||
closeSuggestions(); | ||
}); | ||
|
||
|
||
var KEYS = { | ||
alt: 18, | ||
backspace: 8, | ||
'delete': 46, | ||
down: 40, | ||
enter: 13, | ||
escape: 27, | ||
left: 37, | ||
right: 39, | ||
tab: 9, | ||
up: 38 | ||
}; | ||
|
||
|
||
// clicking outside the field closes suggestions | ||
$( document ).on( 'click', function( event ) { | ||
if ( searchField.is( event.target )) { | ||
event.stopImmediatePropagation(); | ||
} else { | ||
closeSuggestions(); | ||
} | ||
}); | ||
|
||
// handle loss of focus due to TAB | ||
// need to run this onblur, but NOT when focus remains in the suggestions box | ||
// can we check focus in a parent element!? maybe a custom element | ||
// <combobox><input><ul></combobox> ?? | ||
searchField.on( 'keydown', function( event ) { | ||
switch ( event.which ) { | ||
case KEYS.up: | ||
case KEYS.down: | ||
moveFocus( event.which === KEYS.down ? 1 : -1 ); | ||
break; | ||
case KEYS.tab: | ||
closeSuggestions(); | ||
} | ||
}); | ||
searchField.on( 'keyup', function( event ) { | ||
switch ( event.which ) { | ||
case KEYS.escape: | ||
case KEYS.enter: | ||
closeSuggestions(); | ||
} | ||
|
||
// delete | ||
// console.log( event.which ); | ||
}); | ||
|
||
searchField.on( 'input', function() { | ||
userTyped = this.value; | ||
if ( userTyped.length < 3 ) { | ||
closeSuggestions(); | ||
return; | ||
} | ||
|
||
// console.log( 'fetch suggestions for ', userTyped ); | ||
|
||
$.ajax({ | ||
// cache! (the URL will be change with the search text) | ||
cache: true, | ||
dataType: 'jsonp', | ||
url: 'https://find.search.qld.gov.au/s/suggest.json?', | ||
data: { | ||
// TODO read these from search form | ||
collection: $( form.elements.collection ).filter( '[name="collection"]' ).val() || 'qld-gov', | ||
profile: $( form.elements.profile ).filter( '[name="profile"]' ).val() || 'qld_preview', | ||
show: MAX_SUGGESTIONS, | ||
partial_query: userTyped | ||
} | ||
}) | ||
.done(function( data ) { | ||
if ( data.length < 1 ) { | ||
closeSuggestions(); | ||
return; | ||
} | ||
// TODO if the user has typed more, filter the matches in this array | ||
// should we retreive more than 4 so there is a bit of slack here? | ||
// what if ajax repsonses arrive out of sequence? track last match? | ||
// console.log( 'suggestions for ', userTyped, data, 'user has typed', searchField.val() ); | ||
var match = new RegExp( userTyped.replace( /([.+*?\[^\]$(){}=!<>|:-\\,])/g, '\\$1' ), 'g' ); | ||
var safeInput = userTyped.replace( /</g, '<' ); | ||
suggestions.html( $.map( data, function( value ) { | ||
var htmlValue = value.replace( /</g, '<' ).replace( match, '<mark>' + safeInput + '</mark>' ); | ||
// use form.action + default params | ||
return '<li><a href="https://find.search.qld.gov.au/s/search.html?collection=qld-gov&profile=qld&query=' + encodeURIComponent( value ) + '">' + htmlValue + '</a></li>'; | ||
}).join( '\n' )); | ||
|
||
// issue #3: issues with typing over selected suggestion | ||
// https://github.com/qld-gov-au/jquery.autocomplete/issues/3 | ||
// check length is increasing (if not, user is deleting input) | ||
// if ( searchField[0].value.length > lastSearch.length ) { | ||
// // set the value to the best answer and select the untyped portion of the text | ||
// prefillInput( data[0] ); | ||
// } | ||
lastSearch = searchField.val(); | ||
suggestions.attr('aria-busy','false'); | ||
}); | ||
|
||
// show suggestions box | ||
// click on suggestion = fill in form and submit | ||
// hover over selection = update 'placeholder' style text | ||
|
||
}); | ||
}); | ||
|
||
}); // onready |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
39 changes: 37 additions & 2 deletions
39
docs/assets/v3.1/latest/lib/ext/butterfly/butterfly-ie.css
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,37 @@ | ||
/*! SWE 3.1.4 2019044T1413 */ | ||
* html #jb-overlay{position:absolute!important;filter:alpha(opacity = 70)}* html #jb-overlay,* html #jb-window{top:expression(eval(document.documentElement.scrollTop));height:expression(eval(document.documentElement.clientHeight) + "px")}* html #jb-window{position:absolute}* html #jb-window.reactive{background-image:url(../images/skin/reactive-overlay.gif)}* html #jb-window-inner{margin-top:expression(((this.parentNode.clientHeight - this.clientHeight)/2) + "px");margin-left:auto;margin-right:auto;overflow:auto!important}* html #jb-window-content{overflow:hidden}* html{background-image:url(about:blank);background-attachment:fixed} | ||
/** | ||
* jquery.butterfly.js | ||
* @version 0.10 | ||
* @see http://irama.org/web/dhtml/butterfly/ | ||
* @license GNU GENERAL PUBLIC LICENSE (GPL) <http://www.gnu.org/licenses/gpl.html> | ||
*/ | ||
/* butterfly lightbox IE6 hacks */ | ||
* html #jb-overlay { | ||
position: absolute !important; | ||
top: expression(eval(document.documentElement.scrollTop)); | ||
height: expression(eval(document.documentElement.clientHeight) + 'px'); | ||
filter: alpha(opacity = 70); | ||
} | ||
* html #jb-window { | ||
position: absolute; | ||
top: expression(eval(document.documentElement.scrollTop)); | ||
height: expression(eval(document.documentElement.clientHeight) + 'px'); | ||
} | ||
* html #jb-window.reactive { | ||
background-image: url(../images/skin/reactive-overlay.gif); | ||
} | ||
* html #jb-window-inner { | ||
margin-top: expression( (( this.parentNode.clientHeight - this.clientHeight ) / 2 ) + "px" ); | ||
margin-left: auto; | ||
margin-right: auto; | ||
overflow: auto !important; | ||
} | ||
* html #jb-window-content { | ||
overflow: hidden; | ||
} | ||
|
||
|
||
/* IE6 Fixed Position Jitter Fix */ | ||
* html { | ||
background-image: url(about:blank); | ||
background-attachment: fixed; | ||
} |
127 changes: 125 additions & 2 deletions
127
docs/assets/v3.1/latest/lib/ext/butterfly/butterfly.css
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,125 @@ | ||
/*! SWE 3.1.4 2019044T1413 */ | ||
#jb-overlay{background:#000;z-index:1}#jb-overlay,#jb-window{position:fixed;top:0;height:100%;left:0;width:100%}#jb-window{z-index:2}#jb-window-inner{background-color:#fff;color:#444;width:50%;height:50%;margin:auto;overflow:auto}#jb-loading{position:absolute;left:0;top:0;width:0;height:0;padding:0;margin:0;line-height:0;display:block;overflow:hidden}#jb-window.reactive{background:transparent url(reactive-overlay.png) 100% 0 no-repeat}#jb-window.loading #jb-window-inner{background-image:url(loading-black-on-white.gif);background-position:50%;background-repeat:no-repeat}.type-ajax #jb-window-content{padding:0 1em 1em}.type-media #jb-window-content{padding:0}#jb-window-content:focus{outline:none}#jb-window-content .jb-caption{display:block;clear:both;margin:0;position:absolute;bottom:0;left:0;background:#fff;width:100%}#jb-window-content .jb-caption span{display:block;padding:.5em 1em}#jb-close-button img{border:none}#jb-window.error-no-content #jb-window-content{background:transparent url(alert-64.png) 15px no-repeat;padding-left:70px}#jb-gallery-next,#jb-gallery-prev{height:0;padding-top:85px;width:49px;background:transparent url(gallery-controls-sprite.png) 0 0 no-repeat}#jb-gallery-next{background-position:-49px top}#jb-gallery-prev:focus,#jb-gallery-prev:hover{background-position:left -85px}#jb-gallery-next:focus,#jb-gallery-next:hover{background-position:-49px -85px}#jb-gallery-next.disabled,#jb-gallery-prev.disabled{background:none;cursor:default}.type-iframe #jb-window-content iframe{border:none;background:transparent;padding:0} | ||
/** | ||
* jquery.butterfly.js | ||
* @version 0.10 | ||
* @see http://irama.org/web/dhtml/butterfly/ | ||
* @license GNU GENERAL PUBLIC LICENSE (GPL) <http://www.gnu.org/licenses/gpl.html> | ||
*/ | ||
|
||
#jb-overlay { | ||
background: #000; | ||
z-index: 999; | ||
position: fixed; | ||
top: 0; | ||
height: 100%; | ||
left: 0; | ||
width: 100%; | ||
} | ||
#jb-window { | ||
z-index: 1000; | ||
position: fixed; | ||
top: 0; | ||
height: 100%; | ||
left: 0; | ||
width: 100%; | ||
} | ||
|
||
#jb-window-inner { | ||
background-color: #fff; | ||
color: #444; | ||
width: 50%; | ||
height: 50%; | ||
margin: auto; | ||
overflow: auto; | ||
/*position: relative;*/ | ||
} | ||
|
||
#jb-loading { /* For semantic value, not to be seen */ | ||
position: absolute; | ||
left: 0; top: 0; | ||
width: 0; height: 0; | ||
padding: 0; margin: 0; | ||
line-height: 0; | ||
display: block; | ||
overflow: hidden; | ||
} | ||
|
||
#jb-window.reactive { | ||
background: transparent url(reactive-overlay.png) right top no-repeat; | ||
} | ||
|
||
|
||
#jb-window.loading #jb-window-inner { | ||
background-image: url(loading-black-on-white.gif); | ||
background-position: center center; | ||
background-repeat: no-repeat; | ||
} | ||
/*.type-fragment #jb-window-content, */ | ||
.type-ajax #jb-window-content { | ||
padding: 0 1em 1em; | ||
} | ||
|
||
.type-media #jb-window-content { | ||
padding: 0; | ||
} | ||
|
||
#jb-window-content:focus { | ||
outline: none; | ||
} | ||
|
||
#jb-window-content .jb-caption { | ||
display: block; | ||
clear: both; | ||
margin: 0; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
background: #fff; | ||
width: 100%; | ||
} | ||
#jb-window-content .jb-caption span { | ||
display: block; | ||
padding: .5em 1em; | ||
} | ||
|
||
|
||
|
||
|
||
#jb-close-button img { | ||
border: none; | ||
} | ||
|
||
#jb-window.error-no-content #jb-window-content { | ||
background: transparent url(alert-64.png) 15px center no-repeat; | ||
padding-left: 70px; | ||
} | ||
|
||
/* Image replacement on gallery controls */ | ||
#jb-gallery-prev, | ||
#jb-gallery-next { | ||
height: 0; | ||
padding-top: 85px; | ||
width: 49px; | ||
background: transparent url(gallery-controls-sprite.png) left top no-repeat; | ||
} | ||
#jb-gallery-next { | ||
background-position: -49px top; | ||
} | ||
#jb-gallery-prev:hover, | ||
#jb-gallery-prev:focus { | ||
background-position: left -85px; | ||
} | ||
#jb-gallery-next:hover, | ||
#jb-gallery-next:focus { | ||
background-position: -49px -85px; | ||
} | ||
#jb-gallery-prev.disabled, | ||
#jb-gallery-next.disabled { | ||
background: none; | ||
cursor: default; | ||
} | ||
|
||
.type-iframe #jb-window-content iframe { | ||
border: none; | ||
background: transparent; | ||
padding: 0; | ||
} |
1,466 changes: 1,463 additions & 3 deletions
1,466
docs/assets/v3.1/latest/lib/ext/butterfly/jquery.butterfly.js
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.