Skip to content

Commit

Permalink
move to 6.0.0
Browse files Browse the repository at this point in the history
lint
  • Loading branch information
hkollmann committed Feb 5, 2021
1 parent 19bea1c commit e7ed74b
Show file tree
Hide file tree
Showing 21 changed files with 237 additions and 294 deletions.
4 changes: 2 additions & 2 deletions Manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
]
},
"requires": {
"@qooxdoo/compiler": "^1.0.0-beta",
"@qooxdoo/framework": "^6.0.0-beta"
"@qooxdoo/compiler": "^1.0.0",
"@qooxdoo/framework": "^6.0.0"
}
}
6 changes: 2 additions & 4 deletions source/class/qxl/mobileshowcase/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ qx.Class.define("qxl.mobileshowcase.Application",
* This method contains the initial application code and gets called
* during startup of the application
*/
main : function()
{
main : function() {
// Call super class
this.base(arguments);

// Enable logging in debug variant
if (qx.core.Environment.get("qx.debug"))
{
if (qx.core.Environment.get("qx.debug")) {
// support native logging capabilities, e.g. Firebug for Firefox
qx.log.appender.Native;
}
Expand Down
6 changes: 2 additions & 4 deletions source/class/qxl/mobileshowcase/page/Abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ qx.Class.define("qxl.mobileshowcase.page.Abstract",
{
extend : qx.ui.mobile.page.NavigationPage,

construct : function(wrapContentByGroup)
{
construct : function(wrapContentByGroup) {
this.base(arguments, wrapContentByGroup);
this.setShowBackButton(true);
this.setBackButtonText("Back");
Expand All @@ -34,8 +33,7 @@ qx.Class.define("qxl.mobileshowcase.page.Abstract",
members :
{
// overridden
_back : function()
{
_back : function() {
qx.core.Init.getApplication().getRouting().back();
}
}
Expand Down
11 changes: 4 additions & 7 deletions source/class/qxl/mobileshowcase/page/Animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ qx.Class.define("qxl.mobileshowcase.page.Animation",
{
extend : qxl.mobileshowcase.page.Abstract,

construct : function()
{
construct : function() {
this.base(arguments);
this.setTitle("Page Transitions");
},
Expand Down Expand Up @@ -59,13 +58,11 @@ qx.Class.define("qxl.mobileshowcase.page.Animation",
members :
{
// overridden
_initialize : function()
{
_initialize : function() {
this.base(arguments);

var list = new qx.ui.mobile.list.List({
configureItem : function(item, data, row)
{
configureItem : function(item, data, row) {
item.setTitle(data.title);
item.setShowArrow(true);
}
Expand All @@ -85,4 +82,4 @@ qx.Class.define("qxl.mobileshowcase.page.Animation",
this.getContent().add(list);
}
}
});
});
11 changes: 4 additions & 7 deletions source/class/qxl/mobileshowcase/page/AnimationLanding.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ qx.Class.define("qxl.mobileshowcase.page.AnimationLanding",
{
extend : qxl.mobileshowcase.page.Abstract,

construct : function()
{
construct : function() {
this.base(arguments, true);
this.setTitle("Page Transitions");
this.setShowBackButtonOnTablet(true);
Expand All @@ -47,8 +46,7 @@ qx.Class.define("qxl.mobileshowcase.page.AnimationLanding",
members :
{
// overridden
_initialize : function()
{
_initialize : function() {
this.base(arguments);


Expand Down Expand Up @@ -86,9 +84,8 @@ qx.Class.define("qxl.mobileshowcase.page.AnimationLanding",


// overridden
_back : function()
{
_back : function() {
qx.core.Init.getApplication().getRouting().executeGet("/animation", {animation:this.getAnimation(), reverse:true});
}
}
});
});
8 changes: 3 additions & 5 deletions source/class/qxl/mobileshowcase/page/Basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ qx.Class.define("qxl.mobileshowcase.page.Basic",
{
extend : qxl.mobileshowcase.page.Abstract,

construct : function()
{
construct : function() {
this.base(arguments, false);
this.setTitle("Basic Widgets");
this._widgets = [];
Expand All @@ -43,8 +42,7 @@ qx.Class.define("qxl.mobileshowcase.page.Basic",
_widgets : null,

// overridden
_initialize : function()
{
_initialize : function() {
this.base(arguments);

// BASIC WIDGET CHANGE MENU
Expand Down Expand Up @@ -111,7 +109,7 @@ qx.Class.define("qxl.mobileshowcase.page.Basic",

this.getContent().add(new qx.ui.mobile.form.Title("ToggleButton"));

var toggleButtonGroup = new qx.ui.mobile.form.Group;
var toggleButtonGroup = new qx.ui.mobile.form.Group();
toggleButtonGroup.add(exToggleButton);
this.getContent().add(toggleButtonGroup);

Expand Down
42 changes: 22 additions & 20 deletions source/class/qxl/mobileshowcase/page/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",
{
extend : qxl.mobileshowcase.page.Abstract,

construct : function()
{
this.base(arguments,false);
construct : function() {
this.base(arguments, false);
this.setTitle("Canvas");
this.__ratio = qx.core.Environment.get("device.pixelRatio");
},
Expand All @@ -45,8 +44,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",


// overridden
_initialize : function()
{
_initialize : function() {
this.base(arguments);

this.__lastPoint = {};
Expand All @@ -73,8 +71,8 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",

canvas.setWidth(this._to(this.__canvasSize));
canvas.setHeight(this._to(this.__canvasSize));
qx.bom.element.Style.set(canvas.getContentElement(),"width", this.__canvasSize + "px");
qx.bom.element.Style.set(canvas.getContentElement(),"height", this.__canvasSize + "px");
qx.bom.element.Style.set(canvas.getContentElement(), "width", this.__canvasSize + "px");
qx.bom.element.Style.set(canvas.getContentElement(), "height", this.__canvasSize + "px");

this.getContent().add(canvas);

Expand All @@ -89,9 +87,10 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",


/**
* Calculates the correct position in relation to the device pixel ratio.
* @return {Number} the correct position.
*/
* Calculates the correct position in relation to the device pixel ratio.
* @param value
* @return {Number} the correct position.
*/
_to : function(value) {
return value * this.__ratio;
},
Expand All @@ -103,12 +102,12 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",
_drawExample : function() {
// Comment in Text
var ctx = this.__canvas.getContext2d();
ctx.fillStyle = 'gray';
ctx.font = 'bold '+this._to(16)+'px Helvetica';
ctx.fillText('Start drawing here ...', this._to(15), this._to(25));
ctx.fillStyle = "gray";
ctx.font = "bold "+this._to(16)+"px Helvetica";
ctx.fillText("Start drawing here ...", this._to(15), this._to(25));

// Smiley
ctx.strokeStyle = '#3D72C9';
ctx.strokeStyle = "#3D72C9";
ctx.beginPath();
ctx.arc(475, 85, 50, 0, Math.PI * 2, true);
ctx.moveTo(510, 85);
Expand Down Expand Up @@ -136,6 +135,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",

/**
* Handles the <code>trackstart</code> event on canvas.
* @param evt
*/
_onTrackStart : function(evt) {
this.__canvasLeft = qx.bom.element.Location.getLeft(this.__canvas.getContentElement(), "padding");
Expand All @@ -147,6 +147,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",

/**
* Handles the <code>track</code> event on canvas.
* @param evt
*/
_onTrack : function(evt) {
this.__draw(evt);
Expand All @@ -157,6 +158,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",

/**
* Handles the <code>trackend</code> event on canvas.
* @param evt
*/
_onTrackEnd : function(evt) {
this.__lastPoint = {};
Expand All @@ -165,6 +167,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",

/**
* Draws the line on canvas.
* @param evt
*/
__draw: function(evt) {
var ctx = this.__canvas.getContext2d();
Expand All @@ -177,14 +180,14 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",

if (lastPoint) {
ctx.beginPath();
ctx.lineCap = 'round';
ctx.lineCap = "round";
ctx.moveTo(this._to(lastPoint.x), this._to(lastPoint.y));
ctx.lineTo(this._to(pointerLeft), this._to(pointerTop));

var deltaX = Math.abs(lastPoint.x - pointerLeft);
var deltaY = Math.abs(lastPoint.y - pointerTop);

var velocity = Math.sqrt(Math.pow(deltaX ,2) + Math.pow(deltaY ,2));
var velocity = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));

opacity = (100 - velocity) / 100;
opacity = Math.round(opacity * Math.pow(10, 2)) / Math.pow(10, 2);
Expand All @@ -198,8 +201,8 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",

// linear gradient from start to end of line
var grad = ctx.createLinearGradient(lastPoint.x, lastPoint.y, pointerLeft, pointerTop);
grad.addColorStop(0, 'rgba(61,114,201,' + lastPoint.opacity + ')');
grad.addColorStop(1, 'rgba(61,114,201,' + opacity + ')');
grad.addColorStop(0, "rgba(61,114,201," + lastPoint.opacity + ")");
grad.addColorStop(1, "rgba(61,114,201," + opacity + ")");
ctx.strokeStyle = grad;

ctx.lineWidth = this._to(1.5);
Expand All @@ -216,8 +219,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas",
},


destruct : function()
{
destruct : function() {
this._disposeObjects();
}

Expand Down
17 changes: 8 additions & 9 deletions source/class/qxl/mobileshowcase/page/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ qx.Class.define("qxl.mobileshowcase.page.Carousel",
{
extend : qxl.mobileshowcase.page.Abstract,

construct : function()
{
construct : function() {
this.base(arguments);
this.setTitle("Carousel");
},
Expand Down Expand Up @@ -58,18 +57,18 @@ qx.Class.define("qxl.mobileshowcase.page.Carousel",
nextButton.addListener("tap", function() {
setTimeout(function() {
carousel.nextPage();
}.bind(this), 0);
}, 0);
}, carousel);

var previousButton = new qx.ui.mobile.form.Button("Previous Page");
previousButton.addCssClass("example-button");
previousButton.addListener("tap", function() {
setTimeout(function() {
carousel.previousPage();
}.bind(this), 0);
}, 0);
}, carousel);

var page3group = new qx.ui.mobile.form.Group([previousButton,nextButton],false);
var page3group = new qx.ui.mobile.form.Group([previousButton, nextButton], false);
page3group.setLayout(new qx.ui.mobile.layout.HBox());
page3.add(page3group);

Expand All @@ -79,7 +78,7 @@ qx.Class.define("qxl.mobileshowcase.page.Carousel",

var page5 = new qx.ui.mobile.container.Composite();
page5.addCssClass("carousel-example-5");
page5.add(new qx.ui.mobile.basic.Label("You can add as many pages as you want."),{flex:1});
page5.add(new qx.ui.mobile.basic.Label("You can add as many pages as you want."), {flex:1});

var moreButton = new qx.ui.mobile.form.Button("Add more pages");
moreButton.addCssClass("example-button");
Expand All @@ -101,14 +100,14 @@ qx.Class.define("qxl.mobileshowcase.page.Carousel",
}
}, carousel);

var moreGroup = new qx.ui.mobile.form.Group([moreButton],false);
var moreGroup = new qx.ui.mobile.form.Group([moreButton], false);
moreGroup.setLayout(new qx.ui.mobile.layout.HBox());

page5.add(moreGroup);

var page6 = new qx.ui.mobile.container.Composite();
page6.addCssClass("carousel-example-6");
page6.add(new qx.ui.mobile.basic.Label("Previous page is shown when you swipe right."),{flex:1});
page6.add(new qx.ui.mobile.basic.Label("Previous page is shown when you swipe right."), {flex:1});

carousel.add(page1);
carousel.add(page2);
Expand All @@ -126,4 +125,4 @@ qx.Class.define("qxl.mobileshowcase.page.Carousel",
return null;
}
}
});
});
Loading

0 comments on commit e7ed74b

Please sign in to comment.