Permalink
Browse files

fixed problem with branch

  • Loading branch information...
1 parent 528971a commit bc2eb5f401263eea230ab7ecf1d6eb3ed1f640d2 @FotoVerite FotoVerite committed Sep 3, 2010
Showing with 318 additions and 326 deletions.
  1. +31 −36 client/index.html
  2. +2 −290 client/js/app.js
  3. +285 −0 client/js/jup.js
View
@@ -116,52 +116,47 @@ <h3 class="feature ms{{milestone_id}}">
</div>
<footer>
- <table>
- <tr>
- <td>
- When you're ready to create code from this stuff, click here...
<div id="export" title="create code from this thing">
</div>
- <div id="export-data">
- <h2>this is currently stubbed out, will implement soon</h2>
-<pre>
-<code>
-vows.describe('Addition').addBatch({
- "Add two numbers": {
- "GIVEN I have entered 50 into the calculator": {
- topic: function () {
- /* Setup your test conditions here */
- },
- "AND I have entered 70 into the calculator": {
- topic: function () {
- /* Setup your test conditions here */
- },
- "WHEN I press add": {
- topic: function () {
- /* Setup your test conditions here */
- },
- "THEN the result should be 120 on the screen": function () {
- /* Setup your test assertions here */
- },
- }
- }
- }
- }
-}).export(module);
-</code>
-</pre>
- </div>
- </td>
- </tr>
- </table>
</footer>
</div> <!-- end of #container -->
+
+ <div id="export-data" style="display:none;">
+ <h2>this is currently stubbed out, will implement soon</h2>
+ <pre>
+ <code>
+ vows.describe('Addition').addBatch({
+ "Add two numbers": {
+ "GIVEN I have entered 50 into the calculator": {
+ topic: function () {
+ /* Setup your test conditions here */
+ },
+ "AND I have entered 70 into the calculator": {
+ topic: function () {
+ /* Setup your test conditions here */
+ },
+ "WHEN I press add": {
+ topic: function () {
+ /* Setup your test conditions here */
+ },
+ "THEN the result should be 120 on the screen": function () {
+ /* Setup your test assertions here */
+ },
+ }
+ }
+ }
+ }
+ }).export(module);
+ </code>
+ </pre>
+ </div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>!window.jQuery && document.write('<script src="js/jquery-1.4.2.min.js"><\/script>')</script>
<script src="js/jquery-ui-1.8.custom.min.js?v=1"></script>
<script src="js/jquery.hotKeys.js?v=1"></script>
<script src="js/underscore.js?v=1"></script>
+ <script src="js/jup.js?v=1"></script>
<script src="js/hi.js" type="text/javascript" charset="utf-8"></script>
<script src="js/plugins.js?v=1"></script>
View
@@ -148,7 +148,7 @@ $(function() {
$(document).bind('feature.add', function(e, feature){
var out = NJ.nup.renderFeature(1, feature);
- $('#featureslist').append($.jup.html(out));
+ $('#featureslist').append(out);
// close all other Featuresaccordions
$('#featureslist').accordion( "activate", false);
// rebind accordion
@@ -365,7 +365,7 @@ $(function() {
// for adding additional steps in a scenario
$('.add-step').live('click', function(){
- $(this).siblings('ul').append($.jup.html(NJ.nup.renderStep()));
+ $(this).siblings('ul').append(NJ.nup.renderStep());
$('.sortable-ui').sortable('refresh');
});
@@ -784,291 +784,3 @@ $(function() {
})().Main();
});
-
-(function() {
-
- var STR_MAPS = {
- HTML_DECODE: {
- '&lt;': '<'
- ,'&gt;': '>'
- ,'&amp;': '&'
- ,'&quot;': '"'
- },
- HTML_ENCODE: {
- '<': '&lt;'
- ,'>': '&gt;'
- ,'&': '&amp;'
- ,'"': '&quot;'
- },
- ESCAPE_CHARSS: {
- '\\': '\\\\',
- '\'': '\\\'',
- '"': '\\"',
- '\r': '\\r',
- '\n': '\\n',
- '\t': '\\t',
- '\f': '\\f',
- '\b': '\\b'
- }
- };
-
- var jExtras = {
-
- jup: (function() {
-
- var Util = {
-
- isArray: (function() { return Array.isArray || function(obj) {
- // isArray function adapted from underscore.js
- return !!(obj && obj.concat && obj.unshift && !obj.callee);
- }})(),
-
- sup: function(target, data) {
-
- return data ? target.replace(/\{\{([^\{\}]*)\}\}/g, function(str, r) {
- try { return data[r]; } catch(ex) {}
- }) : target;
- },
-
- translate: function (o, data) {
-
- var c = [], atts = [], count = 1, selfClosing = false;
-
- for (var i in o) {
- if (o.hasOwnProperty(i) ) {
-
- count++;
- selfClosing = false;
-
- if(typeof c[0] == "string") {
- switch(o[0].toLowerCase()) {
- case "area":
- case "base":
- case "basefont":
- case "br":
- case "hr":
- case "input":
- case "img":
- case "link":
- case "meta":
- selfClosing = true;
- break;
- }
- }
-
- if (o[i] && typeof o[i] == "object") {
-
- if(!Util.isArray(o[i])) {
- for(var attribute in o[i]) {
- if (o[i].hasOwnProperty(attribute)) {
- atts.push([" ", Util.sup(attribute, data).replace(/ /g, "-"), "=\"", Util.sup(o[i][attribute], data), "\""].join(""));
- }
- }
- c[i] = "";
- c[0] = [c[0], atts.join("")].join("");
- }
- else {
- c[i] = this.translate(o[i], data);
- }
- }
- else {
- c[i] = Util.sup(o[i], data);
- }
-
- if(typeof c[0] == "string") {
-
- c[0] = ["<", o[0], atts.join(""), (selfClosing ? "/>" : ">")].join("");
-
- if(selfClosing == false) {
- c.push("</" + o[0] + ">");
- }
- }
- }
- }
- if(count-1 == o.length) {
- return [c.join("")];
- }
- }
- };
-
- return {
- version: "0.2",
- data: function(str) {
- return ["{{", str, "}}"].join("");
- },
- html: function() {
-
- var args = Array.prototype.slice.call(arguments), structure = [], data = {};
-
- if(args.length == 2) {
- structure = args[1];
- data = args[0];
- }
- else {
- if(Util.isArray(args[0])) {
- structure = args[0];
- }
- else {
- data = args[0].data || null;
- structure = args[0].structure;
- }
- }
- if(Util.isArray(data)) {
-
- var copystack = [];
-
- for(var c=0; c < data.length; c++) {
- copystack.push(Util.translate(structure, data[c])[0]);
- }
- return copystack.join("");
- }
- else if(data) {
- for(var d=0; d < data.length; d++) {
- return Util.translate(args[2] ? structure : Util.translate(structure)[0], data[d]);
- }
- }
- return Util.translate(structure)[0];
- }
- };
- })(),
-
- hash: {
-
- path: function(hash) {
-
- var hash = window.location.hash;
- return hash.substr(1, hash.length).split("/");
- }
- },
-
- querystring: {
-
- toJSON: function(query) {
- /* Special thanks to @bga_ for this bit of code,
- a big improvement on my crummy RegEx version */
-
- query = query || window.location.search;
-
- var p = 0,
- ret = {},
- _unescape = unescape,
- key,
- value,
- queryLen;
-
- if(query.charAt(p) == '?') {
- ++p;
- }
-
- if(query.charAt(p) == '&') {
- ++p;
- }
-
- if(query.charAt(query.length - 1) != '&') {
- query += '&';
- }
-
- queryLen = query.length - 1;
-
- --p;
- while(++p < queryLen) {
-
- key = _unescape(query.slice(p, (p = query.indexOf('=', p))));
- value = _unescape(query.slice(++p, (p = query.indexOf('&', p))));
-
- ret[key] = value;
- }
-
- return ret;
- }
- },
-
- array: {
-
- group: function(a, callback) {
-
- var len = a.length, groups = [], keys = {};
- for (var i = 0; i < length; i++) {
- var key = callback(a[i], i);
- if (! key || !key.length) {
- continue;
- }
- var items = keys[key];
- if (!items) {
- items = [];
- items.key = key;
- keys[key] = items;
- groups.add(items);
- }
- items.add(a[i]);
- }
- return groups;
- },
-
- aggregate: function(a, seed, callback) {
- var len = a.length;
- for (var i = 0; i < length; i++) {
- seed = callback(seed, a[i], i, a);
- }
- return seed;
- },
-
- removeRange: function(a, index, count) {
- return a.splice(index, count);
- }
- },
-
- string: {
-
- html: {
-
- decode: function(s) {
- s = s.replace(/(&amp;|&lt;|&gt;|&quot;)/gi,
- function(_s, r) {
- return STR_MAPS.HTML_DECODE[r];
- });
- return s;
- },
-
- encode: function(s) {
- if (/([&<>"])/g.test(s)) {
- s = s.replace(/([&<>"])/g,
- function(_s, r) {
- return STR_MAPS.HTML_ENCODE[r];
- });
- }
- return s;
- }
- },
-
- quote: function(s) {
- s.replace(new RegExp("([\'\"\\\\\x00-\x1F\x7F-\uFFFF])", "g"),
- function(str, r) {
- return STR_MAPS.ESCAPE_CHARS[r] ||
- '\\u' + r.charCodeAt(0).toString(16).toUpperCase().padLeft(4, '0');
- });
- },
-
- subst: function(s, o) {
- var count = -1;
- return s.replace(/{{([^{}]*)}}/g,
- function(str, r) {
- if(!isNaN(r)) {
- return o[r];
- }
- count++;
- return o[(o instanceof Array) ? count : r];
- }
- );
- }
-
- }
- };
-
- // put everything under one roof. (assumption that $ is a library that has an extend method (most likely jQuery))
- window.$ = (typeof window.$ != "undefined") ? $.extend($, jExtras) : jExtras;
-
-
-
-})();
-
Oops, something went wrong.

0 comments on commit bc2eb5f

Please sign in to comment.