diff --git a/Manifest.json b/Manifest.json index 184acf14..f577d475 100644 --- a/Manifest.json +++ b/Manifest.json @@ -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" } } \ No newline at end of file diff --git a/source/class/qxl/mobileshowcase/Application.js b/source/class/qxl/mobileshowcase/Application.js index 27edac0d..65b21067 100644 --- a/source/class/qxl/mobileshowcase/Application.js +++ b/source/class/qxl/mobileshowcase/Application.js @@ -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; } diff --git a/source/class/qxl/mobileshowcase/page/Abstract.js b/source/class/qxl/mobileshowcase/page/Abstract.js index 1b4b7bc2..ba595e33 100644 --- a/source/class/qxl/mobileshowcase/page/Abstract.js +++ b/source/class/qxl/mobileshowcase/page/Abstract.js @@ -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"); @@ -34,8 +33,7 @@ qx.Class.define("qxl.mobileshowcase.page.Abstract", members : { // overridden - _back : function() - { + _back : function() { qx.core.Init.getApplication().getRouting().back(); } } diff --git a/source/class/qxl/mobileshowcase/page/Animation.js b/source/class/qxl/mobileshowcase/page/Animation.js index f4497b7e..306a1ad7 100644 --- a/source/class/qxl/mobileshowcase/page/Animation.js +++ b/source/class/qxl/mobileshowcase/page/Animation.js @@ -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"); }, @@ -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); } @@ -85,4 +82,4 @@ qx.Class.define("qxl.mobileshowcase.page.Animation", this.getContent().add(list); } } -}); \ No newline at end of file +}); diff --git a/source/class/qxl/mobileshowcase/page/AnimationLanding.js b/source/class/qxl/mobileshowcase/page/AnimationLanding.js index ef6901b1..5d3d8f79 100644 --- a/source/class/qxl/mobileshowcase/page/AnimationLanding.js +++ b/source/class/qxl/mobileshowcase/page/AnimationLanding.js @@ -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); @@ -47,8 +46,7 @@ qx.Class.define("qxl.mobileshowcase.page.AnimationLanding", members : { // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); @@ -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}); } } -}); \ No newline at end of file +}); diff --git a/source/class/qxl/mobileshowcase/page/Basic.js b/source/class/qxl/mobileshowcase/page/Basic.js index 25182d6e..53478ecc 100644 --- a/source/class/qxl/mobileshowcase/page/Basic.js +++ b/source/class/qxl/mobileshowcase/page/Basic.js @@ -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 = []; @@ -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 @@ -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); diff --git a/source/class/qxl/mobileshowcase/page/Canvas.js b/source/class/qxl/mobileshowcase/page/Canvas.js index 9a2b4a67..c8b3973b 100644 --- a/source/class/qxl/mobileshowcase/page/Canvas.js +++ b/source/class/qxl/mobileshowcase/page/Canvas.js @@ -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"); }, @@ -45,8 +44,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas", // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); this.__lastPoint = {}; @@ -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); @@ -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; }, @@ -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); @@ -136,6 +135,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas", /** * Handles the trackstart event on canvas. + * @param evt */ _onTrackStart : function(evt) { this.__canvasLeft = qx.bom.element.Location.getLeft(this.__canvas.getContentElement(), "padding"); @@ -147,6 +147,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas", /** * Handles the track event on canvas. + * @param evt */ _onTrack : function(evt) { this.__draw(evt); @@ -157,6 +158,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas", /** * Handles the trackend event on canvas. + * @param evt */ _onTrackEnd : function(evt) { this.__lastPoint = {}; @@ -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(); @@ -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); @@ -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); @@ -216,8 +219,7 @@ qx.Class.define("qxl.mobileshowcase.page.Canvas", }, - destruct : function() - { + destruct : function() { this._disposeObjects(); } diff --git a/source/class/qxl/mobileshowcase/page/Carousel.js b/source/class/qxl/mobileshowcase/page/Carousel.js index 3bdbbe49..bf9785ce 100644 --- a/source/class/qxl/mobileshowcase/page/Carousel.js +++ b/source/class/qxl/mobileshowcase/page/Carousel.js @@ -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"); }, @@ -58,7 +57,7 @@ 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"); @@ -66,10 +65,10 @@ qx.Class.define("qxl.mobileshowcase.page.Carousel", 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); @@ -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"); @@ -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); @@ -126,4 +125,4 @@ qx.Class.define("qxl.mobileshowcase.page.Carousel", return null; } } -}); \ No newline at end of file +}); diff --git a/source/class/qxl/mobileshowcase/page/DataBinding.js b/source/class/qxl/mobileshowcase/page/DataBinding.js index c98c914c..5be27358 100644 --- a/source/class/qxl/mobileshowcase/page/DataBinding.js +++ b/source/class/qxl/mobileshowcase/page/DataBinding.js @@ -23,8 +23,7 @@ qx.Class.define("qxl.mobileshowcase.page.DataBinding", { extend : qxl.mobileshowcase.page.Abstract, - construct : function() - { + construct : function() { this.base(arguments); this.setTitle("Data Binding"); @@ -76,8 +75,7 @@ qx.Class.define("qxl.mobileshowcase.page.DataBinding", // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); this.__form = this.__createSliderDataBindings(); @@ -119,12 +117,11 @@ qx.Class.define("qxl.mobileshowcase.page.DataBinding", /** * Reacts on tap of Stop time button. */ - __onStopTimeButtonTap : function () - { + __onStopTimeButtonTap : function () { var now = new Date(); var date = now.toLocaleTimeString(); - this.getListData().insertAt(0,date); + this.getListData().insertAt(0, date); this.__list.setVisibility("visible"); }, @@ -133,8 +130,7 @@ qx.Class.define("qxl.mobileshowcase.page.DataBinding", /** * Called on interval event of timer. */ - __onInterval : function() - { + __onInterval : function() { var old = parseInt(this.__dataLabel.getValue(), 10); if (this.__increaseMode) { if (old < 500) { @@ -142,13 +138,11 @@ qx.Class.define("qxl.mobileshowcase.page.DataBinding", } else { this.__timer.stop(); } - } else { - if (old > 0) { + } else if (old > 0) { this.__dataLabel.setValue(old - 1); } else { this.__timer.stop(); } - } }, @@ -163,8 +157,7 @@ qx.Class.define("qxl.mobileshowcase.page.DataBinding", /** * Called on button increase. */ - __onIncrease : function() - { + __onIncrease : function() { this.__increaseMode = true; this.__timer.start(); }, @@ -173,8 +166,7 @@ qx.Class.define("qxl.mobileshowcase.page.DataBinding", /** * Called on button decrease. */ - __onDecrease : function() - { + __onDecrease : function() { this.__increaseMode = false; this.__timer.start(); }, @@ -183,13 +175,12 @@ qx.Class.define("qxl.mobileshowcase.page.DataBinding", /** * Creates the slider and slider value label and binds vice-versa. */ - __createSliderDataBindings : function() - { + __createSliderDataBindings : function() { var form = new qx.ui.mobile.form.Form(); this.__slider = new qx.ui.mobile.form.Slider(); this.__slider.setDisplayValue("value"); this.__slider.setMaximum(500); - form.add(this.__slider,"Move slider:"); + form.add(this.__slider, "Move slider:"); this.__dataLabel = new qx.ui.mobile.form.TextField(); this.__dataLabel.setValue("0"); @@ -211,8 +202,7 @@ qx.Class.define("qxl.mobileshowcase.page.DataBinding", var self = this; var list = new qx.ui.mobile.list.List({ - configureItem : function(item, data, row) - { + configureItem : function(item, data, row) { var stopCount = self.getListData().getLength()-row; item.setTitle("Stop #"+stopCount); item.setSubtitle(data); @@ -232,4 +222,4 @@ qx.Class.define("qxl.mobileshowcase.page.DataBinding", "__slider", "__form", "__list"); } } -}); \ No newline at end of file +}); diff --git a/source/class/qxl/mobileshowcase/page/Dialog.js b/source/class/qxl/mobileshowcase/page/Dialog.js index d16ee56b..e20c0a17 100644 --- a/source/class/qxl/mobileshowcase/page/Dialog.js +++ b/source/class/qxl/mobileshowcase/page/Dialog.js @@ -26,9 +26,8 @@ qx.Class.define("qxl.mobileshowcase.page.Dialog", { extend : qxl.mobileshowcase.page.Abstract, - construct : function() - { - this.base(arguments,false); + construct : function() { + this.base(arguments, false); this.setTitle("Dialog Widgets"); }, @@ -47,8 +46,7 @@ qx.Class.define("qxl.mobileshowcase.page.Dialog", // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); this.__resultsLabel = new qx.ui.mobile.basic.Label("No events received so far."); @@ -125,23 +123,23 @@ qx.Class.define("qxl.mobileshowcase.page.Dialog", this.__menu.show(); }, this); - var popupGroup = new qx.ui.mobile.form.Group([],false); + var popupGroup = new qx.ui.mobile.form.Group([], false); popupGroup.add(this._createGroupTitle("Popup")); popupGroup.setLayout(new qx.ui.mobile.layout.VBox()); - popupGroup.add(showPopupButton,{flex:1}); - popupGroup.add(showAnchorButton,{flex:1}); + popupGroup.add(showPopupButton, {flex:1}); + popupGroup.add(showAnchorButton, {flex:1}); - var menuGroup = new qx.ui.mobile.form.Group([],false); + var menuGroup = new qx.ui.mobile.form.Group([], false); menuGroup.add(this._createGroupTitle("Menu")); menuGroup.setLayout(new qx.ui.mobile.layout.VBox()); - menuGroup.add(showMenuButton,{flex:1}); - menuGroup.add(showAnchorMenuButton,{flex:1}); + menuGroup.add(showMenuButton, {flex:1}); + menuGroup.add(showAnchorMenuButton, {flex:1}); - var otherGroup = new qx.ui.mobile.form.Group([],false); + var otherGroup = new qx.ui.mobile.form.Group([], false); otherGroup.add(this._createGroupTitle("Other")); otherGroup.setLayout(new qx.ui.mobile.layout.VBox()); - otherGroup.add(busyIndicatorButton,{flex:1}); - otherGroup.add(showPickerButton,{flex:1}); + otherGroup.add(busyIndicatorButton, {flex:1}); + otherGroup.add(showPickerButton, {flex:1}); var groupContainer = new qx.ui.mobile.container.Composite(); groupContainer.addCssClass("dialog-group"); @@ -166,7 +164,7 @@ qx.Class.define("qxl.mobileshowcase.page.Dialog", pickerDialog.setTitle("Picker"); var picker = this.__picker = new qx.ui.mobile.control.Picker(); - picker.addListener("changeSelection", this.__onPickerChangeSelection,this); + picker.addListener("changeSelection", this.__onPickerChangeSelection, this); this.__pickerDaySlotData = this._createDayPickerSlot(0, new Date().getFullYear()); picker.addSlot(this.__pickerDaySlotData); @@ -234,9 +232,9 @@ qx.Class.define("qxl.mobileshowcase.page.Dialog", /** * Creates the anchor popup. + * @param anchor */ - __createAnchorPopup : function(anchor) - { + __createAnchorPopup : function(anchor) { if (this.__anchorPopup) { return this.__anchorPopup; } @@ -263,10 +261,11 @@ qx.Class.define("qxl.mobileshowcase.page.Dialog", /** * Reacts on "changeSelection" event on picker, and displays the values on resultsLabel. + * @param e */ __onPickerChangeSelection : function(e) { if (e.getData().slot > 0) { - if(this._updatePickerTimer) { + if (this._updatePickerTimer) { clearTimeout(this._updatePickerTimer); this._updatePickerTimer = null; } @@ -298,12 +297,12 @@ qx.Class.define("qxl.mobileshowcase.page.Dialog", var oldDayData = this.__picker.getModel().getItem(0); var diff = slotData.length - oldDayData.length; if (diff < 0) { - for (var i = 0; i < -diff; i++) { + for (let i = 0; i < -diff; i++) { oldDayData.pop(); } } else if (diff > 0) { var ref = oldDayData.length; - for (var i = 0; i < diff; i++) { + for (let i = 0; i < diff; i++) { oldDayData.push({ title: "" + (ref + i + 1) }); @@ -315,9 +314,10 @@ qx.Class.define("qxl.mobileshowcase.page.Dialog", /** - * Creates a group title for the dialow showcase. - * @return {qx.ui.mobile.form.Label} the group title label. - */ + * Creates a group title for the dialow showcase. + * @param value + * @return {qx.ui.mobile.form.Label} the group title label. + */ _createGroupTitle : function(value) { var titleLabel = new qx.ui.mobile.basic.Label(value); titleLabel.addCssClass("dialog-group-title"); @@ -328,6 +328,7 @@ qx.Class.define("qxl.mobileshowcase.page.Dialog", /** * Reacts on "confirmSelection" event on picker, and displays the values on resultsLabel. + * @param e */ __onPickerConfirmSelection : function(e) { this.__resultsLabel.setValue(""); @@ -341,9 +342,10 @@ qx.Class.define("qxl.mobileshowcase.page.Dialog", /** * Reacts on "changeSelection" event on Menu, and displays the values on resultsLabel. + * @param e */ __onMenuChangeSelection : function(e) { this.__resultsLabel.setValue("Received changeSelection from Menu Dialog. [index: "+ e.getData().index+ "] [item: "+ e.getData().item+"]"); } } -}); \ No newline at end of file +}); diff --git a/source/class/qxl/mobileshowcase/page/Drawer.js b/source/class/qxl/mobileshowcase/page/Drawer.js index 4d728ca6..9e61fe95 100644 --- a/source/class/qxl/mobileshowcase/page/Drawer.js +++ b/source/class/qxl/mobileshowcase/page/Drawer.js @@ -23,8 +23,7 @@ qx.Class.define("qxl.mobileshowcase.page.Drawer", { extend : qxl.mobileshowcase.page.Abstract, - construct : function() - { + construct : function() { this.base(arguments, false); this.setTitle("Drawer"); }, @@ -32,7 +31,10 @@ qx.Class.define("qxl.mobileshowcase.page.Drawer", members : { - /** Factory method for creation of drawers. */ + /** + * Factory method for creation of drawers. + * @param orientation + */ _createDrawer : function(orientation) { var drawer = new qx.ui.mobile.container.Drawer(this, new qx.ui.mobile.layout.VBox()); drawer.setOrientation(orientation); @@ -42,7 +44,10 @@ qx.Class.define("qxl.mobileshowcase.page.Drawer", }, - /** Factory method for the a demo drawer's content. */ + /** + * Factory method for the a demo drawer's content. + * @param target + */ _createDrawerContent : function(target) { var closeDrawerButton = new qx.ui.mobile.form.Button("Close"); closeDrawerButton.addListener("tap", function() { @@ -54,10 +59,13 @@ qx.Class.define("qxl.mobileshowcase.page.Drawer", }, - /** Factory method for the a drawer menu. */ + /** + * Factory method for the a drawer menu. + * @param drawers + */ _createDrawerMenu : function(drawers) { var drawerGroup = new qx.ui.mobile.form.Group(); - for(var i = 0; i < drawers.length; i++) { + for (var i = 0; i < drawers.length; i++) { var openDrawerButton = new qx.ui.mobile.form.Button("Open "+drawers[i].getOrientation() +" drawer"); openDrawerButton.addListener("tap", drawers[i].show, drawers[i]); drawerGroup.add(openDrawerButton); @@ -68,8 +76,7 @@ qx.Class.define("qxl.mobileshowcase.page.Drawer", // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); // DRAWERS @@ -119,4 +126,4 @@ qx.Class.define("qxl.mobileshowcase.page.Drawer", this.getContent().add(this._createDrawerMenu([drawerTop, drawerRight, drawerBottom, drawerLeft])); } } -}); \ No newline at end of file +}); diff --git a/source/class/qxl/mobileshowcase/page/Event.js b/source/class/qxl/mobileshowcase/page/Event.js index a648b6a6..cd589b37 100644 --- a/source/class/qxl/mobileshowcase/page/Event.js +++ b/source/class/qxl/mobileshowcase/page/Event.js @@ -24,8 +24,7 @@ qx.Class.define("qxl.mobileshowcase.page.Event", { extend : qxl.mobileshowcase.page.Abstract, - construct : function() - { + construct : function() { this.base(arguments, false); this.setTitle("Events"); @@ -33,7 +32,7 @@ qx.Class.define("qxl.mobileshowcase.page.Event", this.__pointers = {}; - if(qx.core.Environment.get("browser.name")=="firefox") { + if (qx.core.Environment.get("browser.name")=="firefox") { this.__vendorPrefix = "moz"; } else if (qx.core.Environment.get("engine.name") == "mshtml") { this.__vendorPrefix = "ms"; @@ -66,11 +65,10 @@ qx.Class.define("qxl.mobileshowcase.page.Event", // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); - var container = this.__showcaseContainer = new qx.ui.mobile.container.Composite(new qx.ui.mobile.layout.VBox().set({ + var container = this.__showcaseContainer = new qx.ui.mobile.container.Composite(new qx.ui.mobile.layout.VBox().set({ alignX : "center", alignY : "middle" })); @@ -116,10 +114,10 @@ qx.Class.define("qxl.mobileshowcase.page.Event", this.__gestureTarget.setTranslateX(-5000); // If OS is Android 2 remove HTML5 badge logo, because Android is not able to scale and rotate on the same element. - var isAndroid2 = (qx.core.Environment.get("os.name") == "android") - && (parseInt(qx.core.Environment.get("os.version").charAt(0)) < 4); + var isAndroid2 = (qx.core.Environment.get("os.name") == "android") && + (parseInt(qx.core.Environment.get("os.version").charAt(0)) < 4); - if(isAndroid2) { + if (isAndroid2) { this.__gestureTarget.exclude(); } @@ -144,7 +142,7 @@ qx.Class.define("qxl.mobileshowcase.page.Event", var descriptionText = "Testing Pointer Events: Touch / Tap / Swipe the area
\n\ Testing Multi-Pointer Events: Touch the area with multiple fingers
\n\ "; - if(!isAndroid2) { + if (!isAndroid2) { descriptionText += "Testing Pinch/Zoom Gesture: Touch HTML5 logo with two fingers
"; } descriptionText += "Testing OrientationChange Event: Rotate your device / change browser size"; @@ -157,7 +155,7 @@ qx.Class.define("qxl.mobileshowcase.page.Event", this.getContent().add(containerGroup, {flex:1}); // Center background gradient, when multiple pointers are available. - qx.bom.element.Style.set(this.__container.getContentElement(),"background","-"+this.__vendorPrefix+"-radial-gradient(50% 50%, cover, #1a82f7, #2F2727)"); + qx.bom.element.Style.set(this.__container.getContentElement(), "background", "-"+this.__vendorPrefix+"-radial-gradient(50% 50%, cover, #1a82f7, #2F2727)"); // Start rendering qx.bom.AnimationFrame.request(this._renderLabel, this); @@ -197,7 +195,6 @@ qx.Class.define("qxl.mobileshowcase.page.Event", /** * Event handler. * - * @param evt {qx.event.type.Track} The track event. */ __onTrackEnd : function() { if (qx.core.Environment.get("qx.mobile.nativescroll") === false) { @@ -229,8 +226,8 @@ qx.Class.define("qxl.mobileshowcase.page.Event", var scale = evt.getScale() * this.__initialScale; this.__currentScale = (Math.round(scale * 100) / 100); - this.__currentScale = Math.max(this.__currentScale,this.__minScale); - this.__currentScale = Math.min(this.__currentScale,this.__maxScale); + this.__currentScale = Math.max(this.__currentScale, this.__minScale); + this.__currentScale = Math.min(this.__currentScale, this.__maxScale); qx.bom.AnimationFrame.request(this._renderLogo, this); }, @@ -243,7 +240,7 @@ qx.Class.define("qxl.mobileshowcase.page.Event", */ _onGesture : function(evt) { var pointer = this.__pointers[evt.getPointerId()]; - if(pointer) { + if (pointer) { this.__pointers[evt.getPointerId()].events.push(evt.getType()); } qx.bom.AnimationFrame.request(this._renderLabel, this); @@ -286,7 +283,7 @@ qx.Class.define("qxl.mobileshowcase.page.Event", * @param x {Integer} pointer position x. * @param y {Integer} pointer position y. */ - _setPointerCirclePosition : function(pointerId,x,y) { + _setPointerCirclePosition : function(pointerId, x, y) { // Disable pointer circles Windows Phone 8 as no pointer-events:none is available. if (navigator.userAgent.match(/IEMobile\/10\.0/)) { return; @@ -308,7 +305,7 @@ qx.Class.define("qxl.mobileshowcase.page.Event", _getPointerPosition : function(evt) { var containerLeft = qx.bom.element.Location.getLeft(this.__container.getContentElement(), "padding"); var containerTop = qx.bom.element.Location.getTop(this.__container.getContentElement(), "padding"); - return [evt.getViewportLeft() - containerLeft,evt.getViewportTop() - containerTop]; + return [evt.getViewportLeft() - containerLeft, evt.getViewportTop() - containerTop]; }, @@ -317,15 +314,14 @@ qx.Class.define("qxl.mobileshowcase.page.Event", * * @param evt {qx.event.type.Pointer} The pointer event. */ - _onPointer : function(evt) - { + _onPointer : function(evt) { var type = evt.getType(); var pointerId = evt.getPointerId(); if (type == "pointerdown") { for (var key in this.__pointers) { var pointerToDelete = this.__pointers[key]; - if(pointerToDelete.remove) { + if (pointerToDelete.remove) { delete this.__pointers[key]; } } @@ -344,14 +340,14 @@ qx.Class.define("qxl.mobileshowcase.page.Event", this._updatePointerPosition(evt); } - if(type == "pointermove") { + if (type == "pointermove") { this._updatePointerPosition(evt); } - if(this.__pointers[pointerId] && !this.__pointers[pointerId].remove) { + if (this.__pointers[pointerId] && !this.__pointers[pointerId].remove) { var pointerEvents = this.__pointers[pointerId].events; - if(pointerEvents.length > 0) { + if (pointerEvents.length > 0) { var lastEventType = pointerEvents[pointerEvents.length -1]; if (lastEventType != type) { pointerEvents.push(type); @@ -365,7 +361,7 @@ qx.Class.define("qxl.mobileshowcase.page.Event", // Remove all circles out of visible area this._resetPointerPosition(pointerId); - if(evt.isPrimary()) { + if (evt.isPrimary()) { this.__initialRotation = this.__currentRotation; this.__initialScale = this.__currentScale; } @@ -387,7 +383,7 @@ qx.Class.define("qxl.mobileshowcase.page.Event", // Render HTML5 logo: rotation and scale. var gestureTargetElement = this.__gestureTarget.getContentElement(); - var transitionValue = "translate(" + (this.__logoLeft) + "px" + "," + (this.__logoTop) + "px) "; + var transitionValue = "translate(" + (this.__logoLeft) + "px," + (this.__logoTop) + "px) "; transitionValue = transitionValue + " scale(" + (this.__currentScale) + ")"; transitionValue = transitionValue + " rotate(" + (this.__currentRotation) + "deg)"; @@ -402,13 +398,13 @@ qx.Class.define("qxl.mobileshowcase.page.Event", var labelBuffer = ""; for (var pointerId in this.__pointers) { var pointer = this.__pointers[pointerId]; - labelBuffer = labelBuffer + "
"; + labelBuffer += "
"; labelBuffer = labelBuffer + "" + pointerId + ""; for (var i = 0; i < pointer.events.length; i++) { labelBuffer = labelBuffer + " " + pointer.events[i] + ""; - }; - labelBuffer = labelBuffer + "
"; - }; + } + labelBuffer += "
"; + } this.__label.setValue(labelBuffer); } } diff --git a/source/class/qxl/mobileshowcase/page/Form.js b/source/class/qxl/mobileshowcase/page/Form.js index e2a20161..5147b114 100644 --- a/source/class/qxl/mobileshowcase/page/Form.js +++ b/source/class/qxl/mobileshowcase/page/Form.js @@ -24,8 +24,7 @@ qx.Class.define("qxl.mobileshowcase.page.Form", { extend : qxl.mobileshowcase.page.Abstract, - construct : function() - { + construct : function() { this.base(arguments); this.setTitle("Form"); }, @@ -52,8 +51,7 @@ qx.Class.define("qxl.mobileshowcase.page.Form", // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); this.__form = this.__createForm(); @@ -72,7 +70,7 @@ qx.Class.define("qxl.mobileshowcase.page.Form", this.__closeResultPopup = new qx.ui.mobile.form.Button("OK"); this.__closeResultPopup.addListener("tap", function() { this.__resultPopup.hide(); - },this); + }, this); popupContent.add(this.__result); popupContent.add(this.__closeResultPopup); @@ -110,8 +108,7 @@ qx.Class.define("qxl.mobileshowcase.page.Form", * * @return {qx.ui.mobile.form.Form} the created form. */ - __createForm : function() - { + __createForm : function() { var form = new qx.ui.mobile.form.Form(); // NAME FIELD @@ -131,16 +128,16 @@ qx.Class.define("qxl.mobileshowcase.page.Form", this.__rememberPass = new qx.ui.mobile.form.CheckBox(); form.add(this.__rememberPass, "Remember password? "); this.__rememberPass.setModel("password_reminder"); - this.__rememberPass.bind("model",this.__password,"value"); + this.__rememberPass.bind("model", this.__password, "value"); - this.__password.bind("value",this.__rememberPass,"model"); + this.__password.bind("value", this.__rememberPass, "model"); // NUMBER FIELD this.__numberField = new qx.ui.mobile.form.NumberField(); this.__numberField.setMaximum(150); this.__numberField.setMinimum(0); this.__numberField.setLiveUpdate(true); - form.add(this.__numberField,"Age"); + form.add(this.__numberField, "Age"); form.addGroupHeader("Gender"); this.__radio1 = new qx.ui.mobile.form.RadioButton(); @@ -170,14 +167,14 @@ qx.Class.define("qxl.mobileshowcase.page.Form", placeholder: "Terms of Service", readOnly: true }); - form.add(this.__info,"Terms of Service"); + form.add(this.__info, "Terms of Service"); this.__info.setValue("qooxdoo Licensing Information\n=============================\n\nqooxdoo is licensed under the MIT License (MIT). \n The above holds for any newer qooxdoo release. Only legacy versions 5.0 and below were licensed under LGPL/EPL."); this.__slide = new qx.ui.mobile.form.Slider(); this.__slide.setDisplayValue("percent"); - form.add(this.__slide,"Are you human? Drag the slider to prove it."); + form.add(this.__slide, "Are you human? Drag the slider to prove it."); - this.__save = new qx.ui.mobile.form.ToggleButton(false,"YES","NO",13); + this.__save = new qx.ui.mobile.form.ToggleButton(false, "YES", "NO", 13); this.__save.addListener("changeValue", this._enableFormSubmitting, this); form.add(this.__save, "Agree?"); @@ -196,18 +193,18 @@ qx.Class.define("qxl.mobileshowcase.page.Form", */ _createValidationRules : function(validationManager) { // USERNAME validation - validationManager.add(this.__name, function(value, item){ - var valid = value != null && value.length>3; - if(!valid) { + validationManager.add(this.__name, function(value, item) { + var valid = value !== null && value.length>3; + if (!valid) { item.setInvalidMessage("Username should have more than 3 characters!"); } return valid; }, this); // PASSWORD validation - validationManager.add(this.__password, function(value, item){ - var valid = value != null && value.length>3; - if(!valid) { + validationManager.add(this.__password, function(value, item) { + var valid = value !== null && value.length>3; + if (!valid) { item.setInvalidMessage("Password should have more than 3 characters!"); } return valid; @@ -215,7 +212,7 @@ qx.Class.define("qxl.mobileshowcase.page.Form", // AGE validation validationManager.add(this.__numberField, function(value, item) { - if(value == null || value == "0") { + if (value === null || value == "0") { item.setInvalidMessage("Please enter your age."); return false; } @@ -225,7 +222,7 @@ qx.Class.define("qxl.mobileshowcase.page.Form", return false; } - if(value < item.getMinimum() || value > item.getMaximum()) { + if (value < item.getMinimum() || value > item.getMaximum()) { item.setInvalidMessage("Value out of range: "+ item.getMinimum()+"-"+item.getMaximum()); return false; } @@ -246,19 +243,17 @@ qx.Class.define("qxl.mobileshowcase.page.Form", /** Event handler. */ - _onSubmitButtonTap : function() - { - if(this.__form.validate()) - { + _onSubmitButtonTap : function() { + if (this.__form.validate()) { var result = []; - result.push("Username: " + this.__name.getValue()); - result.push("Password: " + this.__password.getValue()); - result.push("Age: " + this.__numberField.getValue()); - result.push("Male: " + this.__radio1.getValue()); - result.push("Female: " + this.__radio2.getValue()); - result.push("Agree on our terms: " + this.__save.getValue()); - result.push("How did you hear about us : " + this.__sel.getValue()); - result.push("Are you human? : " + this.__slide.getValue() +"%"); + result.push("Username: " + this.__name.getValue()); + result.push("Password: " + this.__password.getValue()); + result.push("Age: " + this.__numberField.getValue()); + result.push("Male: " + this.__radio1.getValue()); + result.push("Female: " + this.__radio2.getValue()); + result.push("Agree on our terms: " + this.__save.getValue()); + result.push("How did you hear about us : " + this.__sel.getValue()); + result.push("Are you human? : " + this.__slide.getValue() +"%"); this.__result.setValue(result.join("
")); this.__resultPopup.show(); } else { @@ -272,7 +267,7 @@ qx.Class.define("qxl.mobileshowcase.page.Form", // overridden _stop : function() { - if(this.__resultPopup) { + if (this.__resultPopup) { this.__resultPopup.hide(); } this.base(arguments); diff --git a/source/class/qxl/mobileshowcase/page/List.js b/source/class/qxl/mobileshowcase/page/List.js index b33d59ad..7f247d65 100644 --- a/source/class/qxl/mobileshowcase/page/List.js +++ b/source/class/qxl/mobileshowcase/page/List.js @@ -25,8 +25,7 @@ qx.Class.define("qxl.mobileshowcase.page.List", extend : qxl.mobileshowcase.page.Abstract, - construct : function() - { + construct : function() { this.base(arguments); this.setTitle("List"); }, @@ -176,7 +175,7 @@ qx.Class.define("qxl.mobileshowcase.page.List", _loadMoreModelItems: function() { var initialModelLength = this._model.length; - if(this._isLoading || initialModelLength > 200) { + if (this._isLoading || initialModelLength > 200) { return; } @@ -210,4 +209,4 @@ qx.Class.define("qxl.mobileshowcase.page.List", qx.ui.mobile.dialog.Manager.getInstance().confirm("Selection", text, null, this, ["OK"]); } } -}); \ No newline at end of file +}); diff --git a/source/class/qxl/mobileshowcase/page/Login.js b/source/class/qxl/mobileshowcase/page/Login.js index b2195e67..e94296a1 100644 --- a/source/class/qxl/mobileshowcase/page/Login.js +++ b/source/class/qxl/mobileshowcase/page/Login.js @@ -15,8 +15,7 @@ qx.Class.define("qxl.qxl.mobileshowcase.page.Login", { extend : qx.ui.mobile.page.NavigationPage, - construct : function() - { + construct : function() { this.base(arguments); this.setTitle("Login"); }, diff --git a/source/class/qxl/mobileshowcase/page/Maps.js b/source/class/qxl/mobileshowcase/page/Maps.js index ee6f427f..adad1f5e 100644 --- a/source/class/qxl/mobileshowcase/page/Maps.js +++ b/source/class/qxl/mobileshowcase/page/Maps.js @@ -22,15 +22,15 @@ * @ignore(ol.*) * @asset(qx/mobile/css/*) */ +/* global ol */ qx.Class.define("qxl.mobileshowcase.page.Maps", { extend : qxl.mobileshowcase.page.Abstract, - construct : function() - { + construct : function() { this.base(arguments, false); this.setTitle("Maps"); - qx.bom.Stylesheet.includeFile('https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.5/ol.css'); + qx.bom.Stylesheet.includeFile("https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.5/ol.css"); this._geolocationEnabled = qx.core.Environment.get("html.geolocation"); }, members : @@ -42,8 +42,7 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", _showMyPositionButton : null, // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); if (this._geolocationEnabled) { this._initGeoLocation(); @@ -68,14 +67,12 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", }, // overridden - _start : function() - { + _start : function() { this._redrawMap(); }, // overridden - _createScrollContainer : function() - { + _createScrollContainer : function() { // MapContainer // Do not use any layout manager - otherwise the map will not be // displayed with safari browsers. @@ -86,8 +83,7 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", }, // overridden - _createContent : function() - { + _createContent : function() { // Disable menu for Windows Phone 8. if (navigator.userAgent.match(/IEMobile\/10\.0/)) { return null; @@ -108,8 +104,7 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", // Button is disabled when Geolocation is not available. this._showMyPositionButton.setEnabled(this._geolocationEnabled); - toggleNavigationButton.addListener("changeValue", function() - { + toggleNavigationButton.addListener("changeValue", function() { var newNavBarState = !this.isNavigationBarHidden(); this.setNavigationBarHidden(newNavBarState); this.show(); @@ -126,12 +121,10 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", /** * Loads JavaScript library which is needed for the map. */ - _loadMapLibrary : function() - { + _loadMapLibrary : function() { var req = new qx.bom.request.Script(); - req.onload = function() - { - var osmlayer = new ol.layer.Tile( { + req.onload = function() { + var osmlayer = new ol.layer.Tile({ source : new ol.source.OSM() }); var view = new ol.View( @@ -139,11 +132,11 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", zoom : 10, minZoom : 2, maxZoom : 19 - }) + }); this._map = new ol.Map( { - target : 'map', + target : "map", layers : [osmlayer], view : view }); @@ -170,8 +163,7 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", * @param zoom {Integer} zoom level. * @param showMarker {Boolean} if a marker should be drawn at the defined position. */ - _zoomToPosition : function(longitude, latitude, zoom, showMarker) - { + _zoomToPosition : function(longitude, latitude, zoom, showMarker) { if (!this._map) { return; } @@ -189,25 +181,22 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", * @param mapPosition {Map} the map position. * @param showMarker {Boolean} if a marker should be drawn at the defined position. */ - _setMarkerOnMap : function(map, mapPosition, showMarker) - { - if (this._marker) - { + _setMarkerOnMap : function(map, mapPosition, showMarker) { + if (this._marker) { map.removeLayer(this._marker); this._marker = null; } - if (showMarker === true) - { - var point = new ol.Feature( { + if (showMarker === true) { + var point = new ol.Feature({ geometry : new ol.geom.Point(mapPosition) }); - point.setStyle(new ol.style.Style( { - image : new ol.style.Icon( { - src : 'http://www.openlayers.org/api/img/marker.png' + point.setStyle(new ol.style.Style({ + image : new ol.style.Icon({ + src : "http://www.openlayers.org/api/img/marker.png" }) })); - this._marker = new ol.layer.Vector( { - source : new ol.source.Vector( { + this._marker = new ol.layer.Vector({ + source : new ol.source.Vector({ features : [point] }) }); @@ -218,8 +207,7 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", /** * Prepares qooxdoo GeoLocation and installs needed listeners. */ - _initGeoLocation : function() - { + _initGeoLocation : function() { var geo = qx.bom.GeoLocation.getInstance(); geo.addListener("position", this._onGeolocationSuccess, this); geo.addListener("error", this._onGeolocationError, this); @@ -227,9 +215,9 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", /** * Callback function when Geolocation did work. + * @param position */ - _onGeolocationSuccess : function(position) - { + _onGeolocationSuccess : function(position) { this._zoomToPosition(position.getLongitude(), position.getLatitude(), 15, true); this._redrawMap(); }, @@ -237,8 +225,7 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", /** * Callback function when Geolocation returned an error. */ - _onGeolocationError : function() - { + _onGeolocationError : function() { this._showMyPositionButton.setEnabled(false); var buttons = []; buttons.push(qx.locale.Manager.tr("OK")); @@ -251,8 +238,7 @@ qx.Class.define("qxl.mobileshowcase.page.Maps", /** * Retreives GeoPosition out of qx.bom.Geolocation and zooms to this point on map. */ - _getGeoPosition : function() - { + _getGeoPosition : function() { var geo = qx.bom.GeoLocation.getInstance(); geo.getCurrentPosition(false, 1000, 1000); }, diff --git a/source/class/qxl/mobileshowcase/page/Overview.js b/source/class/qxl/mobileshowcase/page/Overview.js index 5647ff61..f546d37f 100644 --- a/source/class/qxl/mobileshowcase/page/Overview.js +++ b/source/class/qxl/mobileshowcase/page/Overview.js @@ -23,8 +23,7 @@ qx.Class.define("qxl.mobileshowcase.page.Overview", { extend : qx.ui.mobile.page.NavigationPage, - construct : function() - { + construct : function() { this.base(arguments); this.setTitle("Overview"); }, @@ -40,13 +39,11 @@ qx.Class.define("qxl.mobileshowcase.page.Overview", 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.setSubtitle(data.subtitle); item.setShowArrow(true); @@ -77,7 +74,6 @@ qx.Class.define("qxl.mobileshowcase.page.Overview", }, this); this.getContent().add(list); - } } }); diff --git a/source/class/qxl/mobileshowcase/page/Tab.js b/source/class/qxl/mobileshowcase/page/Tab.js index 1b353f30..0e9d9c70 100644 --- a/source/class/qxl/mobileshowcase/page/Tab.js +++ b/source/class/qxl/mobileshowcase/page/Tab.js @@ -24,8 +24,7 @@ qx.Class.define("qxl.mobileshowcase.page.Tab", extend : qxl.mobileshowcase.page.Abstract, - construct : function() - { + construct : function() { this.base(arguments); this.setTitle("Tabs"); }, @@ -34,8 +33,7 @@ qx.Class.define("qxl.mobileshowcase.page.Tab", members : { // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); var tabBar = this.__createTabBar(); @@ -50,8 +48,7 @@ qx.Class.define("qxl.mobileshowcase.page.Tab", * * @return {qx.ui.mobile.tabbar.TabBar} created tab bar. */ - __createTabBar : function() - { + __createTabBar : function() { var tabBar = new qx.ui.mobile.tabbar.TabBar(); var view1 = this.__createView("qx.Desktop

Create desktop oriented applications. Features a rich and extendable set of widgets. No HTML/CSS knowledge required."); @@ -91,11 +88,10 @@ qx.Class.define("qxl.mobileshowcase.page.Tab", * @param text {String} The text of the label used in this view. * @return {qx.ui.mobile.basic.Label} the created view. */ - __createView : function(text) - { + __createView : function(text) { var label = new qx.ui.mobile.basic.Label(text); this.getContent().add(label); return label; } } -}); \ No newline at end of file +}); diff --git a/source/class/qxl/mobileshowcase/page/Theming.js b/source/class/qxl/mobileshowcase/page/Theming.js index 3dacf6b0..57359bdb 100644 --- a/source/class/qxl/mobileshowcase/page/Theming.js +++ b/source/class/qxl/mobileshowcase/page/Theming.js @@ -32,8 +32,7 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", { extend : qxl.mobileshowcase.page.Abstract, - construct : function() - { + construct : function() { this.base(arguments, false); this.setTitle("Theming"); @@ -65,7 +64,7 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", * Preloads all css files for preventing flickering on theme switches. */ __preloadThemes : function() { - for(var i = 0; i < this.self(arguments).THEMES.length; i++) { + for (var i = 0; i < this.self(arguments).THEMES.length; i++) { var cssResource = this.self(arguments).THEMES[i].css; var cssURI = qx.util.ResourceManager.getInstance().toUri(cssResource); var req = new qx.bom.request.Xhr(); @@ -76,8 +75,7 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); this.getContent().add(new qx.ui.mobile.form.Title("Select a theme")); @@ -93,16 +91,17 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", }, - /** Check on possible scale changes. */ - _onChangeScale : qx.module.util.Function.debounce(function(e) - { + /** + * Check on possible scale changes. + * @param e + */ + _onChangeScale : qx.module.util.Function.debounce(function(e) { var root = qx.core.Init.getApplication().getRoot(); var appScale = root.getAppScale(); var fontScale = root.getFontScale(); - if(appScale != this.__appScale || fontScale != this.__fontScale) - { + if (appScale != this.__appScale || fontScale != this.__fontScale) { this.__appScale = appScale; this.__fontScale = fontScale; @@ -151,8 +150,7 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", /** * Refreshes the label which displays the pixel ratio, scale factor etc. */ - _updateDemoImageLabel : function() - { + _updateDemoImageLabel : function() { var pixelRatio = parseFloat(qx.bom.client.Device.getDevicePixelRatio().toFixed(2)); var fontScale = qx.core.Init.getApplication().getRoot().getFontScale(); var appScale = qx.core.Init.getApplication().getRoot().getAppScale(); @@ -169,8 +167,7 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", * @param x {Number} * @return {String} the formatted number */ - __format : function(x) - { + __format : function(x) { if (x === null) { return "(unknown)"; } @@ -184,8 +181,7 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", /** * Creates the a control widget for the theme's scale factor. */ - __createThemeScaleControl : function() - { + __createThemeScaleControl : function() { this.getContent().add(new qx.ui.mobile.form.Title("Adjust font scale")); var form = new qx.ui.mobile.form.Form(); @@ -203,7 +199,7 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", useScaleButton.addListener("tap", this._onApplyScaleButtonTap, this); form.addButton(useScaleButton); - var scaleGroup = new qx.ui.mobile.form.Group([new qx.ui.mobile.form.renderer.Single(form)],false); + var scaleGroup = new qx.ui.mobile.form.Group([new qx.ui.mobile.form.renderer.Single(form)], false); this.getContent().add(scaleGroup); }, @@ -255,7 +251,7 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", qx.bom.Element.removeListener(blocker.getContentElement(), "transitionEnd", this.self._onAppFadedOut, this); var root = qxWeb(".root"); - root.setStyle("color","white"); + root.setStyle("color", "white"); qxWeb("link[rel^='stylesheet']")[0].remove(); @@ -266,7 +262,7 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", qxWeb("head")[0].append(newCssLink); - root.setStyle("color",null); + root.setStyle("color", null); setTimeout(function() { qx.bom.Element.addListener(blocker.getContentElement(), "transitionEnd", this.self._onAppFadedIn, this); @@ -289,7 +285,6 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", /** * Switches the theme of the application to the target theme. - * @param src {qx.ui.mobile.core.Widget} Source widget of this event. */ __switchTheme : function() { var cssResource = this.self.self(arguments).THEMES[this.index].css; @@ -300,15 +295,14 @@ qx.Class.define("qxl.mobileshowcase.page.Theming", /** * Adds a new theme data object to the theme switcher. - * @param cssFile {String} The css file url. + * @param themeData */ appendTheme : function(themeData) { this.self(arguments).THEMES.push(themeData); }, - destruct : function() - { + destruct : function() { qx.event.Registration.removeListener(window, "resize", this._onChangeScale); qx.core.Init.getApplication().getRoot().removeListener("changeAppScale", this._updateDemoImageLabel, this); diff --git a/source/class/qxl/mobileshowcase/page/Toolbar.js b/source/class/qxl/mobileshowcase/page/Toolbar.js index 42012b26..1cf1bbbc 100644 --- a/source/class/qxl/mobileshowcase/page/Toolbar.js +++ b/source/class/qxl/mobileshowcase/page/Toolbar.js @@ -31,13 +31,12 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", statics : { - __toolbarButtonImages: ["qxl/mobileshowcase/icon/arrowleft.png","qxl/mobileshowcase/icon/camera.png"] + __toolbarButtonImages: ["qxl/mobileshowcase/icon/arrowleft.png", "qxl/mobileshowcase/icon/camera.png"] }, - construct : function() - { - this.base(arguments,false); + construct : function() { + this.base(arguments, false); this.setTitle("Toolbar"); }, @@ -66,8 +65,7 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", // overridden - _initialize : function() - { + _initialize : function() { this.base(arguments); var label = new qx.ui.mobile.form.Title("Search"); @@ -87,8 +85,8 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", ); this.__goBackBtn.setShow("icon"); - this.__goBackBtn.addListener("tap", function(){ - var popup = this.__createAreYouSurePopup( this.__goBackBtn); + this.__goBackBtn.addListener("tap", function() { + var popup = this.__createAreYouSurePopup(this.__goBackBtn); popup.show(); }, this); @@ -97,7 +95,7 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", ); this.__loadButton.setShow("icon"); - this.__loadButton.addListener("tap", function(){ + this.__loadButton.addListener("tap", function() { var popup = this.__createSearchPopup(); popup.show(); qx.lang.Function.delay(popup.hide, 3000, popup); @@ -105,8 +103,8 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", var deleteButton = new qx.ui.mobile.toolbar.Button("Delete"); - deleteButton.addListener("tap", function(){ - this.__deleteDialog = qx.ui.mobile.dialog.Manager.getInstance().warning('Deleting', 'Are you sure?', this.__processDelete, this, ["Yes", "No"]); + deleteButton.addListener("tap", function() { + this.__deleteDialog = qx.ui.mobile.dialog.Manager.getInstance().warning("Deleting", "Are you sure?", this.__processDelete, this, ["Yes", "No"]); }, this); toolbar.add(searchBtn); @@ -116,9 +114,8 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", }, - __processDelete : function(index) - { - if(index==0) { + __processDelete : function(index) { + if (index==0) { this.__deleteDialog.destroy(); } else { this.__deleteDialog.destroy(); @@ -128,10 +125,10 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", /** * Creates the popup widget to show when backButton is tapped + * @param anchor */ - __createAreYouSurePopup : function(anchor) - { - if(this.__areYouSurePopup) { + __createAreYouSurePopup : function(anchor) { + if (this.__areYouSurePopup) { return this.__areYouSurePopup; } var buttonsWidget = new qx.ui.mobile.container.Composite(new qx.ui.mobile.layout.HBox()); @@ -142,11 +139,11 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", buttonsWidget.add(okButton, {flex:1}); buttonsWidget.add(cancelButton, {flex:1}); - okButton.addListener("tap", function(){ + okButton.addListener("tap", function() { this.__areYouSurePopup.hide(); }, this); - cancelButton.addListener("tap", function(){ + cancelButton.addListener("tap", function() { this.__areYouSurePopup.hide(); }, this); @@ -157,10 +154,10 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", /** * Creates the popup widget to show when backButton is tapped + * @param attachedToWidget */ - __createSearchPopup : function(attachedToWidget) - { - if(this.__searchPopup) { + __createSearchPopup : function(attachedToWidget) { + if (this.__searchPopup) { return this.__searchPopup; } var busyIndicator = new qx.ui.mobile.dialog.BusyIndicator("Data connection..."); @@ -172,9 +169,8 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", /** * Creates the popup widget to show when backButton is tapped */ - __createSearchDialog : function() - { - if(this.__searchDialog) { + __createSearchDialog : function() { + if (this.__searchDialog) { return this.__searchDialog; } var popupWidget = new qx.ui.mobile.container.Composite(new qx.ui.mobile.layout.VBox()); @@ -187,7 +183,7 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", }.bind(this)); var searchButton = new qx.ui.mobile.form.Button("Search"); - searchButton.addListener("tap", function(){ + searchButton.addListener("tap", function() { this.__searchDialog.hide(); }, this); @@ -197,7 +193,7 @@ qx.Class.define("qxl.mobileshowcase.page.Toolbar", this.__searchDialog = new qx.ui.mobile.dialog.Popup(popupWidget); this.__searchDialog.setHideOnBlockerTap(true); this.__searchDialog.setModal(true); - this.__searchDialog.setTitle('Search ...'); + this.__searchDialog.setTitle("Search ..."); return this.__searchDialog; }, diff --git a/source/class/qxl/mobileshowcase/test/DemoTest.js b/source/class/qxl/mobileshowcase/test/DemoTest.js index f946c83a..235de8fb 100644 --- a/source/class/qxl/mobileshowcase/test/DemoTest.js +++ b/source/class/qxl/mobileshowcase/test/DemoTest.js @@ -35,8 +35,7 @@ qx.Class.define("qxl.mobileshowcase.test.DemoTest", /** * Here are some simple tests */ - testSimple : function() - { + testSimple : function() { this.assertEquals(4, 3+1, "This should never fail!"); this.assertFalse(false, "Can false be true?!"); }, @@ -44,8 +43,7 @@ qx.Class.define("qxl.mobileshowcase.test.DemoTest", /** * Here are some more advanced tests */ - testAdvanced: function () - { + testAdvanced: function () { var a = 3; var b = a; this.assertIdentical(a, b, "A rose by any other name is still a rose");