Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoshan Karki <roxan@roxan-desktop.(none)>2009-12-30 07:38:03 (GMT)
committer Roshan Karki <roxan@roxan-desktop.(none)>2009-12-30 07:38:03 (GMT)
commitfaa55c0d17261ee45257fa6f22084c7dab9e9662 (patch)
treec9a3f831e6cc47dd97aa1b98674ec0eadf716334
parent8fae0a9c4c0c9fc027383b716af65884818a3221 (diff)
parent9a525cb17b27f9f4d19200c79b12e11f78a23a23 (diff)
Merge branch 'master' of gitorious@git.sugarlabs.org:karma/mainline
-rw-r--r--bin/kbuild.js81
-rw-r--r--bin/kbuild.js~11
-rw-r--r--examples/NumberWords-svg/assets/svg/crossword.svg178
-rw-r--r--examples/NumberWords-svg/index.html22
-rw-r--r--examples/NumberWords-svg/index.html~21
-rw-r--r--examples/NumberWords-svg/js/lesson.js16
-rw-r--r--examples/NumberWords-svg/js/lesson.js~24
7 files changed, 353 insertions, 0 deletions
diff --git a/bin/kbuild.js b/bin/kbuild.js
new file mode 100644
index 0000000..a3c2b41
--- /dev/null
+++ b/bin/kbuild.js
@@ -0,0 +1,81 @@
+
+//requires narwhal
+var file = require('file');
+var os = require('os');
+var args = require('args');
+
+//list of repos
+var REPOS = [ ["folder_name", "git_url"],
+ ["folder_name", "git_url"]
+ ];
+
+var XO_BUNDLE_REPO = "~/tmp/bundle";
+
+
+var GIT_DIR = "~/tmp/gitDir";
+var BUILD_DIR = "~/tmp/build";
+var STABLE_TARGET = "~/tmp/stableTarget";
+var UNSTABLE_TARGET = "~/tmp/unstableTarget";
+
+var tag = "master";
+//folders used by each lesson as it is processed
+var lessonGitDir = "";
+var lessonBuildDir = "";
+
+var addExitCodeCheck = function (cmd) {
+ return cmd.concat('; echo $?');
+};
+
+var isSuccessful = function(str){
+ var newArray = str.split('\n');
+ return newArray[newArray.length -2] === "0" ?
+ true : false;
+};
+
+//parse args
+var parser = new args.Parser();
+
+parser.help(
+ 'Builds and distributes Karma bundle to different type of targets'
+);
+
+parser.option('-t', '--tag', 'tag')
+ .help("which tag to checkout for all lessons")
+ .set();
+
+parser.helpful();
+
+print(tag);
+
+
+
+//check that the gitdir exists
+//if not create it
+
+//check that build dir exists, if not create it
+//pull latest copy of XO_BUNDLE
+
+
+//loop through repos
+//check that it exists, if not create it and clone it
+//pulling each one so up to date
+
+//checkout the tag
+//if tag doesn't exist, delete all files except .git
+
+
+//after loop, copy all files except the .git ones to build directory
+
+//delete empty directories starting w/ "karma-"
+//delete unneeded directories like tests, docs
+
+
+//delete all tmp files from editors
+
+//edit all the .html and .css to use different paths except for lesson.js
+//move all the .js files except lesson.js to js/
+
+//somehow put links to all the lessons in a chakra index.html
+
+//rsync the whole structure to the target directory
+
diff --git a/bin/kbuild.js~ b/bin/kbuild.js~
new file mode 100644
index 0000000..0b472f3
--- /dev/null
+++ b/bin/kbuild.js~
@@ -0,0 +1,11 @@
+
+//requires narwhal
+
+//list of repos
+var repos = [ ["folder_name", "git_url"],
+ ["folder_name", "git_url"]
+ ];
+
+var CLONE_DIR = "";
+
+var BUILD_DIR = ""; \ No newline at end of file
diff --git a/examples/NumberWords-svg/assets/svg/crossword.svg b/examples/NumberWords-svg/assets/svg/crossword.svg
new file mode 100644
index 0000000..19fa940
--- /dev/null
+++ b/examples/NumberWords-svg/assets/svg/crossword.svg
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="323.42856"
+ height="174.57144"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47pre4 r22446"
+ sodipodi:docname="New document 1">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective2828"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2828-2"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2828-6"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2828-3"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2828-1"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2886"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2908"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.35"
+ inkscape:cx="341"
+ inkscape:cy="-162.28571"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1024"
+ inkscape:window-height="551"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-33.999996,-195.50504)">
+ <g
+ id="g2922">
+ <rect
+ y="285.21933"
+ x="35.999996"
+ height="82.857147"
+ width="77.142853"
+ id="rect2818-7"
+ style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <g
+ id="group1">
+ <rect
+ y="198.07646"
+ x="37.142857"
+ height="82.857147"
+ width="77.142853"
+ id="rect2818"
+ style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <rect
+ y="197.50504"
+ x="278.28571"
+ height="82.857147"
+ width="77.142853"
+ id="rect2818-1"
+ style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <rect
+ y="198.64789"
+ x="198"
+ height="82.857147"
+ width="77.142853"
+ id="rect2818-2"
+ style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <g
+ id="group2">
+ <rect
+ y="284.07648"
+ x="115.99999"
+ height="82.857147"
+ width="77.142853"
+ id="rect2818-0"
+ style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <rect
+ y="197.50504"
+ x="118.57143"
+ height="82.857147"
+ width="77.142853"
+ id="rect2818-5"
+ style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+ </g>
+ <rect
+ style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect2818-1-7"
+ width="77.142853"
+ height="82.857147"
+ x="275.71429"
+ y="284.93359" />
+ <rect
+ style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect2818-2-9"
+ width="77.142853"
+ height="82.857147"
+ x="196.57143"
+ y="283.21933" />
+ </g>
+</svg>
diff --git a/examples/NumberWords-svg/index.html b/examples/NumberWords-svg/index.html
new file mode 100644
index 0000000..dd93b92
--- /dev/null
+++ b/examples/NumberWords-svg/index.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>crossword demo</title>
+ <meta name="keywords"
+ content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal,urugay" />
+ <link rel="stylesheet" type="text/css" href="jquery.svg.css" />
+ <link rel="stylesheet" type="text/css" href="css/lesson.css" />
+ <script type="text/javascript" src="../../js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="../../js/karma.js"></script>
+ <script type="text/javascript" src="../../js/jquery.svg.js"></script>
+ <script type="text/javascript" src="../../js/jquery.svgdom.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+ </head>
+ <body>
+
+ <object id="crossword" data="assets/svg/crossword.svg" type="image/svg+xml"
+ width="500px" height="500px">
+ </object>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/examples/NumberWords-svg/index.html~ b/examples/NumberWords-svg/index.html~
new file mode 100644
index 0000000..a0f2568
--- /dev/null
+++ b/examples/NumberWords-svg/index.html~
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>crossword demo</title>
+ <meta name="keywords"
+ content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal,urugay" />
+ <link rel="stylesheet" type="text/css" href="jquery.svg.css" />
+ <link rel="stylesheet" type="text/css" href="css/lesson.css" />
+ <script type="text/javascript" src="../../js/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="../../js/karma.js"></script>
+ <script type="text/javascript" src="../../js/jquery.svg.js"></script>
+ <script type="text/javascript" src="../../js/jquery.svgdom.js"></script>
+ <script type="text/javascript" src="js/lesson.js"></script>
+ </head>
+ <body>
+
+ <object id="crossword" data="assets/svg/crossword.svg" type="image/svg+xml">
+ </object>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/examples/NumberWords-svg/js/lesson.js b/examples/NumberWords-svg/js/lesson.js
new file mode 100644
index 0000000..d9e9347
--- /dev/null
+++ b/examples/NumberWords-svg/js/lesson.js
@@ -0,0 +1,16 @@
+$(document).ready(
+ function(){
+ var k = Karma({
+ svg :[{'name':"crossword", 'domId':'crossword'} ]
+ });
+
+ k.ready(function() {
+ var root = k.svg.crossword.root;
+ $('#group1', root).addClass('foo')
+ [0].onclick= function() { console.log('foo');};
+ $('#group2:not(#group1)', root)[0].onclick = function() { console.log('bar');};
+ $('#group2', root).animate({svgFill:"blue"}, 1000);
+
+ });
+
+ }); \ No newline at end of file
diff --git a/examples/NumberWords-svg/js/lesson.js~ b/examples/NumberWords-svg/js/lesson.js~
new file mode 100644
index 0000000..2d04f79
--- /dev/null
+++ b/examples/NumberWords-svg/js/lesson.js~
@@ -0,0 +1,24 @@
+$(document).ready(
+ function(){
+ var k = Karma({
+ svg :[
+ {name:'capitals', domId: 'capitals'},
+ {name:'alien', domId: 'alien'},
+ {name:'spaceship', domId: 'spaceship'},
+ {name: 'help', domId: 'helpScreen'},
+ {name:'playAgain', domId:'playAgain'},
+ {name:'helpIcon', domId:'helpIcon'},
+ {name:'quitIcon', domId:'quitIcon'}
+ ],
+ audio:[
+ {name:'correct', file:'correct.ogg'},
+ {name:'incorrect', file:'incorrect.ogg'}
+ ]
+ });
+
+ k.ready(function() {
+
+
+ });
+
+ }); \ No newline at end of file