Showing with 155 additions and 153 deletions.
  1. +43 −39 demos/_assets/css/jqm-demos.css
  2. +21 −24 demos/_assets/js/jqm-demos.js
  3. +2 −1 demos/_search/index.php
  4. +89 −89 demos/jqm-contents.php
@@ -202,6 +202,35 @@
filter: Alpha(Opacity=40);
}

/* Search */
.jqm-search-panel .ui-panel-inner {
padding-top: 0;
}
.jqm-search-panel .ui-input-search {
margin: 1em 0;
}
.jqm-list .jqm-search-results-keywords {
padding: .46857em 0 0;
font-size: .8em;
font-weight: 300;
color: #999;
display: block;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.ui-btn-active .jqm-search-results-keywords {
color: #fff;
}
.jqm-search-results-highlight {
color: #3388cc;
font-weight: 400;
}
.ui-btn-active .jqm-search-results-highlight {
color: #fff;
font-weight: 300;
}

/* Quick links */
.jqm-demos .jqm-content .jqm-deeplink {
display: block;
@@ -329,6 +358,20 @@
.jqm-navmenu-panel .ui-btn:hover::after {
opacity: .4;
}
.jqm-search-panel {
width: 26em;
right: -26em;
z-index: 1003; /* Puts the panel on top of the dismiss modal which is not adjusted to custom width */
}
.jqm-search-panel.ui-panel-animate.ui-panel-position-right {
-webkit-transform: translate3d(26em,0,0);
-moz-transform: translate3d(26em,0,0);
transform: translate3d(26em,0,0);
}
.ui-panel-dismiss-open.ui-panel-dismiss-position-right {
left: -17em;
right: 17em;
}
}

/* View source popup */
@@ -628,42 +671,3 @@
color: #fff;
text-shadow: none;
}
/* CSS for keywords highlighting in search results */
.jqm-search-results-highlight {
color: #07ade0;
font-weight: 400;
text-shadow: none;
}
.ui-btn-active .jqm-search-results-highlight,
.ui-focus .jqm-search-results-highlight {
color: #fff;
text-shadow: 0 1px 0 #369;
}
.jqm-search .jqm-list .ui-li .ui-btn-text a.ui-link-inherit,
.jqm-search-results-wrap .jqm-list .ui-li .ui-btn-text a.ui-link-inherit {
padding: .5626em 15px;
font-weight: 400;
}
.jqm-list .jqm-search-results-keywords {
padding: 6px 0 0;
font-size: .8em;
font-weight: 300;
color: #999;
display:block;
}
.jqm-search-results-keywords .jqm-keyword-hash {
margin-right: .2em;
margin-left: .2em;
font-weight: 400;
color: #aaa;
font-size: .75em;
text-transform: uppercase;
}
.ui-btn-active .jqm-search-results-keywords,
.ui-focus .jqm-search-results-keywords,
.ui-btn-active .jqm-search-results-keywords .jqm-keyword-hash,
.ui-focus .jqm-search-results-keywords .jqm-keyword-hash {
color: #fff;
text-shadow: 0 1px 0 #369;
font-weight: 400;
}
@@ -70,20 +70,20 @@ $( document ).on( "pagecreate", ".jqm-demos", function( event ) {

$( ".jqm-version" ).html( text );

// global navmenu panel
// Global navmenu panel
$( ".jqm-navmenu-link" ).on( "click", function() {
page.find( ".jqm-navmenu-panel" ).panel( "open" );
});

// Turn off autocomplete / correct for demos search
$( this ).find( ".jqm-search input" ).attr( "autocomplete", "off" ).attr( "autocorrect", "off" );

// global search
// Global search
$( ".jqm-search-link" ).on( "click", function() {
page.find( ".jqm-search-panel" ).panel( "open" );
});

// initalize search panel list and filter also remove collapsibles
// Initalize search panel list and filter also remove collapsibles
$( this ).find( ".jqm-search ul.jqm-list" ).html( searchContents ).listview({
inset: false,
theme: null,
@@ -110,22 +110,16 @@ $( document ).on( "pagecreate", ".jqm-demos", function( event ) {
highlight: true
}).filterable();

// Append keywords list to each list item
$( this ).find( ".jqm-search-results-list li, .jqm-search li" ).each(function() {
var text = $( this ).attr( "data-filtertext" );
$( this ).find( "a" ).append( "<span class='jqm-search-results-keywords ui-li-desc'><span class='jqm-keyword-hash'></span> " + text + "</span>" );
});

//fix links on homepage to point to sub directories
if( $( event.target ).hasClass( "jqm-home") ){
// Fix links on homepage to point to sub directories
if ( $( event.target ).hasClass( "jqm-home") ) {
$( this ).find( "a" ).each( function() {
$( this ).attr( "href", $( this ).attr( "href" ).replace( "../", "" ) );
});
}

// Search results page get search query string and enter it into filter then trigger keyup to filter
if( $( event.target ).hasClass( "jqm-demos-search-results") ){
search = $.mobile.path.parseUrl( window.location.href ).search.split( "=" )[1];
if ( $( event.target ).hasClass( "jqm-demos-search-results") ) {
search = $.mobile.path.parseUrl( window.location.href ).search.split( "=" )[ 1 ];
setTimeout(function() {
e = $.Event( "keyup" );
e.which = 65;
@@ -134,7 +128,18 @@ $( document ).on( "pagecreate", ".jqm-demos", function( event ) {
}
});

// funstions for highlighting text used for keywords highlight in search
// Append keywords list to each list item
$( document ).one( "pagecreate", ".jqm-demos", function( event ) {
$( this ).find( ".jqm-search-results-list li, .jqm-search li" ).each(function() {
var text = $( this ).attr( "data-filtertext" );

$( this )
.find( "a" )
.append( "<span class='jqm-search-results-keywords ui-li-desc'>" + text + "</span>" );
});
});

// Functions for highlighting text used for keywords highlight in search
jQuery.fn.highlight = function( pat ) {
function innerHighlight( node, pat ) {
var skip = 0;
@@ -162,7 +167,7 @@ jQuery.fn.highlight = function( pat ) {
}) : this;
};

// Funstion to remove highlights in text
// Function to remove highlights in text
jQuery.fn.removeHighlight = function() {
return this.find( "span.jqm-search-results-highlight" ).each(function() {
this.parentNode.firstChild.nodeName;
@@ -179,15 +184,7 @@ $( document ).on( "mobileinit", function() {

$.widget( "mobile.listview", $.mobile.listview, {
options: {
theme: null,
countTheme: null,
dividerTheme: null,
icon: "carat-r",
splitIcon: "carat-r",
splitTheme: null,
corners: true,
shadow: true,
inset: false,
icon: false,
arrowKeyNav: false,
enterToNav: false,
highlight: false,
@@ -25,7 +25,8 @@

<div data-role="content" class="jqm-content">

<h2>Search Results</h2>
<h1>Search Results</h1>

<div class="jqm-search-results-wrap">
<ul class="jqm-list jqm-search-results-list">
<?php include( '../jqm-contents.php' ); ?>