Skip to content

Commit

Permalink
[BUG #4831] Refactoring: Resolution independent CSS
Browse files Browse the repository at this point in the history
* Added pxToEm function which enables the user to scale the application through root font size ($application-font-size as variable)
  • Loading branch information
czuendorf committed Sep 24, 2013
1 parent 01d9330 commit beed914
Show file tree
Hide file tree
Showing 252 changed files with 5,462 additions and 3,676 deletions.
Expand Up @@ -920,8 +920,12 @@ qx.Class.define("demobrowser.DemoBrowser",
var treeNode = this.tree.getSelection()[0];
var modelNode = treeNode.getUserData("modelLink");
var demoName = this.tests.handler.getFullName(modelNode);
demoName = demoName.replace(".", "~");
var fullUrl = location.protocol + "//" + location.host + location.pathname + "#" + demoName;
if (qx.core.Environment.get("qx.contrib")) {
demoName = demoName.replace(/\|/g, "/");
} else {
demoName = demoName.replace(".", "~");
}
var fullUrl = location.protocol + "//" + location.host + location.pathname + "#" + encodeURIComponent(demoName);
this._urlWindow.getChildren()[0].setValue(fullUrl);
this._urlWindow.open();
}, this);
Expand Down
Expand Up @@ -22,6 +22,7 @@
*
* @require(qx.module.Animation)
* @require(qx.module.Manipulating)
* @require(qx.module.Traversing)
* @require(qx.module.Template)
*/
qx.Class.define("demobrowser.demo.animation.Scroll",
Expand All @@ -38,12 +39,12 @@ qx.Class.define("demobrowser.demo.animation.Scroll",
var data = {items : []};
for (var i=0; i < 30; i++) {
data.items.push(i);
};
}

// add 5 lists to the body
for (var i=0; i < 5; i++) {
for (var j=0; j < 5; j++) {
q.template.get("list-template", data).appendTo(document.body);
};
}

// set a default scroll top
this.reset();
Expand All @@ -53,7 +54,7 @@ qx.Class.define("demobrowser.demo.animation.Scroll",
q(".list").addClass("scrolling").setScrollTop(250, 2000).once("animationEnd", function() {
q(".list").removeClass("scrolling");
});
})
});

},

Expand Down
Expand Up @@ -216,7 +216,9 @@ qx.Class.define("demobrowser.demo.virtual.List",
height: 280,
width: 150,
labelPath: "label",
iconPath: "icon"
iconPath: "icon",
draggable: true,
droppable: true
});
container.add(list, {top: 20});

Expand Down
Expand Up @@ -57,7 +57,8 @@ qx.Class.define("demobrowser.demo.widget.Tree",
{
var tree = new qx.ui.tree.Tree().set({
width : 200,
height : 400
height : 400,
draggable: true
});

var root = new qx.ui.tree.TreeFolder("root");
Expand Down
11 changes: 8 additions & 3 deletions application/feedreader/config.json
Expand Up @@ -193,12 +193,16 @@

"environment" :
{
"qx.mobile.emulatetouch" : true
"qx.mobile.emulatetouch" : true,
"qx.mobile.nativescroll" : false
},

"compile-options" :
{
"paths" : { "file" : "source/script/${APPLICATION}-mobile.js" }
"paths": {
"file": "source/script/${APPLICATION}-mobile.js",
"loader-template": "${QOOXDOO_PATH}/tool/data/generator/mobile.loader.tmpl.js"
}
},

"=packages" : {}
Expand All @@ -216,7 +220,8 @@

"environment" :
{
"qx.mobile.emulatetouch" : true
"qx.mobile.emulatetouch" : true,
"qx.mobile.nativescroll" : false
},

"compile-options" :
Expand Down
Expand Up @@ -97,7 +97,7 @@ qx.Class.define("feedreader.model.Model",
);
staticFeedFolder.getFeeds().push(
new feedreader.model.Feed(
"Surfin' Safari", "http://webkit.org/blog/feed/", "static"
"Firefox Future Releases", "http://blog.mozilla.org/futurereleases/feed/", "static"
)
);

Expand Down
6 changes: 3 additions & 3 deletions application/feedreader/source/index-mobile.html
Expand Up @@ -7,12 +7,12 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="format-detection" content="telephone=no" />

<link rel="stylesheet" type="text/css" media="screen" href="../../../framework/source/resource/qx/mobile/css/indigo.css">

<title>qooxdoo &raquo; Feed Reader</title>

<style type="text/css">
</style>
<style type="text/css"></style>

<script type="text/javascript" src="script/feedreader-mobile.js"></script>
<script type="text/javascript">
Expand Down
8 changes: 8 additions & 0 deletions application/mobileshowcase/config.json
Expand Up @@ -106,6 +106,14 @@
"qx.application" : "${APPLICATION}.Application",
"qx.mobile.emulatetouch" : true,
"qx.theme" : "${THEME}"
},

"compile-options" :
{
"paths" :
{
"loader-template" : "${QOOXDOO_PATH}/tool/data/generator/mobile.loader.tmpl.js"
}
}
},

Expand Down
Expand Up @@ -44,6 +44,7 @@ qx.Class.define("mobileshowcase.page.Dialog",
__busyPopup : null,
__menu : null,
__picker : null,
__pickerDaySlotData : null,
__anchorMenu : null,
__modalDialogPopup : null,
__resultsLabel : null,
Expand Down
Expand Up @@ -205,6 +205,7 @@ qx.Class.define("mobileshowcase.page.Toolbar",
popupWidget.add(searchButton);

this.__searchDialog = new qx.ui.mobile.dialog.Popup(popupWidget);
this.__searchDialog.setHideOnBlockerClick(true);
this.__searchDialog.setModal(true);
this.__searchDialog.setTitle('Search ...');
return this.__searchDialog;
Expand Down
18 changes: 17 additions & 1 deletion application/playground/source/class/playground/Application.js
Expand Up @@ -112,6 +112,12 @@ qx.Class.define("playground.Application",
// Call super class
this.base(arguments);

// quickfix for the playground for BUG #7680
this.getRoot().getContentElement().setStyle("-webkit-backface-visibility", "hidden");

// register error handler
qx.event.GlobalError.setErrorHandler(this.__onGlobalError, this);

// container layout
var layout = new qx.ui.layout.VBox();

Expand Down Expand Up @@ -824,7 +830,7 @@ qx.Class.define("playground.Application",
// try to create a function
try {
this.__oldCode = code;
this.fun = new Function(code);
this.fun = qx.event.GlobalError.observeMethod(new Function(code));
} catch(ex) {
var exc = ex;
}
Expand Down Expand Up @@ -886,6 +892,16 @@ qx.Class.define("playground.Application",
},


/**
* Handler for global errors.
*
* @param e {Event} The global error event
*/
__onGlobalError : function(e) {
this.error(e);
},


// ***************************************************
// STANDALONE SUPPORT
// ***************************************************
Expand Down
Expand Up @@ -113,7 +113,7 @@ qx.Class.define("playground.view.RiaPlayArea",
if (this._initialized) {
return;
}
qx.html.Element.flush();
qx.ui.core.queue.Manager.flush();

var playRootEl = this._dummy.getContentElement().getDomElement();
this._playRoot = new qx.ui.root.Inline(playRootEl);
Expand All @@ -124,6 +124,10 @@ qx.Class.define("playground.view.RiaPlayArea",
this.__playField.getChildren = this.__playField._getChildren =
function() { return [self._playRoot]; };

// copy the initial size which is availbale due to the flush at the beginning
this._playRoot.setMinWidth(this.__playField.getBounds().width);
this._playRoot.setMinHeight(this.__playField.getBounds().height);

this.__playField.addListener("resize", function(e) {
var data = e.getData();
this._playRoot.setMinWidth(data.width);
Expand Down
2 changes: 1 addition & 1 deletion application/showcase/source/class/showcase/Application.js
Expand Up @@ -162,7 +162,7 @@ qx.Class.define("showcase.Application",
}
}, this);
}, this);
};
}

var listController = new qx.data.controller.List(pages, list, "name");
listController.setIconPath("icon");
Expand Down
6 changes: 4 additions & 2 deletions application/todo/config.json
Expand Up @@ -10,7 +10,9 @@

"export" :
[
"build-mini"
"build-mini",
"clean",
"distclean"
],

"default-job" : "build-mini",
Expand All @@ -25,7 +27,7 @@
"ROOT" : "."
}

,"jobs" :
,"jobs" :
{
"build-mini" : // cannot use 'build-min' b.o. cyclic extends
{
Expand Down
Expand Up @@ -66,7 +66,7 @@ qx.Class.define("widgetbrowser.pages.Control",
this.__vbox.add(openColorPopup);
openColorPopup.addListener("execute", function()
{
colorPopup.placeToWidget(openColorPopup);
colorPopup.placeToWidget(openColorPopup, true);
colorPopup.show();
});

Expand All @@ -79,4 +79,4 @@ qx.Class.define("widgetbrowser.pages.Control",

}
}
});
});
14 changes: 9 additions & 5 deletions component/apiviewer/source/class/apiviewer/ui/ClassViewer.js
Expand Up @@ -472,6 +472,15 @@ qx.Class.define("apiviewer.ui.ClassViewer",
);
}

var seeAlso = apiviewer.ui.panels.InfoPanel.createSeeAlsoHtml(classNode);
if (seeAlso) {
if (classHtml.length > 0) {
classHtml.splice(-1, 0, seeAlso);
} else {
classHtml.add(seeAlso);
}
}

if (classNode.getErrors().length > 0) {
classHtml.add(
'<div class="class-description">',
Expand All @@ -494,11 +503,6 @@ qx.Class.define("apiviewer.ui.ClassViewer",
classHtml.add(this.__getDependentClassesHtml(classNode.getImplementations(), "Implementations of this interface:"));
classHtml.add(this.__getDependentClassesHtml(classNode.getIncluder(), "Classes including this mixin:"));

var construct = classNode.getConstructor();
if (construct) {
classHtml.add(apiviewer.ui.panels.InfoPanel.createSeeAlsoHtml(construct));
}

if (classNode.isDeprecated())
{
classHtml.add('<h2 class="warning">', "Deprecated:", '</h2>');
Expand Down
Expand Up @@ -321,7 +321,11 @@ qx.Class.define("apiviewer.ui.panels.InfoPanel", {
if (seeAlsoLinks.length != 0) {
seeAlsoLinks.add(", ");
}
seeAlsoLinks.add(this.createItemLinkHtml(see[i], node.getClass()));
var link = this.createItemLinkHtml(see[i], node.getClass());
if (link.indexOf("http") === 0) {
link = "<a target='_blank' href='" + link + "'>" + link + "</a>";
}
seeAlsoLinks.add(link);
}

if (!seeAlsoLinks.isEmpty())
Expand All @@ -332,7 +336,7 @@ qx.Class.define("apiviewer.ui.panels.InfoPanel", {
'<div class="item-detail-headline">', "See also:", '</div>',
'<div class="item-detail-text">', seeAlsoLinks, '</div>'
);
return seeAlsoHtml.get()
return seeAlsoHtml.get();
}
}

Expand Down

0 comments on commit beed914

Please sign in to comment.