Skip to content
Browse files

Merge pull request #233 from codam/master

samples and readme updates
  • Loading branch information...
2 parents 6ea0d14 + d066824 commit a6073c62c8bf7636d093419612c44814b8885bae @codam codam committed
View
87 readme.txt
@@ -1,3 +1,12 @@
+/*
+ * Cocktail, HTML rendering engine
+ * http://haxe.org/com/libs/cocktail
+ *
+ * Copyright (c) Silex Labs
+ * Cocktail is available under the MIT license
+ * http://www.silexlabs.org/labs/cocktail-licensing/
+*/
+
== Cocktail, HTML rendering engine ==
Cocktail is cross-platform, embeddable and native.
@@ -14,59 +23,55 @@ Native
Cocktail do not require any virtual machine, it is not interpreted.
This has a positive impact on the performances and allows access to native functionnalities and libraries in native language such as objective C, C++, php, ActionScript…
-Silex Labs Cocktail library is released under GPL.
+Silex Labs Cocktail library is released under MIT.
== Links ==
-Articles and demos
+Tutorials
- * Getting started with Cocktail
- => http://haxe.org/com/libs/cocktail/getting_started_with_cocktail
- * Cocktail web app demo
- => http://haxe.org/com/libs/cocktail/cocktail_web_app_demo
- * Cocktail v1.0 Sunrise: progress report
- => http://www.silexlabs.org/?p=130892
- * Cocktail, for an open bar community !
- => http://www.silexlabs.org/the-blog
- * Combining Cocktail Haxe with PhoneGap
- => http://www.blog.elimak.com/2012/07/combining-cocktail-haxe-with-phonegap/
+* Getting started with Cocktail
+=> http://haxe.org/com/libs/cocktail/getting_started_with_cocktail
Developer resources
- * Main wiki on Haxe libs
- => http://haxe.org/com/libs/cocktail
- * Forums and working group
- => http://www.silexlabs.org/groups/labs/cocktail/forum/
- * Cocktail download and source code
- => https://github.com/silexlabs/Cocktail
+* Main wiki on Haxe libs
+=> http://haxe.org/com/libs/cocktail
+* Forums and working group
+=> http://www.silexlabs.org/groups/labs/cocktail/forum/
+* Cocktail download and source code
+=> https://github.com/silexlabs/Cocktail
+* Old Wiki on Git Hub
+=> https://github.com/silexlabs/Cocktail/wiki
Other resources
- * Cocktail supported platforms
- => http://haxe.org/com/libs/cocktail/supported_platforms
- * Cocktail future platforms
- => http://www.silexlabs.org/groups/labs/cocktail/docs/cocktail-future-platforms
- * Official Cocktail definition
- => http://www.silexlabs.org/groups/labs/cocktail/docs/official-cocktail-definition
- * Cocktail road map
- => https://github.com/silexlabs/Cocktail/wiki/Road-map
- * Cocktail GPL license
- => http://www.gnu.org/copyleft/gpl.html
+* Cocktail supported platforms
+=> http://haxe.org/com/libs/cocktail/supported_platforms
+* Cocktail future platforms
+=> http://www.silexlabs.org/groups/labs/cocktail/docs/cocktail-future-platforms
+* Official Cocktail definition
+=> http://www.silexlabs.org/groups/labs/cocktail/docs/official-cocktail-definition
+* Cocktail road map
+=> http://haxe.org/com/libs/cocktail/cocktail_s_road_map
+* Cocktail MIT license
+=> http://www.silexlabs.org/labs/cocktail-licensing/
+* W3C CSS unit tests
+=> http://haxe.org/com/libs/cocktail/w3c_css_unit_tests
Release notes
- * Cocktail Release notes - v1.0.0alpha1
- => http://www.silexlabs.org/groups/labs/cocktail/docs/cocktail-release-notes-v1-0-0alpha1
- * Cocktail Release notes - v1.0.0alpha2
- => http://www.silexlabs.org/groups/labs/cocktail/docs/cocktail-release-notes-v1-0-0alpha2
-
+* Cocktail Release notes – v1.0.0alpha1
+=> http://www.silexlabs.org/groups/labs/cocktail/docs/cocktail-release-notes-v1-0-0alpha1
+* Cocktail Release notes – v1.0.0alpha2
+=> http://www.silexlabs.org/groups/labs/cocktail/docs/cocktail-release-notes-v1-0-0alpha2
+Articles and demos
-== license ==
-
-Cocktail, HTML rendering engine
-http://haxe.org/com/libs/cocktail
-
-Copyright (c) Silex Labs
-Cocktail is available under the MIT license
-http://www.silexlabs.org/labs/cocktail-licensing/
+* Cocktail web app demo
+=> http://haxe.org/com/libs/cocktail/cocktail_web_app_demo
+* Cocktail v1.0 Sunrise: progress report
+=> http://www.silexlabs.org/?p=130892
+* Cocktail, for an open bar community !
+=> http://www.silexlabs.org/the-blog* Cocktail, for an open bar community !
+* Combining Cocktail with PhoneGap
+=> http://www.blog.elimak.com/2012/07/combining-cocktail-haxe-with-phonegap/
View
30 samples/01-HelloWorld/compile-nme.nmml
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
- <app title="Cocktail" main="Cocktail" package="org.silexlabs.cocktail" version="1.0.0" company="Silex Labs" />
- <window width="1024" height="768" fps="30" orientation="portrait" resizable="false" unless="target_flash" />
-
- <set name="BUILD_DIR" value="bin" />
- <set name="SWF_VERSION" value="10.2" />
+ <app main="Cocktail" path="bin" file="Main"/>
+ <meta title="Cocktail" package="org.silexlabs.cocktail" version="1.0.0" company="Silex Labs" />
+ <window width="350" height="450" fps="30" orientation="portrait" resizable="true" unless="target_flash" />
- <classpath name="../../src" />
- <classpath name="src" />
+ <set name="SWF_VERSION" value="10.2" />
- <haxelib name="nme" />
+ <classpath name="../../src" />
+ <classpath name="src" />
- <ndll name="std" />
- <ndll name="regexp" />
- <ndll name="zlib" />
- <ndll name="nme" haxelib="nme" />
-
- <compilerflag name="--remap js:cocktail" />
- <compilerflag name="--macro Cocktail.create('index.html')" />
+ <haxelib name="nme" />
+
+ <ndll name="std" />
+ <ndll name="regexp" />
+ <ndll name="zlib" />
+ <ndll name="nme" haxelib="nme" />
+
+ <compilerflag name="--remap js:cocktail" />
+ <compilerflag name="--macro Cocktail.create('index.html')" />
</project>
View
40 samples/02-load_picture/compile-nme.nmml
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
- <app title="Cocktail" main="Cocktail" package="org.silexlabs.cocktail" version="1.0.0" company="Silex Labs" />
- <window width="1024" height="768" fps="30" orientation="portrait" resizable="false" unless="target_flash" />
-
- <set name="BUILD_DIR" value="bin" />
- <set name="SWF_VERSION" value="10.2" />
-
- <classpath name="../../src" />
- <classpath name="src" />
-
- <haxelib name="nme" />
-
- <assets path="assets" include="*" ></assets>
-
- <ndll name="std" />
- <ndll name="regexp" />
- <ndll name="zlib" />
- <ndll name="nme" haxelib="nme" />
-
- <compilerflag name="--remap js:cocktail" />
- <compilerflag name="--macro Cocktail.create('src/index.html','Main')" />
+ <app main="Cocktail" path="bin" file="Main"/>
+ <meta title="Cocktail" package="org.silexlabs.cocktail" version="1.0.0" company="Silex Labs" />
+ <window width="350" height="350" fps="30" orientation="portrait" resizable="true" unless="target_flash" />
+
+ <set name="SWF_VERSION" value="10.2" />
+
+ <classpath name="../../src" />
+ <classpath name="src" />
+
+ <haxelib name="nme" />
+
+ <assets path="assets"></assets>
+
+ <ndll name="std" />
+ <ndll name="regexp" />
+ <ndll name="zlib" />
+ <ndll name="nme" haxelib="nme" />
+
+ <compilerflag name="--remap js:cocktail" />
+ <compilerflag name="--macro Cocktail.create('src/index.html','Main')" />
</project>
View
6 samples/03-style_text/compile-nme.nmml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
- <app title="Cocktail" main="Cocktail" package="org.silexlabs.cocktail" version="1.0.0" company="Silex Labs" />
- <window width="1024" height="768" fps="30" orientation="portrait" resizable="false" unless="target_flash" />
+ <app main="Cocktail" path="bin" file="Main"/>
+ <meta title="Cocktail" package="org.silexlabs.cocktail" version="1.0.0" company="Silex Labs" />
+ <window width="350" height="750" fps="30" orientation="portrait" resizable="true" unless="target_flash" />
- <set name="BUILD_DIR" value="bin" />
<set name="SWF_VERSION" value="10.2" />
<classpath name="../../src" />
View
6 samples/04-inner_html/compile-nme.nmml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
- <app title="Cocktail" main="Cocktail" package="org.silexlabs.cocktail" version="1.0.0" company="Silex Labs" />
- <window width="1024" height="768" fps="30" orientation="portrait" resizable="false" unless="target_flash" />
+ <app main="Cocktail" path="bin" file="Main"/>
+ <meta title="Cocktail" package="org.silexlabs.cocktail" version="1.0.0" company="Silex Labs" />
+ <window width="350" height="350" fps="30" orientation="portrait" resizable="true" unless="target_flash" />
- <set name="BUILD_DIR" value="bin" />
<set name="SWF_VERSION" value="10.2" />
<classpath name="../../src" />
View
4 samples/05-HaxeJS-vs-HTML/Main.hx
@@ -52,7 +52,7 @@ class Main
//HTML & semantics
var paragraph = Lib.document.createElement("p");
- paragraph.appendChild(Lib.document.createTextNode("Cocktail is a HTML rendering engine. It focuses on UIs and bridges the gap between all the targets supported by haXe."));
+ paragraph.appendChild(Lib.document.createTextNode("Cocktail is a HTML rendering engine."));
Lib.document.body.appendChild(paragraph);
//CSS text
@@ -87,7 +87,7 @@ class Main
function buildDomHtml()
{
//HxTML
- Lib.document.body.innerHTML = '<div style="width: 50%; margin-right: auto; margin-left: auto; background-color: rgba(255, 255, 255, 0.5);"><h1 style="word-spacing: 10px; color: orange; font-family: arial;">Hello Cocktail</h1><p>Cocktail is a cross-platform library for the haXe programming language. It focuses on UIs and bridges the gap between all the targets supported by haXe.<img id="pic" src="assets/cocktail.png" /></p></div>';
+ Lib.document.body.innerHTML = '<div style="width: 50%; margin-right: auto; margin-left: auto; background-color: rgba(255, 255, 255, 0.5);"><h1 style="word-spacing: 10px; color: orange; font-family: arial;">Hello Cocktail</h1><p>Cocktail is a HTML rendering engine.<img id="pic" src="assets/cocktail.png" /></p></div>';
}
View
9 samples/GettingStarted/Main_js.hxproj
@@ -2,7 +2,7 @@
<project version="2">
<!-- Output SWF options -->
<output>
- <movie outputType="Application" />
+ <movie outputType="CustomBuild" />
<movie input="" />
<movie path="bin\js\Main.js" />
<movie fps="0" />
@@ -23,7 +23,7 @@
<option flashStrict="False" />
<option mainClass="Cocktail" />
<option enabledebug="False" />
- <option additional="-cmd cp -R assets bin\swf\" />
+ <option additional="" />
</build>
<!-- haxelib libraries -->
<haxelib>
@@ -40,13 +40,12 @@
<!-- Executed before build -->
<preBuildCommand />
<!-- Executed after build -->
- <postBuildCommand alwaysRun="False">haxe compile-js.hxml
-haxe compile-swf.hxml</postBuildCommand>
+ <postBuildCommand alwaysRun="False" />
<!-- Other project options -->
<options>
<option showHiddenPaths="False" />
<option testMovie="Custom" />
- <option testMovieCommand="bin/js/index.html" />
+ <option testMovieCommand="compile-js.hxml" />
</options>
<!-- Plugin storage -->
<storage />
View
2 samples/GettingStarted/compile-js.hxml
@@ -8,4 +8,4 @@
--macro Cocktail.create('src/index.html','Main')
#copy assets directory
--cmd cp -R assets bin\swf\
+-cmd cp -R assets bin\js\
View
40 samples/GettingStarted/compile-nme.nmml
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
- <app title="Cocktail" main="Cocktail" package="org.silexlabs.cocktail" version="1.0.0" company="Silex Labs" />
- <window width="1024" height="768" fps="30" orientation="portrait" resizable="false" unless="target_flash" />
-
- <set name="BUILD_DIR" value="bin" />
- <set name="SWF_VERSION" value="10.2" />
-
- <classpath name="../../src" />
- <classpath name="src" />
-
- <haxelib name="nme" />
-
- <assets path="assets" include="*" ></assets>
-
- <ndll name="std" />
- <ndll name="regexp" />
- <ndll name="zlib" />
- <ndll name="nme" haxelib="nme" />
-
- <compilerflag name="--remap js:cocktail" />
- <compilerflag name="--macro Cocktail.create('src/index.html','Main')" />
+ <app main="Cocktail" path="bin" file="Main"/>
+ <meta title="Cocktail" package="org.silexlabs.cocktail" version="1.0.0" company="Silex Labs" />
+ <window width="350" height="350" fps="30" orientation="portrait" resizable="true" unless="target_flash" />
+
+ <set name="SWF_VERSION" value="10.2" />
+
+ <classpath name="../../src" />
+ <classpath name="src" />
+
+ <haxelib name="nme" />
+
+ <assets path="assets"></assets>
+
+ <ndll name="std" />
+ <ndll name="regexp" />
+ <ndll name="zlib" />
+ <ndll name="nme" haxelib="nme" />
+
+ <compilerflag name="--remap js:cocktail" />
+ <compilerflag name="--macro Cocktail.create('src/index.html','Main')" />
</project>
View
60 samples/GettingStarted/src/Main.hx
@@ -6,7 +6,6 @@
* Cocktail is available under the MIT license
* http://www.silexlabs.org/labs/cocktail-licensing/
*/
-import haxe.Http;
import js.Lib;
import js.Dom;
@@ -33,29 +32,6 @@ class Main
}
/**
- * Creates a centered div container and attach it to the body
- * @return container
- */
- public static function createContainer():HtmlDom
- {
- // create a container to gather all of our visual elements
- var container = Lib.document.createElement("div");
-
- // apply styles to the container
- container.style.st = container.style.marginRight = "auto";
- container.style.width = "150px";
- container.style.textAlign = "center";
-
- // create a reference to the body
- var body = Lib.document.body;
-
- //attach the container to the body
- body.appendChild(container);
-
- return container;
- }
-
- /**
* Mouse Down callback. Changes the image to be displayed.
* @param event
*/
@@ -73,42 +49,6 @@ class Main
{
var image:Image = cast(event.target);
image.src = "assets/icone_cocktail_blanche_ombre.png";
-
- try {
- // calls the http request
- var request:Http = new Http("assets/feed.txt");
- // sets the callbacks
- request.onData = onData;
- request.onError = onError;
- // closes the http request
- request.request(false);
- }
- catch (error:Dynamic) {
- onError(error);
- }
- }
-
- /**
- * Http request success callback. Attach the external file content to the stage using a centered container.
- * @param string
- */
- public static function onData(string:String):Void
- {
- // create a container and attch it to the body
- var container = createContainer();
- // create a text node to display the content of the file
- var text = Lib.document.createTextNode(string);
- // attach the text node to the container
- container.appendChild(text);
- }
-
- /**
- * Http request error callback. Displays an error message.
- * @param string
- */
- public static function onError(msg:Dynamic):Void
- {
- trace("there was an error while loading the external data");
}
}
View
6 samples/GettingStarted/src/index.html
@@ -3,9 +3,9 @@
<title>Getting Started with Cocktail</title>
</head>
<body>
- <div style="margin-right: auto; margin-left: auto; text-align: center; ">
- <h1 style="word-spacing: 10px; color: orange; font-family: arial; ">Hello Cocktail</h1>
- <p>Cocktail is a HTML rendering engine.</p>
+ <h1 style="word-spacing:10px; color:orange; font-family:arial; margin-top:0px; margin-bottom:0px; text-align:center;">Hello Cocktail</h1>
+ <p style="text-align:center;">Cocktail is a HTML rendering engine.</p>
+ <div style="text-align:center;">
<img id="icon" alt="cocktail" src="assets/icone_cocktail_blanche_ombre.png" width="132" height="132"></img>
</div>
</body>

0 comments on commit a6073c6

Please sign in to comment.
Something went wrong with that request. Please try again.