summaryrefslogtreecommitdiff
path: root/libs/patch/0006-JQM-Change-header-footer-code-to-meet-TIZEN-UI.patch
diff options
context:
space:
mode:
Diffstat (limited to 'libs/patch/0006-JQM-Change-header-footer-code-to-meet-TIZEN-UI.patch')
-rw-r--r--libs/patch/0006-JQM-Change-header-footer-code-to-meet-TIZEN-UI.patch406
1 files changed, 406 insertions, 0 deletions
diff --git a/libs/patch/0006-JQM-Change-header-footer-code-to-meet-TIZEN-UI.patch b/libs/patch/0006-JQM-Change-header-footer-code-to-meet-TIZEN-UI.patch
new file mode 100644
index 00000000..50088216
--- /dev/null
+++ b/libs/patch/0006-JQM-Change-header-footer-code-to-meet-TIZEN-UI.patch
@@ -0,0 +1,406 @@
+From f55b2231026c520cc9899aaf8f2279c29e057da3 Mon Sep 17 00:00:00 2001
+From: Minkyu Kang <mk7.kang@samsung.com>
+Date: Wed, 29 Feb 2012 15:44:47 +0900
+Subject: [PATCH] JQM: Change header/footer code to meet TIZEN UI
+
+Signed-off-by: Jun Jinhyuk <jinhyuk.jun@samsung.com>
+Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
+---
+ .../js/jquery.mobile.fixHeaderFooter.js | 293 +++++++++++++++++++-
+ 1 files changed, 279 insertions(+), 14 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
+index 3bb5613..0216c65 100644
+--- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
++++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.fixHeaderFooter.js
+@@ -2,6 +2,51 @@
+ * "fixHeaderFooter" plugin - on-demand positioning for headers,footers
+ */
+
++/*
++ * Header/Footer can be created using the
++ * data-role="header", data-role="footer" attribute to an element.
++ *
++ * Every page in SLP theme have Header&Footer and default footer contains back button
++ * Framework automatically generate footer even though web developer does not define footer
++ * For more detail footer usage, refer Page(page.section.js) guideline
++ *
++ * Attribute:
++ * data-position : default value is fixed, automatically generated footer has fixed position,
++ * in header, web dev. defines header fix or not.
++ *
++ * Examples:
++ *
++ * HTML markup for creating header :
++ * <div data-role="header" data-position="fixed">
++ * <h1>NBeat UI</h1>
++ * </div>
++ *
++ * HTML markup for creating 1 button title ( button is available 1~3 )
++ * <div data-role="header" data-position="fixed">
++ * <a>Text1</a>
++ * <h1>Title Area</h1>
++ * </div>
++ *
++ * HTML markup for creating 2 button and groupControl title ( Groupcontrol is available 2~4 )
++ * <div data-role="header" data-position="fixed">
++ * <a>Text</a>
++ * <h1>Title Extend 2 Button </h1>
++ * <a>Text</a>
++ * <div data-role="fieldcontain">
++ * <fieldset data-role="controlgroup" data-type="horizontal">
++ * <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment1" value="on" checked="checked" />
++ * <label for="segment1">All</label>
++ * <input type="radio" name="radio-view-8" data-icon="segment-titlestyle-segonly" id="segment2" value="off" />
++ * <label for="segment2">Call</label>
++ * </fieldset>
++ * </div>
++ * </div>
++ *
++ * HTML markup for creating footer
++ * <div data-role="footer" data-position="fixed">
++ * </div>
++ */
++
+ (function( $, undefined ) {
+
+ var slideDownClass = "ui-header-fixed ui-fixed-inline fade",
+@@ -50,6 +95,7 @@ $.mobile.fixedToolbars = (function() {
+ touchStopEvent = supportTouch ? "touchend" : "mouseup",
+ stateBefore = null,
+ scrollTriggered = false,
++ defaultFooterHeight = 114,
+ touchToggleEnabled = true;
+
+ function showEventCallback( event ) {
+@@ -62,6 +108,57 @@ $.mobile.fixedToolbars = (function() {
+ //
+ // If we are in autoHideMode, we don't do anything because we know the scroll
+ // callbacks for the plugin will fire off a show when the scrolling has stopped.
++
++ var footer_filter;
++
++ if ( $( document ).find( ".ui-page-active" ).length ) {
++ footer_filter = $( document ).find( ".ui-page-active" ).find( ":jqmData(role='footer')" );
++ } else {
++ footer_filter = $( document ).find( ":jqmData(role='footer')" ).eq( 0 );
++ }
++
++ if ( footer_filter.height() < defaultFooterHeight ) {
++ footer_filter.css("height", defaultFooterHeight);
++ }
++
++ footer_filter
++ .css( "top", $(window).height() - footer_filter.height() )
++ .show();
++
++ var footerNavbar = footer_filter.find(".ui-navbar");
++
++ if ( footerNavbar.jqmData("style") == "toolbar" ) {
++ footerNavbar
++ .css( "width", $(window).width() - footerNavbar.siblings(".ui-btn").width() );
++ }
++
++ // divide content mode scrollview and non-scrollview
++ // recalculate content area when resize callback occur
++ if ( event.type == "resize" ) {
++ var s_theme_header =
++ $( document ).find( ".ui-page-active" ).find( ":jqmData(role='header')" );
++ var s_theme_content =
++ $( document ).find( ".ui-page-active" ).find( ":jqmData(role='content')" );
++
++ if ( $.support.scrollview ) {
++ if ( s_theme_header.css("position") != "fixed" ) {
++ s_theme_header.css( "position", "fixed" );
++ }
++
++ s_theme_content.css( "top", s_theme_header.height() );
++ s_theme_content.css( "height",
++ document.documentElement.clientHeight -
++ footer_filter.height() - s_theme_header.height() );
++ } else {
++ if ( s_theme_header.css("position") != "fixed" ) {
++ s_theme_header.css( "position", "relative" );
++ s_theme_content
++ .css( "top", "0" )
++ .css( "height", "" );
++ }
++ }
++ }
++
+ if ( !autoHideMode && currentstate === "overlay" ) {
+ if ( !delayTimer ) {
+ $.mobile.fixedToolbars.hide( true );
+@@ -107,6 +204,9 @@ $.mobile.fixedToolbars = (function() {
+
+ ( ( $document.scrollTop() === 0 ) ? $window : $document )
+ .bind( "scrollstart", function( event ) {
++ if ( $( event.target ).find(":jqmData(role='header')").is(":jqmData(position='fixed')") ) {
++ return;
++ }
+
+ scrollTriggered = true;
+
+@@ -131,7 +231,6 @@ $.mobile.fixedToolbars = (function() {
+ }
+ })
+ .bind( "scrollstop", function( event ) {
+-
+ if ( $( event.target ).closest( ignoreTargets ).length ) {
+ return;
+ }
+@@ -145,13 +244,141 @@ $.mobile.fixedToolbars = (function() {
+ stateBefore = null;
+ });
+
+- $window.bind( "resize updatelayout", showEventCallback );
++ $window.bind( "resize", showEventCallback );
+ });
+
+ // 1. Before page is shown, check for duplicate footer
+ // 2. After page is shown, append footer to new page
+ $( ".ui-page" )
+ .live( "pagebeforeshow", function( event, ui ) {
++ /* Fixed header modify for theme-s */
++ var s_theme_header = $( event.target ).find(":jqmData(role='header')");
++ var s_theme_fieldcontain = s_theme_header.find(":jqmData(role='fieldcontain')");
++ var s_theme_content = $( event.target ).find(".ui-content");
++ var title_style = "normal";
++
++ if ( s_theme_fieldcontain.length != 0 ) {
++ title_style = "extended";
++ }
++
++ if ( s_theme_header.jqmData("position") == "fixed" || window.S.frameworkData.theme.match(/tizen/).length ||
++ s_theme_header.css("position") == "fixed" ) {
++ s_theme_header
++ .css( "position", "fixed" )
++ .css( "top", "0px" );
++
++ if ( s_theme_header.children().is(".ui-navbar") ) {
++ s_theme_header.addClass("ui-title-controlbar-height");
++ $( event.target ).find( ".ui-content" )
++ .addClass("ui-title-content-controlbar-height");
++ } else {
++ $( event.target ).find( ".ui-content" )
++ .addClass("ui-title-content-" + title_style + "-height");
++ }
++ }
++
++ if ( s_theme_header.children().is(".ui-option-header") ) {
++ s_theme_content.removeClass("ui-title-content-" + title_style + "-height");
++
++ if ( s_theme_header.children().is(".input-search-bar") ) {
++ s_theme_content.addClass("ui-title-content-optionheader-search");
++ } else {
++ if ( $.tizen.optionheader.prototype.options.collapseOnInit == true ) {
++ s_theme_content
++ .addClass("ui-title-content-option-header-collapsed-1line-height");
++ } else {
++ s_theme_content
++ .addClass("ui-title-content-option-header-expanded-1line-height");
++ }
++ }
++ } else if ( s_theme_header.find("input").jqmData("type") == "search" ) {
++ s_theme_content
++ .removeClass("ui-title-content-" + title_style + "-height")
++ .addClass("ui-title-content-search");
++ }
++
++ if ( s_theme_header.children().is("a") ||
++ s_theme_header.children().find(".ui-radio").length != 0 ) {
++ if ( title_style == "normal" ) {
++ if ( s_theme_header.children("a").length == 3 ) {
++ s_theme_header.find( "a" ).eq( 1 )
++ .removeClass("ui-btn-right")
++ .addClass("ui-title-normal-3btn");
++
++ s_theme_header.find( "a" ).eq( 2 )
++ .addClass("ui-btn-right");
++ }
++ } else {
++ var group_length = s_theme_fieldcontain.find(".ui-radio").length;
++
++ s_theme_header
++ .addClass("ui-title-extended-height");
++
++ s_theme_fieldcontain
++ .find(".ui-controlgroup")
++ .addClass("ui-title-extended-controlgroup");
++
++ s_theme_fieldcontain
++ .find(".ui-controlgroup")
++ .addClass("ui-extended-controlgroup");
++
++ s_theme_fieldcontain
++ .addClass("ui-title-extended-segment-style");
++
++ if ( group_length == 2 || group_length == 3 || group_length == 4 ) {
++ s_theme_fieldcontain
++ .addClass("ui-title-extended-controlgroup-" + group_length + "btn");
++ }
++ }
++ s_theme_content.addClass("ui-title-content-" + title_style + "-height");
++ }
++
++ // divide content mode scrollview and non-scrollview
++ // recalculate content area when resize callback occur
++ if ( event.type == "resize" ) {
++ if ( $.support.scrollview ) {
++ if ( s_theme_header.css("position") != "fixed" ) {
++ s_theme_header.css( "position", "fixed" );
++ }
++
++ s_theme_content.css( "top", s_theme_header.height() );
++ } else {
++ if ( s_theme_header.css("position") != "fixed" ) {
++ s_theme_header.css( "position", "relative" );
++ s_theme_content.css( "top", "0" );
++ }
++ }
++ }
++
++ var footer_filter = $( document ).find(":jqmData(role='footer')");
++
++ if ( footer_filter.find(".ui-navbar").is(".ui-controlbar-s") ){
++ footer_filter
++ .css( "top", $(window).height() - footer_filter.height() )
++ .show();
++ }
++
++ if ( footer_filter.children().find(".ui-radio").length != 0 ) {
++ var footerGroup = footer_filter.find(":jqmData(role='fieldcontain')");
++ var groupLength = footerGroup.find(".ui-radio").length;
++
++ footerGroup.find(".ui-controlgroup")
++ .addClass("ui-extended-controlgroup")
++ .addClass("ui-footer-extended-controlgroup")
++ .css( "display", "inline" );
++
++ /* Groupcontrol cannot initialize inline property at first page */
++ footerGroup.addClass("ui-title-extended-controlgroup-" + groupLength + "btn");
++
++ footerButton = footer_filter.children("a");
++ footerButton.each(function( i ) {
++ if ( footerButton.eq( i ).is(".ui-btn") && !footerButton.eq( i ).is(".ui-btn-back") ){
++ footerButton.eq( i )
++ .removeClass("ui-btn-left")
++ .addClass("ui-btn-footer-right");
++ }
++ });
++ }
+
+ var page = $( event.target ),
+ footer = page.find( ":jqmData(role='footer')" ),
+@@ -162,15 +389,53 @@ $.mobile.fixedToolbars = (function() {
+
+ if ( id && prevFooterMatches ) {
+ stickyFooter = footer;
+- setTop( stickyFooter.removeClass( "fade in out" ).appendTo( $.mobile.pageContainer ) );
++ stickyFooter.removeClass( "fade in out" ).appendTo( $.mobile.pageContainer );
++ stickyFooter
++ .css("position", "fixed")
++ .css("top", $(".ui-page").find(":jqmData(role='footer')").eq( 0 ).css("top"));
++
++ }
++
++ if ( footer.is(".ui-footer-fixed") ) {
++ footer.css( "top", $(window).height() - footer.height() );
++ }
++
++ /* Increase Content size with dummy <div> because of footer height */
++ if ( footer.length != 0 && $( event.target ).find(".dummy-div").length == 0 ) {
++ $( event.target ).find( ":jqmData(role='content')" ).append( '<div class="dummy-div"></div>' );
++ $( ".dummy-div" )
++ .css( "width", footer.width() )
++ .css( "height", footer.height() );
++
++ if ( $(".dummy-div").height() < defaultFooterHeight ) {
++ $( ".dummy-div" ).css( "height", defaultFooterHeight );
++ }
+ }
++
++ /* Header position fix(remove transition) */
++ var next_id = $( event.target ).attr( "id" );
++
++ $( "#"+next_id ).find( ":jqmData(role='header')" )
++ .removeClass( "fade in out" )
++ .appendTo( $.mobile.pageContainer );
+ })
+ .live( "pageshow", function( event, ui ) {
++ /* Fixed header modify for theme-s */
++ var s_theme_header = $( event.target ).find( ":jqmData(role='header')" );
++ if ( s_theme_header.is(".ui-header-fixed") && s_theme_header.is(".ui-bar-s") ) {
++ $( event.target ).find(":jqmData(role='header')")
++ .css( "position", "fixed" )
++ .css( "top", "0px" );
++
++ ( $( document ).scrollTop() === 0 ? $( window ) : $( document ) )
++ .unbind("scrollstart")
++ .unbind("silentscroll")
++ .unbind("scrollstop");
++ }
+
+ var $this = $( this );
+
+ if ( stickyFooter && stickyFooter.length ) {
+-
+ setTimeout(function() {
+ setTop( stickyFooter.appendTo( $this ).addClass( "fade" ) );
+ stickyFooter = null;
+@@ -178,8 +443,13 @@ $.mobile.fixedToolbars = (function() {
+ }
+
+ $.mobile.fixedToolbars.show( true, this );
++
++ /* Header position fix(remove transition) */
++ $("body").children(":jqmData(role='header')")
++ .insertBefore( $(event.target).find(":jqmData(role='content')").eq( 0 ) );
+ });
+
++
+ // When a collapsiable is hidden or shown we need to trigger the fixed toolbar to reposition itself (#1635)
+ $( ".ui-collapsible-contain" ).live( "collapse expand", showEventCallback );
+
+@@ -215,10 +485,15 @@ $.mobile.fixedToolbars = (function() {
+ }
+
+ function setTop( el ) {
++ if ( el.parents(".ui-page").find(":jqmData(role='header')").is(".ui-header-fixed") &&
++ el.parents(".ui-page").find(":jqmData(role='header')").is(".ui-bar-s") ) {
++ return;
++ }
++
+ var fromTop = $(window).scrollTop(),
+ thisTop = getOffsetTop( el[ 0 ] ), // el.offset().top returns the wrong value on iPad iOS 3.2.1, call our workaround instead.
+ thisCSStop = el.css( "top" ) == "auto" ? 0 : parseFloat(el.css( "top" )),
+- screenHeight = window.innerHeight,
++ screenHeight = $(window).height(),
+ thisHeight = el.outerHeight(),
+ useRelative = el.parents( ".ui-page:not(.ui-page-fullscreen)" ).length,
+ relval;
+@@ -260,20 +535,10 @@ $.mobile.fixedToolbars = (function() {
+ fromTop = $( window ).scrollTop(),
+ // el.offset().top returns the wrong value on iPad iOS 3.2.1, call our workaround instead.
+ thisTop = getOffsetTop( el[ 0 ] ),
+- screenHeight = window.innerHeight,
++ screenHeight = $(window).height(),
+ thisHeight = el.outerHeight(),
+ alreadyVisible = ( el.is( ".ui-header-fixed" ) && fromTop <= thisTop + thisHeight ) ||
+ ( el.is( ".ui-footer-fixed" ) && thisTop <= fromTop + screenHeight );
+-
+- // Add state class
+- el.addClass( "ui-fixed-overlay" ).removeClass( "ui-fixed-inline" );
+-
+- if ( !alreadyVisible && !immediately ) {
+- el.animationComplete(function() {
+- el.removeClass( "in" );
+- }).addClass( "in" );
+- }
+- setTop(el);
+ });
+ },
+
+--
+1.7.5.4
+