Ready for action, sir!
73
.gitignore
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
### If you add something here, copy it to the end of .npmignore, too. ###
|
||||
|
||||
# Python
|
||||
*.pyc
|
||||
*.pyo
|
||||
|
||||
# OS X
|
||||
.DS_Store
|
||||
Icon?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
|
||||
# Windows
|
||||
Thumbs.db
|
||||
|
||||
# Emacs
|
||||
*.*~
|
||||
*.#
|
||||
.#*
|
||||
*#
|
||||
|
||||
# Vim
|
||||
.*.sw[a-z]
|
||||
*.un~i
|
||||
|
||||
# Sublime
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
|
||||
# NPM packages folder.
|
||||
node_modules/
|
||||
bower_components/
|
||||
|
||||
# Some other random stuff
|
||||
always-ignore extensions
|
||||
*.diff
|
||||
*.err
|
||||
*.orig
|
||||
*.log
|
||||
*.rej
|
||||
*.vi
|
||||
*.sass-cache
|
||||
|
||||
# OS or Editor folders
|
||||
.cache
|
||||
.project
|
||||
.settings
|
||||
.tmproj
|
||||
.idea
|
||||
nbproject
|
||||
|
||||
# Brunch folder for temporary files.
|
||||
tmp/
|
||||
|
||||
# Brunch output
|
||||
public/
|
||||
|
||||
# Redis?
|
||||
dump.rdb
|
||||
|
||||
# Mongo
|
||||
mongo/
|
||||
|
||||
# Karma coverage
|
||||
coverage/
|
||||
|
||||
# Floo
|
||||
.floo
|
||||
FLOOBITS_README.md
|
||||
|
||||
|
||||
### If you add something here, copy it to the end of .npmignore, too. ###
|
91
.npmignore
Normal file
|
@ -0,0 +1,91 @@
|
|||
# Since we're not a node module, we just use this to tell Nodejitsu what to deploy.
|
||||
|
||||
# Don't include GitHub stuff or local scripts
|
||||
README.md
|
||||
generators
|
||||
to_browserify.js
|
||||
config.coffee
|
||||
bin
|
||||
karma.conf.js
|
||||
.gitignore
|
||||
|
||||
# Don't include Brunch input
|
||||
test
|
||||
vendor
|
||||
|
||||
# Only include some of app
|
||||
app/assets
|
||||
app/styles
|
||||
app/templates
|
||||
app/views
|
||||
#!app/models # keep
|
||||
#!app/validators # keep
|
||||
#!app/lib/world # keep
|
||||
#!app/lib/surface # keep
|
||||
|
||||
### Stuff from .gitignore ###
|
||||
|
||||
# # Python
|
||||
*.pyc
|
||||
*.pyo
|
||||
|
||||
# OS X
|
||||
.DS_Store
|
||||
Icon?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
|
||||
# Windows
|
||||
Thumbs.db
|
||||
|
||||
# Emacs
|
||||
*.*~
|
||||
*.#
|
||||
.#*
|
||||
*#
|
||||
|
||||
# Vim
|
||||
.*.sw[a-z]
|
||||
*.un~i
|
||||
|
||||
# Sublime
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
|
||||
# NPM packages folder.
|
||||
node_modules/
|
||||
|
||||
# Some other random stuff
|
||||
always-ignore extensions
|
||||
*.diff
|
||||
*.err
|
||||
*.orig
|
||||
*.log
|
||||
*.rej
|
||||
*.vi
|
||||
*.sass-cache
|
||||
|
||||
# OS or Editor folders
|
||||
.cache
|
||||
.project
|
||||
.settings
|
||||
.tmproj
|
||||
.idea
|
||||
nbproject
|
||||
|
||||
# Brunch folder for temporary files.
|
||||
tmp/
|
||||
|
||||
### Brunch output
|
||||
##public/
|
||||
## Do include Brunch output.
|
||||
|
||||
# Redis?
|
||||
dump.rdb
|
||||
|
||||
# Mongo
|
||||
mongo/
|
||||
|
||||
# Karma coverage
|
||||
coverage/
|
|
@ -1,4 +1,7 @@
|
|||
codecombat
|
||||
CodeCombat
|
||||
==========
|
||||
|
||||
Multiplayer programming game for learning how to code.
|
||||
Multiplayer live coding for learning to program.
|
||||
|
||||
[![Nodejitsu Deploy Status Badges](https://webhooks.nodejitsu.com/nodejitsu/handbook.png)](https://webops.nodejitsu.com#nodejitsu/webhooks)
|
||||
|
||||
|
|
34
app/application.coffee
Normal file
|
@ -0,0 +1,34 @@
|
|||
FacebookHandler = require 'lib/FacebookHandler'
|
||||
GPlusHandler = require 'lib/GPlusHandler'
|
||||
locale = require 'locale/locale'
|
||||
{me} = require 'lib/auth'
|
||||
Tracker = require 'lib/Tracker'
|
||||
|
||||
COMMON_FILES = ['/images/modal_background.png', '/images/level/code_palette_background.png']
|
||||
preload = (arrayOfImages) ->
|
||||
$(arrayOfImages).each ->
|
||||
$('<img/>')[0].src = @
|
||||
|
||||
|
||||
Application = initialize: ->
|
||||
Router = require('lib/Router')
|
||||
@tracker = new Tracker()
|
||||
new FacebookHandler()
|
||||
new GPlusHandler()
|
||||
preload(COMMON_FILES)
|
||||
$.i18n.init {
|
||||
lng: me?.lang() ? 'en'
|
||||
fallbackLng: 'en'
|
||||
resStore: locale
|
||||
#debug: true
|
||||
#sendMissing: true
|
||||
#sendMissingTo: "current"
|
||||
#resPostPath: '/languages/add/__lng__/__ns__'
|
||||
}, (t) =>
|
||||
@router = new Router()
|
||||
@router.subscribe()
|
||||
Object.freeze this if typeof Object.freeze is 'function'
|
||||
@router = Router
|
||||
|
||||
module.exports = Application
|
||||
window.application = Application
|
1
app/assets/channel.html
Normal file
|
@ -0,0 +1 @@
|
|||
<script src="//connect.facebook.net/en_US/all.js"></script>
|
BIN
app/assets/images/avatars/ally_small.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
app/assets/images/avatars/archer.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
app/assets/images/avatars/arrow.png
Executable file
After Width: | Height: | Size: 700 B |
BIN
app/assets/images/avatars/arrow_tower.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
app/assets/images/avatars/artillery.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
app/assets/images/avatars/beam.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
app/assets/images/avatars/beam_tower.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
app/assets/images/avatars/captain_anya.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
app/assets/images/avatars/enemy_flying.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
app/assets/images/avatars/enemy_large.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
app/assets/images/avatars/enemy_medium.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
app/assets/images/avatars/enemy_small.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
app/assets/images/avatars/mage.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
app/assets/images/avatars/mushroom.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/assets/images/avatars/peasant.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/assets/images/avatars/potion.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
app/assets/images/avatars/shell.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
app/assets/images/avatars/spear.png
Executable file
After Width: | Height: | Size: 551 B |
BIN
app/assets/images/avatars/sword.png
Normal file
After Width: | Height: | Size: 671 B |
BIN
app/assets/images/avatars/tharin.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
app/assets/images/avatars/thoktar.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
app/assets/images/avatars/thrower.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
app/assets/images/favicon.ico
Normal file
After Width: | Height: | Size: 461 B |
BIN
app/assets/images/generic-icon.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
app/assets/images/level/action_timeline_indicator.png
Normal file
After Width: | Height: | Size: 290 B |
BIN
app/assets/images/level/code_editor_background.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
app/assets/images/level/code_editor_error_background.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/assets/images/level/code_editor_info_background.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/assets/images/level/code_editor_tab_background.png
Normal file
After Width: | Height: | Size: 332 B |
BIN
app/assets/images/level/code_editor_tab_error_background.png
Normal file
After Width: | Height: | Size: 505 B |
BIN
app/assets/images/level/code_editor_warning_background.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
app/assets/images/level/code_palette_background.png
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
app/assets/images/level/control_bar_background.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/assets/images/level/csedweek-logo-final-small.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
app/assets/images/level/current_action_indicator.png
Normal file
After Width: | Height: | Size: 312 B |
BIN
app/assets/images/level/hud_center.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
app/assets/images/level/hud_left_wing.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
app/assets/images/level/hud_right_wing.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
app/assets/images/level/info_icons.png
Normal file
After Width: | Height: | Size: 646 B |
BIN
app/assets/images/level/no_selection_pointer.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/assets/images/level/playback_thumb.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
app/assets/images/level/pointer.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
app/assets/images/level/popover_background.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
app/assets/images/level/prop_health.png
Normal file
After Width: | Height: | Size: 513 B |
BIN
app/assets/images/level/prop_inventory.png
Normal file
After Width: | Height: | Size: 571 B |
BIN
app/assets/images/level/prop_pos.png
Normal file
After Width: | Height: | Size: 576 B |
BIN
app/assets/images/level/prop_target.png
Normal file
After Width: | Height: | Size: 581 B |
BIN
app/assets/images/level/wood_texture.png
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
app/assets/images/loading_image.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
app/assets/images/pages/about/george.jpg
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
app/assets/images/pages/about/jeremy.jpg
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
app/assets/images/pages/about/michael.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
app/assets/images/pages/about/nick.jpg
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
app/assets/images/pages/about/scott.jpg
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
app/assets/images/pages/base/background_texture.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
app/assets/images/pages/base/glyphicons-halflings-white.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
app/assets/images/pages/base/glyphicons-halflings.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/assets/images/pages/base/glyphicons-simplified.png
Normal file
After Width: | Height: | Size: 650 B |
BIN
app/assets/images/pages/base/logo.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
app/assets/images/pages/base/modal_background.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
app/assets/images/pages/base/repeat-tile.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
app/assets/images/pages/contribute/adventurer.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
app/assets/images/pages/contribute/ambassador.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
app/assets/images/pages/contribute/archmage.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
app/assets/images/pages/contribute/artisan.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
app/assets/images/pages/contribute/contribute_header.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
app/assets/images/pages/contribute/counselor.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
app/assets/images/pages/contribute/diplomat.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
app/assets/images/pages/contribute/scribe.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
app/assets/images/pages/home/front_screenshot_01.png
Normal file
After Width: | Height: | Size: 54 KiB |
159
app/assets/index.html
Normal file
|
@ -0,0 +1,159 @@
|
|||
<!doctype html>
|
||||
<!--[if lt IE 7]> <html class="lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="lt-ie10 lt-ie9 lt-ie8" lang="en"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="lt-ie10 lt-ie9" lang="en"> <![endif]-->
|
||||
<!--[if IE 9]> <html class="lt-ie10" lang="en"> <![endif]-->
|
||||
<!--[if !IE]><!--><html lang="en"> <!--<![endif]-->
|
||||
<head>
|
||||
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
|
||||
<!--<script src="http://ie.microsoft.com/TestDrive/HTML5/CompatInspector/inspector.js"></script>--> <!-- for testing IE compatibility issues -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
<title>CodeCombat</title>
|
||||
<meta name="description" content="Learn programming with a multiplayer live coding strategy game. You're a wizard, and your spells are JavaScript. Free, open source HTML5 game!">
|
||||
|
||||
<meta property="og:title" content="CodeCombat: Multiplayer Programming">
|
||||
<meta property="og:url" content="http://codecombat.com">
|
||||
<meta property="og:type" content="game">
|
||||
<meta property="og:image" content="http://codecombat.com/images/pages/home/front_screenshot_01.png">
|
||||
<meta property="og:site_name" content="CodeCombat">
|
||||
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:title" content="CodeCombat: Multiplayer Programming">
|
||||
<meta name="twitter:url" content="http://codecombat.com">
|
||||
<meta name="twitter:site" content="CodeCombat">
|
||||
<meta name="twitter:image:src" content="http://codecombat.com/images/pages/base/logo_square_250.png">
|
||||
<meta name="twitter:description" content="Learn programming with a multiplayer live coding strategy game. You're a wizard, and your spells are JavaScript. Free, open source HTML5 game!">
|
||||
|
||||
|
||||
<link href="https://plus.google.com/115285980638641924488" rel="publisher" />
|
||||
|
||||
<link rel="shortcut icon" href="/images/favicon.ico">
|
||||
<link rel="stylesheet" href="/stylesheets/app.css">
|
||||
<script src="/lib/ace/ace.js"></script>
|
||||
|
||||
<!--[if IE 9]> <script src="/javascripts/vendor_with_box2d.js"></script> <![endif]-->
|
||||
<!--[if !IE]><!--> <script src="/javascripts/vendor.js"></script> <!--<![endif]-->
|
||||
<script src="/javascripts/app.js"></script> <!-- it's all Backbone! -->
|
||||
<script>require('initialize');</script>
|
||||
|
||||
|
||||
<!-- begin segment.io code -->
|
||||
<script type="text/javascript">
|
||||
var analytics=analytics||[];(function(){var e=["identify","track","trackLink","trackForm","trackClick","trackSubmit","page","pageview","ab","alias","ready","group"],t=function(e){return function(){analytics.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var n=0;n<e.length;n++)analytics[e[n]]=t(e[n])})(),analytics.load=function(e){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"===document.location.protocol?"https://":"http://")+"d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/"+e+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)};
|
||||
analytics.load("jsjzx9n4d2");
|
||||
</script>
|
||||
<!-- end segment.io code -->
|
||||
|
||||
<!-- begin olark code -->
|
||||
<script data-cfasync="false" type='text/javascript'>/*<![CDATA[*/window.olark||(function(c){var f=window,d=document,l=f.location.protocol=="https:"?"https:":"http:",z=c.name,r="load";var nt=function(){
|
||||
f[z]=function(){
|
||||
(a.s=a.s||[]).push(arguments)};var a=f[z]._={
|
||||
},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){
|
||||
f[z]("call",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={
|
||||
0:+new Date};a.P=function(u){
|
||||
a.p[u]=new Date-a.p[0]};function s(){
|
||||
a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent("on"+r,s);var ld=function(){function p(hd){
|
||||
hd="head";return["<",hd,"></",hd,"><",i,' onl' + 'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',"></",i,">"].join("")}var i="body",m=d[i];if(!m){
|
||||
return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){
|
||||
b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{
|
||||
b.contentWindow[g].open()}catch(w){
|
||||
c[e]=d[e];o="javascript:var d="+g+".open();d.domain='"+d.domain+"';";b[k]=o+"void(0);"}try{
|
||||
var t=b.contentWindow[g];t.write(p());t.close()}catch(x){
|
||||
b[k]=o+'d.write("'+p().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};ld()};nt()})({
|
||||
loader: "static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]});
|
||||
/* custom configuration goes here (www.olark.com/documentation) */
|
||||
olark.identify('1451-787-10-5544');/*]]>*/</script>
|
||||
<!-- end olark code -->
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="fb-root"></div>
|
||||
|
||||
<!-- begin facebook code -->
|
||||
<script>
|
||||
// Additional JS functions here
|
||||
window.fbAsyncInit = function() {
|
||||
FB.init({
|
||||
appId : '148832601965463', // App ID
|
||||
channelUrl : 'http://codecombat.com/channel.html', // Channel File
|
||||
status : true, // check login status
|
||||
cookie : true, // enable cookies to allow the server to access the session
|
||||
xfbml : true // parse XFBML
|
||||
});
|
||||
|
||||
// This is fired for any auth related change, such as login, logout or session refresh.
|
||||
FB.Event.subscribe('auth.authResponseChange', function(response) {
|
||||
// Here we specify what we do with the response anytime this event occurs.
|
||||
if (response.status === 'connected') {
|
||||
// They have logged in to the app.
|
||||
Backbone.Mediator.publish('facebook-logged-in', {response:response});
|
||||
} else if (response.status === 'not_authorized') {
|
||||
// The person is logged into Facebook, but not into the app.
|
||||
} else {
|
||||
// The person is not logged into Facebook
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Load the SDK asynchronously
|
||||
(function(d){
|
||||
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
|
||||
if (d.getElementById(id)) {return;}
|
||||
js = d.createElement('script'); js.id = id; js.async = true;
|
||||
js.src = "//connect.facebook.net/en_US/all.js";
|
||||
//js.src = "//connect.facebook.net/en_US/all/debug.js";
|
||||
ref.parentNode.insertBefore(js, ref);
|
||||
}(document));
|
||||
</script>
|
||||
<!-- end facebook code -->
|
||||
|
||||
|
||||
<header class="header-container" id="header-container"></header>
|
||||
|
||||
<div id="page-container"></div>
|
||||
|
||||
<div id="modal-wrapper"></div>
|
||||
|
||||
<!-- begin google api/plus code -->
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
||||
po.src = 'https://apis.google.com/js/client:plusone.js?onload=onGPlusLoaded';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
||||
})();
|
||||
|
||||
function onGPlusLoaded() {
|
||||
Backbone.Mediator.publish('gapi-loaded');
|
||||
}
|
||||
|
||||
function signinCallback(authResult) {
|
||||
if (authResult['access_token']) {
|
||||
Backbone.Mediator.publish('gplus-logged-in', authResult)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- end google api/plus code -->
|
||||
|
||||
<!-- begin twitter code -->
|
||||
<script>
|
||||
(function (d,s,id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
|
||||
if(!d.getElementById(id)) {
|
||||
js = d.createElement(s);
|
||||
js.id = id;
|
||||
js.src = p + '://platform.twitter.com/widgets.js';
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}
|
||||
})(document, 'script', 'twitter-wjs');
|
||||
</script>
|
||||
<!-- end twitter code -->
|
||||
|
||||
<!-- begin filepicker.io code -->
|
||||
<script type="text/javascript">
|
||||
(function(a){if(window.filepicker){return}var b=a.createElement("script");b.type="text/javascript";b.async=!0;b.src=("https:"===a.location.protocol?"https:":"http:")+"//api.filepicker.io/v1/filepicker.js";var c=a.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c);var d={};d._queue=[];var e="pick,pickMultiple,pickAndStore,read,write,writeUrl,export,convert,store,storeUrl,remove,stat,setKey,constructWidget,makeDropPane".split(",");var f=function(a,b){return function(){b.push([a,arguments])}};for(var g=0;g<e.length;g++){d[e[g]]=f(e[g],d._queue)}window.filepicker=d})(document);
|
||||
</script>
|
||||
<!-- end filepicker.io code -->
|
||||
</body>
|
||||
</html>
|
123
app/assets/index_old_browser.html
Normal file
|
@ -0,0 +1,123 @@
|
|||
<!doctype html>
|
||||
<!--[if lt IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8" lang="en"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js lt-ie10 lt-ie9" lang="en"> <![endif]-->
|
||||
<!--[if IE 9]> <html class="no-js lt-ie10" lang="en"> <![endif]-->
|
||||
<!--[if gt IE 9]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
|
||||
<head>
|
||||
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
|
||||
<!--<script src="http://ie.microsoft.com/TestDrive/HTML5/CompatInspector/inspector.js"></script>--> <!-- for testing IE compatibility issues -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
<title>CodeCombat</title>
|
||||
<meta name="description" content="Learn programming with a multiplayer live coding strategy game. You're a wizard, and your spells are JavaScript. Free HTML5 game!">
|
||||
|
||||
<meta property="og:title" content="CodeCombat: Multiplayer Programming">
|
||||
<meta property="og:url" content="http://codecombat.com">
|
||||
<meta property="og:type" content="game">
|
||||
<meta property="og:image" content="http://codecombat.com/images/pages/home/front_screenshot_01.png">
|
||||
<meta property="og:site_name" content="CodeCombat">
|
||||
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:title" content="CodeCombat: Multiplayer Programming">
|
||||
<meta name="twitter:url" content="http://codecombat.com">
|
||||
<meta name="twitter:site" content="CodeCombat">
|
||||
<meta name="twitter:image:src" content="http://codecombat.com/images/pages/base/logo_square_250.png">
|
||||
<meta name="twitter:description" content="Learn programming with a multiplayer live coding strategy game. You're a wizard, and your spells are JavaScript. Free HTML5 game!">
|
||||
|
||||
|
||||
<link href="https://plus.google.com/115285980638641924488" rel="publisher" />
|
||||
|
||||
<link rel="shortcut icon" href="/images/favicon.ico">
|
||||
<link rel="stylesheet" href="/stylesheets/app.css">
|
||||
|
||||
<!-- begin segment.io code -->
|
||||
<script type="text/javascript">
|
||||
var analytics=analytics||[];(function(){var e=["identify","track","trackLink","trackForm","trackClick","trackSubmit","page","pageview","ab","alias","ready","group"],t=function(e){return function(){analytics.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var n=0;n<e.length;n++)analytics[e[n]]=t(e[n])})(),analytics.load=function(e){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"===document.location.protocol?"https://":"http://")+"d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/"+e+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)};
|
||||
analytics.load("jsjzx9n4d2");
|
||||
</script>
|
||||
<!-- end segment.io code -->
|
||||
|
||||
<!-- begin olark code -->
|
||||
<script data-cfasync="false" type='text/javascript'>/*<![CDATA[*/window.olark||(function(c){var f=window,d=document,l=f.location.protocol=="https:"?"https:":"http:",z=c.name,r="load";var nt=function(){
|
||||
f[z]=function(){
|
||||
(a.s=a.s||[]).push(arguments)};var a=f[z]._={
|
||||
},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){
|
||||
f[z]("call",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={
|
||||
0:+new Date};a.P=function(u){
|
||||
a.p[u]=new Date-a.p[0]};function s(){
|
||||
a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent("on"+r,s);var ld=function(){function p(hd){
|
||||
hd="head";return["<",hd,"></",hd,"><",i,' onl' + 'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',"></",i,">"].join("")}var i="body",m=d[i];if(!m){
|
||||
return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){
|
||||
b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{
|
||||
b.contentWindow[g].open()}catch(w){
|
||||
c[e]=d[e];o="javascript:var d="+g+".open();d.domain='"+d.domain+"';";b[k]=o+"void(0);"}try{
|
||||
var t=b.contentWindow[g];t.write(p());t.close()}catch(x){
|
||||
b[k]=o+'d.write("'+p().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};ld()};nt()})({
|
||||
loader: "static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]});
|
||||
/* custom configuration goes here (www.olark.com/documentation) */
|
||||
olark.identify('1451-787-10-5544');/*]]>*/</script>
|
||||
<!-- end olark code -->
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="header-container" id="header-container"></header>
|
||||
|
||||
<div id="page-container">
|
||||
<div id="home-view">
|
||||
<div id="fb-root"></div>
|
||||
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="content clearfix">
|
||||
<a class="brand" href="/"><img alt="CodeCombat" src="/images/pages/base/logo.png" title="CodeCombat"></a>
|
||||
|
||||
<ul class="navbar-link-text nav pull-right">
|
||||
<li class="blog"><a data-i18n="nav.blog" href="http://code-combat.tumblr.com/">Blog</a></li>
|
||||
|
||||
<li class="forum"><a data-i18n="nav.forum" href="http://discourse.codecombat.com/">Forum</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outer-content-wrapper">
|
||||
<div id="inner-content-wrapper">
|
||||
<div class="main-content-area">
|
||||
<div>
|
||||
<del><h1 data-i18n="home.slogan" id="site-slogan">Learn to Code JavaScript by Playing a Game</h1></del>
|
||||
|
||||
<div id="front-screenshot"><img alt="" src="/images/pages/home/front_screenshot_01.png"></div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="alert">
|
||||
<h1>CodeCombat requires a modern browser to play:</h1>
|
||||
<ul>
|
||||
<h1><li>Chrome 20+</li></h1>
|
||||
<h1><li>Firefox 21+</li></h1>
|
||||
<h1><li>Safari 6+</li></h1>
|
||||
<h1><li>Internet Explorer 10+</li></h1>
|
||||
</ul>
|
||||
<h2>It looks like you have an older browser or a mobile device, so it won't work. Sorry!</h2>
|
||||
<h2><a href="/">Return Home</a></h2>
|
||||
or
|
||||
<h2><a href="?try-old-browser-anyway=true">Try Anyway</a></h2>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-wrapper"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
154
app/assets/javascripts/workers/worker_world.js
Normal file
|
@ -0,0 +1,154 @@
|
|||
// There's no reason that this file is in JavaScript instead of CoffeeScript.
|
||||
// We should convert it and update the brunch config.
|
||||
|
||||
// If we wanted to be more robust, we could use this: https://github.com/padolsey/operative/blob/master/src/operative.js
|
||||
if(typeof window !== 'undefined' || !self.importScripts)
|
||||
throw "Attempt to load worker_world into main window instead of web worker.";
|
||||
|
||||
// assign global window so that Brunch's require (in world.js) can go into it
|
||||
self.window = self;
|
||||
self.workerID = "Worker";
|
||||
|
||||
self.logLimit = 200;
|
||||
self.logsLogged = 0;
|
||||
var console = {
|
||||
log: function() {
|
||||
if(self.logsLogged++ == self.logLimit)
|
||||
self.postMessage({type: 'console-log', args: ["Log limit " + self.logLimit + " reached; shutting up."], id: self.workerID});
|
||||
else if(self.logsLogged < self.logLimit) {
|
||||
args = [].slice.call(arguments);
|
||||
for(var i = 0; i < args.length; ++i) {
|
||||
if(args[i] && args[i].constructor) {
|
||||
if(args[i].constructor.className === "Thang" || args[i].isComponent)
|
||||
args[i] = args[i].toString();
|
||||
}
|
||||
}
|
||||
try {
|
||||
self.postMessage({type: 'console-log', args: args, id: self.workerID});
|
||||
}
|
||||
catch(error) {
|
||||
self.postMessage({type: 'console-log', args: ["Could not post log: " + args, error.toString(), error.stack, error.stackTrace], id: self.workerID});
|
||||
}
|
||||
}
|
||||
}}; // so that we don't crash when debugging statements happen
|
||||
console.error = console.info = console.log;
|
||||
self.console = console;
|
||||
|
||||
importScripts('/javascripts/world.js');
|
||||
// Since this is run synchronously on the main thread, we might consider splitting it up and sending "ready":
|
||||
//xhr.onload = function() {
|
||||
// eval(this.responseText);
|
||||
// postMessage("ready");
|
||||
//};
|
||||
//xhr.open("get", "script.js");
|
||||
//xhr.send();
|
||||
|
||||
self.transferableSupported = function transferableSupported() {
|
||||
// Not in IE, even in IE 11
|
||||
try {
|
||||
var ab = new ArrayBuffer(1);
|
||||
worker.postMessage(ab, [ab]);
|
||||
return ab.byteLength == 0;
|
||||
} catch(error) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var World = self.require('lib/world/world');
|
||||
var GoalManager = self.require('lib/world/GoalManager');
|
||||
|
||||
self.runWorld = function runWorld(args) {
|
||||
self.postedErrors = {};
|
||||
self.t0 = new Date();
|
||||
self.firstWorld = args.firstWorld;
|
||||
self.postedErrors = false;
|
||||
self.logsLogged = 0;
|
||||
|
||||
try {
|
||||
self.world = new World(args.worldName, args.userCodeMap);
|
||||
if(args.level)
|
||||
self.world.loadFromLevel(args.level, true);
|
||||
self.goalManager = new GoalManager(self.world);
|
||||
self.goalManager.setGoals(args.goals);
|
||||
self.goalManager.setCode(args.userCodeMap);
|
||||
self.goalManager.worldGenerationWillBegin();
|
||||
self.world.setGoalManager(self.goalManager);
|
||||
}
|
||||
catch (error) {
|
||||
self.onWorldError(error);
|
||||
return;
|
||||
}
|
||||
Math.random = self.world.rand.randf; // so user code is predictable
|
||||
self.world.loadFrames(self.onWorldLoaded, self.onWorldError, self.onWorldLoadProgress);
|
||||
};
|
||||
|
||||
self.onWorldLoaded = function onWorldLoaded() {
|
||||
self.goalManager.worldGenerationEnded();
|
||||
var t1 = new Date();
|
||||
var diff = t1 - self.t0;
|
||||
var transferableSupported = self.transferableSupported();
|
||||
try {
|
||||
var serialized = self.world.serialize();
|
||||
}
|
||||
catch(error) {
|
||||
console.log("World serialization error:", error.toString() + "\n" + error.stack || error.stackTrace);
|
||||
}
|
||||
var t2 = new Date();
|
||||
//console.log("About to transfer", serialized.serializedWorld.trackedPropertiesPerThangValues, serialized.transferableObjects);
|
||||
try {
|
||||
if(transferableSupported)
|
||||
self.postMessage({type: 'new-world', serialized: serialized.serializedWorld, goalStates: self.goalManager.getGoalStates()}, serialized.transferableObjects);
|
||||
else
|
||||
self.postMessage({type: 'new-world', serialized: serialized.serializedWorld, goalStates: self.goalManager.getGoalStates()});
|
||||
}
|
||||
catch(error) {
|
||||
console.log("World delivery error:", error.toString() + "\n" + error.stack || error.stackTrace);
|
||||
}
|
||||
var t3 = new Date();
|
||||
console.log("And it was so: (" + (diff / self.world.totalFrames).toFixed(3) + "ms per frame,", self.world.totalFrames, "frames)\nSimulation :", diff + "ms \nSerialization:", (t2 - t1) + "ms\nDelivery :", (t3 - t2) + "ms");
|
||||
self.world = null;
|
||||
};
|
||||
|
||||
self.onWorldError = function onWorldError(error) {
|
||||
if(error instanceof Aether.problems.UserCodeProblem) {
|
||||
if(!self.postedErrors[error.key]) {
|
||||
var problem = error.serialize();
|
||||
self.postMessage({type: 'user-code-problem', problem: problem});
|
||||
self.postedErrors[error.key] = problem;
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log("Non-UserCodeError:", error.toString() + "\n" + error.stack || error.stackTrace);
|
||||
}
|
||||
/* We don't actually have the recoverable property any more; hmm
|
||||
if(!self.firstWorld && !error.recoverable) {
|
||||
self.abort();
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
};
|
||||
|
||||
self.onWorldLoadProgress = function onWorldLoadProgress(progress) {
|
||||
self.postMessage({type: 'world-load-progress-changed', progress: progress});
|
||||
};
|
||||
|
||||
self.abort = function abort() {
|
||||
if(self.world && self.world.name) {
|
||||
console.log("About to abort:", self.world.name, typeof self.world.abort);
|
||||
if(typeof self.world !== "undefined")
|
||||
self.world.abort();
|
||||
self.world = null;
|
||||
}
|
||||
self.postMessage({type: 'abort'});
|
||||
};
|
||||
|
||||
self.reportIn = function reportIn() {
|
||||
self.postMessage({type: 'reportIn'});
|
||||
}
|
||||
|
||||
self.addEventListener('message', function(event) {
|
||||
self[event.data.func](event.data.args);
|
||||
});
|
||||
|
11
app/assets/lib/ace/ace.js
Normal file
1
app/assets/lib/ace/ext-chromevox.js
Normal file
1
app/assets/lib/ace/ext-elastic_tabstops_lite.js
Normal file
|
@ -0,0 +1 @@
|
|||
ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){var t=e.data.range;r&&(n.indexOf(t.start.row)==-1&&n.push(t.start.row),t.end.row!=t.start.row&&n.push(t.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},this.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},this.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},this.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r}}).call(r.prototype),t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})})
|
1
app/assets/lib/ace/ext-emmet.js
Normal file
1
app/assets/lib/ace/ext-keybinding_menu.js
Normal file
|
@ -0,0 +1 @@
|
|||
ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,r=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,i=r(t),s=document.createElement("div"),o=i.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+"</span> : "+'<span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");s.id="kbshortcutmenu",s.innerHTML="<h1>Keyboard Shortcuts</h1>"+o+"</div>",n(t,s,"0","0","0",null)}}var r=e("ace/editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}}),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);-webkit-transition: all 0.5s;transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 1000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}";r.importCssString(i),n.exports.overlayPage=function(t,n,i,s,o,u){function l(e){e.keyCode===27&&a.click()}i=i?"top: "+i+";":"",o=o?"bottom: "+o+";":"",s=s?"right: "+s+";":"",u=u?"left: "+u+";":"";var a=document.createElement("div"),f=document.createElement("div");a.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",a.addEventListener("click",function(){document.removeEventListener("keydown",l),a.parentNode.removeChild(a),t.focus(),a=null}),document.addEventListener("keydown",l),f.style.cssText=i+s+o+u,f.addEventListener("click",function(e){e.stopPropagation()});var c=r.createElement("div");c.style.position="relative";var h=r.createElement("div");h.className="ace_closeButton",h.addEventListener("click",function(){a.click()}),c.appendChild(h),f.appendChild(c),f.appendChild(n),a.appendChild(f),document.body.appendChild(a),t.blur()}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var r=e.commandKeyBinding;for(var s in r){var o=parseInt(s);o==-1?o="":isNaN(o)?o=s:o=""+(o&t.command?"Cmd-":"")+(o&t.ctrl?"Ctrl-":"")+(o&t.alt?"Alt-":"")+(o&t.shift?"Shift-":"");for(var u in r[s]){var a=r[s][u];typeof a!="string"&&(a=a.name),i[a]?i[a].key+="|"+o+u:(i[a]={key:o+u,command:a},n.push(i[a]))}}}),n}})
|
1
app/assets/lib/ace/ext-language_tools.js
Normal file
1
app/assets/lib/ace/ext-modelist.js
Normal file
|
@ -0,0 +1 @@
|
|||
ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;if(/\^/.test(n))var r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$";else var r="^.*\\.("+n+")$";this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ActionScript:["as"],ADA:["ada|adb"],AsciiDoc:["asciidoc"],Assembly_x86:["asm"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],C9Search:["c9search_results"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp"],Clojure:["clj"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],CSharp:["cs"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dot:["dot"],Erlang:["erl|hrl"],EJS:["ejs"],Forth:["frt|fs|ldr"],FTL:["ftl"],Glsl:["glsl|frag|vert"],golang:["go"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],haXe:["hx"],HTML:["html|htm|xhtml"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Jack:["jack"],Jade:["jade"],Java:["java"],JavaScript:["js|jsm"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSX:["jsx"],Julia:["jl"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],MATLAB:["matlab"],Markdown:["md|markdown"],MySQL:["mysql"],MUSHCode:["mc|mush"],Nix:["nix"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|phtml"],Powershell:["ps1"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Python:["py"],R:["r"],RDoc:["Rd"],RHTML:["Rhtml"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala"],Scheme:["scm|rkt"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Space:["space"],snippets:["snippets"],Soy_Template:["soy"],SQL:["sql"],Stylus:["styl|stylus"],SVG:["svg"],Tcl:["tcl"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],Twig:["twig"],Typescript:["ts|typescript|str"],VBScript:["vbs"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],XQuery:["xq"],YAML:["yaml|yml"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C/C++",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",FTL:"FreeMarker"},a={};for(var f in o){var l=o[f],c=u[f]||f,h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}})
|
1
app/assets/lib/ace/ext-old_ie.js
Normal file
1
app/assets/lib/ace/ext-searchbox.js
Normal file
1
app/assets/lib/ace/ext-settings_menu.js
Normal file
1
app/assets/lib/ace/ext-spellcheck.js
Normal file
|
@ -0,0 +1 @@
|
|||
ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="",a=o+" "+u;n.value=a,n.setSelectionRange(o.length,o.length+1),n.setSelectionRange(0,0),n.setSelectionRange(0,o.length);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){console.log(e,a,n.selectionStart,n.selectionEnd);if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})})
|
1
app/assets/lib/ace/ext-split.js
Normal file
|
@ -0,0 +1 @@
|
|||
ace.define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){n.exports=e("../split")}),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t,n){function l(e,t){this.$u=e,this.$doc=t}var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./editor").Editor,u=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,f=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){r.implement(this,s),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new u(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splits<this.$editors.length&&this.$splits<e)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;while(this.$splits<e)this.$createEditor(),this.$splits++}else while(this.$splits>e)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();if(n){var r=new l(n,t);t.setUndoManager(r)}return t.$informUndoManager=i.delayedCall(function(){t.$deltas=[]}),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=r+"px",n.container.style.top="0px",n.container.style.left=i*r+"px",n.container.style.height=t+"px",n.resize()}else{var s=t/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=e+"px",n.container.style.top=i*s+"px",n.container.style.left="0px",n.container.style.height=s+"px",n.resize()}}}).call(f.prototype),function(){this.execute=function(e){this.$u.execute(e)},this.undo=function(){var e=this.$u.undo(!0);e&&this.$doc.selection.setSelectionRange(e)},this.redo=function(){var e=this.$u.redo(!0);e&&this.$doc.selection.setSelectionRange(e)},this.reset=function(){this.$u.reset()},this.hasUndo=function(){return this.$u.hasUndo()},this.hasRedo=function(){return this.$u.hasRedo()}}.call(l.prototype),t.Split=f})
|
1
app/assets/lib/ace/ext-static_highlight.js
Normal file
|
@ -0,0 +1 @@
|
|||
ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom"],function(e,t,n){var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;}.ace_static_highlight .ace_gutter {width: 25px !important;display: block;float: left;text-align: right;padding: 0 3px 0 0;margin-right: 3px;position: static !important;}.ace_static_highlight .ace_line { clear: both; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;}",o=e("../config"),u=e("../lib/dom"),a=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",f=[];if(e.firstElementChild){var l=0;for(var c=0;c<e.childNodes.length;c++){var h=e.childNodes[c];h.nodeType==3?(l+=h.data.length,o+=h.data):f.push(l,h)}}else o=u.getInnerText(e),t.trim&&(o=o.trim());a.render(o,i,s,t.firstLineNumber,!t.showGutter,function(t){u.importCssString(t.css,"ace_highlight"),e.innerHTML=t.html;var r=e.firstChild.firstChild;for(var i=0;i<f.length;i+=2){var s=t.session.doc.indexToPosition(f[i]),o=f[i+1],a=r.children[s.row];a&&a.appendChild(o)}n&&n()})};a.render=function(e,t,n,i,s,u){function c(){var r=a.renderSync(e,t,n,i,s);return u?u(r):r}var f=0,l=r.prototype.$modes;return typeof n=="string"&&(f++,o.loadModule(["theme",n],function(e){n=e,--f||c()})),typeof t=="string"&&(f++,o.loadModule(["mode",t],function(e){l[t]||(l[t]=new e.Mode),t=l[t],--f||c()})),f||c()},a.renderSync=function(e,t,n,o,u){o=parseInt(o||1,10);var a=new r("");a.setUseWorker(!1),a.setMode(t);var f=new i(document.createElement("div"));f.setSession(a),f.config={characterWidth:10,lineHeight:20},a.setValue(e);var l=[],c=a.getLength();for(var h=0;h<c;h++)l.push("<div class='ace_line'>"),u||l.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'>"+(h+o)+"</span>"),f.$renderLine(l,h,!0,!1),l.push("\n</div>");var p="<div class='"+n.cssClass+"'>"+"<div class='ace_static_highlight'>"+l.join("")+"</div>"+"</div>";return f.destroy(),{css:s+n.cssText,html:p,session:a}},n.exports=a,n.exports.highlight=a})
|
1
app/assets/lib/ace/ext-statusbar.js
Normal file
|
@ -0,0 +1 @@
|
|||
ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this));e.on("changeStatus",function(){n.schedule(100)}),e.on("changeSelection",function(){n.schedule(100)})};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];e.$vimModeHandler?n(e.$vimModeHandler.getStatusText()):e.commands.recording&&n("REC");var r=e.selection.lead;n(r.row+":"+r.column," ");if(!e.selection.isEmpty()){var i=e.getSelectionRange();n("("+(i.end.row-i.start.row)+":"+(i.end.column-i.start.column)+")")}t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s})
|
1
app/assets/lib/ace/ext-textarea.js
Normal file
1
app/assets/lib/ace/ext-themelist.js
Normal file
|
@ -0,0 +1 @@
|
|||
ace.define("ace/ext/themelist",["require","exports","module","ace/ext/themelist_utils/themes"],function(e,t,n){n.exports.themes=e("ace/ext/themelist_utils/themes").themes,n.exports.ThemeDescription=function(e){this.name=e,this.desc=e.split("_").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(" "),this.theme="ace/theme/"+e},n.exports.themesByName={},n.exports.themes=n.exports.themes.map(function(e){return n.exports.themesByName[e]=new n.exports.ThemeDescription(e),n.exports.themesByName[e]})}),ace.define("ace/ext/themelist_utils/themes",["require","exports","module"],function(e,t,n){n.exports.themes=["ambiance","chaos","chrome","clouds","clouds_midnight","cobalt","crimson_editor","dawn","dreamweaver","eclipse","github","idle_fingers","kr_theme","merbivore","merbivore_soft","mono_industrial","monokai","pastel_on_dark","solarized_dark","solarized_light","terminal","textmate","tomorrow","tomorrow_night","tomorrow_night_blue","tomorrow_night_bright","tomorrow_night_eighties","twilight","vibrant_ink","xcode"]})
|
1
app/assets/lib/ace/ext-whitespace.js
Normal file
|
@ -0,0 +1 @@
|
|||
ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){var r=e("../lib/lang");t.$detectIndentation=function(e,t){function h(e){var t=0;for(var r=e;r<n.length;r+=e)t+=n[r]||0;return t}var n=[],r=[],i=0,s=0,o=Math.min(e.length,1e3);for(var u=0;u<o;u++){var a=e[u];if(!/^\s*[^*+\-\s]/.test(a))continue;var f=a.match(/^\t*/)[0].length;a[0]==" "&&i++;var l=a.match(/^ */)[0].length;if(l&&a[l]!=" "){var c=l-s;c>0&&!(s%c)&&!(l%c)&&(r[c]=(r[c]||0)+1),n[l]=(n[l]||0)+1}s=l;while(a[a.length-1]=="\\")a=e[u++]}var p=r.reduce(function(e,t){return e+t},0),d={score:0,length:0},v=0;for(var u=1;u<12;u++){if(u==1){v=h(u);var m=1}else var m=h(u)/v;r[u]&&(m+=r[u]/p),m>d.score&&(d={score:m,length:u})}if(d.score&&d.score>1.4)var g=d.length;if(i>v+1)return{ch:" ",length:g};if(v+1>i)return{ch:" ",length:g}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t?-1:0;for(var s=0,o=r.length;s<o;s++){var u=r[s],a=u.search(/\s+$/);a>i&&n.removeInLine(s,a,u.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c<h;c++){var p=a[c],d=p.match(/^\s*/)[0];if(d){var v=e.$getStringScreenWidth(d)[0],m=Math.floor(v/s),g=v%s,y=f[m]||(f[m]=r.stringRepeat(o,m));y+=l[g]||(l[g]=r.stringRepeat(" ",g)),y!=d&&(u.removeInLine(c,0,d.length),u.insertInLine({row:c,column:0},y))}}e.setTabSize(n),e.setUseSoftTabs(t==" ")},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch=" ":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?typeof e=="string"?t.$parseStringArg(e):typeof e.text=="string"?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",exec:function(e){t.trimTrailingSpace(e.session)}},{name:"convertIndentation",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(r.ch==" ")}}]})
|