upgrade lodash to 3.10
This commit is contained in:
parent
28d75c9945
commit
2fc585df4d
|
@ -31,12 +31,8 @@
|
|||
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
|
||||
<!--<script src="playground/libs/ace-builds-1.1.8/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>-->
|
||||
<!--<script src="https://cdn.firebase.com/js/client/2.0.5/firebase.js"></script>-->
|
||||
<!--<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>-->
|
||||
<!--<script src="playground/libs.browser.js"></script>-->
|
||||
<script src="playground/dist/rt-main.browser.js"></script>
|
||||
<!--http://requirejs.org/docs/release/2.1.15/minified/require.js-->
|
||||
<!--<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.15/require.min.js"></script>-->
|
||||
<!--<script src="playground/dist/fiddle.min.js"></script>-->
|
||||
|
||||
<!--<script data-main="playground/fiddle-main.js" src="http://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.20/require.js"></script>-->
|
||||
<script data-main="playground/dist/fiddle.min.js" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.20/require.min.js"></script>
|
||||
|
|
|
@ -82,7 +82,6 @@
|
|||
|
||||
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
|
||||
<script src="playground/dist/rt-main.browser.min.js"></script>
|
||||
<!--<script data-main="playground/home-main.js" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.20/require.min.js"></script>-->
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.20/require.min.js"></script>
|
||||
<!--<script src="playground/home-main.js"></script>-->
|
||||
<script src="playground/dist/home.min.js"></script>
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -16,14 +16,14 @@ define(['lodash', 'react', './examples.rt',
|
|||
repeat: [rtRepeatCode, rtRepeatRT],
|
||||
weather: [weatherCode, weatherRT]
|
||||
};
|
||||
//samples = _.map(samples, function (tuple) {
|
||||
// return {templateProps: tuple[0], templateHTML: tuple[1]};
|
||||
//samples = _.map(samples, function (v, k) {
|
||||
// return {name: k, templateProps: _.template(v[0])({name: k}), templateHTML: v[1]};
|
||||
//});
|
||||
Object.keys(samples).forEach(function (k) {
|
||||
samples[k] = {name: k, templateProps: _.template(samples[k][0], {name: k}), templateHTML: samples[k][1]};
|
||||
_.each(samples, function (v, k) {
|
||||
samples[k] = {name: k, templateProps: _.template(v[0])({name: k}), templateHTML: v[1]};
|
||||
});
|
||||
|
||||
var Examples = React.createClass({
|
||||
return React.createClass({
|
||||
displayName: 'Examples',
|
||||
mixins: [React.addons.LinkedStateMixin],
|
||||
getInitialState: function () {
|
||||
|
@ -40,6 +40,4 @@ define(['lodash', 'react', './examples.rt',
|
|||
},
|
||||
render: examplesTemplate
|
||||
});
|
||||
|
||||
return Examples;
|
||||
});
|
||||
|
|
|
@ -1,52 +1,27 @@
|
|||
requirejs.config({
|
||||
// baseUrl: '/',
|
||||
paths: {
|
||||
lodash: '//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min',
|
||||
lodash: '//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.0/lodash.min',
|
||||
jquery: '//code.jquery.com/jquery-2.1.4.min',
|
||||
firebase: '//cdn.firebase.com/js/client/2.0.5/firebase',
|
||||
react: '//cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react-with-addons',
|
||||
//ace: '../ace-builds-1.1.8/src-min/ace',
|
||||
fiddle: './fiddle',
|
||||
text: 'libs/requirejs-plugins/text',
|
||||
json: 'libs/requirejs-plugins/json',
|
||||
bootstrap: 'libs/bootstrap/bootstrap.min'
|
||||
//codeMirror: 'libs/codemirror-4.8/lib/codemirror',
|
||||
//htmlmixed: 'libs/codemirror-4.8/mode/htmlmixed/htmlmixed',
|
||||
//javascript: 'libs/codemirror-4.8/mode/javascript/javascript'
|
||||
},
|
||||
shim: {
|
||||
lodash: {exports: '_'},
|
||||
firebase: {exports: 'Firebase'},
|
||||
//ace: { exports: 'ace' },
|
||||
jquery: {exports: '$'},
|
||||
react: {exports: 'React'}
|
||||
},
|
||||
map: {
|
||||
'*': {
|
||||
'react/addons': 'react'
|
||||
}
|
||||
'*': {'react/addons': 'react'}
|
||||
}
|
||||
});
|
||||
|
||||
requirejs(['jquery', 'react', 'fiddle', 'bootstrap'], function ($, React, fiddle) {
|
||||
requirejs(['fiddle', 'react', 'jquery', 'bootstrap'], function (fiddle, React) {
|
||||
'use strict';
|
||||
var elem = React.createElement(fiddle);
|
||||
window.fiddle = React.render(elem, document.getElementById('container'));
|
||||
//$(function () {
|
||||
// //$(window).resize(calcSize);
|
||||
// //calcSize();
|
||||
//});
|
||||
//
|
||||
//function calcSize() {
|
||||
// var contentHeight = $(window).height() - $('#header').height();
|
||||
// var height = contentHeight / 2 - 10;
|
||||
// console.log(contentHeight, height);
|
||||
// $('.code-area').each(function (/*i, k*/) {
|
||||
// $(this).height(height);
|
||||
// console.log($(this).height());
|
||||
// });
|
||||
// window.editorCode.refresh();
|
||||
// window.editorRT.refresh();
|
||||
// window.editorGenerated.refresh();
|
||||
//}
|
||||
});
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/**
|
||||
* Created by avim on 12/2/2014.
|
||||
*/
|
||||
/*eslint global-strict:0, no-alert:0*/
|
||||
/*global alert:true*/
|
||||
define(['react', 'firebase', 'lodash', './fiddle.rt', 'jquery'], function (React, Firebase, _, fiddleTemplate, $) {
|
||||
'use strict';
|
||||
|
||||
|
@ -37,7 +35,7 @@ define(['react', 'firebase', 'lodash', './fiddle.rt', 'jquery'], function (React
|
|||
var firebase = new Firebase('https://reacttemplates.firebaseio-demo.com/');
|
||||
firebase.child('fiddles').child(newHash).set(playgroundState, function () {
|
||||
Firebase.goOffline();
|
||||
alert('saved the fiddle, you can share your url');
|
||||
alert('Saved the fiddle, you can share your url'); //eslint-disable-line no-alert
|
||||
});
|
||||
},
|
||||
clear: function () {
|
||||
|
@ -59,7 +57,7 @@ define(['react', 'firebase', 'lodash', './fiddle.rt', 'jquery'], function (React
|
|||
$.get('playground/samples/' + name + '.code', null, function (data2/*, textStatus2, jqXHR2*/) {
|
||||
var currentState = {
|
||||
templateHTML: rt,
|
||||
templateProps: _.template(data2, {name: 'template'})
|
||||
templateProps: _.template(data2)({name: 'template'})
|
||||
};
|
||||
//this.updateSample(currentState);
|
||||
playground.setState(currentState);
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
requirejs.config({
|
||||
// baseUrl: '/',
|
||||
//baseUrl: '.',
|
||||
baseUrl: './playground',
|
||||
paths: {
|
||||
lodash: '//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min',
|
||||
lodash: '//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.0/lodash.min',
|
||||
jquery: '//code.jquery.com/jquery-2.1.4.min',
|
||||
firebase: 'https://cdn.firebase.com/js/client/2.0.5/firebase',
|
||||
react: '//cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react-with-addons',
|
||||
text: 'libs/requirejs-plugins/text',
|
||||
json: 'libs/requirejs-plugins/json'
|
||||
//ace: '../ace-builds-1.1.8/src-min/ace',
|
||||
//examples: './examples'
|
||||
},
|
||||
shim: {
|
||||
lodash: {exports: '_'},
|
||||
firebase: {exports: 'Firebase'},
|
||||
//ace: { exports: 'ace' },
|
||||
jquery: {exports: '$'},
|
||||
react: {exports: 'React'}
|
||||
},
|
||||
|
@ -21,10 +21,8 @@ requirejs.config({
|
|||
}
|
||||
});
|
||||
|
||||
requirejs(['jquery', 'react', './examples'], function ($, React, Examples) {
|
||||
requirejs(['./examples', 'react', 'jquery'], function (Examples, React) {
|
||||
'use strict';
|
||||
/*eslint new-cap:0*/
|
||||
var elem = React.createElement(Examples);
|
||||
React.render(elem, document.getElementById('home-section'));
|
||||
//window.fiddle = React.render(fiddle(), document.getElementById('container'));
|
||||
});
|
||||
|
|
|
@ -1 +1 @@
|
|||
define(["text"],function(text){function cacheBust(a){return a=a.replace(CACHE_BUST_FLAG,""),a+=a.indexOf("?")<0?"?":"&",a+CACHE_BUST_QUERY_PARAM+"="+Math.round(2147483647*Math.random())}var CACHE_BUST_QUERY_PARAM="bust",CACHE_BUST_FLAG="!bust",jsonParse="undefined"!=typeof JSON&&"function"==typeof JSON.parse?JSON.parse:function(val){return eval("("+val+")")},buildMap={};return{load:function(a,b,c,d){!d.isBuild||d.inlineJSON!==!1&&-1===a.indexOf(CACHE_BUST_QUERY_PARAM+"=")?text.get(b.toUrl(a),function(b){d.isBuild?(buildMap[a]=b,c(b)):c(jsonParse(b))},c.error,{accept:"application/json"}):c(null)},normalize:function(a){return-1===a.indexOf(CACHE_BUST_FLAG)?a:cacheBust(a)},write:function(a,b,c){if(b in buildMap){var d=buildMap[b];c('define("'+a+"!"+b+'", function(){ return '+d+";});\n")}}}});
|
||||
define(["text"],function(text){function cacheBust(a){return a=a.replace(CACHE_BUST_FLAG,""),a+=a.indexOf("?")<0?"?":"&",a+CACHE_BUST_QUERY_PARAM+"="+Math.round(2147483647*Math.random())}var CACHE_BUST_QUERY_PARAM="bust",CACHE_BUST_FLAG="!bust",jsonParse="undefined"!=typeof JSON&&"function"==typeof JSON.parse?JSON.parse:function(val){return eval("("+val+")")},buildMap={};return{load:function(a,b,c,d){!d.isBuild||d.inlineJSON!==!1&&-1===a.indexOf(CACHE_BUST_QUERY_PARAM+"=")?text.get(b.toUrl(a),function(b){d.isBuild?(buildMap[a]=b,c(b)):c(jsonParse(b))},c.error,{accept:"application/json"}):c(null)},normalize:function(a,b){return-1===a.indexOf(CACHE_BUST_FLAG)?a:cacheBust(a)},write:function(a,b,c){if(b in buildMap){var d=buildMap[b];c('define("'+a+"!"+b+'", function(){ return '+d+";});\n")}}}});
|
|
@ -1 +1 @@
|
|||
define(["module"],function(a){"use strict";var b,c,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],e=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,f=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,g="undefined"!=typeof location&&location.href,h=g&&location.protocol&&location.protocol.replace(/\:/,""),i=g&&location.hostname,j=g&&(location.port||void 0),k=[],l=a.config&&a.config()||{};return b={version:"2.0.5",strip:function(a){if(a){a=a.replace(e,"");var b=a.match(f);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:l.createXhr||function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(b=0;3>b;b+=1){c=d[b];try{a=new ActiveXObject(c)}catch(e){}if(a){d=[c];break}}return a},parseName:function(a){var b,c,d,e=!1,f=a.indexOf("."),g=0===a.indexOf("./")||0===a.indexOf("../");return-1!==f&&(!g||f>1)?(b=a.substring(0,f),c=a.substring(f+1,a.length)):b=a,d=c||b,f=d.indexOf("!"),-1!==f&&(e="strip"===d.substring(f+1),d=d.substring(0,f),c?c=d:b=d),{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,d,e){var f,g,h,i=b.xdRegExp.exec(a);return i?(f=i[2],g=i[3],g=g.split(":"),h=g[1],g=g[0],!(f&&f!==c||g&&g.toLowerCase()!==d.toLowerCase()||(h||g)&&h!==e)):!0},finishLoad:function(a,c,d,e){d=c?b.strip(d):d,l.isBuild&&(k[a]=d),e(d)},load:function(a,c,d,e){if(e.isBuild&&!e.inlineText)return void d();l.isBuild=e.isBuild;var f=b.parseName(a),k=f.moduleName+(f.ext?"."+f.ext:""),m=c.toUrl(k),n=l.useXhr||b.useXhr;!g||n(m,h,i,j)?b.get(m,function(c){b.finishLoad(a,f.strip,c,d)},function(a){d.error&&d.error(a)}):c([k],function(a){b.finishLoad(f.moduleName+"."+f.ext,f.strip,a,d)})},write:function(a,c,d){if(k.hasOwnProperty(c)){var e=b.jsEscape(k[c]);d.asModule(a+"!"+c,"define(function () { return '"+e+"';});\n")}},writeFile:function(a,c,d,e,f){var g=b.parseName(c),h=g.ext?"."+g.ext:"",i=g.moduleName+h,j=d.toUrl(g.moduleName+h)+".js";b.load(i,d,function(){var c=function(a){return e(j,a)};c.asModule=function(a,b){return e.asModule(a,j,b)},b.write(a,i,c,f)},f)}},"node"===l.env||!l.env&&"undefined"!=typeof process&&process.versions&&process.versions.node?(c=require.nodeRequire("fs"),b.get=function(a,b){var d=c.readFileSync(a,"utf8");0===d.indexOf("\ufeff")&&(d=d.substring(1)),b(d)}):"xhr"===l.env||!l.env&&b.createXhr()?b.get=function(a,c,d,e){var f,g=b.createXhr();if(g.open("GET",a,!0),e)for(f in e)e.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),e[f]);l.onXhr&&l.onXhr(g,a),g.onreadystatechange=function(){var b,e;4===g.readyState&&(b=g.status,b>399&&600>b?(e=new Error(a+" HTTP status: "+b),e.xhr=g,d(e)):c(g.responseText))},g.send(null)}:("rhino"===l.env||!l.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java)&&(b.get=function(a,b){var c,d,e="utf-8",f=new java.io.File(a),g=java.lang.System.getProperty("line.separator"),h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),e)),i="";try{for(c=new java.lang.StringBuffer,d=h.readLine(),d&&d.length()&&65279===d.charAt(0)&&(d=d.substring(1)),c.append(d);null!==(d=h.readLine());)c.append(g),c.append(d);i=String(c.toString())}finally{h.close()}b(i)}),b});
|
||||
define(["module"],function(a){"use strict";var b,c,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],e=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,f=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,g="undefined"!=typeof location&&location.href,h=g&&location.protocol&&location.protocol.replace(/\:/,""),i=g&&location.hostname,j=g&&(location.port||void 0),k=[],l=a.config&&a.config()||{};return b={version:"2.0.5",strip:function(a){if(a){a=a.replace(e,"");var b=a.match(f);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:l.createXhr||function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(b=0;3>b;b+=1){c=d[b];try{a=new ActiveXObject(c)}catch(e){}if(a){d=[c];break}}return a},parseName:function(a){var b,c,d,e=!1,f=a.indexOf("."),g=0===a.indexOf("./")||0===a.indexOf("../");return-1!==f&&(!g||f>1)?(b=a.substring(0,f),c=a.substring(f+1,a.length)):b=a,d=c||b,f=d.indexOf("!"),-1!==f&&(e="strip"===d.substring(f+1),d=d.substring(0,f),c?c=d:b=d),{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,d,e){var f,g,h,i=b.xdRegExp.exec(a);return i?(f=i[2],g=i[3],g=g.split(":"),h=g[1],g=g[0],!(f&&f!==c||g&&g.toLowerCase()!==d.toLowerCase()||(h||g)&&h!==e)):!0},finishLoad:function(a,c,d,e){d=c?b.strip(d):d,l.isBuild&&(k[a]=d),e(d)},load:function(a,c,d,e){if(e.isBuild&&!e.inlineText)return void d();l.isBuild=e.isBuild;var f=b.parseName(a),k=f.moduleName+(f.ext?"."+f.ext:""),m=c.toUrl(k),n=l.useXhr||b.useXhr;!g||n(m,h,i,j)?b.get(m,function(c){b.finishLoad(a,f.strip,c,d)},function(a){d.error&&d.error(a)}):c([k],function(a){b.finishLoad(f.moduleName+"."+f.ext,f.strip,a,d)})},write:function(a,c,d,e){if(k.hasOwnProperty(c)){var f=b.jsEscape(k[c]);d.asModule(a+"!"+c,"define(function () { return '"+f+"';});\n")}},writeFile:function(a,c,d,e,f){var g=b.parseName(c),h=g.ext?"."+g.ext:"",i=g.moduleName+h,j=d.toUrl(g.moduleName+h)+".js";b.load(i,d,function(c){var d=function(a){return e(j,a)};d.asModule=function(a,b){return e.asModule(a,j,b)},b.write(a,i,d,f)},f)}},"node"===l.env||!l.env&&"undefined"!=typeof process&&process.versions&&process.versions.node?(c=require.nodeRequire("fs"),b.get=function(a,b){var d=c.readFileSync(a,"utf8");0===d.indexOf("\ufeff")&&(d=d.substring(1)),b(d)}):"xhr"===l.env||!l.env&&b.createXhr()?b.get=function(a,c,d,e){var f,g=b.createXhr();if(g.open("GET",a,!0),e)for(f in e)e.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),e[f]);l.onXhr&&l.onXhr(g,a),g.onreadystatechange=function(b){var e,f;4===g.readyState&&(e=g.status,e>399&&600>e?(f=new Error(a+" HTTP status: "+e),f.xhr=g,d(f)):c(g.responseText))},g.send(null)}:("rhino"===l.env||!l.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java)&&(b.get=function(a,b){var c,d,e="utf-8",f=new java.io.File(a),g=java.lang.System.getProperty("line.separator"),h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),e)),i="";try{for(c=new java.lang.StringBuffer,d=h.readLine(),d&&d.length()&&65279===d.charAt(0)&&(d=d.substring(1)),c.append(d);null!==(d=h.readLine());)c.append(g),c.append(d);i=String(c.toString())}finally{h.close()}b(i)}),b});
|
Loading…
Reference in New Issue