<div class="content-primary">
<div class="my-check-button-style"><a id="check-1" data-role="button" data-inline="true">Check/UnCheck</a></div>
<div class="my-check-button-style my-check-inline-style"><a id="get-check-value" data-role="button" data-inline="true">Get Check Value</a></div>
- <p>First checkbox check value :
+ <p>First checkbox check value : <br>
<span class="checked-value">
<em>(click the button! )</em>
</span>
</span>
</p>
<hr/>
- <fieldset data-role="controlgroup">
+ <fieldset data-role="controlgroup" class="my-check-controlgroup">
<input type="checkbox" name="checkbox-1" id="checkbox-1"/>
<label for="checkbox-1">Normal</label>
<input type="checkbox" name="checkbox-2" id="checkbox-2" checked="checked" disabled="disabled" />
<label for="checkbox-2">Checked, Disabled</label>
<input type="checkbox" name="checkbox-3" id="checkbox-3" disabled="disabled" />
- <label for="checkbox-3">Disabled</label>
+ <label for="checkbox-3">Disabled</label><br>
<input type="checkbox" name="checkbox-4" id="checkbox-4" class="favorite" />
<label for="checkbox-4">Favorite</label>
<input type="checkbox" name="checkbox-5" id="checkbox-5" checked="checked" disabled="disabled" class="favorite" />
<label for="checkbox-5">Favorite Checked, Disabled</label>
<input type="checkbox" name="checkbox-6" id="checkbox-6" disabled="disabled" class="favorite" />
- <label for="checkbox-6">Favorite, Disabled</label>
+ <label for="checkbox-6">Favorite, Disabled</label><br>
<input type="checkbox" name="checkbox-7" id="checkbox-7" />
<input type="checkbox" name="checkbox-8" id="checkbox-8" />
</fieldset>
}
.my-check-inline-style {
display: inline;
+}
+
+.my-check-controlgroup div.ui-checkbox {
+ margin-top : 3px;
+ margin-bottom : 3px;
}
\ No newline at end of file
<li><a href="#" data-rel="back">Add to contact</a></li>
<li><a href="#" data-rel="back">Call log</a></li>
<li><a href="#" data-rel="back">Music</a></li>
- <li><a href="#" data-rel="back">File manager</a></li>
- <li><a href="#" data-rel="back">Internal Link</a></li>
</ul>
</div>
</div>
<li><a href="#" data-rel="back">Add to contact</a></li>
<li><a href="#" data-rel="back">Call log</a></li>
<li><a href="#" data-rel="back">Music</a></li>
- <li><a href="#" data-rel="back">File manager</a></li>
- <li><a href="#" data-rel="back">Internal Link</a></li>
</ul>
</div>
</div>
<li><a href="#" data-rel="back">Add to contact</a></li>
<li><a href="#" data-rel="back">Call log</a></li>
<li><a href="#" data-rel="back">Music</a></li>
- <li><a href="#" data-rel="back">File manager</a></li>
</ul>
</div>
</div>
$("#textbox_popup").popup("close");
return false;
});
+
+ if ( $.tizen.__tizen__.util.isMobileBrowser() ) {
+ var direction = window.screen.orientation;
+ if ( direction === "landscape-primary" || direction === "landscape-secondary" ) {
+ $( "#go_textbox_popup a" ).attr( "href", "#textbox_popup_landscape" );
+ }
+ }
});
function onSuccessPopupCallback ( ori ) {
</div>
<div data-role="footer">
- <a href="#pop_js" data-role="button" data-icon="naviframe-more" data-rel="popupwindow"></a>
+ <a href="#pop_js" data-role="button" data-icon="naviframe-more" data-rel="popup"></a>
- <div id="pop_js" data-role="popupwindow" data-show-arrow="true">
+ <div id="pop_js" data-role="popup" >
<ul data-role="listview">
- <li><a href="#" class="ui-btn-ctxpopup-close">Settings</a></li>
- <li><a href="#" class="ui-btn-ctxpopup-close">Add to contact</a></li>
- <li><a href="#" class="ui-btn-ctxpopup-close">Call log</a></li>
- <li><a href="#" class="ui-btn-ctxpopup-close">Music</a></li>
- <li><a href="#" class="ui-btn-ctxpopup-close">File manager</a></li>
- <li><a href="#" class="ui-btn-ctxpopup-close">Internal Link</a></li>
+ <li><a href="#" data-rel="back">Settings</a></li>
+ <li><a href="#" data-rel="back">Add to contact</a></li>
+ <li><a href="#" data-rel="back">Call log</a></li>
+ <li><a href="#" data-rel="back">Music</a></li>
</ul>
</div>
<div data-role="tabbar">
<li><a href="#"class="ui-btn-active">MENU</a></li>
<li><a href="#">SAVE</a></li>
<li><a href="#">SHARE</a></li>
-
</ul>
</div>
</div>
</div>
<div data-role="footer">
- <a href="#pop_js" data-role="button" data-icon="naviframe-more" data-rel="popupwindow"></a>
+ <a href="#pop_js" data-role="button" data-icon="naviframe-more" data-rel="popup"></a>
- <div id="pop_js" data-role="popupwindow" data-show-arrow="true">
+ <div id="pop_js" data-role="popup">
<ul data-role="listview">
- <li><a href="#" class="ui-btn-ctxpopup-close">Settings</a></li>
- <li><a href="#" class="ui-btn-ctxpopup-close">Add to contact</a></li>
- <li><a href="#" class="ui-btn-ctxpopup-close">Call log</a></li>
- <li><a href="#" class="ui-btn-ctxpopup-close">Music</a></li>
- <li><a href="#" class="ui-btn-ctxpopup-close">File manager</a></li>
- <li><a href="#" class="ui-btn-ctxpopup-close">Internal Link</a></li>
- </ul>
-
+ <li><a href="#" data-rel="back">Settings</a></li>
+ <li><a href="#" data-rel="back">Add to contact</a></li>
+ <li><a href="#" data-rel="back">Call log</a></li>
+ <li><a href="#" data-rel="back">Music</a></li>
+ </ul>
</div>
<div data-role="controlgroup" data-type="horizontal">
<a href="#" data-role="button">BACK</a>
return factory(root);
});
} else {
- // Browser globals
- factory(root);
+ // Specific initialization for TIZEN Web UI Framework
+ root.initGlMatrix = function ( targetRoot ) {
+ factory( targetRoot || root );
+ };
}
}(this, function (root) {
"use strict";
-From 3a3b8ea37dbe26879cac7861e4478856bcf91d6e Mon Sep 17 00:00:00 2001
+From d96db7f8a2ab691ca92492ac3b0c253afea40250 Mon Sep 17 00:00:00 2001
From: "hjnim.kim" <hjnim.kim@samsung.com>
-Date: Wed, 10 Apr 2013 13:22:06 +0900
-Subject: [PATCH] JQM Applied tizen style popup, context popup
+Date: Thu, 25 Apr 2013 12:38:27 +0900
+Subject: [PATCH] JQM Apply Tizen style context popup and window popup
-Apply tizen style popup, context popup
+Apply tizen style and operation
-Change-Id: I757bdf622e4ee106aa3ace5ab6665633879b740f
+Change-Id: I73884fd8bd78e4704b1d6357d1c2a10bc6609a4f
Signed-off-by: hyunjung kim <hjnim.kim@samsung.com>
---
- libs/js/jquery-mobile-1.2.0/js/widgets/popup.js | 113 +++++++++++++++++++++--
- 1 files changed, 103 insertions(+), 10 deletions(-)
+ libs/js/jquery-mobile-1.2.0/js/widgets/popup.js | 129 +++++++++++++++++++++--
+ 1 files changed, 119 insertions(+), 10 deletions(-)
diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
-index 8174055..203599d 100644
+index 8174055..c4d6a22 100644
--- a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
+++ b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
@@ -58,7 +58,7 @@ define( [ "jquery",
},
_createPrereqs: function( screenPrereq, containerPrereq, whenDone ) {
-@@ -569,7 +622,7 @@ define( [ "jquery",
+@@ -461,6 +514,8 @@ define( [ "jquery",
+ _desiredCoords: function( x, y, positionTo ) {
+ var dst = null, offset, winCoords = windowCoords();
+
++ self.positionTo = positionTo;
++
+ // Establish which element will serve as the reference
+ if ( positionTo && positionTo !== "origin" ) {
+ if ( positionTo === "window" ) {
+@@ -499,6 +554,19 @@ define( [ "jquery",
+ return { x: x, y: y };
+ },
+
++ _reposition: function() {
++ var self = this,
++ coords;
++
++ if( self._isOpen
++ && self.link
++ && self.positionTo !== "window") {
++ coords = self._placementCoords( self._desiredCoords( $(self.link).offset().left + $(self.link).outerWidth() /2 , $(self.link).offset().top + $(self.link).outerHeight() /2 , self.positionTo || self.options.positionTo || "origin" ) );
++ self._ui.container
++ .offset( { top : coords.top } );
++ }
++ },
++
+ _openPrereqsComplete: function() {
+ var self = this;
+
+@@ -512,6 +580,7 @@ define( [ "jquery",
+ setTimeout(function(){
+ self._ui.container.attr( "tabindex", "0" ).focus();
+ self._trigger( "afteropen" );
++ self._reposition();
+ });
+ },
+
+@@ -569,7 +638,7 @@ define( [ "jquery",
this._ui.container
.removeClass( "ui-selectmenu-hidden" )
.offset( coords );
if ( this.options.overlayTheme && androidBlacklist ) {
/* TODO:
The native browser on Android 4.0.X ("Ice Cream Sandwich") suffers from an issue where the popup overlay appears to be z-indexed
-@@ -694,15 +747,55 @@ define( [ "jquery",
+@@ -694,15 +763,55 @@ define( [ "jquery",
// what should be in _open. Seems to be "visual" vs "history" for now
open: function( options ) {
var self = this, opts = this.options, url, hashkey, activePage, currentIsDialog, hasHash, urlHistory;
+ if( !options ) {
+ options = [];
+ }
-
++
+ if ( !options.link ) {
+ if ( !event ) {
+ self.positionTo = "window";
+ if ( event ) {
+ self.positionTo = ( options != null && options.positionTo != null ) ? options.positionTo : "origin";
+ }
-+
+
+ if ( $(self.link).jqmData("position-to") !== "window"
+ && self.positionTo !== "window" ) {
+
--- /dev/null
+From b9a95ce6a3ede8c3ca3f06b2f949bb92a88f6dd8 Mon Sep 17 00:00:00 2001
+From: maciej moczulski <m.moczulski@samsung.com>
+Date: Tue, 16 Apr 2013 11:07:17 +0200
+Subject: [PATCH] Delegate init of popup widget with
+ delegateSelfInitWithSingleSelector
+
+Change-Id: If9a9d923bb30bb1a866eb9f3e0c960856626f311
+---
+ libs/js/jquery-mobile-1.2.0/js/widgets/popup.js | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
+index de2af2c..65d5615 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
+@@ -814,9 +814,8 @@ define( [ "jquery",
+ }
+ });
+
+- $.mobile.$document.bind( "pagecreate create", function( e ) {
+- $.mobile.popup.prototype.enhanceWithin( e.target, true );
+- });
++ //delegate self-init widgets
++ $.delegateSelfInitWithSingleSelector( $.mobile.popup, true );
+
+ })( jQuery );
+ //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+--
+1.7.9.5
+
Name: web-ui-fw
-Version: 0.2.25
+Version: 0.2.26
Release: 0
Summary: Tizen Web UI Framework Library
Group: Development/Other
###############################
%changelog
+* Fri Apr 26 2013 Youmin Ha <youmin.ha@samsung.com> 0.2.26
+ - PageLayout : bug fix
+ - Gallery3d: Change timing of 'gl-matrix' library's execution
+ - Replace in LoadTheme function strings build with array join with the string concat
+ - Contextpopup: context popup reposition module has been added
+ - Pagelayout : skip to calculate min-height using data-scroll="none"(Issue: DCM-1453)
+ - Splitview: Fix the touchend event error.
+ - Gallery3d: Change event registration method from $.bind() to $.on()
+ - Scrollview : remove useless setTimeout in case scrolls go outside
+ - Naviframe : adjust new SIP down button
+ - Timepicker: Added return false; after vclick
+ - Popupwindow: reserved words has been removed
+ - minor changes: replace one occurrence of array.join with string concat and simplify jQuery arguments
+ - TizenWinset : set default margin for checkbox demo
+ - Tizenwinset: Context popup demo has been changed
+ - TizenDemo : add initial orientation mode to popup demo
+ - Widgets: removed parsing error for legacy javascript engine
+ - Delegate init of popup widget with delegateSelfInitWithSingleSelector
+
* Tue Apr 18 2013 Youmin Ha <youmin.ha@samsung.com> 0.2.25
- Pinch: pinch event re-implementation to use size
- Pagelayout : prevent code inserting window.innerHeight when content calculate
loadTheme: function ( theme ) {
var themePath,
- cssPath,
- jsPath;
+ cssPath,
+ jsPath;
if ( ! theme ) {
theme = tizen.frameworkData.theme;
}
- themePath = [
- tizen.frameworkData.rootDir,
- tizen.frameworkData.version,
- 'themes',
- theme
- ].join( '/' );
-
- jsPath = [ themePath, 'theme.js' ].join( '/' );
-
+
+ themePath = tizen.frameworkData.rootDir + '/' + tizen.frameworkData.version + '/themes/' + theme;
+
+ jsPath = themePath + '/theme.js';
+
if ( tizen.frameworkData.minified ) {
- cssPath = [themePath, 'tizen-web-ui-fw-theme.min.css'].join( '/' );
+ cssPath = themePath + '/tizen-web-ui-fw-theme.min.css';
} else {
- cssPath = [themePath, 'tizen-web-ui-fw-theme.css'].join( '/' );
+ cssPath = themePath + '/tizen-web-ui-fw-theme.css';
}
tizen.css.load( cssPath );
tizen.util.loadScriptSync( jsPath );
self.frameworkData.version,
'js',
'cultures',
- ['globalize.culture.', lang, '.js'].join( '' ),
+ ['globalize.culture.', lang, '.js'].join( '' )
].join( '/' );
}
return cFPath;
meta = document.createElement( "meta" );
if ( meta ) {
meta.name = "viewport";
- content = [ "width=", viewportWidth, ", user-scalable=no" ].join( "" );
+ content = "width=" + viewportWidth + ", user-scalable=no";
if ( ! isNaN( viewportWidth ) ) {
// Fix scale to 1.0, if viewport width is set to fixed value.
// NOTE: Works wrong in Tizen browser!
tizen.log.debug( "themedefaultfont size: " + themeDefaultFontSize + ", ratio: " + ratio );
var scaledFontSize = Math.max( Math.floor( themeDefaultFontSize * ratio ), 4 );
- $( 'html.ui-mobile' ).css( { 'font-size': scaledFontSize + "px" } );
+ $( 'html' ).css( { 'font-size': scaledFontSize + "px" } );
tizen.log.debug( 'html:font size is set to ' + scaledFontSize );
$( document ).ready( function ( ) {
$( '.ui-mobile' ).children( 'body' ).css( { 'font-size': scaledFontSize + "px" } );
ratio = parseFloat( viewportWidth / this.frameworkData.defaultViewportWidth );
this.scaleBaseFontSize( themeDefaultFontSize, ratio );
}
- },
+ }
};
function export2TizenNS ( $, tizen ) {
overshootEnable: false,
outerScrollEnable: false,
overflowEnable: true,
- scrollJump: false,
+ scrollJump: false
},
_getViewHeight: function () {
y = 0,
scroll_height = 0,
self = this,
- end_effect = function ( dir ) {
- setTimeout( function () {
- self._effect_dir = dir;
- self._setEndEffect( "in" );
- }, 100 );
-
- setTimeout( function () {
- self._setEndEffect( "out" );
- }, 350 );
- },
vt = this._vTracker,
ht = this._hTracker;
} else if ( vt.isMin() ) {
this._outerScroll( y - vt.getRemained() / 3, scroll_height );
- if ( scroll_height > 0 ) {
- end_effect( 1 );
- }
} else if ( vt.isMax() ) {
this._outerScroll( vt.getRemained() / 3, scroll_height );
-
- if ( scroll_height > 0 ) {
- end_effect( 0 );
- }
}
}
}
if ( y > 0 ) {
this._sy = 0;
- if ( this._didDrag && scroll_height > 0 ) {
- this._effect_dir = 0;
- this._setEndEffect( "in" );
- }
+ this._effect_dir = 0;
+ this._setEndEffect( "in" );
} else if ( y < -scroll_height ) {
this._sy = -scroll_height;
- if ( this._didDrag && scroll_height > 0 ) {
- this._effect_dir = 1;
- this._setEndEffect( "in" );
- }
+ this._effect_dir = 1;
+ this._setEndEffect( "in" );
} else {
if ( this._endEffect && this._sy !== y ) {
this._setEndEffect();
this.ui.find('.ui-datefield-period').buttonMarkup().bind( 'vclick', function ( e ) {
obj._switchAmPm( obj );
+ return false;
});
this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "format", this.options.format );
this._popup_open = false;
this.ui.bind('vclick', function ( e ) {
obj._showDataSelector( obj, this, e.target );
+ return false;
});
$.extend( this, {
$.widget( "tizen.fastscroll", $.mobile.widget, {
options: {
- initSelector: ":jqmData(fastscroll)",
+ initSelector: ":jqmData(fastscroll)"
},
_primaryLanguage: null,
* select ( [number] )
* : When the "select" method is called with an argument, the method selects the image of given index.
* If the method is called with no argument, it will return the Javascript object having "src"
- * attribute having the selected image’s URL.
+ * attribute having the selected image's URL.
* add ( object or string [, number] )
* This method adds an image to Gallery3D widget.
* If the second argument isn't inputted, the image is added at the 0th position.
/**
@method select
When the "select" method is called with an argument, the method selects the image of given index.
- If the method is called with no argument, it will return the Javascript object having "src" attribute having the selected image’s URL.
+ If the method is called with no argument, it will return the Javascript object having "src" attribute having the selected image's URL.
<script>
$( "#gallery3d" ).on( "gallery3dcreate", function () {
*/
( function ( $, document, window, undefined ) {
- window.requestAnimationFrame = ( function () {
- return function ( callback ) {
- var id = window.setTimeout( callback, 1000 / 60 );
- return id;
- };
- } () );
-
- window.cancelAnimationFrame = ( function () {
- return function ( id ) {
- window.clearTimeout( id );
- };
- } () );
-
- var vec3 = window.vec3,
- mat3 = window.mat3,
- mat4 = window.mat4,
- GlArray32 = ( typeof window.Float32Array !== "undefined" ? window.Float32Array : ( typeof window.WebGLFloatArray !== "undefined" ? window.WebGLFloatArray : Array ) ),
- GlArray16 = ( typeof window.Uint16Array !== "undefined" ? window.Uint16Array : Array ),
- getContext3D = function ( canvas ) {
- var gl, i,
- contextNames = [ "experimental-webgl", "webkit-3d", "webgl", "moz-webgl" ];
-
- for ( i = 0; i < contextNames.length; i += 1 ) {
- try {
- gl = canvas.getContext( contextNames[i] );
- if ( gl ) {
- break;
- }
- } catch ( e ) {
- window.alert( "Unfortunately, there's a WebGL compatibility problem. </br> You may want to check your system settings." );
- return;
- }
- }
- return gl;
- },
- VERTEX_SHADER = [
- "attribute vec3 aVertexPosition;",
- "attribute vec2 aTextureCoord;",
- "attribute vec3 aVertexNormal;",
- "uniform mat4 uMoveMatrix;",
- "uniform mat4 uPerspectiveMatrix;",
- "uniform mat3 nNormalMatrix;",
- "uniform vec3 uAmbientColor;",
- "uniform vec3 uLightDirection;",
- "uniform vec3 uDirectionColor;",
- "uniform vec3 uLightDirection_first;",
- "uniform vec3 uLightDirection_second;",
- "varying vec2 vTextureCoord;",
- "varying vec3 vLightWeight;",
- "varying vec4 vFogWeight;",
-
- "void main(void) {",
- " vec4 v_Position = uMoveMatrix * vec4(aVertexPosition, 1.0);",
- " gl_Position = uPerspectiveMatrix * v_Position;",
- " vTextureCoord = aTextureCoord;",
- " float fog = 1.0 - ((gl_Position.z + 1.5) / 60.0);",
- " vFogWeight = clamp( vec4( fog, fog, fog, 1.0), 0.6, 1.0);",
- " vec3 transNormalVector = nNormalMatrix * aVertexNormal;",
-
- " float vLightWeightFirst = 0.0;",
- " float vLightWeightSecond = max( dot(transNormalVector, uLightDirection_second), 0.0 );",
-
- " vLightWeight = uAmbientColor + uDirectionColor * vLightWeightSecond;",
- "}"
- ].join( "\n" ),
- FRAGMENT_SHADER = [
- "precision mediump float;",
- "varying vec2 vTextureCoord;",
- "varying vec3 vLightWeight;",
- "uniform sampler2D uSampler;",
- "varying vec4 vFogWeight;",
-
- "void main(void) {",
- " vec4 TextureColor;",
- " if ( vTextureCoord.s <= 0.01 || vTextureCoord.s >= 0.99 || vTextureCoord.t <= 0.01 || vTextureCoord.t >= 0.99 ) {",
- " TextureColor = vec4(1.0, 1.0, 1.0, 0.5);",
- " } else {",
- " TextureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));",
- " }",
- " TextureColor *= vFogWeight;",
- " gl_FragColor = vec4(TextureColor.rgb * vLightWeight, TextureColor.a);",
- "}"
- ].join( "\n" );
-
function Node() {
this.vertices = [
-1.0, -1.0, 0.0,
this.imageID = 0;
}
+ var isPreInitailization = false,
+ glMatrix = {},
+ VERTEX_SHADER,
+ FRAGMENT_SHADER,
+ GlArray32,
+ GlArray16,
+ preInitialize = function () {
+ if ( isPreInitailization ) {
+ return;
+ }
+
+ window.initGlMatrix( glMatrix );
+
+ VERTEX_SHADER = [
+ "attribute vec3 aVertexPosition;",
+ "attribute vec2 aTextureCoord;",
+ "attribute vec3 aVertexNormal;",
+ "uniform mat4 uMoveMatrix;",
+ "uniform mat4 uPerspectiveMatrix;",
+ "uniform mat3 nNormalMatrix;",
+ "uniform vec3 uAmbientColor;",
+ "uniform vec3 uLightDirection;",
+ "uniform vec3 uDirectionColor;",
+ "uniform vec3 uLightDirection_first;",
+ "uniform vec3 uLightDirection_second;",
+ "varying vec2 vTextureCoord;",
+ "varying vec3 vLightWeight;",
+ "varying vec4 vFogWeight;",
+
+ "void main(void) {",
+ " vec4 v_Position = uMoveMatrix * vec4(aVertexPosition, 1.0);",
+ " gl_Position = uPerspectiveMatrix * v_Position;",
+ " vTextureCoord = aTextureCoord;",
+ " float fog = 1.0 - ((gl_Position.z + 1.5) / 60.0);",
+ " vFogWeight = clamp( vec4( fog, fog, fog, 1.0), 0.6, 1.0);",
+ " vec3 transNormalVector = nNormalMatrix * aVertexNormal;",
+
+ " float vLightWeightFirst = 0.0;",
+ " float vLightWeightSecond = max( dot(transNormalVector, uLightDirection_second), 0.0 );",
+
+ " vLightWeight = uAmbientColor + uDirectionColor * vLightWeightSecond;",
+ "}"
+ ].join( "\n" );
+
+ FRAGMENT_SHADER = [
+ "precision mediump float;",
+ "varying vec2 vTextureCoord;",
+ "varying vec3 vLightWeight;",
+ "uniform sampler2D uSampler;",
+ "varying vec4 vFogWeight;",
+
+ "void main(void) {",
+ " vec4 TextureColor;",
+ " if ( vTextureCoord.s <= 0.01 || vTextureCoord.s >= 0.99 || vTextureCoord.t <= 0.01 || vTextureCoord.t >= 0.99 ) {",
+ " TextureColor = vec4(1.0, 1.0, 1.0, 0.5);",
+ " } else {",
+ " TextureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));",
+ " }",
+ " TextureColor *= vFogWeight;",
+ " gl_FragColor = vec4(TextureColor.rgb * vLightWeight, TextureColor.a);",
+ "}"
+ ].join( "\n" );
+
+ GlArray32 = ( typeof window.Float32Array !== "undefined" ?
+ window.Float32Array :
+ ( typeof window.WebGLFloatArray !== "undefined" ? window.WebGLFloatArray : Array ) );
+
+ GlArray16 = ( typeof window.Uint16Array !== "undefined" ? window.Uint16Array : Array );
+
+ isPreInitailization = true;
+ },
+ degreeToRadian = function ( degree ) {
+ return degree * Math.PI / 180;
+ },
+ getContext3D = function ( canvas ) {
+ var gl, i,
+ contextNames = [ "experimental-webgl", "webkit-3d", "webgl", "moz-webgl" ];
+
+ for ( i = 0; i < contextNames.length; i += 1 ) {
+ try {
+ gl = canvas.getContext( contextNames[i] );
+ if ( gl ) {
+ break;
+ }
+ } catch ( e ) {
+ $( canvas ).html( "Unfortunately, there's a WebGL compatibility problem. </br> You may want to check your system settings." );
+ return;
+ }
+ }
+ return gl;
+ },
+ requestAnimationFrame = function ( callback ) {
+ var id = window.setTimeout( callback, 1000 / 60 );
+ return id;
+ },
+ cancelAnimationFrame = function ( id ) {
+ window.clearTimeout( id );
+ };
+
$.widget( "tizen.gallery3d", $.mobile.widget, {
options: {
thumbnailCache: false
view = self.element,
option = self.options;
+ preInitialize();
+
self._canvas = $( "<canvas class='ui-gallery3d-canvas'></canvas>" );
view.addClass( "ui-gallery3d" ).append( self._canvas );
self.options[ key ] = undefined;
self._setOption( key, value );
});
+ },
+ destroy: function () {
+ this._final();
+ $.mobile.widget.prototype.destroy.call( this );
},
_setOption: function ( key, value ) {
touchEndEvt = ( $.support.touch ? "touchend" : "mouseup" ) + ".gallery3d",
touchLeaveEvt = ( $.support.touch ? "touchleave" : "mouseout" ) + ".gallery3d";
- $( document ).unbind( ".gallery3d" ).bind( "pagechange.gallery3d", function ( e ) {
- $( e.target ).find( ".ui-gallery3d" ).gallery3d( "refresh" );
- }).bind( "pageremove.gallery3d", function ( e ) {
- $( e.target ).find( ".ui-gallery3d" ).trigger( "_destory" );
- });
-
- $( window ).unbind( ".gallery3d" ).bind( "resize.gallery3d orientationchange.gallery3d", function ( e ) {
- $( ".ui-page-active" ).find( ".ui-gallery3d" ).gallery3d( "refresh" );
- }).bind( "unload.gallery3d", function ( e ) {
- $( e.target ).find( ".ui-gallery3d" ).trigger( "_destory" );
- });
-
- view.bind( "_destory", function ( e ) {
- self._final();
- });
-
- canvas.bind( "webglcontextlost", function ( e ) {
+ canvas.on( "webglcontextlost", function ( e ) {
e.preventDefault();
- }).bind( "webglcontextrestored", function ( e ) {
+ }).on( "webglcontextrestored", function ( e ) {
self._init();
- }).bind( touchStartEvt, function ( e ) {
+ }).on( touchStartEvt, function ( e ) {
var i = 0,
startX = 0,
deltaMaxSteps = 20,
deltaIndex += 1;
- view.bind( touchMoveEvt, function ( e ) {
+ view.on( touchMoveEvt, function ( e ) {
var x, dx, interval;
e.preventDefault();
startX = x;
prevTime = $.now();
}
- }).bind( touchEndEvt, function ( e ) {
+ }).on( touchEndEvt, function ( e ) {
var baseTime = 0,
recent = -1,
index = 0,
}
view.unbind( ".gallery3d" );
- }).bind( touchLeaveEvt, function ( e ) {
+ }).on( touchLeaveEvt, function ( e ) {
view.trigger( touchEndEvt );
});
});
// ----------------------------------------------------------
_initGL: function ( canvas ) {
var self = this,
+ mat4 = glMatrix.mat4,
gl;
gl = getContext3D( canvas );
if ( !gl ) {
- window.alert( "There's no WebGL context available!!!" );
return null;
}
// ----------------------------------------------------------
_setPosition: function ( progress, direction ) {
var self = this,
+ mat4 = glMatrix.mat4,
nodes = self._nodes,
imageList = self._imageList,
imageListLength = imageList.length,
mat4.identity( nodes[i].mvMatrix );
mat4.translate( nodes[i].mvMatrix, [-2.0, -2.0, 1.0] );
- mat4.rotate( nodes[i].mvMatrix, self._degreeToRadian( 19 ), [1, 0, 0] );
+ mat4.rotate( nodes[i].mvMatrix, degreeToRadian( 19 ), [1, 0, 0] );
t = ( current + ( next - current ) * ( ( progress > 1 ) ? 1 : progress ) );
_drawElement: function ( perspectiveMatrix, targetNode ) {
var self = this,
gl = self._gl,
+ vec3 = glMatrix.vec3,
+ mat3 = glMatrix.mat3,
+ mat4 = glMatrix.mat4,
shaderProgram = self._shaderProgram,
moveMatrix = targetNode.mvMatrix,
texture = targetNode.texture,
self._setPosition( progress - _removeCount, direction );
}
- self._animationID = window.requestAnimationFrame( function () {
+ self._animationID = requestAnimationFrame( function () {
self._animate( easingType, duration, direction, repeatCount, startValue, _removeCount );
});
},
_stop: function () {
if ( this._animationID ) {
- window.cancelAnimationFrame( this._animationID );
+ cancelAnimationFrame( this._animationID );
}
this._animationID = 0;
this._sumTime = 0;
},
- _degreeToRadian: function ( degree ) {
- return degree * Math.PI / 180;
- },
-
next: function () {
this._run( this._DIRECTION_LEFT , 0 );
},
}
});
- $( document ).bind( "pagecreate create", function ( e ) {
+ $( document ).on( "pagecreate create", function ( e ) {
$( ":jqmData(role='gallery3d')" ).gallery3d();
+ }).on( "pagechange", function ( e ) {
+ $( e.target ).find( ".ui-gallery3d" ).gallery3d( "refresh" );
+ });
+
+ $( window ).on( "resize orientationchange", function ( e ) {
+ $( ".ui-page-active" ).find( ".ui-gallery3d" ).gallery3d( "refresh" );
});
} ( jQuery, document, window ) );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
} );
-//>>excludeEnd("jqmBuildExclude");
\ No newline at end of file
+//>>excludeEnd("jqmBuildExclude");
options: {
initSelector: ":jqmData(role='list-divider')",
folded : false,
- listDividerLine : true,
+ listDividerLine : true
},
_create: function () {
$listdivider.bind( "vclick", function ( event, ui ) {
/* need to implement expand/collapse divider */
});
- },
+ }
});
//auto self-init widgets
dpr = 1,
layoutInnerHeight = window.innerHeight;
- if ( !$.support.scrollview ) {
+ if ( !$.support.scrollview || ($.support.scrollview && $elContent.jqmData("scroll") === "none") ) {
dpr = window.outerWidth / window.innerWidth;
layoutInnerHeight = Math.floor( window.outerHeight / dpr );
} else {
resultMinHeight = layoutInnerHeight - $elHeader.height() - $elFooter.height();
- $elContent.css( "min-height", resultMinHeight - parseFloat( $elContent.css("padding-top") ) - parseFloat( $elContent.css("padding-bottom") ) + "px" );
- if ( $.support.scrollview ) {
+ if ( $.support.scrollview && $elContent.jqmData("scroll") !== "none" ) {
+ $elContent.css( "min-height", resultMinHeight - parseFloat( $elContent.css("padding-top") ) - parseFloat( $elContent.css("padding-bottom") ) + "px" );
$elContent.children( ".ui-scrollview-view" ).css( "min-height", $elContent.css( "min-height" ) );
}
},
tbPage = tbPage || $el.closest( ".ui-page" );
- if ( $el.siblings( ".ui-header" ).jqmData("position") == "fixed" || $.support.scrollview ) {
+ if ( $el.siblings( ".ui-header" ).jqmData("position") == "fixed" || ($.support.scrollview && $el.jqmData("scroll") !== "none" )) {
$( tbPage ).css( "padding-top", ( header ? $el.siblings( ".ui-header" ).outerHeight() : 0 ) );
}
$( tbPage ).css( "padding-bottom", ( footer ? $el.siblings( ".ui-footer" ).outerHeight() : 0 ) );
$elFooter.css( "bottom", 0 );
}
- if ( !$.support.scrollview ) {
+ if ( !$.support.scrollview || ($.support.scrollview && $elContent.jqmData("scroll") === "none") ) {
dpr = window.outerWidth / window.innerWidth;
layoutInnerHeight = Math.floor( window.outerHeight / dpr );
} else {
resultContentHeight = layoutInnerHeight - resultFooterHeight - resultHeaderHeight;
- if ( $.support.scrollview ) {
+ if ( $.support.scrollview && $elContent.jqmData("scroll") !== "none" ) {
$elContent.height( resultContentHeight -
parseFloat( $elContent.css("padding-top") ) -
parseFloat( $elContent.css("padding-bottom") ) );
)
),
// Triangle points here
- final = {
+ finalposition = {
"x": orig.x + ( isHorizontal ? triangleOffset : 0) + ("r" === arrow ? size.cx : 0),
"y": orig.y + (!isHorizontal ? triangleOffset : 0) + ("b" === arrow ? size.cy : 0)
},
ret = {
actual : orig,
triangleOffset : triangleOffset,
- absDiff : Math.abs( x - final.x ) + Math.abs( y - final.y )
+ absDiff : Math.abs( x - finalposition.x ) + Math.abs( y - finalposition.y )
};
// Hide it back
* The number of panes inside of Splitview is restricted as two.
* If a user define only one pane in Splitview, a empty pane will be added automatically,
* on the other hand, if 3 or more panes are defined in Splitview, the panes after two will be ignored and removed from the DOM tree.
- * The HTML fragments of a pane should be composed of elements describing a part of Web page (e.g. <div>…</div>).
+ * The HTML fragments of a pane should be composed of elements describing a part of Web page (e.g. <div>...</div>).
* Also widgets can be included in the HTML fragments.
*
* HTML Attributes:
$el.addClass( "ui-splitview ui-direction-" + self._direction( opt.dividerVertical ) );
- if ( $el.parent().closest( ".ui-splitview" ).length ) {
- if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
- self._layout();
- }
- }
-
- $( window ).bind( "pagechange", function ( e ) {
- if ( !$el.parent().closest( ".ui-splitview" ).length ) {
- if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
- self._layout();
- }
- }
- }).resize( function () {
- if ( resizeTimer ) {
- clearTimeout( resizeTimer );
- }
+ self._refresh();
- resizeTimer = setTimeout( function () {
- if ( !$el.parent().closest( ".ui-splitview" ).length ) {
- if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
- self._layout();
- }
- }
- }, 250);
- });
+ $( window ).unbind( ".splitview" )
+ .bind( "pagechange.splitview resize.splitview", function ( event ) {
+ $( ".ui-page-active .ui-splitview" ).each( function () {
+ $( this ).data( "splitview" )._refresh();
+ });
+ });
},
_addEmptyPanes : function () {
widthSum = 0,
childSplitview = null;
- if ( typeof initRatio === "undefined" ) {
- initRatio = false;
- }
-
- if ( initRatio && typeof fromFirstPane === "undefined" ) {
- fromFirstPane = false;
- }
+ initRatio = !!initRatio;
+ fromFirstPane = !!fromFirstPane;
$el.css( {
"min-width" : width,
spliter.outerWidth( innerSize ).css( "top", posValue );
}
- if ( typeof bar !== "undefined" && bar ) {
- if ( isHorizontal ) {
- bar.outerHeight( innerSize );
- } else {
- bar.outerWidth( innerSize );
- }
+ if ( bar.length ) {
+ bar[ isHorizontal ? "outerHeight" : "outerWidth" ]( innerSize );
}
- if ( typeof handle !== "undefined" && handle ) {
- if ( isHorizontal ) {
- handle.css( "top", ( innerSize - spliterWidth ) / 2 );
- } else {
- handle.css( "left", ( innerSize - spliterWidth ) / 2 );
- }
+ if ( handle.length ) {
+ handle.css( isHorizontal ? "top" : "left", ( innerSize - spliterWidth ) / 2 );
}
});
- childSplitview = $el.find( ":jqmData(role='splitview'):first" );
+ childSplitview = $el.find( ".ui-splitview:first" );
if ( !childSplitview.length ) {
return;
}
$.each( spliters, function ( i ) {
var spliter = $( this );
- self._bindSpliterTouchEvents( spliter );
- });
-
- $el.mouseleave( function () {
- if ( self.touchStatus ) {
- $el.children( ".ui-spliter" ).trigger( "vmouseup" );
- }
- });
-
- $panes.bind( "vmousedown", function () {
- $el.find( ".ui-spliter" ).trigger( "vmouseup" );
+ self._bindSpliterTouchEvents.call( self, spliter );
});
},
_bindSpliterTouchEvents : function ( spliter ) {
var self = this,
$el = self.element,
- opt = self.options;
+ opt = self.options,
+ touchStartEvt = ( $.support.touch ? "touchstart" : "mousedown" ),
+ touchMoveEvt = ( $.support.touch ? "touchmove" : "mousemove" ) + ".splitview",
+ touchEndEvt = ( $.support.touch ? "touchend" : "mouseup" ) + ".splitview";
- spliter.bind( "vmousedown", { e : spliter }, function ( event ) {
+ spliter.bind( touchStartEvt, { e : spliter }, function ( event ) {
if ( self.options.fixed ) {
return;
}
- var targetSpliter = event.data.e,
+ var realEvent = $.support.touch ? event.originalEvent.changedTouches[0] : event,
+ targetSpliter = event.data.e,
prevPane = targetSpliter.prev(),
nextPane = targetSpliter.next(),
- splitviewInPrev = prevPane.find( ":jqmData(role='splitview'):first" ),
- splitviewInNext = nextPane.find( ":jqmData(role='splitview'):first" ),
+ splitviewInPrev = prevPane.find( ".ui-splitview:first" ),
+ splitviewInNext = nextPane.find( ".ui-splitview:first" ),
isHorizontal = opt.dividerVertical,
spliterWidth = isHorizontal ?
$( self.spliterBars[0] ).outerWidth() :
$( self.spliterBars[0] ).outerHeight();
- $el.closest( ".ui-page" ).find( ".ui-spliter" ).trigger( "vmouseup" );
-
self.moveTarget = targetSpliter;
self.moveData = {
spliterWidth : spliterWidth || 0,
nextPanePos : parseInt( nextPane.css( isHorizontal ? "left" : "top" ), 10 ) || 0,
nextPaneWidth : parseInt( nextPane.css( isHorizontal ? "width" : "height" ), 10 ) || 0,
targetPos : parseInt( targetSpliter.css( isHorizontal ? "left" : "top" ), 10 ) || 0,
- pagePos : isHorizontal ? event.pageX : event.pageY
+ pagePos : isHorizontal ? realEvent.pageX : realEvent.pageY
};
targetSpliter.addClass( "ui-spliter-active" );
- $( document ).bind( "vmousemove.splitview", function ( event ) {
+ $el.bind( touchMoveEvt, function ( event ) {
if ( !self.touchStatus ) {
return;
}
-
- self._drag( event );
-
- event.preventDefault();
event.stopPropagation();
- }).bind( "vmouseup.splitview", function ( event ) {
- if ( !self.touchStatus ) {
- return;
- }
-
- self._stop( event );
-
- event.preventDefault();
+ self._drag( $.support.touch ? event.originalEvent.changedTouches[0] : event );
+ }).bind( touchEndEvt, function ( event ) {
event.stopPropagation();
-
+ self._stop( $.support.touch ? event.originalEvent.changedTouches[0] : event );
self.touchStatus = false;
+ $el.unbind( ".splitview" );
+ $( document ).unbind( ".splitview" );
});
- event.preventDefault();
- event.stopPropagation();
+ $( document ).bind( touchMoveEvt + " " + touchEndEvt, function() {
+ $el.trigger( touchEndEvt );
+ });
+ event.preventDefault();
self.touchStatus = true;
});
},
},
_stop : function ( e ) {
- if ( !this.moveData || typeof this.moveData === "undefined" ) {
+ if ( !this.moveData || !this.moveTarget ) {
return;
}
( height - spliterSize ),
sum = 0;
- $( document ).unbind( "vmousemove.splitview vmouseup.splitview" );
moveTarget.removeClass( "ui-spliter-active" );
// ratio calculation
var self = this,
$el = self.element;
- if ( typeof initRatio === "undefined" ) {
- initRatio = false;
- }
-
- if ( initRatio && typeof fromFirstPane === "undefined" ) {
- fromFirstPane = false;
- }
+ initRatio = !!initRatio;
+ fromFirstPane = !!fromFirstPane;
if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
self._layout( initRatio, fromFirstPane );
}
// getter
- if ( typeof element === "undefined" || !element ) {
+ if ( !element ) {
return $targetPane.contents();
}
restore : function () {
var self = this;
- if ( self.savedRatio.length === 0 ) {
+ if ( !self.savedRatio.length ) {
return;
}