Skip to content

Commit f98ef1d

Browse files
committed
Merge branch 'master' of https://github.com/unify/qooxdoo
2 parents bd39f1e + b6481f4 commit f98ef1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1258
-580
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ qooxdoo/component/inspector/source/script
1010
qooxdoo/component/inspector/build
1111
qooxdoo/component/inspector/test
1212
qooxdoo/component/inspector/api
13+
qooxdoo/component/apiviewer/source/script
1314
qooxdoo/documentation/manual/build
1415
qooxdoo/application/feedreader/inspector
1516
qooxdoo/application/demobrowser/build
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/* ************************************************************************
2+
3+
qooxdoo - the new era of web development
4+
5+
http://qooxdoo.org
6+
7+
Copyright:
8+
2004-2009 1&1 Internet AG, Germany, http://www.1und1.de
9+
10+
License:
11+
LGPL: http://www.gnu.org/licenses/lgpl.html
12+
EPL: http://www.eclipse.org/org/documents/epl-v10.php
13+
See the LICENSE file in the project's top-level directory for details.
14+
15+
Authors:
16+
* Martin Wittemann (martinwittemann)
17+
* Christian Hagendorn (chris_schmidt)
18+
19+
************************************************************************ */
20+
21+
/**
22+
* @tag filter
23+
*/
24+
qx.Class.define("demobrowser.demo.virtual.ListWithFilter",
25+
{
26+
extend : qx.application.Standalone,
27+
28+
members :
29+
{
30+
main: function()
31+
{
32+
this.base(arguments);
33+
34+
// create the data
35+
var rawData = [];
36+
for (var i = 0; i < 8; i++) {
37+
rawData.push(i);
38+
}
39+
var data = new qx.data.Array(rawData);
40+
41+
// create the widget
42+
var list = new qx.ui.list.List(data);
43+
44+
// add the widgets to the document
45+
this.getRoot().add(list, {left: 10, top: 80});
46+
47+
// create the delegates for the filter
48+
var delegateOdd = {};
49+
delegateOdd.filter = function(data) {
50+
return parseInt(data) % 2 == 1;
51+
};
52+
var delegateEven = {};
53+
delegateEven.filter = function(data) {
54+
return parseInt(data) % 2 == 0;
55+
};
56+
57+
var filterNameLabel = new qx.ui.basic.Label("init");
58+
this.getRoot().add(filterNameLabel, {left: 10, top: 290});
59+
var options = {
60+
converter: function(data) {
61+
if (data == delegateEven) {
62+
return "Show only even numbers."
63+
} else if (data == delegateOdd) {
64+
return "Show only odd numbers."
65+
}
66+
return "Show all numbers."
67+
}
68+
};
69+
list.bind("delegate", filterNameLabel, "value", options);
70+
71+
72+
/* ***********************************************
73+
* Controlls: Do only work on the data array
74+
* ********************************************* */
75+
var addItemButton = new qx.ui.form.Button("Add an item");
76+
addItemButton.setWidth(120);
77+
this.getRoot().add(addItemButton, {left: 130, top: 80});
78+
addItemButton.addListener("execute", function() {
79+
data.push(data.length);
80+
}, this);
81+
82+
var removeItemButton = new qx.ui.form.Button("Remove an item");
83+
removeItemButton.setWidth(120);
84+
this.getRoot().add(removeItemButton, {left: 130, top: 115});
85+
removeItemButton.addListener("execute", function() {
86+
data.pop();
87+
}, this);
88+
89+
var logDataButton = new qx.ui.form.Button("Write data to log");
90+
logDataButton.setWidth(120);
91+
this.getRoot().add(logDataButton, {left: 130, top: 150});
92+
logDataButton.addListener("execute", function() {
93+
// open the console
94+
qx.log.appender.Console.show();
95+
// push the data in the console
96+
this.info(data.toString());
97+
}, this);
98+
99+
var changeFilterButton = new qx.ui.form.Button("Odd / Even filter");
100+
changeFilterButton.setWidth(120);
101+
this.getRoot().add(changeFilterButton, {left: 130, top: 185});
102+
changeFilterButton.addListener("execute", function() {
103+
list.getDelegate() == delegateOdd ? list.setDelegate(delegateEven) : list.setDelegate(delegateOdd);
104+
}, this);
105+
106+
var removeFilterButton = new qx.ui.form.Button("Remove filter");
107+
removeFilterButton.setWidth(120);
108+
this.getRoot().add(removeFilterButton, {left: 130, top: 220});
109+
removeFilterButton.addListener("execute", function() {
110+
list.setDelegate(null);
111+
}, this);
112+
113+
var reverseButton = new qx.ui.form.Button("Reverse order");
114+
reverseButton.setWidth(120);
115+
this.getRoot().add(reverseButton, {left: 130, top: 255});
116+
reverseButton.addListener("execute", function() {
117+
data.reverse();
118+
}, this);
119+
120+
121+
/* ***********************************************
122+
* DESCRIPTIONS
123+
* ********************************************* */
124+
// List Selection sync description
125+
var description = new qx.ui.basic.Label();
126+
description.setRich(true);
127+
description.setWidth(200);
128+
description.setValue(
129+
"<b>Filtered List</b><br/>"
130+
+ "List showing numbered items, bound to a data array."
131+
);
132+
this.getRoot().add(description, {left: 20, top: 10});
133+
}
134+
}
135+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<script type="text/javascript" src="../helper.js"></script>
6+
</head>
7+
<body>
8+
9+
</body>
10+
</html>

qooxdoo/documentation/manual/source/pages/development/profiling.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Profiling Applications
44
**********************
55

6-
qooxdoo has build in a cross-browser, pure JavaScript profiler. If the profiler is enabled, each call of a method defined by qooxdoo's class declaration can be measured. The profiler is able to compute both the total own time and the call count of any method.
6+
qooxdoo has built-in a cross-browser, pure JavaScript profiler. If the profiler is enabled, each call of a method defined by qooxdoo's class declaration can be measured. The profiler is able to compute both the total own time and the call count of any method.
77

88
Since the profiler is implemented in pure JavaScript, it is totally cross-browser and works on any supported browser.
99

@@ -12,14 +12,20 @@ Since the profiler is implemented in pure JavaScript, it is totally cross-browse
1212
How to enable the Profiler
1313
==========================
1414

15-
Basically set the variant ``qx.aspects`` to ``on`` and be sure to include the class `qx.dev.Profile <http://api.qooxdoo.org/#qx.dev.Profile>`_. The class should be included before other classes.
15+
Basically set the variant ``qx.aspects`` to ``on`` and be sure to include the class `qx.dev.Profile <http://api.qooxdoo.org/#qx.dev.Profile>`_. The class should be included before other classes. The easiest way to achieve that is to extend the ``profiling`` helper job in a job that creates your application. For example, to enable profiling in the source version of your app, go to the ``"jobs"`` section of your config.json, and add ::
16+
17+
"source-script" : {
18+
"extend" : [ "profiling" ]
19+
}
20+
21+
1622

1723
.. _pages/profiling#how_to_use_the_profiler:
1824

1925
How to use the Profiler
2026
=======================
2127

22-
The profiler can be controlled either hard-wired in the application code (like the demo browser does for instance) or interactively using a JavaScript shell like FireBug for Firefox or DebugBar for IE.
28+
The profiler can be controlled either hard-wired in the application code, or interactively using a JavaScript shell like FireBug for Firefox or DebugBar for IE.
2329

2430
Profiling a certain action:
2531

qooxdoo/documentation/manual/source/pages/getting_started.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Tutorials
2020
tutorials/tutorial-part-3
2121
tutorials/tutorial-part-4-1
2222
tutorials/tutorial-part-4-2
23+
tutorials/tutorial-part-4-3
2324

2425
.. _index#sdk:
2526

qooxdoo/documentation/manual/source/pages/gui_toolkit/window_management.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Window Management
2-
============
2+
=================
33

44
Window is a widget used to show dialogs or to realize a MDI (Multiple Document Interface) applications. Windows can only be added to ``qx.ui.window.Desktop`` widgets, or to widgets which implement the ``qx.ui.window.IDesktop`` interface.
55

@@ -69,5 +69,5 @@ Related documentation
6969

7070

7171
Demos and API
72-
-----
72+
-------------
7373
To find out more, you can check the `desktop demo <http://demo.qooxdoo.org/1.2.x/demobrowser/index.html#widget~Desktop.html>`_ and the `API reference <http://demo.qooxdoo.org/1.2.x/apiviewer/index.html#qx.ui.window>`_.

qooxdoo/documentation/manual/source/pages/tutorials/tutorial-part-3.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ Pre-Evaluation
1212

1313
First, we need to specify what's the data we need to transfer. For that, we need to take a look what tasks our application can handle:
1414

15-
1. Show the friends timeline for a specific user.
15+
1. Show the public twitter timeline.
1616
2. Post a tweet.
1717

18-
So it's clear that we need to fetch the friends timeline (that's how it is called by twitter), and we need to post a message to twitter. It's time to take a look at the `twitter API <http://apiwiki.twitter.com/Twitter-API-Documentation>`_ so that we know what we need to do to communicate with the service.
18+
So it's clear that we need to fetch the public timeline (that's how it is called by twitter), and we need to post a message to twitter. It's time to take a look at the `twitter API <http://apiwiki.twitter.com/Twitter-API-Documentation>`_ so that we know what we need to do to communicate with the service.
1919
But keep in mind that we are still on a website so we can't just send some ``POST`` or ``GET`` requests due to cross-site scripting restrictions. The one thing we can and should do is take advantage of JSONP. If you have never heard of JSONP, take some time to read the `article on ajaxian <http://ajaxian.com/archives/jsonp-json-with-padding>`_ to get further details.
2020

2121
.. _pages/tutorials/tutorial-part-3#creating_the_data_access_class:
2222

2323
Creating the Data Access Class
2424
==============================
2525

26-
Now, that we know how we want to communicate, we can tackle the first task, fetching the friends timeline. twitter offers a `JSONP service for that <http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-friends_timeline>`_ which we can use. Luckily, twitter also takes care of the login process on the server side so we don't need to bother with that in the client. The following URL returns the friends timeline wrapped in a JavaScript method call (that's what JSONP is about):
26+
Now, that we know how we want to communicate, we can tackle the first task, fetching the public timeline. twitter offers a `JSONP service for that <http://dev.twitter.com/doc/get/statuses/public_timeline>`_ which we can use. Luckily, there is no login process on the server side so we don't need to bother with that in the client. The following URL returns the public timeline wrapped in a JavaScript method call (that's what JSONP is about):
2727

2828
::
2929

30-
http://twitter.com/statuses/friends_timeline.json?callback=methodName
30+
http://api.twitter.com/1/statuses/public_timeline.json?callback=methodName
3131

3232
Now we know how to get the data from twitter. Its time for us to go back to the qooxdoo code. It is, like in the case of the UI, a good idea to create a separate class for the communication layer. Therefore, we create a class named ``TwitterService``. We don't want to inherit from any advanced qooxdoo class so we extend straight from ``qx.core.Object``. The code for that class should looks like this:
3333

@@ -59,7 +59,7 @@ Now it's time to get this method working. But how do we load the data in qooxdoo
5959
::
6060

6161
if (this.__store == null) {
62-
var url = "http://twitter.com/statuses/friends_timeline.json";
62+
var url = "http://api.twitter.com/1/statuses/public_timeline.json";
6363
this.__store = new qx.data.store.Jsonp(url, null, "callback");
6464
// more to do
6565
} else {

qooxdoo/documentation/manual/source/pages/tutorials/tutorial-part-4-1.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Tutorial Part 4.1: Form Handling
44
********************************
55

6+
.. note::
7+
8+
This tutorial is outdated! twitter changed its API and does not allow basic authentication anymore. Still, the qooxdoo part is valid and worth trying even if you can not access you friends timeline anymore.
9+
10+
611
In the previous steps of this tutorial, we :doc:`laid the groundwork <tutorial-part-1>` for a Twitter client application, gave it a :doc:`neat UI <tutorial-part-2>` and implemented a :doc:`communication layer <tutorial-part-3>`. One thing this application still lacks is a nice way for users to input their Twitter user name and password in order to post a status update. Fortunately, qooxdoo comes with a :doc:`forms API </pages/gui_toolkit/ui_form_handling>` that takes the pain out of creating form elements and handling user input.
712

813
Before we get started, make sure you're working on the version of the Twitter tutorial application tagged with `"Step 3" in the GitHub repository <http://github.com/wittemann/qooxdoo-tutorial/tree/Step3>`_. This includes the posting part of the communication layer that we'll be using in this tutorial.

0 commit comments

Comments
 (0)