Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fayde loading progress #198

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b837098
Added video sources and media element
Ronmenator Aug 26, 2015
173331c
Video Tester
Ronmenator Aug 26, 2015
5ca983b
forgot to add timestamp to the draw function
Ronmenator Aug 26, 2015
c54f142
Merge remote-tracking branch 'wsick/master'
Ronmenator Aug 26, 2015
6d50347
Implemented SelectionOnFocus property for textbox
Ronmenator Aug 26, 2015
c78390f
Video Source Updater to invalidate
Ronmenator Aug 26, 2015
ae30277
Implementing getIsPlaying for IVideoSource. Removing side-effect code.
BSick7 Aug 27, 2015
afe1429
Setting pixel sizes when can play.
BSick7 Aug 27, 2015
9b45258
Change to video source, removed stretch for now
Ronmenator Aug 27, 2015
d213248
Removing selection-on-focus code from videos branch.
BSick7 Aug 27, 2015
8a4d65d
Adding protected to intentionally hidden methods. Matching new IImag…
BSick7 Aug 27, 2015
29f74d4
Fixing video sources.
BSick7 Aug 27, 2015
41e4ccd
Creating extensible ImageSource that VideoSource can utilize.
BSick7 Aug 27, 2015
5fb6142
Removing deleted interface.
BSick7 Aug 27, 2015
70f09dd
Converting VideoSourceBase to inherit from ImageSource.
BSick7 Aug 27, 2015
c91215b
Textbox copy and paste
Ronmenator Aug 28, 2015
b22433a
Update
Ronmenator Aug 28, 2015
ab124c5
selection-on-focus merge
Ronmenator Aug 28, 2015
df3f797
Videos merge
Ronmenator Aug 28, 2015
d109f6d
Version compile after merge
Ronmenator Aug 28, 2015
83958d0
Text Copy and Paste
Ronmenator Aug 29, 2015
d9ed986
merge from wsick/master
Ronmenator Aug 29, 2015
5158980
Copy and Paste functionality
Ronmenator Aug 29, 2015
32cf11e
Video
Ronmenator Sep 3, 2015
f10cfa2
Local changes
Ronmenator Oct 15, 2015
3a4ee83
Merge remote-tracking branch 'refs/remotes/wsick/master'
Nov 3, 2015
76f2d07
Merge remote-tracking branch 'refs/remotes/wsick/master'
Nov 3, 2015
f5d783d
comi
Nov 4, 2015
f66ea53
Fixed missing HorizontalAlignment and VerticalAlignment template bind…
Nov 24, 2015
9afe95c
Remove from version control
Nov 24, 2015
d094c64
Added closeProgress function to bootstrap. It will remove an HTML Ele…
Nov 24, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,039 changes: 0 additions & 6,039 deletions dist/fayde.d.ts

This file was deleted.

27,386 changes: 0 additions & 27,386 deletions dist/fayde.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/fayde.js.map

This file was deleted.

19 changes: 19 additions & 0 deletions dist/fayde.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/fayde.min.js.map

Large diffs are not rendered by default.

118 changes: 58 additions & 60 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,60 +1,58 @@
var gulp = require('gulp'),
taskListing = require('gulp-task-listing'),
fs = require('fs'),
typings = require('bower-typings'),
allTypings = typings(),
name = 'fayde',
meta = {
name: name,
src: [
'typings/*.d.ts',
'src/_Version.ts',
'src/perf/**/*.ts',
'src/polyfill/**/*.ts',
'src/_Types.ts',
'src/**/*.ts'
].concat(typings({includeSelf: false})),
scaffolds: [
{
name: 'test',
symdirs: ['dist', 'src', 'themes'],
src: [
'typings/*.d.ts',
'test/**/*.ts',
'!test/lib/**/*.ts',
'dist/' + name + '.d.ts'
].concat(allTypings)
},
{
name: 'testsite',
ignore: 'lib/qunit',
port: 7001,
symdirs: ['dist', 'src', 'themes'],
src: [
'typings/*.d.ts',
'testsite/**/*.ts',
'!testsite/lib/**/*.ts',
'dist/' + name + '.d.ts'
].concat(allTypings)
},
{
name: 'stress',
ignore: 'lib/qunit',
port: 7002,
symdirs: ['dist', 'src', 'themes'],
src: [
'typings/*.d.ts',
'stress/**/*.ts',
'!stress/lib/**/*.ts',
'dist/' + name + '.d.ts'
].concat(allTypings)
}
]
};

gulp.task('help', taskListing);

fs.readdirSync('./gulp')
.forEach(function (file) {
require('./gulp/' + file)(meta);
});
var gulp = require('gulp'),
taskListing = require('gulp-task-listing'),
fs = require('fs'),
typings = require('bower-typings'),
allTypings = typings(),
name = 'fayde',
meta = {
name: name,
src: [
'typings/*.d.ts',
'src/_Version.ts',
'src/perf/**/*.ts',
'src/polyfill/**/*.ts',
'src/_Types.ts',
'src/**/*.ts'
].concat(typings({
includeSelf: false
})),
scaffolds: [{
name: 'test',
symdirs: ['dist', 'src', 'themes'],
src: [
'typings/*.d.ts',
'test/**/*.ts',
'!test/lib/**/*.ts',
'dist/' + name + '.d.ts'
].concat(allTypings)
}, {
name: 'testsite',
ignore: 'lib/qunit',
port: 7001,
symdirs: ['dist', 'src', 'themes'],
src: [
'typings/*.d.ts',
'testsite/**/*.ts',
'!testsite/lib/**/*.ts',
'dist/' + name + '.d.ts'
].concat(allTypings)
}, {
name: 'stress',
ignore: 'lib/qunit',
port: 7002,
symdirs: ['dist', 'src', 'themes'],
src: [
'typings/*.d.ts',
'stress/**/*.ts',
'!stress/lib/**/*.ts',
'dist/' + name + '.d.ts'
].concat(allTypings)
}]
};

gulp.task('help', taskListing);

fs.readdirSync('./gulp')
.forEach(function(file) {
require('./gulp/' + file)(meta);
});
2 changes: 1 addition & 1 deletion src/Controls/Border.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ module Fayde.Controls {
upd.updateBounds();
upd.invalidateMeasure();
}, false, false);
}
}
11 changes: 6 additions & 5 deletions src/Controls/TextBoxBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module Fayde.Controls {
static SelectionStartProperty = DependencyProperty.RegisterFull("SelectionStart", () => Number, TextBoxBase, 0, undefined, undefined, true, positiveIntValidator);
static BaselineOffsetProperty = DependencyProperty.Register("BaselineOffset", () => Number, TextBoxBase);
static MaxLengthProperty = DependencyProperty.RegisterFull("MaxLength", () => Number, TextBoxBase, 0, undefined, undefined, undefined, positiveIntValidator);
static SelectionOnFocusProperty = DependencyProperty.Register("SelectionOnFocus", () => new Enum(SelectionOnFocus), TextBoxBase, SelectionOnFocus.Default);

CaretBrush: Media.Brush;
SelectionForeground: Media.Brush;
Expand Down Expand Up @@ -248,6 +247,8 @@ module Fayde.Controls {
switch (args.Key) {
case Key.A:
//Ctrl+A => Select All
if (isReadOnly)
break;
handled = true;
proxy.selectAll();
break;
Expand Down Expand Up @@ -280,10 +281,10 @@ module Fayde.Controls {
break;
case Key.Z:
//Ctrl+Z => Undo
if (!isReadOnly) {
handled = true;
proxy.undo();
}
if (isReadOnly)
break;
handled = true;
proxy.undo();
break;
}
}
Expand Down
96 changes: 96 additions & 0 deletions src/Controls/Video.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
module Fyade.Controls {
import Input = Fayde.Input;
import Control = Fayde.Controls.Control;
import Media = Fayde.Media;
import DependencyObject = Fayde.DependencyObject;
import MediaElement = Fayde.Controls.MediaElement;
import Uri = Fayde.Uri;
import Enum = Fayde.Enum;
import Button = Fayde.Controls.Button;
import ProgressBar = Fayde.Controls.ProgressBar;
import DpReaction = Fayde.DPReaction;

export class Video extends Control {
private Media: MediaElement;
private PlayButton: Button;
private PauseButton: Button;
private PlayProgress: ProgressBar;
private BufferProgress: ProgressBar;

private static _SourceCoercer(d: DependencyObject, propd: DependencyProperty, value: any): any {
if (typeof value === "string")
return new Media.Videos.VideoSource(new Uri(value));
if (value instanceof Uri)
return new Media.Videos.VideoSource(value);
return value;
}

static SourceProperty = DependencyProperty.RegisterFull("Source", () => Media.Videos.VideoSource, Video, undefined, undefined, Video._SourceCoercer);
static StretchProperty = DependencyProperty.RegisterCore("Stretch", () => new Enum(Media.Stretch), Video, Media.Stretch.Uniform);
Source: Media.Videos.VideoSource;
Stretch: Media.Stretch;

constructor() {
super();
this.DefaultStyleKey = Video;
}

OnApplyTemplate() {
super.OnApplyTemplate();
this.Media = <MediaElement>this.GetTemplateChild("PARTVideo", MediaElement);
this.PlayButton = <Button>this.GetTemplateChild("PARTPlayButton", Button);
this.PauseButton = <Button>this.GetTemplateChild("PARTPauseButton", Button);
this.PlayProgress = <ProgressBar>this.GetTemplateChild("PARTPlayProgress", ProgressBar);
this.BufferProgress = <ProgressBar>this.GetTemplateChild("PARTBufferProgress", ProgressBar);

if (this.PlayButton)
this.PlayButton.Command = new Fayde.MVVM.RelayCommand(par => this.PlayClicked(par));
if (this.PauseButton)
this.PauseButton.Command = new Fayde.MVVM.RelayCommand(par => this.PauseClicked(par));
}

OnMouseEnter(e: Input.MouseEventArgs) {
super.OnMouseEnter(e);
this.UpdateVisualState();
}

OnMouseLeave(e: Input.MouseEventArgs) {
super.OnMouseLeave(e);
this.UpdateVisualState();
}

PlayClicked(par: any) {
this.Media.Play();
}

PauseClicked(par: any) {
this.Media.Pause();
}

SetSource(value: any) {
this.Source = value;
}
}

Fayde.CoreLibrary.add(Video);

Fayde.Controls.TemplateVisualStates(Video,
{ GroupName: "CommonStates", Name: "Normal" },
{ GroupName: "CommonStates", Name: "MouseOver" },
{ GroupName: "CommonStates", Name: "Disabled" });

Fayde.Controls.TemplateParts(Video,
{ Name: "PARTMedia", Type: MediaElement },
{ Name: "PARTPlayButton", Type: Button },
{ Name: "PARTPauseButton", Type: Button },
{ Name: "PARTPlayProgress", Type: ProgressBar },
{ Name: "PARTBufferProgress", Type: ProgressBar });

DpReaction<Media.Videos.VideoSource>(Video.SourceProperty, (vid: Video, ov, nv) => {
vid.SetSource(nv);
}, false);

DpReaction<minerva.Stretch>(Video.StretchProperty, (vid: Video, ov, nv) => {
vid.Stretch = nv;
}, false);
}
14 changes: 14 additions & 0 deletions src/Controls/WebBrowser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Fayde.Controls {
export class WebBrowser extends Controls.Control {

HTML

constructor() {
super();
}


}

Fayde.CoreLibrary.add(WebBrowser);
}
2 changes: 1 addition & 1 deletion src/Engine/InputManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module Fayde.Engine {
}

SetIsUserInitiatedEvent(value: boolean) {
this._Focus.EmitChanges()
this._Focus.EmitChanges();
this._State.IsFirstUserInitiated = this._State.IsFirstUserInitiated || value;
this._State.IsUserInitiated = value;
}
Expand Down
10 changes: 9 additions & 1 deletion src/Runtime/Bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ module Fayde {
loaded();
}

function closeProgress() {
var progressId = document.body.getAttribute("fayde-progress");
if (progressId) {
document.body.removeChild(document.getElementById(progressId));
}
}

function loaded() {
onLoaded && onLoaded(app);
perfex.phases.start('Running');
Expand All @@ -67,6 +74,7 @@ module Fayde {
.then(getApp, finishError)
.then(resolveTheme, finishError)
.then(resolveApp, finishError)
.then(startApp, finishError);
.then(startApp, finishError)
.then(closeProgress, finishError);
}
}
12 changes: 6 additions & 6 deletions testsite/IssueTests/TextViewModel.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class TextViewModel extends Fayde.MVVM.ViewModelBase {
OnTextChanged(args: Fayde.IEventBindingArgs<Fayde.RoutedEventArgs>) {
var tb = <Fayde.Controls.TextBox>args.sender;
console.log("Text Changed", tb.Text);
}
}
class TextViewModel extends Fayde.MVVM.ViewModelBase {
OnTextChanged(args: Fayde.IEventBindingArgs<Fayde.RoutedEventArgs>) {
var tb = <Fayde.Controls.TextBox>args.sender;
console.log("Text Changed", tb.Text);
}
}
export = TextViewModel;
4 changes: 2 additions & 2 deletions testsite/Overlay/basic.fap
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ToggleButton x:Name="Overlay1Toggle" Content="Open Overlay" />
<Overlay IsOpen="{Binding ElementName=Overlay1Toggle, Path=IsChecked, Mode=TwoWay}">
<Overlay.Visual>
<Border HorizontalAlignment="Center" VerticalAlignment="Center" Background="Yellow"
Width="300" Height="300">
<Border HorizontalAlignment="Stretch" VerticalAlignment="Center" Background="Yellow"
Height="300">
<TextBlock Text="Hi! I am an overlay." />
</Border>
</Overlay.Visual>
Expand Down
11 changes: 11 additions & 0 deletions testsite/videos/video.fap
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Application
xmlns="http://schemas.wsick.com/fayde"
xmlns:x="http://schemas.wsick.com/fayde/x"
xmlns:c="videos"
ThemeName="Metro">
<Grid x:Name="LayoutRoot">
<Video Source="http://localhost:7001/videos/test_movie.mp4"
Grid.Row="0"
x:Name="Video" />
</Grid>
</Application>
Loading