From ChrisBurrell at crosswire.org Sat Feb 4 03:59:48 2012 From: ChrisBurrell at crosswire.org (ChrisBurrell at crosswire.org) Date: Sat, 04 Feb 2012 03:59:48 -0700 Subject: [Tynstep-svn] r233 - tags Message-ID: Author: ChrisBurrell Date: 2012-02-04 03:59:48 -0700 (Sat, 04 Feb 2012) New Revision: 233 Added: tags/step-0.1/ Log: tagging prototype as version 0.1 From tst25 at crosswire.org Wed Feb 29 15:35:52 2012 From: tst25 at crosswire.org (tst25 at crosswire.org) Date: Wed, 29 Feb 2012 15:35:52 -0700 Subject: [Tynstep-svn] r234 - in trunk: . android android/step_viewer android/step_viewer/.settings android/step_viewer/bin android/step_viewer/bin/classes android/step_viewer/bin/classes/com android/step_viewer/bin/classes/com/tyndalehouse android/step_viewer/bin/classes/com/tyndalehouse/step android/step_viewer/bin/res android/step_viewer/bin/res/drawable android/step_viewer/bin/res/drawable-hdpi android/step_viewer/bin/res/drawable-ldpi android/step_viewer/bin/res/drawable-mdpi android/step_viewer/gen android/step_viewer/gen/com android/step_viewer/gen/com/tyndalehouse android/step_viewer/gen/com/tyndalehouse/step android/step_viewer/res android/step_viewer/res/drawable android/step_viewer/res/drawable-hdpi android/step_viewer/res/drawable-ldpi android/step_viewer/res/drawable-mdpi android/step_viewer/res/layout android/step_viewer/res/values android/step_viewer/src android/step_viewer/src/com android/step_viewer/src/com/tyndalehouse android/step_viewer/src/com/tyndalehouse/step Message-ID: Author: tst25 Date: 2012-02-29 15:35:51 -0700 (Wed, 29 Feb 2012) New Revision: 234 Added: trunk/android/ trunk/android/step_viewer/ trunk/android/step_viewer/.classpath trunk/android/step_viewer/.project trunk/android/step_viewer/.settings/ trunk/android/step_viewer/.settings/org.eclipse.jdt.core.prefs trunk/android/step_viewer/AndroidManifest.xml trunk/android/step_viewer/assets/ trunk/android/step_viewer/bin/ trunk/android/step_viewer/bin/classes.dex trunk/android/step_viewer/bin/classes/ trunk/android/step_viewer/bin/classes/com/ trunk/android/step_viewer/bin/classes/com/tyndalehouse/ trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/ trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/FullGallery.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$attr.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$drawable.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$id.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$layout.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$string.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$styleable.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen$1.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$1.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$ImageAdapter.class trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer.class trunk/android/step_viewer/bin/res/ trunk/android/step_viewer/bin/res/drawable-hdpi/ trunk/android/step_viewer/bin/res/drawable-hdpi/ic_launcher.png trunk/android/step_viewer/bin/res/drawable-ldpi/ trunk/android/step_viewer/bin/res/drawable-ldpi/ic_launcher.png trunk/android/step_viewer/bin/res/drawable-mdpi/ trunk/android/step_viewer/bin/res/drawable-mdpi/ic_launcher.png trunk/android/step_viewer/bin/res/drawable/ trunk/android/step_viewer/bin/res/drawable/thouse.png trunk/android/step_viewer/bin/resources.ap_ trunk/android/step_viewer/bin/step_viewer.apk trunk/android/step_viewer/gen/ trunk/android/step_viewer/gen/com/ trunk/android/step_viewer/gen/com/tyndalehouse/ trunk/android/step_viewer/gen/com/tyndalehouse/step/ trunk/android/step_viewer/gen/com/tyndalehouse/step/R.java trunk/android/step_viewer/proguard.cfg trunk/android/step_viewer/project.properties trunk/android/step_viewer/res/ trunk/android/step_viewer/res/drawable-hdpi/ trunk/android/step_viewer/res/drawable-hdpi/ic_launcher.png trunk/android/step_viewer/res/drawable-ldpi/ trunk/android/step_viewer/res/drawable-ldpi/ic_launcher.png trunk/android/step_viewer/res/drawable-mdpi/ trunk/android/step_viewer/res/drawable-mdpi/ic_launcher.png trunk/android/step_viewer/res/drawable/ trunk/android/step_viewer/res/drawable/step.jpg trunk/android/step_viewer/res/drawable/step_2.jpg trunk/android/step_viewer/res/drawable/thouse.png trunk/android/step_viewer/res/drawable/wilson1.gif trunk/android/step_viewer/res/drawable/wilson2.gif trunk/android/step_viewer/res/layout/ trunk/android/step_viewer/res/layout/main.xml trunk/android/step_viewer/res/layout/splash.xml trunk/android/step_viewer/res/layout/viewer.xml trunk/android/step_viewer/res/values/ trunk/android/step_viewer/res/values/attrs.xml trunk/android/step_viewer/res/values/strings.xml trunk/android/step_viewer/src/ trunk/android/step_viewer/src/com/ trunk/android/step_viewer/src/com/tyndalehouse/ trunk/android/step_viewer/src/com/tyndalehouse/step/ trunk/android/step_viewer/src/com/tyndalehouse/step/FullGallery.java trunk/android/step_viewer/src/com/tyndalehouse/step/SplashScreen.java trunk/android/step_viewer/src/com/tyndalehouse/step/Viewer.java Log: Added basic android app to view book page images. Still a lot of bugs to fix surrounding the pinch zoom functionality. Added: trunk/android/step_viewer/.classpath =================================================================== --- trunk/android/step_viewer/.classpath (rev 0) +++ trunk/android/step_viewer/.classpath 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,8 @@ + + + + + + + + Added: trunk/android/step_viewer/.project =================================================================== --- trunk/android/step_viewer/.project (rev 0) +++ trunk/android/step_viewer/.project 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,33 @@ + + + step_viewer + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + Added: trunk/android/step_viewer/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/android/step_viewer/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/android/step_viewer/.settings/org.eclipse.jdt.core.prefs 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,12 @@ +#Wed Feb 29 17:22:45 GMT 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 Added: trunk/android/step_viewer/AndroidManifest.xml =================================================================== --- trunk/android/step_viewer/AndroidManifest.xml (rev 0) +++ trunk/android/step_viewer/AndroidManifest.xml 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/FullGallery.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/FullGallery.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$attr.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$attr.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$drawable.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$drawable.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$id.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$id.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$layout.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$layout.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$string.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$string.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$styleable.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$styleable.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen$1.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen$1.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$1.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$1.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$ImageAdapter.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$ImageAdapter.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer.class =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/classes.dex =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/classes.dex ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/res/drawable/thouse.png =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/res/drawable/thouse.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/res/drawable-hdpi/ic_launcher.png =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/res/drawable-hdpi/ic_launcher.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/res/drawable-ldpi/ic_launcher.png =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/res/drawable-ldpi/ic_launcher.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/res/drawable-mdpi/ic_launcher.png =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/res/drawable-mdpi/ic_launcher.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/resources.ap_ =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/resources.ap_ ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/bin/step_viewer.apk =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/bin/step_viewer.apk ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/gen/com/tyndalehouse/step/R.java =================================================================== --- trunk/android/step_viewer/gen/com/tyndalehouse/step/R.java (rev 0) +++ trunk/android/step_viewer/gen/com/tyndalehouse/step/R.java 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,57 @@ +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package com.tyndalehouse.step; + +public final class R { + public static final class attr { + } + public static final class drawable { + public static final int ic_launcher=0x7f020000; + public static final int step=0x7f020001; + public static final int step_2=0x7f020002; + public static final int thouse=0x7f020003; + public static final int wilson1=0x7f020004; + public static final int wilson2=0x7f020005; + } + public static final class id { + public static final int gallery=0x7f050000; + } + public static final class layout { + public static final int main=0x7f030000; + public static final int splash=0x7f030001; + public static final int viewer=0x7f030002; + } + public static final class string { + public static final int app_name=0x7f040001; + public static final int gallery_2_text=0x7f040004; + public static final int hello=0x7f040000; + public static final int select_book=0x7f040003; + public static final int title=0x7f040002; + } + public static final class styleable { + /** Attributes that can be used with a Viewer. +

Includes the following attributes:

+ + + + + +
AttributeDescription
{@link #Viewer_android_galleryItemBackground com.tyndalehouse.step:android_galleryItemBackground}
+ @see #Viewer_android_galleryItemBackground + */ + public static final int[] Viewer = { + 0x0101004c + }; + /** +

This symbol is the offset where the {@link com.tyndalehouse.step.R.attr#android_galleryItemBackground} + attribute's value can be found in the {@link #Viewer} array. + @attr name android:android_galleryItemBackground + */ + public static final int Viewer_android_galleryItemBackground = 0; + }; +} Added: trunk/android/step_viewer/proguard.cfg =================================================================== --- trunk/android/step_viewer/proguard.cfg (rev 0) +++ trunk/android/step_viewer/proguard.cfg 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,40 @@ +-optimizationpasses 5 +-dontusemixedcaseclassnames +-dontskipnonpubliclibraryclasses +-dontpreverify +-verbose +-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* + +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference +-keep public class com.android.vending.licensing.ILicensingService + +-keepclasseswithmembernames class * { + native ; +} + +-keepclasseswithmembers class * { + public (android.content.Context, android.util.AttributeSet); +} + +-keepclasseswithmembers class * { + public (android.content.Context, android.util.AttributeSet, int); +} + +-keepclassmembers class * extends android.app.Activity { + public void *(android.view.View); +} + +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} Added: trunk/android/step_viewer/project.properties =================================================================== --- trunk/android/step_viewer/project.properties (rev 0) +++ trunk/android/step_viewer/project.properties 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-8 Added: trunk/android/step_viewer/res/drawable/step.jpg =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/res/drawable/step.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/res/drawable/step_2.jpg =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/res/drawable/step_2.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/res/drawable/thouse.png =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/res/drawable/thouse.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/res/drawable/wilson1.gif =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/res/drawable/wilson1.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/res/drawable/wilson2.gif =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/res/drawable/wilson2.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/res/drawable-hdpi/ic_launcher.png =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/res/drawable-hdpi/ic_launcher.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/res/drawable-ldpi/ic_launcher.png =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/res/drawable-ldpi/ic_launcher.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/res/drawable-mdpi/ic_launcher.png =================================================================== (Binary files differ) Property changes on: trunk/android/step_viewer/res/drawable-mdpi/ic_launcher.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/android/step_viewer/res/layout/main.xml =================================================================== --- trunk/android/step_viewer/res/layout/main.xml (rev 0) +++ trunk/android/step_viewer/res/layout/main.xml 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file Added: trunk/android/step_viewer/res/layout/splash.xml =================================================================== --- trunk/android/step_viewer/res/layout/splash.xml (rev 0) +++ trunk/android/step_viewer/res/layout/splash.xml 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,12 @@ + + + + \ No newline at end of file Added: trunk/android/step_viewer/res/layout/viewer.xml =================================================================== --- trunk/android/step_viewer/res/layout/viewer.xml (rev 0) +++ trunk/android/step_viewer/res/layout/viewer.xml 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file Added: trunk/android/step_viewer/res/values/attrs.xml =================================================================== --- trunk/android/step_viewer/res/values/attrs.xml (rev 0) +++ trunk/android/step_viewer/res/values/attrs.xml 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file Added: trunk/android/step_viewer/res/values/strings.xml =================================================================== --- trunk/android/step_viewer/res/values/strings.xml (rev 0) +++ trunk/android/step_viewer/res/values/strings.xml 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,8 @@ + + + Hello World! + STEP Viewer + Tyndale House STEP Viewer + Please select a book + LONG PRESS DOES SOMETHING + Added: trunk/android/step_viewer/src/com/tyndalehouse/step/FullGallery.java =================================================================== --- trunk/android/step_viewer/src/com/tyndalehouse/step/FullGallery.java (rev 0) +++ trunk/android/step_viewer/src/com/tyndalehouse/step/FullGallery.java 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,183 @@ +package com.tyndalehouse.step; + +import android.content.Context; +import android.graphics.Matrix; +import android.graphics.PointF; +import android.util.AttributeSet; +import android.util.Log; +import android.view.GestureDetector; +import android.view.GestureDetector.OnGestureListener; +import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.ScaleGestureDetector; +import android.view.ScaleGestureDetector.OnScaleGestureListener; +import android.widget.Gallery; +import android.widget.ImageView; + +public class FullGallery extends Gallery implements OnGestureListener, OnScaleGestureListener { + + private static final String TAG = "Gallery"; + static final int NONE = 0; + static final int DRAG = 1; + int mode = NONE; + + private Context c; + + private ScaleGestureDetector mScaleDetector; + private GestureDetector mDetector; + private float mScaleFactor = 1.f; + + float new_distance_touch, old_distance_touch, init_x, init_y; + + Matrix matrix = new Matrix(); + Matrix savedMatrix = new Matrix(); + + PointF mid = new PointF(); + PointF start = new PointF(); + + ImageView imgPicture; + + public FullGallery(Context context, AttributeSet attrSet) { + super(context, attrSet); + + c = context; + mDetector = new GestureDetector(c,this); + mScaleDetector = new ScaleGestureDetector(c, this); + } + + + @Override + public boolean onTouchEvent(MotionEvent event) { //gesture detector for the movements + imgPicture = (ImageView) super.getSelectedView(); + + if (mDetector.onTouchEvent(event)) { + Log.d("onTouchEvent", "--[ MOVEMENT ]--"); + switch (event.getAction() & MotionEvent.ACTION_MASK) { + case MotionEvent.ACTION_DOWN: + init_x = event.getX(); + init_y = event.getY(); + midPoint(mid, event); + savedMatrix.set(matrix); + start.set(event.getX(), event.getY()); + Log.d(TAG, "mode=DRAG" ); + mode = DRAG; + break; + + case MotionEvent.ACTION_MOVE: + if (mode == DRAG) { + matrix.set(savedMatrix); + matrix.postTranslate(event.getX() - start.x, event.getY() - start.y); + } + break; + } + + imgPicture = (ImageView) super.getSelectedView(); + imgPicture.setImageMatrix(matrix); + + return true; + } + else if(mScaleDetector.onTouchEvent(event)) { // scale detector for zoom + Log.d("onTouchEvent", "--[ SCALE ]--"); + return true; + } + else + return false; + } + + + + public boolean onScale(ScaleGestureDetector detector) { + + mScaleFactor *= detector.getScaleFactor(); + mScaleFactor = Math.max(0.1f, Math.min(mScaleFactor, 5.0f)); + + if (new_distance_touch > 10f) { + matrix.set(savedMatrix); + matrix.postScale(mScaleFactor, mScaleFactor, mid.x, mid.y); + Log.d("ZOOMMING",matrix.toShortString()); + } + else { + matrix.set(savedMatrix); + matrix.postTranslate(init_x - start.x, init_y - start.y); + Log.d("PANNING",matrix.toShortString()); + } + + imgPicture.setImageMatrix(matrix); + + imgPicture.invalidate(); + + Log.d("MATRIX", matrix.toString()); + return true; + } + + //@Override + public boolean onScaleBegin(ScaleGestureDetector detector) { + Log.d(TAG, "-- onScaleBegin --"); + matrix = imgPicture.getImageMatrix(); + savedMatrix.set(matrix); + start.set(init_x, init_y); + return true; + } + + //@Override + public void onScaleEnd(ScaleGestureDetector detector) { + Log.d(TAG, "-- onScaleEnd --"); + old_distance_touch = detector.getPreviousSpan(); + new_distance_touch = detector.getCurrentSpan(); + + } + + @Override + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { + Log.d(TAG, "-- onFling --"); + + float velMax = 2500f; + float velMin = 1000f; + float velX = Math.abs(velocityX); + if (velX > velMax) { + velX = velMax; + } + else if (velX < velMin) { + velX = velMin; + } + velX -= 600; + int k = 500000; + int speed = (int) Math.floor(1f / velX * k); + setAnimationDuration(speed); + + int kEvent; + if (isScrollingLeft(e1, e2)) { + kEvent = KeyEvent.KEYCODE_DPAD_LEFT; + } else { + kEvent = KeyEvent.KEYCODE_DPAD_RIGHT; + } + onKeyDown(kEvent, null); + + return true; + } + + private boolean isScrollingLeft(MotionEvent e1, MotionEvent e2){ + return e2.getX() > e1.getX(); + } + + @Override + public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { + Log.d(TAG, "-- onScroll --"); + return super.onScroll(e1, e2, distanceX, distanceY); + } + +// private float spacing(MotionEvent event) { +// float x = event.getX(0) - event.getX(1); +// float y = event.getY(0) - event.getY(1); +// return FloatMath.sqrt(x * x + y * y); +// } +// + + + private void midPoint(PointF point, MotionEvent event) { + float x = event.getX(0) + event.getX(1); + float y = event.getY(0) + event.getY(1); + point.set(x / 2, y / 2); + } + +} \ No newline at end of file Added: trunk/android/step_viewer/src/com/tyndalehouse/step/SplashScreen.java =================================================================== --- trunk/android/step_viewer/src/com/tyndalehouse/step/SplashScreen.java (rev 0) +++ trunk/android/step_viewer/src/com/tyndalehouse/step/SplashScreen.java 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,50 @@ +package com.tyndalehouse.step; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.MotionEvent; + +public class SplashScreen extends Activity { + protected boolean active = true; + protected int splashTime = 5000; + protected int timeIncrement = 100; + protected int sleepTime = 100; + + /** Called when the activity is first created. */ + @Override + public void onCreate( Bundle savedInstanceState ) { + super.onCreate( savedInstanceState ); + setContentView( R.layout.splash ); + + // thread for displaying the SplashScreen + Thread splashThread = new Thread() { + @Override + public void run() { + try { + int elapsedTime = 0; + while( active && ( elapsedTime < splashTime ) ) { + sleep( sleepTime ); + if( active ) elapsedTime = elapsedTime + timeIncrement; + } + } + catch( InterruptedException e ) { + // do nothing + } + finally { + finish(); + startActivity( new Intent( "com.tyndalehouse.step.Viewer" ) ); + } + } + }; + splashThread.start(); + } + + @Override + public boolean onTouchEvent( MotionEvent event ) { + if ( event.getAction() == MotionEvent.ACTION_DOWN ) { + active = false; + } + return true; + } +} \ No newline at end of file Added: trunk/android/step_viewer/src/com/tyndalehouse/step/Viewer.java =================================================================== --- trunk/android/step_viewer/src/com/tyndalehouse/step/Viewer.java (rev 0) +++ trunk/android/step_viewer/src/com/tyndalehouse/step/Viewer.java 2012-02-29 22:35:51 UTC (rev 234) @@ -0,0 +1,145 @@ +package com.tyndalehouse.step; + +import com.tyndalehouse.step.R; +import android.app.Activity; +import android.content.Context; +import android.content.res.TypedArray; +import android.os.Bundle; +import android.view.ContextMenu; +import android.view.ContextMenu.ContextMenuInfo; +import android.view.MenuItem; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.AdapterView.AdapterContextMenuInfo; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.BaseAdapter; +import android.widget.Gallery.LayoutParams; +import android.widget.ImageView; +import android.widget.Toast; + +public class Viewer extends Activity +{ + + private FullGallery g; +// private Cursor c; +// private int columnIndex; + + + @Override + protected void onCreate( Bundle savedInstanceState ) { + super.onCreate( savedInstanceState ); + + + setContentView( R.layout.viewer ); + +// /** +// * Query image database to get images +// */ +// String[] projection = { MediaStore.Images.Media._ID, MediaStore.Images.Media.ORIENTATION }; +// +// c = managedQuery( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, +// projection, +// MediaStore.Images.Media.DATA + " like ? ", +// new String[] { "%STEP/Wilson%" }, +// null ); +// columnIndex = c.getColumnIndexOrThrow( MediaStore.Images.Media._ID ); + + /** + * Set Gallery + */ + + g = ( FullGallery ) findViewById( R.id.gallery ); + g.setAdapter( new ImageAdapter( this ) ); + g.setFadingEdgeLength(0); + g.setSpacing(2); + + g.setAdapter( new ImageAdapter( this ) ); + + + /** + * Set up click listener on Gallery + */ + g.setOnItemClickListener( new OnItemClickListener() { + public void onItemClick(AdapterView parent, View v, int position, long id) { + + if ( v != null ) { + Toast.makeText(Viewer.this, "Page " + (position + 1), Toast.LENGTH_SHORT).show(); + } + } + }); + + // We also want to show context menu for longpressed items in the gallery + registerForContextMenu(g); + } + + @Override + public void onCreateContextMenu( ContextMenu menu, View v, ContextMenuInfo menuInfo ) { + menu.add(R.string.gallery_2_text); + } + + @Override + public boolean onContextItemSelected( MenuItem item ) { + AdapterContextMenuInfo info = ( AdapterContextMenuInfo ) item.getMenuInfo(); + Toast.makeText(this, "Longpress: " + ( info.position + 1 ), Toast.LENGTH_SHORT).show(); + return true; + } + + public class ImageAdapter extends BaseAdapter { + int mGalleryItemBackground; + private Context mContext; + + private Integer[] mImageIds = { + R.drawable.wilson1, + R.drawable.wilson2 + }; + + public ImageAdapter( Context context ) { + mContext = context; + TypedArray attr = mContext.obtainStyledAttributes( R.styleable.Viewer ); + mGalleryItemBackground = attr.getResourceId( R.styleable.Viewer_android_galleryItemBackground, 0 ); + attr.recycle(); + } + + public int getCount() { +// return c.getCount(); + return mImageIds.length; + } + + public Object getItem( int position ) { + return position; + } + + public long getItemId( int position ) { + return position; + } + + + public View getView( int position, View convertView, ViewGroup parent ) { + + ImageView imageView = new ImageView(mContext); + +// // Move cursor to current position +// c.moveToPosition(position); +// +// // Get the current value for the requested column +// int imageID = c.getInt(columnIndex); +// +// // Obtain the image URI +// Uri uri = Uri.withAppendedPath( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, Integer.toString( imageID ) ); +// +// // Set the content of the image based on the image URI +// imageView.setImageURI( uri ); + + // Set content of the image from resources + imageView.setImageResource( mImageIds[position] ); + + imageView.setLayoutParams( new LayoutParams( LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT ) ); + imageView.setScaleType( ImageView.ScaleType.FIT_CENTER ); + + return imageView; + } + } + +} + From ryan1234 at crosswire.org Wed Feb 29 20:24:43 2012 From: ryan1234 at crosswire.org (ryan1234 at crosswire.org) Date: Wed, 29 Feb 2012 20:24:43 -0700 Subject: [Tynstep-svn] r235 - tags Message-ID: Author: ryan1234 Date: 2012-02-29 20:24:42 -0700 (Wed, 29 Feb 2012) New Revision: 235 Added: tags/step-ui-temp/ Log: From ryan1234 at crosswire.org Wed Feb 29 20:26:31 2012 From: ryan1234 at crosswire.org (ryan1234 at crosswire.org) Date: Wed, 29 Feb 2012 20:26:31 -0700 Subject: [Tynstep-svn] r236 - in tags: . step-0.2/step-core step-0.2/step-web step-0.2/step-web/src/main/webapp step-0.2/step-web/src/main/webapp/css step-0.2/step-web/src/main/webapp/js Message-ID: Author: ryan1234 Date: 2012-02-29 20:26:31 -0700 (Wed, 29 Feb 2012) New Revision: 236 Added: tags/step-0.2/ Modified: tags/step-0.2/step-core/pom.xml tags/step-0.2/step-web/db-create.sql tags/step-0.2/step-web/db-drop.sql tags/step-0.2/step-web/src/main/webapp/css/initial-layout.css tags/step-0.2/step-web/src/main/webapp/index.html tags/step-0.2/step-web/src/main/webapp/js/init.js tags/step-0.2/step-web/src/main/webapp/js/lexicon_definition.js tags/step-0.2/step-web/src/main/webapp/js/timeline.js tags/step-0.2/step-web/src/main/webapp/js/ui_hooks.js tags/step-0.2/step-web/src/main/webapp/panemenu.html Log: >From Ryan M. Started to work on the UI for STEP - specifically with the timeline feature. Creating a separate copy of the source with a tag just for testing. Modified: tags/step-0.2/step-core/pom.xml =================================================================== --- trunk/step/step-core/pom.xml 2011-05-16 21:16:25 UTC (rev 232) +++ tags/step-0.2/step-core/pom.xml 2012-03-01 03:26:31 UTC (rev 236) @@ -81,10 +81,14 @@ jsword + org.crosswire.common.util + jsword-common + 1.6 + + org.jdom jdom - commons-lang commons-lang Modified: tags/step-0.2/step-web/db-create.sql =================================================================== --- trunk/step/step-web/db-create.sql 2011-05-16 21:16:25 UTC (rev 232) +++ tags/step-0.2/step-web/db-create.sql 2012-03-01 03:26:31 UTC (rev 236) @@ -5,6 +5,18 @@ constraint pk_bookmark primary key (id)) ; +create table geo_place ( + id integer not null, + esv_name varchar(255), + root varchar(255), + latitude double(17), + longitude double(17), + comment varchar(255), + precision integer, + constraint ck_geo_place_precision check (precision in (0,1,2)), + constraint pk_geo_place primary key (id)) +; + create table history ( id integer not null, history_reference varchar(255) not null, @@ -23,30 +35,28 @@ constraint pk_hot_spot primary key (id)) ; +create table relational_person ( + id integer not null, + name varchar(255), + father_id integer, + mother_id integer, + code varchar(255), + constraint uq_relational_person_code unique (code), + constraint pk_relational_person primary key (id)) +; + create table scripture_reference ( - scripture_reference_id integer not null, - target_id integer, + id integer not null, + geo_place_id integer, + timeline_event_id integer, + relational_person_id integer, target_type integer, start_verse_id integer, end_verse_id integer, - constraint ck_scripture_reference_target_type check (target_type in (0)), - constraint pk_scripture_reference primary key (scripture_reference_id)) + constraint ck_scripture_reference_target_type check (target_type in (0,1)), + constraint pk_scripture_reference primary key (id)) ; -create table scripture_target ( - targetTypeId integer(31) not null, - id integer not null, - summary varchar(255), - from_date bigint, - to_date bigint, - from_precision integer, - to_precision integer, - hot_spot_id integer, - constraint ck_scripture_target_from_precision check (from_precision in (0,1,2,3)), - constraint ck_scripture_target_to_precision check (to_precision in (0,1,2,3)), - constraint pk_scripture_target primary key (id)) -; - create table session ( id integer not null, j_session_id varchar(255), @@ -65,29 +75,47 @@ constraint pk_timeband primary key (id)) ; +create table timeline_event ( + id integer not null, + summary varchar(255), + from_date timestamp, + to_date timestamp, + from_precision integer, + to_precision integer, + hot_spot_id integer, + constraint ck_timeline_event_from_precision check (from_precision in (0,1,2,3)), + constraint ck_timeline_event_to_precision check (to_precision in (0,1,2,3)), + constraint pk_timeline_event primary key (id)) +; + create table users ( id integer not null, name varchar(255), - password varchar(255), - email_address varchar(255), + password varbinary(255) not null, + salt varbinary(255) not null, + email_address varchar(255) not null, country varchar(255), constraint pk_users primary key (id)) ; create sequence bookmark_seq; +create sequence geo_place_seq; + create sequence history_seq; create sequence hot_spot_seq; +create sequence relational_person_seq; + create sequence scripture_reference_seq; -create sequence scripture_target_seq; - create sequence session_seq; create sequence timeband_seq; +create sequence timeline_event_seq; + create sequence users_seq; alter table bookmark add constraint fk_bookmark_user_1 foreign key (user_id) references users (id) on delete restrict on update restrict; @@ -96,11 +124,19 @@ create index ix_history_user_2 on history (user_id); alter table hot_spot add constraint fk_hot_spot_timeband_3 foreign key (timeband_id) references timeband (id) on delete restrict on update restrict; create index ix_hot_spot_timeband_3 on hot_spot (timeband_id); -alter table scripture_reference add constraint fk_scripture_reference_target_4 foreign key (target_id) references scripture_target (id) on delete restrict on update restrict; -create index ix_scripture_reference_target_4 on scripture_reference (target_id); -alter table scripture_target add constraint fk_scripture_target_hotSpot_5 foreign key (hot_spot_id) references hot_spot (id) on delete restrict on update restrict; -create index ix_scripture_target_hotSpot_5 on scripture_target (hot_spot_id); -alter table session add constraint fk_session_user_6 foreign key (user_id) references users (id) on delete restrict on update restrict; -create index ix_session_user_6 on session (user_id); +alter table relational_person add constraint fk_relational_person_father_4 foreign key (father_id) references relational_person (id) on delete restrict on update restrict; +create index ix_relational_person_father_4 on relational_person (father_id); +alter table relational_person add constraint fk_relational_person_mother_5 foreign key (mother_id) references relational_person (id) on delete restrict on update restrict; +create index ix_relational_person_mother_5 on relational_person (mother_id); +alter table scripture_reference add constraint fk_scripture_reference_geoPlac_6 foreign key (geo_place_id) references geo_place (id) on delete restrict on update restrict; +create index ix_scripture_reference_geoPlac_6 on scripture_reference (geo_place_id); +alter table scripture_reference add constraint fk_scripture_reference_timelin_7 foreign key (timeline_event_id) references timeline_event (id) on delete restrict on update restrict; +create index ix_scripture_reference_timelin_7 on scripture_reference (timeline_event_id); +alter table scripture_reference add constraint fk_scripture_reference_relatio_8 foreign key (relational_person_id) references relational_person (id) on delete restrict on update restrict; +create index ix_scripture_reference_relatio_8 on scripture_reference (relational_person_id); +alter table session add constraint fk_session_user_9 foreign key (user_id) references users (id) on delete restrict on update restrict; +create index ix_session_user_9 on session (user_id); +alter table timeline_event add constraint fk_timeline_event_hotSpot_10 foreign key (hot_spot_id) references hot_spot (id) on delete restrict on update restrict; +create index ix_timeline_event_hotSpot_10 on timeline_event (hot_spot_id); Modified: tags/step-0.2/step-web/db-drop.sql =================================================================== --- trunk/step/step-web/db-drop.sql 2011-05-16 21:16:25 UTC (rev 232) +++ tags/step-0.2/step-web/db-drop.sql 2012-03-01 03:26:31 UTC (rev 236) @@ -2,35 +2,43 @@ drop table if exists bookmark; +drop table if exists geo_place; + drop table if exists history; drop table if exists hot_spot; +drop table if exists relational_person; + drop table if exists scripture_reference; -drop table if exists scripture_target; - drop table if exists session; drop table if exists timeband; +drop table if exists timeline_event; + drop table if exists users; SET REFERENTIAL_INTEGRITY TRUE; drop sequence if exists bookmark_seq; +drop sequence if exists geo_place_seq; + drop sequence if exists history_seq; drop sequence if exists hot_spot_seq; +drop sequence if exists relational_person_seq; + drop sequence if exists scripture_reference_seq; -drop sequence if exists scripture_target_seq; - drop sequence if exists session_seq; drop sequence if exists timeband_seq; +drop sequence if exists timeline_event_seq; + drop sequence if exists users_seq; Modified: tags/step-0.2/step-web/src/main/webapp/css/initial-layout.css =================================================================== --- trunk/step/step-web/src/main/webapp/css/initial-layout.css 2011-05-16 21:16:25 UTC (rev 232) +++ tags/step-0.2/step-web/src/main/webapp/css/initial-layout.css 2012-03-01 03:26:31 UTC (rev 236) @@ -176,12 +176,60 @@ #bottomSection { height: 0px; position: absolute; - bottom: 0px; + bottom: 5px; left: 0px; - width: 100%; + width: 99%; + border: 1px solid #000; + margin-left: 5px; + margin-right: 5px; + display: none; } +#bottomSection > div +{ + width: 100%; + background-color: #147000; + color: #fff; + text-align: right; +} +/* Close button */ +#bottomSection > div span +{ + cursor: pointer; + margin: 5px; +} + +#bottomSection #leftArrow +{ + height: 105px; + width: 20px; + background-color: #fff; + border: 1px solid #ccc; + position: absolute; + top: 28px; + left: 0px; + z-index: 9999; + font-size: 30px; + color: #ccc; + padding-top: 70px; +} + +#bottomSection #rightArrow +{ + height: 105px; + width: 20px; + background-color: #fff; + border: 1px solid #ccc; + position: absolute; + top: 28px; + right: 0px; + z-index: 9999; + font-size: 30px; + color: #ccc; + padding-top: 70px; +} + .no-left-border { /* border-left: none; */ margin-left: -1px; @@ -255,8 +303,11 @@ width: 100%; } +/**************************/ +/* LEXICON DEFINITION +/**************************/ #lexiconDefinition { - display: inline-block; + display: none; z-index: 9999; width: 400px; bottom: 0px; @@ -264,6 +315,13 @@ left: -1000px; } +#lexiconPopupClose +{ + float: right; + padding-top: 4px; + padding-right: 4px; + cursor: pointer; +} /**************************/ /* LOGIN POPUP /**************************/ Modified: tags/step-0.2/step-web/src/main/webapp/index.html =================================================================== --- trunk/step/step-web/src/main/webapp/index.html 2011-05-16 21:16:25 UTC (rev 232) +++ tags/step-0.2/step-web/src/main/webapp/index.html 2012-03-01 03:26:31 UTC (rev 236) @@ -88,8 +88,8 @@

Add a bookmark - - + +
@@ -97,7 +97,17 @@ -
No modules have yet been loaded.
+
+
+ + Close +
+
<
+
+ No modules have yet been loaded. +
+
>
+
Modified: tags/step-0.2/step-web/src/main/webapp/js/init.js =================================================================== --- trunk/step/step-web/src/main/webapp/js/init.js 2011-05-16 21:16:25 UTC (rev 232) +++ tags/step-0.2/step-web/src/main/webapp/js/init.js 2012-03-01 03:26:31 UTC (rev 236) @@ -30,7 +30,7 @@ var topMenuHeight = $("#topMenu").height(); var headingContainerHeight = $(".headingContainer").height(); var imageAndFooterHeight = $(".northBookmark").height() + $(".logo").height(); - var bottomSectionHeight = $("#bottomSection").height(); + var bottomSectionHeight = $("#bottomSection").height() + 100; var windowWithoutMenuNorModule = windowHeight - topMenuHeight - bottomSectionHeight; var columnHeight = windowWithoutMenuNorModule; var bookmarkHeight = windowWithoutMenuNorModule - imageAndFooterHeight ; @@ -263,11 +263,11 @@ } /** - * initialises the modules + * initialises the modules * @param passages a list of passages that were provided */ function initModules(passages) { - var bottomSection = $("#bottomSection"); + var bottomSection = $("#bottomSectionContent"); new TimelineWidget(bottomSection); new GeographyWidget(bottomSection, passages); Modified: tags/step-0.2/step-web/src/main/webapp/js/lexicon_definition.js =================================================================== --- trunk/step/step-web/src/main/webapp/js/lexicon_definition.js 2011-05-16 21:16:25 UTC (rev 232) +++ tags/step-0.2/step-web/src/main/webapp/js/lexicon_definition.js 2012-03-01 03:26:31 UTC (rev 236) @@ -13,13 +13,17 @@ LexiconDefinition.prototype.getPopup = function() { if(this.popup) { + this.popup.css('display', 'inline-block'); return this.popup; } //create the popup container - $("body").append("
    "); + $("body").append("
      X
    "); this.popup = $("#lexiconDefinition"); this.popup.tabs().draggable(); + $('#lexiconPopupClose').click(function() { + $('#lexiconDefinition').hide(); + }); return this.popup; } Modified: tags/step-0.2/step-web/src/main/webapp/js/timeline.js =================================================================== --- trunk/step/step-web/src/main/webapp/js/timeline.js 2011-05-16 21:16:25 UTC (rev 232) +++ tags/step-0.2/step-web/src/main/webapp/js/timeline.js 2012-03-01 03:26:31 UTC (rev 236) @@ -54,6 +54,8 @@ } } +var tl2; + TimelineWidget.prototype.onLoad = function() { var zones = []; this.theme = Timeline.ClassicTheme.create(); @@ -67,7 +69,8 @@ var bands = self.getBands(json.events); if(!self.tl) { - self.tl = Timeline.create(self.rootElement[0], bands, Timeline.HORIZONTAL); + self.tl = Timeline.create(self.rootElement[0], bands, Timeline.HORIZONTAL); + tl2 = self.tl; } // bands[0].eventSource.loadJSON(json, TIMELINE_GET_EVENTS_IN_PERIOD +"-101690000000000/-101580000000000"); @@ -87,6 +90,8 @@ var date = "-1250"; var zones = []; + var i = 0; + $.each(events, function(index, event) { //TODO this can be optmized, since we are re-creating the uiTimebands every time var hotspot = self.hotspots[event.hotSpotId]; @@ -97,7 +102,7 @@ if(obtained[hotspot.timebandId] == null) { obtained[hotspot.timebandId] = true; var bandInfo = Timeline.createBandInfo({ - width: "50px", + width: "180px", trackGap: 0.2, trackHeight: 0.5, intervalUnit: unit, @@ -110,12 +115,17 @@ }); bandInfo.stepTimebandId = hotspot.timebandId; - uiTimebands.push( bandInfo ); + + if (i == 2) + { + uiTimebands.push( bandInfo ); + } } } + + i++; }); - -// alert(uiTimebands); + return uiTimebands; } @@ -139,8 +149,9 @@ return band.stepTimebandId == hotspot.timebandId; }); -// alert(eventsOnBand.length); - band.eventSource.loadJSON({ dateTimeFormat: json.dateTimeFormat, events: eventsOnBand }, TIMELINE_GET_EVENTS_IN_PERIOD +"-101690000000000/-101580000000000"); + + band.eventSource.loadJSON({ dateTimeFormat: json.dateTimeFormat, events: eventsOnBand }, + TIMELINE_GET_EVENTS_IN_PERIOD +"-101690000000000/-101580000000000"); }); }; @@ -177,4 +188,63 @@ self.tl.layout(); }, 500); } +} + +/* Overriding the fill in bubble from the timeline library. */ +Timeline.DefaultEventSource.Event.prototype.fillInfoBubble = function (elmt, theme, labeller) { + var start = new Date(this.getStart()); + start = (start.getFullYear() < 0) ? Math.abs(start.getFullYear()) + " BC" : start.getFullYear() + " AD"; + + var end = new Date(this.getEnd()); + end = (end.getFullYear() < 0) ? Math.abs(end.getFullYear()) + " BC" : end.getFullYear() + " AD"; + + var doc = elmt.ownerDocument; + var title = this.getText(); + var link = this.getLink(); + var image = this.getImage(); + + if (image != null) { + var img = doc.createElement("img"); + img.src = image; + theme.event.bubble.imageStyler(img); + elmt.appendChild(img); + } + var divTitle = doc.createElement("div"); + var textTitle = doc.createTextNode(title); + if (link != null) { + var a = doc.createElement("a"); + a.href = link; + a.appendChild(textTitle); + divTitle.appendChild(a); + } else { + divTitle.appendChild(textTitle); + } + theme.event.bubble.titleStyler(divTitle); + elmt.appendChild(divTitle); + var divBody = doc.createElement("div"); + this.fillDescription(divBody); + theme.event.bubble.bodyStyler(divBody); + elmt.appendChild(divBody); + // This is where they define the times in the bubble + var divTime = doc.createElement("div"); + divTime.innerHTML = start + " - " + end; + elmt.appendChild(divTime); + var divWiki = doc.createElement("div"); + this.fillWikiInfo(divWiki); + theme.event.bubble.wikiStyler(divWiki); + elmt.appendChild(divWiki); +} + +function TimelineLeftArrow() +{ + var band = tl2.getBand(0); + var newDate = Timeline.DateTime.parseGregorianDateTime(band.getMinVisibleDate().getFullYear() - 300); + band.scrollToCenter(newDate); +} + +function TimelineRightArrow() +{ + var band = tl2.getBand(0); + var newDate = Timeline.DateTime.parseGregorianDateTime(band.getMaxVisibleDate().getFullYear() + 300); + band.scrollToCenter(newDate); } \ No newline at end of file Modified: tags/step-0.2/step-web/src/main/webapp/js/ui_hooks.js =================================================================== --- trunk/step/step-web/src/main/webapp/js/ui_hooks.js 2011-05-16 21:16:25 UTC (rev 232) +++ tags/step-0.2/step-web/src/main/webapp/js/ui_hooks.js 2012-03-01 03:26:31 UTC (rev 236) @@ -125,8 +125,8 @@ /** * Shows the timeline module */ -function showTimelineModule() { - showBottomSection(); +function showTimelineModule(menuItem) { + showBottomSection(menuItem); $.shout("show-timeline"); }; @@ -141,8 +141,35 @@ /** * shows the bottom section */ -function showBottomSection() { +function showBottomSection(menuItem) { + if (getPassageId(menuItem) == 0) + { + var verse = $('#leftPassageReference').val(); + $('#timelineContext').html(verse); + } + else + { + var verse = $('#rightPassageReference').val(); + $('#timelineContext').html(verse); + } + var bottomSection = $("#bottomSection"); - bottomSection.height(bottomSection.parent().parent().height() / 2); + var bottomSectionContent = $("#bottomSectionContent"); + + bottomSection.show(); + bottomSection.height(250); + bottomSectionContent.height(225); + refreshLayout(); } + +function hideBottomSection() { + var bottomSection = $("#bottomSection"); + var bottomSectionContent = $("#bottomSectionContent"); + + bottomSection.hide(); + bottomSection.height(0); + bottomSectionContent.height(0); + + refreshLayout(); +} Modified: tags/step-0.2/step-web/src/main/webapp/panemenu.html =================================================================== --- trunk/step/step-web/src/main/webapp/panemenu.html 2011-05-16 21:16:25 UTC (rev 232) +++ tags/step-0.2/step-web/src/main/webapp/panemenu.html 2012-03-01 03:26:31 UTC (rev 236) @@ -10,7 +10,7 @@
  • Context