merged formfactors with js and css docs

This commit is contained in:
Bernhard Posselt
2013-02-09 14:19:15 +01:00
parent e578635998
commit 5fc0387366
5 changed files with 38 additions and 28 deletions

View File

@@ -123,4 +123,4 @@ After all this, we must return a boolean value to indicate the success or failur
Conclusion
----------
To fully support user migration for your app you must provide a import and export function under an instance of **OC_Migration_Provider** and put this code in the file :file:`appinfo/migrate.php`
To fully support user migration for your app you must provide an import and export function under an instance of **OC_Migration_Provider** and put this code in the file :file:`appinfo/migrate.php`

View File

@@ -1,19 +0,0 @@
Formfactors
===========
ownCloud automatically detects what kind of form factor you are using.
Supported form factors
----------------------
Currently supported are mobile, tablet, standalone and the default desktop view. Mobile is a mode that works good for touch screen smartphones. Tablet is optimized for devices like iPads or Android Tablets. The standalone view is a mode where only the content are an App is shown. The header, footer and side navigation is not visible. This is useful if ownCloud is embedded in other applications.
Over writing
------------
The auto detection can be overwritten by using the “formfactor” GET variable in the url.
How to use it in Apps?
----------------------
Developers can provide special versions of js or css files and templates. The special versions are automatically used if present. If not it falls back to the default files. If an App wants to provide a special mobile version of the css file it can just add a second file with a special name. The mobile version of example.css is example.mobile.css. The tablet template of foo.php is foo.tablet.php.

View File

@@ -15,7 +15,6 @@ App Developement
data-migration
templates
static
formfactors
unittesting
middleware
access

View File

@@ -30,11 +30,37 @@ To add a script in your controller method, use the controller's **addScript** an
?>
If you have to include an image in your CSS, use %appswebroot% and %webroot% for creating absolute paths to your image, for instance:
If you have to include an image or css file in your CSS, prepend the following to your path:
* **%appswebroot%**: gets the absolute path to your app
* **%webroot%**: gets the absolute path to owncloud
For example:
.. code-block:: css
.folder > .title {
background-image: url('%webroot%/core/img/places/folder.svg');
}
}
Formfactors
-----------
ownCloud automatically detects what kind of form factor you are using.
Currently supported are:
* **mobile**: works well on mobiles
* **tablet**: optimized for devices like iPads or Android Tablets
* **standalone**: mode where only the content are an App is shown. The header, footer and side navigation is not visible. This is useful if ownCloud is embedded in other applications.
The auto detection can be overwritten by using the “formfactor” GET variable in the url::
index.php/myapp?formfactor=mobile
If you want to provide a different stylesheet or javascript file for mobile devices just suffix the formfactor in the filename, like::
style.mobile.css
or::
script.tablet.css

View File

@@ -7,14 +7,14 @@ ownCloud provides its own templating system. The App Framework also provides the
Templates are abstracted by the TemplateResponse object and used and returned inside the controller method. Variables can be assigned to the Template by using the :php:class:`OCA\\AppFramework\\Http\\TemplateResponse::setParams` method:
:file:`controllers/yourcontroller.php`
.. code-block:: php
<?php
use \OCA\AppFramework\Http\TemplateResponse;
// ...
// in your controller
// inside the controller
public function index(){
@@ -58,7 +58,7 @@ Twig can also cache templates as simple PHP files. To make use of this, create a
A full reference can be found on the `Twig Template Reference <http://twig.sensiolabs.org/doc/templates.html>`_.
If you want to use Twig together with AngularJS the variable print characters **{{}}** of Angular will have to be adjusted. You can do that by setting a different $interpolateProvider in the :file:`coffee/app.coffee` config section:
If you want to use Twig together with AngularJS the variable print characters **{{}}** of Angular will have to be adjusted. You can do that by setting a different **$interpolateProvider** in the :file:`coffee/app.coffee` config section:
.. code-block:: js
@@ -138,7 +138,9 @@ In every template file you can easily access the template functions listed in :d
To prevent XSS the following PHP **functions for printing are forbidden: echo, print() and <?=**. Instead use the **p()** function for printing your values. Should you require unescaped printing, **double check for XSS** and use: :php:func:`print_unescaped`.
Templates can also include other templates by using the **$this->inc('templateName')** method. Use this if you find yourself repeating a lot of the same HTML constructs. The parent variables will also be available in the included templates, but should you require it, you can also pass new variables to it by using the second optional parameter for $this->inc.
Templates can also include other templates by using the **$this->inc('templateName')** method. Use this if you find yourself repeating a lot of the same HTML constructs.
The parent variables will also be available in the included templates, but should you require it, you can also pass new variables to it by using the second optional parameter as array for **$this->inc**.
@@ -148,6 +150,8 @@ Templates can also include other templates by using the **$this->inc('templateNa
<div>I am included but i can still access the parents variables!</div>
<?php p($_['name']); ?>
<?php print_unescaped($this->inc('other_template', array('variable' => 'value'))); ?>
**For more info, see** :doc:`../classes/core/templates`