{"size":2324,"ext":"coffee","lang":"CoffeeScript","max_stars_count":2.0,"content":"#\n# Updates all the locally installed packages\n#\n# Copyright (C) 2011-2012 Nikolay Nemshilov\n#\n\n#\n# Reads a file content in the current directory\n#\n# @param {String} filename\n# @return {String} file content\n#\nread = (filename)->\n fs = require('fs')\n filename = process.cwd() + \"\/\" + filename\n\n if fs.existsSync(filename)\n fs.readFileSync(filename).toString()\n else\n ''\n\n#\n# Reading the images list\n#\n# @return {Object} images\n#\nread_images = (build)->\n fs = require('fs')\n folder = \"#{process.cwd()}\/images\/\"\n images = {}\n\n if match = build.match(\/('|\"|\\()\\\/?images\\\/.+?\\1\/g)\n for file in match\n file = file.substr(1, file.length - 2)\n file = file.substr(0, file.length - 1) if file[file.length-1] is \"\\\\\"\n if file = file.split('images\/')[1]\n if fs.existsSync(folder + file)\n images[file] = fs.readFileSync(folder + file).toString('base64')\n\n return images\n\n#\n# Collects the documentation from the current directory\n#\n# @return {Object} documentation index\n#\ncollect_documentation = ->\n fs = require('fs')\n cwd = process.cwd()\n docs =\n index: read('README.md')\n demo: read(\"demo.html\") || read(\"index.html\")\n changelog: read('CHANGELOG')\n\n loop_recursively = (dirname)->\n for filename in fs.readdirSync(\"#{cwd}\/#{dirname}\")\n if fs.statSync(\"#{cwd}\/#{dirname}\/#{filename}\").isDirectory()\n loop_recursively(\"#{dirname}\/#{filename}\")\n else\n docs[\"#{dirname}\/#{filename}\"] = read(\"#{dirname}\/#{filename}\")\n\n loop_recursively('docs') if fs.existsSync(\"#{cwd}\/docs\")\n\n return docs\n\n\n\n#\n# Kicks in the command\n#\nexports.init = (args) ->\n pack = require('..\/package')\n hosting = require('..\/hosting')\n lovelyrc = require('..\/lovelyrc')\n\n sout \"\u00bb Compiling the project\".ljust(61)\n system \"#{__dirname}\/..\/..\/bin\/lovely build\", ->\n sout \"Done\\n\".green\n\n build = read(\"build\/#{pack.name}.js\")\n\n sout \"\u00bb Publishing #{lovelyrc.host}\/packages\/#{pack.name} \".ljust(61)\n hosting.send_package\n manifest: read('package.json')\n build: build\n images: read_images(build)\n documents: collect_documentation()\n\n sout \"Done\\n\".green\n\n\n#\n# Prints out the command help\n#\nexports.help = (args) ->\n \"\"\"\n Publishes the package on the lovely.io host\n\n Usage:\n lovely publish\n\n \"\"\"","avg_line_length":22.7843137255,"max_line_length":75,"alphanum_fraction":0.6166092943} {"size":1779,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"# Copyright 2012 the V8 project authors. All rights reserved.\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n# * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n# * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following\n# disclaimer in the documentation and\/or other materials provided\n# with the distribution.\n# * Neither the name of Google Inc. nor the names of its\n# contributors may be used to endorse or promote products derived\n# from this software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n# Flags: --expose-debug-as debug\nlistener = (event, exec_state, event_data, data) ->\n event_data.script().setSource 1\n return\nDebug = debug.Debug\nDebug.setListener listener\neval \"0\"\nDebug.setListener null\n","avg_line_length":49.4166666667,"max_line_length":72,"alphanum_fraction":0.7655986509} {"size":20758,"ext":"coffee","lang":"CoffeeScript","max_stars_count":160.0,"content":"###\n knockback.js 1.2.3\n Copyright (c) 2011-2016 Kevin Malakoff.\n License: MIT (http:\/\/www.opensource.org\/licenses\/mit-license.php)\n Source: https:\/\/github.com\/kmalakoff\/knockback\n Dependencies: Knockout.js, Backbone.js, and Underscore.js (or LoDash.js).\n Optional dependencies: Backbone.ModelRef.js and BackboneORM.\n###\n\n{_, ko} = kb = require '.\/kb'\n\nCOMPARE_EQUAL = 0\nCOMPARE_ASCENDING = -1\nCOMPARE_DESCENDING = 1\n\nKEYS_PUBLISH = ['destroy', 'shareOptions', 'filters', 'comparator', 'sortAttribute', 'viewModelByModel', 'hasViewModels']\n\nkb.compare = (value_a, value_b) ->\n # String compare\n return value_a.localeCompare(\"#{value_b}\") if _.isString(value_a)\n return value_b.localeCompare(\"#{value_a}\") if _.isString(value_b)\n\n # compare raw values\n return if (value_a is value_b) then COMPARE_EQUAL else (if (value_a < value_b) then COMPARE_ASCENDING else COMPARE_DESCENDING)\n\n# Base class for observing collections.\n#\n# @example How to create a ko.CollectionObservable using the ko.collectionObservable factory.\n# var collection = new Collection([{name: 'name1'}, {name: 'name2'}]);\n# var view_model = {\n# todos: kb.collectionObservable(collection)\n# };\n#\n# @example How to access and change the observed collection.\n# var todos = new kb.CollectionObservable(new kb.Collection([{name: 'name1'}, {name: 'name2'}]);\n# var current_collection = todos.collection(); \/\/ get\n# todos.collection(new Backbone.Collection([{name: 'name3'}, {name: 'name4'}])); \/\/ set\n#\n# @method .extend(prototype_properties, class_properties)\n# Class method for JavaScript inheritance.\n# @param [Object] prototype_properties the properties to add to the prototype\n# @param [Object] class_properties the properties to add to the class\n# @return [ko.observable] the constructor does not return 'this' but a ko.observableArray\n# @example\n# var MyCollectionObservable = kb.CollectionObservable.extend({\n# constructor: function(collection, options) {\n# \/\/ the constructor does not return 'this' but a ko.observableArray\n# return kb.CollectionObservable.prototype.constructor.call(this, collection, {\n# view_model: MyViewModel,\n# options: options\n# });\n# });\n#\n# @method #collection()\n# Dual-purpose getter\/setter ko.computed for the observed collection.\n# @return [Collection|void] getter: the collection whose models are being observed (can be null) OR setter: void\n#\nclass kb.CollectionObservable\n # @nodoc\n @extend = kb.extend # for Backbone non-Coffeescript inheritance (use \"kb.SuperClass.extend({})\" in Javascript instead of \"class MyClass extends kb.SuperClass\")\n\n # Used to create a new kb.CollectionObservable.\n #\n # When the observable is updated, the following Backbone.Events are triggered:\n #\n # * ***add***: (view_model, collection_observable) or if batch: (collection_observable)\n # * ***resort***: (view_model, collection_observable, new_index) or if batch: (collection_observable)\n # * ***remove***: (view_model, collection_observable) or if batch: (collection_observable)\n #\n # @param [Collection] collection the collection to observe (can be null)\n # @param [Object] options the create options\n # @option options [Boolean] models_only flag for skipping the creation of view models. The collection observable will be populated with (possibly sorted) models.\n # @option options [Boolean] auto_compact flag used to compact memory used by the collection observable when large changes occur, eg. resetting the collection.\n # @option options [Constructor] view_model the view model constructor used for models in the collection. Signature: constructor(model, options)\n # @option options [Function] create a function used to create a view model for models in the collection. Signature: create(model, options)\n # @option options [Object] factories a map of dot-deliminated paths; for example 'models.owner': kb.ViewModel to either constructors or create functions. Signature: 'some.path': function(object, options)\n # @option options [Function] comparator a function that is used to sort an object. Signature: `function(model_a, model_b)` returns negative value for ascending, 0 for equal, and positive for descending\n # @option options [String] sort_attribute the name of an attribute. Default: resort on all changes to a model.\n # @option options [Id|Function|Array] filters filters can be individual ids (observable or simple) or arrays of ids, functions, or arrays of functions.\n # @option options [String] path the path to the value (used to create related observables from the factory).\n # @option options [kb.Store] store a store used to cache and share view models.\n # @option options [kb.Factory] factory a factory used to create view models.\n # @option options [Object] options a set of options merge into these options. Useful for extending options when deriving classes rather than merging them by hand.\n # @return [ko.observableArray] the constructor does not return 'this' but a ko.observableArray\n # @note the constructor does not return 'this' but a ko.observableArray\n constructor: (collection, view_model, options) -> args = Array.prototype.slice.call(if _.isArguments(collection) then collection else arguments); return kb.ignore =>\n collection = if args[0] instanceof kb.Collection then args.shift() else (if _.isArray(args[0]) then new kb.Collection(args.shift()) else new kb.Collection())\n args[0] = {view_model: args[0]} if _.isFunction(args[0])\n options = {}; _.extend(options, arg) for arg in args\n observable = kb.utils.wrappedObservable(@, ko.observableArray([]))\n observable.__kb_is_co = true # mark as a kb.CollectionObservable\n @in_edit = 0\n\n # bind callbacks\n @__kb or= {}\n\n # options\n options = kb.utils.collapseOptions(options)\n @auto_compact = true if options.auto_compact\n if options.sort_attribute\n @_comparator = ko.observable(@_attributeComparator(options.sort_attribute))\n else\n @_comparator = ko.observable(options.comparator)\n if options.filters\n @_filters = ko.observableArray(if _.isArray(options.filters) then options.filters else [options.filters] if options.filters)\n else\n @_filters = ko.observableArray([])\n create_options = @create_options = {store: kb.Store.useOptionsOrCreate(options, collection, observable)} # create options\n kb.utils.wrappedObject(observable, collection)\n\n # view model factory create factories\n @path = options.path\n create_options.factory = kb.utils.wrappedFactory(observable, @_shareOrCreateFactory(options))\n create_options.path = kb.utils.pathJoin(options.path, 'models')\n\n # check for models only\n create_options.creator = create_options.factory.creatorForPath(null, create_options.path)\n @models_only = create_options.creator.models_only if create_options.creator\n\n # publish public interface on the observable and return instead of this\n kb.publishMethods(observable, @, KEYS_PUBLISH)\n\n # start the processing\n @_collection = ko.observable(collection)\n observable.collection = @collection = ko.computed {\n read: => return @_collection()\n write: (new_collection) => kb.ignore =>\n return if ((previous_collection = @_collection()) is new_collection) # no change\n # @create_options.store.reuse(@, new_collection) # not meant to be shared\n kb.utils.wrappedObject(observable, new_collection)\n\n # clean up\n previous_collection.unbind('all', @_onCollectionChange) if previous_collection\n\n # store in _kb_collection so that a collection() function can be exposed on the observable and so the collection can be\n new_collection.bind('all', @_onCollectionChange) if new_collection\n\n # update references (including notification)\n @_collection(new_collection)\n }\n collection.bind('all', @_onCollectionChange) if collection # bind now\n\n # observable that will re-trigger when sort or filters or collection changes\n @_mapper = ko.computed =>\n comparator = @_comparator() # create dependency\n filters = @_filters() # create dependency\n (ko.utils.unwrapObservable(filter) for filter in filters) if filters # create a dependency\n current_collection = @_collection() # create dependency\n return if @in_edit # we are doing the editing\n\n # no models\n observable = kb.utils.wrappedObservable(@)\n previous_view_models = kb.peek(observable)\n models = current_collection.models if current_collection\n if not models or (current_collection.models.length is 0) then view_models = []\n\n # process filters, sorting, etc\n else\n # apply filters\n models = _.filter(models, (model) => not filters.length or @_selectModel(model))\n\n # apply sorting\n if comparator\n view_models = _.map(models, (model) => @_createViewModel(model)).sort(comparator)\n\n # no sorting\n else\n if @models_only\n view_models = if filters.length then models else models.slice() # clone the array if it wasn't filtered\n else\n view_models = _.map(models, (model) => @_createViewModel(model))\n\n # update the observable array for this collection observable\n @in_edit++\n observable(view_models)\n @in_edit--\n\n # TODO: release previous\n # unless @models_only\n # create_options.store.release(view_model) for view_model in previous_view_models\n return\n\n # start subscribing\n observable.subscribe(_.bind(@_onObservableArrayChange, @))\n\n not kb.statistics or kb.statistics.register('CollectionObservable', @) # collect memory management statistics\n\n return observable\n\n # Required clean up function to break cycles, release view models, etc.\n # Can be called directly, via kb.release(object) or as a consequence of ko.releaseNode(element).\n destroy: ->\n @__kb_released = true\n observable = kb.utils.wrappedObservable(@)\n collection = kb.peek(@_collection); kb.utils.wrappedObject(observable, null)\n if collection\n collection.unbind('all', @_onCollectionChange)\n array = kb.peek(observable); array.splice(0, array.length) # clear the view models or models\n @collection.dispose(); @_collection = observable.collection = @collection = null\n @_mapper.dispose(); @_mapper = null\n kb.release(@_filters); @_filters = null\n @_comparator(null); @_comparator = null\n @create_options = null\n observable.collection = null; kb.utils.wrappedDestroy(@)\n\n not kb.statistics or kb.statistics.unregister('CollectionObservable', @) # collect memory management statistics\n\n # Get the options for a new collection that can be used for sharing view models.\n #\n # @example Sharing view models for an HTML select element.\n # var selected_collection = new Backbone.Collection();\n # var available_collection = new Backbone.Collection([{name: 'Bob'}, {name: 'Fred'}]);\n # var selected = kb.collectionObservable(available_collection);\n # var available = kb.collectionObservable(available_collection, available_collection.shareOptions()); \/\/ view models shared with selected collection observable\n shareOptions: ->\n observable = kb.utils.wrappedObservable(@)\n return {store: kb.utils.wrappedStore(observable), factory: kb.utils.wrappedFactory(observable)}\n\n # Setter for the filters array for excluding models in the collection observable.\n #\n # @param [Id|Function|Array] filters filters can be individual ids (observable or simple) or arrays of ids, functions, or arrays of functions.\n #\n # @example\n # \/\/ exclude a single model by id\n # collection_observable.filters(model.id);\n filters: (filters) ->\n if filters\n @_filters(if _.isArray(filters) then filters else [filters])\n else\n @_filters([])\n\n # Setter for the sorted index function for auto-sorting the ViewModels or Models in a kb.CollectionObservable.\n #\n # @param [Function] comparator a function that returns an index where to insert the model. Signature: function(models, model)\n # @param [Function] comparator a function that is used to sort an object. Signature: `function(model_a, model_b)` returns negative value for ascending, 0 for equal, and positive for descending\n #\n # @example\n # \/\/ change the sorting function\n # collection_observable.comparator(\n # function(view_models, vm){\n # return _.comparator(view_models, vm, (test) -> kb.utils.wrappedModel(test).get('name'));\n # }\n # );\n comparator: (comparator) -> @_comparator(comparator)\n\n # Setter for the sort attribute name for auto-sorting the ViewModels or Models in a kb.CollectionObservable.\n #\n # @param [String] sort_attribute the name of an attribute. Default: resort on all changes to a model.\n #\n # @example\n # var todos = new kb.CollectionObservable(new Backbone.Collection([{name: 'Zanadu', name: 'Alex'}]));\n # \/\/ in order of Zanadu then Alex\n # todos.sortAttribute('name');\n # \/\/ in order of Alex then Zanadu\n sortAttribute: (sort_attribute) -> @_comparator(if sort_attribute then @_attributeComparator(sort_attribute) else null)\n\n # Reverse lookup for a view model by model. If created with models_only option, will return null.\n viewModelByModel: (model) ->\n return null if @models_only\n id_attribute = if model.hasOwnProperty(model.idAttribute) then model.idAttribute else 'cid'\n return _.find(kb.peek(kb.utils.wrappedObservable(@)), (test) -> return if test?.__kb?.object then (test.__kb.object[id_attribute] == model[id_attribute]) else false)\n\n # Will return true unless created with models_only option.\n #\n # @example\n # var todos1 = new kb.CollectionObservable(new Backbone.Collection(), {models_only: true});\n # todos1.hasViewModels(); \/\/ false\n # var todos2 = new kb.CollectionObservable(new Backbone.Collection());\n # todos2.hasViewModels(); \/\/ true\n hasViewModels: -> return not @models_only\n\n # Compacts the Collection Observable to use the least amount of memory. Currently, this is brute force meaning it releases than regenerates all view models when called.\n #\n compact: -> return kb.ignore =>\n observable = kb.utils.wrappedObservable(@)\n return unless kb.utils.wrappedStoreIsOwned(observable)\n kb.utils.wrappedStore(observable).clear()\n @_collection.notifySubscribers(@_collection())\n\n ####################################################\n # Internal\n ####################################################\n\n # @nodoc\n _shareOrCreateFactory: (options) ->\n absolute_models_path = kb.utils.pathJoin(options.path, 'models')\n factories = options.factories\n\n # check the existing factory\n if (factory = options.factory)\n # models matches, check additional paths\n if (existing_creator = factory.creatorForPath(null, absolute_models_path)) and (not factories or (factories['models'] is existing_creator))\n return factory unless factories # all match, share the factory\n\n # all match, share the factory\n return factory if factory.hasPathMappings(factories, options.path)\n\n # need to create a new factory\n factory = new kb.Factory(options.factory)\n factory.addPathMappings(factories, options.path) if factories\n\n # set up the default create function\n unless factory.creatorForPath(null, absolute_models_path)\n if options.hasOwnProperty('models_only')\n if options.models_only\n factory.addPathMapping(absolute_models_path, {models_only: true})\n else\n factory.addPathMapping(absolute_models_path, kb.ViewModel)\n else if options.view_model\n factory.addPathMapping(absolute_models_path, options.view_model)\n else if options.create\n factory.addPathMapping(absolute_models_path, {create: options.create})\n else\n factory.addPathMapping(absolute_models_path, kb.ViewModel)\n return factory\n\n # @nodoc\n _onCollectionChange: (event, arg) => return kb.ignore =>\n return if @in_edit or kb.wasReleased(@) # we are doing the editing or have been released\n\n switch event\n when 'reset'\n if @auto_compact then @compact() else @_collection.notifySubscribers(@_collection())\n when 'sort', 'resort'\n @_collection.notifySubscribers(@_collection())\n\n when 'new', 'add'\n return unless @_selectModel(arg) # filtered\n\n observable = kb.utils.wrappedObservable(@)\n collection = @_collection()\n return if (collection.indexOf(arg) == -1) # the model may have been removed before we got a chance to add it\n return if (view_model = @viewModelByModel(arg)) # it may have already been added by a change event\n @in_edit++\n if (comparator = @_comparator())\n observable().push(@_createViewModel(arg))\n observable.sort(comparator)\n else\n observable.splice(collection.indexOf(arg), 0, @_createViewModel(arg))\n @in_edit--\n\n when 'remove', 'destroy' then @_onModelRemove(arg)\n when 'change'\n # filtered, remove\n return @_onModelRemove(arg) unless @_selectModel(arg)\n\n view_model = if @models_only then arg else @viewModelByModel(arg)\n return @_onCollectionChange('add', arg) unless view_model # add new\n return unless (comparator = @_comparator())\n\n @in_edit++\n kb.utils.wrappedObservable(@).sort(comparator)\n @in_edit--\n\n return\n\n # @nodoc\n _onModelRemove: (model) ->\n view_model = if @models_only then model else @viewModelByModel(model) # either remove a view model or a model\n return unless view_model # it may have already been removed\n observable = kb.utils.wrappedObservable(@)\n @in_edit++\n observable.remove(view_model)\n @in_edit--\n\n # @nodoc\n _onObservableArrayChange: (models_or_view_models) -> return kb.ignore =>\n return if @in_edit # we are doing the editing\n\n # validate input\n (@models_only and (not models_or_view_models.length or kb.isModel(models_or_view_models[0]))) or (not @models_only and (not models_or_view_models.length or (_.isObject(models_or_view_models[0]) and not kb.isModel(models_or_view_models[0])))) or kb._throwUnexpected(@, 'incorrect type passed')\n\n observable = kb.utils.wrappedObservable(@)\n collection = kb.peek(@_collection)\n has_filters = kb.peek(@_filters).length\n return if not collection # no collection or we are updating ourselves\n\n view_models = models_or_view_models\n\n # set Models\n if @models_only\n models = _.filter(models_or_view_models, (model) => not has_filters or @_selectModel(model))\n\n # set ViewModels\n else\n not has_filters or (view_models = []) # check for filtering of ViewModels\n models = []\n for view_model in models_or_view_models\n model = kb.utils.wrappedObject(view_model)\n if has_filters\n continue unless @_selectModel(model) # filtered so skip\n view_models.push(view_model)\n\n # check for view models being different (will occur if a ko select selectedOptions is bound to this collection observable) -> update our store\n if current_view_model = @create_options.store.find(model, @create_options.creator)\n (current_view_model.constructor is view_model.constructor) or kb._throwUnexpected(@, 'replacing different type of view model')\n @create_options.store.retain(view_model, model, @create_options.creator)\n models.push(model)\n\n # a change, update models\n @in_edit++\n (models_or_view_models.length is view_models.length) or observable(view_models) # replace the ViewModels because they were filtered\n _.isEqual(collection.models, models) or collection.reset(models)\n @in_edit--\n return\n\n # @nodoc\n _attributeComparator: (sort_attribute) ->\n modelAttributeCompare = (model_a, model_b) ->\n attribute_name = ko.utils.unwrapObservable(sort_attribute)\n kb.compare(model_a.get(attribute_name), model_b.get(attribute_name))\n return (if @models_only then modelAttributeCompare else (model_a, model_b) -> modelAttributeCompare(kb.utils.wrappedModel(model_a), kb.utils.wrappedModel(model_b)))\n\n # @nodoc\n _createViewModel: (model) ->\n return model if @models_only\n return @create_options.store.retainOrCreate(model, @create_options)\n\n # @nodoc\n _selectModel: (model) ->\n filters = kb.peek(@_filters)\n for filter in filters\n filter = kb.peek(filter)\n if _.isFunction(filter)\n return false if not filter(model)\n else if _.isArray(filter)\n return false unless model.id in filter\n else\n return false unless model.id is filter\n return true\n\n# factory function\nkb.collectionObservable = (collection, view_model, options) -> return new kb.CollectionObservable(arguments)\nkb.observableCollection = kb.collectionObservable\n","avg_line_length":47.7195402299,"max_line_length":296,"alphanum_fraction":0.7135562193} {"size":437,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"i: 5\nlist: while i -= 1\n i * 2\n\nok list.join(' ') is \"8 6 4 2\"\n\n\ni: 5\nlist: (i * 3 while i -= 1)\n\nok list.join(' ') is \"12 9 6 3\"\n\n\ni: 5\nfunc: (num) -> i -= num\nassert: -> ok i < 5 > 0\n\nresults: while func 1\n assert()\n i\n\nok results.join(' ') is '4 3 2 1'\n\n\ni: 10\nresults: while i -= 1 when i % 2 is 0\n i * 2\n\nok results.join(' ') is '16 12 8 4'\n\n\nvalue: false\ni: 0\nresults: until value\n value: true if i is 5\n i += 1\n\nok i is 6\n","avg_line_length":11.2051282051,"max_line_length":37,"alphanum_fraction":0.528604119} {"size":936,"ext":"coffee","lang":"CoffeeScript","max_stars_count":187.0,"content":"\n#> define parameter as object\npath: '\/v1\/reverse?point.lat=1&point.lon=1¶meter[idx]=value'\n\n#? 200 ok\nresponse.statusCode.should.be.equal 400\nresponse.should.have.header 'charset', 'utf8'\nresponse.should.have.header 'content-type', 'application\/json; charset=utf-8'\n\n#? valid geocoding block\nshould.exist json.geocoding\nshould.exist json.geocoding.version\nshould.exist json.geocoding.attribution\nshould.exist json.geocoding.query\nshould.exist json.geocoding.engine\nshould.exist json.geocoding.engine.name\nshould.exist json.geocoding.engine.author\nshould.exist json.geocoding.engine.version\nshould.exist json.geocoding.timestamp\n\n#? valid geojson\njson.type.should.be.equal 'FeatureCollection'\njson.features.should.be.instanceof Array\n\n#? expected warnings\nshould.not.exist json.geocoding.warnings\n\n#? expected errors\nshould.exist json.geocoding.errors\njson.geocoding.errors.should.eql [ '\\'parameter\\' parameter must be a scalar' ]\n","avg_line_length":30.1935483871,"max_line_length":79,"alphanum_fraction":0.8044871795} {"size":465,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"define ['..\/el'], (El) ->\n\n\tmixing class _Letter extends El\n\n\t\tconstructor: (letter = '') ->\n\n\t\t\t@_shouldCloneInnerHTML = yes\n\n\t\t\tnode = document.createElement 'span'\n\t\t\tnode.classList.add 'yatta-letter'\n\n\t\t\tsuper node, no\n\n\t\t\t@setLetter letter\n\n\t\t\t_Letter.__initMixinsFor @\n\n\t\tsetLetter: (letter) ->\n\n\t\t\t@_letter = String letter\n\n\t\t\tdo @_applyLetter\n\n\t\t_applyLetter: ->\n\n\t\t\tif @_letter is ' '\n\n\t\t\t\t@node.innerHTML = ' '\n\n\t\t\telse\n\n\t\t\t\t@node.innerHTML = @_letter","avg_line_length":14.53125,"max_line_length":39,"alphanum_fraction":0.6322580645} {"size":4612,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"\nimport Logger from '~\/plugins\/starpeace-client\/logger.coffee'\n\nimport BuildingZone from '~\/plugins\/starpeace-client\/overlay\/building-zone.coffee'\nimport Concrete from '~\/plugins\/starpeace-client\/building\/concrete.coffee'\nimport ChunkMap from '~\/plugins\/starpeace-client\/map\/chunk\/chunk-map.coffee'\n\nexport default class BuildingMap\n constructor: (@client_state, @building_manager, @road_manager, @width, @height) ->\n @tile_info_building = new Array(@width * @height)\n @tile_info_concrete = new Array(@width * @height)\n @tile_info_road = new Array(@width * @height)\n\n @building_chunks = new ChunkMap(@width, @height, (chunk_x, chunk_y, chunk_width, chunk_height) =>\n @building_manager.load_chunk(chunk_x, chunk_y, chunk_width, chunk_height)\n , (chunk_info, building_ids) =>\n Logger.debug(\"refreshing building chunk at #{chunk_info.chunk_x}x#{chunk_info.chunk_y}\")\n @add_building(building_id) for building_id in building_ids\n @client_state.planet.notify_map_data_listeners({ type: 'building', info: chunk_info })\n )\n @road_chunks = new ChunkMap(@width, @height, (chunk_x, chunk_y, chunk_width, chunk_height) =>\n @road_manager.load_chunk(chunk_x, chunk_y, chunk_width, chunk_height)\n , (chunk_info, road_data) =>\n Logger.debug(\"refreshing road chunk at #{chunk_info.chunk_x}x#{chunk_info.chunk_y}\")\n @update_roads(chunk_info, road_data)\n @client_state.planet.notify_map_data_listeners({ type: 'road', info: chunk_info })\n )\n\n chunk_building_update_at: (x, y) -> @building_chunks.update_at(x, y)\n chunk_building_info_at: (x, y) -> @building_chunks.info_at(x, y)\n chunk_road_update_at: (x, y) -> @road_chunks.update_at(x, y)\n chunk_road_info_at: (x, y) -> @road_chunks.info_at(x, y)\n\n building_info_at: (x, y) -> @tile_info_building[y * @width + x]\n is_city_around: (x, y) ->\n y > 0 && @building_info_at(x, y - 1)?.has_concrete == true ||\n y < @height && @building_info_at(x, y + 1)?.has_concrete == true ||\n x > 0 && @building_info_at(x - 1, y)?.has_concrete == true ||\n x < @width && @building_info_at(x + 1, y)?.has_concrete == true\n\n is_road_junction: (x, y) ->\n index = y * @width + x\n index_n = (y - 1) * @width + x\n index_s = (y + 1) * @width + x\n index_e = index + 1\n index_w = index - 1\n (@tile_info_road[index_n] || @tile_info_road[index_s]) && (@tile_info_road[index_e] || @tile_info_road[index_w])\n\n add_building: (building_id) ->\n building = @client_state.core.building_cache.building_metadata_by_id[building_id]\n metadata = @client_state.core.building_library.metadata_by_id[building.key]\n unless metadata?\n Logger.debug(\"unable to load building definition metadata for #{building.key}\")\n # FIXME: TODO: add dummy\/empty placeholder\n return\n\n image_metadata = @client_state.core.building_library.images_by_id[metadata.image_id]\n unless image_metadata?\n Logger.debug(\"unable to load building image metadata for #{building.key}\")\n return\n\n building.has_concrete = has_concrete = metadata.zone != BuildingZone.TYPES.NONE.type && metadata.zone != BuildingZone.TYPES.INDUSTRIAL.type && metadata.zone != BuildingZone.TYPES.WAREHOUSE.type\n for y in [0...image_metadata.h]\n for x in [0...image_metadata.w]\n map_index = (building.y - y) * @width + (building.x - x)\n @tile_info_building[map_index] = building\n @tile_info_concrete[map_index] = if has_concrete then Concrete.FILL_TYPE.FILLED else Concrete.FILL_TYPE.NO_FILL\n\n remove_building: (building_id) ->\n building = @client_state.core.building_cache.building_metadata_by_id[building_id]\n metadata = if building? then @client_state.core.building_library.metadata_by_id[building.key] else null\n image_metadata = if metadata? then @client_state.core.building_library.images_by_id[metadata.image_id] else null\n\n unless metadata? && image_metadata?\n Logger.debug(\"unable to load building metadata for #{building_id} of type #{building?.key || 'UNKNOWN'}\")\n return\n\n for y in [0...image_metadata.h]\n for x in [0...image_metadata.w]\n map_index = (building.y - y) * @width + (building.x - x)\n delete @tile_info_building[map_index]\n delete @tile_info_concrete[map_index]\n\n update_roads: (chunk_info, road_data) ->\n for y in [0...ChunkMap.CHUNK_HEIGHT]\n for x in [0...ChunkMap.CHUNK_WIDTH]\n map_index = (chunk_info.chunk_y * ChunkMap.CHUNK_HEIGHT + y) * @width + (chunk_info.chunk_x * ChunkMap.CHUNK_WIDTH + x)\n @tile_info_road[map_index] = if road_data[y * ChunkMap.CHUNK_WIDTH + x] then true else null\n","avg_line_length":51.8202247191,"max_line_length":197,"alphanum_fraction":0.7044666088} {"size":849,"ext":"cson","lang":"CoffeeScript","max_stars_count":17.0,"content":"hedges: [\n \"a bit\"\n \"a little\"\n \"a tad\"\n \"a touch\"\n \"almost\"\n \"apologize\"\n \"apparently\"\n \"appears\"\n \"around\"\n \"basically\"\n \"bother\"\n \"could\"\n \"does that make sense\"\n \"effectively\"\n \"evidently\"\n \"fairly\"\n \"generally\"\n \"hardly\"\n \"hopefully\"\n \"I am about\"\n \"I think\"\n \"I will try\"\n \"I'll try\"\n \"I'm about\"\n \"I'm just trying\"\n \"I'm no expert\"\n \"I'm not an expert\"\n \"I'm trying\"\n \"in general\"\n \"just about\"\n \"just\"\n \"kind of\"\n \"largely\"\n \"likely\"\n \"mainly\"\n \"may\"\n \"maybe\"\n \"might\"\n \"more or less\"\n \"mostly\"\n \"nearly\"\n \"overall\"\n \"partially\"\n \"partly\"\n \"perhaps\"\n \"possibly\"\n \"presumably\"\n \"pretty\"\n \"probably\"\n \"quite clearly\"\n \"quite\"\n \"rather\"\n \"really quite\"\n \"really\"\n \"seem\"\n \"seemed\"\n \"seems\"\n \"some\"\n \"sometimes\"\n \"somewhat\"\n \"sorry\"\n \"sort of\"\n \"suppose\"\n \"supposedly\"\n \"think\"\n]\n","avg_line_length":12.4852941176,"max_line_length":24,"alphanum_fraction":0.5677267373} {"size":121,"ext":"cson","lang":"CoffeeScript","max_stars_count":null,"content":"\".source.js\":\n \"Top-oriented axis\":\n prefix: \"axist\"\n body: \"\"\"\n d3.axisTop(${1:x});\n \"\"\"\n","avg_line_length":17.2857142857,"max_line_length":27,"alphanum_fraction":0.4049586777} {"size":3611,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"module.exports = ->\n\n @factory 'ObjectProxy', (isPlainObject) ->\n\n class ObjectProxy\n\n constructor: (collection, @model, @as = '', @instance = collection) ->\n return new Proxy collection, @\n\n canModify: (attributes, name) ->\n if Array.isArray @instance\n return true\n\n descriptor = Object.getOwnPropertyDescriptor attributes, name\n\n if descriptor\n return true\n\n true\n\n defineProperty: (attributes, name, descriptor) ->\n if 'value' of descriptor\n @set attributes, name, descriptor.value\n\n delete descriptor.value\n\n Object.defineProperty attributes, name, descriptor\n\n true\n\n changed: (name, oldVal, newVal) ->\n path = @append name\n type = '$set'\n\n if newVal is undefined\n type = '$unset'\n\n @instance.emit type, path, newVal\n\n return\n\n compare: (a, b) ->\n if a is b\n return true\n\n if Array.isArray(a) and Array.isArray(b)\n\n if a.length isnt b.length\n return false\n\n i = 0\n\n while i < a.length\n if not @compare a[i], b[i]\n return false\n\n i++\n\n return true\n\n if isPlainObject(a) and isPlainObject (b)\n ka = Object.keys a\n kb = Object.keys b\n\n if ka.length isnt kb.length\n return false\n\n i = 0\n\n while i < ka.length\n if kb.indexOf(ka[i]) is -1\n return false\n\n if not @compare a[ka[i]], b[ka[i]]\n return false\n\n i++\n\n return true\n\n false\n\n append: (name) ->\n [ @as, (name + '') ]\n .filter (v) -> v\n .join '.'\n\n set: (attributes, name, value) ->\n if not @canModify attributes, name\n return false\n\n oldVal = attributes[name]\n\n if @compare oldVal, value\n return true\n\n if value is undefined and not oldVal\n return false\n\n if Array.isArray value\n if not value.length \n attributes[name] = new ObjectProxy [], @model, @append(name), @instance\n \n return true \n\n cast = @model.attributes[name]\n \n proxy = new ObjectProxy [], @model, @append(name), @instance\n \n value.forEach (item, i) =>\n if cast\n proxy.push cast?.apply? item, name, @, i\n else \n proxy.push item \n\n value = proxy \n else \n\n if Array.isArray attributes\n cast = @model.attributes[@as]\n\n if cast\n value = cast?.apply? value, @as, @, name\n else \n cast = @model.attributes[name]\n\n if cast \n value = cast?.apply? value, name, @\n\n if isPlainObject value\n proxy = new ObjectProxy {}, @model, @append(name), @instance\n\n for own name of value\n descriptor = Object.getOwnPropertyDescriptor value, name\n\n Object.defineProperty proxy, name, descriptor\n\n value = proxy\n\n attributes[name] = value\n\n if Array.isArray(@instance) and name is 'length'\n return true\n\n if name[0] is '$'\n return true\n\n @changed name, oldVal, value\n\n true\n\n deleteProperty: (attributes, name) ->\n if not @canModify attributes, name\n return false\n\n oldVal = attributes[name]\n\n try\n delete attributes[name]\n catch e\n return false\n\n @changed name, oldVal\n\n true\n","avg_line_length":21.7530120482,"max_line_length":83,"alphanum_fraction":0.5095541401} {"size":320,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"class Dashing.Spread extends Dashing.Widget\n\n ready: ->\n # This is fired when the widget is done being rendered\n\n onData: (data) ->\n # Handle incoming data\n # You can access the html node of this widget with `@node`\n # Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in.\n","avg_line_length":32.0,"max_line_length":92,"alphanum_fraction":0.6875} {"size":316,"ext":"cson","lang":"CoffeeScript","max_stars_count":8.0,"content":" 'prebuild:#ECMASCRIPT#': '\n npm run lint &&\n npm run clean\n '\n\n 'build:#ECMASCRIPT#': '\n npm run transpile:typescript:#ECMASCRIPT#\n '\n\n 'postbuild:#ECMASCRIPT#': '\n npm run afterdist\n '\n\n 'transpile:typescript:#ECMASCRIPT#': '\n tsc --pretty -p \".\/tsconfigs\/tsconfig-#ECMASCRIPT#-all.json\"\n '\n","avg_line_length":18.5882352941,"max_line_length":64,"alphanum_fraction":0.6202531646} {"size":140,"ext":"coffee","lang":"CoffeeScript","max_stars_count":2.0,"content":"SomePackage = require('some-package')\n\nBracketsToo = require('brackets-package').BracketsToo\n\n\nimportInAVar = 'myVar'\n\nSomePackage.action()\n","avg_line_length":15.5555555556,"max_line_length":53,"alphanum_fraction":0.7642857143} {"size":1064,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"###\n# Copyright (c) 2013-2015 the original author or authors.\n#\n# Licensed under the MIT License (the \"License\");\n# you may not use this file except in compliance with the License. \n# You may obtain a copy of the License at\n#\n# http:\/\/www.opensource.org\/licenses\/mit-license.php\n#\n# Unless required by applicable law or agreed to in writing, \n# software distributed under the License is distributed on an \n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, \n# either express or implied. See the License for the specific \n# language governing permissions and limitations under the License. \n###\n\n#\n# Gui Editor - Page controller.\n#\ncyclotronApp.controller 'PageEditorController', ($scope, $stateParams, configService, dashboardService) ->\n\n $scope.pageExcludes = ['widgets']\n\n $scope.$watch 'editor.selectedItemIndex', (pageIndex) ->\n $scope.editor.selectedPage = $scope.editor.selectedItem\n\n $scope.newWidget = (widgetName, pageIndex) ->\n dashboardService.addWidget $scope.editor.dashboard, widgetName, pageIndex\n\n return\n","avg_line_length":34.3225806452,"max_line_length":106,"alphanum_fraction":0.7340225564} {"size":1057,"ext":"coffee","lang":"CoffeeScript","max_stars_count":2.0,"content":"#! ========================================\n#! Reverse\nhandler = (msg, match, Haruka) ->\n txt = match.input.tokenize()[1]\n if not txt\n msg.reply [\n 'Reverse what?'\n '?tahw esreveR'\n 'What do you want me to reverse?'\n '?esrever ot em tnaw uoy od tahW'\n 'Give me some text to reverse.'\n '.esrever ot txet emos em eviG'\n ].choose()\n else\n txt = msg.cleanContent.replace(\n new RegExp(\"^(#{Haruka.prefix})\\\\s+(reverse|backwards)\", 'i'),\n ''\n )\n txt = txt.split('').reverse().join('')\n msg.channel.send txt, disableEveryone: yes\n\nmodule.exports = {\n name: \"Reverse\"\n regex: \/^(reverse|backwards)(\\s+|$)\/i\n handler: handler\n help:\n short: \"-h reverse ::\n Reverses some text.\"\n long: \"\"\"\n ```asciidoc\n === Help for Reverse ===\n *Aliases*: reverse, backwards\n -h reverse :: Sends the text but in reverse.\n ```\n \"\"\"\n}\n","avg_line_length":28.5675675676,"max_line_length":74,"alphanum_fraction":0.4664143803} {"size":3143,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"\n{tryparse, later} = require '..\/util'\n\nSTATE =\n CONNECTING: 'connecting' # exactly match corresponding event name\n CONNECTED: 'connected' # exactly match corresponding event name\n CONNECT_FAILED: 'connect_failed' # exactly match corresponding event name\n\nEVENT_STATE =\n IN_SYNC: 'in_sync' # when we certain we have connection\/events\n MISSING_SOME: 'missing_some' # when more than 40 secs without any event\n MISSING_ALL: 'missing_all' # when more than 10 minutes without any event\n\nTIME_SOME = 40 * 1000 # 40 secs\nTIME_ALL = 10 * 60 * 1000 # 10 mins\n\nmerge = (t, os...) -> t[k] = v for k,v of o when v not in [null, undefined] for o in os; t\n\ninfo =\n connecting: 'Connecting\u2026'\n connected: 'Connected'\n connect_failed: 'Not connected'\n unknown: 'Unknown'\n\nmodule.exports = exp =\n state: null # current connection state\n eventState: null # current event state\n lastActive: tryparse(localStorage.lastActive) ? 0 # last activity timestamp\n wasConnected: false\n\n setState: (state) ->\n return if @state == state\n @state = state\n if @wasConnected and state == STATE.CONNECTED\n later -> action 'syncrecentconversations'\n @wasConnected = @wasConnected or state == STATE.CONNECTED\n updated 'connection'\n\n setWindowOnline: (wonline) ->\n return if @wonline == wonline\n @wonline = wonline\n unless @wonline\n @setState STATE.CONNECT_FAILED\n\n infoText: -> info[@state] ? info.unknown\n\n setLastActive: (active) ->\n return if @lastActive == active\n @lastActive = localStorage.lastActive = active\n\n setEventState: (state) ->\n return if @eventState == state\n @eventState = state\n if state == EVENT_STATE.IN_SYNC\n @setLastActive Date.now() unless @lastActive\n else if state == EVENT_STATE.MISSING_SOME\n # if we have a gap of more than 40 seconds we try getting\n # any events we may have missed during that gap. notice\n # that we get 'noop' every 20-30 seconds, so there is no\n # reason for a gap of 40 seconds.\n later -> action 'syncallnewevents', @lastActive\n else if state == EVENT_STATE.MISSING_ALL\n # if we have a gap of more than 10 minutes, we will\n # reinitialize all convs using syncrecentconversations\n # (sort of like client startup)\n later -> action 'syncrecentconversations'\n later -> checkEventState()\n updated 'connection'\n\nmerge exp, STATE\nmerge exp, EVENT_STATE\n\ncheckTimer = null\ncheckEventState = ->\n elapsed = Date.now() - exp.lastActive\n clearTimeout checkTimer if checkTimer\n if elapsed >= TIME_ALL\n wrapAction -> exp.setEventState EVENT_STATE.MISSING_ALL\n else if elapsed >= TIME_SOME\n wrapAction -> exp.setEventState EVENT_STATE.MISSING_SOME\n else\n wrapAction -> exp.setEventState EVENT_STATE.IN_SYNC\n checkTimer = setTimeout checkEventState, 1000\n\nwrapAction = (f) ->\n handle 'connwrap', -> f()\n action 'connwrap'\n","avg_line_length":35.7159090909,"max_line_length":92,"alphanum_fraction":0.6426980592} {"size":1087,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"StepView = require '.\/step.coffee'\nanalyticsHooks = require '..\/..\/..\/..\/lib\/analytics_hooks.coffee'\nUserInterestsView = require '..\/..\/..\/..\/components\/user_interests\/view.coffee'\n{ setSkipLabel } = require '..\/mixins\/followable.coffee'\ntemplate = -> require('..\/..\/templates\/bookmarks.jade') arguments...\n\nmodule.exports = class BookmarksView extends StepView\n setSkipLabel: setSkipLabel\n\n events:\n 'click .personalize-skip': 'advance'\n\n postRender: ->\n @userInterestsView = new UserInterestsView autofocus: @autofocus()\n @$('#personalize-bookmark-artists').html @userInterestsView.render().$el\n\n @userInterests = @userInterestsView.collection\n @userInterests.fetch()\n\n @listenTo @userInterests, 'add remove', @setSkipLabel\n @listenTo @userInterests, 'add', ->\n analyticsHooks.trigger 'personalize:added-artist'\n\n @listenTo @userInterestsView, 'uncollect', ->\n analyticsHooks.trigger 'personalize:removed-artist'\n\n render: ->\n @$el.html template(state: @state)\n @postRender()\n this\n\n remove: ->\n @userInterestsView.remove()\n super\n","avg_line_length":31.0571428571,"max_line_length":79,"alphanum_fraction":0.7010119595} {"size":1344,"ext":"coffee","lang":"CoffeeScript","max_stars_count":2.0,"content":"import { underscore } from 'inflection'\nimport { m } from 'mithril'\nimport { Base } from '.\/..\/base\/base.js'\n\nexport class View extends Base\n constructor:(args)->\n super(args)\n oninit:(vnode)->\n super(vnode)\n @reindex()\n body_location = @body.location if @body && @body.location\n body_location ||= underscore(@constructor.name)\n body_view = @body.view if @body && @body.view\n document.body.setAttribute('location',body_location) if body_location\n document.body.setAttribute('view' , body_view) if body_view\n return true\n # reindex is where you would normally make\n # your api call. If reindex is not overwritten\n # then it will immediately return sucess telling\n # the page to load.\n reindex:=>\n @loading = true\n @success()\n # success is where you would assign the return data\n # if you had made an api call\n onremove:(vnode)=>\n document.body.classList.remove(@body_class) if @body_class\n err:(err)=>\n if err.code is 403\n if err.response && err.response.redirect_to\n window.location.href = err.response.redirect_to\n else\n window.location.href = '\/'\n else if err.code is 404\n window.location.href = '\/'\n\n success:(data={})=>\n @model = data\n @loading = false\n view:(vnode)->\n if @loading\n m '.loading'\n else\n @render(vnode)\n","avg_line_length":29.8666666667,"max_line_length":73,"alphanum_fraction":0.6532738095} {"size":997,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"\ntwttr_events_bound = false\n\n$ ->\n loadTwitterSDK ->\n bindTwitterEventHandlers() unless twttr_events_bound\n\nbindTwitterEventHandlers = ->\n $(document).on 'turbolinks:load', renderTweetButtons\n twttr_events_bound = true\n\nrenderTweetButtons = ->\n $('.twitter-share-button').each ->\n button = $(this)\n button.attr('data-url', document.location.href) unless button.data('url')?\n button.attr('data-text', document.title) unless button.data('text')?\n twttr.widgets.load()\n\nloadTwitterSDK = (callback) ->\n $.getScript('\/\/platform.twitter.com\/widgets.js', callback)\n\n\ndocument.addEventListener 'turbolinks:load', ->\n !((d, s, id) ->\n js = undefined\n fjs = d.getElementsByTagName(s)[0]\n p = if \/^http:\/.test(d.location) then 'http' else 'https'\n if !d.getElementById(id)\n js = d.createElement(s)\n js.id = id\n js.src = p + ':\/\/platform.twitter.com\/widgets.js'\n fjs.parentNode.insertBefore js, fjs\n return\n )(document, 'script', 'twitter-wjs')\n return\n","avg_line_length":27.6944444444,"max_line_length":78,"alphanum_fraction":0.6710130391} {"size":201,"ext":"coffee","lang":"CoffeeScript","max_stars_count":59.0,"content":"_ = require 'lodash'\n\nmodule.exports = (req, res) ->\n tagIds = _.pluck(req.app.locals.tags, 'id')\n tagIndex = _.random(0, tagIds.length - 1)\n tagId = tagIds[tagIndex]\n res.redirect \"\/tag\/#{tagId}\"\n","avg_line_length":25.125,"max_line_length":45,"alphanum_fraction":0.6467661692} {"size":686,"ext":"coffee","lang":"CoffeeScript","max_stars_count":3.0,"content":"path = require 'path'\nos = require 'os'\n\nmodule.exports = (grunt) ->\n {rm} = require('.\/task-helpers')(grunt)\n\n grunt.registerTask 'partial-clean', 'Delete some of the build files', ->\n tmpdir = os.tmpdir()\n\n rm grunt.config.get('atom.buildDir')\n rm require('..\/src\/coffee-cache').cacheDir\n rm require('..\/src\/less-compile-cache').cacheDir\n rm path.join(tmpdir, 'atom-cached-atom-shells')\n rm 'atom-shell'\n\n grunt.registerTask 'clean', 'Delete all the build files', ->\n homeDir = process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']\n\n rm 'node_modules'\n rm path.join(homeDir, '.atom', '.node-gyp')\n grunt.task.run('partial-clean')\n","avg_line_length":31.1818181818,"max_line_length":88,"alphanum_fraction":0.6603498542} {"size":1290,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"module.exports = class JSLintReporter\n\n constructor : (@errorReport, options = {}) ->\n\n print : (message) ->\n console.log message\n\n publish : () ->\n @print \"\"\n\n for path, errors of @errorReport.paths\n if errors.length\n @print \"\"\n\n for e in errors\n @print \"\"\"\n \n \"\"\"\n @print \"<\/file>\"\n\n @print \"<\/jslint>\"\n\n escape : (msg) ->\n # Force msg to be a String\n msg = \"\" + msg\n unless msg\n return\n # Perhaps some other HTML Special Chars should be added here\n # But this are the XML Special Chars listed in Wikipedia\n replacements = [\n [\/&\/g, \"&\"]\n [\/\"\/g, \""\"]\n [\/<\/g, \"<\"]\n [\/>\/g, \">\"]\n [\/'\/g, \"'\"]\n ]\n\n for r in replacements\n msg = msg.replace r[0], r[1]\n\n msg\n","avg_line_length":28.6666666667,"max_line_length":80,"alphanum_fraction":0.4263565891} {"size":244,"ext":"coffee","lang":"CoffeeScript","max_stars_count":4.0,"content":"'use strict'\n\ndescribe 'Service: <%= name %>', ->\n\n beforeEach module '<%= name %>'\n\n <%= name %> = {}\n beforeEach inject (_<%= name %>_) ->\n <%= name %> = _<%= name %>_\n\n it 'should do something', ->\n expect(!!<%= name %>).toBe true\n","avg_line_length":18.7692307692,"max_line_length":38,"alphanum_fraction":0.4959016393} {"size":778,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"readInstalled = require(\"..\/read-installed.js\")\ntest = require(\"tap\").test\njson = require(\"..\/package.json\")\npath = require(\"path\")\nknown = [].concat(Object.keys(json.dependencies), Object.keys(json.optionalDependencies), Object.keys(json.devDependencies)).sort()\ntest \"make sure that it works without dev deps\", (t) ->\n readInstalled path.join(__dirname, \"..\/\"), (er, map) ->\n t.notOk er, \"er should be bull\"\n t.ok map, \"map should be data\"\n return console.error(er.stack or er.message) if er\n deps = Object.keys(map.dependencies).sort()\n t.equal deps.length, known.length, \"array lengths are equal\"\n t.deepEqual deps, known, \"arrays should be equal\"\n t.ok map.dependencies.tap.extraneous, \"extraneous is set on devDep\"\n t.end()\n return\n\n return\n\n","avg_line_length":38.9,"max_line_length":131,"alphanum_fraction":0.6915167095} {"size":1122,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"root = document.documentElement\n\nmodule.exports =\n activate: (state) ->\n atom.config.observe 'one-dark-ui.fontSize', (value) ->\n setFontSize(value)\n\n atom.config.observe 'one-dark-ui.layoutMode', (value) ->\n setLayoutMode(value)\n\n atom.config.observe 'one-dark-ui.tabSizing', (value) ->\n setTabSizing(value)\n\n deactivate: ->\n unsetFontSize()\n unsetLayoutMode()\n unsetTabSizing()\n\n# Font Size -----------------------\nsetFontSize = (currentFontSize) ->\n if Number.isInteger(currentFontSize)\n root.style.fontSize = \"#{currentFontSize}px\"\n else if currentFontSize is 'Auto'\n unsetFontSize()\n\nunsetFontSize = ->\n root.style.fontSize = ''\n\n# Layout Mode -----------------------\nsetLayoutMode = (layoutMode) ->\n root.setAttribute('theme-one-dark-ui-layoutmode', layoutMode.toLowerCase())\n\nunsetLayoutMode = ->\n root.removeAttribute('theme-one-dark-ui-layoutmode')\n\n# Tab Sizing -----------------------\nsetTabSizing = (tabSizing) ->\n root.setAttribute('theme-one-dark-ui-tabsizing', tabSizing.toLowerCase())\n\nunsetTabSizing = ->\n root.removeAttribute('theme-one-dark-ui-tabsizing')\n","avg_line_length":26.7142857143,"max_line_length":77,"alphanum_fraction":0.6622103387} {"size":3318,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"console.log \"demo_4.2 MeshDepthMaterial\"\ncamera = null\nscene = null\nrenderer = null\ninit = ()->\n # \u573a\u666f\n scene = new THREE.Scene()\n scene.overrideMaterial = new THREE.MeshDepthMaterial()\n\n\n # \u6444\u50cf\u673a\n camera = new THREE.PerspectiveCamera 45, window.innerWidth\/window.innerHeight, 10, 130\n camera.position.x = -50\n camera.position.y = 40\n camera.position.z = 50\n camera.lookAt scene.position\n \n # \u6e32\u67d3\u5668\n renderer = new THREE.WebGLRenderer()\n renderer.setClearColor new THREE.Color(0x00000, 1.0)\n renderer.setSize window.innerWidth, window.innerHeight\n renderer.shadowMapEnabled = true\n\n\n step = 0\n # \u63a7\u5236\u53f0\n controls = new ()->\n this.cameraNear = camera.near\n this.cameraFar = camera.far\n this.rotationSpeed = 0.02\n this.numberOfObjects = scene.children.length\n\n this.removeCube = ()->\n allChildren = scene.children\n lastObject = allChildren[allChildren.length - 1]\n\n if lastObject instanceof THREE.Mesh\n scene.remove lastObject\n this.numberOfObjects = scene.children.length\n \n \n this.addCube = ()->\n cubeSize = Math.ceil(3 + (Math.random() * 3))\n cubeGeometry = new THREE.BoxGeometry cubeSize, cubeSize, cubeSize\n cubeMaterial = new THREE.MeshLambertMaterial({color: Math.random() * 0xffffff})\n cube = new THREE.Mesh cubeGeometry, cubeMaterial\n cube.castShadow = true\n\n cube.position.x = -60 + Math.round((Math.random() * 100))\n cube.position.y = Math.round((Math.random() * 10))\n cube.position.z = -100 + Math.round((Math.random() * 150))\n\n scene.add cube\n this.numberOfObjects = scene.children.length\n \n this.outputObjects = ()->\n console.log scene.children\n return this\n \n #\u63a7\u5236\u6761UI\n gui = new dat.GUI()\n gui.add controls,\"rotationSpeed\", 0, 0.5\n \n gui.add controls,\"addCube\"\n \n gui.add controls,\"removeCube\"\n \n gui.add(controls, \"cameraNear\", 0, 50).onChange (e)->\n camera.near = e\n \n gui.add(controls, \"cameraFar\", 50, 200).onChange (e)->\n camera.far = e\n\n i = 10\n controls.addCube() while i -= 1\n\n # \u5b9e\u65f6\u6e32\u67d3\n renderScene = ()->\n stats.update()\n \n scene.traverse (e)->\n if e instanceof THREE.Mesh\n e.rotation.x += controls.rotationSpeed\n e.rotation.y += controls.rotationSpeed\n e.rotation.z += controls.rotationSpeed\n\n requestAnimationFrame renderScene\n renderer.render scene,camera\n \n # \u72b6\u6001\u6761\n initStats = ()->\n stats = new Stats()\n stats.setMode 0\n stats.domElement.style.position = \"absolute\"\n stats.domElement.style.left = \"0px\"\n stats.domElement.style.top = \"0px\"\n $(\"#Stats-output\").append stats.domElement\n return stats\n \n stats = initStats()\n \n $(\"#WebGL-output\").append renderer.domElement\n renderScene()\n\n\n#\u5c4f\u5e55\u9002\u914d\nonResize =()->\n console.log \"onResize\"\n camera.aspect = window.innerWidth\/window.innerHeight\n camera.updateProjectionMatrix()\n renderer.setSize window.innerWidth, window.innerHeight\n\n\nwindow.onload = init()\nwindow.addEventListener \"resize\", onResize, false\n","avg_line_length":28.6034482759,"max_line_length":91,"alphanum_fraction":0.6057866184} {"size":332,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"# Applies a syntax highlighting color scheme CSS class to any element with the\n# `js-syntax-highlight` class\n#\n# ### Example Markup\n#\n#
<\/div>\n#\n$.fn.syntaxHighlight = ->\n $(this).addClass(gon.user_color_scheme)\n\n$(document).on 'ready page:load', ->\n $('.js-syntax-highlight').syntaxHighlight()\n","avg_line_length":25.5384615385,"max_line_length":78,"alphanum_fraction":0.6957831325} {"size":1314,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"###\n# Markdown is a named function that will parse markdown syntax\n# @param {Object} message - The message object\n###\n\nclass Markdown\n\tconstructor: (message) ->\n\n\t\tif _.trim message.html\n\n\t\t\tmsg = message.html\n\n\t\t\t# Process MD like for strong, italic and strike\n\t\t\tmsg = msg.replace(\/(^|>|[ >_*~])\\`([^`]+)\\`([<_*~]|\\B|\\b|$)\/gm, '$1`<\/span>$2<\/code>`<\/span>$3')\n\t\t\tmsg = msg.replace(\/(^|>|[ >_~`])\\*([^*]+)\\*([<_~`]|\\B|\\b|$)\/gm, '$1*<\/span>$2<\/strong>*<\/span>$3')\n\t\t\tmsg = msg.replace(\/(^|>|[ >*~`])\\_([^_]+)\\_([<*~`]|\\B|\\b|$)\/gm, '$1_<\/span>$2<\/em>_<\/span>$3')\n\t\t\tmsg = msg.replace(\/(^|>|[ >_*`])\\~{1,2}([^~]+)\\~{1,2}([<_*`]|\\B|\\b|$)\/gm, '$1~<\/span>$2<\/strike>~<\/span>$3')\n\t\t\tmsg = msg.replace(\/^>(.*)$\/gm, '
><\/span>$1<\/blockquote>')\n\t\t\tmsg = msg.replace(\/<\\\/blockquote>\\n
\/gm, '<\/blockquote>
')\n\n\t\t\tmessage.html = msg\n\n\t\t\tconsole.log 'Markdown', message if window.rocketDebug\n\n\t\treturn message\n\nRocketChat.callbacks.add 'renderMessage', Markdown, RocketChat.callbacks.priority.LOW\nRocketChat.Markdown = Markdown\n","avg_line_length":45.3103448276,"max_line_length":169,"alphanum_fraction":0.601217656} {"size":7388,"ext":"coffee","lang":"CoffeeScript","max_stars_count":19.0,"content":"###\n Code generator that generates a Javascript function body\n###\nclass JsCodeGenerator extends CodeGenerator\n\n constructor: (@options) ->\n @outputBuffer = new haml.Buffer(this)\n\n ###\n Append a line with embedded javascript code\n ###\n appendEmbeddedCode: (indentText, expression, escapeContents, perserveWhitespace, currentParsePoint) ->\n @outputBuffer.flush()\n\n @outputBuffer.appendToOutputBuffer(indentText + 'try {\\n')\n @outputBuffer.appendToOutputBuffer(indentText + ' var value = eval(\"' +\n (_.str || _).trim(expression).replace(\/\"\/g, '\\\\\"').replace(\/\\\\n\/g, '\\\\\\\\n') + '\");\\n')\n @outputBuffer.appendToOutputBuffer(indentText + ' value = value === null ? \"\" : value;')\n if escapeContents\n @outputBuffer.appendToOutputBuffer(indentText + ' html.push(haml.HamlRuntime.escapeHTML(String(value)));\\n')\n else if perserveWhitespace\n @outputBuffer.appendToOutputBuffer(indentText + ' html.push(haml.HamlRuntime.perserveWhitespace(String(value)));\\n')\n else\n @outputBuffer.appendToOutputBuffer(indentText + ' html.push(String(value));\\n')\n\n @outputBuffer.appendToOutputBuffer(indentText + '} catch (e) {\\n');\n @outputBuffer.appendToOutputBuffer(indentText + ' handleError(haml.HamlRuntime.templateError(' +\n currentParsePoint.lineNumber + ', ' + currentParsePoint.characterNumber + ', \"' +\n @escapeCode(currentParsePoint.currentLine) + '\",\\n')\n @outputBuffer.appendToOutputBuffer(indentText + ' \"Error evaluating expression - \" + e));\\n')\n @outputBuffer.appendToOutputBuffer(indentText + '}\\n')\n\n ###\n Initilising the output buffer with any variables or code\n ###\n initOutput: () ->\n if @options?.tolerateFaults\n @outputBuffer.appendToOutputBuffer(' var handleError = haml.HamlRuntime._logError;')\n else\n @outputBuffer.appendToOutputBuffer(' var handleError = haml.HamlRuntime._raiseError;')\n\n @outputBuffer.appendToOutputBuffer(\n '''\n var html = [];\n var hashFunction = null, hashObject = null, objRef = null, objRefFn = null;\n with (context || {}) {\n '''\n )\n\n ###\n Flush and close the output buffer and return the contents\n ###\n closeAndReturnOutput: () ->\n @outputBuffer.flush()\n @outputBuffer.output() + ' }\\n return html.join(\"\");\\n'\n\n ###\n Append a line of code to the output buffer\n ###\n appendCodeLine: (line, eol) ->\n @outputBuffer.flush()\n @outputBuffer.appendToOutputBuffer(HamlRuntime.indentText(@indent))\n @outputBuffer.appendToOutputBuffer(line)\n @outputBuffer.appendToOutputBuffer(eol)\n\n ###\n Does the current line end with a function declaration?\n ###\n lineMatchesStartFunctionBlock: (line) -> line.match(\/function\\s*\\((,?\\s*\\w+)*\\)\\s*\\{\\s*$\/)\n\n ###\n Does the current line end with a starting code block\n ###\n lineMatchesStartBlock: (line) -> line.match(\/\\{\\s*$\/)\n\n ###\n Generate the code to close off a code block\n ###\n closeOffCodeBlock: (tokeniser) ->\n unless tokeniser.token.minus and tokeniser.matchToken(\/\\s*\\}\/g)\n @outputBuffer.flush()\n @outputBuffer.appendToOutputBuffer(HamlRuntime.indentText(@indent) + '}\\n')\n\n ###\n Generate the code to close off a function parameter\n ###\n closeOffFunctionBlock: (tokeniser) ->\n unless tokeniser.token.minus and tokeniser.matchToken(\/\\s*\\}\/g)\n @outputBuffer.flush()\n @outputBuffer.appendToOutputBuffer(HamlRuntime.indentText(@indent) + '});\\n')\n\n ###\n Generate the code for dynamic attributes ({} form)\n ###\n generateCodeForDynamicAttributes: (id, classes, attributeList, attributeHash, objectRef, currentParsePoint) ->\n @outputBuffer.flush()\n if attributeHash.length > 0\n attributeHash = @replaceReservedWordsInHash(attributeHash)\n @outputBuffer.appendToOutputBuffer(' hashFunction = function () { return eval(\"hashObject = ' +\n attributeHash.replace(\/\"\/g, '\\\\\"').replace(\/\\n\/g, '\\\\n') + '\"); };\\n')\n else\n @outputBuffer.appendToOutputBuffer(' hashFunction = null;\\n')\n if objectRef.length > 0\n @outputBuffer.appendToOutputBuffer(' objRefFn = function () { return eval(\"objRef = ' +\n objectRef.replace(\/\"\/g, '\\\\\"') + '\"); };\\n')\n else\n @outputBuffer.appendToOutputBuffer(' objRefFn = null;\\n');\n\n @outputBuffer.appendToOutputBuffer(' html.push(haml.HamlRuntime.generateElementAttributes(context, \"' +\n id + '\", [\"' +\n classes.join('\",\"') + '\"], objRefFn, ' +\n JSON.stringify(attributeList) + ', hashFunction, ' +\n currentParsePoint.lineNumber + ', ' + currentParsePoint.characterNumber + ', \"' +\n @escapeCode(currentParsePoint.currentLine) + '\", handleError));\\n')\n\n ###\n Clean any reserved words in the given hash\n ###\n replaceReservedWordsInHash: (hash) ->\n resultHash = hash\n for reservedWord in ['class', 'for']\n resultHash = resultHash.replace(reservedWord + ':', '\"' + reservedWord + '\":')\n resultHash\n\n ###\n Escape the line so it is safe to put into a javascript string\n ###\n escapeCode: (jsStr) ->\n jsStr.replace(\/\\\\\/g, '\\\\\\\\').replace(\/\"\/g, '\\\\\"').replace(\/\\n\/g, '\\\\n').replace(\/\\r\/g, '\\\\r')\n\n ###\n Generate a function from the function body\n ###\n generateJsFunction: (functionBody) ->\n try\n new Function('context', functionBody)\n catch e\n throw \"Incorrect embedded code has resulted in an invalid Haml function - #{e}\\nGenerated Function:\\n#{functionBody}\"\n\n ###\n Generate the code required to support a buffer flush\n ###\n generateFlush: (bufferStr) -> ' html.push(\"' + @escapeCode(bufferStr) + '\");\\n'\n\n ###\n Set the current indent level\n ###\n setIndent: (indent) -> @indent = indent\n\n ###\n Save the current indent level if required\n ###\n mark: () ->\n\n ###\n Append the text contents to the buffer, expanding any embedded code\n ###\n appendTextContents: (text, shouldInterpolate, currentParsePoint, options = {}) ->\n if shouldInterpolate and text.match(\/#{[^}]*}\/)\n @interpolateString(text, currentParsePoint, options)\n else\n @outputBuffer.append(@processText(text, options))\n\n ###\n Interpolate any embedded code in the text\n ###\n interpolateString: (text, currentParsePoint, options) ->\n index = 0\n result = @embeddedCodeBlockMatcher.exec(text)\n while result\n precheedingChar = text.charAt(result.index - 1) if result.index > 0\n precheedingChar2 = text.charAt(result.index - 2) if result.index > 1\n if precheedingChar is '\\\\' and precheedingChar2 isnt '\\\\'\n @outputBuffer.append(@processText(text.substring(index, result.index - 1), options)) unless result.index == 0\n @outputBuffer.append(@processText(result[0]), options)\n else\n @outputBuffer.append(@processText(text.substring(index, result.index)), options)\n @appendEmbeddedCode(HamlRuntime.indentText(@indent + 1), result[1], options.escapeHTML, options.perserveWhitespace, currentParsePoint)\n index = @embeddedCodeBlockMatcher.lastIndex\n result = @embeddedCodeBlockMatcher.exec(text)\n @outputBuffer.append(@processText(text.substring(index), options)) if index < text.length\n\n ###\n process text based on escape and preserve flags\n ###\n processText: (text, options) ->\n if options?.escapeHTML\n haml.HamlRuntime.escapeHTML(text)\n else if options?.perserveWhitespace\n haml.HamlRuntime.perserveWhitespace(text)\n else\n text\n","avg_line_length":38.2797927461,"max_line_length":142,"alphanum_fraction":0.6654033568} {"size":3682,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"mold = require('..\/..\/src\/index').default\n\ndescribe.skip 'Functional. Action.', ->\n describe 'Action.', ->\n beforeEach () ->\n this.handlerCreate = sinon.spy();\n handlerCreate = this.handlerCreate;\n this.handlerCustomAction = sinon.spy();\n handlerCustomAction = this.handlerCustomAction;\n\n testSchema = () ->\n documentsCollection:\n type: 'documentsCollection'\n action: {\n load: {\n options: {\n param1: 'value1',\n }\n },\n create: (v) => handlerCreate(v),\n customAction: (v) -> handlerCustomAction(v),\n }\n item:\n type: 'document'\n action: {\n load: {\n options: {\n param1: 'value1',\n }\n },\n put: (v) => handlerCreate(v),\n customAction: (v) -> handlerCustomAction(v),\n }\n schema:\n $id: {type: 'number', primary: true}\n\n this.testSchema = testSchema()\n this.mold = mold( {silent: true}, this.testSchema )\n this.documentsCollection = this.mold.child('documentsCollection')\n this.document = this.mold.child('documentsCollection[0]')\n\n describe \"DocumentsCollection\", ->\n it \"custom action\", ->\n this.documentsCollection.action.customAction('param');\n\n expect(this.handlerCustomAction).to.have.been.calledOnce\n expect(this.handlerCustomAction).to.have.been.calledWith('param')\n\n it \"Overwrote create\", ->\n this.documentsCollection.create(1);\n\n expect(this.handlerCreate).to.have.been.calledOnce\n expect(this.handlerCreate).to.have.been.calledWith(1)\n\n it \"action defaults\", ->\n handlerSendRequest = sinon.spy();\n savedMethod = this.documentsCollection._main.$$state.request.sendRequest.bind(this.documentsCollection._main.$$state.request)\n this.documentsCollection._main.$$state.request.sendRequest = (rawRequest, schema, urlParams) ->\n handlerSendRequest(rawRequest, schema, urlParams)\n return savedMethod(rawRequest, schema, urlParams)\n this.documentsCollection.load(1);\n\n expect(handlerSendRequest).to.have.been.calledOnce\n expect(handlerSendRequest).to.have.been.calledWith({\n method: 'filter',\n moldPath: 'documentsCollection',\n metaParams: { pageNum: 1 },\n options: {\n param1: 'value1',\n },\n }, this.testSchema.documentsCollection)\n\n\n describe \"Document\", ->\n it \"custom action\", ->\n this.document.action.customAction('param');\n\n expect(this.handlerCustomAction).to.have.been.calledOnce\n expect(this.handlerCustomAction).to.have.been.calledWith('param')\n\n it \"Overwrote put\", ->\n this.document.put(1);\n\n expect(this.handlerCreate).to.have.been.calledOnce\n expect(this.handlerCreate).to.have.been.calledWith(1)\n\n it \"action defaults\", ->\n handlerSendRequest = sinon.spy();\n savedMethod = this.document._main.$$state.request.sendRequest.bind(this.document._main.$$state.request)\n this.document._main.$$state.request.sendRequest = (rawRequest, schema, urlParams) ->\n handlerSendRequest(rawRequest, schema, urlParams)\n return savedMethod(rawRequest, schema, urlParams)\n this.document.load(1);\n\n expect(handlerSendRequest).to.have.been.calledOnce\n expect(handlerSendRequest).to.have.been.calledWith({\n method: 'get',\n moldPath: 'documentsCollection[0]',\n options: {\n param1: 'value1',\n },\n }, this.testSchema.documentsCollection.item)\n","avg_line_length":35.7475728155,"max_line_length":131,"alphanum_fraction":0.6091797936} {"size":1769,"ext":"coffee","lang":"CoffeeScript","max_stars_count":642.0,"content":"{EventEmitter} = require 'events'\n\nPromise = require 'bluebird'\n\nCommand = require '..\/..\/command'\nProtocol = require '..\/..\/protocol'\nParser = require '..\/..\/parser'\n\nclass TrackJdwpCommand extends Command\n execute: ->\n this._send 'track-jdwp'\n @parser.readAscii 4\n .then (reply) =>\n switch reply\n when Protocol.OKAY\n new Tracker this\n when Protocol.FAIL\n @parser.readError()\n else\n @parser.unexpected reply, 'OKAY or FAIL'\n\n class Tracker extends EventEmitter\n constructor: (@command) ->\n @pids = []\n @pidMap = Object.create null\n @reader = this.read()\n .catch Parser.PrematureEOFError, (err) =>\n this.emit 'end'\n .catch Promise.CancellationError, (err) =>\n @command.connection.end()\n this.emit 'end'\n .catch (err) =>\n @command.connection.end()\n this.emit 'error', err\n this.emit 'end'\n\n read: ->\n @command.parser.readValue()\n .cancellable()\n .then (list) =>\n pids = list.toString().split '\\n'\n pids.push maybeEmpty if maybeEmpty = pids.pop()\n this.update pids\n\n update: (newList) ->\n changeSet =\n removed: []\n added: []\n newMap = Object.create null\n for pid in newList\n unless @pidMap[pid]\n changeSet.added.push pid\n this.emit 'add', pid\n newMap[pid] = pid\n for pid in @pids\n unless newMap[pid]\n changeSet.removed.push pid\n this.emit 'remove', pid\n @pids = newList\n @pidMap = newMap\n this.emit 'changeSet', changeSet, newList\n return this\n\n end: ->\n @reader.cancel()\n return this\n\nmodule.exports = TrackJdwpCommand\n","avg_line_length":25.6376811594,"max_line_length":57,"alphanum_fraction":0.5590729226} {"size":435,"ext":"coffee","lang":"CoffeeScript","max_stars_count":4.0,"content":"class FLTurtleClass extends FLClasses\n\n createNew: ->\n toBeReturned = super FLTurtle\n\n toBeReturned.penDown = true\n toBeReturned.direction = 0\n toBeReturned.x = 0\n toBeReturned.y = 0\n\n toBeReturned.sendHome = ->\n if canvasOutputElement?\n @x = canvasOutputElement.clientWidth\/2\n @y = canvasOutputElement.clientHeight\/2\n @direction = 0\n\n\n return toBeReturned\n\nFLTurtle = new FLTurtleClass()\n","avg_line_length":20.7142857143,"max_line_length":47,"alphanum_fraction":0.6873563218} {"size":9890,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"#!\/usr\/bin\/env coffee\n\nfs = require 'fs'\ncrypto = require 'crypto'\n{Parser, tree} = require 'less'\n{extend, isString} = require 'underscore'\n\ndefineVisitor = (base, props) ->\n extend Object.create(base), props\n\ngenVar = (features) ->\n \"var#{crypto.createHash('md5').update(features).digest('hex')}\"\n\nrenderValue = (node, options) ->\n options = extend {}, options\n return node if isString node\n impl = Object.create(expressionVisitor)\n impl.options = options\n visitor = new tree.visitor impl\n visitor.visit node\n if impl.value then impl.value.trim() else ''\n\nrenderTree = (node, indent = '') ->\n impl = Object.create(treeVisitor)\n impl.indent = indent\n new tree.visitor(impl).visit(node)\n\nrenderMixinParam = (node) ->\n param = node.name.slice(1)\n if node.value\n param = \"#{param}=#{renderValue(node.value)}\"\n param\n\nrenderMixinArg = (node) ->\n param = renderValue(node.value)\n if node.name\n param = \"#{node.name.slice(1)}=#{param}\"\n param\n\nrenderPrelude = ->\n console.log \"\"\"\n lesscss-percentage(n)\n (n * 100)%\n \"\"\".trim()\n\ntoUnquoted = (value) ->\n value\n .replace(\/@{\/g, '\"@{')\n .replace(\/}\/g, '}\"')\n .split(\/(@{)|}\/)\n .filter((v) -> v != '@{' and v != '}' and v?.length > 0)\n .join(' + ')\n\nfuncMap =\n '%': 's'\n 'percentage': 'lesscss-percentage'\n\nmixinMap =\n translate: 'mixin-translate'\n scale: 'mixin-scale'\n rotate: 'mixin-rotate'\n skew: 'mixin-skew'\n translate3d: 'mixin-translate3d'\n\nbaseVisitor =\n visitAlpha: (node) ->\n throw new Error('not implemented')\n\n visitAnonymous: (node) ->\n throw new Error('not implemented')\n\n visitAssigment: (node) ->\n throw new Error('not implemented')\n\n visitAttribute: (node) ->\n throw new Error('not implemented')\n\n visitCall: (node) ->\n throw new Error('not implemented')\n\n visitColor: (node) ->\n throw new Error('not implemented')\n\n visitComment: (node) ->\n throw new Error('not implemented')\n\n visitCondition: (node) ->\n throw new Error('not implemented')\n\n visitDimension: (node) ->\n throw new Error('not implemented')\n\n visitDirective: (node) ->\n throw new Error('not implemented')\n\n visitElement: (node) ->\n throw new Error('not implemented')\n\n visitExpression: (node) ->\n throw new Error('not implemented')\n\n visitExtend: (node) ->\n throw new Error('not implemented')\n\n visitImport: (node) ->\n throw new Error('not implemented')\n\n visitJavaScript: (node) ->\n throw new Error('not implemented')\n\n visitKeyword: (node) ->\n throw new Error('not implemented')\n\n visitMedia: (node) ->\n throw new Error('not implemented')\n\n visitMixin: (node) ->\n throw new Error('not implemented')\n\n visitMixinCall: (node) ->\n throw new Error('not implemented')\n\n visitMixinDefinition: (node) ->\n throw new Error('not implemented')\n\n visitNegative: (node) ->\n throw new Error('not implemented')\n\n visitOperation: (node) ->\n throw new Error('not implemented')\n\n visitParen: (node) ->\n throw new Error('not implemented')\n\n visitQuoted: (node) ->\n throw new Error('not implemented')\n\n visitRule: (node, options) ->\n throw new Error('not implemented')\n\n visitRuleset: (node, options) ->\n throw new Error('not implemented')\n\n visitSelector: (node, options) ->\n throw new Error('not implemented')\n\n visitValue: (node) ->\n throw new Error('not implemented')\n\n visitVariable: (node) ->\n throw new Error('not implemented')\n\n visitURL: (node) ->\n throw new Error('not implemented')\n\n visitUnicodeDescriptor: (node) ->\n throw new Error('not implemented')\n\nexpressionVisitor = defineVisitor baseVisitor,\n acc: (v) ->\n @value = '' unless @value\n @value += ' ' + v\n\n visitAnonymous: (node) ->\n @acc node.value\n\n visitDimension: (node) ->\n @acc \"#{node.value}#{node.unit.numerator.join('')}\"\n\n visitVariable: (node) ->\n if @options.unquote\n @acc \"@{#{node.name.slice(1)}}\"\n else\n @acc node.name.slice(1)\n\n visitCall: (node, options) ->\n options.visitDeeper = false\n args = node.args.map((e) => renderValue(e, @options)).join(', ')\n name = funcMap[node.name] or node.name\n args = args.replace(\/%d\/g, '%s') if name == 's'\n @acc \"#{name}(#{args})\"\n\n visitSelector: (node, options) ->\n options.visitDeeper = false\n @acc node.elements\n .map((e) =>\n \"#{e.combinator.value}#{renderValue(e, @options)}\")\n .join('')\n .replace(\/>\/g, ' > ')\n .replace(\/\\+\/g, ' + ')\n\n visitElement: (node, options) ->\n options.visitDeeper = false\n @acc renderValue(node.value, @options)\n\n visitAttribute: (node, options) ->\n options.visitDeeper = false\n rendered = node.key\n rendered += node.op + renderValue(node.value, @options) if node.op\n @acc \"[#{rendered}]\"\n\n visitKeyword: (node) ->\n @acc node.value\n\n visitQuoted: (node) ->\n if node.escaped\n value = toUnquoted(node.value)\n @acc \"unquote(#{node.quote}#{value}#{node.quote})\"\n else\n @acc \"#{node.quote}#{node.value}#{node.quote}\"\n\n visitParen: (node, options) ->\n options.visitDeeper = false\n @acc \"(#{renderValue(node.value, @options)})\"\n\n visitRule: (node, options) ->\n options.visitDeeper = false\n @acc \"#{node.name}: #{renderValue(node.value, @options)}\"\n\n visitOperation: (node, options) ->\n options.visitDeeper = false\n if node.operands.length != 2\n throw new Error('assertion')\n [left, right] = node.operands\n value = \"#{renderValue(left, @options)} #{node.op} #{renderValue(right, @options)}\"\n value = \"(#{value})\"\n @acc value\n\n visitValue: (node, options) ->\n options.visitDeeper = false\n @acc node.value.map((e) => renderValue(e, @options)).join(', ')\n\n visitExpression: (node, options) ->\n options.visitDeeper = false\n @acc node.value.map((e) => renderValue(e, @options)).join(' ')\n\n visitColor: (node) ->\n if node.rgb\n c = \"rgb(#{node.rgb.join(', ')}\"\n if node.alpha\n c += \", #{node.alpha}\"\n c += \")\"\n @acc c\n else\n throw new Error(\"unknow color #{node}\")\n\n visitNegative: (node) ->\n @acc \"- #{renderValue(node.value, @options)}\"\n\ntreeVisitor = defineVisitor baseVisitor,\n indent: ''\n increaseIndent: ->\n @indent + ' '\n decreaseIndent: ->\n @indent.slice(0, -2)\n\n p: (m, indent) ->\n indent = indent or @indent\n console.log \"#{indent}#{m.trim()}\"\n\n isNamespaceDefinition: (node) ->\n return false unless node.type == 'Ruleset'\n return false unless node.selectors.length == 1\n name = renderValue node.selectors[0]\n return false unless name[0] == '#'\n return false unless node.rules.every (rule) ->\n # TODO: variables are also allowed\n rule.type == 'MixinDefinition' or rule.type == 'Comment'\n return name.slice(1)\n\n isNamespaceCall: (node) ->\n\n visitRuleset: (node, options, directive = '') ->\n unless node.root\n namespace = @isNamespaceDefinition(node)\n options.visitDeeper = false\n if namespace\n for rule in node.rules\n # TODO: handle variables\n if rule.type == 'MixinDefinition'\n rule.name = \".#{namespace}-#{rule.name.slice(1)}\"\n renderTree(rule, @indent)\n else\n if node.rules.length > 0\n @p \"#{directive}#{node.selectors.map(renderValue).join(', ')}\"\n for rule in node.rules\n renderTree(rule, @increaseIndent())\n\n visitRulesetOut: (node) ->\n unless node.root\n @decreaseIndent()\n\n visitRule: (node, options) ->\n options.visitDeeper = false\n name = node.name\n if name[0] == '@'\n @p \"#{name.slice(1)} = #{renderValue(node.value)}\"\n else\n @p \"#{name} #{renderValue(node.value)}#{node.important}\"\n\n visitComment: (node) ->\n @p node.value unless node.silent\n\n visitMedia: (node, options) ->\n options.visitDeeper = false\n features = renderValue(node.features, unquote: true)\n if \/@{\/.exec features\n mediaVar = genVar(features)\n @p \"#{mediaVar} = \\\"#{toUnquoted(features)}\\\"\"\n @p \"@media #{mediaVar}\"\n else\n @p \"@media #{features}\"\n\n for rule in node.ruleset.rules\n renderTree(rule, @increaseIndent())\n\n visitSelector: (node, options) ->\n options.visitDeeper = false\n @p node.elements.map(renderValue).join('')\n\n visitMixinDefinition: (node, options) ->\n options.visitDeeper = false\n name = node.name.slice(1)\n name = mixinMap[name] or name\n @p \"#{name}(#{node.params.map(renderMixinParam).join(', ')})\"\n for rule in node.rules\n renderTree(rule, @increaseIndent())\n if node.params.length == 0 or node.params.every((p) -> p.value?)\n @p \".#{name}\"\n @p \"#{name}()\", @increaseIndent()\n\n\n visitMixinCall: (node, options) ->\n options.visitDeeper = false\n if node.selector.elements.length == 2 and node.selector.elements[0].value[0] == '#'\n namespace = node.selector.elements[0].value.slice(1)\n node.selector.elements[0] = node.selector.elements[1]\n delete node.selector.elements[1]\n node.selector.elements[0].value = \"#{namespace}-#{node.selector.elements[0].value.slice(1)}\"\n name = renderValue(node.selector).slice(1)\n name = mixinMap[name] or name\n if node.arguments.length > 0\n v = \"#{renderValue(node.selector).slice(1)}\"\n v += \"(#{node.arguments.map(renderMixinArg).join(', ')})\"\n else\n v = \"@extend .#{renderValue(node.selector).slice(1)}\"\n @p v\n\n visitImport: (node, options) ->\n options.visitDeeper = false\n @p \"@import #{renderValue(node.path).replace(\/\\.less\/, '.styl')}\"\n\n visitDirective: (node, options) ->\n @visitRuleset(node.ruleset, options, node.name)\n\n\nmain = ->\n\n filename = process.argv[2]\n parser = new Parser(filename: filename)\n str = fs.readFileSync(filename).toString()\n\n parser.parse str, (err, node) ->\n throw err if err\n renderPrelude()\n renderTree node\n\nmodule.exports = {\n main,\n treeVisitor, expressionVisitor, baseVisitor,\n renderValue, renderTree, renderPrelude,\n}\n","avg_line_length":26.5147453083,"max_line_length":98,"alphanum_fraction":0.6238624874} {"size":175,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"FramesnipsView = require '..\/lib\/framesnips-view'\n{WorkspaceView} = require 'atom'\n\ndescribe \"FramesnipsView\", ->\n it \"has one valid test\", ->\n expect(\"life\").toBe \"easy\"\n","avg_line_length":25.0,"max_line_length":49,"alphanum_fraction":0.68} {"size":260,"ext":"cson","lang":"CoffeeScript","max_stars_count":null,"content":"'.source.yaml':\n 'customrule':\n 'prefix': 'customrule'\n 'body':\"\"\"\n Condition: ${2:String} # optional\n Source: ${3:String} # required\n Status: ${4:String} # optional\n Target: ${5:String} # required\n\"\"\"","avg_line_length":28.8888888889,"max_line_length":46,"alphanum_fraction":0.4884615385} {"size":150,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"'use strict'\nangular.module('solrpressApp').config ($stateProvider) ->\n $stateProvider.state 'admin',\n abstract: true\n parent: 'site'\n return\n","avg_line_length":21.4285714286,"max_line_length":57,"alphanum_fraction":0.6933333333} {"size":412,"ext":"cson","lang":"CoffeeScript","max_stars_count":1.0,"content":"# See https:\/\/atom.io\/docs\/latest\/hacking-atom-package-word-count#menus for more details\n'context-menu':\n 'atom-text-editor': [\n {\n 'label': 'Toggle atoman'\n 'command': 'atoman:toggle'\n }\n ]\n'menu': [\n {\n 'label': 'Packages'\n 'submenu': [\n 'label': 'atoman'\n 'submenu': [\n {\n 'label': 'Toggle'\n 'command': 'atoman:toggle'\n }\n ]\n ]\n }\n]\n","avg_line_length":17.9130434783,"max_line_length":88,"alphanum_fraction":0.4927184466} {"size":889,"ext":"coffee","lang":"CoffeeScript","max_stars_count":19.0,"content":"\nstream = require \"stream\"\nassert = require \"assert\"\nlog = require \"lawg\"\nutil = require \"util\"\nfuture = require \"phuture\"\ndomain = require \"domain\"\n\n# Stream wrapper for http:\/\/github.com\/Worlize\/WebSocket-Node.git version 1.0.8\nmodule.exports = class WsStream extends stream.Duplex\n\n # options.domain nodejs domain f\n constructor: (@ws)->\n super()\n @_sig = \"ws\"\n @_open = true\n @ws.on 'message', (message)=>\n if @_open then @push message.binaryData\n @ws.on 'close', ()=>\n @_open = false\n @emit 'close'\n @ws.on \"error\", (err)=> @emit 'error', err\n\n end : ()->\n super()\n @ws.close()\n\n # node stream overrides\n # @push is called when there is data, _read does nothing\n _read : ()->\n # if callback is not called, then stream write will be blocked\n _write: (chunk, encoding, callback)->\n if @_open then @ws.sendBytes(chunk, callback)\n\n","avg_line_length":25.4,"max_line_length":79,"alphanum_fraction":0.6377952756} {"size":4867,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"describe \"String#tr\", ->\n xit \"returns a new string with the characters from from_string replaced by the ones in to_string\", ->\n expect( R(\"hello\").tr('aeiou', '*') ).toEqual R(\"h*ll*\")\n expect( R(\"hello\").tr('el', 'ip') ).toEqual R(\"hippo\")\n expect( R(\"Lisp\").tr(\"Lisp\", \"Ruby\") ).toEqual R(\"Ruby\")\n\n xit \"accepts c1-c2 notation to denote ranges of characters\", ->\n expect( R(\"hello\").tr('a-y', 'b-z') ).toEqual R(\"ifmmp\")\n expect( R(\"123456789\").tr(\"2-5\",\"abcdefg\") ).toEqual R(\"1abcd6789\")\n expect( R(\"hello ^-^\").tr(\"e-\", \"__\") ).toEqual R(\"h_llo ^_^\")\n expect( R(\"hello ^-^\").tr(\"---\", \"_\") ).toEqual R(\"hello ^_^\")\n\n xit \"pads to_str with its last char if it is shorter than from_string\", ->\n expect( R(\"this\").tr(\"this\", \"x\") ).toEqual R(\"xxxx\")\n expect( R(\"hello\").tr(\"a-z\", \"A-H.\") ).toEqual R(\"HE...\")\n\n describe \"ruby_version_is '1.9.2'\", ->\n xit \"raises a ArgumentError a descending range in the replacement as containing just the start character\", ->\n expect( -> R(\"hello\").tr(\"a-y\", \"z-b\") ).toThrow('ArgumentError')\n\n xit \"raises a ArgumentError a descending range in the source as empty\", ->\n expect( -> R(\"hello\").tr(\"l-a\", \"z\") ).toThrow('ArgumentError')\n\n xit \"translates chars not in from_string when it starts with a ^\", ->\n expect( R(\"hello\").tr('^aeiou', '*') ).toEqual R(\"*e**o\")\n expect( R(\"123456789\").tr(\"^345\", \"abc\") ).toEqual R(\"cc345cccc\")\n expect( R(\"abcdefghijk\").tr(\"^d-g\", \"9131\") ).toEqual R(\"111defg1111\")\n\n expect( R(\"hello ^_^\").tr(\"a-e^e\", \".\") ).toEqual R(\"h.llo ._.\")\n expect( R(\"hello ^_^\").tr(\"^^\", \".\") ).toEqual R(\"......^.^\")\n expect( R(\"hello ^_^\").tr(\"^\", \"x\") ).toEqual R(\"hello x_x\")\n expect( R(\"hello ^-^\").tr(\"^-^\", \"x\") ).toEqual R(\"xxxxxx^-^\")\n expect( R(\"hello ^-^\").tr(\"^^-^\", \"x\") ).toEqual R(\"xxxxxx^x^\")\n expect( R(\"hello ^-^\").tr(\"^---\", \"x\") ).toEqual R(\"xxxxxxx-x\")\n expect( R(\"hello ^-^\").tr(\"^---l-o\", \"x\") ).toEqual R(\"xxlloxx-x\")\n\n xit \"supports non-injective replacements\", ->\n expect( R(\"hello\").tr(\"helo\", \"1212\") ).toEqual R(\"12112\")\n\n xit \"tries to convert from_str and to_str to strings using to_str\", ->\n from_str =\n to_str: -> R(\"ab\")\n\n to_str =\n to_str: -> R(\"AB\")\n\n expect( R(\"bla\").tr(from_str, to_str) ).toEqual R(\"BlA\")\n\n xit \"returns subclass instances when called on a subclass\", ->\n expect( new StringSpecs.MyString(\"hello\").tr(\"e\", \"a\") ).toBeInstanceOf(StringSpecs.MyString)\n\n # it \"taints the result when self is tainted\", ->\n # [\"h\", \"hello\"].each do |str|\n # tainted_str = str.dup.taint\n\n # expect( tainted_str.tr(\"e\", \"a\").tainted? ).toEqual true\n\n # expect( str.tr(\"e\".taint, \"a\").tainted? ).toEqual false\n # expect( str.tr(\"e\", \"a\".taint).tainted? ).toEqual false\n\n # with_feature :encoding do\n # # http:\/\/redmine.ruby-lang.org\/issues\/show\/1839\n # xit \"can replace a 7-bit ASCII character with a multibyte one\", ->\n # a = \"uber\"\n # expect( a.encoding ).toEqual Encoding::UTF_8\n # b = a.tr(\"u\",\"\u00fc\")\n # expect( b ).toEqual \"\u00fcber\"\n # expect( b.encoding ).toEqual Encoding::UTF_8\n # end\n\ndescribe \"String#tr!\", ->\n xit \"modifies self in place\", ->\n s = R(\"abcdefghijklmnopqR\")\n expect( s.tr_bang(\"cdefg\", \"12\") ).toEqual R(\"ab12222hijklmnopqR\")\n expect( s ).toEqual R(\"ab12222hijklmnopqR\")\n\n xit \"returns nil if no modification was made\", ->\n s = R(\"hello\")\n expect( s.tr_bang(\"za\", \"yb\") ).toEqual null\n expect( s.tr_bang(\"\", \"\") ).toEqual null\n expect( s ).toEqual R(\"hello\")\n\n xit \"does not modify self if from_str is empty\", ->\n s = R(\"hello\")\n expect( s.tr_bang(\"\", \"\") ).toEqual null\n expect( s ).toEqual R(\"hello\")\n expect( s.tr_bang(\"\", \"yb\") ).toEqual null\n expect( s ).toEqual R(\"hello\")\n\n describe 'ruby_version_is \"1.9\"', ->\n xit \"raises a RuntimeError if self is frozen\", ->\n # s = R(\"abcdefghijklmnopqR\".freeze)\n # expect( -> s.tr_bang(\"cdefg\", \"12\") ).toThrow('RuntimeError')\n # expect( -> s.tr_bang(\"R\", \"S\") ).toThrow('RuntimeError')\n # expect( -> s.tr_bang(\"\", \"\") ).toThrow('RuntimeError')\n\n\n # ruby_version_is \"\"...\"1.9\", ->\n # xit \"raises a TypeError if self is frozen\", ->\n # s = \"abcdefghijklmnopqR\".freeze\n # lambda { s.tr_bang(\"cdefg\", \"12\") }.should raise_error(TypeError)\n # lambda { s.tr_bang(\"R\", \"S\") }.should raise_error(TypeError)\n # lambda { s.tr_bang(\"\", \"\") }.should raise_error(TypeError)\n # ruby_version_is '' ... '1.9.2' do\n # xit \"treats a descending range in the replacement as containing just the start character\", ->\n # expect( R(\"hello\").tr(\"a-y\", \"z-b\") ).toEqual \"zzzzz\"\n # xit \"treats a descending range in the source as empty\", ->\n # expect( R(\"hello\").tr(\"l-a\", \"z\") ).toEqual \"hello\"","avg_line_length":45.0648148148,"max_line_length":113,"alphanum_fraction":0.5748921307} {"size":2106,"ext":"coffee","lang":"CoffeeScript","max_stars_count":187.0,"content":"TestEditor = require '.\/test-editor'\n\ndescribe \"TestEditor\", ->\n cursorPosition = (editor, i) ->\n cursor = editor.getCursors()[i]\n point = cursor?.getBufferPosition()\n [point?.row, point?.column]\n\n cursorRange = (editor, i) ->\n cursor = editor.getCursors()[i]\n return null if !cursor?\n\n head = cursor.marker.getHeadBufferPosition()\n tail = cursor.marker.getTailBufferPosition()\n [head?.row, head?.column, tail?.row, tail?.column]\n\n beforeEach ->\n waitsForPromise =>\n atom.workspace.open().then (editor) =>\n @editor = editor\n @testEditor = new TestEditor(@editor)\n\n describe \"set\", ->\n it \"sets the buffer text\", ->\n @testEditor.setState('hi')\n expect(@editor.getText()).toEqual('hi')\n\n it \"sets cursors where specified\", ->\n @testEditor.setState('[0]a[2]b[1]')\n expect(@editor.getText()).toEqual('ab')\n\n expect(cursorPosition(@editor, 0)).toEqual([0, 0])\n expect(cursorPosition(@editor, 1)).toEqual([0, 2])\n expect(cursorPosition(@editor, 2)).toEqual([0, 1])\n\n it \"handles missing cursors\", ->\n expect((=> @testEditor.setState('[0]x[2]'))).\n toThrow('missing head of cursor 1')\n\n it \"sets forward & reverse selections if tails are specified\", ->\n @testEditor.setState('a(0)b[1]c[0]d(1)e')\n expect(@editor.getText()).toEqual('abcde')\n\n expect(cursorRange(@editor, 0)).toEqual([0, 3, 0, 1])\n expect(cursorRange(@editor, 1)).toEqual([0, 2, 0, 4])\n\n describe \"get\", ->\n it \"correctly positions cursors\", ->\n @editor.setText('abc')\n @editor.getLastCursor().setBufferPosition([0, 2])\n @editor.addCursorAtBufferPosition([0, 1])\n expect(@testEditor.getState()).toEqual('a[1]b[0]c')\n\n it \"correctly positions heads & tails of forward & reverse selections\", ->\n @editor.setText('abcde')\n @editor.getLastCursor().selection.setBufferRange([[0, 1], [0, 3]])\n cursor = @editor.addCursorAtBufferPosition([0, 0])\n cursor.selection.setBufferRange([[0, 2], [0, 4]], reversed: true)\n expect(@testEditor.getState()).toEqual('a(0)b[1]c[0]d(1)e')\n","avg_line_length":35.1,"max_line_length":78,"alphanum_fraction":0.626305793} {"size":123,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"'use strict'\n\nrequire '.\/base.scss'\nrequire '.\/base.html'\nrequire '.\/base.route.coffee'\nrequire '.\/base.controller.coffee'\n","avg_line_length":17.5714285714,"max_line_length":34,"alphanum_fraction":0.7154471545} {"size":91,"ext":"cson","lang":"CoffeeScript","max_stars_count":1.0,"content":"'.source.php':\n 'Input-secure':\n 'prefix': 'Input-secure'\n 'body': 'Input::secure()'","avg_line_length":22.75,"max_line_length":29,"alphanum_fraction":0.5714285714} {"size":252,"ext":"coffee","lang":"CoffeeScript","max_stars_count":4858.0,"content":"CocoModel = require '.\/CocoModel'\nschema = require 'schemas\/models\/branch.schema'\nCocoCollection = require 'collections\/CocoCollection'\n\nmodule.exports = class Branch extends CocoModel\n @className: 'Branch'\n @schema: schema\n urlRoot: '\/db\/branches'\n","avg_line_length":28.0,"max_line_length":53,"alphanum_fraction":0.7658730159} {"size":3117,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"{ NODE_ENV } = require '..\/..\/config'\n{ stringifyJSONForWeb } = require '..\/..\/components\/util\/json'\nPartnerShow = require '..\/..\/models\/partner_show'\nmetaphysics = require '..\/..\/..\/lib\/metaphysics'\nDateHelpers = require '..\/..\/components\/util\/date_helpers'\nViewHelpers = require '.\/helpers\/view_helpers'\n\nquery = \"\"\"\n query ShowMetadataQuery($id: String!) {\n partner_show(id: $id) {\n _id\n id\n created_at\n start_at\n end_at\n name\n displayable\n has_location\n press_release(format: HTML)\n description\n status\n href\n counts {\n artworks\n eligible_artworks\n }\n events {\n description\n title\n start_at\n end_at\n event_type\n }\n partner {\n id\n _id\n href\n name\n type\n is_linkable\n default_profile_id\n }\n fair {\n id\n _id\n profile {\n is_published\n }\n published\n has_full_feature\n name\n href\n start_at\n end_at\n location {\n coordinates {\n lat\n lng\n }\n display\n city\n state\n postal_code\n country\n address\n address_2\n }\n }\n location {\n coordinates {\n lat\n lng\n }\n display\n city\n state\n postal_code\n country\n address\n address_2\n day_schedules {\n start_time\n end_time\n day_of_week\n }\n }\n artworks {\n id\n _id\n __id\n href\n collecting_institution\n image {\n url(version: \"large\")\n width\n height\n aspect_ratio\n placeholder\n }\n partner {\n href\n id\n type\n name\n }\n artists {\n public\n href\n name\n }\n date\n title\n sale_message\n is_inquireable\n }\n artists {\n id\n name\n href\n image {\n url(version: \"large\")\n }\n }\n meta_image {\n meta_image_url: url(version: \"larger\")\n meta_thumb_url: url(version: \"medium\")\n }\n install_shots: images(default: false) {\n carousel_dimension: resized(height: 300, version: \"large\") {\n width\n }\n url(version: \"larger\")\n caption\n }\n }\n }\n\"\"\"\n\n@index = (req, res, next) ->\n send = query: query, variables: req.params\n\n return if metaphysics.debug req, res, send\n\n metaphysics send\n .then (data) ->\n res.locals.sd.PARTNER_SHOW = data.partner_show # bootstrap\n res.locals.sd.INCLUDE_SAILTHRU = res.locals.sd.PARTNER_SHOW?\n res.locals.ViewHelpers = ViewHelpers\n res.locals.DateHelpers = DateHelpers\n res.locals.jsonLD = JSON.stringify ViewHelpers.toJSONLD data.partner_show\n data.artworkColumns = ViewHelpers.groupByColumnsInOrder(data.partner_show.artworks)\n res.render 'index', data\n .catch next\n","avg_line_length":20.2402597403,"max_line_length":89,"alphanum_fraction":0.5056143728} {"size":647,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"Helper = require('hubot-test-helper')\nchai = require 'chai'\n\nexpect = chai.expect\n\nhelper = new Helper('..\/src\/to-phabricator.coffee')\n\ndescribe 'to-phabricator', ->\n beforeEach ->\n @room = helper.createRoom()\n\n afterEach ->\n @room.destroy()\n\n it 'responds to hello', ->\n @room.user.say('alice', '@hubot hello').then =>\n expect(@room.messages).to.eql [\n ['alice', '@hubot hello']\n ['hubot', '@alice hello!']\n ]\n\n it 'hears orly', ->\n @room.user.say('bob', 'just wanted to say orly').then =>\n expect(@room.messages).to.eql [\n ['bob', 'just wanted to say orly']\n ['hubot', 'yarly']\n ]\n","avg_line_length":23.1071428571,"max_line_length":60,"alphanum_fraction":0.57187017} {"size":768,"ext":"coffee","lang":"CoffeeScript","max_stars_count":8.0,"content":"\"\"\"\nGit support for archie.\n\nUses the command line -- sorry Windows users!\n\"\"\"\nmkdirp = require 'mkdirp'\nrimraf = require 'rimraf'\nexec = require('child_process').exec\narchie = require '.\/..\/'\n\nmodule.exports = (archetype, vars) ->\n temp = '.\/~temp'\n\n checkIfDir = (folder) ->\n try\n return fs.statSync(temp).isDirectory()\n catch error\n return false\n\n while checkIfDir temp\n temp += 'p'\n\n exec \"git clone #{archetype.url} #{temp}\", (error, stdout, stderr) ->\n return console.error \"ERROR: Git cloning error: #{error}\" if error?\n console.log \"Cloned git repostory at #{archetype.url}.\"\n\n dest = \".\/#{vars.name}\/\"\n\n archie.generate temp, dest, vars\n\n # Remove dumb files\n rimraf \"#{dest}.git\/\", (err) ->\n rimraf temp, (err) ->\n","avg_line_length":22.5882352941,"max_line_length":71,"alphanum_fraction":0.6263020833} {"size":178,"ext":"coffee","lang":"CoffeeScript","max_stars_count":6.0,"content":"Chaplin = require \"chaplin\"\nHeaderView = require \"views\/header\"\n\nmodule.exports = class HeaderController extends Chaplin.Controller\n initialize: ->\n @view = new HeaderView()\n","avg_line_length":25.4285714286,"max_line_length":66,"alphanum_fraction":0.7528089888} {"size":1150,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"express = require 'express'\npath = require 'path'\nfavicon = require 'serve-favicon'\nlogger = require 'morgan'\ncookieParser = require 'cookie-parser'\nbodyParser = require 'body-parser'\nindex = require '.\/routes\/index'\nresume = require '.\/routes\/resume'\n\napp = express()\n\napp.set 'views', path.join __dirname, 'views'\napp.set 'view engine', 'pug'\n\napp.config =\nconfig = new (require '.\/lib\/config') {envroot}\n .load 'config.yaml'\n\napp.set 'envroot', envroot = __dirname\n\napp.use logger 'dev'\napp.use bodyParser.json()\napp.use bodyParser.urlencoded extended: false\napp.use cookieParser()\n\napp.use express.static path.join __dirname, 'public'\n\napp.use '\/', index\napp.use '\/resume', resume\n\napp.use (req, res, next) ->\n err = new Error 'Not Found'\n err.status = 404\n next err\n return\n\napp.use (err, req, res, next) ->\n # set locals, only providing error in development\n res.locals.message = err.message\n res.locals.error = if req.app.get('env') == 'development' then err else {}\n\n # render the error page\n res.status err.status or 500\n res.render 'error'\n return\n\nmodule.exports = app\n","avg_line_length":23.9583333333,"max_line_length":76,"alphanum_fraction":0.667826087} {"size":568,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"'use strict'\n\nexpress = require 'express'\ncontroller = require '.\/user.controller'\nconfig = require '..\/..\/config\/environment'\nauth = require '..\/..\/auth\/auth.service'\n\nrouter = express.Router()\n\nrouter.get '\/', auth.hasRole('admin'), controller.index\nrouter.delete '\/:id', auth.hasRole('admin'), controller.destroy\nrouter.get '\/me', auth.isAuthenticated(), controller.me\nrouter.put '\/:id\/password', auth.isAuthenticated(), controller.changePassword\nrouter.get '\/:id', auth.isAuthenticated(), controller.show\nrouter.post '\/', controller.create\n\nmodule.exports = router","avg_line_length":33.4117647059,"max_line_length":77,"alphanum_fraction":0.7323943662} {"size":959,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"# Overlay funny things on people's faces\n#\n# hubot hipster me - Overlay hipster glasses on a face.\n# hubot clown me - Overlay a clown nose on a face.\n# hubot scumbag me - Overlay a scumbag on a face.\n# hubot jason me - Overlay a jason on a face.\n\nmodule.exports = (robot) ->\n robot.respond \/(hipster|clown|scumbag|rohan|jason)( me)? (.*)\/i, (msg) ->\n type = msg.match[1]\n imagery = msg.match[3]\n\n if imagery.match \/^https?:\\\/\\\/\/i\n msg.send \"http:\/\/faceup.me\/img?overlay=#{type}&src=#{imagery}\"\n else\n imageMe msg, imagery, (url) ->\n msg.send \"http:\/\/faceup.me\/img?overlay=#{type}&src=#{url}\"\n\nimageMe = (msg, query, cb) ->\n msg.http('http:\/\/ajax.googleapis.com\/ajax\/services\/search\/images')\n .query(v: \"1.0\", rsz: '8', q: query)\n .get() (err, res, body) ->\n images = JSON.parse(body)\n images = images.responseData.results\n image = msg.random images\n cb \"#{image.unescapedUrl}\"\n","avg_line_length":35.5185185185,"max_line_length":75,"alphanum_fraction":0.6246089677} {"size":1243,"ext":"coffee","lang":"CoffeeScript","max_stars_count":4.0,"content":"# Description:\n# Utility commands surrounding Hubot uptime.\n#\n# Commands:\n# hubot ping - Reply with pong\n# hubot echo - Reply back with \n# hubot time - Reply with current time\n# hubot die - Pretend to end hubot process\n\nmodule.exports = (robot) ->\n robot.respond \/PING$\/i, (msg) ->\n msg.send \"PONG\"\n\n robot.respond \/ECHO (.*)$\/i, (msg) ->\n msg.send msg.match[1]\n\n robot.respond \/TIME$\/i, (msg) ->\n msg.send \"Server time is: #{new Date()}\"\n\n robot.respond \/DIE$\/i, (msg) ->\n msg.send \"Goodbye, cruel world.\"\n\n robot.hear \/(([^:\\s!]+):\\s)(can (I ask )?you (help|something))\/i, (msg) ->\n msg.send \"Please avoid directing questions at specific people, ask the room instead.\"\n\n robot.hear \/(.+)?(is( there)?|are|can)?(you|((some|any)(one|body))) (awake|alive|help( me)?|home|(in|out )?t?here)(\\?)?$\/i, (msg) ->\n msg.send \"Probably! What do you want to know?\"\n\n robot.hear \/^(?:([^:\\s!]+):\\s)?(?:(?:(?:do|have)? you )|(?:does|has)?\\s?anyone )?(?:got|have)(?: (time|a minute))( to help)?\\??\/i, (msg) ->\n user = msg.match[1]\n type = msg.match[2]\n\n if type is \"time\"\n msg.send \"So much universe, and so little time...\"\n else\n msg.send \"There is always time for another last minute\"\n","avg_line_length":33.5945945946,"max_line_length":141,"alphanum_fraction":0.5961383749} {"size":846,"ext":"coffee","lang":"CoffeeScript","max_stars_count":10.0,"content":"import \"source-map-support\/register\"\nimport \"colors\"\nimport {flow} from \"panda-garden\"\n\nimport {logger, bell, stopwatch as Stopwatch} from \".\/utils\"\nimport readConfiguration from \".\/configuration\"\nimport {setupEdgeLambdas, teardownEdgeLambdas} from \".\/lambdas\"\nimport {syncBucket, teardownBucket} from \".\/bucket\"\nimport {scanLocal, reconcile} from \".\/local\"\nimport {publishStack, teardownStack} from \".\/stack\"\n\nlogger()\n\nstart = (env, options) ->\n stopwatch = Stopwatch()\n {env, options, stopwatch}\n\nend = (config) ->\n console.log config.stopwatch()\n console.log bell\n\npublish = flow [\n start\n readConfiguration\n setupEdgeLambdas\n syncBucket\n publishStack\n end\n]\n\nteardown = flow [\n start\n readConfiguration\n teardownStack\n teardownBucket\n teardownEdgeLambdas\n end\n]\n\nexport {publish, teardown}\nexport default {publish, teardown}\n","avg_line_length":20.1428571429,"max_line_length":63,"alphanum_fraction":0.743498818} {"size":872,"ext":"coffee","lang":"CoffeeScript","max_stars_count":33.0,"content":"feature \"Parallelize\", ->\n parallel = null\n beforeEach ->\n parallel = parallelize 2\n\n it \"works\", (done) =>\n called = false\n setTimeout parallel, 50\n setTimeout parallel, 20\n parallel.done => called = true\n called.should.equal false\n setTimeout (=>\n called.should.equal true\n done()\n ), 100\n\n it \"works immediately\", (done) =>\n parallel()\n parallel()\n parallel.done done\n\n it \"doesn't call the callback if not run enough times\", (done) =>\n called = false\n parallel()\n parallel.done => called = true\n setTimeout (=>\n called.should.equal false\n done()\n ), 50\n\n it \"resets after calling the callback\", =>\n called = false\n parallel()\n parallel()\n parallel.done (=>)\n parallel()\n parallel.done => called = true\n called.should.equal false\n parallel()\n called.should.equal true\n","avg_line_length":21.2682926829,"max_line_length":67,"alphanum_fraction":0.6123853211} {"size":1322,"ext":"coffee","lang":"CoffeeScript","max_stars_count":393.0,"content":"###\n Pokemon Go(c) MITM node proxy\n by Michael Strassburger \n\n This example dumps all raw envelopes and signatures to separate files\n\n###\n\nPokemonGoMITM = require '.\/lib\/pokemon-go-mitm'\nfs = require 'fs'\npcrypt = require 'pcrypt'\n\nserver = new PokemonGoMITM port: 8081, debug: true\n\t.addRawRequestEnvelopeHandler (buffer) ->\n\t\ttimestamp = Date.now()\n\t\tif decoded = @parseProtobuf buffer, 'POGOProtos.Networking.Envelopes.RequestEnvelope'\n\t\t\tid = decoded.request_id\n\t\tconsole.log \"[#] Request Envelope\", decoded\n\t\tfs.writeFileSync \"#{timestamp}.#{id}.request\", buffer, 'binary'\n\n\t\t# TODO: update once repeated field 6 is parsed\n\t\treturn false unless decoded?.unknown6[0]?.unknown2?.encrypted_signature\n\n\t\tbuffer = pcrypt.decrypt decoded.unknown6[0]?.unknown2?.encrypted_signature\n\t\tdecoded = @parseProtobuf buffer, 'POGOProtos.Networking.Envelopes.Signature'\n\t\tconsole.log \"[@] Request Envelope Signature\", decoded\n\t\tfs.writeFileSync \"#{timestamp}.#{id}.signature\", buffer, 'binary'\n\t\tfalse\n\n\t.addRawResponseEnvelopeHandler (buffer) ->\n\t\ttimestamp = Date.now()\n\t\tif decoded = @parseProtobuf buffer, 'POGOProtos.Networking.Envelopes.ResponseEnvelope'\n\t\t\tid = decoded.request_id\n\t\tconsole.log \"[#] Response Envelope\", decoded\n\t\tfs.writeFileSync \"#{timestamp}.#{id}.response\", buffer, 'binary'\n\t\tfalse\n\n","avg_line_length":34.7894736842,"max_line_length":88,"alphanum_fraction":0.743570348} {"size":1156,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"\nmarkdownItGraph = require '.\/md_graph'\nd3 = require 'd3'\ndagreD3 = require 'dagre-d3'\ndot = require 'graphlib-dot'\nuuid = require 'node-uuid'\n\ndotProcessor = (tokens, graph_template, error_template) ->\n render = dagreD3.render()\n register: (mdInstance, postProcessors) ->\n markdownItGraph(tokens).register mdInstance, (graphStr) ->\n try\n graph = dot.read graphStr\n id = \"dg-\" + uuid.v4()\n postProcessors.registerElemenbById id, (elem, done) ->\n d3.select(elem).call(render, graph)\n svgElem = elem.getElementsByClassName('output')[0]\n svgHeight = svgElem?.getBoundingClientRect().height || 0\n elem.style.height = svgHeight + 22\n\n # remove arrows in undirected graphs\n if !graph.isDirected()\n tags = elem.getElementsByTagName('path')\n [].forEach.call tags, (e) ->\n e.setAttribute 'marker-end', ''\n\n done()\n\n # graph was parsed succesful\n return graph_template id: id\n\n # parsing errors..\n catch e\n return error_template error: e\n\n return null\n\nmodule.exports = dotProcessor\n","avg_line_length":29.641025641,"max_line_length":68,"alphanum_fraction":0.6115916955} {"size":2638,"ext":"coffee","lang":"CoffeeScript","max_stars_count":31.0,"content":"\nnikita = require '@nikitajs\/core\/lib'\n{tags, config, docker} = require '..\/test'\nthey = require('mocha-they')(config)\n\nreturn unless tags.docker\n\ndescribe 'docker.tools.service', ->\n \n describe 'schema', ->\n \n they 'honors docker.run', ({ssh}) ->\n nikita\n $ssh: ssh\n docker: docker\n .docker.tools.service\n image: 'httpd'\n container: 'nikita_test_unique'\n pid: [key: true] # docker.run action define type string\n .should.be.rejectedWith\n code: 'NIKITA_SCHEMA_VALIDATION_CONFIG'\n \n they 'overwrite default', ({ssh}) ->\n nikita\n $ssh: ssh\n docker: docker\n .docker.tools.service\n image: 'httpd'\n container: 'nikita_test_unique'\n port: '499:80'\n , ({config}) ->\n config.detach.should.be.true()\n config.rm.should.be.false()\n\n they 'simple service', ({ssh}) ->\n nikita\n $ssh: ssh\n docker: docker\n , ->\n @docker.rm\n force: true\n container: 'nikita_test_unique'\n @docker.tools.service\n image: 'httpd'\n container: 'nikita_test_unique'\n port: '499:80'\n # .wait_connect\n # port: 499\n # host: ipadress of docker, docker-machine...\n @docker.rm\n force: true\n container: 'nikita_test_unique'\n\n it 'config.container required', ->\n nikita.docker.tools.service\n image: 'httpd'\n port: '499:80'\n .should.be.rejectedWith\n message: [\n 'NIKITA_SCHEMA_VALIDATION_CONFIG:'\n 'one error was found in the configuration of action `docker.tools.service`:'\n '#\/required config must have required property \\'container\\'.'\n ].join ' '\n\n it 'config.image required', ->\n nikita.docker.tools.service\n container: 'toto'\n port: '499:80'\n .should.be.rejectedWith\n message: [\n 'NIKITA_SCHEMA_VALIDATION_CONFIG:'\n 'one error was found in the configuration of action `docker.tools.service`:'\n '#\/required config must have required property \\'image\\'.'\n ].join ' '\n\n they 'status not modified', ({ssh}) ->\n nikita\n $ssh: ssh\n docker: docker\n , ->\n @docker.rm\n force: true\n container: 'nikita_test'\n @docker.tools.service\n container: 'nikita_test'\n image: 'httpd'\n port: '499:80'\n {$status} = await @docker.tools.service\n container: 'nikita_test'\n image: 'httpd'\n port: '499:80'\n $status.should.be.false()\n @docker.rm\n force: true\n container: 'nikita_test'\n","avg_line_length":27.4791666667,"max_line_length":86,"alphanum_fraction":0.5629264594} {"size":349,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"beforeEach ->\n jasmine.addMatchers\n toBeVisible: ->\n compare: (actual) ->\n $el = actual\n\n result =\n pass: $(actual).is(':visible')\n\n if result.pass\n result.message = \"Expected element not to be visible.\"\n else\n result.message = \"Expected element to be visible.\"\n\n return result\n","avg_line_length":21.8125,"max_line_length":64,"alphanum_fraction":0.5558739255} {"size":8924,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"import { expect } from 'chai'\n{createError, nogthrow, defaultErrorHandler} = NogError\n\n# Add helper to define test only on client.\nit.client = (args...) -> if Meteor.isClient then @(args...)\n\n\nfakeErrorCode = '999999'\n\ndescribe 'nog-error', ->\n fakeSpec = (diff) ->\n _.extend {\n errorCode: 'INVALID'\n statusCode: 0\n sanitized: null\n reason: ''\n details: ''\n }, diff\n\n describe 'createError(spec, context)', ->\n it 'uses errorCode from spec.', ->\n e = createError fakeSpec {errorCode: 'FAKE'}\n expect(e.errorCode).to.equal 'FAKE'\n\n it 'uses statusCode from spec.', ->\n e = createError fakeSpec {statusCode: 555}\n expect(e.statusCode).to.equal 555\n\n it 'uses reason from spec.', ->\n e = createError fakeSpec {reason: 'foo'}\n expect(e.reason).to.contain 'foo'\n\n it 'uses reason from spec (function).', ->\n e = createError fakeSpec({reason: (ctx) -> ctx.foo}), {\n foo: 'foo'\n }\n expect(e.reason).to.contain 'foo'\n expect(e.reason).to.not.contain 'function'\n\n it 'uses details from spec.', ->\n e = createError fakeSpec {details: 'foo'}\n expect(e.details).to.contain 'foo'\n\n it 'uses details from spec (function).', ->\n e = createError fakeSpec({details: (ctx) -> ctx.foo}), {\n foo: 'foo'\n }\n expect(e.details).to.contain 'foo'\n expect(e.details).to.not.contain 'function'\n\n it 'uses sanitized defaults.', ->\n {sanitizedError} = createError fakeSpec\n sanitized: null\n reason: 'foo'\n details: 'bar'\n expect(sanitizedError.error).to.equal 'NOGERR'\n expect(sanitizedError.reason).to.contain 'Unspecified'\n expect(sanitizedError.reason).to.not.contain 'foo'\n expect(sanitizedError.details).to.not.contain 'bar'\n expect(sanitizedError.message).to.contain 'NOGERR'\n expect(sanitizedError.message).to.contain 'Unspecified'\n\n it 'uses sanitized object from spec.', ->\n {sanitizedError} = createError fakeSpec\n sanitized:\n errorCode: 'FAKE'\n reason: 'foo'\n details: 'bar'\n expect(sanitizedError.error).to.equal 'FAKE'\n expect(sanitizedError.reason).to.contain 'foo'\n expect(sanitizedError.reason).to.not.contain 'Unspecified'\n expect(sanitizedError.details).contain 'bar'\n expect(sanitizedError.message).to.contain 'FAKE'\n expect(sanitizedError.message).to.contain 'foo'\n\n it 'uses sanitized object from spec (functions).', ->\n {sanitizedError} = createError fakeSpec(\n sanitized:\n errorCode: 'FAKE'\n reason: (ctx) -> ctx.foo\n details: (ctx) -> ctx.bar\n ), {\n foo: 'foo'\n bar: 'bar'\n }\n expect(sanitizedError.reason).to.contain 'foo'\n expect(sanitizedError.reason).to.not.contain 'Unspecified'\n expect(sanitizedError.details).contain 'bar'\n expect(sanitizedError.message).to.contain 'foo'\n\n it 'supports sanitized `full`.', ->\n {sanitizedError} = createError fakeSpec({sanitized: 'full'}),\n reason: 'foo'\n details: 'bar'\n expect(sanitizedError.reason).to.contain 'foo'\n expect(sanitizedError.message).to.contain 'foo'\n expect(sanitizedError.reason).to.not.contain 'Unspecified'\n expect(sanitizedError.details).contain 'bar'\n\n it 'uses reason from context.', ->\n e = createError fakeSpec(),\n reason: 'foo'\n expect(e.reason).to.contain 'foo'\n\n it 'uses details from context.', ->\n e = createError fakeSpec(),\n details: 'bar'\n expect(e.details).to.contain 'bar'\n\n it 'adds time.', ->\n e = createError fakeSpec()\n expect(e.time).to.exist\n\n it 'adds a token.', ->\n e = createError fakeSpec()\n expect(e.token).to.exist\n\n it 'stores a context object.', ->\n e = createError fakeSpec(),\n foo: 'foo'\n expect(e.context.foo).to.equal 'foo'\n\n it 'composes the reason from cause.', ->\n cause = new Meteor.Error 'FAKE', 'foo', 'bar'\n e = createError fakeSpec(), {cause}\n expect(e.reason).to.contain 'foo'\n\n it 'composes the details from cause.', ->\n cause = new Meteor.Error 'FAKE', 'foo', 'bar'\n e = createError fakeSpec(), {cause}\n expect(e.details).to.contain 'bar'\n\n it 'composes the sanitized reason from cause.', ->\n cause = createError fakeSpec({sanitized: 'full'}), {\n reason: 'foo', details: 'bar'\n }\n {sanitizedError} = createError fakeSpec(), {cause}\n expect(sanitizedError.reason).to.contain 'foo'\n\n it 'composes the sanitized details from cause.', ->\n cause = createError fakeSpec({sanitized: 'full'}), {\n reason: 'foo', details: 'bar'\n }\n {sanitizedError} = createError fakeSpec(), {cause}\n expect(sanitizedError.details).to.contain 'bar'\n\n it 'composes the sanitized reason from cause (full).', ->\n cause = createError fakeSpec(), {\n reason: 'foo', details: 'bar'\n }\n {sanitizedError} = createError fakeSpec({sanitized: 'full'}), {cause}\n expect(sanitizedError.reason).to.contain 'foo'\n\n it 'composes the sanitized details from cause (full).', ->\n cause = createError fakeSpec(), {\n reason: 'foo', details: 'bar'\n }\n {sanitizedError} = createError fakeSpec({sanitized: 'full'}), {cause}\n expect(sanitizedError.details).to.contain 'bar'\n\n it 'adds the error to the error log collection.', ->\n e = createError fakeSpec {errorCode: 'FAKE'}\n l = NogError.errorLog.findOne _.pick e, 'token', 'time'\n expect(l).to.exist\n\n describe 'nogthrow()', ->\n it 'throws for (spec, context).', ->\n fn = -> nogthrow fakeSpec({errorCode: 'FAKE'}), {reason: 'foo'}\n expect(fn).to.throw 'FAKE'\n expect(fn).to.throw 'foo'\n\n it 'throws for legacy (code, reason, details).', ->\n fn = -> nogthrow(fakeErrorCode, 'reason', 'details')\n expect(fn).to.throw fakeErrorCode\n expect(fn).to.throw 'reason'\n\n describe 'legacy createError(code, reason, details)', ->\n it 'accepts a string as details.', ->\n e = createError fakeErrorCode, 'reason', 'details'\n expect(e.errorCode).to.be.equal fakeErrorCode\n expect(e.statusCode).to.be.equal 500\n expect(e.reason).to.contain 'reason'\n expect(e.details).to.contain 'details'\n expect(e.history[0].details).to.contain 'details'\n expect(e.message).to.contain fakeErrorCode\n expect(e.message).to.contain 'reason'\n expect(e.sanitizedError.message).to.contain fakeErrorCode\n expect(e.sanitizedError.message).to.contain 'reason'\n expect(e.sanitizedError.details).to.contain 'details'\n\n it 'accepts undefined details.', ->\n e = createError fakeErrorCode, 'reason'\n expect(e.errorCode).to.be.equal fakeErrorCode\n expect(e.reason).to.be.contain 'reason'\n expect(e.message).to.contain fakeErrorCode\n expect(e.message).to.contain 'reason'\n expect(e.sanitizedError.message).to.contain fakeErrorCode\n expect(e.sanitizedError.message).to.contain 'reason'\n\n it 'accepts an Error as details.', ->\n details = new Error 'origError'\n e = createError fakeErrorCode, 'reason', details\n expect(e.message).to.contain 'origError'\n expect(e.history[1].reason).to.contain 'origError'\n expect(e.sanitizedError.message).to.contain 'origError'\n\n it 'accepts a Meteor.Error as details.', ->\n details = createError 'err1', 'reason1', 'details1'\n e = createError fakeErrorCode, 'reason', details\n expect(e.history[1].errorCode).to.equal 'err1'\n expect(e.history[1].reason).to.contain 'reason1'\n expect(e.history[1].details).to.contain 'details1'\n expect(e.sanitizedError.message).to.contain 'reason1'\n expect(e.sanitizedError.details).to.contain 'details1'\n\n describe 'defaultErrorHandler()', ->\n it.client \"sets Session 'errors'.\", ->\n Session.set 'errors', null\n defaultErrorHandler createError(fakeErrorCode, 'reason', 'details')\n expect(Session.get('errors')[0].errorCode).to.be.equal fakeErrorCode\n\n describe 'errorDisplay', ->\n it.client \"reacts to Session 'errors'.\", ->\n Session.set 'errors', null\n tmpl = Template.errorDisplay\n errorDisplay = $(renderToDiv tmpl).find('.nog-error-display')\n expect(errorDisplay.length).to.equal 0\n defaultErrorHandler createError(fakeErrorCode, 'reason', 'details')\n errorDisplay = $(renderToDiv tmpl).find('.nog-error-display')\n expect(errorDisplay.length).to.equal 1\n\n it.client \"clears Session 'errors' when clicking the clear button.\", ->\n Session.set 'errors', null\n defaultErrorHandler createError(fakeErrorCode, 'reason', 'details')\n expect(Session.get 'errors').to.have.length 1\n tmpl = Template.errorDisplay\n $(renderToDiv tmpl).find('.js-clear-errors').click()\n expect(Session.get 'errors').to.not.exist\n","avg_line_length":37.3389121339,"max_line_length":75,"alphanum_fraction":0.6370461676} {"size":2497,"ext":"coffee","lang":"CoffeeScript","max_stars_count":7.0,"content":"# Copyright \u00a9 2011-2020 MUSC Foundation for Research Development~\n# All rights reserved.~\n\n# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:~\n\n# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.~\n\n# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following~\n# disclaimer in the documentation and\/or other materials provided with the distribution.~\n\n# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products~\n# derived from this software without specific prior written permission.~\n\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,~\n# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT~\n# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL~\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS~\n# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR~\n# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.~\n\n$(\"#modal_errors\").html(\"<%= escape_javascript(render(partial: 'modal_errors', locals: {errors: @report.errors})) %>\");\nif $(\"#modal_errors > .alert.alert-danger > p\").length == 0\n <% if @reports_params %>\n <% if not @reports_params[:protocols_participant_id].blank? %>\n $(\"#participant_report_<%= @reports_params[:protocols_participant_id] %>\").data(\"document_id\", \"<%= @document.id %>\")\n $(\"#participant_report_<%= @reports_params[:protocols_participant_id] %>\").attr(\"document_id\", \"<%= @document.id %>\")\n <% elsif @document.documentable_type == 'Protocol' %>\n $(\"#study_schedule_report_<%= @reports_params[:protocol_id] %>\").data(\"document_id\", \"<%= @document.id %>\")\n $(\"#study_schedule_report_<%= @reports_params[:protocol_id] %>\").attr(\"document_id\", \"<%= @document.id %>\")\n <% end %>\n <% end %>\n window.document_id = <%= @document.id %>\n $(\"#modalContainer\").modal('hide')\n $('table.documents').bootstrapTable('refresh')\n","avg_line_length":71.3428571429,"max_line_length":146,"alphanum_fraction":0.7452943532} {"size":205,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"'use strict';\n\nangular.module(\"<%= _.camelize(appname) %>App\").config [\"$provide\", ($provide) ->\n $provide.decorator \"<%= _.camelize(name) %>\", ($delegate) ->\n # decorate the $delegate\n $delegate\n]\n","avg_line_length":25.625,"max_line_length":81,"alphanum_fraction":0.6097560976} {"size":359,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"path = require(\"path\")\ngulp = require(\"gulp\")\nthrough = require(\"through2\")\ntypings_core = require(\"typings-core\")\n\ninstall = (file, enc, cb) ->\n opts = {production: false, cwd: path.dirname(file.path)}\n typings_core.install(opts).then(() -> cb(null, file))\n\ngulp.task \"typings:install\", () ->\n gulp.src(\".\/typings.json\")\n .pipe(through.obj(install))\n","avg_line_length":27.6153846154,"max_line_length":58,"alphanum_fraction":0.6601671309} {"size":15515,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"membership = null\ngroup = null\nuser = null\n\ndescribe 'Tower.ModelRelation', ->\n beforeEach (done) ->\n async.series [\n (callback) =>\n App.User.create firstName: 'Lance', (error, record) =>\n user = record\n callback()\n (callback) =>\n App.Group.create (error, record) =>\n group = record\n callback()\n ], done\n \n afterEach ->\n try App.Parent.create.restore()\n try App.Group.create.restore()\n try App.Membership.create.restore()\n \n describe 'inverseOf', ->\n test 'noInverse_noInverse', ->\n assert.notEqual 'noInverse_noInverse', try App.Parent.relation('noInverse_noInverse').inverse().name\n \n test 'parent: noInverse_withInverse, child: withInverse_noInverse', ->\n assert.equal 'withInverse_noInverse', App.Parent.relation('noInverse_withInverse').inverse().name\n \n test 'withInverse_withInverse', ->\n assert.equal 'withInverse_withInverse', App.Parent.relation('withInverse_withInverse').inverse().name\n \n test 'parent: withInverse_noInverse, child: noInverse_withInverse', ->\n assert.equal 'noInverse_withInverse', App.Parent.relation('withInverse_noInverse').inverse().name\n\n describe 'HasMany', ->\n describe '.create', ->\n test 'compileForInsert', ->\n cursor = user.get('memberships').cursor\n cursor.compileForInsert()\n assert.deepEqual cursor.conditions(), { userId: user.get('id') }\n\n test 'compileForInsert with cache: true', ->\n cursor = user.get('cachedMemberships').cursor\n cursor.compileForInsert()\n\n assert.deepEqual cursor.conditions(), { userId: user.get('id') }\n\n test 'compileForInsert on polymorphic record', ->\n cursor = user.get('polymorphicMemberships').cursor\n cursor.compileForInsert()\n \n assert.deepEqual cursor.conditions(), { joinableId: user.get('id'), joinableType: 'User' }\n \n test 'insert relationship model', (done) ->\n user.get('memberships').create groupId: group.get('id'), (error, membership) =>\n assert.equal membership.get('userId').toString(), user.get('id').toString()\n assert.equal membership.get('groupId').toString(), group.get('id').toString()\n done()\n \n describe '.update', ->\n beforeEach (done) ->\n App.Membership.create groupId: group.get('id'), =>\n user.get('memberships').create groupId: group.get('id'), done\n \n test 'compileForUpdate', ->\n cursor = user.get('memberships').cursor\n cursor.compileForUpdate()\n \n assert.deepEqual cursor.conditions(), { userId: user.get('id') }\n\n test 'update relationship model', (done) ->\n user.get('memberships').update kind: 'guest', (error, memberships) =>\n assert.equal memberships.length, 1\n assert.equal memberships[0].get('kind'), 'guest'\n App.Membership.count (error, count) =>\n assert.equal count, 2\n\n done()\n \n describe '.destroy', ->\n beforeEach (done) ->\n App.Membership.create groupId: group.get('id'), =>\n user.get('memberships').create groupId: group.get('id'), done\n \n test 'compileForDestroy', ->\n cursor = user.get('memberships').cursor\n cursor.compileForDestroy()\n\n assert.deepEqual cursor.conditions(), { userId: user.get('id') }\n \n test 'destroy relationship model', (done) ->\n user.get('memberships').destroy (error, memberships) =>\n assert.equal memberships.length, 1\n App.Membership.count (error, count) =>\n # since there were 2, but only one belonged to user\n assert.equal count, 1\n done()\n \n #test 'destroy relationship model if parent is destroyed (dependent: true)', (done) ->\n # App.User.create firstName: 'Lance', (error, user) =>\n # user.dependentMemberships().create =>\n # user.destroy =>\n # App.DependentMembership.count (error, count) =>\n # assert.equal count, 0\n # done()\n\n describe 'HasMany(through: true)', ->\n describe '.create', ->\n # don't want it to have any data b\/c all that data is stored on the relationship model.\n test 'compileForInsert', ->\n cursor = user.get('groups').cursor\n cursor.compileForInsert()\n\n assert.deepEqual cursor.conditions(), { }\n\n test 'throughRelation', ->\n cursor = user.get('groups').cursor\n relation = cursor.relation\n throughRelation = cursor.throughRelation\n \n assert.equal throughRelation.type, 'App.Membership'\n assert.equal throughRelation.targetType, 'App.Membership'\n assert.equal throughRelation.name, 'memberships'\n assert.equal throughRelation.ownerType, 'App.User'\n assert.equal throughRelation.foreignKey, 'userId'\n \n inverseRelation = relation.inverseThrough(throughRelation)\n assert.equal inverseRelation.name, 'group'\n assert.equal inverseRelation.type, 'App.Group'\n assert.equal inverseRelation.foreignKey, 'groupId'\n \n test 'insertThroughRelation', (done) ->\n cursor = user.get('groups').cursor\n \n cursor.insertThroughRelation group, (error, record) =>\n assert.equal record.constructor.className(), 'Membership'\n assert.equal record.get('groupId').toString(), group.get('id').toString()\n assert.equal record.get('userId').toString(), user.get('id').toString()\n done()\n\n test 'all together now, insert through model', (done) ->\n user.get('groups').create (error, group) =>\n # removed this functionality\n # assert.ok user.get('memberships').all() instanceof Array, 'user.memberships.all instanceof Array'\n assert.ok user.get('memberships').all().isCursor, 'user.memberships.all.isCursor'\n assert.ok user.get('memberships').all().isHasMany, 'user.memberships.all.isHasManyThrough'\n\n user.get('memberships').all (error, memberships) =>\n assert.equal memberships.length, 1\n record = memberships[0]\n assert.equal record.get('groupId').toString(), group.get('id').toString()\n assert.equal record.get('userId').toString(), user.get('id').toString()\n \n user.get('groups').all (error, groups) =>\n assert.equal groups.length, 1\n \n done()\n \n test 'insert 2 models and 2 through models as Arguments', (done) ->\n assert.isTrue user.get('groups').all().isHasManyThrough, 'user.groups.isHasManyThrough'\n\n user.get('groups').create {}, {}, (error, groups) =>\n assert.equal groups.length, 2\n \n App.Group.count (error, count) =>\n assert.equal count, 3\n \n user.get('memberships').count (error, count) =>\n assert.equal count, 2\n \n user.get('groups').count (error, count) =>\n assert.equal count, 2\n \n done()\n \n describe '.update', ->\n beforeEach (done) ->\n user.get('groups').create {name: 'Starbucks'}, {}, done\n \n test 'update all groups', (done) ->\n user.get('groups').update name: \"Peet's\", =>\n user.get('groups').all (error, groups) =>\n assert.equal groups.length, 2\n for group in groups\n assert.equal group.get('name'), \"Peet's\"\n done()\n \n test 'update matching groups', (done) ->\n user.get('groups').where(name: \"Starbucks\").update name: \"Peet's\", =>\n user.get('groups').where(name: \"Peet's\").count (error, count) =>\n assert.equal count, 1\n user.get('memberships').count (error, count) =>\n assert.equal count, 2\n done()\n \n describe '.destroy', ->\n beforeEach (done) ->\n user.get('groups').create {name: \"Starbucks\"}, {}, done\n \n test 'destroy all groups', (done) ->\n user.get('groups').destroy =>\n user.get('groups').count (error, count) =>\n assert.equal count, 0\n done()\n \n #describe 'through relation has dependent: \"destroy\"', ->\n # test 'destroy all through relations', (done) ->\n # user.get('groups').destroy =>\n # user.get('memberships').count (error, count) =>\n # assert.equal count, 0\n # done()\n\n describe '.find', ->\n beforeEach (done) ->\n App.Group.create =>\n App.Membership.create =>\n user.get('memberships').create groupId: group.get('id'), (error, record) =>\n membership = record\n done()\n \n test 'appendThroughConditions', (done) ->\n cursor = user.get('groups').cursor\n \n assert.deepEqual cursor.conditions(), { }\n \n cursor.appendThroughConditions =>\n assert.deepEqual cursor.conditions(), { id: $in: [group.get('id')] }\n done()\n\n describe 'finders', ->\n beforeEach (done) ->\n App.Group.create =>\n App.Membership.create =>\n user.get('groups').create {name: \"A\"}, {name: \"B\"}, {name: \"C\"}, done\n \n describe 'relation (groups)', ->\n test 'all', (done) ->\n user.get('groups').all (error, records) =>\n assert.equal records.length, 3\n done()\n \n test 'first', (done) ->\n user.get('groups').desc(\"name\").first (error, record) =>\n assert.equal record.get('name'), \"C\"\n done()\n\n test 'last', (done) ->\n user.get('groups').desc(\"name\").last (error, record) =>\n assert.equal record.get('name'), \"A\"\n done()\n\n test 'count', (done) ->\n user.get('groups').count (error, count) =>\n assert.equal count, 3\n done()\n\n test 'exists', (done) ->\n user.get('groups').exists (error, value) =>\n assert.equal value, true\n done()\n \n describe 'through relation (memberships)', ->\n test 'all', (done) ->\n user.get('memberships').all (error, records) =>\n assert.equal records.length, 3\n done()\n\n test 'first', (done) ->\n user.get('memberships').first (error, record) =>\n assert.ok record\n done()\n\n test 'last', (done) ->\n user.get('memberships').last (error, record) =>\n assert.ok record\n done()\n\n test 'count', (done) ->\n user.get('memberships').count (error, count) =>\n assert.equal count, 3\n done()\n \n test 'exists', (done) ->\n user.get('memberships').exists (error, value) =>\n assert.equal value, true\n done()\n \n describe 'hasMany with idCache', ->\n parent = null\n \n beforeEach (done) ->\n async.series [\n (next) => App.Parent.create (error, record) =>\n parent = record\n next()\n ], done\n \n describe 'Parent.idCacheTrue_idCacheFalse', ->\n cursor = null\n relation = null\n \n beforeEach ->\n relation = App.Parent.relations().idCacheTrue_idCacheFalse\n cursor = parent.get('idCacheTrue_idCacheFalse').cursor\n \n test 'relation', ->\n assert.equal relation.idCache, true\n assert.equal relation.idCacheKey, \"idCacheTrue_idCacheFalse\" + \"Ids\"\n \n test 'default for idCacheKey should be array', ->\n assert.ok _.isArray App.Parent.fields()[relation.idCacheKey]._default\n \n test 'compileForInsert', (done) ->\n cursor.compileForInsert()\n \n assert.deepEqual cursor.conditions(), { parentId: parent.get('id') }\n \n done()\n\n test 'updateOwnerRecord', ->\n assert.equal cursor.updateOwnerRecord(), true\n \n test 'ownerAttributes', (done) ->\n child = new App.Child(id: 20)\n \n assert.deepEqual cursor.ownerAttributes(child), { '$add': { idCacheTrue_idCacheFalseIds: child.get('id') } }\n \n done()\n\n describe 'persistence', ->\n child = null\n child2 = null\n child3 = null\n \n beforeEach (done) ->\n async.series [\n (next) =>\n parent.get('idCacheTrue_idCacheFalse').create (error, record) =>\n child = record\n next()\n (next) =>\n parent.get('idCacheTrue_idCacheFalse').create (error, record) =>\n child2 = record\n next()\n (next) =>\n # insert one without a parent at all\n App.Child.create (error, record) =>\n child3 = record\n next()\n (next) =>\n App.Parent.find parent.get('id'), (error, record) =>\n parent = record\n next()\n ], done\n \n test 'insert', (done) ->\n assert.equal child.get('parentId').toString(), parent.get('id').toString()\n assert.deepEqual parent.get(relation.idCacheKey), [child.get('id'), child2.get('id')]\n done()\n \n test 'update(1)', (done) ->\n parent.get('idCacheTrue_idCacheFalse').update child.get('id'), value: \"something\", =>\n App.Child.find child.get('id'), (error, child) =>\n assert.equal child.get('value'), 'something'\n \n App.Child.find child2.get('id'), (error, child) =>\n assert.equal child.get('value'), null\n \n done()\n\n test 'update()', (done) ->\n parent.get('idCacheTrue_idCacheFalse').update value: \"something\", =>\n App.Child.find child.get('id'), (error, child) =>\n assert.equal child.get('value'), 'something'\n\n App.Child.find child3.get('id'), (error, child) =>\n assert.equal child.get('value'), null\n\n done()\n \n test 'destroy(1)', (done) ->\n parent.get('idCacheTrue_idCacheFalse').destroy child.get('id'), =>\n App.Parent.find parent.get('id'), (error, parent) =>\n assert.deepEqual parent.get(relation.idCacheKey), [child2.get('id')]\n \n App.Child.all (error, records) =>\n assert.equal records.length, 2\n done()\n \n test 'destroy()', (done) ->\n parent.get('idCacheTrue_idCacheFalse').destroy =>\n App.Parent.find parent.get('id'), (error, parent) =>\n assert.deepEqual parent.get(relation.idCacheKey), []\n \n App.Child.all (error, records) =>\n assert.equal records.length, 1\n done()\n \n test 'all', (done) ->\n parent.get('idCacheTrue_idCacheFalse').all (error, records) =>\n assert.equal records.length, 2\n done()\n \n test 'add to set', (done) ->\n App.Child.create (error, newChild) =>\n parent.get('idCacheTrue_idCacheFalse').add newChild, =>\n App.Parent.find parent.get('id'), (error, parent) =>\n assert.deepEqual _.toS(parent.get(relation.idCacheKey)), _.toS([child.get('id'), child2.get('id'), newChild.get('id')])\n \n App.Child.all (error, records) =>\n assert.equal records.length, 4\n done()\n","avg_line_length":37.4758454106,"max_line_length":135,"alphanum_fraction":0.5495327103} {"size":643,"ext":"coffee","lang":"CoffeeScript","max_stars_count":23.0,"content":"'use strict'\n\nnmlParser = require '.\/'\n\ngetImports = (nml) ->\n ast = nmlParser.getAST nml\n nmlParser.getImports ast\n\nDEFAULT_IMPORTS = [\n {name: 'Class', ref: 'Renderer.Class'},\n {name: 'device', ref: 'Renderer.device'},\n {name: 'navigator', ref: 'Renderer.navigator'},\n {name: 'screen', ref: 'Renderer.screen'},\n]\n\nit 'default items', ->\n code = '''\n @Item {\n @PropertyAnimation {}\n }\n '''\n expected = [\n DEFAULT_IMPORTS...,\n {name: 'Item', ref: 'Renderer.Item'},\n {name: 'PropertyAnimation', ref: 'Renderer.PropertyAnimation'},\n ]\n assert.isEqual getImports(code), expected\n","avg_line_length":22.9642857143,"max_line_length":71,"alphanum_fraction":0.5863141524} {"size":2117,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"ToolbarTool = require(\"..\/toolbar_tool\")\n\nclass Remove extends ToolbarTool\n\n # Remove the current element.\n\n constructor: (@editor, @tools)->\n @requiresElement = true\n @label = 'Remove'\n @icon = 'delete_forever'\n\n canApply: (element, selection) ->\n # Return true if the tool can be applied to the current\n # element\/selection.\n return not element.isFixed()\n\n apply: (element, selection, callback) ->\n # Apply the tool to the current element\n\n # Blur the element before it's removed otherwise it will retain focus\n # even when detached.\n element.blur()\n\n # Focus on the next element\n if element.nextContent()\n element.nextContent().focus()\n else if element.previousContent()\n element.previousContent().focus()\n\n # Check the element is still mounted (some elements may automatically\n # remove themselves when they lose focus, for example empty text\n # elements.\n if not element.isMounted()\n callback(true)\n return\n\n # Remove the element\n switch element.type()\n when 'ListItemText'\n # Delete the associated list or list item\n if @editor.ctrlDown()\n list = element.closest (node) ->\n return node.parent().type() is 'Region'\n list.parent().detach(list)\n else\n element.parent().parent().detach(element.parent())\n break\n when 'TableCellText'\n # Delete the associated table or table row\n if @editor.ctrlDown()\n table = element.closest (node) ->\n return node.type() is 'Table'\n table.parent().detach(table)\n else\n row = element.parent().parent()\n row.parent().detach(row)\n break\n else\n element.parent().detach(element)\n break\n\n callback(true)\n\nmodule.exports = Remove\n","avg_line_length":32.5692307692,"max_line_length":77,"alphanum_fraction":0.5380255078} {"size":2117,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"# oauthd\n# Copyright (C) 2014 Webshell SAS\n#\n# NEW LICENSE HERE\n\nQ = require 'q'\n\nPath = require 'path'\nasync = require \"async\"\ncolors = require \"colors\"\n\n# request FIX\nqs = require 'request\/node_modules\/qs'\n\n\nexports.init = (env) ->\n\tdefer = Q.defer()\n\tstartTime = new Date\n\tenv = env || {}\n\t# Env is the global environment object. It is usually the 'this' (or @) in other modules\n\n\tenv.scaffolding = require('.\/scaffolding')()\n\n\tcoreModule = require '.\/core'\n\tdataModule = require '.\/data'\n\n\tcoreModule(env).initEnv() #inits env\n\tcoreModule(env).initConfig() #inits env.config\n\tcoreModule(env).initUtilities() # initializes env, env.utilities, ...\n\n\tdataModule(env) # initializes env.data\n\n\tcoreModule(env).initOAuth() # might be exported in plugin later\n\tcoreModule(env).initPluginsEngine()\n\n\toldstringify = qs.stringify\n\tqs.stringify = ->\n\t\tresult = oldstringify.apply(qs, arguments)\n\t\tresult = result.replace \/!\/g, '%21'\n\t\tresult = result.replace \/'\/g, '%27'\n\t\tresult = result.replace \/\\(\/g, '%28'\n\t\tresult = result.replace \/\\)\/g, '%29'\n\t\tresult = result.replace \/\\*\/g, '%2A'\n\t\treturn result\n\n\n\n\tenv.pluginsEngine.init process.cwd(), (err) ->\n\t\tif not err\n\t\t\tauth_plugin_present = false\n\t\t\tfor k, plugin of env.plugins\n\t\t\t\tif plugin.plugin_config.type == 'auth'\n\t\t\t\t\tauth_plugin_present = true\n\n\t\t\tif not auth_plugin_present\n\t\t\t\tenv.debug \"No \" + \"auth\".red + \" plugin found\"\n\t\t\t\tenv.debug \"You need to install an \" + \"auth\".red + \" plugin to run the server\"\n\t\t\t\tdefer.reject()\n\t\t\t\tprocess.exit()\n\n\t\t\t# start server\n\t\t\tenv.debug \"oauthd start server\"\n\t\t\texports.server = server = require('.\/server')(env)\n\t\t\tasync.series [\n\t\t\t\tenv.data.providers.getList,\n\t\t\t\tserver.listen\n\t\t\t], (err) ->\n\t\t\t\tif err\n\t\t\t\t\tconsole.error 'Error while initialisation', err.stack.toString()\n\t\t\t\t\tenv.pluginsEngine.data.emit 'server', err\n\t\t\t\t\tdefer.reject err\n\t\t\t\telse\n\t\t\t\t\tenv.debug 'Server is ready (load time: ' + Math.round(((new Date) - startTime) \/ 10) \/ 100 + 's)', (new Date).toGMTString()\n\t\t\t\t\tdefer.resolve()\n\n\t\t\treturn defer.promise\n\nexports.installPlugins = () ->\n\trequire('..\/bin\/cli\/plugins')(['install'],{}).command()\n\n","avg_line_length":26.1358024691,"max_line_length":128,"alphanum_fraction":0.6641473784} {"size":14326,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"\n\nDEBUG_IS = false\n\n# p is a U\n# this routine is a simple check on whether we have\n# a basic zero in our hands. It doesn't perform any\n# calculations or simplifications.\nisZeroAtom = (p) ->\n switch (p.k)\n when NUM\n if (MZERO(p.q.a))\n return 1\n when DOUBLE\n if (p.d == 0.0)\n return 1\n return 0\n\n# p is a U\n# this routine is a simple check on whether we have\n# a basic zero in our hands. It doesn't perform any\n# calculations or simplifications.\nisZeroTensor = (p) ->\n if p.k != TENSOR\n return 0\n\n for i in [0...p.tensor.nelem]\n if (!isZeroAtomOrTensor(p.tensor.elem[i]))\n return 0\n return 1\n\n# p is a U\n# this routine is a simple check on whether we have\n# a basic zero in our hands. It doesn't perform any\n# calculations or simplifications.\nisZeroAtomOrTensor = (p) ->\n isZeroAtom(p) or isZeroTensor(p)\n\n# This is a key routine to try to determine whether\n# the argument looks like zero\/false, or non-zero\/true,\n# or undetermined.\n# This is useful in two instances:\n# * to determine if a predicate is true\/false\n# * to determine if particular quantity is zero\n# Note that if one wants to check if we have a simple\n# zero atom or tensor in our hands, then the isZeroAtomOrTensor\n# routine is sufficient.\nisZeroLikeOrNonZeroLikeOrUndetermined = (valueOrPredicate) ->\n # push the argument\n push(valueOrPredicate)\n\n # just like Eval but turns assignments into\n # equality checks\n Eval_predicate()\n evalledArgument = pop()\n\n # OK first check if we already have\n # a simple zero (or simple zero tensor)\n if isZeroAtomOrTensor evalledArgument\n return 0\n\n # also check if we have a simple numeric value, or a tensor\n # full of simple numeric values (i.e. straight doubles or fractions).\n # In such cases, since we\n # just excluded they are zero, then we take it as\n # a \"true\"\n if isNumericAtomOrTensor evalledArgument\n return 1\n\n # if we are here we are in the case of value that\n # is not a zero and not a simple numeric value.\n # e.g. stuff like\n # 'sqrt(2)', or 'sin(45)' or '1+i', or 'a'\n # so in such cases let's try to do a float()\n # so we might get down to a simple numeric value\n # in some of those cases\n\n push evalledArgument\n zzfloat()\n evalledArgument = pop()\n\n # anything that could be calculated down to a simple\n # numeric value is now indeed either a \n # double OR a double with an imaginary component\n # e.g. 2.0 or 2.4 + i*5.6\n # (Everything else are things that don't have a numeric\n # value e.g. 'a+b')\n \n # So, let's take care of the case where we have\n # a simple numeric value with NO imaginary component,\n # things like sqrt(2) or sin(PI)\n # by doing the simple numeric\n # values checks again\n\n if isZeroAtomOrTensor evalledArgument\n return 0\n\n if isNumericAtomOrTensor evalledArgument\n return 1\n\n # here we still have cases of simple numeric values\n # WITH an imaginary component e.g. '1+i',\n # or things that don't have a numeric value e.g. 'a'\n\n # so now let's take care of the imaginary numbers:\n # since we JUST have to spot \"zeros\" we can just\n # calculate the absolute value and re-do all the checks\n # we just did\n\n if Find(evalledArgument, imaginaryunit)\n push evalledArgument\n absValFloat()\n\n Eval_predicate()\n evalledArgument = pop()\n\n # re-do the simple-number checks...\n\n if isZeroAtomOrTensor evalledArgument\n return 0\n\n if isNumericAtomOrTensor evalledArgument\n return 1\n\n # here we have stuff that is not reconducible to any\n # numeric value (or tensor with numeric values) e.g.\n # 'a+b', so it just means that we just don't know the\n # truth value, so we have\n # to leave the whole thing unevalled\n return null\n\n\n# p is a U\nisnegativenumber = (p) ->\n switch (p.k)\n when NUM\n if (MSIGN(p.q.a) == -1)\n return 1\n when DOUBLE\n if (p.d < 0.0)\n return 1\n return 0\n\n# p is a U\nispositivenumber = (p) ->\n switch (p.k)\n when NUM\n if (MSIGN(p.q.a) == 1)\n return 1\n when DOUBLE\n if (p.d > 0.0)\n return 1\n return 0\n\n# p is a U\nisplustwo = (p) ->\n switch (p.k)\n when NUM\n if (MEQUAL(p.q.a, 2) && MEQUAL(p.q.b, 1))\n return 1\n when DOUBLE\n if (p.d == 2.0)\n return 1\n return 0\n\n# p is a U\nisplusone = (p) ->\n switch (p.k)\n when NUM\n if (MEQUAL(p.q.a, 1) && MEQUAL(p.q.b, 1))\n return 1\n when DOUBLE\n if (p.d == 1.0)\n return 1\n return 0\n\nisminusone = (p) ->\n switch (p.k)\n when NUM\n if (MEQUAL(p.q.a, -1) && MEQUAL(p.q.b, 1))\n return 1\n when DOUBLE\n if (p.d == -1.0)\n return 1\n return 0\n\nisone = (p) ->\n return isplusone(p) or isminusone(p)\n\nisinteger = (p) ->\n if (p.k == NUM && MEQUAL(p.q.b, 1))\n return 1\n else\n return 0\n\nisintegerorintegerfloat = (p) ->\n if p.k == DOUBLE\n if (p.d == Math.round(p.d))\n return 1\n return 0\n return isinteger(p)\n\nisnonnegativeinteger = (p) ->\n if (isrational(p) && MEQUAL(p.q.b, 1) && MSIGN(p.q.a) == 1)\n return 1\n else\n return 0\n\nisposint = (p) ->\n if (isinteger(p) && MSIGN(p.q.a) == 1)\n return 1\n else\n return 0\n\n# --------------------------------------\n\nisunivarpolyfactoredorexpandedform = (p,x) ->\n if !x?\n push p\n guess()\n x = pop()\n pop()\n\n if ispolyfactoredorexpandedform(p,x) and (Find(p, symbol(SYMBOL_X)) + Find(p, symbol(SYMBOL_Y)) + Find(p, symbol(SYMBOL_Z)) == 1) \n return x\n else\n return 0\n\n# --------------------------------------\n# sometimes we want to check if we have a poly in our\n# hands, however it's in factored form and we don't\n# want to expand it.\n\nispolyfactoredorexpandedform = (p,x) ->\n return ispolyfactoredorexpandedform_factor(p, x)\n\nispolyfactoredorexpandedform_factor = (p,x) ->\n if (car(p) == symbol(MULTIPLY))\n p = cdr(p)\n while (iscons(p))\n if DEBUG then console.log \"ispolyfactoredorexpandedform_factor testing \" + car(p)\n if (!ispolyfactoredorexpandedform_power(car(p), x))\n if DEBUG then console.log \"... tested negative:\" + car(p)\n return 0\n p = cdr(p)\n return 1\n else\n return ispolyfactoredorexpandedform_power(p, x)\n\nispolyfactoredorexpandedform_power = (p,x) ->\n if (car(p) == symbol(POWER))\n if DEBUG then console.log \"ispolyfactoredorexpandedform_power (isposint(caddr(p)) \" + (isposint(caddr(p))\n if DEBUG then console.log \"ispolyfactoredorexpandedform_power ispolyexpandedform_expr(cadr(p), x)) \" + ispolyexpandedform_expr(cadr(p), x))\n return (isposint(caddr(p)) and ispolyexpandedform_expr(cadr(p), x))\n else\n if DEBUG then console.log \"ispolyfactoredorexpandedform_power not a power, testing if this is exp form: \" + p\n return ispolyexpandedform_expr(p, x)\n\n# --------------------------------------\n\nispolyexpandedform = (p,x) ->\n if (Find(p, x))\n return ispolyexpandedform_expr(p, x)\n else\n return 0\n\n\nispolyexpandedform_expr = (p,x) ->\n if (car(p) == symbol(ADD))\n p = cdr(p)\n while (iscons(p))\n if (!ispolyexpandedform_term(car(p), x))\n return 0\n p = cdr(p)\n return 1\n else\n return ispolyexpandedform_term(p, x)\n\nispolyexpandedform_term = (p,x) ->\n if (car(p) == symbol(MULTIPLY))\n p = cdr(p)\n while (iscons(p))\n if (!ispolyexpandedform_factor(car(p), x))\n return 0\n p = cdr(p)\n return 1\n else\n return ispolyexpandedform_factor(p, x)\n\nispolyexpandedform_factor = (p,x) ->\n if (equal(p, x))\n return 1\n if (car(p) == symbol(POWER) && equal(cadr(p), x))\n if (isposint(caddr(p)))\n return 1\n else\n return 0\n if (Find(p, x))\n return 0\n else\n return 1\n\n# --------------------------------------\n\nisnegativeterm = (p) ->\n if (isnegativenumber(p))\n return 1\n else if (car(p) == symbol(MULTIPLY) && isnegativenumber(cadr(p)))\n return 1\n else\n return 0\n\nhasNegativeRationalExponent = (p) ->\n if (car(p) == symbol(POWER) \\\n && isrational(car(cdr(cdr(p)))) \\\n && isnegativenumber(car(cdr(p))))\n if DEBUG_IS then console.log \"hasNegativeRationalExponent: \" + p.toString() + \" has imaginary component\"\n return 1\n else\n if DEBUG_IS then console.log \"hasNegativeRationalExponent: \" + p.toString() + \" has NO imaginary component\"\n return 0\n\nisimaginarynumberdouble = (p) ->\n if ((car(p) == symbol(MULTIPLY) \\\n && length(p) == 3 \\\n && isdouble(cadr(p)) \\\n && hasNegativeRationalExponent(caddr(p))) \\\n || equal(p, imaginaryunit))\n return 1\n else \n return 0\n\nisimaginarynumber = (p) ->\n if ((car(p) == symbol(MULTIPLY) \\\n && length(p) == 3 \\\n && isNumericAtom(cadr(p)) \\\n && equal(caddr(p), imaginaryunit)) \\\n || equal(p, imaginaryunit) \\\n || hasNegativeRationalExponent(caddr(p))\n )\n if DEBUG_IS then console.log \"isimaginarynumber: \" + p.toString() + \" is imaginary number\"\n return 1\n else \n if DEBUG_IS then console.log \"isimaginarynumber: \" + p.toString() + \" isn't an imaginary number\"\n return 0\n\niscomplexnumberdouble = (p) ->\n if ((car(p) == symbol(ADD) \\\n && length(p) == 3 \\\n && isdouble(cadr(p)) \\\n && isimaginarynumberdouble(caddr(p))) \\\n || isimaginarynumberdouble(p))\n return 1\n else\n return 0\n\niscomplexnumber = (p) ->\n if DEBUG_IS then debugger\n if ((car(p) == symbol(ADD) \\\n && length(p) == 3 \\\n && isNumericAtom(cadr(p)) \\\n && isimaginarynumber(caddr(p))) \\\n || isimaginarynumber(p))\n if DEBUG then console.log \"iscomplexnumber: \" + p.toString() + \" is imaginary number\"\n return 1\n else\n if DEBUG then console.log \"iscomplexnumber: \" + p.toString() + \" is imaginary number\"\n return 0\n\niseveninteger = (p) ->\n if isinteger(p) && p.q.a.isEven()\n return 1\n else\n return 0\n\nisnegative = (p) ->\n if (car(p) == symbol(ADD) && isnegativeterm(cadr(p)))\n return 1\n else if (isnegativeterm(p))\n return 1\n else\n return 0\n\n# returns 1 if there's a symbol somewhere.\n# not used anywhere. Note that PI and POWER are symbols,\n# so for example 2^3 would be symbolic\n# while -1^(1\/2) i.e. 'i' is not, so this can\n# be tricky to use.\nissymbolic = (p) ->\n if (issymbol(p))\n return 1\n else\n while (iscons(p))\n if (issymbolic(car(p)))\n return 1\n p = cdr(p)\n return 0\n\n# i.e. 2, 2^3, etc.\n\nisintegerfactor = (p) ->\n if (isinteger(p) || car(p) == symbol(POWER) \\\n && isinteger(cadr(p)) \\\n && isinteger(caddr(p)))\n return 1\n else\n return 0\n\nisNumberOneOverSomething = (p) ->\n if isfraction(p) \\\n && MEQUAL(p.q.a.abs(), 1)\n return 1\n else\n return 0\n\n\nisoneover = (p) ->\n if (car(p) == symbol(POWER) \\\n && isminusone(caddr(p)))\n return 1\n else\n return 0\n\nisfraction = (p) ->\n if (p.k == NUM && !MEQUAL(p.q.b, 1))\n return 1\n else\n return 0\n\n# p is a U, n an int\nequaln = (p,n) ->\n switch (p.k)\n when NUM\n if (MEQUAL(p.q.a, n) && MEQUAL(p.q.b, 1))\n return 1\n when DOUBLE\n if (p.d == n)\n return 1\n return 0\n\n# p is a U, a and b ints\nequalq = (p, a, b) ->\n switch (p.k)\n when NUM\n if (MEQUAL(p.q.a, a) && MEQUAL(p.q.b, b))\n return 1\n when DOUBLE\n if (p.d == a \/ b)\n return 1\n return 0\n\n# p == 1\/2 ?\n\nisoneovertwo = (p) ->\n if equalq(p, 1, 2)\n return 1\n else\n return 0\n\n# p == -1\/2 ?\nisminusoneovertwo = (p) ->\n if equalq(p, -1, 2)\n return 1\n else\n return 0\n\n\n# p == 1\/sqrt(2) ?\n\nisoneoversqrttwo = (p) ->\n if (car(p) == symbol(POWER) \\\n && equaln(cadr(p), 2) \\\n && equalq(caddr(p), -1, 2))\n return 1\n else\n return 0\n\n# p == -1\/sqrt(2) ?\n\nisminusoneoversqrttwo = (p) ->\n if (car(p) == symbol(MULTIPLY) \\\n && equaln(cadr(p), -1) \\\n && isoneoversqrttwo(caddr(p)) \\\n && length(p) == 3)\n return 1\n else\n return 0\n\nisfloating = (p) ->\n if p.k == DOUBLE or p == symbol(FLOATF)\n return 1\n while (iscons(p))\n if (isfloating(car(p)))\n return 1\n p = cdr(p)\n return 0\n\nisimaginaryunit = (p) ->\n if (equal(p, imaginaryunit))\n return 1\n else\n return 0\n\n# n\/2 * i * pi ?\n\n# return value:\n\n# 0 no\n\n# 1 1\n\n# 2 -1\n\n# 3 i\n\n# 4 -i\n\nisquarterturn = (p) ->\n n = 0\n minussign = 0\n\n if (car(p) != symbol(MULTIPLY))\n return 0\n\n if (equal(cadr(p), imaginaryunit))\n\n if (caddr(p) != symbol(PI))\n return 0\n\n if (length(p) != 3)\n return 0\n\n return 2\n\n if (!isNumericAtom(cadr(p)))\n return 0\n\n if (!equal(caddr(p), imaginaryunit))\n return 0\n\n if (cadddr(p) != symbol(PI))\n return 0\n\n if (length(p) != 4)\n return 0\n\n push(cadr(p))\n push_integer(2)\n multiply()\n\n n = pop_integer()\n\n if (isNaN(n))\n return 0\n\n if (n < 1)\n minussign = 1\n n = -n\n\n switch (n % 4)\n when 0\n n = 1\n when 1\n if (minussign)\n n = 4\n else\n n = 3\n when 2\n n = 2\n when 3\n if (minussign)\n n = 3\n else\n n = 4\n\n return n\n\n# special multiple of pi?\n\n# returns for the following multiples of pi...\n\n# -4\/2 -3\/2 -2\/2 -1\/2 1\/2 2\/2 3\/2 4\/2\n\n# 4 1 2 3 1 2 3 4\n\nisnpi = (p) ->\n n = 0\n if (p == symbol(PI))\n return 2\n if (car(p) == symbol(MULTIPLY) \\\n && isNumericAtom(cadr(p)) \\\n && caddr(p) == symbol(PI) \\\n && length(p) == 3)\n doNothing = 0\n else\n return 0\n push(cadr(p))\n push_integer(2)\n multiply()\n n = pop_integer()\n if (isNaN(n))\n return 0\n if (n < 0)\n n = 4 - (-n) % 4\n else\n n = 1 + (n - 1) % 4\n return n\n\n\n\n$.isZeroAtomOrTensor = isZeroAtomOrTensor\n$.isnegativenumber = isnegativenumber \n$.isplusone = isplusone \n$.isminusone = isminusone \n$.isinteger = isinteger \n$.isnonnegativeinteger = isnonnegativeinteger \n$.isposint = isposint \n$.isnegativeterm = isnegativeterm \n$.isimaginarynumber = isimaginarynumber \n$.iscomplexnumber = iscomplexnumber \n$.iseveninteger = iseveninteger \n$.isnegative = isnegative \n$.issymbolic = issymbolic \n$.isintegerfactor = isintegerfactor \n$.isoneover = isoneover \n$.isfraction = isfraction \n$.isoneoversqrttwo = isoneoversqrttwo \n$.isminusoneoversqrttwo = isminusoneoversqrttwo \n$.isfloating = isfloating \n$.isimaginaryunit = isimaginaryunit \n$.isquarterturn = isquarterturn \n$.isnpi = isnpi\n\n","avg_line_length":22.596214511,"max_line_length":143,"alphanum_fraction":0.5943738657} {"size":2167,"ext":"coffee","lang":"CoffeeScript","max_stars_count":31.0,"content":"helpers = require('.\/helpers')\nEventEmitter = require('events').EventEmitter\nAWS = helpers.AWS\nMockService = helpers.MockService\nBuffer = AWS.util.Buffer\n\ndescribe 'region_config.js', ->\n it 'sets endpoint configuration option for default regions', ->\n service = new MockService\n expect(service.isGlobalEndpoint).toEqual(false)\n expect(service.endpoint.host).toEqual('mockservice.mock-region.amazonaws.com')\n\n [AWS.CloudFront, AWS.IAM, AWS.ImportExport, AWS.Route53, AWS.STS].forEach (svcClass) ->\n it 'uses a global endpoint for ' + svcClass.serviceIdentifier, ->\n service = new svcClass\n expect(service.endpoint.host).toEqual(service.serviceIdentifier + '.amazonaws.com')\n expect(service.isGlobalEndpoint).toEqual(true)\n\n it 'always enables SSL for Route53', ->\n service = new AWS.Route53\n expect(service.config.sslEnabled).toEqual(true)\n\n it 'uses \"global\" endpoint for SimpleDB in us-east-1', ->\n service = new AWS.SimpleDB(region: 'us-east-1')\n expect(service.isGlobalEndpoint).toEqual(false)\n expect(service.endpoint.host).toEqual('sdb.amazonaws.com')\n\n it 'uses \"global\" endpoint for SimpleDB in us-east-1', ->\n service = new AWS.S3(region: 'us-east-1')\n expect(service.isGlobalEndpoint).toEqual(false)\n expect(service.endpoint.host).toEqual('s3.amazonaws.com')\n\n it 'does not use any global endpoints in cn-*', ->\n service = new AWS.IAM(region: 'cn-north-1')\n expect(service.isGlobalEndpoint).toEqual(false)\n expect(service.endpoint.host).toEqual('iam.cn-north-1.amazonaws.com.cn')\n\n it 'enables signature version 4 signing in cn-*', ->\n service = new AWS.IAM(region: 'cn-north-1')\n expect(service.config.signatureVersion).toEqual('v4')\n\n it 'uses - as separator for S3 in public regions', ->\n service = new AWS.S3(region: 'us-west-2')\n expect(service.isGlobalEndpoint).toEqual(false)\n expect(service.endpoint.host).toEqual('s3-us-west-2.amazonaws.com')\n\n it 'uses . as separator for S3 in cn-*', ->\n service = new AWS.S3(region: 'cn-north-1')\n expect(service.isGlobalEndpoint).toEqual(false)\n expect(service.endpoint.host).toEqual('s3.cn-north-1.amazonaws.com.cn')\n","avg_line_length":42.4901960784,"max_line_length":89,"alphanum_fraction":0.7143516382} {"size":1554,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"FindProxyForURL = do ->\n\tproxys =\n\t\taliyun: 'SOCKS5 127.0.0.1:12211'\n\t\tshadowsocks: 'SOCKS5 127.0.0.1:1080'\n\t\tgoagent: 'PROXY 127.0.0.1:8087'\n\t\tdirect: 'DIRECT'\n\n\tdomain_groups =\n\t\tcompany_inner_domain_names:\n\t\t\tways: 'direct'\n\t\t\tlist: [\n\t\t\t\t't1.com'\n\t\t\t\t'sohuno.com'\n\t\t\t\t'no.sohu.com'\n\t\t\t]\n\t\tblocked_by_company:\n\t\t\tways: 'aliyun direct'\n\t\t\tlist: [\n\t\t\t\t'qq.com'\n\t\t\t]\n\t\tblocked_by_gfw:\n\t\t\tways: 'shadowsocks direct'\n\t\t\tlist: [\n\t\t\t\t'angularjs.org'\n\t\t\t\t'getpocket.com'\n\t\t\t\t'dropbox.com'\n\t\t\t\t'fastly.net'\n\t\t\t\t'sf.net'\n\t\t\t\t'sourceforge.net'\n\t\t\t\t'sstatic.net'\n\t\t\t\t'stackoverflow.com'\n\t\t\t\t'wikipedia.org'\n\t\t\t\t'googleapis.com'\n\t\t\t\t'googlevideo.com'\n\t\t\t\t'googlesyndication.com'\n\t\t\t\t'gmail.com'\n\t\t\t\t'mail.google.com'\n\t\t\t\t'plus.google.com'\n\t\t\t\t'googleusercontent.com'\n\t\t\t\t'googlesyndication.com'\n\t\t\t\t'google*.*'\n\t\t\t\t'*static.com'\n\t\t\t\t'*cdn.com'\n\t\t\t\t#'accounts.google.com'\n\t\t\t\t#'chrome.google.com'\n\t\t\t\t#'mail.google.com'\n\t\t\t\t#'plus.google.com'\n\t\t\t\t#'maps.google.com'\n\t\t\t\t'facebook.com'\n\t\t\t\t'twitter.com'\n\t\t\t\t'twimg.com'\n\t\t\t\t'youtube.com'\n\t\t\t\t'youtube-nocookie.com'\n\t\t\t\t'atgfw.org'\n\t\t\t\t'blogspot.*'\n\t\t\t\t'wordpress.*'\n\t\t\t]\n\n\tmatch = (url, domain) ->\n\t\tshExpMatch(url, \"*:\/\/*.#{domain}\/*\") || shExpMatch(url, \"*:\/\/#{domain}\/*\")\n\n\tany = (iter, f=(x)->(x)) ->\n\t\treturn true for x in iter when f(x)\n\t\tfalse\n\n\tproxy = (ways) ->\n\t\t(proxys[proxy_name] for proxy_name in ways.split(' ')).join('; ')\n\n\t(url, host) ->\n\t\tfor group_name, group of domain_groups\n\t\t\tif any(group.list, (domain) -> match(url, domain))\n\t\t\t\treturn proxy group.ways\n\t\treturn proxy 'direct shadowsocks'\n\n","avg_line_length":20.72,"max_line_length":76,"alphanum_fraction":0.5971685972} {"size":13582,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"{_} = require 'lodash'\ndebug = require('debug')('loopback:connector:couch')\n\n# api\nexports.initialize = (dataSource, callback) ->\n\tconnector = new CouchConnector dataSource\n\treturn callback && process.nextTick callback\n\n#Constructor and useful reference functions\nclass CouchConnector\n\tconstructor: (dataSource) ->\n\t\t\n\t\t@dataSource = dataSource\n\t\tdataSource.connector = this\n\t\t\n\t\tsettings = dataSource.settings or {}\n\t\t@settings = settings\n\t\thelpers.optimizeSettings settings\n\t\t\n\t\tdesign = views: by_model: map:\n\t\t\t'function (doc) { if (doc.loopbackModel) return emit(doc.loopbackModel, null); }'\n\t\t\n\t\tif settings.auth?.reader\n\t\t\t@_nanoReader = require('nano')(@buildAuthUrl(settings.auth.reader))\n\t\tif settings.auth?.writer\n\t\t\t@_nanoWriter = require('nano')(@buildAuthUrl(settings.auth.writer))\n\t\tif settings.auth?.admin\n\t\t\t@_nanoAdmin = require('nano')(@buildAuthUrl(settings.auth.admin))\n\n\t\t@_nanoReader = require('nano')(@buildAuthUrl(settings.auth)) if not @_nanoReader\n\t\t@_nanoWriter = require('nano')(@buildAuthUrl(settings.auth)) if not @_nanoWriter\n\t\t@_nanoAdmin = require('nano')(@buildAuthUrl(settings.auth)) if not @_nanoAdmin\n\t\t\n\t\thelpers.updateDesign @_nanoAdmin, '_design\/loopback', design\n\t\t@_models = {}\n\t\t@name = 'couchdb'\n\t\tif settings.views and _.isArray settings.views\n\t\t\t@DataAccessObject = () ->\n\t\t\t#add existing methods\n\t\t\tif dataSource.constructor.DataAccessObject\n\t\t\t\tfor k,v of dataSource.constructor.DataAccessObject\n\t\t\t\t\t@DataAccessObject[k] = v\n\t\t\t\tfor k,v of dataSource.constructor.DataAccessObject.prototype\n\t\t\t\t\t@DataAccessObject.prototype[k] = v\n\t\t\t#then add connector method\n\t\t\tviewFn = @buildViewEndpoint settings.views\n\t\t\t@DataAccessObject.queryView = viewFn\n\t\t\tdataSource.queryView = viewFn\n\n\t\treturn this\n\t\n\trelational: false\n\t\n\tgetDefaultIdType: () -> \n\t\treturn String\n\t\n\tgetTypes: () ->\n\t\treturn ['db', 'nosql', 'couchdb']\n\n\tgetMetadata: () ->\n\t\tunless @_metaData\n\t\t\t@_metaData =\n\t\t\t\ttypes: @getTypes()\n\t\t\t\tdefaultIdType: @getDefaultIdType()\n\t\t\t\tisRelational: @isRelational\n\t\t\t\tschemaForSettings: {}\n\t\treturn @_metaData\n\n\tdefine: (descr) ->\n\t\tmodelName = descr.model.modelName\n\n\t\t@_models[modelName] = descr\n\t\tdescr.properties._rev = type: String\n\t\t# Add index views for schemas that have indexes\n\t\tdesign =\n\t\t\tviews: {}\n\t\thasIndexes = false\n\t\tfor propName, value of descr.properties\n\t\t\tif value.index\n\t\t\t\thasIndexes = true\n\t\t\t\tviewName = helpers.viewName propName\n\t\t\t\tdesign.views[viewName] =\n\t\t\t\t\tmap: 'function (doc) { if (doc.loopbackModel === \\'' + modelName + '\\' && doc.'+propName + ') return emit(doc.' + propName + ', null); }'\n\t\tif hasIndexes\n\t\t\tdesignName = '_design\/' + helpers.designName modelName\n\t\t\thelpers.updateDesign @_nanoAdmin, designName, design\n\n#Loopback.io prototype functions\n\tcreate: (model, data, callback) ->\n\t\tdebug 'CouchDB create'\n\t\t@save model, data, callback\n\n\tsave: (model, data, callback) ->\n\t\tdebug 'CouchDB save'\n\t\treturn callback and callback \"Cannot create an empty document in the database\" if not data\n\t\tdelete data._deleted \t\t# Prevents accidental deletion via save command\n\t\t@_nanoWriter.insert @forDB(model, data), (err, rsp) =>\n\t\t\treturn callback err if err\n\t\t\t# Undo the effects of savePrep as data object is the only one\n\t\t\t# that the Loopback.io can access.\n\t\t\thelpers.undoPrep data\n\t\t\t# Update the data object with the revision returned by CouchDb.\n\t\t\tdata._rev = rsp.rev\n\t\t\treturn callback and callback null, rsp.id, rsp.rev \n\n\tupdateOrCreate: (model, data, callback) ->\n\t\tdebug 'CouchDB updateOrCreate'\n\t\tdelete data._deleted\t\t# Prevents accidental deletion \n\t\treturn @save model, data, (err, id, rev) ->\n\t\t\treturn callback and callback err if err\n\t\t\tdata.id = id\n\t\t\tdata._rev = rev\n\t\t\treturn callback and callback null, data\n\n\tupdate: (model, where, data, callback) ->\n\t\tdebug 'CouchDB update'\n\t\tdelete data._deleted\t\t# Prevents accidental deletion \n\t\t@all model, {where}, (err, docsFromDb) =>\n\t\t\treturn callback and callback err if err\n\t\t\thelpers.merge(docsFromDb, data)\n\t\t\tif (not _.isArray docsFromDb)\n\t\t\t\tdocsFromDb = [docsFromDb]\n\t\t\tdocs = (@forDB model, doc for doc in docsFromDb)\n\t\t\tdebug docs\n\t\t\t@_nanoWriter.bulk {docs}, (err, rsp) ->\n\t\t\t\treturn callback and callback err, rsp\n\t\t\t\n\tupdateAttributes: (model, id, attributes, callback) ->\n\t\tdebug 'CouchDB updateAttributes'\n\t\tdelete attributes._deleted\t#prevent accidental deletion\n\t\t@_nanoReader.get id, (err, doc) =>\n\t\t\treturn callback and callback err if err\n\t\t\t@save model, helpers.merge(doc, attributes), (err, rsp) ->\n\t\t\t\treturn callback and callback err if err\n\t\t\t\tdoc._rev = rsp.rev\n\t\t\t\treturn callback and callback null, doc\n\n\tdestroyAll: (model, where, callback) ->\n\t\tdebug 'CouchDB destroyAll'\n\t\t@all model, {where}, (err, docs) =>\n\t\t\treturn callback and callback err if err\n\t\t\tdebug docs\n\t\t\tdocs = for doc in docs\n\t\t\t\t{_id: doc.id, _rev: doc._rev, _deleted: yes}\n\t\t\t@_nanoWriter.bulk {docs}, (err, rsp) ->\n\t\t\t\treturn callback and callback err, rsp\n\n\tcount: (model, callback, where) ->\n\t\tdebug 'CouchDB count'\n\t\t@all model, {where}, (err, docs) =>\n\t\t\treturn callback and callback err if err\n\t\t\tcallback and callback null, docs.length\n\n\tall: (model, filter, callback) ->\n\t\tdebug 'CouchDB all'\n\t\tdebug filter\n\t\t# Consider first the easy case that a specific id is requested\n\t\tif id = filter?.where?.id\n\t\t\tdebug '...moving to findById from all'\n\t\t\treturn @findById(model, id, callback)\n\t\t\n\t\tparams =\n\t\t\tkeys: [model]\n\t\t\tinclude_docs: yes\n\t\tparams.skip = filter.offset if filter.offset and not filter.where\n\t\tparams.limit = filter.limit if filter.limit and not filter.where\t\t#if you have a where clause and a limit first get all the data and then limit them\n\n\t\t# We always fallback on loopback\/by_model view as it allows us\n\t\t# to iterate over all the docs for a model. But check if\n\t\t# there is a specialized view for one of the where conditions.\n\t\tdesignName = 'loopback'\n\t\tviewName = 'by_model'\n\t\tif where = filter?.where\n\t\t\tprops = @_models[model].properties\n\t\t\tfor propName, value of where\n\t\t\t\t# We can use an optimal view when a where \"clause\" uses an indexed property\n\t\t\t\tif value and props[propName]? and props[propName].index\n\t\t\t\t\t# Use the design and view for the model and propName\n\t\t\t\t\tdesignName = helpers.designName model\n\t\t\t\t\tviewName = helpers.viewName propName\n\t\t\t\t\t# CouchDb stores dates as Unix time\n\t\t\t\t\tparams.key = if _.isDate value then value.getTime() else value\n\t\t\t\t\t# We don't want to use keys - we now have a key property\n\t\t\t\t\tdelete params.keys\n\t\t\t\t\tbreak\n\n\t\t@_nanoReader.view designName, viewName, params, (err, body) =>\n\t\t\treturn callback and callback err if err\n\t\t\tdocs = for row in body.rows\n\t\t\t\trow.doc.id = row.doc._id\n\t\t\t\tdelete row.doc._id\n\t\t\t\trow.doc\n\t\t\t\n\t\t\t\n\t\t\tdebug \"CouchDB all: docs before where\"\n\t\t\tdebug docs\n\n\t\t\tif where = filter?.where\n\t\t\t\tfor k, v of where\n\t\t\t\t\t# CouchDb stores dates as Unix time\n\t\t\t\t\twhere[k] = v.getTime() if _.isDate v\n\t\t\t\tdocs = _.where docs, where\n\n\t\t\t\n\t\t\tdebug \"CouchDB all: docs after where\"\n\t\t\tdebug docs\n\n\t\t\tif orders = filter?.order\n\t\t\t\torders = [orders] if _.isString orders\n\t\t\t\tsorting = (a, b) ->\n\t\t\t\t\tfor item, i in @\n\t\t\t\t\t\tak = a[@[i].key]; bk = b[@[i].key]; rev = @[i].reverse\n\t\t\t\t\t\tif ak > bk then return 1 * rev\n\t\t\t\t\t\tif ak < bk then return -1 * rev\n\t\t\t\t\t0\n\n\t\t\t\tfor key, i in orders\n\t\t\t\t\torders[i] =\n\t\t\t\t\t\treverse: helpers.reverse key\n\t\t\t\t\t\tkey: helpers.stripOrder key\n\n\t\t\t\tdocs.sort sorting.bind orders\n\t\t\t\n\t\t\tif filter?.limit and filter?.where\n\t\t\t\tmaxDocsNum = filter.limit\n\t\t\telse\n\t\t\t\tmaxDocsNum = docs.length\n\t\t\tif filter?.offset and filter?.where\n\t\t\t\tstartDocsNum = filter.offset\n\t\t\telse\n\t\t\t\tstartDocsNum = 0\n\t\t\t\n\t\t\tdocs = docs.slice startDocsNum, maxDocsNum\n\t\t\toutput = (@fromDB model, doc for doc in docs)\n\t\t\treturn callback null, output\n\t\t\t\t\t\n\n\tforDB: (model, data = {}) ->\n\t\thelpers.savePrep model, data\n\t\tprops = @_models[model].properties\n\t\tfor k, v of props\n\t\t\tif data[k] and props[k].type.name is 'Date' and data[k].getTime?\n\t\t\t\tdata[k] = data[k].getTime()\n\t\tdata\n\n\tfromDB: (model, data) ->\n\t\treturn data unless data\n\t\thelpers.undoPrep data\n\t\tprops = @_models[model].properties\n\t\tfor k, v of props\n\t\t\tif data[k]? and props[k].type.name is 'Date'\n\t\t\t\tdate = new Date data[k]\n\t\t\t\tdate.setTime data[k]\n\t\t\t\tdata[k] = date\n\t\tdata\n\n\texists: (model, id, callback) ->\n\t\tdebug 'CouchdDB exists'\n\t\t@_nanoReader.head id, (err, _, headers) ->\n\t\t\treturn callback and callback null, 0 if err\n\t\t\tcallback && callback null, 1\n\t\n\tgetLatestRevision: (model, id, callback) ->\n\t\t@_nanoReader.head id, (err, _, headers) ->\n\t\t\treturn callback and callback err if err\n\t\t\trev = headers.etag.substr(1, headers.etag.length - 2)\n\t\t\treturn callback and callback null, rev\n\n\tdestroy: (model, id, callback) ->\n\t\tdebug 'CouchDB destroy'\n\t\t@getLatestRevision model, id, (err, rev) =>\n\t\t\treturn callback and callback err if err\n\t\t\t@_nanoWriter.destroy id, rev, (err, rsp) =>\n\t\t\t\treturn callback and callback err, rsp\n\n\tfindById: (model, id, callback) ->\n\t\tdebug 'CouchDB findById'\n\t\t@_nanoReader.get id, (err, doc) =>\n\t\t\tdebug err, doc\n\t\t\treturn callback and callback null, [] if err and err.statusCode is 404\n\t\t\treturn callback and callback err if err\n\t\t\treturn callback and callback null, [(@fromDB model, doc)]\t# Uses array as this function is called by all who needs to return array\n\n\tviewFunction: (model, ddoc, viewname, keys, callback) ->\n\t\tddoc = if ddoc then ddoc else @settings.database or @settings.db\n\t\tview = _.findWhere @_availableViews, {ddoc: ddoc, name: viewname}\n\t\t\n\t\tif not view\n\t\t\treturn callback and callback \"The requested view is not available in the datasource\"\n\t\tparams = keys\n\t\tif typeof keys is 'function'\n\t\t\tcallback = keys\n\t\t\tparams = {}\n\t\tif typeof keys is 'string'\n\t\t\tparams = keys: [keys]\n\t\tif _.isArray keys\n\t\t\tparams = keys: keys\n\n\t\t\n\t\tdebug model, ddoc, viewname, params\n\t\t\n\t\t@_nanoReader.view ddoc, viewname, params, (err, rsp) =>\n\t\t\treturn callback and callback err if err\n\t\t\tdocs = _.pluck rsp.rows, 'value'\n\t\t\treturn callback and callback null, (@fromDB model, doc for doc in docs)\n\n\tbuildViewEndpoint: (views) ->\n\t\t@_availableViews = views\n\t\tfn = _.bind @viewFunction, @\n\t\tfn.accepts = [\n\t\t\t{\n\t\t\t\targ: 'modelName'\n\t\t\t\ttype: \"string\"\n\t\t\t\tdescription: \"The current model name\"\n\t\t\t\trequired: false\n\t\t\t\thttp: (ctx) ->\n\t\t\t\t\treturn ctx.method.sharedClass.name\n\t\t\t},\n\t\t\t{ arg: 'ddoc', type: \"string\", description: \"The design document name for the requested view. Defaults to CouchDB database name used for this data.\", required: false, http: {source: 'query'}},\n\t\t\t{ arg: 'viewname', type: \"string\", description: \"The view name requested.\", required: true, http: {source: 'query'}},\n\t\t\t{ arg: 'keys', type: \"object\", description: \"The index(es) requested to narrow view results. Parameter can be a string, array of strings or object with 'key' or with 'startkey' and 'endkey', as per CouchDB. Use the object version for complex keys querying.\", required: false, http: {source: 'query'}}\n\t\t]\n\t\tfn.returns = { arg: 'items', type: \"array\"}\n\t\tfn.shared = true\n\t\tfn.http =\n\t\t\tpath: '\/queryView',\n\t\t\tverb: 'get'\n\t\tfn.description = \"Query a CouchDB view based on design document name, view name and keys.\"\n\t\treturn fn\n\t\n\tbuildAuthUrl: (auth) ->\n\t\tif auth and (auth.username or auth.user) and (auth.password or auth.pass)\n\t\t\tauthString = (auth.username || auth.user) + ':' + (auth.password || auth.pass) + '@'\n\t\telse\n\t\t\tauthString = ''\n\t\turl = @settings.protocol + ':\/\/' + authString + @settings.hostname + ':' + @settings.port + '\/' + @settings.database\n\t\treturn url\n\n\n# helpers\nhelpers =\n\toptimizeSettings: (settings) ->\n\t\tsettings.hostname = settings.hostname or settings.host or '127.0.0.1'\n\t\tsettings.protocol = settings.protocol or 'http'\n\t\tsettings.port = settings.port or 5984\n\t\tsettings.database = settings.database or settings.db\n\t\tif (not settings.database)\n\t\t\tthrow new Error(\"Database name must be specified in dataSource for CouchDB connector\")\n \n\tmerge: (base, update) ->\n\t\treturn update unless base\n\t\tif not _.isArray base\n\t\t\t_.extend base, update\n\t\telse\n\t\t\t_.each base, (doc) ->\n\t\t\t\t_.extend doc, update\n\t\tbase\n\n\treverse: (key) ->\n\t\tif hasOrder = key.match(\/\\s+(A|DE)SC$\/i)\n\t\t\treturn -1 if hasOrder[1] is \"DE\"\n\t\treturn 1\n\n\tstripOrder: (key) -> key.replace(\/\\s+(A|DE)SC\/i, \"\")\n\n\tsavePrep: (model, data) ->\n\t\tif id = data.id\n\t\t\tdata._id = id.toString()\n\t\tdelete data.id\n\t\tif data._rev is null\n\t\t\tdelete data._rev\n\t\tif model\n\t\t\tdata.loopbackModel = model\n\t\treturn\n\n\tundoPrep: (data) ->\n\t\tif _id = data._id\n\t\t\tdata.id = _id.toString()\n\t\tdelete data._id\n\t\tdelete data.loopbackModel\n\t\treturn\n\n\tdesignName: (modelName) -> 'loopback_' + modelName\n\n\tviewName: (propName) -> 'by_' + propName\n\n\tinvokeCallbackOrLogError: (callback, err, res) ->\n\t\t# When callback exists let it handle the error and result\n\t\tif callback\n\t\t\tcallback and callback err, res\n\t\telse if err\n\t\t\t# Without a callback we can at least log the error\n\t\t\tconsole.log err\n \n\tupdateDesign: (db, designName, design, callback) ->\n\t\t# Add the design document to the database or update it if it already exists.\n\t\tdb.get designName, (err, designDoc) =>\n\t\t\tif err && err.error != 'not_found'\n\t\t\t\treturn helpers.invokeCallbackOrLogError callback, err, designDoc\n\n\t\t\t# Update the design doc\n\t\t\tif !designDoc\n\t\t\t\tdesignDoc = design\n\t\t\telse\n\t\t\t\t# We only update the design when its views have changed - this avoids rebuilding the views.\n\t\t\t\tif _.isEqual(designDoc.views, design.views)\n\t\t\t\t\treturn helpers.invokeCallbackOrLogError callback, null, designDoc\n\t\t\t\tdesignDoc.views = design.views\n\n\t\t\t# Insert the design doc into the database.\n\t\t\tdb.insert designDoc, designName, (err, insertedDoc) =>\n\t\t\t\treturn helpers.invokeCallbackOrLogError callback, err, insertedDoc\n\n\n","avg_line_length":32.7277108434,"max_line_length":303,"alphanum_fraction":0.6892946547} {"size":67,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"###\nCoffeeScript Compiler v0.9.6\nReleased under the MIT License\n###","avg_line_length":16.75,"max_line_length":30,"alphanum_fraction":0.7462686567} {"size":186,"ext":"coffee","lang":"CoffeeScript","max_stars_count":22.0,"content":"define(() ->\n (node) ->\n delete: () ->\n li = node.parentNode\n li.parentNode.removeChild(li)\n forEachClick: (callback) ->\n node.addEventListener('click', callback)\n)","avg_line_length":23.25,"max_line_length":46,"alphanum_fraction":0.5913978495} {"size":1915,"ext":"cson","lang":"CoffeeScript","max_stars_count":3.0,"content":"\".source.js.jsx\":\n DocBlock:\n prefix: \"docblock\"\n body: '''\n \/* speck\n * 'name': '${1}'\n * 'extends': '${2}'\n * 'type': '${3}'\n * 'description': '${4}'\n * 'props': {${5}}\n * 'sub components': [${6}]\n * 'usage': {\n * 'languages':\n * 'jsx': \\'''\n * <${1} ...props \/>\n * \\'''\n * 'properties':\n * ${8}\n * }\n * 'interactions': [${7}]\n *\/\n '''\n description: \"Formatted comment for MB3 Particle Docblocks\"\n rightLabelHTML: '''\n

\n MB3<\/span>\n <\/h3>\n '''\n leftLabelHTML: '''\n

\n JSX<\/span>\n <\/h3>\n '''\n \"React Component\":\n prefix: \"component\"\n body: '''\n import React, {PropTypes} from 'react';\n import MB3 from '${1:Path to MB3 basic component in components}';\n\n class ${1:ClassName} extends MB3.Component {\n render() {\n return (\n ${2:

Hello World! <\/h1>}\n );\n }\n }\n\n ${1}.propTypes = {};\n\n export default ${1};\n '''\n description: \"Formatted MB3.Component extension for Particle\"\n rightLabelHTML: '''\n

\n MB3<\/span>\n <\/h3>\n '''\n leftLabelHTML: '''\n

\n JSX<\/span>\n <\/h3>\n '''\n","avg_line_length":30.3968253968,"max_line_length":77,"alphanum_fraction":0.3838120104} {"size":50,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"class Match extends Backbone.Model\r\n\r\nreturn Match","avg_line_length":16.6666666667,"max_line_length":35,"alphanum_fraction":0.82} {"size":523,"ext":"coffee","lang":"CoffeeScript","max_stars_count":31.0,"content":"\n{tags} = require '..\/..\/test'\nnikita = require '..\/..\/..\/src'\n\ndescribe 'action.scheduler', ->\n return unless tags.api\n\n describe 'arguments', ->\n\n it 'function', ->\n nikita ->\n (await @call ->\n new Promise (resolve) -> resolve 1\n ).should.eql 1\n\n it 'array', ->\n (await nikita.call [\n -> new Promise (resolve) -> resolve 1\n -> new Promise (resolve) -> resolve 2\n ])\n .should.eql [1, 2]\n\n it 'array', ->\n (await nikita.call [])\n .should.eql []\n","avg_line_length":20.1153846154,"max_line_length":45,"alphanum_fraction":0.5047801147} {"size":464,"ext":"cson","lang":"CoffeeScript","max_stars_count":null,"content":"# See https:\/\/atom.io\/docs\/latest\/hacking-atom-package-word-count#menus for more details\n'context-menu':\n 'atom-text-editor': [\n {\n 'label': 'Toggle robpaller-ascii-art'\n 'command': 'robpaller-ascii-art:toggle'\n }\n ]\n'menu': [\n {\n 'label': 'Packages'\n 'submenu': [\n 'label': 'robpaller-ascii-art'\n 'submenu': [\n {\n 'label': 'Toggle'\n 'command': 'robpaller-ascii-art:toggle'\n }\n ]\n ]\n }\n]\n","avg_line_length":20.1739130435,"max_line_length":88,"alphanum_fraction":0.5323275862} {"size":711,"ext":"coffee","lang":"CoffeeScript","max_stars_count":16.0,"content":"# wrapper for a forum post\nclass Post\n\n constructor: ({@client, @username, @message, @topic_id, @category, @reply_to_post_number}) ->\n\n # given an array, returns one of the elements\n random: (chooseOne) ->\n if chooseOne? and chooseOne.length > 0\n chooseOne[Math.floor(Math.random() * chooseOne.length)]\n\n # returns a match or null, if we should respond to a given regex\n match: (regex) ->\n @message.match regex\n\n # responds with a given message\n reply: (message) ->\n @client.reply({\n message: message\n category: @category\n topic_id: @topic_id\n is_warning: false\n archetype: 'regular'\n reply_to_post_number: @reply_to_post_number\n })\n\n\nmodule.exports = Post","avg_line_length":26.3333333333,"max_line_length":95,"alphanum_fraction":0.6722925457} {"size":1883,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"EditorEventbus = require 'editorEventbus'\nBasePropertiesView = require 'views\/basePropertiesView'\ntemplates = require 'templates'\nlog = require 'util\/logger'\ndb = require 'database'\n\nclass MaterialProperties extends BasePropertiesView\n\t\n\tid: 'sidebar-properties-material'\n\t\n\tclassName: 'sidebar-panel hidden'\n\t\n\tentity: 'material'\n\t\n\ttemplate: templates.get 'sidebar\/materialProperties.tmpl'\n\t\n\tevents:\n\t\t'shown a[data-toggle=\"tab\"]'\t\t\t: 'changeTab'\n\t\t'change input[name*=\"mp-basis-\"]'\t: 'changeBasis'\n\t\t'change input[name*=\"mp-color-\"]'\t: 'changeColor'\n\t\n\tinitialize: (options) ->\n\t\t@tabs = db.get 'ui\/tabs'\n\t\t@tabs.set 'materialProperties', '#mp-basis'\n\t\tsuper options\n\t\n\tbindEvents: ->\n\t\tEditorEventbus.selectMaterial.add @loadMaterial\n\n\tloadMaterial: (id) =>\n\t\tlog.debug 'Load Material Properties'\n\t\t@model = db.get 'materials', id.id\n\t\t@render()\n\n\tchangeTab: (event) ->\n\t\tunless event then return\n\t\t$currentTarget = $ event.target\n\t\t@tabs.set 'materialProperties', $currentTarget.data 'target'\n\n\tchangeBasis: (event) ->\n\t\tunless event then return\n\t\tevent.preventDefault()\n\t\tentry = @getEntry event, \"mp-basis-\"\n\t\t@model.set entry.property, entry.value\n\t\tEditorEventbus.dispatch 'changeMaterial', @model.id\n\t\t\n\tchangeColor: (event) ->\n\t\tunless event then return\n\t\tevent.preventDefault()\n\t\tentry = @getEntry event, \"mp-color-\"\n\t\t@model.set entry.property, entry.value\n\t\tEditorEventbus.dispatch 'changeMaterial', @model.id\n\t\t\n\tgetTemplateData: ->\n\t\tjson = super()\n\t\tjson.textures = @getTexturesFromDB()\n\t\tjson.isActiveTabBasis = @tabs.get('materialProperties') is '#mp-basis'\n\t\tjson.isActiveTabColor = @tabs.get('materialProperties') is '#mp-color'\n\t\tjson.isActiveTabTexture = @tabs.get('materialProperties') is '#mp-texture'\n\t\tjson\n\t\n\tgetTexturesFromDB: ->\n\t\ttextures = []\n\t\ttextures.push texture.id for texture in db.get('textures').models\n\t\ttextures\t\t\n\nreturn MaterialProperties","avg_line_length":28.1044776119,"max_line_length":76,"alphanum_fraction":0.7227827934} {"size":2032,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"do ({Ordering, arrayToSeq, set, seq} = fpJS.withFnExtension(), Item) ->\n class AccountType extends Ordering then constructor: (@accountTypeId, @accName, @description, @closingDay, @items, @balances) ->\n #[{realbalance}] = balances\n\n @compare = (accType) -> if accName is accType.accName then 0 else (if accName < accType.accName then -1 else 1)\n\n @toString = -> JSON.stringify @\n\n header = -> do ([{realbalance}] = balances) -> \"\"\"\n #{accName}<\/td>\n <\/td>\n <\/td>\n <\/td>\n R$ #{parseFloat(realbalance).toFixed 2}<\/td>\n <\/tr>\"\"\"\n\n foot = ([entrada, saida, saldoTotal]) ->\n saldo = (saldoTotal) -> if saldoTotal > 0 then \"R$ #{saldoTotal}<\/td>\" else \"\"\"R$ #{saldoTotal}<\/td>\"\"\"\n \"\"\"<\/tr>\n <\/td>\n R$ #{parseFloat(entrada).toFixed 2}<\/td>\n R$ #{parseFloat(saida).toFixed 2}<\/td>\n #{saldo parseFloat(entrada + saida).toFixed 2}\n <\/tr>\"\"\"\n\n body = -> do ([{realbalance}] = balances) -> items.foldLeft([[0, 0, realbalance], \"\"]) ([[entrada, saida, saldoTotal], trs]) -> (item) ->\n [ent, sai] = if item.value > 0 then [item.value, 0.00] else [0.00, item.value]\n total = [entrada + ent, saida + sai, saldoTotal + item.value]\n [total, \"#{trs}#{item.draw saldoTotal}\"]\n\n @draw = ->\n [tfoot, tbody] = body()\n \"#{header()}#{tbody}#{foot tfoot}\"\n\n @withItems = (items_ = seq()) ->\n new AccountType accountTypeId, accName, description, closingDay, (items.concat items_), balances\n\n @withItem = (item) -> new AccountType accountTypeId, accName, description, closingDay, (items.cons item), balances\n\n accountType = ({accountTypeId, accName, description, closingDay, items, balances}) ->\n items_ = arrayToSeq(items).fmap(Item.item)\n new AccountType accountTypeId, accName, description, closingDay, items_, balances\n\n root = exports ? window\n root.AccountType = AccountType\n root.AccountType.accountType = accountType","avg_line_length":44.1739130435,"max_line_length":141,"alphanum_fraction":0.6126968504} {"size":150511,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"module.exports = nativeDescription: \"\u010de\u0161tina\", englishDescription: \"Czech\", translation:\n# new_home:\n# slogan: \"The most engaging way to learn real code.\"\n# classroom_edition: \"Classroom Edition:\"\n# learn_to_code: \"Learn to code:\"\n# play_now: \"Play Now\"\n# im_a_teacher: \"I'm a Teacher\"\n# im_a_student: \"I'm a Student\"\n# learn_more: \"Learn more\"\n# classroom_in_a_box: \"A classroom in-a-box for teaching computer science.\"\n# codecombat_is: \"CodeCombat is a platform for students<\/strong> to learn computer science while playing through a real game.\"\n# our_courses: \"Our courses have been specifically playtested to excel in the classroom<\/strong>, even for teachers with little to no prior programming experience.\"\n# watch_how: \"Watch how CodeCombat is transforming the way people learn computer science.\"\n# top_screenshots_hint: \"Students write code and see their changes update in real-time\"\n# designed_with: \"Designed with teachers in mind\"\n# real_code: \"Real, typed code\"\n# from_the_first_level: \"from the first level\"\n# getting_students: \"Getting students to typed code as quickly as possible is critical to learning programming syntax and proper structure.\"\n# educator_resources: \"Educator resources\"\n# course_guides: \"and course guides\"\n# teaching_computer_science: \"Teaching computer science does not require a costly degree, because we provide tools to support educators of all backgrounds.\"\n# accessible_to: \"Accessible to\"\n# everyone: \"everyone\"\n# democratizing: \"Democratizing the process of learning coding is at the core of our philosophy. Everyone should be able to learn to code.\"\n# forgot_learning: \"I think they actually forgot that they were learning something.\"\n# wanted_to_do: \" Coding is something I've always wanted to do, and I never thought I would be able to learn it in school.\"\n# builds_concepts_up: \"I like how CodeCombat builds the concepts up. It's really easy to understand and fun to figure it out.\"\n# why_games: \"Why is learning through games important?\"\n# games_reward: \"Games reward the productive struggle.\"\n# encourage: \"Gaming is a medium that encourages interaction, discovery, and trial-and-error. A good game challenges the player to master skills over time, which is the same critical process students go through as they learn.\"\n# excel: \"Games excel at rewarding\"\n# struggle: \"productive struggle\"\n# kind_of_struggle: \"the kind of struggle that results in learning that\u2019s engaging and\"\n# motivating: \"motivating\"\n# not_tedious: \"not tedious.\"\n# gaming_is_good: \"Studies suggest gaming is good for children\u2019s brains. (it\u2019s true!)\"\n# game_based: \"When game-based learning systems are\"\n# compared: \"compared\"\n# conventional: \"against conventional assessment methods, the difference is clear: games are better at helping students retain knowledge, concentrate and\"\n# perform_at_higher_level: \"perform at a higher level of achievement\"\n# feedback: \"Games also provide real-time feedback that allows students to adjust their solution path and understand concepts more holistically, instead of being limited to just \u201ccorrect\u201d or \u201cincorrect\u201d answers.\"\n# real_game: \"A real game, played with real coding.\"\n# great_game: \"A great game is more than just badges and achievements - it\u2019s about a player\u2019s journey, well-designed puzzles, and the ability to tackle challenges with agency and confidence.\"\n# agency: \"CodeCombat is a game that gives players that agency and confidence with our robust typed code engine, which helps beginner and advanced students alike write proper, valid code.\"\n# request_demo_title: \"Get your students started today!\"\n# request_demo_subtitle: \"Request a demo and get your students started in less than an hour.\"\n# get_started_title: \"Set up your class today\"\n# get_started_subtitle: \"Set up a class, add your students, and monitor their progress as they learn computer science.\"\n# request_demo: \"Request a Demo\"\n# setup_a_class: \"Set Up a Class\"\n# have_an_account: \"Have an account?\"\n# logged_in_as: \"You are currently logged in as\"\n# computer_science: \"Our self-paced courses cover basic syntax to advanced concepts\"\n# ffa: \"Free for all students\"\n# coming_soon: \"More coming soon!\"\n# courses_available_in: \"Courses are available in JavaScript and Python. Web Development courses utilize HTML, CSS, and jQuery.\"\n# boast: \"Boasts riddles that are complex enough to fascinate gamers and coders alike.\"\n# winning: \"A winning combination of RPG gameplay and programming homework that pulls off making kid-friendly education legitimately enjoyable.\"\n# run_class: \"Everything you need to run a computer science class in your school today, no CS background required.\"\n# goto_classes: \"Go to My Classes\"\n# view_profile: \"View My Profile\"\n# view_progress: \"View Progress\"\n# go_to_courses: \"Go to My Courses\"\n# want_coco: \"Want CodeCombat at your school?\"\n\n nav:\n map: \"Mapa\"\n play: \"\u00darovn\u011b\" # The top nav bar entry where players choose which levels to play\n community: \"Komunita\"\n courses: \"Kurzy\"\n blog: \"Blog\"\n forum: \"F\u00f3rum\"\n account: \"\u00da\u010det\"\n my_account: \"M\u016fj \u00da\u010det\"\n profile: \"Profil\"\n home: \"Dom\u016f\"\n contribute: \"P\u0159isp\u00edvat\"\n legal: \"Licence\"\n privacy: \"Soukrom\u00ed\"\n about: \"O str\u00e1nk\u00e1ch\"\n contact: \"Kontakt\"\n twitter_follow: \"Sledovat na Twitteru\"\n my_classrooms: \"Moje T\u0159\u00eddy\"\n my_courses: \"Moje Kurzy\"\n careers: \"Kari\u00e9ry\"\n facebook: \"Facebook\"\n twitter: \"Twitter\"\n create_a_class: \"Vytvo\u0159it T\u0159\u00eddu\"\n other: \"Jin\u00e9\"\n learn_to_code: \"Nau\u010d se k\u00f3dit!\"\n toggle_nav: \"P\u0159epnout navigaci\"\n schools: \"\u0160koly\"\n get_involved: \"Zapojit se\"\n open_source: \"Open source (GitHub)\"\n support: \"Podpora\"\n faqs: \"FAQ\"\n# copyright_prefix: \"Copyright\"\n# copyright_suffix: \"All Rights Reserved.\"\n help_pref: \"Pot\u0159ebujete pomoc? Email\"\n help_suff: \"a my se ozveme!\"\n resource_hub: \"Resource Hub\"\n# apcsp: \"AP CS Principles\"\n# parent: \"Parents\"\n\n modal:\n close: \"Zav\u0159\u00edt\"\n okay: \"Budi\u017e\"\n\n not_found:\n page_not_found: \"Str\u00e1nka nenalezena\"\n\n diplomat_suggestion:\n title: \"Pomozte p\u0159elo\u017eit CodeCombat!\" # This shows up when a player switches to a non-English language using the language selector.\n sub_heading: \"Pot\u0159ebujeme va\u0161e dovednosti.\"\n pitch_body: \"P\u0159esto\u017ee vyv\u00edj\u00edme CodeCombat v angli\u010dtin\u011b, m\u00e1me spoustu hr\u00e1\u010d\u016f z cel\u00e9ho sv\u011bta a mnoz\u00ed z nich by si r\u00e1di zahr\u00e1li \u010desky, nebo\u0165 anglicky neum\u00ed. Pokud anglicky um\u00edte, p\u0159ihlaste se pros\u00edm jako Diplomat a pomozte n\u00e1m v p\u0159ekladu webu i jednotliv\u00fdch \u00farovn\u00ed.\"\n missing_translations: \"Dokud nebude v\u0161e p\u0159elo\u017eeno, bude se v\u00e1m na zat\u00edm nep\u0159elo\u017een\u00fdch m\u00edstech zobrazovat text anglicky.\"\n learn_more: \"Dozv\u011bd\u011bt se v\u00edce o Diplomatech\"\n subscribe_as_diplomat: \"P\u0159ihl\u00e1sit se jako Diplomat\"\n\n play:\n# anon_signup_title_1: \"CodeCombat has a\"\n# anon_signup_title_2: \"Classroom Version!\"\n# anon_signup_enter_code: \"Enter Class Code:\"\n# anon_signup_ask_teacher: \"Don't have one? Ask your teacher!\"\n# anon_signup_create_class: \"Want to create a class?\"\n# anon_signup_setup_class: \"Set up a class, add your students, and monitor progress!\"\n# anon_signup_create_teacher: \"Create free teacher account\"\n play_as: \"Hr\u00e1t jako\" # Ladder page\n get_course_for_class: \"P\u0159i\u0159a\u010f Hern\u00ed V\u00fdvoj a jin\u00e9 do sv\u00fdch t\u0159\u00edd!\"\n request_licenses: \"Kontaktujte specialisty na\u0161\u00ed \u0161koly pro v\u00edce detail\u016f.\"\n compete: \"Soupe\u0159it!\" # Course details page\n spectate: \"D\u00edvat se\" # Ladder page\n players: \"hr\u00e1\u010di\" # Hover over a level on \/play\n hours_played: \"hodin nahr\u00e1no\" # Hover over a level on \/play\n items: \"P\u0159edm\u011bty\" # Tooltip on item shop button from \/play\n unlock: \"Odemknout\" # For purchasing items and heroes\n confirm: \"Potvrdit\"\n owned: \"Vlastn\u011bn\u00e9\" # For items you own\n locked: \"Zam\u010den\u00e9\"\n available: \"Dostupn\u00e9\"\n skills_granted: \"Nabyt\u00e9 dovednosti\" # Property documentation details\n heroes: \"Hrdinov\u00e9\" # Tooltip on hero shop button from \/play\n achievements: \"\u00dasp\u011bchy\" # Tooltip on achievement list button from \/play\n settings: \"Nastaven\u00ed\" # Tooltip on settings button from \/play\n poll: \"Hlasov\u00e1n\u00ed\" # Tooltip on poll button from \/play\n next: \"Dal\u0161\u00ed\" # Go from choose hero to choose inventory before playing a level\n change_hero: \"Zm\u011bnit hrdinu\" # Go back from choose inventory to choose hero\n change_hero_or_language: \"Zm\u011bnit hrdinu nebo jazyk\"\n buy_gems: \"Zakoupit drahokamy\"\n subscribers_only: \"Pouze p\u0159edplatitel\u00e9!\"\n subscribe_unlock: \"P\u0159edpla\u0165te si pro odemknut\u00ed!\"\n subscriber_heroes: \"P\u0159edpla\u0165te si dnes pro okam\u017eit\u00e9 odem\u010den\u00ed Amary, Hushbauma a Hattoriho!\"\n subscriber_gems: \"P\u0159edpla\u0165te si dnes pro n\u00e1kup tohoto hrdiny za drahokamy!\"\n anonymous: \"Anonymn\u00ed hr\u00e1\u010d\"\n level_difficulty: \"Obt\u00ed\u017enost: \"\n awaiting_levels_adventurer_prefix: \"Vypou\u0161t\u00edme p\u011bt \u00farovn\u00ed ka\u017ed\u00fd t\u00fdden.\" # {change}\n awaiting_levels_adventurer: \"P\u0159ihla\u0161te se jako Dobrodruh\"\n awaiting_levels_adventurer_suffix: \"abyste jako prvn\u00ed hr\u00e1li nejnov\u011bj\u0161\u00ed \u00farovn\u011b.\"\n adjust_volume: \"Nastaven\u00ed hlasitosti\"\n campaign_multiplayer: \"Multiplayer Ar\u00e9na\"\n campaign_multiplayer_description: \"...ve kter\u00e9 programujete proti jin\u00fdm hr\u00e1\u010d\u016fm.\"\n# brain_pop_done: \"You\u2019ve defeated the Ogres with code! You win!\"\n# brain_pop_challenge: \"Challenge yourself to play again using a different programming language!\"\n# replay: \"Replay\"\n# back_to_classroom: \"Back to Classroom\"\n# teacher_button: \"For Teachers\"\n# get_more_codecombat: \"Get More CodeCombat\"\n\n# code:\n# if: \"if\" # Keywords--these translations show up on hover, so please translate them all, even if it's kind of long. (In the code editor, they will still be in English.)\n# else: \"else\"\n# elif: \"else if\"\n# while: \"while\"\n# loop: \"loop\"\n# for: \"for\"\n# break: \"break\"\n# continue: \"continue\"\n# pass: \"pass\"\n# return: \"return\"\n# then: \"then\"\n# do: \"do\"\n# end: \"end\"\n# function: \"function\"\n# def: \"define\"\n# var: \"variable\"\n# self: \"self\"\n# hero: \"hero\"\n# this: \"this\"\n# or: \"or\"\n# \"||\": \"or\"\n# and: \"and\"\n# \"&&\": \"and\"\n# not: \"not\"\n# \"!\": \"not\"\n# \"=\": \"assign\"\n# \"==\": \"equals\"\n# \"===\": \"strictly equals\"\n# \"!=\": \"does not equal\"\n# \"!==\": \"does not strictly equal\"\n# \">\": \"is greater than\"\n# \">=\": \"is greater than or equal\"\n# \"<\": \"is less than\"\n# \"<=\": \"is less than or equal\"\n# \"*\": \"multiplied by\"\n# \"\/\": \"divided by\"\n# \"+\": \"plus\"\n# \"-\": \"minus\"\n# \"+=\": \"add and assign\"\n# \"-=\": \"subtract and assign\"\n# True: \"True\"\n# true: \"true\"\n# False: \"False\"\n# false: \"false\"\n# undefined: \"undefined\"\n# null: \"null\"\n# nil: \"nil\"\n# None: \"None\"\n\n share_progress_modal:\n blurb: \"D\u011bl\u00e1\u0161 velk\u00e9 pokroky! \u0158ekni n\u011bkomu, co jsi se u\u017e nau\u010dil s CodeCombat.\" # {change}\n email_invalid: \"Neplatn\u00e1 e-mailov\u00e1 adresa.\"\n form_blurb: \"Vlo\u017ete jejich e-mail n\u00ed\u017ee a my u\u017e je kontaktujeme!\"\n form_label: \"E-mailov\u00e1 adresa\"\n placeholder: \"e-mailov\u00e1 adresa\"\n title: \"V\u00fdborn\u00e1 pr\u00e1ce, u\u010dni\"\n\n login:\n sign_up: \"Vytvo\u0159it \u00fa\u010det\"\n# email_or_username: \"Email or username\"\n log_in: \"P\u0159ihl\u00e1sit\"\n logging_in: \"P\u0159ihla\u0161ov\u00e1n\u00ed\"\n log_out: \"Odhl\u00e1sit\"\n forgot_password: \"Zapomenut\u00e9 heslo?\"\n finishing: \"Dokon\u010dov\u00e1n\u00ed\"\n sign_in_with_facebook: \"P\u0159ihl\u00e1sit p\u0159es Facebook\"\n sign_in_with_gplus: \"P\u0159ihl\u00e1sit p\u0159es Google+\"\n signup_switch: \"Chcete si zalo\u017eit \u00fa\u010det?\"\n\n signup:\n# complete_subscription: \"Complete Subscription\"\n create_student_header: \"Vytvo\u0159it \u00fa\u010det pro studenta\"\n create_teacher_header: \"Vytvo\u0159it \u00fa\u010det pro u\u010ditele\"\n create_individual_header: \"Vytvo\u0159it \u00fa\u010det pro jednotlivce\"\n email_announcements: \"Dost\u00e1vat novinky emailem\" # {change}\n# sign_in_to_continue: \"Sign in or create an account to continue\"\n# teacher_email_announcements: \"Keep me updated on new teacher resources, curriculum, and courses!\"\n creating: \"Vytv\u00e1\u0159\u00edm \u00fa\u010det...\"\n sign_up: \"P\u0159ihl\u00e1\u0161en\u00ed\"\n log_in: \"zadejte va\u0161e heslo\"\n required: \"Nejprve se mus\u00edte p\u0159ihl\u00e1sit.\"\n login_switch: \"M\u00e1te ji\u017e \u00fa\u010det?\"\n# optional: \"optional\"\n# connected_gplus_header: \"You've successfully connected with Google+!\"\n# connected_gplus_p: \"Finish signing up so you can log in with your Google+ account.\"\n# connected_facebook_header: \"You've successfully connected with Facebook!\"\n# connected_facebook_p: \"Finish signing up so you can log in with your Facebook account.\"\n# hey_students: \"Students, enter the class code from your teacher.\"\n birthday: \"Datum narozen\u00ed\"\n# parent_email_blurb: \"We know you can't wait to learn programming — we're excited too! Your parents will receive an email with further instructions on how to create an account for you. Email {{email_link}} if you have any questions.\"\n# classroom_not_found: \"No classes exist with this Class Code. Check your spelling or ask your teacher for help.\"\n checking: \"Kontroluji...\"\n account_exists: \"Tento email se ji\u017e pou\u017e\u00edv\u00e1:\"\n sign_in: \"P\u0159ihla\u0161te se\"\n email_good: \"Email se zd\u00e1 b\u00fdt v po\u0159\u00e1dku!\"\n name_taken: \"U\u017eivatelsk\u00e9 jm\u00e9no je zabran\u00e9! Co tak {{suggestedName}}?\"\n name_available: \"U\u017eivatelsk\u00e9 jm\u00e9no je k dispozici!\"\n name_is_email: \"U\u017eivatelsk\u00e9 jm\u00e9no nesm\u00ed b\u00fdt email\"\n choose_type: \"Zvolte si typ \u00fa\u010dtu:\"\n teacher_type_1: \"Vyu\u010dujte programov\u00e1n\u00ed s CodeCombatem!\"\n teacher_type_2: \"Nastavte si svou t\u0159\u00eddu\"\n# teacher_type_3: \"Access Course Guides\"\n teacher_type_4: \"Prohl\u00ed\u017eejte si pokroky student\u016f\"\n signup_as_teacher: \"Zalo\u017eit \u00fa\u010det jako u\u010ditel\"\n student_type_1: \"Nau\u010d se programovat p\u0159i hran\u00ed zaj\u00edmav\u00e9 hry!\"\n student_type_2: \"Hrej si se svou t\u0159\u00eddou\"\n student_type_3: \"Sout\u011b\u017e v ar\u00e9nach\"\n student_type_4: \"Vyber si sv\u00e9ho hrdinu!\"\n student_type_5: \"P\u0159iprav si sv\u016fj t\u0159\u00eddn\u00ed k\u00f3d!\"\n signup_as_student: \"Zalo\u017eit \u00fa\u010det jako student\"\n individuals_or_parents: \"Jednotlivci a rodi\u010de\"\n individual_type: \"Pro hr\u00e1\u010de, kte\u0159\u00ed se u\u010d\u00ed programovat samostatn\u011b. Rodi\u010de by si m\u011bli zalo\u017eit \u00fa\u010det zde.\"\n signup_as_individual: \"Zalo\u017eit \u00fa\u010det jako jednotlivec\"\n enter_class_code: \"Zadej sv\u016fj t\u0159\u00eddn\u00ed k\u00f3d\"\n enter_birthdate: \"Zadejte datum narozen\u00ed:\"\n parent_use_birthdate: \"Rodi\u010de, pou\u017eijte sv\u00e9 vlastn\u00ed datum narozen\u00ed.\"\n ask_teacher_1: \"Po\u017e\u00e1dej sv\u00e9ho u\u010ditele o t\u0159\u00eddn\u00ed k\u00f3d.\"\n ask_teacher_2: \"Nejste sou\u010d\u00e1st\u00ed \u017e\u00e1dn\u00e9 t\u0159\u00eddy? Vytvo\u0159te si \"\n ask_teacher_3: \"\u00fa\u010det pro jednotlivce\"\n ask_teacher_4: \".\"\n# about_to_join: \"You're about to join:\"\n# enter_parent_email: \"Enter your parent\u2019s email address:\"\n# parent_email_error: \"Something went wrong when trying to send the email. Check the email address and try again.\"\n# parent_email_sent: \"We\u2019ve sent an email with further instructions on how to create an account. Ask your parent to check their inbox.\"\n account_created: \"\u00da\u010det vytvo\u0159en!\"\n# confirm_student_blurb: \"Write down your information so that you don't forget it. Your teacher can also help you reset your password at any time.\"\n confirm_individual_blurb: \"Zapi\u0161te si p\u0159ihla\u0161ovac\u00ed \u00fadaje, budete je pozd\u011bji pot\u0159ebovat. Ov\u011b\u0159te sv\u016fj email, abyste si mohl\/a obnovit \u00fa\u010det v p\u0159\u00edpad\u011b, \u017ee zapomenete heslo - zkontrolujte si p\u0159\u00edchoz\u00ed po\u0161tu!\"\n write_this_down: \"Zapi\u0161te si:\"\n start_playing: \"Za\u010d\u00edt hr\u00e1t!\"\n# sso_connected: \"Successfully connected with:\"\n select_your_starting_hero: \"Vyber si sv\u00e9ho v\u00fdchoz\u00edho hrdinu:\"\n you_can_always_change_your_hero_later: \"Hrdinu si m\u016f\u017ee\u0161 kdykoli zm\u011bnit.\"\n# finish: \"Finish\"\n# teacher_ready_to_create_class: \"You're ready to create your first class!\"\n# teacher_students_can_start_now: \"Your students will be able to start playing the first course, Introduction to Computer Science, immediately.\"\n# teacher_list_create_class: \"On the next screen you will be able to create a new class.\"\n# teacher_list_add_students: \"Add students to the class by clicking the View Class link, then sending your students the Class Code or URL. You can also invite them via email if they have email addresses.\"\n# teacher_list_resource_hub_1: \"Check out the\"\n# teacher_list_resource_hub_2: \"Course Guides\"\n# teacher_list_resource_hub_3: \"for solutions to every level, and the\"\n# teacher_list_resource_hub_4: \"Resource Hub\"\n# teacher_list_resource_hub_5: \"for curriculum guides, activities, and more!\"\n# teacher_additional_questions: \"That\u2019s it! If you need additional help or have questions, reach out to __supportEmail__.\"\n# dont_use_our_email_silly: \"Don't put our email here! Put your parent's email.\"\n# want_codecombat_in_school: \"Want to play CodeCombat all the time?\"\n# eu_confirmation: \"I agree to allow CodeCombat to store my data on US servers.\"\n# eu_confirmation_place_of_processing: \"Learn more about the possible risks\"\n# eu_confirmation_student: \"If you are not sure, ask your teacher.\"\n# eu_confirmation_individual: \"If you do not want us to store your data on US servers, you can always keep playing anonymously without saving your code.\"\n\n recover:\n recover_account_title: \"Obnoven\u00ed \u00fa\u010dtu\"\n send_password: \"Zaslat nov\u00e9 heslo\"\n recovery_sent: \"Email s obnoven\u00edm byl zasl\u00e1n.\"\n\n items:\n primary: \"Hlavn\u00ed\"\n secondary: \"Vedlej\u0161\u00ed\"\n armor: \"Zbroj\"\n accessories: \"Dopl\u0148ky\"\n misc: \"R\u016fzn\u00e9\"\n books: \"Spisy\"\n\n common:\n back: \"Zp\u011bt\" # When used as an action verb, like \"Navigate backward\"\n coming_soon: \"Ji\u017e brzy!\"\n continue: \"Pokra\u010dovat\" # When used as an action verb, like \"Continue forward\"\n# next: \"Next\"\n# default_code: \"Default Code\"\n loading: \"Na\u010d\u00edt\u00e1n\u00ed...\"\n# overview: \"Overview\"\n# processing: \"Processing...\"\n solution: \"\u0158e\u0161en\u00ed\"\n# table_of_contents: \"Table of Contents\"\n intro: \"Intro\"\n saving: \"Ukl\u00e1d\u00e1n\u00ed...\"\n sending: \"Odes\u00edl\u00e1n\u00ed...\"\n send: \"Odeslat\"\n sent: \"Odeslan\u00e9\"\n cancel: \"Zru\u0161it\"\n save: \"Ulo\u017eit\"\n publish: \"Publikovat\"\n create: \"Vytvo\u0159it\"\n fork: \"Klonovat\"\n play: \"Hr\u00e1t\" # When used as an action verb, like \"Play next level\"\n retry: \"Znovu\"\n actions: \"Akce\"\n info: \"Info\"\n help: \"Pomoc\"\n watch: \"Sledovat\"\n unwatch: \"Odsledovat\"\n submit_patch: \"Odeslat opravu\"\n submit_changes: \"Odeslat zm\u011bny\"\n save_changes: \"Ulo\u017eit zm\u011bny\"\n required_field: \"povinn\u00e9 pole\"\n\n general:\n and: \"a\"\n name: \"Jm\u00e9no\"\n date: \"Datum\"\n body: \"T\u011blo\"\n version: \"Verze\"\n pending: \"Nevy\u0159\u00edzeno\"\n accepted: \"P\u0159ijato\"\n rejected: \"Odm\u00edtnuto\"\n withdrawn: \"Uzav\u0159eno\"\n# accept: \"Accept\"\n# accept_and_save: \"Accept&Save\"\n# reject: \"Reject\"\n# withdraw: \"Withdraw\"\n submitter: \"Odes\u00edlatel\"\n submitted: \"Odesl\u00e1no\"\n commit_msg: \"Popisek ukl\u00e1d\u00e1n\u00ed\"\n version_history: \"Seznam zm\u011bn\"\n version_history_for: \"Seznam zm\u011bn pro: \"\n select_changes: \"Vyberte dv\u011b zm\u011bny pro porovn\u00e1n\u00ed.\"\n undo_prefix: \"Zp\u011bt\"\n undo_shortcut: \"(Ctrl+Z)\"\n redo_prefix: \"Znovu dop\u0159edu\"\n redo_shortcut: \"(Ctrl+Shift+Z)\"\n play_preview: \"P\u0159ehr\u00e1t n\u00e1hled sou\u010dasn\u00e9 \u00farovn\u011b\"\n result: \"V\u00fdsledek\"\n results: \"V\u00fdsledky\"\n description: \"Popis\"\n or: \"nebo\"\n subject: \"P\u0159edm\u011bt\"\n email: \"Email\"\n password: \"Heslo\"\n# confirm_password: \"Confirm Password\"\n message: \"Zpr\u00e1va\"\n code: \"K\u00f3d\"\n ladder: \"\u017deb\u0159\u00ed\u010dek\"\n when: \"Kdy\u017e\"\n opponent: \"Protivn\u00edk\"\n rank: \"Po\u0159ad\u00ed\"\n score: \"Sk\u00f3re\"\n win: \"Vyhran\u00e9\"\n loss: \"Prohran\u00e9\"\n tie: \"Rem\u00edzy\"\n easy: \"Jednoduch\u00e9\"\n medium: \"St\u0159edn\u00ed\"\n hard: \"T\u011b\u017ek\u00e9\"\n player: \"Hr\u00e1\u010d\"\n player_level: \"\u00darove\u0148\" # Like player level 5, not like level: Dungeons of Kithgard\n warrior: \"V\u00e1le\u010dn\u00edk\"\n ranger: \"Odst\u0159elova\u010d\"\n wizard: \"Kouzeln\u00edk\"\n first_name: \"Jm\u00e9no\"\n last_name: \"P\u0159\u00edjmen\u00ed\"\n last_initial: \"St\u0159edn\u00ed inici\u00e1la\"\n username: \"U\u017eivatelsk\u00e9 jm\u00e9no\"\n contact_us: \"Kontaktujte n\u00e1s\"\n close_window: \"Zav\u0159\u00edt okno\"\n learn_more: \"V\u00edc informac\u00ed\"\n# more: \"More\"\n# fewer: \"Fewer\"\n# with: \"with\"\n\n units:\n second: \"sekunda\"\n seconds: \"sekund\"\n# sec: \"sec\"\n minute: \"minuta\"\n minutes: \"minut\"\n hour: \"hodina\"\n hours: \"hodin\"\n day: \"den\"\n days: \"dn\u00ed\"\n week: \"t\u00fdden\"\n weeks: \"t\u00fddn\u016f\"\n month: \"m\u011bs\u00edc\"\n months: \"m\u011bs\u00edc\u016f\"\n year: \"rok\"\n years: \"rok\u016f\"\n\n play_level:\n# back_to_map: \"Back to Map\"\n# directions: \"Directions\"\n# edit_level: \"Edit Level\"\n# keep_learning: \"Keep Learning\"\n# explore_codecombat: \"Explore CodeCombat\"\n# finished_hoc: \"I'm finished with my Hour of Code\"\n# get_certificate: \"Get your certificate!\"\n# level_complete: \"Level Complete\"\n# completed_level: \"Completed Level:\"\n# course: \"Course:\"\n done: \"Hotovo\"\n next_level: \"Dal\u0161\u00ed \u00farove\u0148\"\n# combo_challenge: \"Combo Challenge\"\n# concept_challenge: \"Concept Challenge\"\n# challenge_unlocked: \"Challenge Unlocked\"\n# combo_challenge_unlocked: \"Combo Challenge Unlocked\"\n# concept_challenge_unlocked: \"Concept Challenge Unlocked\"\n# concept_challenge_complete: \"Concept Challenge Complete!\"\n# combo_challenge_complete: \"Combo Challenge Complete!\"\n# combo_challenge_complete_body: \"Great job, it looks like you're well on your way to understanding __concept__!\"\n# replay_level: \"Replay Level\"\n# combo_concepts_used: \"__complete__\/__total__ Concepts Used\"\n# combo_all_concepts_used: \"You used all concepts possible to solve the challenge. Great job!\"\n# combo_not_all_concepts_used: \"You used __complete__ out of the __total__ concepts possible to solve the challenge. Try to get all __total__ concepts next time!\"\n# start_challenge: \"Start Challenge\"\n next_game: \"Dal\u0161\u00ed hra\"\n languages: \"Jazyky\"\n# programming_language: \"Programming language\"\n# show_menu: \"Show game menu\"\n home: \"Dom\u016f\" # Not used any more, will be removed soon.\n level: \"\u00darove\u0148\" # Like \"Level: Dungeons of Kithgard\"\n skip: \"P\u0159esko\u010dit\"\n game_menu: \"Hern\u00ed menu\"\n restart: \"Restartovat\"\n goals: \"C\u00edle\"\n goal: \"C\u00edl\"\n# challenge_level_goals: \"Challenge Level Goals\"\n# challenge_level_goal: \"Challenge Level Goal\"\n# concept_challenge_goals: \"Concept Challenge Goals\"\n# combo_challenge_goals: \"Challenge Level Goals\"\n# concept_challenge_goal: \"Concept Challenge Goal\"\n# combo_challenge_goal: \"Challenge Level Goal\"\n running: \"B\u011b\u017e\u00edc\u00ed...\"\n success: \"\u00dasp\u011bch!\"\n incomplete: \"Nedokon\u010den\u00fd\"\n timed_out: \"Vypr\u0161el \u010das\"\n failing: \"Selh\u00e1n\u00ed\"\n reload: \"Znovu na\u010d\u00edst\"\n reload_title: \"Znovu na\u010d\u00edst ve\u0161ker\u00fd k\u00f3d?\"\n reload_really: \"Opravdu chcete resetovat tuto \u00farove\u0148 do po\u010d\u00e1te\u010dn\u00edho stavu?\"\n reload_confirm: \"Znovu na\u010d\u00edst v\u0161e\"\n# test_level: \"Test Level\"\n victory: \"V\u00edt\u011bzstv\u00ed\"\n victory_title_prefix: \"\"\n victory_title_suffix: \" Hotovo\"\n victory_sign_up: \"P\u0159ihl\u00e1sit se pro ulo\u017een\u00ed postupu\"\n victory_sign_up_poke: \"Chcete ulo\u017eit v\u00e1\u0161 k\u00f3d? Vytvo\u0159te si \u00fa\u010det zdarma!\"\n victory_rate_the_level: \"Ohodno\u0165te tuto \u00farove\u0148: \" # {change}\n victory_return_to_ladder: \"Vr\u00e1tit se na \u017deb\u0159\u00ed\u010dek\"\n victory_saving_progress: \"Ukl\u00e1d\u00e1n\u00ed postupu\"\n victory_go_home: \"P\u0159ej\u00edt dom\u016f\"\n victory_review: \"P\u0159ipom\u00ednky!\"\n# victory_review_placeholder: \"How was the level?\"\n victory_hour_of_code_done: \"Skon\u010dili jste?\"\n victory_hour_of_code_done_yes: \"Ano, pro dne\u0161ek jsem skon\u010dil!\"\n victory_experience_gained: \"Z\u00edsk\u00e1no zku\u0161enost\u00ed\"\n victory_gems_gained: \"Z\u00edsk\u00e1no drahokam\u016f\"\n# victory_new_item: \"New Item\"\n# victory_new_hero: \"New Hero\"\n# victory_viking_code_school: \"Holy smokes, that was a hard level you just beat! If you aren't already a software developer, you should be. You just got fast-tracked for acceptance with Viking Code School, where you can take your skills to the next level and become a professional web developer in 14 weeks.\"\n# victory_become_a_viking: \"Become a Viking\"\n# victory_no_progress_for_teachers: \"Progress is not saved for teachers. But, you can add a student account to your classroom for yourself.\"\n tome_cast_button_run: \"Spustit\"\n tome_cast_button_running: \"Spu\u0161t\u011bn\u00e9\"\n tome_cast_button_ran: \"Spu\u0161t\u011bno\"\n tome_submit_button: \"Odeslat\"\n tome_reload_method: \"Znovu na\u010d\u00edst p\u016fvodn\u00ed k\u00f3d pro tuto metodu\" # {change}\n tome_available_spells: \"Dostupn\u00e1 kouzla\"\n tome_your_skills: \"Va\u0161e dovednosti\"\n hints: \"N\u00e1pov\u011bda\"\n hints_title: \"N\u00e1pov\u011bda \u010d. {{number}}\"\n code_saved: \"K\u00f3d ulo\u017een\"\n skip_tutorial: \"P\u0159esko\u010dit (esc)\"\n keyboard_shortcuts: \"Kl\u00e1vesov\u00e9 zkratky\"\n loading_start: \"Za\u010d\u00edt \u00farove\u0148\"\n# loading_start_combo: \"Start Combo Challenge\"\n# loading_start_concept: \"Start Concept Challenge\"\n problem_alert_title: \"Oprav si k\u00f3d\"\n time_current: \"Nyn\u00ed:\"\n time_total: \"Max:\"\n time_goto: \"J\u00edt na:\"\n# non_user_code_problem_title: \"Unable to Load Level\"\n infinite_loop_title: \"Detekov\u00e1n nekone\u010dn\u00fd cyklus\"\n# infinite_loop_description: \"The initial code to build the world never finished running. It's probably either really slow or has an infinite loop. Or there might be a bug. You can either try running this code again or reset the code to the default state. If that doesn't fix it, please let us know.\"\n# check_dev_console: \"You can also open the developer console to see what might be going wrong.\"\n# check_dev_console_link: \"(instructions)\"\n infinite_loop_try_again: \"Zkusit znovu\"\n infinite_loop_reset_level: \"Resetovat \u00farove\u0148\"\n infinite_loop_comment_out: \"Zakomentovat m\u016fj k\u00f3d\"\n tip_toggle_play: \"P\u0159epn\u011bte p\u0159ehr\u00e1v\u00e1n\u00ed\/pauzu pomoc\u00ed Ctrl+P.\"\n tip_scrub_shortcut: \"Ctrl+[ a Ctrl+] pro p\u0159eto\u010den\u00ed a rychl\u00fd p\u0159esun.\" # {change}\n tip_guide_exists: \"Klikn\u011bte na pr\u016fvode uvnit\u0159 hern\u00edho menu (naho\u0159e na str\u00e1nce), pro u\u017eite\u010dn\u00e9 informace.\"\n tip_open_source: \"CodeCombat je 100% open source!\" # {change}\n# tip_tell_friends: \"Enjoying CodeCombat? Tell your friends about us!\"\n tip_beta_launch: \"CodeCombat spustil svoji beta verzi v \u0158\u00edjnu, 2013.\"\n tip_think_solution: \"Myslete na \u0159e\u0161en\u00ed, ne na probl\u00e9m.\"\n tip_theory_practice: \"Teoreticky nen\u00ed \u017e\u00e1dn\u00fd rozd\u00edl mezi teori\u00ed a prax\u00ed. Ale v praxi ten rozd\u00edl je. - Yogi Berra\"\n tip_error_free: \"Jsou dva zp\u016fsoby jak ps\u00e1t programy bez chyb; jenom ten t\u0159et\u00ed funguje. - Alan Perlis\"\n tip_debugging_program: \"Pokud je lad\u011bn\u00ed proces, p\u0159i kter\u00e9m se odstra\u0148uj\u00ed chyby, programov\u00e1n\u00ed tedy mus\u00ed b\u00fdt proces, kter\u00fdm se chyby p\u0159id\u00e1vaj\u00ed. - Edsger W. Dijkstra\"\n tip_forums: \"Jd\u011bte na na\u0161e f\u00f3ra a \u0159ekn\u011bte n\u00e1m, co si mysl\u00edte!\"\n tip_baby_coders: \"V budoucnu budou i mimina Arcikouzeln\u00edky.\"\n tip_morale_improves: \"Na\u010d\u00edt\u00e1n\u00ed bude prob\u00edhat, dokud se nezlep\u0161\u00ed mor\u00e1lka.\"\n tip_all_species: \"V\u011b\u0159\u00edme ve stejn\u00e9 mo\u017enosti u\u010den\u00ed se programovat pro v\u0161echny druhy.\"\n tip_reticulating: \"S\u00ed\u0165ov\u00e1n\u00ed p\u00e1te\u0159\u00ed.\"\n tip_harry: \"Hej kouzeln\u00edku, \"\n tip_great_responsibility: \"S velk\u00fdmi dovednosti v programov\u00e1n\u00ed p\u0159ich\u00e1z\u00ed velk\u00e1 odpov\u011bdnost lad\u011bn\u00ed.\"\n tip_munchkin: \"Pokud nebude\u0161 j\u00edst zeleninu, munchkin p\u016fjde po tob\u011b mezit\u00edm co bude\u0161 sp\u00e1t.\"\n tip_binary: \"Je jenom 10 typ\u016f lid\u00ed na tomto sv\u011bt\u011b: ti, kte\u0159\u00ed rozum\u00ed bin\u00e1n\u00ed soustav\u011b a ti, kte\u0159\u00ed j\u00ed nerozum\u00ed.\"\n tip_commitment_yoda: \"Program\u00e1tor mus\u00ed m\u00edt nejhlub\u0161\u00ed oddanost, nejv\u00e1\u017en\u011bj\u0161\u00ed mysl. - Yoda\"\n tip_no_try: \"D\u011blej. Nebo ned\u011blej. Av\u0161ak nikdy nezkou\u0161ej. - Yoda\"\n tip_patience: \"Trp\u011blivost mus\u00ed\u0161 m\u00edt, mlad\u00fd Padawan. - Yoda\"\n tip_documented_bug: \"Zadokumentovan\u00e1 chyba nen\u00ed chyba; je to funkce.\"\n tip_impossible: \"V\u017edy se to zd\u00e1 nemo\u017en\u00e9 dokud to nen\u00ed dokon\u010deno. - Nelson Mandela\"\n tip_talk_is_cheap: \"Mluven\u00ed je pro slab\u00e9. Uka\u017e mi k\u00f3d. - Linus Torvalds\"\n tip_first_language: \"Nejv\u00edce zni\u010duj\u00edc\u00ed v\u011bc, kterou se m\u016f\u017ee\u0161 nau\u010dit je tv\u016fj prvn\u00ed programovac\u00ed jazyk. - Alan Kay\"\n tip_hardware_problem: \"Q: Kolik program\u00e1tor\u016f je pot\u0159eba k v\u00fdm\u011bn\u011b \u017e\u00e1rovky? \u017d\u00e1dn\u00fd. To je probl\u00e9m hardwaru.\"\n tip_hofstadters_law: \"Hofstadter\u016fv z\u00e1kon: V\u0161e v\u017edy trv\u00e1 d\u00e9le, ne\u017e o\u010dek\u00e1v\u00e1me, a to i kdy\u017e bereme v \u00favahu Hofstadter\u016fv z\u00e1kon.\"\n tip_premature_optimization: \"P\u0159ed\u010dasn\u00e1 optimalizace je p\u016fvodce v\u0161eho zla. - Donald Knuth\"\n tip_brute_force: \"V p\u0159\u00edpad\u011b pochybnost\u00ed, pou\u017eijte brute force. - Ken Thompson\"\n tip_extrapolation: \"Jsou jenom dva druhy lid\u00ed: ti, kte\u0159\u00ed mohou extrapolovat z nekompletn\u00edch dat...\"\n tip_superpower: \"K\u00f3dov\u00e1n\u00ed by se t\u00e9m\u011b\u0159 dalo srovn\u00e1vat se superschopnostmi.\"\n tip_control_destiny: \"V opravdov\u00e9m open source m\u00e1te pr\u00e1vo \u0159\u00eddit sv\u016fj osud. - Linus Torvalds\"\n tip_no_code: \"\u017d\u00e1dn\u00fd k\u00f3d nen\u00ed rychlej\u0161\u00ed ne\u017e \u017e\u00e1dn\u00fd k\u00f3d.\"\n tip_code_never_lies: \"K\u00f3d nikdy nel\u017ee, koment\u00e1\u0159e n\u011bkdy ano. \u2014 Ron Jeffries\"\n tip_reusable_software: \"P\u0159edt\u00edm, ne\u017e m\u016f\u017ee b\u00fdt software znovu pou\u017eiteln\u00fd, mus\u00ed b\u00fdt nejprve pou\u017eiteln\u00fd.\"\n tip_optimization_operator: \"Ka\u017ed\u00fd jazyk m\u00e1 sv\u00e9 optimalizace. Ve v\u011bt\u0161in\u011b jazyku to je \\\"\/\/\\\"\"\n tip_lines_of_code: \"M\u011b\u0159en\u00ed postupu v programov\u00e1n\u00ed podle po\u010dtu \u0159\u00e1dk\u016f je jako m\u011b\u0159en\u00ed postupu stavby letadla podle v\u00e1hy. \u2014 Bill Gates\"\n tip_source_code: \"Chci zm\u011bnit sv\u011bt, ale necht\u011bj\u00ed m\u011b d\u00e1t k n\u011bmu zdrojov\u00fd k\u00f3d.\"\n tip_javascript_java: \"Porovn\u00e1vat Javu a JavaScript je stejn\u00e9, jako porovn\u00e1vat auto a autoritu. - Chris Heilmann\"\n tip_move_forward: \"A\u0165 u\u017e d\u011bl\u00e1\u0161 cokoliv, v\u017edy jdi dop\u0159edu. - Martin Luther King Jr.\"\n tip_google: \"M\u00e1\u0161 probl\u00e9m, kter\u00fd nem\u016f\u017ee\u0161 vy\u0159e\u0161it? Vygoogluj to!\"\n tip_adding_evil: \"P\u0159id\u00e1v\u00e1n\u00ed \u0161petky zla.\"\n# tip_hate_computers: \"That's the thing about people who think they hate computers. What they really hate is lousy programmers. - Larry Niven\"\n tip_open_source_contribute: \"M\u016f\u017ee\u0161 n\u00e1m pomoct zlep\u0161it CodeCombat!\"\n# tip_recurse: \"To iterate is human, to recurse divine. - L. Peter Deutsch\"\n# tip_free_your_mind: \"You have to let it all go, Neo. Fear, doubt, and disbelief. Free your mind. - Morpheus\"\n# tip_strong_opponents: \"Even the strongest of opponents always has a weakness. - Itachi Uchiha\"\n# tip_paper_and_pen: \"Before you start coding, you can always plan with a sheet of paper and a pen.\"\n# tip_solve_then_write: \"First, solve the problem. Then, write the code. - John Johnson\"\n tip_compiler_ignores_comments: \"N\u011bkdy m\u00e1m pocit, \u017ee kompil\u00e1tor ignoruje moje koment\u00e1\u0159e.\"\n tip_understand_recursion: \"Jedin\u00fd zp\u016fsob, jak pochopit rekurzi, je pochopit rekurzi.\"\n# tip_life_and_polymorphism: \"Open Source is like a totally polymorphic heterogeneous structure: All types are welcome.\"\n# tip_mistakes_proof_of_trying: \"Mistakes in your code are just proof that you are trying.\"\n# tip_adding_orgres: \"Rounding up ogres.\"\n# tip_sharpening_swords: \"Sharpening the swords.\"\n# tip_ratatouille: \"You must not let anyone define your limits because of where you come from. Your only limit is your soul. - Gusteau, Ratatouille\"\n# tip_nemo: \"When life gets you down, want to know what you've gotta do? Just keep swimming, just keep swimming. - Dory, Finding Nemo\"\n# tip_internet_weather: \"Just move to the internet, it's great here. We get to live inside where the weather is always awesome. - John Green\"\n# tip_nerds: \"Nerds are allowed to love stuff, like jump-up-and-down-in-the-chair-can't-control-yourself love it. - John Green\"\n# tip_self_taught: \"I taught myself 90% of what I've learned. And that's normal! - Hank Green\"\n# tip_luna_lovegood: \"Don't worry, you're just as sane as I am. - Luna Lovegood\"\n# tip_good_idea: \"The best way to have a good idea is to have a lot of ideas. - Linus Pauling\"\n# tip_programming_not_about_computers: \"Computer Science is no more about computers than astronomy is about telescopes. - Edsger Dijkstra\"\n# tip_mulan: \"Believe you can, then you will. - Mulan\"\n# project_complete: \"Project Complete!\"\n# share_this_project: \"Share this project with friends or family:\"\n# ready_to_share: \"Ready to publish your project?\"\n# click_publish: \"Click \\\"Publish\\\" to make it appear in the class gallery, then check out what your classmates built! You can come back and continue to work on this project. Any further changes will automatically be saved and shared with your classmates.\"\n# already_published_prefix: \"Your changes have been published to the class gallery.\"\n# already_published_suffix: \"Keep experimenting and making this project even better, or see what the rest of your class has built! Your changes will automatically be saved and shared with your classmates.\"\n# view_gallery: \"View Gallery\"\n# project_published_noty: \"Your level has been published!\"\n# keep_editing: \"Keep Editing\"\n\n# apis:\n# methods: \"Methods\"\n# events: \"Events\"\n# handlers: \"Handlers\"\n# properties: \"Properties\"\n# snippets: \"Snippets\"\n# spawnable: \"Spawnable\"\n# html: \"HTML\"\n# math: \"Math\"\n# array: \"Array\"\n# object: \"Object\"\n# string: \"String\"\n# function: \"Function\"\n# vector: \"Vector\"\n# date: \"Date\"\n# jquery: \"jQuery\"\n# json: \"JSON\"\n# number: \"Number\"\n# webjavascript: \"JavaScript\"\n\n# amazon_hoc:\n# title: \"Keep Learning with Amazon!\"\n# congrats: \"Congratulations on conquering that challenging Hour of Code!\"\n# educate_1: \"Now, keep learning about coding and cloud computing with AWS Educate, an exciting, free program from Amazon for both students and teachers. With AWS Educate, you can earn cool badges as you learn about the basics of the cloud and cutting-edge technologies such as gaming, virtual reality, and Alexa.\"\n# educate_2: \"Learn more and sign up here\"\n# future_eng_1: \"You can also try to build your own school facts skill for Alexa\"\n# future_eng_2: \"here\"\n# future_eng_3: \"(device is not required). This Alexa activity is brought to you by the\"\n# future_eng_4: \"Amazon Future Engineer\"\n# future_eng_5: \"program which creates learning and work opportunities for all K-12 students in the United States who wish to pursue computer science.\"\n\n# play_game_dev_level:\n# created_by: \"Created by {{name}}\"\n# created_during_hoc: \"Created during Hour of Code\"\n# restart: \"Restart Level\"\n# play: \"Play Level\"\n# play_more_codecombat: \"Play More CodeCombat\"\n# default_student_instructions: \"Click to control your hero and win your game!\"\n# goal_survive: \"Survive.\"\n# goal_survive_time: \"Survive for __seconds__ seconds.\"\n# goal_defeat: \"Defeat all enemies.\"\n# goal_defeat_amount: \"Defeat __amount__ enemies.\"\n# goal_move: \"Move to all the red X marks.\"\n# goal_collect: \"Collect all the items.\"\n# goal_collect_amount: \"Collect __amount__ items.\"\n\n game_menu:\n inventory_tab: \"Invent\u00e1\u0159\"\n save_load_tab: \"Ulo\u017eit\/Na\u010d\u00edst\"\n options_tab: \"Mo\u017enosti\"\n guide_tab: \"Pr\u016fvodce\"\n guide_video_tutorial: \"Video Tutori\u00e1l\"\n guide_tips: \"Tipy\"\n multiplayer_tab: \"Multiplayer\"\n auth_tab: \"Registrovat se\"\n inventory_caption: \"Vybavte sv\u00e9ho hrdinu\"\n choose_hero_caption: \"Vyberte hrdinu, jazyk\"\n options_caption: \"Konfigurace nastaven\u00ed\"\n guide_caption: \"Dokumentace a tipy\"\n multiplayer_caption: \"Hrajte s p\u0159\u00e1teli!\"\n auth_caption: \"Ulo\u017ete v\u00e1\u0161 postup.\"\n\n leaderboard:\n view_other_solutions: \"Zobrazit jin\u00e9 \u0159e\u0161en\u00ed\" # {change}\n scores: \"Sk\u00f3re\"\n top_players: \"Nejlep\u0161\u00ed hr\u00e1\u010di\"\n day: \"Dnes\"\n week: \"Tento t\u00fdden\"\n all: \"Celkov\u011b\"\n# latest: \"Latest\"\n time: \"\u010cas\"\n damage_taken: \"Obdr\u017eeno zran\u011bn\u00ed\"\n damage_dealt: \"Ud\u011bleno zran\u011bn\u00ed\"\n difficulty: \"Obt\u00ed\u017enost\"\n gold_collected: \"Sebr\u00e1no zlata\"\n# survival_time: \"Survived\"\n# defeated: \"Enemies Defeated\"\n# code_length: \"Lines of Code\"\n# score_display: \"__scoreType__: __score__\"\n\n inventory:\n equipped_item: \"Nasazeno\"\n required_purchase_title: \"Vy\u017eadov\u00e1no\"\n available_item: \"Dostupn\u00e9\"\n restricted_title: \"Omezeno\"\n should_equip: \"(dvojklik pro nasazen\u00ed)\"\n equipped: \"(nasazeno)\"\n locked: \"(zam\u010deno)\"\n restricted: \"(omezeno v t\u00e9to \u00farovni)\"\n equip: \"Nasadit\"\n unequip: \"Sundat\"\n warrior_only: \"Jenom v\u00e1le\u010dn\u00edk\"\n ranger_only: \"Jenom str\u00e1\u017ece\"\n wizard_only: \"Jenom kouzeln\u00edk\"\n\n buy_gems:\n few_gems: \"P\u00e1r drahokam\u016f\"\n pile_gems: \"Hromada drahokam\u016f\"\n chest_gems: \"Truhlice drahokam\u016f\"\n purchasing: \"Prob\u00edh\u00e1 n\u00e1kup...\"\n declined: \"Va\u0161e karta byla odm\u00edtnuta\"\n retrying: \"Chyba serveru, obnovov\u00e1n\u00ed.\"\n prompt_title: \"Nedostatek drahokam\u016f\"\n prompt_body: \"Chcete z\u00edskat v\u00edce?\"\n prompt_button: \"Vstoupit do obchodu\"\n recovered: \"Obnoven\u00ed ji\u017e zakoupen\u00fdch drahokam\u016f prob\u011bhlo \u00fasp\u011b\u0161n\u011b. Aktualizujte str\u00e1nku pros\u00edm.\"\n price: \"x{{gems}} \/ m\u011bs.\"\n# buy_premium: \"Buy Premium\"\n# purchase: \"Purchase\"\n# purchased: \"Purchased\"\n\n# subscribe_for_gems:\n# prompt_title: \"Not Enough Gems!\"\n# prompt_body: \"Subscribe to Premium to get gems and access to even more levels!\"\n\n# earn_gems:\n# prompt_title: \"Not Enough Gems\"\n# prompt_body: \"Keep playing to earn more!\"\n\n subscribe:\n# best_deal: \"Best Deal!\"\n# confirmation: \"Congratulations! You now have a CodeCombat Premium Subscription!\"\n# premium_already_subscribed: \"You're already subscribed to Premium!\"\n subscribe_modal_title: \"CodeCombat Premium\"\n comparison_blurb: \"Sharpen your skills with a CodeCombat subscription!\" # {change}\n must_be_logged: \"Mus\u00edte se nejd\u0159\u00edve p\u0159ihl\u00e1sit. Pros\u00edm vytvo\u0159te si \u00fa\u010det nebo se p\u0159ihlaste z menu naho\u0159e.\"\n subscribe_title: \"P\u0159edplatn\u00e9\" # Actually used in subscribe buttons, too\n unsubscribe: \"Zru\u0161it p\u0159edplatn\u00e9\"\n confirm_unsubscribe: \"Potvrdit zru\u0161en\u00ed\"\n never_mind: \"To nevad\u00ed, po\u0159\u00e1d t\u011b miluji\"\n thank_you_months_prefix: \"D\u011bkujeme za va\u0161i podporu v posledn\u00edch\"\n thank_you_months_suffix: \"m\u011bs\u00edc\u00edch.\"\n thank_you: \"D\u011bkujeme za podporu CodeCombatu.\"\n sorry_to_see_you_go: \"To je \u0161koda! Dejte n\u00e1m pros\u00edm v\u011bd\u011bt, co m\u016f\u017eeme ud\u011blat l\u00e9pe.\"\n unsubscribe_feedback_placeholder: \"Co jsme spolu dok\u00e1zali?\"\n stripe_description: \"M\u011bs\u00ed\u010dn\u00ed p\u0159edplatn\u00e9\"\n# buy_now: \"Buy Now\"\n subscription_required_to_play: \"Pro hran\u00ed t\u00e9to \u00farovn\u011b pot\u0159ebujete p\u0159edplatn\u00e9.\"\n unlock_help_videos: \"Kupte si p\u0159edplatn\u00e9 pro odem\u010den\u00ed v\u0161ech tutori\u00e1lov\u00fdch vide\u00ed.\"\n# personal_sub: \"Personal Subscription\" # Accounts Subscription View below\n# loading_info: \"Loading subscription information...\"\n# managed_by: \"Managed by\"\n# will_be_cancelled: \"Will be cancelled on\"\n# currently_free: \"You currently have a free subscription\"\n# currently_free_until: \"You currently have a subscription until\"\n# free_subscription: \"Free subscription\"\n# was_free_until: \"You had a free subscription until\"\n# managed_subs: \"Managed Subscriptions\"\n# subscribing: \"Subscribing...\"\n# current_recipients: \"Current Recipients\"\n# unsubscribing: \"Unsubscribing\"\n# subscribe_prepaid: \"Click Subscribe to use prepaid code\"\n# using_prepaid: \"Using prepaid code for monthly subscription\"\n# feature_level_access: \"Access 300+ levels available\"\n# feature_heroes: \"Unlock exclusive heroes and pets\"\n# feature_learn: \"Learn to make games and websites\"\n# month_price: \"$__price__\"\n# first_month_price: \"Only $__price__ for your first month!\"\n# lifetime: \"Lifetime Access\"\n# lifetime_price: \"$__price__\"\n# year_subscription: \"Yearly Subscription\"\n# year_price: \"$__price__\/year\"\n# support_part1: \"Need help with payment or prefer PayPal? Email\"\n# support_part2: \"support@codecombat.com\"\n\n# announcement:\n# now_available: \"Now available for subscribers!\"\n# subscriber: \"subscriber\"\n# cuddly_companions: \"Cuddly Companions!\" # Pet Announcement Modal\n# kindling_name: \"Kindling Elemental\"\n# kindling_description: \"Kindling Elementals just want to keep you warm at night. And during the day. All the time, really.\"\n# griffin_name: \"Baby Griffin\"\n# griffin_description: \"Griffins are half eagle, half lion, all adorable.\"\n# raven_name: \"Raven\"\n# raven_description: \"Ravens are excellent at gathering shiny bottles full of health for you.\"\n# mimic_name: \"Mimic\"\n# mimic_description: \"Mimics can pick up coins for you. Move them on top of coins to increase your gold supply.\"\n# cougar_name: \"Cougar\"\n# cougar_description: \"Cougars like to earn a PhD by Purring Happily Daily.\"\n# fox_name: \"Blue Fox\"\n# fox_description: \"Blue foxes are very clever and love digging in the dirt and snow!\"\n# pugicorn_name: \"Pugicorn\"\n# pugicorn_description: \"Pugicorns are some of the rarest creatures and can cast spells!\"\n# wolf_name: \"Wolf Pup\"\n# wolf_description: \"Wolf pups excel in hunting, gathering, and playing a mean game of hide-and-seek!\"\n# ball_name: \"Red Squeaky Ball\"\n# ball_description: \"ball.squeak()\"\n# collect_pets: \"Collect pets for your heroes!\"\n# each_pet: \"Each pet has a unique helper ability!\"\n# upgrade_to_premium: \"Become a {{subscriber}} to equip pets.\"\n# play_second_kithmaze: \"Play {{the_second_kithmaze}} to unlock the Wolf Pup!\"\n# the_second_kithmaze: \"The Second Kithmaze\"\n# keep_playing: \"Keep playing to discover the first pet!\"\n# coming_soon: \"Coming soon\"\n# ritic: \"Ritic the Cold\" # Ritic Announcement Modal\n# ritic_description: \"Ritic the Cold. Trapped in Kelvintaph Glacier for countless ages, finally free and ready to tend to the ogres that imprisoned him.\"\n# ice_block: \"A block of ice\"\n# ice_description: \"There appears to be something trapped inside...\"\n# blink_name: \"Blink\"\n# blink_description: \"Ritic disappears and reappears in a blink of an eye, leaving nothing but a shadow.\"\n# shadowStep_name: \"Shadowstep\"\n# shadowStep_description: \"A master assassin knows how to walk between the shadows.\"\n# tornado_name: \"Tornado\"\n# tornado_description: \"It is good to have a reset button when one's cover is blown.\"\n# wallOfDarkness_name: \"Wall of Darkness\"\n# wallOfDarkness_description: \"Hide behind a wall of shadows to prevent the gaze of prying eyes.\"\n\n# premium_features:\n# get_premium: \"Get
CodeCombat
Premium\" # Fit into the banner on the \/features page\n# master_coder: \"Become a Master Coder by subscribing today!\"\n# paypal_redirect: \"You will be redirected to PayPal to complete the subscription process.\"\n# subscribe_now: \"Subscribe Now\"\n# hero_blurb_1: \"Get access to __premiumHeroesCount__ super-charged subscriber-only heroes! Harness the unstoppable power of Okar Stompfoot, the deadly precision of Naria of the Leaf, or summon \\\"adorable\\\" skeletons with Nalfar Cryptor.\"\n# hero_blurb_2: \"Premium Warriors unlock stunning martial skills like Warcry, Stomp, and Hurl Enemy. Or, play as a Ranger, using stealth and bows, throwing knives, traps! Try your skill as a true coding Wizard, and unleash a powerful array of Primordial, Necromantic or Elemental magic!\"\n# hero_caption: \"Exciting new heroes!\"\n# pet_blurb_1: \"Pets aren't just adorable companions, they also provide unique functionality and methods. The Baby Griffin can carry units through the air, the Wolf Pup plays catch with enemy arrows, the Cougar is fond of chasing ogres around, and the Mimic attracts coins like a magnet!\"\n# pet_blurb_2: \"Collect all the pets to discover their unique abilities!\"\n# pet_caption: \"Adopt pets to accompany your hero!\"\n# game_dev_blurb: \"Learn game scripting and build new levels to share with your friends! Place the items you want, write code for unit logic and behavior, and see if your friends can beat the level!\"\n# game_dev_caption: \"Design your own games to challenge your friends!\"\n# everything_in_premium: \"Everything you get in CodeCombat Premium:\"\n# list_gems: \"Receive bonus gems to buy gear, pets, and heroes\"\n# list_levels: \"Gain access to __premiumLevelsCount__ more levels\"\n# list_heroes: \"Unlock exclusive heroes, include Ranger and Wizard classes\"\n# list_game_dev: \"Make and share games with friends\"\n# list_web_dev: \"Build websites and interactive apps\"\n# list_items: \"Equip Premium-only items like pets\"\n# list_support: \"Get Premium support to help you debug tricky code\"\n# list_clans: \"Create private clans to invite your friends and compete on a group leaderboard\"\n\n choose_hero:\n choose_hero: \"Vyberte va\u0161eho hrdinu\"\n programming_language: \"Programovac\u00ed jazyk\"\n programming_language_description: \"Jak\u00fd programovac\u00ed jazyk chcete pou\u017e\u00edt?\"\n default: \"V\u00fdchoz\u00ed\"\n experimental: \"Pokusn\u00fd\"\n python_blurb: \"Jednoduch\u00fd by\u0165 siln\u00fd, dobr\u00fd pro za\u010d\u00e1te\u010dn\u00edky i pokro\u010dil\u00e9.\"\n javascript_blurb: \"Jazyk webov\u00fdch str\u00e1nek. (Nen\u00ed stejn\u00fd jako Java.)\"\n coffeescript_blurb: \"Hez\u010d\u00ed JavaScript syntaxe.\"\n lua_blurb: \"Jazyk pro skriptov\u00e1n\u00ed her.\"\n# java_blurb: \"(Subscriber Only) Android and enterprise.\"\n status: \"Stav\"\n weapons: \"Zbran\u011b\"\n weapons_warrior: \"Me\u010de - Kr\u00e1tk\u00e1 vzd\u00e1lenost, \u017d\u00e1dn\u00e1 magie\"\n weapons_ranger: \"Ku\u0161e, Zbran\u011b - Dlouh\u00e1 vzd\u00e1lenost, \u017d\u00e1dn\u00e1 magie\"\n weapons_wizard: \"Hole, Ty\u010de - Dlouh\u00e1 vzd\u00e1lenost, Magie\"\n attack: \"Po\u0161kozen\u00ed\" # Can also translate as \"Attack\"\n health: \"Zdrav\u00ed\"\n speed: \"Rychlost\"\n regeneration: \"Regenerace\"\n range: \"Vzd\u00e1lenost\" # As in \"attack or visual range\"\n blocks: \"Blokuje\" # As in \"this shield blocks this much damage\"\n backstab: \"Zap\u00edchnut\u00ed do zad\" # As in \"this dagger does this much backstab damage\"\n skills: \"Dovednosti\"\n# attack_1: \"Deals\"\n# attack_2: \"of listed\"\n# attack_3: \"weapon damage.\"\n# health_1: \"Gains\"\n# health_2: \"of listed\"\n# health_3: \"armor health.\"\n# speed_1: \"Moves at\"\n# speed_2: \"meters per second.\"\n available_for_purchase: \"Dostupn\u00e9 pro zakoupen\u00ed\" # Shows up when you have unlocked, but not purchased, a hero in the hero store\n level_to_unlock: \"\u00darovn\u011b pro odemknut\u00ed:\" # Label for which level you have to beat to unlock a particular hero (click a locked hero in the store to see)\n restricted_to_certain_heroes: \"Pouze ur\u010dit\u00ed hrdinov\u00e9 mohou hr\u00e1t tuto \u00farove\u0148.\"\n\n skill_docs:\n# function: \"function\" # skill types\n# method: \"method\"\n# snippet: \"snippet\"\n# number: \"number\"\n# array: \"array\"\n# object: \"object\"\n# string: \"string\"\n writable: \"zapisovateln\u00e1\" # Hover over \"attack\" in Your Skills while playing a level to see most of this\n read_only: \"jen pro \u010dten\u00ed\"\n action: \"Akce\"\n spell: \"Kouzlo\"\n action_name: \"n\u00e1zev\"\n action_cooldown: \"Zabere\"\n action_specific_cooldown: \"Cooldown\"\n action_damage: \"Po\u0161kozen\u00ed\"\n action_range: \"Vzd\u00e1lenost\"\n action_radius: \"Dosah\"\n action_duration: \"Trv\u00e1n\u00ed\"\n example: \"P\u0159\u00edklad\"\n ex: \"p\u0159.\" # Abbreviation of \"example\"\n current_value: \"Aktu\u00e1ln\u00ed hodnota\"\n default_value: \"V\u00fdchoz\u00ed hodnota\"\n parameters: \"Parametry\"\n# required_parameters: \"Required Parameters\"\n# optional_parameters: \"Optional Parameters\"\n returns: \"Vrac\u00ed\"\n granted_by: \"Poskytnutn\u00e9 od\"\n\n save_load:\n granularity_saved_games: \"Ulo\u017een\u00e9\"\n granularity_change_history: \"Historie\"\n\n options:\n general_options: \"Obecn\u00e9 nastaven\u00ed\" # Check out the Options tab in the Game Menu while playing a level\n volume_label: \"Hlasitost\"\n music_label: \"Hudba\"\n music_description: \"Vypnout\/zapnout hudbu v pozad\u00ed.\"\n editor_config_title: \"Konfigurace editoru\"\n editor_config_livecompletion_label: \"\u017div\u00e9 automatick\u00e9 dokon\u010dov\u00e1n\u00ed\"\n editor_config_livecompletion_description: \"Uk\u00e1\u017ee n\u00e1vrhy automatick\u00e9ho dopl\u0148ov\u00e1n\u00ed b\u011bhem psan\u00ed.\"\n editor_config_invisibles_label: \"Zobrazit neviditeln\u00e9\"\n editor_config_invisibles_description: \"Uk\u00e1\u017ee neviditeln\u00e9 jako mezery atd.\"\n editor_config_indentguides_label: \"Zobrazit odsazen\u00ed\"\n editor_config_indentguides_description: \"Uk\u00e1\u017ee vertik\u00e1ln\u00ed \u010d\u00e1ry pro jednoduch\u00e9 vid\u011bn\u00ed odsazen\u00ed.\"\n editor_config_behaviors_label: \"Chytr\u00e9 chov\u00e1n\u00ed\"\n editor_config_behaviors_description: \"Automaticky dopl\u0148ovat z\u00e1vorky a uvozovky.\"\n\n about:\n# learn_more: \"Learn More\"\n# main_title: \"If you want to learn to program, you need to write (a lot of) code.\"\n# main_description: \"At CodeCombat, our job is to make sure you're doing that with a smile on your face.\"\n# mission_link: \"Mission\"\n# team_link: \"Team\"\n# story_link: \"Story\"\n# press_link: \"Press\"\n# mission_title: \"Our mission: make programming accessible to every student on Earth.\"\n# mission_description_1: \"Programming is magic<\/strong>. It's the ability to create things from pure imagination. We started CodeCombat to give learners the feeling of wizardly power at their fingertips by using typed code<\/strong>.\"\n# mission_description_2: \"As it turns out, that enables them to learn faster too. WAY faster. It's like having a conversation instead of reading a manual. We want to bring that conversation to every school and to every student<\/strong>, because everyone should have the chance to learn the magic of programming.\"\n# team_title: \"Meet the CodeCombat team\"\n# team_values: \"We value open and respectful dialog, where the best idea wins. Our decisions are grounded in customer research and our process is focused on delivering tangible results for them. Everyone is hands-on, from our CEO to our GitHub contributors, because we value growth and learning in our team.\"\n nick_title: \"Program\u00e1tor\" # {change}\n matt_title: \"Program\u00e1tor\" # {change}\n# cat_title: \"Game Designer\"\n scott_title: \"Program\u00e1tor\" # {change}\n# maka_title: \"Customer Advocate\"\n# robin_title: \"Senior Product Manager\"\n# nolan_title: \"Sales Manager\"\n# lisa_title: \"Business Development Manager\"\n# sean_title: \"Territory Manager\"\n# liz_title: \"Territory Manager\"\n# jane_title: \"Customer Success Manager\"\n# david_title: \"Marketing Lead\"\n# retrostyle_title: \"Illustration\"\n retrostyle_blurb: \"RetroStyle Games\"\n# bryukh_title: \"Gameplay Developer\"\n# bryukh_blurb: \"Constructs puzzles\"\n# daniela_title: \"Content Crafter\"\n# daniela_blurb: \"Creates stories\"\n# community_title: \"...and our open-source community\"\n# community_subtitle: \"Over 500 contributors have helped build CodeCombat, with more joining every week!\"\n# community_description_3: \"CodeCombat is a\"\n# community_description_link_2: \"community project\"\n# community_description_1: \"with hundreds of players volunteering to create levels, contribute to our code to add features, fix bugs, playtest, and even translate the game into 50 languages so far. Employees, contributors and the site gain by sharing ideas and pooling effort, as does the open source community in general. The site is built on numerous open source projects, and we are open sourced to give back to the community and provide code-curious players a familiar project to explore and experiment with. Anyone can join the CodeCombat community! Check out our\"\n# community_description_link: \"contribute page\"\n# community_description_2: \"for more info.\"\n# number_contributors: \"Over 450 contributors have lent their support and time to this project.\"\n# story_title: \"Our story so far\"\n# story_subtitle: \"Since 2013, CodeCombat has grown from a mere set of sketches to a living, thriving game.\"\n# story_statistic_1a: \"5,000,000+\"\n# story_statistic_1b: \"total players\"\n# story_statistic_1c: \"have started their programming journey through CodeCombat\"\n# story_statistic_2a: \"We\u2019ve been translated into over 50 languages \u2014 our players hail from\"\n# story_statistic_2b: \"190+ countries\"\n# story_statistic_3a: \"Together, they have written\"\n# story_statistic_3b: \"1 billion lines of code and counting\"\n# story_statistic_3c: \"across many different programming languages\"\n# story_long_way_1: \"Though we've come a long way...\"\n# story_sketch_caption: \"Nick's very first sketch depicting a programming game in action.\"\n# story_long_way_2: \"we still have much to do before we complete our quest, so...\"\n# jobs_title: \"Come work with us and help write CodeCombat history!\"\n# jobs_subtitle: \"Don't see a good fit but interested in keeping in touch? See our \\\"Create Your Own\\\" listing.\"\n# jobs_benefits: \"Employee Benefits\"\n# jobs_benefit_4: \"Unlimited vacation\"\n# jobs_benefit_5: \"Professional development and continuing education support \u2013 free books and games!\"\n# jobs_benefit_6: \"Medical (gold), dental, vision, commuter, 401K\"\n# jobs_benefit_7: \"Sit-stand desks for all\"\n# jobs_benefit_9: \"10-year option exercise window\"\n# jobs_benefit_10: \"Maternity leave: 12 weeks paid, next 6 @ 55% salary\"\n# jobs_benefit_11: \"Paternity leave: 12 weeks paid\"\n# jobs_custom_title: \"Create Your Own\"\n# jobs_custom_description: \"Are you passionate about CodeCombat but don't see a job listed that matches your qualifications? Write us and show how you think you can contribute to our team. We'd love to hear from you!\"\n# jobs_custom_contact_1: \"Send us a note at\"\n# jobs_custom_contact_2: \"introducing yourself and we might get in touch in the future!\"\n# contact_title: \"Press & Contact\"\n# contact_subtitle: \"Need more information? Get in touch with us at\"\n# screenshots_title: \"Game Screenshots\"\n# screenshots_hint: \"(click to view full size)\"\n# downloads_title: \"Download Assets & Information\"\n# about_codecombat: \"About CodeCombat\"\n# logo: \"Logo\"\n# screenshots: \"Screenshots\"\n# character_art: \"Character Art\"\n# download_all: \"Download All\"\n# previous: \"Previous\"\n# location_title: \"We're located in downtown SF:\"\n\n# teachers:\n# licenses_needed: \"Licenses needed\"\n\n# special_offer:\n# special_offer: \"Special Offer\"\n# project_based_title: \"Project-Based Courses\"\n# project_based_description: \"Web and Game Development courses feature shareable final projects.\"\n# great_for_clubs_title: \"Great for clubs and electives\"\n# great_for_clubs_description: \"Teachers can purchase up to __maxQuantityStarterLicenses__ Starter Licenses.\" #\n# low_price_title: \"Just __starterLicensePrice__ per student\"\n# low_price_description: \"Starter Licenses are active for __starterLicenseLengthMonths__ months from purchase.\"\n# three_great_courses: \"Three great courses included in the Starter License:\"\n# license_limit_description: \"Teachers can purchase up to __maxQuantityStarterLicenses__ Starter Licenses. You have already purchased __quantityAlreadyPurchased__. If you need more, contact __supportEmail__. Starter Licenses are valid for __starterLicenseLengthMonths__ months.\"\n# student_starter_license: \"Student Starter License\"\n# purchase_starter_licenses: \"Purchase Starter Licenses\"\n# purchase_starter_licenses_to_grant: \"Purchase Starter Licenses to grant access to __starterLicenseCourseList__\"\n# starter_licenses_can_be_used: \"Starter Licenses can be used to assign additional courses immediately after purchase.\"\n# pay_now: \"Pay Now\"\n# we_accept_all_major_credit_cards: \"We accept all major credit cards.\"\n# cs2_description: \"builds on the foundation from Introduction to Computer Science, diving into if-statements, functions, events and more.\"\n# wd1_description: \"introduces the basics of HTML and CSS while teaching skills needed for students to build their first webpage.\"\n# gd1_description: \"uses syntax students are already familiar with to show them how to build and share their own playable game levels.\"\n# see_an_example_project: \"see an example project\"\n# get_started_today: \"Get started today!\"\n# want_all_the_courses: \"Want all the courses? Request information on our Full Licenses.\"\n# compare_license_types: \"Compare License Types:\"\n# cs: \"Computer Science\"\n# wd: \"Web Development\"\n# wd1: \"Web Development 1\"\n# gd: \"Game Development\"\n# gd1: \"Game Development 1\"\n# maximum_students: \"Maximum # of Students\"\n# unlimited: \"Unlimited\"\n# priority_support: \"Priority support\"\n# yes: \"Yes\"\n# price_per_student: \"__price__ per student\"\n# pricing: \"Pricing\"\n# free: \"Free\"\n# purchase: \"Purchase\"\n# courses_prefix: \"Courses\"\n# courses_suffix: \"\"\n# course_prefix: \"Course\"\n# course_suffix: \"\"\n\n# teachers_quote:\n# subtitle: \"Get your students started in less than an hour. You'll be able to create a class, add students, and monitor their progress<\/strong> as they learn computer science.\"\n# email_exists: \"User exists with this email.\"\n# phone_number: \"Phone number\"\n# phone_number_help: \"What's the best number to reach you?\"\n# primary_role_label: \"Your Primary Role\"\n# role_default: \"Select Role\"\n# primary_role_default: \"Select Primary Role\"\n# purchaser_role_default: \"Select Purchaser Role\"\n# tech_coordinator: \"Technology coordinator\"\n# advisor: \"Curriculum Specialist\/Advisor\"\n# principal: \"Principal\"\n# superintendent: \"Superintendent\"\n# parent: \"Parent\"\n# purchaser_role_label: \"Your Purchaser Role\"\n# influence_advocate: \"Influence\/Advocate\"\n# evaluate_recommend: \"Evaluate\/Recommend\"\n# approve_funds: \"Approve Funds\"\n# no_purchaser_role: \"No role in purchase decisions\"\n# district_label: \"District\"\n# district_name: \"District Name\"\n# district_na: \"Enter N\/A if not applicable\"\n# organization_label: \"School\"\n# school_name: \"School Name\"\n# city: \"City\"\n# state: \"State\"\n# country: \"Country\"\n# num_students_help: \"How many students will use CodeCombat?\"\n# num_students_default: \"Select Range\"\n# education_level_label: \"Education Level of Students\"\n# education_level_help: \"Choose as many as apply.\"\n# elementary_school: \"Elementary School\"\n# high_school: \"High School\"\n# please_explain: \"(please explain)\"\n# middle_school: \"Middle School\"\n# college_plus: \"College or higher\"\n# referrer: \"How did you hear about us?\"\n# referrer_help: \"For example: from another teacher, a conference, your students, Code.org, etc.\"\n# referrer_default: \"Select One\"\n# referrer_hoc: \"Code.org\/Hour of Code\"\n# referrer_teacher: \"A teacher\"\n# referrer_admin: \"An administrator\"\n# referrer_student: \"A student\"\n# referrer_pd: \"Professional trainings\/workshops\"\n# referrer_web: \"Google\"\n# referrer_other: \"Other\"\n# anything_else: \"What kind of class do you anticipate using CodeCombat for?\"\n# thanks_header: \"Request Received!\"\n# thanks_sub_header: \"Thanks for expressing interest in CodeCombat for your school.\"\n# thanks_p: \"We'll be in touch soon! If you need to get in contact, you can reach us at:\"\n# back_to_classes: \"Back to Classes\"\n# finish_signup: \"Finish creating your teacher account:\"\n# finish_signup_p: \"Create an account to set up a class, add your students, and monitor their progress as they learn computer science.\"\n# signup_with: \"Sign up with:\"\n# connect_with: \"Connect with:\"\n# conversion_warning: \"WARNING: Your current account is a Student Account<\/em>. Once you submit this form, your account will be updated to a Teacher Account.\"\n# learn_more_modal: \"Teacher accounts on CodeCombat have the ability to monitor student progress, assign licenses and manage classrooms. Teacher accounts cannot be a part of a classroom - if you are currently enrolled in a class using this account, you will no longer be able to access it once you update to a Teacher Account.\"\n# create_account: \"Create a Teacher Account\"\n# create_account_subtitle: \"Get access to teacher-only tools for using CodeCombat in the classroom. Set up a class<\/strong>, add your students, and monitor their progress<\/strong>!\"\n# convert_account_title: \"Update to Teacher Account\"\n# not: \"Not\"\n\n versions:\n save_version_title: \"Ulo\u017eit novou verzi\"\n new_major_version: \"Nov\u00e1 hlavn\u00ed verze\"\n submitting_patch: \"Odes\u00edl\u00e1n\u00ed opravy...\"\n cla_prefix: \"P\u0159ed ulo\u017een\u00edm mus\u00edte souhlasit s\"\n cla_url: \"licenc\u00ed\"\n cla_suffix: \".\"\n cla_agree: \"SOUHLAS\u00cdM\"\n owner_approve: \"Ne\u017e se va\u0161e zm\u011bny projev\u00ed, bude je muset schv\u00e1lit vlastn\u00edk.\"\n\n contact:\n contact_us: \"Konktujte CodeCombat\"\n welcome: \"R\u00e1di od v\u00e1s usly\u0161\u00edme. Pou\u017eijte tento formul\u00e1\u0159 pro odesl\u00e1n\u00ed emailu. \"\n forum_prefix: \"Pro ostatn\u00ed ve\u0159ejn\u00e9 v\u011bci, pros\u00edm zkuste \"\n forum_page: \"na\u0161e f\u00f3rum\"\n forum_suffix: \".\"\n faq_prefix: \"Tak\u00e9 m\u00e1me \"\n faq: \"FAQ\"\n subscribe_prefix: \"Pokud pot\u0159ebujete pomoc s n\u011bjakou \u00farovn\u00ed, pros\u00edm\"\n subscribe: \"zakupte si CodeCombat p\u0159edplatn\u00e9\"\n subscribe_suffix: \"a r\u00e1di v\u00e1m pom\u016f\u017eeme s va\u0161\u00edm k\u00f3dem.\"\n subscriber_support: \"Ji\u017e jste CodeCombat p\u0159edplatitel, tak\u017ee va\u0161e emaily budou vy\u0159\u00edzeny d\u0159\u00edve.\"\n screenshot_included: \"Sn\u00edmek obrazovky zahrnut.\"\n where_reply: \"Kam m\u00e1me odpov\u011bd\u011bt?\"\n send: \"Odeslat p\u0159ipom\u00ednku\"\n\n account_settings:\n title: \"Nastaven\u00ed \u00fa\u010dtu\"\n not_logged_in: \"P\u0159ihlaste se, nebo vytvo\u0159te si \u00fa\u010det pro ulo\u017een\u00ed nastaven\u00ed.\"\n me_tab: \"O mne\"\n picture_tab: \"Obr\u00e1zek\"\n delete_account_tab: \"Smazat v\u00e1\u0161 \u00fa\u010det\"\n wrong_email: \"\u0160patn\u00fd email\"\n wrong_password: \"Neplatn\u00e9 heslo\"\n delete_this_account: \"Smazat tento \u00fa\u010det natrvalo\"\n reset_progress_tab: \"Resetovat v\u0161echen postup\"\n reset_your_progress: \"Smazat v\u0161echen postup a za\u010d\u00edt znovu\"\n god_mode: \"God m\u00f3d\"\n emails_tab: \"Emaily\"\n admin: \"Admin\"\n manage_subscription: \"Klikn\u011bte zde ke spr\u00e1v\u011b va\u0161eho p\u0159edplatn\u00e9ho.\"\n new_password: \"Nov\u00e9 heslo\"\n new_password_verify: \"Potvrdit\"\n type_in_email: \"Zadejte sv\u016fj email nebo u\u017eivatelsk\u00e9 jm\u00e9no pro potvrzen\u00ed smaz\u00e1n\u00ed \u00fa\u010dtu.\"\n type_in_email_progress: \"Zadejte sv\u016fj email pro potvrzen\u00ed smaz\u00e1n\u00ed va\u0161eho postupu.\"\n type_in_password: \"A taky zadejte sv\u00e9 heslo.\"\n email_subscriptions: \"Odeb\u00edrat emailem\"\n email_subscriptions_none: \"\u017d\u00e1dn\u00e9 odeb\u00edr\u00e1n\u00ed emailem.\"\n email_announcements: \"Ozn\u00e1men\u00ed\"\n email_announcements_description: \"Zas\u00edlat emaily o posledn\u00edch novink\u00e1ch a o postupu ve v\u00fdvoji CodeCombat.\"\n email_notifications: \"Upozorn\u011bn\u00ed\"\n email_notifications_summary: \"Ovl\u00e1d\u00e1n\u00ed osobn\u00edch, automatick\u00fdch emailov\u00fdch upozorn\u011bn\u00ed o va\u0161\u00ed CodeCombat aktivit\u011b.\"\n email_any_notes: \"Jak\u00e9koliv upozorn\u011bn\u00ed\"\n email_any_notes_description: \"Vypn\u011bte pro zastaven\u00ed v\u0161ech email\u016f spojen\u00fdch s upozorn\u011bn\u00edmi o aktivit\u011b.\"\n email_news: \"Novinky\"\n email_recruit_notes: \"Pracovn\u00ed p\u0159\u00edle\u017eitosti\"\n email_recruit_notes_description: \"Pokud budete hr\u00e1t velmi dob\u0159e, m\u016f\u017eeme v\u00e1s kontaktovat a nab\u00eddnou v\u00e1m (lep\u0161\u00ed) pr\u00e1ci.\"\n contributor_emails: \"Emaily pro p\u0159isp\u00edvatele\"\n contribute_prefix: \"Hled\u00e1me dal\u0161\u00ed p\u0159isp\u00edvatele! \u010ct\u011bte pros\u00edm \"\n contribute_page: \"str\u00e1nku p\u0159isp\u00edvatel\u016fm\"\n contribute_suffix: \" pro v\u00edce informac\u00ed.\"\n email_toggle: \"Zvolit v\u0161e\"\n error_saving: \"Chyba p\u0159i ukl\u00e1d\u00e1n\u00ed\"\n saved: \"Zm\u011bny ulo\u017eeny\"\n password_mismatch: \"Hesla nesouhlas\u00ed.\"\n password_repeat: \"Opakujte pros\u00edm va\u0161e heslo.\"\n\n keyboard_shortcuts:\n keyboard_shortcuts: \"Kl\u00e1vesov\u00e9 zkratky\"\n space: \"Mezern\u00edk\"\n enter: \"Enter\"\n press_enter: \"zm\u00e1\u010dkn\u011bte enter\"\n escape: \"Escape\"\n shift: \"Shift\"\n run_code: \"Spustit sou\u010dasn\u00fd k\u00f3d.\"\n run_real_time: \"Spustit v re\u00e1ln\u00e9m \u010dase.\"\n continue_script: \"Pokra\u010dovat v sou\u010dasn\u00e9m skriptu.\"\n skip_scripts: \"P\u0159esko\u010dit v\u0161echny p\u0159esko\u010diteln\u00e9 skripty.\"\n toggle_playback: \"P\u0159epnout p\u0159ehr\u00e1v\u00e1n\u00ed\/pauzu.\"\n scrub_playback: \"Proch\u00e1zet zp\u011bt a vp\u0159ed skrz \u010das.\"\n single_scrub_playback: \"Proch\u00e1zet zp\u011bt a vp\u0159ed skrz \u010das po jednotliv\u00fdch sn\u00edmc\u00edche.\"\n scrub_execution: \"Proch\u00e1zet skrz st\u00e1vaj\u00edc\u00ed prov\u00e1d\u011bn\u00ed kouzla.\"\n toggle_debug: \"P\u0159epnout displej lad\u011bn\u00ed.\"\n toggle_grid: \"P\u0159epnout p\u0159ekryt\u00ed m\u0159\u00ed\u017ekou.\"\n toggle_pathfinding: \"P\u0159epnout p\u0159ekryt\u00ed nalez\u00e1n\u00ed cesty.\"\n beautify: \"Ud\u011blejte v\u00e1\u0161 kod hez\u010d\u00ed standardizov\u00e1n\u00edm jeho form\u00e1tu.\"\n maximize_editor: \"Maximalizovat\/minimalizovat editor k\u00f3du.\"\n\n community:\n main_title: \"CodeCombat Komunita\"\n introduction: \"Koukn\u011bte se na zp\u016fsoby, jak se m\u016f\u017eete zapojit n\u00ed\u017ee a rozhodn\u011bte se co v\u00e1m nejv\u00edce vyhovuje. T\u011b\u0161\u00edme se na pracov\u00e1n\u00ed s v\u00e1mi!\"\n level_editor_prefix: \"Pou\u017e\u00edt CodeCombat\"\n level_editor_suffix: \"pro vytvo\u0159en\u00ed a upraven\u00ed \u00farovn\u00ed. U\u017eivatel\u00e9 vytvo\u0159ili \u00farovn\u011b pro jejich t\u0159\u00eddy, p\u0159\u00e1tele, hackatony, studenty, a sourozence. Pokud se boj\u00edt vytv\u00e1\u0159en\u00ed nov\u00e9 \u00farovn\u011b, m\u016f\u017eete za\u010d\u00edt Klonov\u00e1n\u00edm jednoho z na\u0161ich!\"\n thang_editor_prefix: \"Jednotky ve h\u0159e naz\u00fdv\u00e1me 'thangy'. Pou\u017eij\"\n thang_editor_suffix: \"pro upraven\u00ed CodeCombat grafiky. Povol jednotk\u00e1m h\u00e1zet projektily, zm\u011b\u0148 sm\u011br animac\u00ed, zm\u011b\u0148 body z\u00e1sah\u016f jednotek nebo nahraj vlastn\u00ed grafick\u00e9 n\u00e1vrhy.\"\n article_editor_prefix: \"Vid\u00ed\u0161 n\u011bjakou chybu v na\u0161\u00ed dokumentaci? Chcete vytvo\u0159it instrukce pro vlastn\u00ed tvorbu? Pod\u00edvejte se na\"\n article_editor_suffix: \"a pomo\u017ete CodeCombat hr\u00e1\u010d\u016fm dostat co nejv\u00edce z jejich str\u00e1ven\u00e9ho \u010dasu.\"\n find_us: \"Najdete n\u00e1s na t\u011bchto str\u00e1nk\u00e1ch\"\n# social_github: \"Check out all our code on GitHub\"\n social_blog: \"P\u0159e\u010dt\u011bte si CodeCombat blog na Sett\"\n social_discource: \"Vstupte do diskuze na na\u0161em Discourse f\u00f3ru\"\n social_facebook: \"Dejte Like CodeCombat na Facebooku\"\n social_twitter: \"Sledujte CodeCombat na Twitteru\"\n social_gplus: \"P\u0159ipojte se k CodeCombat na Google+\"\n# social_slack: \"Chat with us in the public CodeCombat Slack channel\"\n contribute_to_the_project: \"P\u0159isp\u011bjte tomuto projektu\"\n\n clans:\n clan: \"Klan\"\n clans: \"Klany\"\n new_name: \"Jm\u00e9no nov\u00e9ho klanu\"\n new_description: \"Popis nov\u00e9ho klanu\"\n make_private: \"Ozna\u010dit jako soukrom\u00fd klan\"\n subs_only: \"Jenom p\u0159edplatitel\u00e9\"\n create_clan: \"Vytvo\u0159it nov\u00fd klan\"\n private_preview: \"N\u00e1hled\"\n private_clans: \"Soukrom\u00e9 klany\"\n public_clans: \"Ve\u0159ejn\u00e9 klany\"\n my_clans: \"Moje klany\"\n clan_name: \"Jm\u00e9no klanu\"\n name: \"Jm\u00e9no\"\n chieftain: \"V\u016fdce\"\n edit_clan_name: \"Upravit jm\u00e9no klanu\"\n edit_clan_description: \"Upravit popis klanu\"\n edit_name: \"upravit jm\u00e9no\"\n edit_description: \"upravit popis\"\n private: \"(soukrom\u00fd)\"\n summary: \"Shrnut\u00ed\"\n# average_level: \"Average Level\"\n# average_achievements: \"Average Achievements\"\n delete_clan: \"Smazat klan\"\n leave_clan: \"Opustit klan\"\n join_clan: \"Vstoupit do klanu\"\n invite_1: \"Pozvat:\"\n invite_2: \"*Za\u0161lete hr\u00e1\u010d\u016fm tento link a pozv\u011bte je do tohoto klanu.\"\n members: \"\u010clenov\u00e9\"\n# progress: \"Progress\"\n# not_started_1: \"not started\"\n# started_1: \"started\"\n# complete_1: \"complete\"\n# exp_levels: \"Expand levels\"\n# rem_hero: \"Remove Hero\"\n status: \"Status\"\n# complete_2: \"Complete\"\n# started_2: \"Started\"\n# not_started_2: \"Not Started\"\n view_solution: \"Klikni pro zobrazen\u00ed \u0159e\u0161en\u00ed.\"\n# view_attempt: \"Click to view attempt.\"\n# latest_achievement: \"Latest Achievement\"\n# playtime: \"Playtime\"\n# last_played: \"Last played\"\n# leagues_explanation: \"Play in a league against other clan members in these multiplayer arena instances.\"\n# track_concepts1: \"Track concepts\"\n# track_concepts2a: \"learned by each student\"\n# track_concepts2b: \"learned by each member\"\n# track_concepts3a: \"Track levels completed for each student\"\n# track_concepts3b: \"Track levels completed for each member\"\n# track_concepts4a: \"See your students'\"\n# track_concepts4b: \"See your members'\"\n track_concepts5: \"\u0159e\u0161en\u00ed\"\n# track_concepts6a: \"Sort students by name or progress\"\n# track_concepts6b: \"Sort members by name or progress\"\n# track_concepts7: \"Requires invitation\"\n# track_concepts8: \"to join\"\n# private_require_sub: \"Private clans require a subscription to create or join.\"\n\n courses:\n create_new_class: \"Vytvo\u0159it novou t\u0159\u00eddu\"\n# hoc_blurb1: \"Try the\"\n# hoc_blurb2: \"Code, Play, Share\"\n# hoc_blurb3: \"activity! Construct four different minigames to learn the basics of game development, then make your own!\"\n# solutions_require_licenses: \"Level solutions are available for teachers who have licenses.\"\n unnamed_class: \"Bezejmenn\u00e1 t\u0159\u00edda\"\n edit_settings1: \"Upravit nastaven\u00ed t\u0159\u00eddy\"\n add_students: \"P\u0159idat studenty\"\n stats: \"Statistika\"\n# student_email_invite_blurb: \"Your students can also use class code __classCode__<\/strong> when creating a Student Account, no email required.\"\n total_students: \"Po\u010det student\u016f:\"\n average_time: \"Pr\u016fm\u011brn\u00e1 doba hran\u00ed \u00farovn\u011b:\"\n total_time: \"Celkov\u00e1 doba hran\u00ed:\"\n average_levels: \"Pr\u016fm\u011brn\u00fd po\u010det spln\u011bn\u00fdch \u00farovn\u00ed:\"\n total_levels: \"Celkov\u00fd po\u010det spln\u011bn\u00fdch \u00farovn\u00ed:\"\n students: \"Studenti\"\n concepts: \"Koncepty\"\n play_time: \"Doba hran\u00ed:\"\n completed: \"Spln\u011bno:\"\n enter_emails: \"Odd\u011blte emailov\u00e9 adresy \u010d\u00e1rkou nebo nov\u00fdm \u0159\u00e1dkem\"\n send_invites: \"Pozvat studenty\"\n# number_programming_students: \"Number of Programming Students\"\n# number_total_students: \"Total Students in School\/District\"\n# enroll: \"Enroll\"\n# enroll_paid: \"Enroll Students in Paid Courses\"\n# get_enrollments: \"Get More Licenses\"\n# change_language: \"Change Course Language\"\n# keep_using: \"Keep Using\"\n# switch_to: \"Switch To\"\n# greetings: \"Greetings!\"\n back_classrooms: \"Zp\u011bt na moje t\u0159\u00eddy\"\n# back_classroom: \"Back to classroom\"\n back_courses: \"Zp\u011bt na moje kurzy\"\n# edit_details: \"Edit class details\"\n# purchase_enrollments: \"Purchase Student Licenses\"\n remove_student: \"odstranit studenta\"\n# assign: \"Assign\"\n# to_assign: \"to assign paid courses.\"\n student: \"Student\"\n teacher: \"U\u010ditel\"\n arena: \"Ar\u00e9na\"\n available_levels: \"Dostupn\u00e9 \u00farovn\u011b\"\n# started: \"started\"\n# complete: \"complete\"\n# practice: \"practice\"\n# required: \"required\"\n# welcome_to_courses: \"Adventurers, welcome to Courses!\"\n ready_to_play: \"P\u0159ipraven hr\u00e1t?\"\n start_new_game: \"Za\u010d\u00edt novou hru\"\n# play_now_learn_header: \"Play now to learn\"\n# play_now_learn_1: \"basic syntax to control your character\"\n# play_now_learn_2: \"while loops to solve pesky puzzles\"\n# play_now_learn_3: \"strings & variables to customize actions\"\n# play_now_learn_4: \"how to defeat an ogre (important life skills!)\"\n# welcome_to_page: \"My Student Dashboard\"\n# my_classes: \"Current Classes\"\n# class_added: \"Class successfully added!\"\n# view_levels: \"view all levels\"\n# view_project_gallery: \"view my classmates' projects\"\n# join_class: \"Join A Class\"\n# join_class_2: \"Join class\"\n# ask_teacher_for_code: \"Ask your teacher if you have a CodeCombat class code! If so, enter it below:\"\n# enter_c_code: \"\"\n# join: \"Join\"\n# joining: \"Joining class\"\n# course_complete: \"Course Complete\"\n# play_arena: \"Play Arena\"\n# view_project: \"View Project\"\n# start: \"Start\"\n# last_level: \"Last level played\"\n# not_you: \"Not you?\"\n# continue_playing: \"Continue Playing\"\n# option1_header: \"Invite Students by Email\"\n# remove_student1: \"Remove Student\"\n# are_you_sure: \"Are you sure you want to remove this student from this class?\"\n# remove_description1: \"Student will lose access to this classroom and assigned classes. Progress and gameplay is NOT lost, and the student can be added back to the classroom at any time.\"\n# remove_description2: \"The activated paid license will not be returned.\"\n# license_will_revoke: \"This student's paid license will be revoked and made available to assign to another student.\"\n# keep_student: \"Keep Student\"\n# removing_user: \"Removing user\"\n# subtitle: \"Review course overviews and levels\" # Flat style redesign\n# changelog: \"View latest changes to course levels.\"\n# select_language: \"Select language\"\n# select_level: \"Select level\"\n# play_level: \"Play Level\"\n# concepts_covered: \"Concepts covered\"\n# view_guide_online: \"Level Overviews and Solutions\"\n# grants_lifetime_access: \"Grants access to all Courses.\"\n# enrollment_credits_available: \"Licenses Available:\"\n# language_select: \"Select a language\" # ClassroomSettingsModal\n# language_cannot_change: \"Language cannot be changed once students join a class.\"\n# avg_student_exp_label: \"Average Student Programming Experience\"\n# avg_student_exp_desc: \"This will help us understand how to pace courses better.\"\n# avg_student_exp_select: \"Select the best option\"\n# avg_student_exp_none: \"No Experience - little to no experience\"\n# avg_student_exp_beginner: \"Beginner - some exposure or block-based\"\n# avg_student_exp_intermediate: \"Intermediate - some experience with typed code\"\n# avg_student_exp_advanced: \"Advanced - extensive experience with typed code\"\n# avg_student_exp_varied: \"Varied Levels of Experience\"\n# student_age_range_label: \"Student Age Range\"\n# student_age_range_younger: \"Younger than 6\"\n# student_age_range_older: \"Older than 18\"\n# student_age_range_to: \"to\"\n# create_class: \"Create Class\"\n# class_name: \"Class Name\"\n# teacher_account_restricted: \"Your account is a teacher account and cannot access student content.\"\n# account_restricted: \"A student account is required to access this page.\"\n# update_account_login_title: \"Log in to update your account\"\n# update_account_title: \"Your account needs attention!\"\n# update_account_blurb: \"Before you can access your classes, choose how you want to use this account.\"\n# update_account_current_type: \"Current Account Type:\"\n# update_account_account_email: \"Account Email\/Username:\"\n# update_account_am_teacher: \"I am a teacher\"\n# update_account_keep_access: \"Keep access to classes I've created\"\n# update_account_teachers_can: \"Teacher accounts can:\"\n# update_account_teachers_can1: \"Create\/manage\/add classes\"\n# update_account_teachers_can2: \"Assign\/enroll students in courses\"\n# update_account_teachers_can3: \"Unlock all course levels to try out\"\n# update_account_teachers_can4: \"Access new teacher-only features as we release them\"\n# update_account_teachers_warning: \"Warning: You will be removed from all classes that you have previously joined and will not be able to play as a student.\"\n# update_account_remain_teacher: \"Remain a Teacher\"\n# update_account_update_teacher: \"Update to Teacher\"\n# update_account_am_student: \"I am a student\"\n# update_account_remove_access: \"Remove access to classes I have created\"\n# update_account_students_can: \"Student accounts can:\"\n# update_account_students_can1: \"Join classes\"\n# update_account_students_can2: \"Play through courses as a student and track your own progress\"\n# update_account_students_can3: \"Compete against classmates in arenas\"\n# update_account_students_can4: \"Access new student-only features as we release them\"\n# update_account_students_warning: \"Warning: You will not be able to manage any classes that you have previously created or create new classes.\"\n# unsubscribe_warning: \"Warning: You will be unsubscribed from your monthly subscription.\"\n# update_account_remain_student: \"Remain a Student\"\n# update_account_update_student: \"Update to Student\"\n# need_a_class_code: \"You'll need a Class Code for the class you're joining:\"\n# update_account_not_sure: \"Not sure which one to choose? Email\"\n# update_account_confirm_update_student: \"Are you sure you want to update your account to a Student experience?\"\n# update_account_confirm_update_student2: \"You will not be able to manage any classes that you have previously created or create new classes. Your previously created classes will be removed from CodeCombat and cannot be restored.\"\n# instructor: \"Instructor: \"\n# youve_been_invited_1: \"You've been invited to join \"\n# youve_been_invited_2: \", where you'll learn \"\n# youve_been_invited_3: \" with your classmates in CodeCombat.\"\n# by_joining_1: \"By joining \"\n# by_joining_2: \"will be able to help reset your password if you forget or lose it. You can also verify your email address so that you can reset the password yourself!\"\n# sent_verification: \"We've sent a verification email to:\"\n# you_can_edit: \"You can edit your email address in \"\n# account_settings: \"Account Settings\"\n# select_your_hero: \"Select Your Hero\"\n# select_your_hero_description: \"You can always change your hero by going to your Courses page and clicking \\\"Change Hero\\\"\"\n# select_this_hero: \"Select this Hero\"\n# current_hero: \"Current Hero:\"\n# current_hero_female: \"Current Hero:\"\n# web_dev_language_transition: \"All classes program in HTML \/ JavaScript for this course. Classes that have been using Python will start with extra JavaScript intro levels to ease the transition. Classes that are already using JavaScript will skip the intro levels.\"\n# course_membership_required_to_play: \"You'll need to join a course to play this level.\"\n# license_required_to_play: \"Ask your teacher to assign a license to you so you can continue to play CodeCombat!\"\n# update_old_classroom: \"New school year, new levels!\"\n# update_old_classroom_detail: \"To make sure you're getting the most up-to-date levels, make sure you create a new class for this semester by clicking Create a New Class on your\"\n# teacher_dashboard: \"teacher dashboard\"\n# update_old_classroom_detail_2: \"and giving students the new Class Code that appears.\"\n# view_assessments: \"View Assessments\"\n# view_challenges: \"view challenge levels\"\n# challenge: \"Challenge:\"\n# challenge_level: \"Challenge Level:\"\n# status: \"Status:\"\n# assessments: \"Assessments\"\n# challenges: \"Challenges\"\n# level_name: \"Level Name:\"\n# keep_trying: \"Keep Trying\"\n# start_challenge: \"Start Challenge\"\n# locked: \"Locked\"\n# concepts_used: \"Concepts Used:\"\n# show_change_log: \"Show changes to this course's levels\"\n# hide_change_log: \"Hide changes to this course's levels\"\n\n# project_gallery:\n# no_projects_published: \"Be the first to publish a project in this course!\"\n# view_project: \"View Project\"\n# edit_project: \"Edit Project\"\n\n# teacher:\n# assigning_course: \"Assigning course\"\n# back_to_top: \"Back to Top\"\n# click_student_code: \"Click on any level that the student has started or completed below to view the code they wrote.\"\n# code: \"__name__'s Code\"\n# complete_solution: \"Complete Solution\"\n# course_not_started: \"Student has not started this course yet.\"\n# hoc_happy_ed_week: \"Happy Computer Science Education Week!\"\n# hoc_blurb1: \"Learn about the free\"\n# hoc_blurb2: \"Code, Play, Share\"\n# hoc_blurb3: \"activity, download a new teacher lesson plan, and tell your students to log in to play!\"\n# hoc_button_text: \"View Activity\"\n# no_code_yet: \"Student has not written any code for this level yet.\"\n# open_ended_level: \"Open-Ended Level\"\n# partial_solution: \"Partial Solution\"\n# removing_course: \"Removing course\"\n# solution_arena_blurb: \"Students are encouraged to solve arena levels creatively. The solution provided below meets the requirements of the arena level.\"\n# solution_challenge_blurb: \"Students are encouraged to solve open-ended challenge levels creatively. One possible solution is displayed below.\"\n# solution_project_blurb: \"Students are encouraged to build a creative project in this level. Please refer to curriculum guides in the Resource Hub for information on how to evaluate these projects.\"\n# students_code_blurb: \"A correct solution to each level is provided where appropriate. In some cases, it\u2019s possible for a student to solve a level using different code. Solutions are not shown for levels the student has not started.\"\n# course_solution: \"Course Solution\"\n# level_overview_solutions: \"Level Overview and Solutions\"\n# no_student_assigned: \"No students have been assigned this course.\"\n# paren_new: \"(new)\"\n# student_code: \"__name__'s Student Code\"\n# teacher_dashboard: \"Teacher Dashboard\" # Navbar\n# my_classes: \"My Classes\"\n# courses: \"Course Guides\"\n# enrollments: \"Student Licenses\"\n# resources: \"Resources\"\n# help: \"Help\"\n# language: \"Language\"\n# edit_class_settings: \"edit class settings\"\n# access_restricted: \"Account Update Required\"\n# teacher_account_required: \"A teacher account is required to access this content.\"\n# create_teacher_account: \"Create Teacher Account\"\n# what_is_a_teacher_account: \"What's a Teacher Account?\"\n# teacher_account_explanation: \"A CodeCombat Teacher account allows you to set up classrooms, monitor students\u2019 progress as they work through courses, manage licenses and access resources to aid in your curriculum-building.\"\n# current_classes: \"Current Classes\"\n# archived_classes: \"Archived Classes\"\n# archived_classes_blurb: \"Classes can be archived for future reference. Unarchive a class to view it in the Current Classes list again.\"\n# view_class: \"view class\"\n# archive_class: \"archive class\"\n# unarchive_class: \"unarchive class\"\n# unarchive_this_class: \"Unarchive this class\"\n# no_students_yet: \"This class has no students yet.\"\n# no_students_yet_view_class: \"View class to add students.\"\n# try_refreshing: \"(You may need to refresh the page)\"\n# create_new_class: \"Create a New Class\"\n# class_overview: \"Class Overview\" # View Class page\n# avg_playtime: \"Average level playtime\"\n# total_playtime: \"Total play time\"\n# avg_completed: \"Average levels completed\"\n# total_completed: \"Total levels completed\"\n# created: \"Created\"\n# concepts_covered: \"Concepts covered\"\n# earliest_incomplete: \"Earliest incomplete level\"\n# latest_complete: \"Latest completed level\"\n# enroll_student: \"Enroll student\"\n# apply_license: \"Apply License\"\n# revoke_license: \"Revoke License\"\n# revoke_licenses: \"Revoke All Licenses\"\n# course_progress: \"Course Progress\"\n# not_applicable: \"N\/A\"\n# edit: \"edit\"\n# edit_2: \"Edit\"\n# remove: \"remove\"\n# latest_completed: \"Latest completed:\"\n# sort_by: \"Sort by\"\n# progress: \"Progress\"\n# concepts_used: \"Concepts used by Student:\"\n# concept_checked: \"Concept checked:\"\n# completed: \"Completed\"\n# practice: \"Practice\"\n# started: \"Started\"\n# no_progress: \"No progress\"\n# not_required: \"Not required\"\n# view_student_code: \"Click to view student code\"\n# select_course: \"Select course to view\"\n# progress_color_key: \"Progress color key:\"\n# level_in_progress: \"Level in Progress\"\n# level_not_started: \"Level Not Started\"\n# project_or_arena: \"Project or Arena\"\n# students_not_assigned: \"Students who have not been assigned {{courseName}}\"\n# course_overview: \"Course Overview\"\n# copy_class_code: \"Copy Class Code\"\n# class_code_blurb: \"Students can join your class using this Class Code. No email address is required when creating a Student account with this Class Code.\"\n# copy_class_url: \"Copy Class URL\"\n# class_join_url_blurb: \"You can also post this unique class URL to a shared webpage.\"\n# add_students_manually: \"Invite Students by Email\"\n# bulk_assign: \"Select course\"\n# assigned_msg_1: \"{{numberAssigned}} students were assigned {{courseName}}.\"\n# assigned_msg_2: \"{{numberEnrolled}} licenses were applied.\"\n# assigned_msg_3: \"You now have {{remainingSpots}} available licenses remaining.\"\n# assign_course: \"Assign Course\"\n# removed_course_msg: \"{{numberRemoved}} students were removed from {{courseName}}.\"\n# remove_course: \"Remove Course\"\n# not_assigned_modal_title: \"Courses were not assigned\"\n# not_assigned_modal_starter_body_1: \"This course requires a Starter License. You do not have enough Starter Licenses available to assign this course to all __selected__ selected students.\"\n# not_assigned_modal_starter_body_2: \"Purchase Starter Licenses to grant access to this course.\"\n# not_assigned_modal_full_body_1: \"This course requires a Full License. You do not have enough Full Licenses available to assign this course to all __selected__ selected students.\"\n# not_assigned_modal_full_body_2: \"You only have __numFullLicensesAvailable__ Full Licenses available (__numStudentsWithoutFullLicenses__ students do not currently have a Full License active).\"\n# not_assigned_modal_full_body_3: \"Please select fewer students, or reach out to __supportEmail__ for assistance.\"\n# assigned: \"Assigned\"\n# enroll_selected_students: \"Enroll Selected Students\"\n# no_students_selected: \"No students were selected.\"\n# show_students_from: \"Show students from\" # Enroll students modal\n# apply_licenses_to_the_following_students: \"Apply Licenses to the Following Students\"\n# students_have_licenses: \"The following students already have licenses applied:\"\n# all_students: \"All Students\"\n# apply_licenses: \"Apply Licenses\"\n# not_enough_enrollments: \"Not enough licenses available.\"\n# enrollments_blurb: \"Students are required to have a license to access any content after the first course.\"\n# how_to_apply_licenses: \"How to Apply Licenses\"\n# export_student_progress: \"Export Student Progress (CSV)\"\n# send_email_to: \"Send Recover Password Email to:\"\n# email_sent: \"Email sent\"\n# send_recovery_email: \"Send recovery email\"\n# enter_new_password_below: \"Enter new password below:\"\n# change_password: \"Change Password\"\n# changed: \"Changed\"\n# available_credits: \"Available Licenses\"\n# pending_credits: \"Pending Licenses\"\n# empty_credits: \"Exhausted Licenses\"\n# license_remaining: \"license remaining\"\n# licenses_remaining: \"licenses remaining\"\n# one_license_used: \"1 out of __totalLicenses__ licenses has been used\"\n# num_licenses_used: \"__numLicensesUsed__ out of __totalLicenses__ licenses have been used\"\n# starter_licenses: \"starter licenses\"\n# start_date: \"start date:\"\n# end_date: \"end date:\"\n# get_enrollments_blurb: \" We'll help you build a solution that meets the needs of your class, school or district.\"\n# how_to_apply_licenses_blurb_1: \"When a teacher assigns a course to a student for the first time, we\u2019ll automatically apply a license. Use the bulk-assign dropdown in your classroom to assign a course to selected students:\"\n# how_to_apply_licenses_blurb_2: \"Can I still apply a license without assigning a course?\"\n# how_to_apply_licenses_blurb_3: \"Yes \u2014 go to the License Status tab in your classroom and click \\\"Apply License\\\" to any student who does not have an active license.\"\n# request_sent: \"Request Sent!\"\n# assessments: \"Assessments\"\n# license_status: \"License Status\"\n# status_expired: \"Expired on {{date}}\"\n# status_not_enrolled: \"Not Enrolled\"\n# status_enrolled: \"Expires on {{date}}\"\n# select_all: \"Select All\"\n# project: \"Project\"\n# project_gallery: \"Project Gallery\"\n# view_project: \"View Project\"\n# unpublished: \"(unpublished)\"\n# view_arena_ladder: \"View Arena Ladder\"\n# resource_hub: \"Resource Hub\"\n# pacing_guides: \"Classroom-in-a-Box Pacing Guides\"\n# pacing_guides_desc: \"Learn how to incorporate all of CodeCombat's resources to plan your school year!\"\n# pacing_guides_elem: \"Elementary School Pacing Guide\"\n# pacing_guides_middle: \"Middle School Pacing Guide\"\n# pacing_guides_high: \"High School Pacing Guide\"\n# getting_started: \"Getting Started\"\n# educator_faq: \"Educator FAQ\"\n# educator_faq_desc: \"Frequently asked questions about using CodeCombat in your classroom or school.\"\n# teacher_getting_started: \"Teacher Getting Started Guide\"\n# teacher_getting_started_desc: \"New to CodeCombat? Download this Teacher Getting Started Guide to set up your account, create your first class, and invite students to the first course.\"\n# student_getting_started: \"Student Quick Start Guide\"\n# student_getting_started_desc: \"You can distribute this guide to your students before starting CodeCombat so that they can familiarize themselves with the code editor. This guide can be used for both Python and JavaScript classrooms.\"\n# ap_cs_principles: \"AP Computer Science Principles\"\n# ap_cs_principles_desc: \"AP Computer Science Principles gives students a broad introduction to the power, impact, and possibilities of Computer Science. The course emphasizes computational thinking and problem solving while also teaching the basics of programming.\"\n# cs1: \"Introduction to Computer Science\"\n# cs2: \"Computer Science 2\"\n# cs3: \"Computer Science 3\"\n# cs4: \"Computer Science 4\"\n# cs5: \"Computer Science 5\"\n# cs1_syntax_python: \"Course 1 Python Syntax Guide\"\n# cs1_syntax_python_desc: \"Cheatsheet with references to common Python syntax that students will learn in Introduction to Computer Science.\"\n# cs1_syntax_javascript: \"Course 1 JavaScript Syntax Guide\"\n# cs1_syntax_javascript_desc: \"Cheatsheet with references to common JavaScript syntax that students will learn in Introduction to Computer Science.\"\n# coming_soon: \"Additional guides coming soon!\"\n# engineering_cycle_worksheet: \"Engineering Cycle Worksheet\"\n# engineering_cycle_worksheet_desc: \"Use this worksheet to teach students the basics of the engineering cycle: Assess, Design, Implement and Debug. Refer to the completed example worksheet as a guide.\"\n# engineering_cycle_worksheet_link: \"View example\"\n# progress_journal: \"Progress Journal\"\n# progress_journal_desc: \"Encourage students to keep track of their progress via a progress journal.\"\n# cs1_curriculum: \"Introduction to Computer Science - Curriculum Guide\"\n# cs1_curriculum_desc: \"Scope and sequence, lesson plans, activities and more for Course 1.\"\n# arenas_curriculum: \"Arena Levels - Teacher Guide\"\n# arenas_curriculum_desc: \"Instructions on how to run Wakka Maul, Cross Bones and Power Peak multiplayer arenas with your class.\"\n# cs2_curriculum: \"Computer Science 2 - Curriculum Guide\"\n# cs2_curriculum_desc: \"Scope and sequence, lesson plans, activities and more for Course 2.\"\n# cs3_curriculum: \"Computer Science 3 - Curriculum Guide\"\n# cs3_curriculum_desc: \"Scope and sequence, lesson plans, activities and more for Course 3.\"\n# cs4_curriculum: \"Computer Science 4 - Curriculum Guide\"\n# cs4_curriculum_desc: \"Scope and sequence, lesson plans, activities and more for Course 4.\"\n# cs5_curriculum_js: \"Computer Science 5 - Curriculum Guide (JavaScript)\"\n# cs5_curriculum_desc_js: \"Scope and sequence, lesson plans, activities and more for Course 5 classes using JavaScript.\"\n# cs5_curriculum_py: \"Computer Science 5 - Curriculum Guide (Python)\"\n# cs5_curriculum_desc_py: \"Scope and sequence, lesson plans, activities and more for Course 5 classes using Python.\"\n# cs1_pairprogramming: \"Pair Programming Activity\"\n# cs1_pairprogramming_desc: \"Introduce students to a pair programming exercise that will help them become better listeners and communicators.\"\n# gd1: \"Game Development 1\"\n# gd1_guide: \"Game Development 1 - Project Guide\"\n# gd1_guide_desc: \"Use this to guide your students as they create their first shareable game project in 5 days.\"\n# gd1_rubric: \"Game Development 1 - Project Rubric\"\n# gd1_rubric_desc: \"Use this rubric to assess student projects at the end of Game Development 1.\"\n# gd2: \"Game Development 2\"\n# gd2_curriculum: \"Game Development 2 - Curriculum Guide\"\n# gd2_curriculum_desc: \"Lesson plans for Game Development 2.\"\n# gd3: \"Game Development 3\"\n# gd3_curriculum: \"Game Development 3 - Curriculum Guide\"\n# gd3_curriculum_desc: \"Lesson plans for Game Development 3.\"\n# wd1: \"Web Development 1\"\n# wd1_curriculum: \"Web Development 1 - Curriculum Guide\"\n# wd1_curriculum_desc: \"Lesson plans for Web Development 1.\"\n# wd1_headlines: \"Headlines & Headers Activity\"\n# wd1_headlines_example: \"View sample solution\"\n# wd1_headlines_desc: \"Why are paragraph and header tags important? Use this activity to show how well-chosen headers make web pages easier to read. There are many correct solutions to this!\"\n# wd1_html_syntax: \"HTML Syntax Guide\"\n# wd1_html_syntax_desc: \"One-page reference for the HTML style students will learn in Web Development 1.\"\n# wd1_css_syntax: \"CSS Syntax Guide\"\n# wd1_css_syntax_desc: \"One-page reference for the CSS and Style syntax students will learn in Web Development 1.\"\n# wd2: \"Web Development 2\"\n# wd2_jquery_syntax: \"jQuery Functions Syntax Guide\"\n# wd2_jquery_syntax_desc: \"One-page reference for the jQuery functions students will learn in Web Development 2.\"\n# wd2_quizlet_worksheet: \"Quizlet Planning Worksheet\"\n# wd2_quizlet_worksheet_instructions: \"View instructions & examples\"\n# wd2_quizlet_worksheet_desc: \"Before your students build their personality quiz project at the end of Web Development 2, they should plan out their quiz questions, outcomes and responses using this worksheet. Teachers can distribute the instructions and examples for students to refer to.\"\n# student_overview: \"Overview\"\n# student_details: \"Student Details\"\n# student_name: \"Student Name\"\n# no_name: \"No name provided.\"\n# no_username: \"No username provided.\"\n# no_email: \"Student has no email address set.\"\n# student_profile: \"Student Profile\"\n# playtime_detail: \"Playtime Detail\"\n# student_completed: \"Student Completed\"\n# student_in_progress: \"Student in Progress\"\n# class_average: \"Class Average\"\n# not_assigned: \"has not been assigned the following courses\"\n# playtime_axis: \"Playtime in Seconds\"\n# levels_axis: \"Levels in\"\n# student_state: \"How is\"\n# student_state_2: \"doing?\"\n# student_good: \"is doing well in\"\n# student_good_detail: \"This student is keeping pace with the class.\"\n# student_warn: \"might need some help in\"\n# student_warn_detail: \"This student might need some help with new concepts that have been introduced in this course.\"\n# student_great: \"is doing great in\"\n# student_great_detail: \"This student might be a good candidate to help other students working through this course.\"\n# full_license: \"Full License\"\n# starter_license: \"Starter License\"\n# trial: \"Trial\"\n# hoc_welcome: \"Happy Computer Science Education Week\"\n# hoc_intro: \"There are three ways for your class to participate in Hour of Code with CodeCombat\"\n# hoc_self_led: \"Self-Led Gameplay\"\n# hoc_self_led_desc: \"Students can play through two Hour of Code CodeCombat tutorials on their own\"\n# hoc_game_dev: \"Game Development\"\n# hoc_and: \"and\"\n# hoc_programming: \"JavaScript\/Python Programming\"\n# hoc_teacher_led: \"Teacher-Led Lessons\"\n# hoc_teacher_led_desc1: \"Download our\"\n# hoc_teacher_led_link: \"Introduction to Computer Science lesson plans\"\n# hoc_teacher_led_desc2: \"to introduce your students to programming concepts using offline activities\"\n# hoc_group: \"Group Gameplay\"\n# hoc_group_desc_1: \"Teachers can use the lessons in conjunction with our Introduction to Computer Science course to track student progress. See our\"\n# hoc_group_link: \"Getting Started Guide\"\n# hoc_group_desc_2: \"for more details\"\n# hoc_additional_desc1: \"For additional CodeCombat resources and activities, see our\"\n# hoc_additional_desc2: \"Questions\"\n# hoc_additional_contact: \"Get in touch\"\n# revoke_confirm: \"Are you sure you want to revoke a Full License from {{student_name}}? The license will become available to assign to another student.\"\n# revoke_all_confirm: \"Are you sure you want to revoke Full Licenses from all students in this class?\"\n# revoking: \"Revoking...\"\n# unused_licenses: \"You have unused Licenses that allow you to assign students paid courses when they're ready to learn more!\"\n# remember_new_courses: \"Remember to assign new courses!\"\n# more_info: \"More Info\"\n# how_to_assign_courses: \"How to Assign Courses\"\n# select_students: \"Select Students\"\n# select_instructions: \"Click the checkbox next to each student you want to assign courses to.\"\n# choose_course: \"Choose Course\"\n# choose_instructions: \"Select the course from the dropdown menu you\u2019d like to assign, then click \u201cAssign to Selected Students.\u201d\"\n# push_projects: \"We recommend assigning Web Development 1 or Game Development 1 after students have finished Introduction to Computer Science! See our {{resource_hub}} for more details on those courses.\"\n# teacher_quest: \"Teacher's Quest for Success\"\n# quests_complete: \"Quests Complete\"\n# teacher_quest_create_classroom: \"Create Classroom\"\n# teacher_quest_add_students: \"Add Students\"\n# teacher_quest_teach_methods: \"Help your students learn how to `call methods`.\"\n# teacher_quest_teach_methods_step1: \"Get 75% of at least one class through the first level, __Dungeons of Kithgard__\"\n# teacher_quest_teach_methods_step2: \"Print out the [Student Quick Start Guide](http:\/\/files.codecombat.com\/docs\/resources\/StudentQuickStartGuide.pdf) in the Resource Hub.\"\n# teacher_quest_teach_strings: \"Don't string your students along, teach them `strings`.\"\n# teacher_quest_teach_strings_step1: \"Get 75% of at least one class through __True Names__\"\n# teacher_quest_teach_strings_step2: \"Use the Teacher Level Selector on [Course Guides](\/teachers\/courses) page to preview __True Names__.\"\n# teacher_quest_teach_loops: \"Keep your students in the loop about `loops`.\"\n# teacher_quest_teach_loops_step1: \"Get 75% of at least one class through __Fire Dancing__.\"\n# teacher_quest_teach_loops_step2: \"Use the __Loops Activity__ in the [CS1 Curriculum guide](\/teachers\/resources\/cs1) to reinforce this concept.\"\n# teacher_quest_teach_variables: \"Vary it up with `variables`.\"\n# teacher_quest_teach_variables_step1: \"Get 75% of at least one class through __Known Enemy__.\"\n# teacher_quest_teach_variables_step2: \"Encourage collaboration by using the [Pair Programming Activity](\/teachers\/resources\/pair-programming).\"\n# teacher_quest_kithgard_gates_100: \"Escape the Kithgard Gates with your class.\"\n# teacher_quest_kithgard_gates_100_step1: \"Get 75% of at least one class through __Kithgard Gates__.\"\n# teacher_quest_kithgard_gates_100_step2: \"Guide students to think through hard problems using the [Engineering Cycle Worksheet](http:\/\/files.codecombat.com\/docs\/resources\/EngineeringCycleWorksheet.pdf).\"\n# teacher_quest_wakka_maul_100: \"Prepare to duel in Wakka Maul.\"\n# teacher_quest_wakka_maul_100_step1: \"Get 75% of at least one class to __Wakka Maul__.\"\n# teacher_quest_wakka_maul_100_step2: \"See the [Arena Guide](\/teachers\/resources\/arenas) in the [Resource Hub](\/teachers\/resources) for tips on how to run a successful arena day.\"\n# teacher_quest_reach_gamedev: \"Explore new worlds!\"\n# teacher_quest_reach_gamedev_step1: \"[Get licenses](\/teachers\/licenses) so that your students can explore new worlds, like Game Development and Web Development!\"\n# teacher_quest_done: \"Want your students to learn even more code? Get in touch with our [school specialists](mailto:schools@codecombat.com) today!\"\n# teacher_quest_keep_going: \"Keep going! Here's what you can do next:\"\n# teacher_quest_more: \"See all quests\"\n# teacher_quest_less: \"See fewer quests\"\n# refresh_to_update: \"(refresh the page to see updates)\"\n# view_project_gallery: \"View Project Gallery\"\n# office_hours: \"Teacher Webinars\"\n# office_hours_detail: \"Learn how to keep up with with your students as they create games and embark on their coding journey! Come and attend our\"\n# office_hours_link: \"teacher webinar\"\n# office_hours_detail_2: \"sessions.\"\n# success: \"Success\"\n# in_progress: \"In Progress\"\n# not_started: \"Not Started\"\n# mid_course: \"Mid-Course\"\n# end_course: \"End of Course\"\n# none: \"None detected yet\"\n# explain_open_ended: \"Note: Students are encouraged to solve this level creatively \u2014 one possible solution is provided below.\"\n# level_label: \"Level:\"\n# time_played_label: \"Time Played:\"\n# back_to_resource_hub: \"Back to Resource Hub\"\n# back_to_course_guides: \"Back to Course Guides\"\n# print_guide: \"Print this guide\"\n# combo: \"Combo\"\n# combo_explanation: \"Students pass Combo challenge levels by using at least one listed concept. Review student code by clicking the progress dot.\"\n# concept: \"Concept\"\n\n# share_licenses:\n# share_licenses: \"Share Licenses\"\n# shared_by: \"Shared By:\"\n# add_teacher_label: \"Enter exact teacher email:\"\n# add_teacher_button: \"Add Teacher\"\n# subheader: \"You can make your licenses available to other teachers in your organization. Each license can only be used for one student at a time.\"\n# teacher_not_found: \"Teacher not found. Please make sure this teacher has already created a Teacher Account.\"\n# teacher_not_valid: \"This is not a valid Teacher Account. Only teacher accounts can share licenses.\"\n# already_shared: \"You've already shared these licenses with that teacher.\"\n# teachers_using_these: \"Teachers who can access these licenses:\"\n# footer: \"When teachers revoke licenses from students, the licenses will be returned to the shared pool for other teachers in this group to use.\"\n# you: \"(you)\"\n# one_license_used: \"(1 license used)\"\n# licenses_used: \"(__licensesUsed__ licenses used)\"\n# more_info: \"More info\"\n\n# sharing:\n# game: \"Game\"\n# webpage: \"Webpage\"\n# your_students_preview: \"Your students will click here to see their finished projects! Unavailable in teacher preview.\"\n# unavailable: \"Link sharing not available in teacher preview.\"\n# share_game: \"Share This Game\"\n# share_web: \"Share This Webpage\"\n# victory_share_prefix: \"Share this link to invite your friends & family to\"\n# victory_share_prefix_short: \"Invite people to\"\n# victory_share_game: \"play your game level\"\n# victory_share_web: \"view your webpage\"\n# victory_share_suffix: \".\"\n# victory_course_share_prefix: \"This link will let your friends & family\"\n# victory_course_share_game: \"play the game\"\n# victory_course_share_web: \"view the webpage\"\n# victory_course_share_suffix: \"you just created.\"\n# copy_url: \"Copy URL\"\n# share_with_teacher_email: \"Send to your teacher\"\n\n# game_dev:\n# creator: \"Creator\"\n\n# web_dev:\n# image_gallery_title: \"Image Gallery\"\n# select_an_image: \"Select an image you want to use\"\n# scroll_down_for_more_images: \"(Scroll down for more images)\"\n# copy_the_url: \"Copy the URL below\"\n# copy_the_url_description: \"Useful if you want to replace an existing image.\"\n# copy_the_img_tag: \"Copy the tag\"\n# copy_the_img_tag_description: \"Useful if you want to insert a new image.\"\n# copy_url: \"Copy URL\"\n# copy_img: \"Copy \"\n# how_to_copy_paste: \"How to Copy\/Paste\"\n# copy: \"Copy\"\n# paste: \"Paste\"\n# back_to_editing: \"Back to Editing\"\n\n classes:\n archmage_title: \"Arcikouzeln\u00edk\"\n archmage_title_description: \"(Program\u00e1tor)\"\n archmage_summary: \"Pokud jste v\u00fdvoj\u00e1\u0159 se z\u00e1jmem o k\u00f3dov\u00e1n\u00ed vzd\u011bl\u00e1vac\u00edch her, sta\u0148te se Arcikouzeln\u00edkem, abyste n\u00e1m mohli pomoct s v\u00fdvojem CodeCombat!\"\n artisan_title: \"\u0158emesln\u00edk\"\n artisan_title_description: \"(Tv\u016frce \u00farovn\u00ed)\"\n artisan_summary: \"Stavte a sd\u00edlejte \u00farovn\u011b, abyste si na nich mohli zhr\u00e1t i s p\u0159\u00e1teli. Sta\u0148te se \u0158emesln\u00edkem, abyste se u\u010dili um\u011bn\u00ed u\u010dit jin\u00e9 programovat.\"\n adventurer_title: \"Dobrodruh\"\n adventurer_title_description: \"(Tester \u00farovn\u00ed)\"\n adventurer_summary: \"Dosta\u0148te nov\u00e9 \u00farovn\u011b (dokonce i obsah pro p\u0159edplatitele) zdarma s t\u00fddenn\u00edm p\u0159edstihem a pomozte n\u00e1m vy\u0159e\u0161it chyby p\u0159ed vyd\u00e1n\u00edm.\"\n scribe_title: \"P\u00edsa\u0159\"\n scribe_title_description: \"(Editor \u010dl\u00e1nk\u016f)\"\n scribe_summary: \"Dobr\u00fd k\u00f3d pot\u0159ebuje dobrou dokumentaci. Pi\u0161te, upravuje a vylep\u0161ujte dokumentaci, kterou \u010dtou miliony hr\u00e1\u010d\u016f po cel\u00e9 zemi.\"\n diplomat_title: \"Diplomat\"\n diplomat_title_description: \"(P\u0159ekladatel)\"\n diplomat_summary: \"CodeCombat je p\u0159elo\u017een do 45+ jazyk\u016f na\u0161imi Diplomaty. Pomozte n\u00e1m a p\u0159isp\u011bjte se sv\u00fdmi p\u0159eklady.\"\n ambassador_title: \"Velvyslanec\"\n ambassador_title_description: \"(Podpora)\"\n ambassador_summary: \"Kro\u0165te na\u0161e u\u017eivatele na f\u00f3ru a poskytujte odpov\u011bdi t\u011bm, kte\u0159\u00ed se ptaj\u00ed. Na\u0161i Velvyslanci reprezentuj\u00ed CodeCombat ve sv\u011bt\u011b.\"\n# teacher_title: \"Teacher\"\n\n editor:\n main_title: \"Editory CodeCombatu\"\n article_title: \"Editor \u010dl\u00e1nk\u016f\"\n thang_title: \"Editor Thang\u016f - objekt\u016f\"\n level_title: \"Editor \u00farovn\u00ed\"\n course_title: \"Editor kurz\u016f\"\n achievement_title: \"Editor \u00dasp\u011bch\u016f\"\n poll_title: \"Editor dotazn\u00edk\u016f\"\n back: \"Zp\u011bt\"\n revert: \"Vr\u00e1tit\"\n revert_models: \"Vr\u00e1tit modely\"\n pick_a_terrain: \"Vybrat ter\u00e9n\"\n dungeon: \"Dungeon\"\n indoor: \"\u00dakryt\"\n desert: \"Pou\u0161\u0165\"\n grassy: \"Travnat\u00fd\"\n mountain: \"Hora\"\n glacier: \"Ledovec\"\n small: \"Mal\u00fd\"\n large: \"Velk\u00fd\"\n fork_title: \"Forkovat novou verzi\"\n fork_creating: \"Vytv\u00e1\u0159en\u00ed Forku...\"\n generate_terrain: \"Generov\u00e1n\u00ed ter\u00e9nu\"\n more: \"V\u00edce\"\n wiki: \"Wiki\"\n live_chat: \"\u017div\u00fd Chat\"\n thang_main: \"Hlavn\u00ed\"\n thang_spritesheets: \"Spritesheety\"\n thang_colors: \"Barvy\"\n level_some_options: \"Volby?\"\n level_tab_thangs: \"Thangy\"\n level_tab_scripts: \"Skripty\"\n level_tab_components: \"Komponenty\"\n level_tab_systems: \"Syst\u00e9my\"\n level_tab_docs: \"Dokumentace\"\n level_tab_thangs_title: \"Sou\u010dasn\u00e9 Thangy\"\n level_tab_thangs_all: \"V\u0161echny\"\n level_tab_thangs_conditions: \"V\u00fdchoz\u00ed prost\u0159ed\u00ed\"\n level_tab_thangs_add: \"P\u0159idat Thangy\"\n# level_tab_thangs_search: \"Search thangs\"\n add_components: \"P\u0159idat sou\u010d\u00e1sti\"\n component_configs: \"Nastaven\u00ed sou\u010d\u00e1st\u00ed\"\n config_thang: \"Dvoj-klik pro konfiguraci thangu\"\n delete: \"Smazat\"\n duplicate: \"Duplikovat\"\n stop_duplicate: \"Zastavit duplikov\u00e1n\u00ed\"\n rotate: \"Oto\u010dit\"\n level_component_tab_title: \"Sou\u010dasn\u00e9 komponenty\"\n level_component_btn_new: \"Vytvo\u0159it novou komponentu\"\n level_systems_tab_title: \"Sou\u010dasn\u00e9 syst\u00e9my\"\n level_systems_btn_new: \"Vytvo\u0159it nov\u00fd syst\u00e9m\"\n level_systems_btn_add: \"P\u0159idat syst\u00e9m\"\n level_components_title: \"Zp\u011bt na v\u0161echny Thangy\"\n level_components_type: \"Druh\"\n level_component_edit_title: \"Editovat komponentu\"\n level_component_config_schema: \"Konfigura\u010dn\u00ed sch\u00e9ma\"\n level_system_edit_title: \"Editovat syst\u00e9m\"\n create_system_title: \"Vytvo\u0159it nov\u00fd syst\u00e9m\"\n new_component_title: \"Vytvo\u0159it novou komponentu\"\n new_component_field_system: \"Syst\u00e9m\"\n new_article_title: \"Vytvo\u0159it nov\u00fd \u010dl\u00e1nek\"\n new_thang_title: \"Vytvo\u0159it nov\u00fd typ Thangu\"\n new_level_title: \"Vytvo\u0159it novou \u00farove\u0148\"\n new_article_title_login: \"P\u0159ihla\u0161te se pro vytvo\u0159en\u00ed nov\u00e9ho \u010dl\u00e1nku\"\n new_thang_title_login: \"P\u0159ihla\u0161te se pro vytvo\u0159en\u00ed nov\u00e9ho typu Thangu\"\n new_level_title_login: \"P\u0159ihla\u0161te se pro vytvo\u0159en\u00ed nov\u00e9 \u00farovn\u011b\"\n new_achievement_title: \"Vytvo\u0159it nov\u00fd \u00dasp\u011bch\"\n new_achievement_title_login: \"P\u0159ihla\u0161te se pro vytvo\u0159en\u00ed nov\u00e9ho \u00dasp\u011bchu\"\n new_poll_title: \"Vytvo\u0159it nov\u00fd dotazn\u00edk\"\n# new_poll_title_login: \"Log In to Create a New Poll\"\n article_search_title: \"Vyhledat \u010dl\u00e1nky\"\n thang_search_title: \"Vyhledat typy Thang\u016f\"\n level_search_title: \"Vyhledat \u00farovn\u011b\"\n achievement_search_title: \"Hledat \u00dasp\u011bchy\"\n# poll_search_title: \"Search Polls\"\n read_only_warning2: \"Pozn\u00e1mka: nem\u016f\u017eete ukl\u00e1dat \u017e\u00e1dn\u00e9 zm\u011bny, proto\u017ee nejste p\u0159ihl\u00e1\u0161eni.\"\n no_achievements: \"Pro tuto \u00farove\u0148 je\u0161t\u011b nebyly p\u0159id\u00e1ny \u00fasp\u011bchy.\"\n achievement_query_misc: \"Kl\u00ed\u010dov\u00e9 \u00fasp\u011bchy ostatn\u00edch\"\n achievement_query_goals: \"Kl\u00ed\u010dov\u00e9 \u00fasp\u011bchy c\u00edl\u016f \u00farovn\u00ed\"\n level_completion: \"Dokon\u010den\u00ed \u00farovn\u011b\"\n pop_i18n: \"Os\u00eddlit I18N\"\n tasks: \"\u00dakoly\"\n# clear_storage: \"Clear your local changes\"\n# add_system_title: \"Add Systems to Level\"\n# done_adding: \"Done Adding\"\n\n article:\n edit_btn_preview: \"N\u00e1hled\"\n edit_article_title: \"Editovat \u010dl\u00e1nek\"\n\n polls:\n priority: \"Priorita\"\n\n contribute:\n page_title: \"P\u0159isp\u00edv\u00e1n\u00ed\"\n intro_blurb: \"CodeCombat je 100% open source! Stovky nad\u0161en\u00fdch hr\u00e1\u010d\u016f ji\u017e pomohli postavit hru do podoby, kterou vid\u00edte dnes. P\u0159ipojte se a napi\u0161te dal\u0161\u00ed kapitolu CodeCombatu, ve kter\u00e9m se u\u010d\u00ed cel\u00fd sv\u011bt k\u00f3dovat!\" # {change}\n alert_account_message_intro: \"V\u00edtejte!\"\n alert_account_message: \"Pro odeb\u00edr\u00e1n\u00ed t\u0159\u00eddn\u00edch email\u016f mus\u00edte b\u00fdt nejd\u0159\u00edve p\u0159ihl\u00e1\u0161eni.\"\n archmage_introduction: \"Jedna z nejlep\u0161\u00edch v\u011bc\u00ed na vytv\u00e1\u0159en\u00ed her je to, \u017ee se jedn\u00e1 o spojen\u00ed r\u016fzn\u00fdch proces\u016f. Grafika, zvuk, s\u00ed\u0165ov\u00e1n\u00ed v re\u00e1ln\u00e9m \u010dase, mezilidsk\u00e9 vztahy a samoz\u0159ejm\u011b tak\u00e9 spousta b\u011b\u017en\u00fdch aspekt\u016f programov\u00e1n\u00ed, od n\u00edzko\u00farov\u0148ov\u00e9ho managementu datab\u00e1ze p\u0159es administraci server\u016f a\u017e po tvorbu u\u017eivatelsk\u00e1 rozhran\u00ed. Je zde spousta pr\u00e1ce a pokud jste zku\u0161en\u00fd program\u00e1tor a v\u0161eum\u011bl p\u0159ipraven\u00fd k pono\u0159en\u00ed se do hloubek CodeCombatu, tato skupina je pro v\u00e1s. Budeme moc r\u00e1di za va\u0161i pomoc p\u0159i tvorb\u011b t\u00e9 nejlep\u0161\u00ed programovac\u00ed hry.\"\n class_attributes: \"Vlastnosti\"\n archmage_attribute_1_pref: \"Zn\u00e1te \"\n archmage_attribute_1_suf: \"nebo se jej chcete nau\u010dit. Je v n\u011bm v\u011bt\u0161ina na\u0161eho k\u00f3du. Je-li va\u0161\u00edm obl\u00edben\u00fdm jazykem Ruby nebo Python, budete se c\u00edtit jako doma. Je to JavaScript, ale s lep\u0161\u00ed syntax\u00ed.\"\n archmage_attribute_2: \"Zku\u0161enosti s programov\u00e1n\u00edm a osobn\u00ed iniciativa. Pom\u016f\u017eeme v\u00e1m se zorientovat, ale nem\u016f\u017eeme v\u00e1s u\u010dit.\"\n how_to_join: \"Jak se p\u0159idat\"\n join_desc_1: \"Pomoct m\u016f\u017ee kdokoliv! Pro za\u010d\u00e1tek se pod\u00edvejte na na\u0161i str\u00e1nku na \"\n join_desc_2: \" , za\u0161krtn\u011bte pol\u00ed\u010dko n\u00ed\u017ee - ozna\u010d\u00edte se t\u00edm jako state\u010dn\u00fd Arcim\u00e1g a za\u010dnete dost\u00e1vat informace o novink\u00e1ch emailem. Chcete popov\u00eddat o tom jak za\u010d\u00edt? \"\n join_desc_3: \", nebo se s n\u00e1mi spojte v na\u0161\u00ed \"\n join_desc_4: \"!\"\n join_url_email: \"Po\u0161lete n\u00e1m email\"\n# join_url_slack: \"public Slack channel\"\n archmage_subscribe_desc: \"Dost\u00e1vat emailem ozn\u00e1men\u00ed a informacemi nov\u00fdch programovac\u00edch p\u0159\u00edle\u017eitostech\"\n artisan_introduction_pref: \"Mus\u00edme vytv\u00e1\u0159et dal\u0161\u00ed \u00farovn\u011b! Lid\u00e9 n\u00e1s pros\u00ed o dal\u0161\u00ed obsah, ale sami zvl\u00e1d\u00e1me vytvo\u0159it jen m\u00e1lo. Na\u0161\u00edm prvn\u00edm pracovn\u00edm zastaven\u00edm je prvn\u00ed \u00farove\u0148. Editor \u00farovn\u00ed je tak-tak pou\u017eiteln\u00fd i pro jeho vlastn\u00ed tv\u016frce. M\u00e1te-li vizi pro vytvo\u0159en\u00ed vno\u0159en\u00fdch \u00farovn\u00ed al\u00e1 \"\n artisan_introduction_suf: \"pak nev\u00e1hejte, toto je va\u0161e destinace.\"\n artisan_attribute_1: \"P\u0159edchoz\u00ed zku\u0161enosti s vytv\u00e1\u0159en\u00edm podobn\u00e9ho obsahu by byly v\u00edt\u00e1ny, nap\u0159\u00edklad z editor\u016f \u00farovn\u00ed Blizzardu, ale nejsou vy\u017eadov\u00e1ny!\"\n artisan_attribute_2: \"P\u0159ipraveni ke spoust\u011b testov\u00e1n\u00ed a pokus\u016f. K vytvo\u0159en\u00ed dobr\u00e9 \u00farovn\u011b je pot\u0159eba je p\u0159edstavit ostatn\u00edm, nechat je hr\u00e1t a pak je z velk\u00e9 \u010d\u00e1sti m\u011bnit a opravovat.\"\n artisan_attribute_3: \"Pro te\u010f, stejn\u00e9 jako Dobrodruh - tester \u00farovn\u00ed. N\u00e1\u0161 editor \u00farovn\u00ed je ve velmi ran\u00e9m st\u00e1diu a frustruj\u00edc\u00ed p\u0159i pou\u017e\u00edv\u00e1n\u00ed. Varovali jsme v\u00e1s!\"\n artisan_join_desc: \"Pou\u017eijte editor \u00farovn\u00ed v t\u011bchto postupn\u00fdch kroc\u00edch:\"\n artisan_join_step1: \"P\u0159e\u010dt\u011bte si dokumentaci.\"\n artisan_join_step2: \"Vytvo\u0159te novou \u00farove\u0148 a prozkoumejte existuj\u00edc\u00ed \u00farovn\u011b.\"\n artisan_join_step3: \"Po\u017e\u00e1dejte n\u00e1s o pomoc ve ve\u0159ejn\u00e9 Slack m\u00edstnosti.\"\n artisan_join_step4: \"Zve\u0159ejn\u011bte va\u0161i \u00farove\u0148 na f\u00f3ru pro p\u0159ipom\u00ednkov\u00e1n\u00ed.\"\n artisan_subscribe_desc: \"Dost\u00e1vat emailem ozn\u00e1men\u00ed a informace o aktualizac\u00edch editoru \u00farovn\u00ed.\"\n adventurer_introduction: \"Ujasn\u011bme si dop\u0159edu jednu v\u011bc o va\u0161\u00ed roli: budete jako tank. Projdete ohn\u011bm. Pot\u0159ebujeme n\u011bkoho, kdo odzkou\u0161\u00ed zbrusu nov\u00e9 \u00farovn\u011b a pom\u016f\u017ee identifikovat kde je mo\u017eno je zlep\u0161it. Ten boj bude ohromn\u00fd - tvorba her je dlouh\u00fd proces, kter\u00fd nikdo nezvl\u00e1dne na prvn\u00ed pokus. M\u00e1te-li na to a vydr\u017e\u00edte-li to, pak toto je va\u0161e skupina.\"\n adventurer_attribute_1: \"Touha po u\u010den\u00ed se. Vy se chcete nau\u010dit programovat a my v\u00e1s to chceme nau\u010dit. Jenom, v tomto p\u0159\u00edpad\u011b to budete vy, kdo bude vyu\u010dovat.\"\n adventurer_attribute_2: \"Charismatick\u00fd. Bu\u010fte m\u00edrn\u00fd a pe\u010dliv\u011b artikulujte co a jak je pot\u0159eba zlep\u0161it.\"\n adventurer_join_pref: \"Bu\u010fto se spojte (nebo si najd\u011bte!) Dobrodruha a pracujte s n\u00edm, nebo za\u0161krtn\u011bte pol\u00ed\u010dko n\u00ed\u017ee a dost\u00e1vejte emaily o dostupnosti nov\u00fdch \u00farovn\u00ed k testov\u00e1n\u00ed. Budeme tak\u00e9 pos\u00edlat informace o nov\u00fdch \u00farovn\u00edch k recenz\u00edm na soci\u00e1ln\u00edch webech, \"\n adventurer_forum_url: \" na\u0161em f\u00f3ru\"\n adventurer_join_suf: \"tak\u017ee pokud chcete b\u00fdt v obraze, p\u0159ipojte se k n\u00e1m!\"\n adventurer_subscribe_desc: \"Dost\u00e1vat emailem ozn\u00e1men\u00ed a informace nov\u00fdch \u00farovn\u00edch k testov\u00e1n\u00ed.\"\n scribe_introduction_pref: \"CodeCombat nebude pouze kupa \u00farovn\u00ed. Bude tak\u00e9 zahrnovat informa\u010dn\u00ed zdroje a wiki programovac\u00edch koncept\u016f na kter\u00e9 se \u00farovn\u011b mohou nav\u00e1zat. Takto, nam\u00edsto toho aby ka\u017ed\u00fd \u0158emesln\u00edk musel s\u00e1m do detailu popsatco kter\u00fd oper\u00e1tor d\u011bl\u00e1, mohou jednodu\u0161e nalinkovat svoji \u00farove\u0148 na \u010dl\u00e1nek existuj\u00edc\u00ed k edukaci hr\u00e1\u010d\u016f. N\u011bco ve stylu \"\n scribe_introduction_url_mozilla: \"Mozilla Developer Network\"\n scribe_introduction_suf: \". Jestli\u017ee v\u00e1s bav\u00ed popisovat a p\u0159ed\u00e1vat koncept programov\u00e1n\u00ed v Markdown editoru, pak tato role m\u016f\u017ee b\u00fdt pr\u00e1v\u011b pro v\u00e1s.\"\n scribe_attribute_1: \"Zku\u0161enost s psan\u00edm je jedin\u00e9 co budete pot\u0159ebovat. Nejen gramatika, ale tak\u00e9 schopnost popsat slo\u017eit\u00e9 koncepty a my\u0161lenky ostatn\u00edm.\"\n contact_us_url: \"Spojte se s n\u00e1mi\" # {change}\n scribe_join_description: \"dejte n\u00e1m o v\u00e1s v\u011bd\u011bt, o va\u0161ich zku\u0161enostech s programov\u00e1n\u00edm a o \u010dm byste r\u00e1di psali. Od toho za\u010dneme!\"\n scribe_subscribe_desc: \"Dost\u00e1vat emailem ozn\u00e1men\u00ed a informace o \u010dl\u00e1nc\u00edch.\"\n diplomat_introduction_pref: \"Jedna z v\u011bc\u00ed, kterou jsme zjistili b\u011bhem \"\n diplomat_launch_url: \"zah\u00e1jen\u00ed v \u0158\u00edjnu\"\n diplomat_introduction_suf: \"bylo, \u017ee o CodeCombat je velk\u00fd z\u00e1jem i v jin\u00fdch zem\u00edch, obzvl\u00e1\u0161t\u011b v Braz\u00edlii! Chyst\u00e1me regiment p\u0159ekladatel\u016f ke zp\u0159\u00edstupn\u011bn\u00ed CodeCombatu sv\u011btu. Pokud chcete nakouknout pod pokli\u010dku, dozv\u011bd\u011bt se o p\u0159ipravovan\u00fdch novink\u00e1ch a zp\u0159\u00edstupnit \u00farovn\u011b va\u0161im n\u00e1rodn\u00edm koleg\u016fm, toto je role pro v\u00e1s.\"\n diplomat_attribute_1: \"Plynulost v angli\u010dtin\u011b a v jazyce do kter\u00e9ho budete p\u0159ekl\u00e1dat. P\u0159i p\u0159ed\u00e1v\u00e1n\u00ed komplexn\u00edch my\u0161lenek je d\u016fle\u017eit\u00e9 si b\u00fdt jisti v\u00fdrazy v obou jazyc\u00edch!\"\n diplomat_i18n_page_prefix: \"M\u016f\u017eete za\u010d\u00edt p\u0159ekl\u00e1dat na\u0161e \u00farovn\u011b p\u0159ej\u00edt\u00edm na na\u0161e\"\n diplomat_i18n_page: \"str\u00e1nky p\u0159eklad\u016f\"\n diplomat_i18n_page_suffix: \", nebo na\u0161e prost\u0159ed\u00ed a str\u00e1nky na GitHub.\"\n diplomat_join_pref_github: \"Najd\u011bte soubor pro sv\u016fj jazyk \"\n diplomat_github_url: \"na GitHub\"\n diplomat_join_suf_github: \", upravte ho online a za\u0161lete pull request. Tak\u00e9 za\u0161krtn\u011bte toto pol\u00ed\u010dko, abyste z\u016fstali informov\u00e1ni o nov\u00e9m v\u00fdvoji internacionalizace!\"\n diplomat_subscribe_desc: \"Dost\u00e1vat emailem ozn\u00e1men\u00ed a informace o internacionalizaci a o \u00farovn\u00edch k p\u0159ekladu.\"\n ambassador_introduction: \"Zde se tvo\u0159\u00ed komunita a vy jste jej\u00ed spojen\u00ed. Vyu\u017e\u00edv\u00e1me chat, emaily a soci\u00e1ln\u00ed s\u00edt\u011b se spoustou lid\u00ed k informov\u00e1n\u00ed a diskuz\u00edm a sezn\u00e1men\u00ed s na\u0161\u00ed hrou. Chcete-li pomoci lidem se p\u0159idat a pobavit se a z\u00edskat dobr\u00fd n\u00e1hled na CodeCombat a kam sm\u011b\u0159ujeme, pak toto je va\u0161e role.\"\n ambassador_attribute_1: \"Komunika\u010dn\u00ed schopnosti. Schopnost identifikovat probl\u00e9my hr\u00e1\u010d\u016f a pomoci jim je \u0159e\u0161it. Naslouchat co hr\u00e1\u010di \u0159\u00edkaj\u00ed, co maj\u00ed r\u00e1di a co r\u00e1di nemaj\u00ed a komunikovat to zp\u011bt ostatn\u00edm!\"\n ambassador_join_desc: \"dejte n\u00e1m o sob\u011b v\u011bd\u011bt, o tom co d\u011bl\u00e1te a co byste r\u00e1di d\u011blali. Od toho za\u010dneme!\"\n ambassador_join_note_strong: \"Pozn\u00e1mka\"\n ambassador_join_note_desc: \"Jedna z na\u0161ich priorit je vytvo\u0159en\u00ed v\u00edcehr\u00e1\u010dov\u00e9 hry, kde hr\u00e1\u010d, kter\u00fd m\u00e1 probl\u00e9m s \u0159e\u0161en\u00edm \u00farovn\u00ed m\u016f\u017ee oslovit a po\u017e\u00e1dat o pomoc zku\u0161en\u011bj\u0161\u00ed kouzeln\u00edky. To je p\u0159esn\u011b ten p\u0159\u00edpad a m\u00edsto pro pomoc Velvyslance . D\u00e1me v\u00e1m v\u011bd\u011bt v\u00edce!\"\n ambassador_subscribe_desc: \"Dost\u00e1vat emailem ozn\u00e1men\u00ed a informace o v\u00fdvoji v podpo\u0159e a v\u00edcehr\u00e1\u010dov\u00e9 h\u0159e.\"\n# teacher_subscribe_desc: \"Get emails on updates and announcements for teachers.\"\n changes_auto_save: \"Zm\u011bny jsou automaticky ulo\u017eeny p\u0159i kliknut\u00ed na za\u0161krt\u00e1vac\u00ed pol\u00ed\u010dka.\"\n diligent_scribes: \"Na\u0161i piln\u00ed P\u00edsa\u0159i:\"\n powerful_archmages: \"Na\u0161i mocn\u00ed Arcim\u00e1gov\u00e9:\"\n creative_artisans: \"Na\u0161i kreativn\u00ed \u0158emesln\u00edci:\"\n brave_adventurers: \"Na\u0161i state\u010dn\u00ed Dobrodruzi:\"\n translating_diplomats: \"Na\u0161i p\u0159ekladatel\u0161t\u00ed Diplomati:\"\n helpful_ambassadors: \"Na\u0161i n\u00e1pomocn\u00ed Velvyslanci:\"\n\n ladder:\n my_matches: \"M\u00e9 souboje\"\n simulate: \"Simulovat\"\n simulation_explanation: \"Simulov\u00e1n\u00edm hry odehrajete hru rychleji!\"\n# simulation_explanation_leagues: \"You will mainly help simulate games for allied players in your clans and courses.\"\n simulate_games: \"Simulovat hry!\"\n games_simulated_by: \"Hry simulov\u00e1ny v\u00e1mi:\"\n games_simulated_for: \"Hry simulov\u00e1ny pro v\u00e1s:\"\n# games_in_queue: \"Games currently in the queue:\"\n games_simulated: \"Her simulov\u00e1no\"\n games_played: \"Her hr\u00e1no\"\n ratio: \"Pom\u011br\"\n leaderboard: \"\u017deb\u0159\u00ed\u010dek\"\n battle_as: \"Bojovat jako \"\n summary_your: \"Va\u0161ich \"\n summary_matches: \"Souboj\u016f - \"\n summary_wins: \" Vyhr\u00e1no, \"\n summary_losses: \" Prohr\u00e1no\"\n rank_no_code: \"\u017d\u00e1dn\u00fd nov\u00fd k\u00f3d pro ohodnocen\u00ed\"\n rank_my_game: \"Ohodnotit mou hru!\"\n rank_submitting: \"Odes\u00edl\u00e1n\u00ed...\"\n rank_submitted: \"Odesl\u00e1no pro ohodnocen\u00ed\"\n rank_failed: \"Chyba p\u0159i ohodnocen\u00ed\"\n rank_being_ranked: \"Hra je ohodnocov\u00e1na\"\n rank_last_submitted: \"odesl\u00e1no \"\n help_simulate: \"Pomoc simulovat hry?\"\n code_being_simulated: \"V\u00e1\u0161 nov\u00fd k\u00f3d je pr\u00e1v\u011b simulov\u00e1n jin\u00fdm hr\u00e1\u010dem pro ohodnocen\u00ed.\"\n no_ranked_matches_pre: \"\u017d\u00e1dn\u00e9 ohodnocen\u00e9 souboje pro \"\n no_ranked_matches_post: \" t\u00fdm! Hraj proti soupe\u0159\u016fm a pot\u00e9 p\u0159ij\u010f zp\u011bt pro ohodnocen\u00ed sv\u00e9 hry.\"\n choose_opponent: \"Vybrat soupe\u0159e\"\n select_your_language: \"Vyber sv\u016fj jazyk!\"\n tutorial_play: \"Hr\u00e1t Tutori\u00e1l\"\n tutorial_recommended: \"Doporu\u010deno, pokud jste je\u0161t\u011b nikdy nehr\u00e1li\"\n tutorial_skip: \"P\u0159esko\u010dit Tutori\u00e1l\"\n tutorial_not_sure: \"Nejste si jisti, co se d\u011bje?\"\n tutorial_play_first: \"Hr\u00e1t nejprve Tutori\u00e1l.\"\n simple_ai: \"Jednoduch\u00e1 obt\u00ed\u017enost\" # {change}\n warmup: \"Rozeh\u0159\u00e1t\u00ed\"\n friends_playing: \"P\u0159\u00e1tel hraje\"\n log_in_for_friends: \"Pro hran\u00ed s p\u0159\u00e1teli se nejprve p\u0159ihla\u0161te!\"\n social_connect_blurb: \"P\u0159ipojte se a hrajte proti sv\u00fdm p\u0159\u00e1tel\u016fm!\"\n invite_friends_to_battle: \"Pozv\u011bte sv\u00e9 p\u0159\u00e1tele, abyste spolu bojovali!\"\n fight: \"Boj!\"\n watch_victory: \"Sledovat va\u0161i v\u00fdhru\"\n defeat_the: \"Pora\u017eeno\"\n# watch_battle: \"Watch the battle\"\n# tournament_started: \", started\"\n tournament_ends: \"Turnaj kon\u010d\u00ed\"\n tournament_ended: \"Turnaj ukon\u010den\"\n tournament_rules: \"Pravidla turnaje\"\n tournament_blurb: \"Pi\u0161te k\u00f3d, sb\u00edrejte zlato, budujte arm\u00e1du, zabijte nep\u0159\u00e1tele, vyhrajte ceny a vylep\u0161te si svou kari\u00e9ru v na\u0161em turnaji o $40,000 dolar\u016f! Pod\u00edvejte se na detaily\"\n tournament_blurb_criss_cross: \"Vyhrajte nab\u00eddky, budujte cesty, p\u0159elst\u011bte nep\u0159\u00e1tele, seberte drahokamy a velep\u0161te si svou kari\u00e9ru v na\u0161em K\u0159\u00ed\u017eovk\u00e1\u0159sk\u00e9m turnaji! Pod\u00edvejte se na detaily\"\n# tournament_blurb_zero_sum: \"Unleash your coding creativity in both gold gathering and battle tactics in this alpine mirror match between red sorcerer and blue sorcerer. The tournament began on Friday, March 27 and will run until Monday, April 6 at 5PM PDT. Compete for fun and glory! Check out the details\"\n# tournament_blurb_ace_of_coders: \"Battle it out in the frozen glacier in this domination-style mirror match! The tournament began on Wednesday, September 16 and will run until Wednesday, October 14 at 5PM PDT. Check out the details\"\n tournament_blurb_blog: \"na na\u0161em blogu\"\n rules: \"Pravidla\"\n winners: \"V\u00edt\u011bzov\u00e9\"\n# league: \"League\"\n# red_ai: \"Red CPU\" # \"Red AI Wins\", at end of multiplayer match playback\n# blue_ai: \"Blue CPU\"\n# wins: \"Wins\" # At end of multiplayer match playback\n# humans: \"Red\" # Ladder page display team name\n# ogres: \"Blue\"\n\n user:\n stats: \"Statistiky\"\n singleplayer_title: \"Singleplayer \u00darovn\u011b\"\n multiplayer_title: \"Multiplayer \u00darovn\u011b\"\n achievements_title: \"\u00dasp\u011bchy\"\n last_played: \"Posledn\u00ed hran\u00e1\"\n status: \"Stav\"\n status_completed: \"Dokon\u010deno\"\n status_unfinished: \"Nedokon\u010deno\"\n no_singleplayer: \"Zat\u00edm \u017e\u00e1dn\u00e9 Singleplayer hry nebyly hr\u00e1ny.\"\n no_multiplayer: \"Zat\u00edm \u017e\u00e1dn\u00e9 Multiplayer hry nebyly hr\u00e1ny.\"\n no_achievements: \"Zat\u00edm \u017e\u00e1dn\u00e9 \u00dasp\u011bchy.\"\n favorite_prefix: \"Obl\u00edben\u00fd jazky: \"\n favorite_postfix: \".\"\n not_member_of_clans: \"Zat\u00edm nen\u00ed \u010dlenem \u017e\u00e1dn\u00e9ho klanu.\"\n# certificate_view: \"view certificate\"\n# certificate_click_to_view: \"click to view certificate\"\n# certificate_course_incomplete: \"course incomplete\"\n# certificate_of_completion: \"Certificate of Completion\"\n# certificate_endorsed_by: \"Endorsed by\"\n# certificate_stats: \"Course Stats\"\n# certificate_lines_of: \"lines of\"\n# certificate_levels_completed: \"levels completed\"\n# certificate_for: \"For\"\n\n achievements:\n last_earned: \"Posledn\u00ed obdr\u017een\u00fd\"\n amount_achieved: \"Mno\u017estv\u00ed\"\n achievement: \"\u00dasp\u011bch\"\n current_xp_prefix: \"\"\n current_xp_postfix: \" celkem\"\n new_xp_prefix: \"\"\n new_xp_postfix: \" z\u00edsk\u00e1no\"\n left_xp_prefix: \"\"\n left_xp_infix: \" do \u00farovn\u011b \"\n left_xp_postfix: \"\"\n\n account:\n payments: \"Platby\"\n prepaid_codes: \"P\u0159edplacen\u00e9 k\u00f3dy\"\n purchased: \"Zaplaceno\"\n# subscribe_for_gems: \"Subscribe for gems\"\n subscription: \"P\u0159edplatn\u00e9\"\n invoices: \"Faktury\"\n service_apple: \"Apple\"\n service_web: \"Web\"\n paid_on: \"Zaplaceno p\u0159es\"\n service: \"Slu\u017eba\"\n price: \"Cena\"\n gems: \"Drahokamy\"\n active: \"Aktivn\u00ed\"\n subscribed: \"Odeb\u00edr\u00e1no\"\n unsubscribed: \"Zru\u0161eno odeb\u00edr\u00e1n\u00ed\"\n active_until: \"Aktivn\u00ed do\"\n cost: \"N\u00e1klady\"\n next_payment: \"Dal\u0161\u00ed platba\"\n card: \"Karta\"\n status_unsubscribed_active: \"Nejste p\u0159edplatitel a nebude v\u00e1m nic za\u00fa\u010dtov\u00e1no, ale v\u00e1\u0161 \u00fa\u010det je po\u0159\u00e1d aktivn\u00ed.\"\n status_unsubscribed: \"Dosta\u0148te p\u0159\u00edstup k nov\u00fdm \u00farovn\u00edm, hrdin\u016fm, p\u0159edm\u011bt\u016fm a bonusov\u00fdm drahokam\u016fm s CodeCombat p\u0159edplatn\u00fdm!\"\n# not_yet_verified: \"Not yet verified.\"\n# resend_email: \"Resend email\"\n# email_sent: \"Email sent! Check your inbox.\"\n# verifying_email: \"Verifying your email address...\"\n# successfully_verified: \"You've successfully verified your email address!\"\n# verify_error: \"Something went wrong when verifying your email :(\"\n# unsubscribe_from_marketing: \"Unsubscribe __email__ from all CodeCombat marketing emails?\"\n# unsubscribe_button: \"Yes, unsubscribe\"\n# unsubscribe_failed: \"Failed\"\n# unsubscribe_success: \"Success\"\n\n# account_invoices:\n# amount: \"Amount in US dollars\"\n# declined: \"Your card was declined\"\n# invalid_amount: \"Please enter a US dollar amount.\"\n# not_logged_in: \"Log in or create an account to access invoices.\"\n# pay: \"Pay Invoice\"\n# purchasing: \"Purchasing...\"\n# retrying: \"Server error, retrying.\"\n# success: \"Successfully paid. Thanks!\"\n\n# account_prepaid:\n# purchase_code: \"Purchase a Subscription Code\"\n# purchase_code1: \"Subscription Codes can be redeemed to add premium subscription time to one or more accounts for the Home version of CodeCombat.\" #\n# purchase_code2: \"Each CodeCombat account can only redeem a particular Subscription Code once.\"\n# purchase_code3: \"Subscription Code months will be added to the end of any existing subscription on the account.\"\n# purchase_code4: \"Subscription Codes are for accounts playing the Home version of CodeCombat, they cannot be used in place of Student Licenses for the Classroom version.\"\n# purchase_code5: \"For more information on Student Licenses, reach out to\"\n# users: \"Users\"\n# months: \"Months\"\n# purchase_total: \"Total\"\n# purchase_button: \"Submit Purchase\"\n# your_codes: \"Your Codes\"\n# redeem_codes: \"Redeem a Subscription Code\"\n# prepaid_code: \"Prepaid Code\"\n# lookup_code: \"Lookup prepaid code\"\n# apply_account: \"Apply to your account\"\n# copy_link: \"You can copy the code's link and send it to someone.\"\n# quantity: \"Quantity\"\n# redeemed: \"Redeemed\"\n# no_codes: \"No codes yet!\"\n# you_can1: \"You can\"\n# you_can2: \"purchase a prepaid code\"\n# you_can3: \"that can be applied to your own account or given to others.\"\n\n loading_error:\n could_not_load: \"Chyba p\u0159i na\u010d\u00edt\u00e1n\u00ed ze serveru\" # {change}\n connection_failure: \"Chyba p\u0159ipojen\u00ed.\"\n# connection_failure_desc: \"It doesn\u2019t look like you\u2019re connected to the internet! Check your network connection and then reload this page.\"\n login_required: \"Vy\u017eadov\u00e1no p\u0159ihl\u00e1\u0161en\u00ed\"\n# login_required_desc: \"You need to be logged in to access this page.\"\n unauthorized: \"Mus\u00edte se p\u0159ihl\u00e1sit. M\u00e1te zapnut\u00e9 cookies?\"\n forbidden: \"Nem\u00e1te opr\u00e1vn\u011bn\u00ed.\"\n# forbidden_desc: \"Oh no, there\u2019s nothing we can show you here! Make sure you\u2019re logged into the correct account, or visit one of the links below to get back to programming!\"\n not_found: \"Nenalezeno.\"\n# not_found_desc: \"Hm, there\u2019s nothing here. Visit one of the following links to get back to programming!\"\n not_allowed: \"Metoda nen\u00ed povolena.\"\n timeout: \"Vypr\u0161el \u010dasov\u00fd limit serveru.\" # {change}\n conflict: \"Konflikt zdroj\u016f.\"\n bad_input: \"\u0160patn\u00fd vstup.\"\n server_error: \"Chyba serveru.\"\n unknown: \"Nezn\u00e1m\u00e1 chyba.\" # {change}\n# error: \"ERROR\"\n# general_desc: \"Something went wrong, and it\u2019s probably our fault. Try waiting a bit and then refreshing the page, or visit one of the following links to get back to programming!\"\n\n resources:\n level: \"\u00darove\u0148\"\n patch: \"Oprava\"\n patches: \"Opravy\"\n system: \"Syst\u00e9m\"\n systems: \"Syst\u00e9my\"\n component: \"Sou\u010d\u00e1st\"\n components: \"Sou\u010d\u00e1sti\"\n hero: \"Hrdina\"\n campaigns: \"Kampan\u011b\"\n\n concepts:\n# advanced_css_rules: \"Advanced CSS Rules\"\n# advanced_css_selectors: \"Advanced CSS Selectors\"\n# advanced_html_attributes: \"Advanced HTML Attributes\"\n# advanced_html_tags: \"Advanced HTML Tags\"\n# algorithm_average: \"Algorithm Average\"\n# algorithm_find_minmax: \"Algorithm Find Min\/Max\"\n# algorithm_search_binary: \"Algorithm Search Binary\"\n# algorithm_search_graph: \"Algorithm Search Graph\"\n# algorithm_sort: \"Algorithm Sort\"\n# algorithm_sum: \"Algorithm Sum\"\n arguments: \"Parametry\"\n arithmetic: \"Aritmetika\"\n array_2d: \"2D Pole\"\n array_index: \"Indexov\u00e1n\u00ed pole\"\n# array_iterating: \"Iterating Over Arrays\"\n# array_literals: \"Array Literals\"\n array_searching: \"Vyhled\u00e1v\u00e1n\u00ed v poli\"\n array_sorting: \"T\u0159\u00edd\u011bn\u00ed pole\"\n arrays: \"Pole\"\n# basic_css_rules: \"Basic CSS rules\"\n# basic_css_selectors: \"Basic CSS selectors\"\n# basic_html_attributes: \"Basic HTML Attributes\"\n# basic_html_tags: \"Basic HTML Tags\"\n basic_syntax: \"Z\u00e1kladn\u00ed syntaxe\"\n# binary: \"Binary\"\n# boolean_and: \"Boolean And\"\n# boolean_inequality: \"Boolean Inequality\"\n# boolean_equality: \"Boolean Equality\"\n# boolean_greater_less: \"Boolean Greater\/Less\"\n# boolean_logic_shortcircuit: \"Boolean Logic Shortcircuiting\"\n# boolean_not: \"Boolean Not\"\n# boolean_operator_precedence: \"Boolean Operator Precedence\"\n# boolean_or: \"Boolean Or\"\n# boolean_with_xycoordinates: \"Coordinate Comparison\"\n# bootstrap: \"Bootstrap\"\n break_statements: \"P\u0159\u00edkaz Break\"\n classes: \"T\u0159\u00eddy\"\n continue_statements: \"P\u0159\u00edkaz Continue\"\n# dom_events: \"DOM Events\"\n# dynamic_styling: \"Dynamic Styling\"\n# events: \"Events\"\n# event_concurrency: \"Event Concurrency\"\n# event_data: \"Event Data\"\n# event_handlers: \"Event Handlers\"\n# event_spawn: \"Spawn Event\"\n for_loops: \"For cykly\"\n for_loops_nested: \"Vno\u0159en\u00e9 For Cykly\"\n# for_loops_range: \"For Loops Range\"\n functions: \"Funkce\"\n# functions_parameters: \"Parameters\"\n# functions_multiple_parameters: \"Multiple Parameters\"\n# game_ai: \"Game AI\"\n# game_goals: \"Game Goals\"\n# game_spawn: \"Game Spawn\"\n graphics: \"Grafika\"\n graphs: \"Grafy\"\n heaps: \"Haldy\"\n# if_condition: \"Conditional If Statements\"\n# if_else_if: \"If\/Else If Statements\"\n if_else_statements: \"Konstrukce If\/Else\"\n if_statements: \"Konstrukce If\"\n if_statements_nested: \"Vno\u0159en\u00e9 konstrukce If\" # {change}\n indexing: \"Indexy pole\"\n# input_handling_flags: \"Input Handling - Flags\"\n# input_handling_keyboard: \"Input Handling - Keyboard\"\n# input_handling_mouse: \"Input Handling - Mouse\"\n# intermediate_css_rules: \"Intermediate CSS Rules\"\n# intermediate_css_selectors: \"Intermediate CSS Selectors\"\n# intermediate_html_attributes: \"Intermediate HTML Attributes\"\n# intermediate_html_tags: \"Intermediate HTML Tags\"\n jquery: \"jQuery\"\n# jquery_animations: \"jQuery Animations\"\n# jquery_filtering: \"jQuery Element Filtering\"\n# jquery_selectors: \"jQuery Selectors\"\n length: \"D\u00e9lka pole\"\n# math_coordinates: \"Coordinate Math\"\n math_geometry: \"Geometrie\"\n math_operations: \"Matematick\u00e9 operace\"\n# math_proportions: \"Proportion Math\"\n math_trigonometry: \"Trigonometrie\"\n# object_literals: \"Object Literals\"\n parameters: \"Parametry\"\n# programs: \"Programs\"\n# properties: \"Properties\"\n# property_access: \"Accessing Properties\"\n# property_assignment: \"Assigning Properties\"\n# property_coordinate: \"Coordinate Property\"\n queues: \"Datov\u00e9 struktury - fronty\"\n# reading_docs: \"Reading the Docs\"\n recursion: \"Rekurze\"\n return_statements: \"P\u0159\u00edkaz return\"\n stacks: \"Datov\u00e9 struktury - z\u00e1sobn\u00edky\"\n strings: \"\u0158et\u011bzce\"\n strings_concatenation: \"Spojov\u00e1n\u00ed \u0159et\u011bzc\u016f\"\n strings_substrings: \"Pod\u0159et\u011bzec\"\n trees: \"Datov\u00e9 struktury - stromy\"\n variables: \"Prom\u011bnn\u00e9\"\n vectors: \"Vektory\"\n while_condition_loops: \"Cykly while s podm\u00ednkami\"\n while_loops_simple: \"Cykly while\"\n while_loops_nested: \"Vno\u0159en\u00e9 cykly while\"\n xy_coordinates: \"Kart\u00e9zsk\u00e9 sou\u0159adnice\"\n advanced_strings: \"Pokro\u010dil\u00e9 \u0159et\u011bzce\" # Rest of concepts are deprecated\n algorithms: \"Algoritmy\"\n boolean_logic: \"Booleovsk\u00e1 logika\"\n basic_html: \"Z\u00e1kladn\u00ed HTML\"\n basic_css: \"Z\u00e1kladn\u00ed CSS\"\n# basic_web_scripting: \"Basic Web Scripting\"\n intermediate_html: \"St\u0159edn\u011b pokro\u010dil\u00e9 HTML\"\n intermediate_css: \"St\u0159edn\u011b pokro\u010dil\u00e9 CSS\"\n# intermediate_web_scripting: \"Intermediate Web Scripting\"\n advanced_html: \"Pokro\u010dil\u00e9 HTML\"\n advanced_css: \"Pokro\u010dil\u00e9 CSS\"\n# advanced_web_scripting: \"Advanced Web Scripting\"\n input_handling: \"Zpracov\u00e1n\u00ed vstupu\"\n while_loops: \"Cykly\"\n# place_game_objects: \"Place game objects\"\n# construct_mazes: \"Construct mazes\"\n# create_playable_game: \"Create a playable, sharable game project\"\n# alter_existing_web_pages: \"Alter existing web pages\"\n# create_sharable_web_page: \"Create a sharable web page\"\n# basic_input_handling: \"Basic Input Handling\"\n# basic_game_ai: \"Basic Game AI\"\n# basic_javascript: \"Basic JavaScript\"\n# basic_event_handling: \"Basic Event Handling\"\n# create_sharable_interactive_web_page: \"Create a sharable interactive web page\"\n\n# anonymous_teacher:\n# notify_teacher: \"Notify Teacher\"\n# create_teacher_account: \"Create free teacher account\"\n# enter_student_name: \"Your name:\"\n# enter_teacher_email: \"Your teacher's email:\"\n# teacher_email_placeholder: \"teacher.email@example.com\"\n# student_name_placeholder: \"type your name here\"\n# teachers_section: \"Teachers:\"\n# students_section: \"Students:\"\n# teacher_notified: \"We've notified your teacher that you want to play more CodeCombat in your classroom!\"\n\n delta:\n added: \"P\u0159id\u00e1no\"\n modified: \"Zm\u011bn\u011bno\"\n not_modified: \"Nezm\u011bn\u011bno\"\n deleted: \"Smaz\u00e1no\"\n moved_index: \"Index p\u0159em\u00edst\u011bn\"\n text_diff: \"Rozd\u00edl textu\"\n merge_conflict_with: \"SLOU\u010cIT V ROZPORU S\"\n no_changes: \"\u017d\u00e1dn\u00e9 zm\u011bny\"\n\n legal:\n page_title: \"Licence\"\n# opensource_introduction: \"CodeCombat is part of the open source community.\"\n opensource_description_prefix: \"Pod\u00edvejte se na \"\n github_url: \"na\u0161i str\u00e1nku na GitHubu\"\n opensource_description_center: \"a pokud se v\u00e1m chce, m\u016f\u017eete i pomoct! CodeCombat je vystav\u011bn na n\u011bkolika obl\u00edben\u00fdch svobodn\u00fdch projektech. Pod\u00edvejte se na\"\n archmage_wiki_url: \"na\u0161i wiki Arcikouzeln\u00edk\u016f \"\n opensource_description_suffix: \"pro seznam projekt\u016f, d\u00edky kter\u00fdm m\u016f\u017ee tato hra existovat.\"\n practices_title: \"Doporu\u010den\u00e9 postupy\"\n practices_description: \"Toto je p\u0159\u00edslib na\u0161eho p\u0159\u00edstupu v jednoduch\u00e9m jazyce.\"\n privacy_title: \"Soukrom\u00ed\"\n privacy_description: \"Neprod\u00e1me \u017e\u00e1dn\u00e9 va\u0161e osobn\u00ed informace.\"\n security_title: \"Zabezpe\u010den\u00ed\"\n security_description: \"Usilujeme o to, abychom udr\u017eeli va\u0161e osobn\u00ed informace v bezpe\u010d\u00ed. Jako otev\u0159en\u00fd projekt jsme p\u0159\u00edstupni komukoliv k proveden\u00ed kontroly k\u00f3du pro zlep\u0161en\u00ed na\u0161ich bezpe\u010dnostn\u00edch syst\u00e9m\u016f.\"\n email_title: \"Email\"\n email_description_prefix: \"Nebudeme v\u00e1s zaplavovat nevy\u017e\u00e1danou korespondenc\u00ed. Pomoc\u00ed \"\n email_settings_url: \" nastaven\u00ed emailu\"\n email_description_suffix: \"nebo skrze odkazy v odeslan\u00fdch emailech si m\u016f\u017eete nastavit nebo se kdykoliv odhl\u00e1sit z na\u0161\u00ed korespondence.\"\n cost_title: \"Cena\"\n# cost_description: \"CodeCombat is free to play for all of its core levels, with a ${{price}} USD\/mo subscription for access to extra level branches and {{gems}} bonus gems per month. You can cancel with a click, and we offer a 100% money-back guarantee.\"\n copyrights_title: \"Copyrights a Licence\"\n contributor_title: \"Licen\u010dn\u00ed ujedn\u00e1n\u00ed p\u0159isp\u00edvatel\u016f (CLA)\"\n contributor_description_prefix: \"V\u0161ichni p\u0159isp\u00edvatel\u00e9 jak na webu tak do projektu na GitHubu spadaj\u00ed pod na\u0161e \"\n cla_url: \"CLA\"\n contributor_description_suffix: \"se kter\u00fdm je nutno souhlasit p\u0159ed t\u00edm, ne\u017eli p\u0159isp\u011bjete.\"\n code_title: \"K\u00f3d - MIT\" # {change}\n# client_code_description_prefix: \"All client-side code for codecombat.com in the public GitHub repository and in the codecombat.com database, is licensed under the\"\n mit_license_url: \"MIT licenc\u00ed\"\n code_description_suffix: \"Zahrnut je ve\u0161ker\u00fd k\u00f3d v syst\u00e9mech a komponentech, kter\u00e9 jsou zp\u0159\u00edstupn\u011bn\u00e9 CodeCombatem pro vytv\u00e1\u0159en\u00ed \u00farovn\u00ed.\"\n art_title: \"Obr\u00e1zky\/Hudba - Creative Commons \"\n art_description_prefix: \"Ve\u0161ker\u00fd obecn\u00fd obsah je dostupn\u00fd pod \"\n cc_license_url: \"Mezin\u00e1rodn\u00ed Licenc\u00ed Creative Commons Attribution 4.0\"\n art_description_suffix: \"Obecn\u00fdm obsahem se rozum\u00ed v\u0161e dostupn\u00e9 na CodeCombatu, ur\u010den\u00e9 k vytv\u00e1\u0159en\u00ed \u00farovn\u00ed. To zahrnuje:\"\n art_music: \"Hudbu\"\n art_sound: \"Zvuky\"\n art_artwork: \"Um\u011bleck\u00e1 d\u00edla\"\n art_sprites: \"Dopl\u0148kov\u00fd k\u00f3d\"\n art_other: \"A ve\u0161ker\u00e9 dal\u0161\u00ed kreativn\u00ed pr\u00e1ce pou\u017eit\u00e9 p\u0159i vytv\u00e1\u0159en\u00ed \u00farovn\u00ed.\"\n art_access: \"Moment\u00e1ln\u011b neexistuje jednoduch\u00fd syst\u00e9m pro sta\u017een\u00ed t\u011bchto sou\u010d\u00e1st\u00ed, \u010d\u00e1st\u00ed \u00farovn\u00ed a podobn\u011b. Lze je st\u00e1hnout z URL adres na tomto webu, m\u016f\u017eete n\u00e1s kontaktovat se \u017e\u00e1dost\u00ed o informace nebo n\u00e1m i pomoci ve sd\u00edlen\u00ed a vytv\u00e1\u0159en\u00ed syst\u00e9mu pro jednoduch\u00e9 sd\u00edlen\u00ed t\u011bchto dopl\u0148kov\u00fdch sou\u010d\u00e1st\u00ed.\"\n art_paragraph_1: \"P\u0159i uv\u00e1d\u011bn\u00ed zdroje, uv\u00e1d\u011bjte pros\u00edm jm\u00e9no a odkaz na codecombat.com v m\u00edstech, kter\u00e1 jsou vhodn\u00e1 a kde je to mo\u017en\u00e9. Nap\u0159\u00edklad:\"\n use_list_1: \"P\u0159i pou\u017eit\u00ed ve filmu uve\u010fte codecombat.com v titulc\u00edch.\"\n use_list_2: \"P\u0159i pou\u017eit\u00ed na webu, zahr\u0148te odkaz nap\u0159\u00edklad pod obr\u00e1zkem\/odkazem, nebo na str\u00e1nce uv\u00e1d\u011bj\u00edc\u00ed zdroj, kde tak\u00e9 zm\u00edn\u00edte dal\u0161\u00ed Creative Commons d\u00edla a dal\u0161\u00ed pou\u017eit\u00e9 open source projekty. Ostatn\u00ed, na CodeCombat odkazuj\u00edc\u00ed se pr\u00e1ce (nap\u0159\u00edklad \u010dl\u00e1nek na blogu zmi\u0148uj\u00edc\u00ed CodeCombat) nen\u00ed nutno separ\u00e1tn\u011b ozna\u010dovat a uv\u00e1d\u011bt zdroj.\"\n art_paragraph_2: \"Vyu\u017e\u00edv\u00e1te-li obsah vytvo\u0159en\u00fd n\u011bkter\u00fdm u\u017eivatelem na codecombat.com, uv\u00e1d\u011bjte odkaz na zdroj p\u0159\u00edmo na tohoto autora a n\u00e1sledujte doporu\u010den\u00ed uv\u00e1d\u011bn\u00ed zdroje dan\u00e9ho obsahu, je-li uvedeno.\"\n rights_title: \"Pr\u00e1va vyhrazena\"\n rights_desc: \"V\u0161echna pr\u00e1va jsou vyhrazena jednotliv\u00fdm samostatn\u00fdm \u00farovn\u00edm. To zahrnuje\"\n rights_scripts: \"Skripty\"\n rights_unit: \"Unit konfigurace\"\n rights_writings: \"Z\u00e1pisy\"\n rights_media: \"M\u00e9dia (zvuky, hudba) a dal\u0161\u00ed tvo\u0159iv\u00fd obsah vytvo\u0159en\u00fd specificky pro tuto \u00farove\u0148, kter\u00fd nebyl zp\u0159\u00edstupn\u011bn p\u0159i vytv\u00e1\u0159en\u00ed \u00farovn\u011b.\"\n rights_clarification: \"Pro ujasn\u011bn\u00ed - v\u0161e, co je dostupn\u00e9 v editoru \u00farovn\u00ed p\u0159i vytv\u00e1\u0159en\u00ed \u00farovn\u011b spad\u00e1 pod CC, ale obsah vytvo\u0159en\u00fd v editoru \u00farovn\u00ed nebo nahran\u00fd p\u0159i vytv\u00e1\u0159en\u00ed spad\u00e1 pod \u00farove\u0148.\"\n nutshell_title: \"Ve zkratce\"\n nutshell_description: \"V\u0161e co je poskytnuto v editoru \u00farovn\u00ed je zdarma a m\u017eete toho vyu\u017e\u00edt p\u0159i vytv\u00e1\u0159en\u00ed \u00farovn\u00ed. Ale vyhrazujeme si pr\u00e1vo omezit distribuci \u00farovn\u00ed samotn\u00fdch (t\u011bch, kter\u00e9 byly vytvo\u0159eny na codecombat.com), tak\u017ee v budoucnu bude mo\u017eno tyto zpoplatnit, bude-li to v nejhor\u0161\u00edm p\u0159\u00edpad\u011b nutn\u00e9\"\n# nutshell_see_also: \"See also:\"\n canonical: \"Anglick\u00e1 verze tohoto dokumentu je p\u016fvodn\u00ed, rozhoduj\u00edc\u00ed verz\u00ed. Nastane-li rozd\u00edl v p\u0159ekladu, Anglick\u00e1 verze bude m\u00edt v\u017edy p\u0159ednost.\"\n# third_party_title: \"Third Party Services\"\n# third_party_description: \"CodeCombat uses the following third party services (among others):\"\n# cookies_message: \"CodeCombat uses a few essential and non-essential cookies.\"\n# cookies_deny: \"Decline non-essential cookies\"\n\n ladder_prizes:\n title: \"Ceny v turnaji\" # This section was for an old tournament and doesn't need new translations now.\n blurb_1: \"Tyto ceny budou rozd\u00e1ny v souladu s\"\n blurb_2: \"pravidly turnaje\"\n blurb_3: \"nejlep\u0161\u00edm lidsk\u00fdm a zlob\u0159\u00edm hr\u00e1\u010d\u016fm.\"\n blurb_4: \"Dva t\u00fdmy znamenaj\u00ed dvojn\u00e1sobek cen!\"\n blurb_5: \"(Budou dv\u011b prvn\u00ed m\u00edsta, dv\u011b druh\u00e1 m\u00edsta, atd.)\"\n rank: \"Um\u00edst\u011bn\u00ed\"\n prizes: \"Ceny\"\n total_value: \"Celkov\u00e1 hodnota\"\n in_cash: \"v pen\u011bz\u00edch\"\n custom_wizard: \"Vlastn\u00ed CodeCombat Kouzeln\u00edk\"\n custom_avatar: \"Vlastn\u00ed CodeCombat avatar\"\n heap: \"na \u0161est m\u011bs\u00edc\u016f \\\"Startup\\\" p\u0159\u00edstupu\"\n credits: \"tv\u016frci\"\n one_month_coupon: \"kupon: vybrat bu\u010f Rails nebo HTML\"\n one_month_discount: \"30% sleva: vybrat bu\u010f Rails nebo HTML\"\n license: \"licence\"\n oreilly: \"ebook vlastn\u00edho v\u00fdb\u011bru\"\n\n calendar:\n year: \"Rok\"\n day: \"Den\"\n month: \"M\u011bs\u00edc\"\n january: \"leden\"\n february: \"\u00fanor\"\n march: \"b\u0159ezen\"\n april: \"duben\"\n may: \"kv\u011bten\"\n june: \"\u010derven\"\n july: \"\u010dervenec\"\n august: \"srpen\"\n september: \"z\u00e1\u0159\u00ed\"\n october: \"\u0159\u00edjen\"\n november: \"listopad\"\n december: \"prosinec\"\n\n# code_play_create_account_modal:\n# title: \"You did it!\" # This section is only needed in US, UK, Mexico, India, and Germany\n# body: \"You are now on your way to becoming a master coder. Sign up to receive an extra 100 Gems<\/strong> & you will also be entered for a chance to win $2,500 & other Lenovo Prizes<\/strong>.\"\n# sign_up: \"Sign up & keep coding \u25b6\"\n# victory_sign_up_poke: \"Create a free account to save your code & be entered for a chance to win prizes!\"\n# victory_sign_up: \"Sign up & be entered to win $2,500<\/strong>\"\n\n# server_error:\n# email_taken: \"Email already taken\"\n# username_taken: \"Username already taken\"\n\n# esper:\n# line_no: \"Line $1: \"\n# uncaught: \"Uncaught $1\" # $1 will be an error type, eg \"Uncaught SyntaxError\"\n# reference_error: \"ReferenceError: \"\n# argument_error: \"ArgumentError: \"\n# type_error: \"TypeError: \"\n# syntax_error: \"SyntaxError: \"\n# error: \"Error: \"\n# x_not_a_function: \"$1 is not a function\"\n# x_not_defined: \"$1 is not defined\"\n# spelling_issues: \"Look out for spelling issues: did you mean `$1` instead of `$2`?\"\n# capitalization_issues: \"Look out for capitalization: `$1` should be `$2`.\"\n# py_empty_block: \"Empty $1. Put 4 spaces in front of statements inside the $2 statement.\"\n# fx_missing_paren: \"If you want to call `$1` as a function, you need `()`'s\"\n# unmatched_token: \"Unmatched `$1`. Every opening `$2` needs a closing `$3` to match it.\"\n# unterminated_string: \"Unterminated string. Add a matching `\\\"` at the end of your string.\"\n# missing_semicolon: \"Missing semicolon.\"\n# missing_quotes: \"Missing quotes. Try `$1`\"\n# argument_type: \"`$1`'s argument `$2` should have type `$3`, but got `$4`: `$5`.\"\n# argument_type2: \"`$1`'s argument `$2` should have type `$3`, but got `$4`.\"\n# target_a_unit: \"Target a unit.\"\n# attack_capitalization: \"Attack $1, not $2. (Capital letters are important.)\"\n# empty_while: \"Empty while statement. Put 4 spaces in front of statements inside the while statement.\"\n# line_of_site: \"`$1`'s argument `$2` has a problem. Is there an enemy within your line-of-sight yet?\"\n# need_a_after_while: \"Need a `$1` after `$2`.\"\n# too_much_indentation: \"Too much indentation at the beginning of this line.\"\n# missing_hero: \"Missing `$1` keyword; should be `$2`.\"\n# takes_no_arguments: \"`$1` takes no arguments.\"\n# no_one_named: \"There's no one named \\\"$1\\\" to target.\"\n# separated_by_comma: \"Function calls paramaters must be seperated by `,`s\"\n# protected_property: \"Can't read protected property: $1\"\n# need_parens_to_call: \"If you want to call `$1` as function, you need `()`'s\"\n# expected_an_identifier: \"Expected an identifier and instead saw '$1'.\"\n# unexpected_identifier: \"Unexpected identifier\"\n# unexpected_end_of: \"Unexpected end of input\"\n# unnecessary_semicolon: \"Unnecessary semicolon.\"\n# unexpected_token_expected: \"Unexpected token: expected $1 but found $2 while parsing $3\"\n# unexpected_token: \"Unexpected token $1\"\n# unexpected_token2: \"Unexpected token\"\n# unexpected_number: \"Unexpected number\"\n# unexpected: \"Unexpected '$1'.\"\n# escape_pressed_code: \"Escape pressed; code aborted.\"\n# target_an_enemy: \"Target an enemy by name, like `$1`, not the string `$2`.\"\n# target_an_enemy_2: \"Target an enemy by name, like $1.\"\n# cannot_read_property: \"Cannot read property '$1' of undefined\"\n# attempted_to_assign: \"Attempted to assign to readonly property.\"\n# unexpected_early_end: \"Unexpected early end of program.\"\n# you_need_a_string: \"You need a string to build; one of $1\"\n# unable_to_get_property: \"Unable to get property '$1' of undefined or null reference\" # TODO: Do we translate undefined\/null?\n# code_never_finished_its: \"Code never finished. It's either really slow or has an infinite loop.\"\n# unclosed_string: \"Unclosed string.\"\n# unmatched: \"Unmatched '$1'.\"\n# error_you_said_achoo: \"You said: $1, but the password is: $2. (Capital letters are important.)\"\n# indentation_error_unindent_does: \"Indentation Error: unindent does not match any outer indentation level\"\n# indentation_error: \"Indentation error.\"\n# need_a_on_the: \"Need a `:` on the end of the line following `$1`.\"\n# attempt_to_call_undefined: \"attempt to call '$1' (a nil value)\"\n# unterminated: \"Unterminated `$1`\"\n# target_an_enemy_variable: \"Target an $1 variable, not the string $2. (Try using $3.)\"\n# error_use_the_variable: \"Use the variable name like `$1` instead of a string like `$2`\"\n# indentation_unindent_does_not: \"Indentation unindent does not match any outer indentation level\"\n# unclosed_paren_in_function_arguments: \"Unclosed $1 in function arguments.\"\n# unexpected_end_of_input: \"Unexpected end of input\"\n# there_is_no_enemy: \"There is no `$1`. Use `$2` first.\" # Hints start here\n# try_herofindnearestenemy: \"Try `$1`\"\n# there_is_no_function: \"There is no function `$1`, but `$2` has a method `$3`.\"\n# attacks_argument_enemy_has: \"`$1`'s argument `$2` has a problem.\"\n# is_there_an_enemy: \"Is there an enemy within your line-of-sight yet?\"\n# target_is_null_is: \"Target is $1. Is there always a target to attack? (Use $2?)\"\n# hero_has_no_method: \"`$1` has no method `$2`.\"\n# there_is_a_problem: \"There is a problem with your code.\"\n# did_you_mean: \"Did you mean $1? You do not have an item equipped with that skill.\"\n# missing_a_quotation_mark: \"Missing a quotation mark. \"\n# missing_var_use_var: \"Missing `$1`. Use `$2` to make a new variable.\"\n# you_do_not_have: \"You do not have an item equipped with the $1 skill.\"\n# put_each_command_on: \"Put each command on a separate line\"\n# are_you_missing_a: \"Are you missing a '$1' after '$2'? \"\n# your_parentheses_must_match: \"Your parentheses must match.\"\n\n# apcsp:\n# syllabus: \"AP CS Principles Syllabus\"\n# syllabus_description: \"Use this resource to plan CodeCombat curriculum for your AP Computer Science Principles class.\"\n# computational_thinking_practices: \"Computational Thinking Practices\"\n# learning_objectives: \"Learning Objectives\"\n# curricular_requirements: \"Curricular Requirements\"\n# unit_1: \"Unit 1: Creative Technology\"\n# unit_1_activity_1: \"Unit 1 Activity: Technology Usability Review\"\n# unit_2: \"Unit 2: Computational Thinking\"\n# unit_2_activity_1: \"Unit 2 Activity: Binary Sequences\"\n# unit_2_activity_2: \"Unit 2 Activity: Computing Lesson Project\"\n# unit_3: \"Unit 3: Algorithms\"\n# unit_3_activity_1: \"Unit 3 Activity: Algorithms - Hitchhiker's Guide\"\n# unit_3_activity_2: \"Unit 3 Activity: Simulation - Predator & Prey\"\n# unit_3_activity_3: \"Unit 3 Activity: Algorithms - Pair Design and Programming\"\n# unit_4: \"Unit 4: Programming\"\n# unit_4_activity_1: \"Unit 4 Activity: Abstractions\"\n# unit_4_activity_2: \"Unit 4 Activity: Searching & Sorting\"\n# unit_4_activity_3: \"Unit 4 Activity: Refactoring\"\n# unit_5: \"Unit 5: The Internet\"\n# unit_5_activity_1: \"Unit 5 Activity: How the Internet Works\"\n# unit_5_activity_2: \"Unit 5 Activity: Internet Simulator\"\n# unit_5_activity_3: \"Unit 5 Activity: Chat Room Simulation\"\n# unit_5_activity_4: \"Unit 5 Activity: Cybersecurity\"\n# unit_6: \"Unit 6: Data\"\n# unit_6_activity_1: \"Unit 6 Activity: Introduction to Data\"\n# unit_6_activity_2: \"Unit 6 Activity: Big Data\"\n# unit_6_activity_3: \"Unit 6 Activity: Lossy & Lossless Compression\"\n# unit_7: \"Unit 7: Personal & Global Impact\"\n# unit_7_activity_1: \"Unit 7 Activity: Personal & Global Impact\"\n# unit_7_activity_2: \"Unit 7 Activity: Crowdsourcing\"\n# unit_8: \"Unit 8: Performance Tasks\"\n# unit_8_description: \"Prepare students for the Create Task by building their own games and practicing key concepts.\"\n# unit_8_activity_1: \"Create Task Practice 1: Game Development 1\"\n# unit_8_activity_2: \"Create Task Practice 2: Game Development 2\"\n# unit_8_activity_3: \"Create Task Practice 3: Game Development 3\"\n# unit_9: \"Unit 9: AP Review\"\n# unit_10: \"Unit 10: Post-AP\"\n# unit_10_activity_1: \"Unit 10 Activity: Web Quiz\"\n\n# parent_landing:\n# slogan_quote: \"\\\"CodeCombat is really fun, and you learn a lot.\\\"\"\n# quote_attr: \"5th Grader, Oakland, CA\"\n# refer_teacher: \"Refer a Teacher\"\n# focus_quote: \"Unlock your child's future\"\n# value_head1: \"The most engaging way to learn typed code\"\n# value_copy1: \"CodeCombat is child\u2019s personal tutor. Covering material aligned with national curriculum standards, your child will program algorithms, build websites and even design their own games.\"\n# value_head2: \"Building critical skills for the 21st century\"\n# value_copy2: \"Your kids will learn how to navigate and become citizens in the digital world. CodeCombat is a solution that enhances your child\u2019s critical thinking and resilience.\"\n# value_head3: \"Heroes that your child will love\"\n# value_copy3: \"We know how important fun and engagement is for the developing brain, so we\u2019ve packed in as much learning as we can while wrapping it up in a game they'll love.\"\n# dive_head1: \"Not just for software engineers\"\n# dive_intro: \"Computer science skills have a wide range of applications. Take a look at a few examples below!\"\n# medical_flag: \"Medical Applications\"\n# medical_flag_copy: \"From mapping of the human genome to MRI machines, coding allows us to understand the body in ways we\u2019ve never been able to before.\"\n# explore_flag: \"Space Exploration\"\n# explore_flag_copy: \"Apollo got to the Moon thanks to hardworking human computers, and scientists use computer programs to analyze the gravity of planets and search for new stars.\"\n# filmaking_flag: \"Filmmaking and Animation\"\n# filmaking_flag_copy: \"From the robotics of Jurassic Park to the incredible animation of Dreamworks and Pixar, films wouldn\u2019t be the same without the digital creatives behind the scenes.\"\n# dive_head2: \"Games are important for learning\"\n# dive_par1: \"Multiple studies have found that game-based learning promotes\"\n# dive_link1: \"cognitive development\"\n# dive_par2: \"in kids while also proving to be\"\n# dive_link2: \"more effective\"\n# dive_par3: \"in helping students\"\n# dive_link3: \"learn and retain knowledge\"\n# dive_par4: \",\"\n# dive_link4: \"concentrate\"\n# dive_par5: \", and perform at a higher level of achievement.\"\n# dive_par6: \"Game based learning is also good for developing\"\n# dive_link5: \"resilience\"\n# dive_par7: \", cognitive reasoning, and\"\n# dive_par8: \". Science is just telling us what learners already know. Children learn best by playing.\"\n# dive_link6: \"executive functions\"\n# dive_head3: \"Team up with teachers\"\n# dive_3_par1: \"In the future, \"\n# dive_3_link1: \"coding is going to be as fundamental as learning to read and write\"\n# dive_3_par2: \". We\u2019ve worked closely with teachers to design and develop our content, and we can't wait to get your kids learning. Educational technology programs like CodeCombat work best when the teachers implement them consistently. Help us make that connection by introducing us to your child\u2019s teachers!\"\n# mission: \"Our mission: to teach and engage\"\n# mission1_heading: \"Coding for today's generation\"\n# mission2_heading: \"Preparing for the future\"\n# mission3_heading: \"Supported by parents like you\"\n# mission1_copy: \"Our education specialists work closely with teachers to meet children where they are in the educational landscape. Kids learn skills that can be applied outside of the game because they learn how to solve problems, no matter what their learning style is.\"\n# mission2_copy: \"A 2016 survey showed that 64% of girls in 3-5th grade want to learn how to code. There were 7 million job openings in 2015 required coding skills. We built CodeCombat because every child should be given a chance to create their best future.\"\n# mission3_copy: \"At CodeCombat, we\u2019re parents. We\u2019re coders. We\u2019re educators. But most of all, we\u2019re people who believe in giving our kids the best opportunity for success in whatever it is they decide to do.\"\n\n# parent_modal:\n# refer_teacher: \"Refer Teacher\"\n# name: \"Your Name\"\n# parent_email: \"Your Email\"\n# teacher_email: \"Teacher's Email\"\n# message: \"Message\"\n# custom_message: \"I just found CodeCombat and thought it'd be a great program for your classroom! It's a computer science learning platform with standards-aligned curriculum.\\n\\nComputer literacy is so important and I think this would be a great way to get students engaged in learning to code.\"\n# send: \"Send Email\"\n\n# hoc_2018:\n# banner: \"Happy Computer Science Education Week 2018!\"\n# page_heading: \"Your students will learn to code by building their own game!\"\n# step_1: \"Step 1: Watch Video Overview\"\n# step_2: \"Step 2: Try it Yourself\"\n# step_3: \"Step 3: Download Lesson Plan\"\n# try_activity: \"Try Activity\"\n# download_pdf: \"Download PDF\"\n# teacher_signup_heading: \"Turn Hour of Code into a Year of Code\"\n# teacher_signup_blurb: \"Everything you need to teach computer science, no prior experience needed.\"\n# teacher_signup_input_blurb: \"Get first course free:\"\n# teacher_signup_input_placeholder: \"Teacher email address\"\n# teacher_signup_input_button: \"Get CS1 Free\"\n# activities_header: \"More Hour of Code Activities\"\n# activity_label_1: \"Escape the Dungeon!\"\n# activity_label_2: \" Beginner: Build a Game!\"\n# activity_label_3: \"Advanced: Build an Arcade Game!\"\n# activity_button_1: \"View Lesson\"\n# about: \"About CodeCombat\"\n# about_copy: \"A game-based, standards-aligned computer science program that teaches real, typed Python and JavaScript.\"\n# point1: \"\u2713 Scaffolded\"\n# point2: \"\u2713 Differentiated\"\n# point3: \"\u2713 Assessments\"\n# point4: \"\u2713 Project-based courses\"\n# point5: \"\u2713 Student tracking\"\n# point6: \"\u2713 Full lesson plans\"\n# title: \"HOUR OF CODE 2018\"\n# acronym: \"HOC\"\n\n# hoc_2018_interstitial:\n# welcome: \"Welcome to CodeCombat's Hour of Code 2018!\"\n# educator: \"I'm an educator\"\n# show_resources: \"Show me teacher resources!\"\n# student: \"I'm a student\"\n# ready_to_code: \"I'm ready to code!\"\n\n# hoc_2018_completion:\n# congratulations: \"Congratulations on completing Code, Play, Share!<\/b>\"\n# send: \"Send your Hour of Code game to friends and family!\"\n# copy: \"Copy URL\"\n# get_certificate: \"Get a certificate of completion to celebrate with your class!\"\n# get_cert_btn: \"Get Certificate\"\n# first_name: \"First Name\"\n# last_initial: \"Last Initial\"\n# teacher_email: \"Teacher's email address\"\n","avg_line_length":55.7654686921,"max_line_length":572,"alphanum_fraction":0.7390356851} {"size":165,"ext":"coffee","lang":"CoffeeScript","max_stars_count":3084.0,"content":"mailers =\n 'reset-password': require '.\/reset-password'\n 'verify': require '.\/verify'\n\nmailer = module.exports\n\nmailer.getMailer = (template) -> mailers[template]\n","avg_line_length":20.625,"max_line_length":50,"alphanum_fraction":0.703030303} {"size":3927,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"http = require 'http'\ndebug = require('debug')('meshblu-connector-xenserver:VmLifecycle')\n\nclass VmLifecycle\n constructor: ({@connector}) ->\n throw new Error 'VmLifecycle requires connector' unless @connector?\n \n do: ({data}, callback) =>\n return callback @_userError(422, 'either data.name or data.uuid is required') unless data?.name? || data?.uuid?\n return callback @_userError(422, 'data.operation is required') unless data?.operation?\n \n {operation} = data\n {name} = data if data?.name?\n {uuid} = data if data?.uuid?\n {destination} = data if data?.destination?\n\n metadata =\n code: 200\n status: http.STATUS_CODES[200]\n\n if operation == \"migrate\"\n if not destination\n return callback @_userError(422, 'data.destination is required for migrate') unless data?.destination?\n\n @connector.getXapi().then((xapi) =>\n # Look up the VM by name or UUID (based on what the user supplied - if both, favour the more precise UUID)\n lookuplist = []\n lookupvm = {\n class: \"VM\"\n uuid: uuid\n name: name\n }\n lookuplist.push(lookupvm)\n \n # For a VM migrate we also need to lookup the destination host\n if destination\n lookuphost = {\n class: \"host\"\n name: destination\n }\n lookuplist.push(lookuphost)\n \n @connector.findObjects(lookuplist).then((results) =>\n vmref = null\n hostref = null\n\n if results\n if results[0]\n if results[0].length > 0\n vmref = results[0][0]\n if destination && (results.length > 1) && results[1] && results[1].length > 0\n hostref = results[1][0]\n \n debug(\"VMref \" + vmref) \n if !vmref\n if uuid\n message = \"Cannot find VM \" + uuid\n else\n message = \"Cannot find VM \" + name\n status = \"error\"\n data = {message, status}\n callback null, {metadata, data}\n return\n \n if destination\n debug(\"hostref \" + hostref)\n if !hostref\n message = \"Cannot find host \" + destination\n status = \"error\"\n data = {message, status}\n callback null, {metadata, data}\n return\n \n switch operation\n when 'start'\n if destination\n callargs = ['VM.start_on', vmref, hostref, false, false]\n else\n callargs = ['VM.start', vmref, false, false]\n when 'shutdown' then callargs = ['VM.shutdown', vmref]\n when 'reboot' then callargs = ['VM.clean_reboot', vmref]\n when 'migrate' then callargs = ['VM.pool_migrate', vmref, hostref, {\"live\": \"true\"}]\n else return callback @_userError(422, 'Unknown operation ' + operation)\n\n xapi.call.apply(xapi, callargs).then((response) =>\n \n if uuid\n message = \"Executed VM \" + operation + \" on \" + uuid\n else\n message = \"Executed VM \" + operation + \" on \" + name\n status = \"ok\"\n data = {message, status}\n \n debug \"Success \" + data\n callback null, {metadata, data}\n \n ).catch((error) =>\n message = error.toString()\n status = \"error\"\n data = {message, status}\n\n debug \"Error \" + data\n callback null, {metadata, data}\n )\n ).catch((error) =>\n message = error\n status = \"error\"\n data = {message, status}\n callback null, {metadata, data}\n return\n )\n ).catch((error) =>\n message = \"XenServer connection not available\"\n status = \"error\"\n data = {message, status}\n callback null, {metadata, data}\n return\n )\n \n _userError: (code, message) =>\n error = new Error message\n error.code = code\n return error\n\nmodule.exports = VmLifecycle\n","avg_line_length":31.1666666667,"max_line_length":115,"alphanum_fraction":0.5462184874} {"size":238,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"$ ->\n $(document).on 'ajax:before', '.edit_donation, .new_donation', ->\n $('#js-edit_donation').dialog(\"destroy\")\n $.mpdx.ajaxBefore()\n\n $(document).on 'click', '.delete_donation', ->\n $('#js-edit_donation').dialog(\"destroy\")\n\n","avg_line_length":26.4444444444,"max_line_length":67,"alphanum_fraction":0.6092436975} {"size":330,"ext":"coffee","lang":"CoffeeScript","max_stars_count":3.0,"content":"exports.glyphs['O_sc'] =\n\tunicode: '\u1d0f'\n\tglyphName: 'osmall'\n\tcharacterName: 'LATIN LETTER SMALL CAPITAL O'\n\tbase: 'O_cap'\n\tadvanceWidth: base.advanceWidth\n\ttransforms: Array(\n\t\t['skewX', slant + 'deg']\n\t)\n\ttags: [\n\t\t'all',\n\t\t'latin',\n\t\t'smallcap'\n\t]\n\tparameters:\n\t\tcapHeight: scCapHeight\n\t\tthickness: scThickness\n\t\twidth: scWidth\n","avg_line_length":17.3684210526,"max_line_length":46,"alphanum_fraction":0.6787878788} {"size":2515,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"import * as _ from \"underscore\"\n\nimport {GestureTool, GestureToolView} from \".\/gesture_tool\"\nimport * as p from \"..\/..\/..\/core\/properties\"\n\nexport class WheelPanToolView extends GestureToolView\n\n _scroll: (e) ->\n # we need a browser-specific multiplier to have similar experiences\n if navigator.userAgent.toLowerCase().indexOf(\"firefox\") > -1\n multiplier = 20\n else\n multiplier = 1\n\n if e.originalEvent?.deltaY?\n delta = -e.originalEvent.deltaY * multiplier\n else\n delta = e.bokeh.delta\n\n factor = @model.speed * delta\n\n # clamp the magnitude of factor, if it is > 1 bad things happen\n if factor > 0.9\n factor = 0.9\n else if factor < -0.9\n factor = -0.9\n\n @_update_ranges(factor)\n\n _update_ranges: (factor) ->\n frame = @plot_model.frame\n hr = frame.h_range\n vr = frame.v_range\n\n [vx_low, vx_high] = [hr.start, hr.end]\n [vy_low, vy_high] = [vr.start, vr.end]\n\n switch @model.dimension\n when \"height\"\n vy_range = Math.abs(vy_high - vy_low)\n sx0 = vx_low\n sx1 = vx_high\n sy0 = vy_low + vy_range * factor\n sy1 = vy_high + vy_range * factor\n when \"width\"\n vx_range = Math.abs(vx_high - vx_low)\n sx0 = vx_low - vx_range * factor\n sx1 = vx_high - vx_range * factor\n sy0 = vy_low\n sy1 = vy_high\n\n xrs = {}\n for name, mapper of frame.x_mappers\n [start, end] = mapper.v_map_from_target([sx0, sx1], true)\n xrs[name] = {start: start, end: end}\n\n yrs = {}\n for name, mapper of frame.y_mappers\n [start, end] = mapper.v_map_from_target([sy0, sy1], true)\n yrs[name] = {start: start, end: end}\n\n # OK this sucks we can't set factor independently in each direction. It is used\n # for GMap plots, and GMap plots always preserve aspect, so effective the value\n # of 'dimensions' is ignored.\n pan_info = {\n xrs: xrs\n yrs: yrs\n factor: factor\n }\n @plot_view.push_state('wheel_pan', {range: pan_info})\n @plot_view.update_range(pan_info, false, true)\n @plot_view.interactive_timestamp = Date.now()\n return null\n\n\nexport class WheelPanTool extends GestureTool\n type: 'WheelPanTool'\n default_view: WheelPanToolView\n tool_name: \"Wheel Pan\"\n icon: \"bk-tool-icon-wheel-pan\"\n event_type: 'scroll'\n default_order: 12\n\n @getters {\n tooltip: () -> @_get_dim_tooltip(@tool_name, @dimension)\n }\n\n @define {\n dimension: [ p.Dimension, \"width\" ]\n }\n\n @internal {\n speed: [ p.Number, 1\/1000 ]\n }\n","avg_line_length":26.4736842105,"max_line_length":83,"alphanum_fraction":0.6314115308} {"size":386,"ext":"coffee","lang":"CoffeeScript","max_stars_count":13.0,"content":"import g from '.\/globals'\n\nexport arrayToObject = (arr) -> Object.assign {}, ...arr.map (item) ->\n\t[Array.isArray(item) and item[0] or item]: Array.isArray(item) and item[1] or item\n\n\nexport isLiterate = (filename) ->\n\tfilename.toLocaleLowerCase().split('.')[-1..][0].startsWith('lit')\n\nexport isCoffeeFile = (f) ->\n\tf.match new RegExp g.CoffeeExtensions.join('|').replace(\/\\.\/g,'\\\\.')\n","avg_line_length":32.1666666667,"max_line_length":83,"alphanum_fraction":0.6580310881} {"size":415,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"before (done) ->\n util.project.install_dependencies('*\/*', done)\n\nafter ->\n util.project.remove_folders('**\/public')\n\ndescribe 'constructor', ->\n\n it 'fails when given nonexistant path', ->\n (-> project = new Roots('sdfsdfsd')).should.throw(Error)\n\n it 'exposes config and root', ->\n project = new Roots(path.join(base_path, 'compile\/basic'))\n project.root.should.exist\n project.config.should.exist\n","avg_line_length":25.9375,"max_line_length":62,"alphanum_fraction":0.6795180723} {"size":335,"ext":"cjsx","lang":"CoffeeScript","max_stars_count":48.0,"content":"React = require 'react'\n\n# Place within a form where a generic error message can be returned\nmodule.exports = class ErrorSummary extends React.Component\n\n @propTypes =\n message: React.PropTypes.string\n\n\n render: ->\n return null unless @props.message?\n\n
\n {@props.message}\n <\/div>\n","avg_line_length":20.9375,"max_line_length":67,"alphanum_fraction":0.7014925373} {"size":927,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"specialProperties = ['included', 'extended', 'prototype', 'ClassMethods', 'InstanceMethods']\n\nclass Tower.Class\n @mixin: (self, object) ->\n for key, value of object when key not in specialProperties\n self[key] = value\n\n object\n \n @extend: (object) ->\n extended = object.extended \n delete object.extended\n \n @mixin(@, object)\n \n extended.apply(object) if extended\n \n object\n\n @self: @extend\n\n @include: (object) ->\n included = object.included\n delete object.included\n \n @extend(object.ClassMethods) if object.hasOwnProperty(\"ClassMethods\")\n @include(object.InstanceMethods) if object.hasOwnProperty(\"InstanceMethods\")\n \n @mixin(@::, object)\n\n included.apply(object) if included\n\n object\n\n @className: ->\n _.functionName(@)\n\n className: ->\n @constructor.className()\n\n constructor: ->\n @initialize()\n\n initialize: ->\n\nmodule.exports = Tower.Class\n","avg_line_length":19.7234042553,"max_line_length":92,"alphanum_fraction":0.6515641855} {"size":840,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"jQuery.fn.liveForm = ->\n this.each ->\n form = $(this)\n\n $('#main').prepend('
<\/div>')\n preview_button = $('input[formaction*=\"preview\"]')\n preview_button.remove()\n\n send_form = (form) ->\n form.ajaxSubmit(\n url: preview_button.attr(\"formaction\")\n beforeSend: ->\n $('#preview').addCargando()\n success: (data) ->\n $('#preview').html($('#preview', data).html())\n .removeCargando().imagenesQuitables().worldMaps()\n $('#sidebar').remove()\n $('#sidebar', data).prependTo('#extra')\n )\n\n $('input[type=text], textarea', form).typeWatch(\n callback: -> send_form(form)\n wait: 1000\n highlight: false\n captureLenght: 1\n )\n\n send_form(form)\n\n\n$(document).ready -> $('form.pagina').liveForm()\n","avg_line_length":26.25,"max_line_length":61,"alphanum_fraction":0.5357142857} {"size":1575,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"{$} = require 'atom'\nfs = require 'fs-plus'\npath = require 'path'\nseason = require 'season'\n\nmodule.exports =\n configDefaults:\n x: 0\n y: 0\n width: 0\n height: 0\n treeWidth: 0\n storeOutsideMainConfig: false\n\n activate: (state) ->\n setWindowDimensions()\n $(window).on 'resize beforeunload', -> saveWindowDimensions()\n\nbuildConfig = (x=0, y=0, width=0, height=0, treeWidth=0) ->\n {\n x: x\n y: y\n width: width\n height: height\n treeWidth: treeWidth\n }\n\nstoreOutsideMainConfig = ->\n atom.config.get('remember-window.storeOutsideMainConfig')\n\ngetConfig = ->\n if storeOutsideMainConfig()\n configPath = path.join(atom.getConfigDirPath(), 'remember-window.cson')\n if fs.existsSync(configPath)\n season.readFileSync(configPath)\n else\n buildConfig()\n else\n atom.config.get('remember-window')\n\nsetConfig = (config) ->\n if storeOutsideMainConfig()\n season.writeFileSync(path.join(atom.getConfigDirPath(), 'remember-window.cson'), config)\n else\n atom.config.set('remember-window', config)\n\nsetWindowDimensions = ->\n {x, y, width, height, treeWidth} = getConfig()\n\n if x is 0 and y is 0 and width is 0 and height is 0 and treeWidth is 0\n saveWindowDimensions()\n else\n $('.tree-view-resizer').width(treeWidth)\n atom.setWindowDimensions\n 'x': x\n 'y': y\n 'width': width\n 'height': height\n\nsaveWindowDimensions = ->\n {x, y, width, height} = atom.getWindowDimensions()\n treeWidth = $('.tree-view-resizer').width()\n config = buildConfig(x, y, width, height, treeWidth)\n setConfig(config)\n","avg_line_length":24.2307692308,"max_line_length":92,"alphanum_fraction":0.6653968254} {"size":4171,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"require('chai').should()\n\nrequire('..\/..\/main\/common\/utils.coffee')\nrequire('..\/..\/main\/common\/constants.coffee')\nrequire('..\/..\/main\/common\/Battler.coffee')\nrequire('..\/..\/main\/common\/Actor.coffee')\nrequire('..\/..\/main\/common\/State.coffee')\nrequire('..\/..\/main\/common\/Item.coffee')\nrequire('..\/..\/main\/common\/ItemContainer.coffee')\nrequire('..\/..\/main\/common\/UsableCounter.coffee')\nrequire('..\/..\/main\/common\/Effect.coffee')\nrequire('..\/..\/main\/common\/EquipItem.coffee')\n\ndescribe 'rpg.EquipItem', ->\n item = null\n describe '\u57fa\u672c', ->\n it 'init', ->\n item = new rpg.EquipItem name: 'EquipItem001'\n item.name.should.equal 'EquipItem001'\n item.equip.should.equal true\n it 'ability', ->\n item = new rpg.EquipItem\n name: 'EquipItem001'\n abilities: [\n {str:10}\n ]\n n = item.ability base:5, ability:'str'\n n.should.equal 10\n it '\u653b\u6483\u529b\u8a2d\u5b9a', ->\n item = new rpg.EquipItem\n name: 'EquipItem001'\n patk: 50\n item.patk.should.equal 50\n item.str.should.equal 0\n item.price.should.equal 2500\n it '\u529b\u30a2\u30c3\u30d7', ->\n item = new rpg.EquipItem\n name: 'EquipItem001'\n patk: 50\n str: 10\n item.patk.should.equal 50\n item.str.should.equal 10\n it '\u30bb\u30fc\u30d6\u30ed\u30fc\u30c9', ->\n json = rpg.utils.createJsonData(item)\n o = rpg.utils.createRpgObject(json)\n jsontest = rpg.utils.createJsonData(o)\n jsontest.should.equal json\n describe '\u88c5\u5099\u53ef\u80fd\u5224\u5b9a', ->\n describe '\uff11\u304b\u6240', ->\n it '\u88c5\u5099\u5834\u6240\u30c1\u30a7\u30c3\u30af', ->\n item = new rpg.EquipItem\n name: 'EquipItem001'\n patk: 50\n equips: ['head']\n it '\u982d\u306b\u306f\u88c5\u5099\u53ef\u80fd', ->\n r = item.checkEquips 'head'\n r.should.equal true\n it '\u982d\u306b\u306f\u88c5\u5099\u53ef\u80fd', ->\n r = item.checkEquips ['head']\n r.should.equal true\n it '\u8db3\u306b\u306f\u88c5\u5099\u4e0d\u53ef', ->\n r = item.checkEquips 'legs'\n r.should.equal false\n it '\u8db3\u306b\u306f\u88c5\u5099\u4e0d\u53ef', ->\n r = item.checkEquips ['legs']\n r.should.equal false\n it '\u982d\u3068\u8db3\u306b\u306f\u88c5\u5099\u4e0d\u53ef', ->\n r = item.checkEquips ['head','legs']\n r.should.equal false\n describe '\uff12\u304b\u6240', ->\n it '\u88c5\u5099\u5834\u6240\u30c1\u30a7\u30c3\u30af\uff08\u30ea\u30b9\u30c8\uff09', ->\n item = new rpg.EquipItem\n name: 'EquipItem001'\n patk: 50\n equips: ['left_hand','right_hand']\n it '\u982d\u306b\u306f\u88c5\u5099\u4e0d\u53ef', ->\n r = item.checkEquips 'head'\n r.should.equal false\n it '\u982d\u306b\u306f\u88c5\u5099\u4e0d\u53ef', ->\n r = item.checkEquips ['head']\n r.should.equal false\n it '\u5de6\u624b\u306e\u307f\u306b\u306f\u88c5\u5099\u4e0d\u53ef', ->\n r = item.checkEquips 'left_hand'\n r.should.equal false\n it '\u5de6\u624b\u306e\u307f\u306b\u306f\u88c5\u5099\u4e0d\u53ef', ->\n r = item.checkEquips ['left_hand']\n r.should.equal false\n it '\u982d\u3068\u8db3\u306b\u306f\u88c5\u5099\u4e0d\u53ef', ->\n r = item.checkEquips ['head','legs']\n r.should.equal false\n it '\u4e21\u624b\u306a\u3089\u88c5\u5099\u53ef\u80fd', ->\n r = item.checkEquips ['left_hand','right_hand']\n r.should.equal true\n describe '\u88c5\u5099\u53ef\u80fd\u6761\u4ef6', ->\n it '\u88c5\u5099\u53ef\u80fd\u6761\u4ef6\u306a\u3057\u306f\u3001\u88c5\u5099\u53ef\u80fd\u3068\u5224\u65ad', ->\n item = new rpg.EquipItem\n name: 'EquipItem001'\n patk: 50\n equips: ['left_hand','right_hand']\n battler = new rpg.Battler base:{str: 10}\n r = item.checkRequired battler\n r.should.equal true\n it 'str \u304c 10 \u4ee5\u4e0a\u3058\u3083\u306a\u3044\u3068\u30c0\u30e1', ->\n item = new rpg.EquipItem\n name: 'EquipItem001'\n patk: 50\n equips: ['left_hand','right_hand']\n required: [\n ['str', '>=', 10]\n ]\n battler = new rpg.Battler base:{str: 10}\n battler.str.should.equal 10\n r = item.checkRequired battler\n r.should.equal true\n battler = new rpg.Battler base:{str: 9}\n battler.str.should.equal 9\n r = item.checkRequired battler\n r.should.equal false\n it 'str \u304c 10 \u4ee5\u4e0a vit \u304c 5\u4ee5\u4e0b\u3058\u3083\u306a\u3044\u3068\u30c0\u30e1', ->\n item = new rpg.EquipItem\n name: 'EquipItem001'\n patk: 50\n equips: ['left_hand','right_hand']\n required: [\n ['str', '>=', 10]\n ['vit', '<=', 5]\n ]\n battler = new rpg.Battler base:{str: 10,vit:5}\n r = item.checkRequired battler\n r.should.equal true\n battler = new rpg.Battler base:{str: 10,vit:6}\n r = item.checkRequired battler\n r.should.equal false\n","avg_line_length":31.1268656716,"max_line_length":55,"alphanum_fraction":0.5535842724} {"size":3809,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"# TODO: compile snippet with correct file so relative #metaimports can be resolved correctly\n# TODO: ship mjsish with plugin\n# TODO: open separate repls for different packages and eval on correct one\n# TODO: show javascript code in a separate pane\n\n{View} = require 'space-pen'\n{packageRootOf} = require '.\/packages'\n{inspect} = require 'util'\n{addLinks, onClickStackTrace} = require '.\/stack-trace-links'\n\nmodule.exports =\nclass MetaScriptReplView extends View\n @content: ->\n @div class: 'language-meta-script tool-panel panel-bottom', =>\n @div class: 'title panel-heading', =>\n @span class: 'icon-x', click: 'toggle'\n @span 'Ready', outlet: 'title'\n @div class: 'panel-body padded', =>\n @pre '', class: 'mjsish-output', outlet: 'output'\n\n initialize: (serializeState) ->\n atom.commands.add \"atom-text-editor\", \"meta-script-repl:toggle\", => @toggle()\n atom.commands.add \"atom-text-editor\", \"meta-script-repl:eval\", => @eval()\n @output.on 'click', 'a', onClickStackTrace\n\n serialize: ->\n\n destroy: ->\n @killRepl()\n @detach()\n\n reset: ->\n @title.text 'Ready'\n @clearStatusClasses @title\n @output.text ''\n\n clearStatusClasses: (node) ->\n node.removeClass('success error warning')\n\n toggle: ->\n if @hasParent()\n @detach()\n else\n atom.workspace.addBottomPanel(item: this)\n\n onOutputData: (data) ->\n @output.append data\n @output.scrollToBottom()\n\n repl: null\n\n eval: ->\n @toggle() unless @hasParent()\n activeEditor = atom.workspace.getActiveTextEditor()\n return unless activeEditor\n code = activeEditor.getSelectedText()\n filename = activeEditor.getBuffer().getPath()\n request = {code, filename}\n if @repl\n @send request\n else\n activePackage = packageRootOf filename\n @repl = @spawnReplForPackage activePackage, =>\n packageName = (require 'path').basename activePackage\n @title.text \"mjsish on package *#{packageName}*\"\n @repl.on 'message', (message) =>\n @onReplMessage message\n process.nextTick =>\n @send request\n request = null\n\n send: (message) ->\n console.log \"mjsish request:\", message\n @repl.send message\n\n onReplMessage: (message) ->\n console.log 'mjsish message:', message\n @clearStatusClasses @output\n switch message.intent\n when 'evaluation-result'\n @output.text message.result\n when 'evaluation-error'\n @output.text ''\n @output.append addLinks message.error\n @output.addClass 'error'\n else\n @output.text inspect message\n @output.addClass 'warning'\n\n killRepl: ->\n return unless @repl\n @repl.kill 'SIGKILL'\n\n onProcessClose: (exitCode) ->\n console.log 'repl exited with %d code', exitCode\n @repl = null\n success = exitCode == 0\n @title.text(if success then 'process finished' else 'process error')\n @title.addClass(if success then 'success' else 'error')\n\n mjsishPath: ->\n atom.config.get 'language-metascript.mjsishExecutablePath'\n\n spawnReplForPackage: (packageDir, onProcess) ->\n {spawn} = require('child_process')\n ansi = require('ansi-html-stream')\n executable = @mjsishPath()\n console.log \"spawning `%s' for package `%s'\", executable, packageDir\n mjsish = spawn executable, ['--ipc'], {cwd: packageDir, stdio: [undefined, undefined, undefined, 'ipc']}\n mjsish.on 'error', (err) =>\n console.warn 'mjsish error:', err\n mjsish.on 'close', (exitCode) =>\n @onProcessClose exitCode\n stream = ansi({ chunked: false })\n mjsish.stdout.pipe stream\n mjsish.stderr.pipe stream\n callback = (data) =>\n callback = (data) =>\n @onOutputData data\n callback(data)\n onProcess()\n onProcess = null\n stream.on 'data', (data) =>\n callback data\n mjsish\n","avg_line_length":30.2301587302,"max_line_length":108,"alphanum_fraction":0.6476765555} {"size":437,"ext":"cson","lang":"CoffeeScript","max_stars_count":2.0,"content":"# Keybindings require three things to be fully defined: A selector that is\n# matched against the focused element, the keystroke and the command to\n# execute.\n#\n# Below is a basic keybinding which registers on all platforms by applying to\n# the root workspace element.\n\n# For more detailed documentation see\n# https:\/\/atom.io\/docs\/latest\/behind-atom-keymaps-in-depth\n'atom-workspace':\n 'alt-shift-e': 'atom-terminal:open-project-root'\n","avg_line_length":36.4166666667,"max_line_length":77,"alphanum_fraction":0.7688787185} {"size":997,"ext":"coffee","lang":"CoffeeScript","max_stars_count":7.0,"content":"_ = require 'lodash'\nstaticI18n = require 'static-i18n'\n\nmodule.exports = (grunt) ->\n grunt.registerMultiTask 'i18n', 'Translates static HTML', ->\n done = @async()\n\n options = @options(\n selector: '[data-t]'\n useAttr: true\n replace: false\n locales: ['en']\n fixPaths: true\n locale: 'en'\n files: '**\/*.html'\n exclude: []\n allowHtml: false\n baseDir: process.cwd()\n removeAttr: true\n outputDir: undefined\n fileFormat: 'json'\n localeFile: '__lng__.__fmt__'\n outputDefault: '__file__'\n outputOther: '__lng__\/__file__'\n localesPath: 'locales'\n outputOverride: {}\n encoding: 'utf8'\n i18n:\n resGetPath: undefined\n lng: undefined\n )\n\n (staticI18n.processDir options.baseDir, options)\n .then(done).catch((err) ->\n err.message = 'Failed to compile ' + err.message;\n grunt.log.error err\n grunt.fail.warn 'i18n task failed'\n )\n","avg_line_length":25.5641025641,"max_line_length":62,"alphanum_fraction":0.5727181545} {"size":7997,"ext":"coffee","lang":"CoffeeScript","max_stars_count":31.0,"content":"# lod2dheatmap: heat map panel, with the two dimensions broken into chromosomes\n\nd3panels.lod2dheatmap = (chartOpts) ->\n chartOpts = {} unless chartOpts? # make sure it's defined\n\n # chartOpts start\n width = chartOpts?.width ? 800 # overall height of chart in pixels\n height = chartOpts?.height ? 800 # overall width of chart in pixels\n margin = chartOpts?.margin ? {left:60, top:40, right:40, bottom: 60} # margins in pixels (left, top, right, bottom)\n chrGap = chartOpts?.chrGap ? 6 # gap between chromosomes in pixels\n equalCells = chartOpts?.equalCells ? false # if true, make all cells equal-sized; in this case, chartOpts.chrGap is ignored\n oneAtTop = chartOpts?.oneAtTop ? false # if true, put chromosome 1 at the top rather than bottom\n colors = chartOpts?.colors ? [\"slateblue\", \"white\", \"crimson\"] # vector of three colors for the color scale (negative - zero - positive)\n nullcolor = chartOpts?.nullcolor ? \"#e6e6e6\" # color for empty cells\n zlim = chartOpts?.zlim ? null # z-axis limits (if null take from data, symmetric about 0)\n zthresh = chartOpts?.zthresh ? null # z threshold; if |z| < zthresh, not shown\n hilitcolor = chartOpts?.hilitcolor ? \"black\" # color of box around highlighted cell\n tipclass = chartOpts?.tipclass ? \"tooltip\" # class name for tool tips\n # chartOpts end\n # further chartOpts: chr2dpanelframe\n # accessors start\n xscale = null # x-axis scale (vector by chromosome)\n yscale = null # y-axis scale (vector by chromosome)\n zscale = null # z-axis scale\n celltip = null # cell tooltip selection\n cells = null # cell selection\n svg = null # SVG selection\n # accessors end\n cellSelect = null # actual name for the cell selection\n\n ## the main function\n chart = (selection, data) -> # (chr, pos, lod[chrx][chry]) optionally poslabel (e.g., marker names)\n\n # args that are lists: check that they have all the pieces\n margin = d3panels.check_listarg_v_default(margin, {left:60, top:40, right:40, bottom: 60})\n\n d3panels.displayError(\"lod2dheatmap: data.chr is missing\") unless data.chr?\n d3panels.displayError(\"lod2dheatmap: data.pos is missing\") unless data.pos?\n d3panels.displayError(\"lod2dheatmap: data.lod is missing\") unless data.lod?\n\n n_pos = data.chr.length\n if(data.pos.length != n_pos)\n d3panels.displayError(\"lod2dheatmap: data.pos.length (#{data.pos.length}) != data.chr.length (#{n_pos})\")\n if(data.lod.length != n_pos)\n d3panels.displayError(\"lod2dheatmap: data.lod.length (#{data.lod.length}) != data.chr.length (#{n_pos})\")\n for i of data.lod\n if(data.lod[i].length != n_pos)\n d3panels.displayError(\"lod2dheatmap: data.lod[#{i}].length (#{data.lod[i].length}) != data.chr.length (#{n_pos})\")\n\n if data.poslabel?\n if(data.poslabel.length != n_pos)\n d3panels.displayError(\"lod2dheatmap: data.poslabel.length (#{data.poslabel.length}) != data.chr.length (#{n_pos})\")\n else\n # create position labels\n data.poslabel = (\"#{data.chr[i]}@#{d3panels.formatAxis(data.pos)(data.pos[i])}\" for i of data.chr)\n\n # create chrname if missing\n data.chrname = d3panels.unique(data.chr) unless data.chrname?\n data.chrname = d3panels.forceAsArray(data.chrname)\n\n # if equalCells, change positions to dummy values\n if equalCells\n data.pos = []\n for chr in data.chrname\n data.pos = data.pos.concat(+i for i of data.chr when data.chr[i] == chr)\n\n # create chrstart, chrend if missing\n data = d3panels.add_chrname_start_end(data)\n\n # if equalCells, adjust chrGap to make chromosome ends equal\n if equalCells\n chrGap = ((width - margin.left - margin.right) - 2*data.chrname.length)\/data.chr.length + 2\n\n # create frame\n chartOpts.chrGap = chrGap\n chartOpts.width = width\n chartOpts.height = height\n chartOpts.margin = margin\n myframe = d3panels.chr2dpanelframe(chartOpts)\n\n # create SVG\n myframe(selection, {chr:data.chrname, start:data.chrstart, end:data.chrend})\n svg = myframe.svg()\n\n # scales\n xscale = myframe.xscale()\n yscale = myframe.yscale()\n\n # split position by chromosome\n posByChr = d3panels.reorgByChr(data.chrname, data.chr, data.pos)\n\n # scaled midpoints\n xmid_scaled = {}\n ymid_scaled = {}\n for chr in data.chrname\n xmid_scaled[chr] = d3panels.calc_midpoints(d3panels.pad_vector(xscale[chr](x) for x in posByChr[chr], chrGap-2))\n ymid_scaled[chr] = d3panels.calc_midpoints(d3panels.pad_vector(yscale[chr](y) for y in posByChr[chr], if oneAtTop then chrGap-2 else 2-chrGap))\n\n # z-axis (color) limits; if not provided, make symmetric about 0\n zmin = d3panels.matrixMin(data.lod)\n zmax = d3panels.matrixMaxAbs(data.lod)\n zlim = zlim ? [-zmax, 0, zmax]\n if zlim.length != colors.length\n d3panels.displayError(\"lod2dheatmap: zlim.length (#{zlim.length}) != colors.length (#{colors.length})\")\n zscale = d3.scaleLinear().domain(zlim).range(colors)\n zthresh = zthresh ? zmin - 1\n\n # create within-chromosome index\n indexWithinChr = []\n for chr in data.chrname\n indexWithinChr = indexWithinChr.concat(+i for i of posByChr[chr])\n\n # create cells for plotting\n cells = []\n for i of data.chr\n for j of data.chr\n if Math.abs(data.lod[i][j]) >= zthresh\n cells.push({\n lod:data.lod[i][j]\n chrx:data.chr[i]\n chry:data.chr[j]\n poslabelx:data.poslabel[i]\n poslabely:data.poslabel[j]\n xindex:i\n yindex:j\n xindexByChr:indexWithinChr[i]\n yindexByChr:indexWithinChr[j]})\n\n # calc cell height, width\n d3panels.calc_2dchrcell_rect(cells, xmid_scaled, ymid_scaled)\n\n cellg = svg.append(\"g\").attr(\"id\", \"cells\")\n cellSelect =\n cellg.selectAll(\"empty\")\n .data(cells)\n .enter()\n .append(\"rect\")\n .attr(\"x\", (d) -> d.left)\n .attr(\"y\", (d) -> d.top)\n .attr(\"width\", (d) -> d.width)\n .attr(\"height\", (d) -> d.height)\n .attr(\"class\", (d,i) -> \"cell#{i}\")\n .attr(\"fill\", (d) -> if d.lod? then zscale(d.lod) else nullcolor)\n .attr(\"stroke\", \"none\")\n .attr(\"stroke-width\", \"1\")\n .on(\"mouseover\", () ->\n d3.select(this).attr(\"stroke\", hilitcolor).raise())\n .on(\"mouseout\", () ->\n d3.select(this).attr(\"stroke\", \"none\"))\n\n # tool tip\n tooltipfunc = (d) ->\n z = d3.format(\".2f\")(Math.abs(d.lod))\n \"(#{d.poslabelx},#{d.poslabely}) → #{z}\"\n celltip = d3panels.tooltip_create(d3.select(\"body\"), cellg.selectAll(\"rect\"),\n {tipclass:tipclass},\n tooltipfunc)\n\n # functions to grab stuff\n chart.xscale = () -> xscale\n chart.yscale = () -> yscale\n chart.zscale = () -> zscale\n chart.cells = () -> cellSelect\n chart.celltip = () -> celltip\n chart.svg = () -> svg\n\n # function to remove chart\n chart.remove = () ->\n svg.remove()\n d3panels.tooltip_destroy(celltip)\n return null\n\n # return the chart function\n chart\n","avg_line_length":45.6971428571,"max_line_length":155,"alphanum_fraction":0.5679629861} {"size":54396,"ext":"coffee","lang":"CoffeeScript","max_stars_count":null,"content":"###*\n * Backbone JJRelational\n * v0.2.13\n *\n * A relational plugin for Backbone JS that provides one-to-one, one-to-many and many-to-many relations between Backbone models.\n *\n * Tested with Backbone v1.0.0 and Underscore v.1.5.0\n * \n###\n\ndo () ->\n \"use strict\"\n\n # CommonJS shim\n\n if typeof window is 'undefined'\n _ = require 'underscore'\n Backbone = require 'backbone'\n exports = Backbone\n typeof module is 'undefined' || (module.exports = exports)\n else\n _ = window._\n Backbone = window.Backbone\n exports = window\n\n that = @\n\n # !-\n # ! Backbone.JJStore\n # !-\n ###*\n *\n * The Store - well, stores all models in it.\n * On creation, a model registers itself in the store by its `storeIdentifier`-attribute.\n * Backbone JJStore provides some methods to get models by id\/cid, for example, etc.\n *\n ###\n\n # Basic setup\n\n Backbone.JJStore = {}\n Backbone.JJStore._modelScopes = [exports]\n Backbone.JJStore.Models = {}\n Backbone.JJStore.Events = _.extend {}, Backbone.Events\n\n ###*\n * Adds a store for the given `storeIdentifier` if one doesn't exist yet.\n * @param {String} storeIdentifier\n * @return {Backbone.Collection} The matching store array\n ###\n Backbone.JJStore.__registerModelType = (storeIdentifier) ->\n @.Models[storeIdentifier] = new Backbone.Collection() unless @.Models[storeIdentifier]\n @.Models[storeIdentifier]\n\n ###*\n * Adds a model to its store if it's not present yet.\n * @param {Backbone.JJRelationalModel} model The model to register\n * @return {Boolean} true\n ###\n Backbone.JJStore.__registerModelInStore = (model) ->\n # keep track of the model's original collection property so we can reset it,\n # because our call to store.add would stomp it\n originalCollection = model.collection\n store = @.__registerModelType model.storeIdentifier\n if not store.get(model)\n store.add model, { silent: true }\n model.collection = originalCollection\n Backbone.JJStore.Events.trigger('added:' + model.storeIdentifier, model)\n true\n\n ###*\n * Removes a model from its store if present.\n * @param {Backbone.JJRelationalModel} model The model to remove\n * @return {Boolean} true\n ###\n Backbone.JJStore.__removeModelFromStore = (model) ->\n @.Models[model.storeIdentifier].remove model\n true\n\n ## Convenience functions\n\n Backbone.JJStore._byId = (store, id) ->\n if _.isString store then store = @.Models[store]\n if store\n return store.get id\n null\n\n ###*\n * Adds a scope for `getObjectByName` to look for model types by name.\n * @param {Object} scope\n ###\n Backbone.JJStore.addModelScope = (scope) ->\n @._modelScopes.push scope\n \n ###*\n * Removes a model scope\n * @param {Object} scope\n ###\n Backbone.JJStore.removeModelScope = (scope) ->\n @._modelScopes = _.without @._modelScopes, scope\n \n\n # !-\n # ! Backbone JJRelationalModel\n # !-\n ###*\n *\n * The main part\n *\n ###\n\n # ! Basic setup\n\n Backbone.JJRelational = {}\n\n Backbone.JJRelational.VERSION = '0.2.13'\n\n Backbone.JJRelational.Config = {\n url_id_appendix : '?ids='\n # if this is true and you create a new model with an id that already exists in the store,\n # the existing model will be updated and returned instead of a new one\n work_with_store\t: true\n }\n\n Backbone.JJRelational.CollectionTypes = {}\n \n # ! General functions\n\n\n ###*\n * Find a model type on one of the modelScopes by name. Names are split on dots.\n * @param {String} name\n * @return {mixed}\n ###\n Backbone.JJRelational.__getObjectByName = (name) ->\n parts = name.split('.')\n type = null\n _.find Backbone.JJStore._modelScopes, (scope) ->\n type = _.reduce(parts or [], (memo, val) ->\n if memo then memo[val] else undefined\n , scope)\n true if type and type isnt scope\n , @\n type\n\n ###*\n * Registers one or many collection-types, in order to build a correct collection instance for many-relations.\n * @param {Object} collTypes key => value pairs, where `key` is the name under which to store the collection type (`value`)\n * @return {Boolean} \t\t\t\t\t Success or not.\n ###\n Backbone.JJRelational.registerCollectionTypes = (collTypes) ->\n if not _.isObject(collTypes) then return false\n\n for name, collection of collTypes\n Backbone.JJRelational.CollectionTypes[name] = collection\n true\n\n ###*\n * Returns a collection type by the registered name.\n * If none is found, Backbone.Collection will be returned.\n * @param {String} name Name under which the collection type is stored\n * @return {Backbone.Collection} Found collection type or Backbone.Collection\n ###\n Backbone.JJRelational.__getCollectionType = (name) ->\n for n, coll of Backbone.JJRelational.CollectionTypes\n if n is name then return coll\n\n return Backbone.Collection\n\n\n ###*\n * Backbone.JJRelationalModel\n *\n * The main model extension of Backbone.Model\n * Here come the good parts. :)\n * @type {Backbone.JJRelationalModel}\n *\n ###\n Backbone.Model.prototype.__save = Backbone.Model.prototype.save\n Backbone.JJRelationalModel = Backbone.Model.extend\n\n # This flag checks whether all relations have been installed. If false, some \"`set`\"-functionality is suppressed.\n relationsInstalled: false\n\n ###*\n * The constructor:\n * The Model is built normally, then the relational attributes are set up and the model is registered in the store.\n * After that, the relational attributes are populated (if present in argument `attributes`).\n * At last, the creation of the model is triggered on Backbone.JJStore.Events. (e.g. 'created:MyModel')\n *\n * @param {Object} attributes Initial attributes.\n * @param {Object} options Options object.\n * @return {Backbone.JJRelationalModel} The freshly created model.\n ###\n constructor: (attributes, options) ->\n # check if the model already exists in the store (by id)\n if Backbone.JJRelational.Config.work_with_store and _.isObject(attributes) and id = attributes[@.idAttribute]\n existModel = Backbone.JJStore._byId @.storeIdentifier, id\n\n if existModel\n # if the model exists, update the existing one and return it instead of a new model\n existModel.set attributes, options\n return existModel\n\n # usual Backbone.Model constructor\n Backbone.Model.apply(this, arguments)\n # attributes should be parsed by this point if the parse option is set\n attributes = @parse(attributes or {}, options) if options and options.parse\n # set up the relational attributes\n @.__prepopulate_rel_atts()\n # put in store\n Backbone.JJStore.__registerModelInStore @\n # populate relations with attributes\n @.__populate_rels_with_atts(attributes, options)\n # trigger the creation\n Backbone.JJStore.Events.trigger 'created:' + @.storeIdentifier, @\n @.trigger('relationsInstalled')\n @\n\n ###*\n * Initializes the relational attributes and binds basic listeners.\n * has_many and many_many get empty collections, with a `_relational`-property containing:\n * `owner`, `ownerKey`, `reverseKey` and `idQueue`\n *\n * @return {Backbone.JJRelationalModel}\n ###\n __prepopulate_rel_atts: ->\n if @.relations\n for relation, i in @.relations\n relModel = relation.relatedModel\n\n # check includeInJSON\n relation.includeInJSON = if relation.includeInJSON then relation.includeInJSON else []\n relation.includeInJSON = if _.isArray(relation.includeInJSON) then relation.includeInJSON else [relation.includeInJSON]\n indexOfID = _.indexOf(relation.includeInJSON, 'id')\n if indexOfID >= 0 and @.idAttribute then relation.includeInJSON[indexOfID] = @.idAttribute\n\n # at first check if relatedModel is an instance of Backbone.JJRelationalModel or a string, in which case we should get it from the global object\n if relModel is undefined or relModel.prototype instanceof Backbone.JJRelationalModel is false\n if _.isString(relModel)\n # try to get it from the global object\n gObj = Backbone.JJRelational.__getObjectByName relModel\n if gObj and gObj.prototype instanceof Backbone.JJRelationalModel is true\n relModel = @.relations[i].relatedModel = gObj\n else\n throw new TypeError 'relatedModel \"' + relModel + '\" is neither a reference to a JJRelationalModel nor a string referring to an object in the global oject'\n else if _.isFunction(relModel)\n relModel = @.relations[i].relatedModel = relModel.call @\n\n\n value\n if relation and not isOneType(relation) and collType = Backbone.JJRelational.__getCollectionType relation.collectionType\n value = new collType()\n value._relational =\n owner : @\n ownerKey : relation.key\n reverseKey : relation.reverseKey\n polymorphic : !!relation.polymorphic\n idQueue : []\n else\n value = null\n @.attributes[relation.key] = value\n\n\n # bind any creations of the related model\n # @todo unbind JJStore Event on deletion of model\n Backbone.JJStore.Events.bind 'created:' + relModel.prototype.storeIdentifier, @.newModelInStore, @\n @.bind 'destroy', @._destroyAllRelations\n @.relationsInstalled = true\n @\n\n ###\n # Fills in any relational values that are present in the `attributes`-argument\n # e.g. var m = new MyModel({ HasOneRelation : relationalModel });\n #\n # @param {Object} attributes\n # @param {Object} options\n #\n ###\n __populate_rels_with_atts: (attributes, options) ->\n for key, value of attributes\n if relation = @.getRelationByKey key\n # check if the attribute is a whole collection and if that makes any sense\n if value instanceof Backbone.Collection is true\n throw new TypeError 'The attribute \"' + key + '\" is a collection. You should not replace whole collections in a relational attribute. Please use the direct reference to the model array (Backbone.Collection.models)'\n else\n value = if _.isArray value then value else [ value ]\n for v in value\n @.checkAndAdd v, relation, options\n @\n\n # ! Backbone core overrides\n\n ###*\n * Override \"`save`\" method.\n * The concept is: When saving a model, it is checked whether it has any relations containing a\n * new model. If yes, the new model is saved first. When all new models have been saved, only\n * then is the actual model saved.\n * Relational collections are saved as an array of models + idQueue\n * Concerning relations, the `includeInJSON`-property is used to generate the JSON object\n *\n * @param {String | Object} key See Backbone core\n * @param {mixed | Object} value See Backbone core\n * @param {Object} options (optional) See Backbone core\n * @return {Backbone.$.ajax}\n ###\n save: (key, value, options) ->\n attrs\n returnXhr = null\n attributes = @.attributes\n\n # Handle both '(\"key\", value)' and '({key: value})` -style calls.'\n # this doesn't differ from Backbone core\n if _.isObject(key) or not key\n attrs = key\n options = value\n else if key isnt null\n attrs = {}\n attrs[key] = value\n options = if options then _.clone(options) else {}\n options.isSave = true\n\n # If we're not waiting and attributes exist, save acts as `set(attr).save(null, opts)`.\n if attrs and (not options or not options.wait) and not @.set(attrs, options) then return false\n\n options = _.extend {validate: true}, options\n\n # Do not persist invalid models\n if not this._validate(attrs,options) then return false\n\n # Set temporary attributes if `{wait: true}`\n if attrs and options.wait then @.attributes = _.extend({}, attributes, attrs)\n\n # we're going to keep two lists, one of models to save before, and one of models to save after\n origOptions = _.clone options\n relModelsToSaveAfter = []\n relModelsToSaveBefore = []\n\n #\n # This is the actual save function that's called when all the new related models have been saved\n #\n actualSave = =>\n success = options.success\n\n # generate JSON\n # use `includeInJSON` for relations\n if not options.contentType then options.contentType = 'application\/json'\n\n if not options.data then options.data = JSON.stringify(@toJSON(_.extend({}, options, isSave: true)))\n\n if options.parse is undefined then options.parse = true\n\n # Set up chain of deferreds to save each 'after' model.\n # If we encounter a model that's not new, we'll simply return a Deferred that's already resolved as a sort of no-op.\n # afterSuccess is resolved in the success handler of the model to kick off this process.\n afterSuccess = new Backbone.$.Deferred();\n\n latestSuccess = afterSuccess;\n generateSuccessHandler = (model) =>\n () =>\n modelHasUrlError = false\n try\n _.result(model, 'url')\n catch e\n modelHasUrlError = true\n\n if not modelHasUrlError and model.isNew() and _.result(model, 'url')\n return model.save({}, _.extend({}, origOptions))\n else\n d = new Backbone.$.Deferred()\n d.resolve()\n return d\n \n for relModel in relModelsToSaveAfter\n latestSuccess = latestSuccess.then generateSuccessHandler(relModel)\n\n options.success = (resp, status, xhr) =>\n # Ensure attribtues are restored during synchronous saves\n @attributes = attributes\n\n serverAttrs = @.parse resp, options\n if options.wait then serverAttrs = _.extend(attrs || {}, serverAttrs)\n if _.isObject(serverAttrs) and not @.set(serverAttrs, options) then return false\n\n if success then success @, resp, options\n\n afterSuccess.resolve()\n\n @.trigger 'sync', @, resp, options\n\n wrapError @, options\n\n method = if @.isNew() then 'create' else (if options.patch then 'patch' else 'update')\n if method is 'patch'\n options.attrs = attrs\n delete options.data\n xhr = @.sync method, @, options\n\n # Restore attributes\n if attrs and options.wait then @.attributes = attributes\n\n # Yield a Deferred that will be resolved when every model has been updated\n latestSuccess\n\n # Okay, so here's actually happening it. When we're saving - and a model in a relation is not yet saved\n # we have to save the related model first. Only then can we save our actual model.\n # This goes down to infinity... ;)\n # If multiple models must be saved first, we need to check if everything's been saved, before calling \"`actualSave`\".\n\n # we need an array that stores models which must be ignored to prevent double saving...\n if not options.ignoreSaveOnModels then options.ignoreSaveOnModels = [@]\n\n # checks if a model is new\n checkIfNew = (val, saveAfter) ->\n try\n if val and (val instanceof Backbone.JJRelationalModel) and val.url() and val.isNew()\n if saveAfter\n relModelsToSaveAfter.push model\n else\n relModelsToSaveBefore.push({model: val, done: false})\n\n # checks if all models have been saved. if yes, do the \"`actualSave`\"\n checkAndContinue = ->\n if _.isEmpty relModelsToSaveBefore then returnXhr = actualSave()\n done = true\n for obj in relModelsToSaveBefore\n if obj.done is false then done = false\n if done then returnXhr = actualSave()\n\n # iterate over relations and check if a model is new\n if @.relations\n for relation in @.relations\n val = @.get relation.key\n reverseRelation = if (val instanceof Backbone.Collection && val.first()) then _.findWhere(val.first().relations, {key: relation.reverseKey}) else null\n\n if reverseRelation && isManyType(relation) && isOneType(reverseRelation)\n for model in val.models\n checkIfNew model, true\n else if isManyType relation\n for model in val.models\n checkIfNew model, false\n else if isOneType relation\n checkIfNew val, false\n\n # if we don't have any relational models to save, directly go to \"`actualSave`\"\n if _.isEmpty relModelsToSaveBefore then returnXhr = actualSave()\n\n # save every relational model that needs saving and add it to the `ignoreSaveOnModel` option.\n for obj in relModelsToSaveBefore\n if _.indexOf(options.ignoreSaveOnModels, obj.model) <= -1\n # add to options.ignoreSaveModels to avoid multiple saves on the same model\n options.ignoreSaveOnModels.push obj.model\n # clone options to avoid conflicts\n opts = _.clone options\n\n opts.success = (model, resp) ->\n for obj in relModelsToSaveBefore\n if obj.model.cid is model.cid then obj.done = true\n\n # trigger on JJStore.Events\n Backbone.JJStore.Events.trigger 'created:' + model.storeIdentifier, model\n # check if that's all and continue if yes\n checkAndContinue()\n obj.model.save({}, opts)\n else\n obj.done = true\n checkAndContinue()\n\n\n returnXhr\n\n ###*\n * Override \"`set`\" method.\n * This is pretty much the most important override...\n * It's almost exactly the same as the core `set` except for one small code block handling relations.\n * See `@begin & @end edit` in the comments\n *\n * If `set` is the heart of the beast in Backbone, JJRelational makes sure it's not made of stone.\n *\n * @param {String | Object} key See Backbone core\n * @param {mixed | Object} val See Backbone core\n * @param {Object} options (optional) Backbone core\n ###\n set: (key, val, options) ->\n if key is null then return @\n\n # Handle both `\"key\", value` and `{key: value}` -style arguments.\n if typeof key is 'object'\n attrs = key\n options = val\n else\n attrs = {}\n attrs[key] = val\n\n options = options or {}\n\n # Run validation\n if not @._validate(attrs, options) then return false\n\n # Extract attributes and options\n unset = options.unset\n silent = options.silent\n\n changes = []\n changing = @._changing\n @._changing = true\n\n if not changing\n @._previousAttributes = _.clone @.attributes\n @.changed = {}\n current = @.attributes\n prev = @._previousAttributes\n\n # actual setting\n checkAndSet = (key, value) =>\n # if we are trying to set a relation key, simply ignore it\n # it will be handled below when we decide to empty the relation (or not)\n if !_.contains(_.pluck(@.relations, 'key'), key)\n if !_.isEqual(current[key], value)\n changes.push key\n if !_.isEqual(prev[key], value)\n @.changed[key] = value\n else\n delete @.changed[key]\n ###*\n * @begin edit JJRelational\n ###\n # check if it's a relation that is to be set\n relation = @.getRelationByKey(key)\n isRelation = @.relationsInstalled and relation\n currValue = @.get(key)\n shouldRefreshRelation = isRelation and (unset or\n (currValue == null) or\n (_.isNumber(currValue) and _.isNumber(value) and currValue != value) or\n (!_.isObject(value) and _.isObject(currValue) and currValue.id and currValue.id != value) or\n (_.isObject(value) and _.isObject(currValue) and currValue.id and value.id and currValue.id != value.id) or\n (value instanceof Backbone.Model and value.cid != currValue.cid) or\n (_.isArray(value) && (!_.isEqual(value, currValue) or currValue instanceof Backbone.Collection)))\n\n if shouldRefreshRelation\n # we ignored adding changes in `checkAndSet`, so we have to add it now\n changes.push key\n @.changed[key] = value\n value = if _.isArray value then value else [value]\n # if we already have a collection, don't empty it - just simply call `set()` on it!\n if currValue instanceof Backbone.Collection\n currValue.set value, options\n else\n # otherwise, it's safe to empty the relation and start over\n @._emptyRelation relation\n for v in value\n # check the value and add it to the relation accordingly\n @.checkAndAdd(v, relation, options) unless unset\n else if not isRelation\n if unset then delete current[key] else current[key] = value\n @\n ###*\n * @end edit JJRelational\n ###\n\n # Trigger all relevant attribute changes\n triggerChanges = =>\n if not silent\n if changes.length then this._pending = true\n for change in changes\n @.trigger 'change:' + change, @, current[change], options\n\n # Check for changes of `id`\n # If changed, we have to trigger `change:{idAttribute}` early, so that any\n # collections can update their _byId lookups of this model\n if @.idAttribute of attrs\n @.id = attrs[@.idAttribute]\n checkAndSet @.idAttribute, attrs[@.idAttribute]\n # trigger early if necessary\n triggerChanges()\n # remove from changes to prevent triggering it twice\n i = changes.indexOf @.idAttribute\n if ~i then changes.splice i, 1\n delete attrs[@.idAttribute]\n\n\n # Check for changes of `id`\n if @.idAttribute of attrs then @.id = attrs[@.idAttribute]\n\n # iterate over the attributes to set\n for key, value of attrs\n checkAndSet key, value\n\n triggerChanges()\n\n if changing then return @\n if not silent\n while @._pending\n @._pending = false\n @.trigger 'change', @, options\n @._pending = false\n @._changing = false\n\n @\n\n ###*\n * Override \"`_validate`\" method.\n * The difference is that it flattens relational collections down to its model array.\n *\n * @param {Object} attrs see Backbone core\n * @param {Object} options see Backbone core\n * @return {Boolean} see Backbone core\n ###\n _validate: (attrs, options) ->\n if not options.validate or not @.validate then return true\n attrs = _.extend {}, @.attributes, attrs\n for relation in @.relations\n val = attrs[relation.key]\n if val instanceof Backbone.Collection is true then attrs[relation.key] = val.models\n error = @.validationError = @.validate(attrs, options) || null\n if not error then return true\n @.trigger 'invalid', @, error, _.extend(options || {}, {validationError: error})\n false\n\n ###*\n * Override `toJSON` method for relation handling.\n * If it's for saving (`options.isSave == true`), then it uses the includeInJSON property of relations.\n * This can go down as many levels as required.\n * If not, it just goes down one level.\n *\n * @param {Object} options Options object\n * @return {Object} Final JSON object\n ###\n toJSON: (options) ->\n options = options || {}\n # if options.withRelIDs, return the model with its related models represented only by ids\n if options.withRelIDs then return @.toJSONWithRelIDs(options)\n\n json = _.clone @.attributes\n # if options.bypass, return normal Backbone toJSON-function\n if options.bypass then return json\n\n if options.isSave\n for relation in @.relations\n # if this relation should not be included continue\n if options.scaffold and ( _.indexOf(options.scaffold, relation.key) < 0 ) then continue\n\n include = relation.includeInJSON\n\n key = relation.key\n relValue = @.get key\n if isOneType relation\n if relValue\n if (relValue instanceof relation.relatedModel is true)\n if include.length is 0\n json[relation.key] = relValue.toJSONWithRelIDs(options)\n else if include.length is 1\n json[relation.key] = relValue.get(include[0])\n else\n json[relation.key] = relValue.toJSON(_.extend({}, options, {isSave: true, scaffold:include}))\n else\n # only id is present. check if 'id' is specified in includeInJSON\n json[relation.key] = if ( _.indexOf(include, relation.relatedModel.prototype.idAttribute) >=0 ) then relValue else null\n else\n json[relation.key] = null\n else if isManyType relation\n if include.length is 0\n json[relation.key] = relValue.toJSON(_.extend({}, options, {withRelIDs: true}))\n else if include.length is 1\n json[relation.key] = relValue.getArrayForAttribute include[0]\n else\n json[relation.key] = relValue.toJSON(_.extend({}, options, {isSave: true, scaffold:include}))\n if _.indexOf(include, 'id') >= 0 then json[relation.key].push relValue._relational.idQueue\n\n # e.g. for views\n else\n # go down one level\n for relation in @.relations\n relValue = @.get relation.key\n if isOneType relation\n json[relation.key] = if (relValue instanceof relation.relatedModel is true) then relValue.toJSONWithRelIDs(options) else relValue\n else if isManyType relation\n json[relation.key] = relValue.toJSON(_.extend({}, options, {withRelIDs: true}))\n\n if options.scaffold\n json = _.pick.apply that, [json, options.scaffold]\n\n json\n\n # ! Managing functions\n\n ###*\n * Returns a JSON of the model with the relations represented only by ids.\n *\n * @return {Object} Final JSON object\n ###\n toJSONWithRelIDs: ->\n json = _.clone @.attributes\n for relation in @.relations\n relValue = @.get relation.key\n if isOneType relation\n json[relation.key] = if (relValue instanceof relation.relatedModel is true) then relValue.id else relValue\n else if isManyType relation\n json[relation.key] = relValue.getIDArray()\n json\n\n ###*\n * This function checks a given value and adds it to the relation accordingly.\n * If it's a model, it adds it to the relation. If it's a set of attributes, it creates a new model\n * and adds it. Otherwise it assumes that it must be the id, looks it up in the store (if there's\n * already a model) or adds it to the relation's idQueue.\n *\n * @param {mixed} val The value to check\n * @param {Object} rel The relation which to add the value to\n * @param {Object} options Options object\n * @return {Backbone.JJRelationalModel}\n ###\n checkAndAdd: (val, rel, options) ->\n options = options or {}\n relModel = rel.relatedModel\n if val instanceof relModel is true\n # is already a Model -> just add\n @.addToRelation val, rel, false\n else if _.isObject(val) and val instanceof Backbone.Model is false\n # is an object -> Model has to be created and populated -> then add\n val[rel.reverseKey] = @ if @.relationsInstalled and !val[rel.reverseKey]? # optimistically set the reverse relationship key if it doesn't already exist\n if rel.polymorphic and rel.collectionType\n newModel = new (Backbone.JJRelational.CollectionTypes[rel.collectionType].prototype.model)(val)\n else\n newModel = new relModel(val)\n @.addToRelation newModel, rel, false\n else\n # must be the id. look it up in the store or add it to idQueue\n storeIdentifier = relModel.prototype.storeIdentifier\n if existModel = Backbone.JJStore._byId storeIdentifier, val\n # check if this model should be ignored. this is the case for example for collection.fetchIdQueue()\n if options.ignoreModel is existModel then return\n @.addToRelation existModel, rel, false\n else if isManyType rel\n @.get(rel.key).addToIdQueue val\n else if isOneType rel\n @.setHasOneRelation rel, val, true\n @\n\n ###*\n * This function is triggered by a newly created model (@see Backbone.JJRelationalModel.constructor)\n * that has been registered in the store and COULD belong to a relation.\n *\n * @param {Backbone.JJRelationalModel} model The newly created model which triggered the event.\n ###\n newModelInStore: (model) ->\n id = model.id\n if id\n # get the relation by the model's identifier\n relation = @.getRelationByIdentifier model.storeIdentifier\n if relation\n if isOneType relation\n # check if that one's needed overall\n if id is @.get relation.key\n @.addToRelation model, relation, false\n else if isManyType relation\n # check if id exists in idQueue\n relColl = @.get relation.key\n idQueue = relColl._relational.idQueue\n\n if _.indexOf(idQueue, id) > -1\n @.addToRelation model, relation, false\n\n undefined\n\n ###*\n * Adds a model to a relation.\n *\n * @param {Backbone.JJRelationalModel} model The model to add\n * @param {String | Object} relation Relation object or relationKey\n * @param {Boolean} silent Indicates whether to pass on the relation to the added model. (reverse set)\n * @return {Backbone.JJRelationalModel}\n ###\n addToRelation: (model, relation, silent) ->\n # if relation is not passed completely, it is treated as the key\n if not _.isObject relation then relation = @.getRelationByKey relation\n\n if relation and (model instanceof relation.relatedModel is true)\n # handling of has_one relation\n if isOneType relation\n if @.get(relation.key) isnt model\n @.setHasOneRelation relation, model, silent\n else if isManyType relation\n @.get(relation.key).add model, {silentRelation: silent}\n\n @\n\n ###*\n * Sets a value on a has_one relation.\n *\n * @param {String |\u00a0Object} relation Relation object or relationKey\n * @param {mixed} val The value to set\n * @param {Boolean} silentRelation Indicates whether to pass on the relation to the added model. (reverse set)\n ###\n setHasOneRelation: (relation, val, silentRelation) ->\n if not _.isObject relation then relation = @.getRelationByKey relation\n prev = @.get relation.key\n @.attributes[relation.key] = val\n\n if prev instanceof relation.relatedModel is true then prev.removeFromRelation relation.reverseKey, @, true\n if silentRelation then return\n if val instanceof relation.relatedModel is true\n # pass on relation\n val.addToRelation @, relation.reverseKey, true\n @\n\n ###*\n * Removes a model from a relation\n * @param {String | Object} relation Relation object or relationKey\n * @param {Backbone.JJRelationalModel} model The model to add\n * @param {Boolean} silent Indicates whether to pass on the relation to the added model. (reverse set)\n * @return {Backbone.JJRelationalModel}\n ###\n removeFromRelation: (relation, model, silent) ->\n # if relation is not passed completely, it is treated as the key\n if not _.isObject relation then relation = @.getRelationByKey relation\n\n if relation\n if isOneType relation\n @.setHasOneRelation relation, null, silent\n else if isManyType relation\n coll = @.get relation.key\n if (model instanceof relation.relatedModel is true)\n coll.remove model, {silentRelation:silent}\n else\n coll.removeFromIdQueue model\n @\n\n ###*\n * Completely empties a relation.\n *\n * @param {Object} relation\n * @return {Backbone.JJRelationalModel}\n ###\n _emptyRelation: (relation) ->\n if isOneType relation\n @.setHasOneRelation relation, null, false\n else if isManyType relation\n coll = @.get relation.key\n coll._cleanup()\n @\n\n ###*\n * Cleanup function that removes all listeners, empties relation and informs related models of removal\n *\n * @return {Backbone.JJRelationalModel}\n ###\n _destroyAllRelations: ->\n Backbone.JJStore.__removeModelFromStore @\n for relation in @.relations\n\n # remove listeners\n @.unbind 'destroy', @._destroyAllRelations\n Backbone.JJStore.Events.unbind 'created:' + relation.relatedModel.prototype.storeIdentifier, @.newModelInStore, @\n\n # inform relation of removal\n if isOneType(relation) and relModel = @.get(relation.key)\n @.setHasOneRelation relation, null, false\n else if isManyType(relation)\n @.get(relation.key)._cleanup()\n @\n\n ###*\n * Helper function to get the length of the relational idQueue (for has_one: 0 || 1)\n *\n * @param {String | Object} relation Relation object or relationKey\n * @return {Integer} Length of idQueue\n ###\n getIdQueueLength: (relation) ->\n if not _.isObject relation then relation = @.getRelationByKey relation\n if relation\n if isOneType relation\n val = @.get relation.key\n if (not val) || (val instanceof relation.relatedModel is true) then return 0 else return 1\n else if isManyType relation\n return @.get(relation.key)._relational.idQueue.length\n 0\n\n ###*\n * Clears the idQueue of a relation\n *\n * @param {String | Object} relation Relation object or relationKey\n * @return {Backbone.JJRelationalModel}\n ###\n clearIdQueue: (relation) ->\n if not _.isObject relation then relation = @.getRelationByKey relation\n if relation\n if isOneType relation\n val = @.get relation.key\n if val and (val instanceof relation.relatedModel is false) then @.set relation.key, null, {silentRelation: true}\n else if isManyType relation\n coll = @.get relation.key\n coll._relational.idQueue = []\n @\n\n ###*\n * Fetches missing related models, if their ids are known.\n *\n * @param {String | Object} relation Relation object or relationKey\n * @param {Object} options Options object\n * @return {Backbone.$.ajax}\n ###\n fetchByIdQueue: (relation, options) ->\n if not _.isObject relation then relation = @.getRelationByKey relation\n if relation\n if isManyType relation\n # pass this on to collection, it will handle the rest\n @.get(relation.key).fetchByIdQueue(options)\n else if isOneType relation\n id = @.get relation.key\n if id and (id instanceof relation.relatedModel is false)\n relModel = relation.relatedModel\n if options then options = _.clone(options) else options = {}\n\n # set the url\n url = getValue relModel.prototype, 'url'\n url += Backbone.JJRelational.Config.url_id_appendix + id\n options.url = url\n\n if options.parse is undefined then options.parse = true\n\n success = options.success\n options.success = (resp, status, xhr) =>\n # IMPORTANT: set the id in the relational attribute to null, so that the model won't be\n # added twice to the relation (by Backbone.JJStore.Events trigger)\n @.setHasOneRelation relation, null, true\n options.ignoreModel = @\n model = new relModel relModel.prototype.parse(resp[0]), options\n @.set relation.key, model\n\n if success then success(model, resp)\n model.trigger 'sync', model, resp, options\n\n wrapError @, options\n return @.sync.call(@, 'read', @, options)\n @\n\n ###*\n *\n * @begin Helper methods\n *\n ###\n getRelationByKey: (key) ->\n for relation in @.relations\n if relation.key is key then return relation\n false\n\n getRelationByReverseKey: (key) ->\n for relation in @.relations\n if relation.reverseKey is key then return relation\n false\n\n getRelationByIdentifier: (identifier) ->\n for relation in @.relations\n if relation.relatedModel.prototype.storeIdentifier is identifier then return relation\n false\n\n # @end Helper methods\n\n\n # ! Backbone Collection\n\n ###*\n * Sums up \"`fetchByIdQueue`\"-calls on the same relation in a whole collection\n * by collecting the idQueues of each model and firing a single request.\n * The fetched models are just added to the store, so they will be added to the relation\n * via the Backbone.JJStore.Events listener\n *\n * @param {String} relationKey Key of the relation\n * @param {Object} options Options object\n * @return {Backbone.Collection}\n ###\n Backbone.Collection.prototype.fetchByIdQueueOfModels = (relationKey, options) ->\n if @.model and (@.model.prototype instanceof Backbone.JJRelationalModel is true)\n relation = @.model.prototype.getRelationByKey relationKey\n relModel = relation.relatedModel\n idQueue = []\n\n # build up idQueue\n if isOneType relation\n @.each (model) ->\n val = model.get relationKey\n if val && val instanceof relModel is false\n # must be the id: add to idQueue\n idQueue.push val\n else if isManyType relation\n @.each (model) ->\n coll = model.get relationKey\n idQueue = _.union(idQueue, coll._relational.idQueue)\n\n # get and set the url on options\n if idQueue.length > 0\n options.url = getUrlForIdQueue relModel.prototype, idQueue\n if options.parse is undefined then options.parse = true\n\n success = options.success\n options.success = (resp, status, xhr) =>\n parsedObjs = []\n # check if there's a collection type for the relation. if yes, parse with it\n if relation.collectionType and (collType = Backbone.JJRelational.__getCollectionType relation.collectionType)\n parsedObjs = collType.prototype.parse(resp)\n else if _.isArray resp\n # parse each object in it with the related model's parse-function\n for respObj in resp\n if _.isObject respObj then parsedObjs.push relModel.prototype.parse(respObj)\n\n # build up the new models\n for parsedObj in parsedObjs\n new relModel parsedObj\n\n if success then success(@, resp)\n @.trigger 'sync', @, resp, options\n\n wrapError @, options\n return @.sync.call(this, 'read', this, options)\n\n # call success function no matter what\n if options.success then options.success(@)\n @\n\n\n ###*\n *\n * Backbone.Collection hacks\n *\n ###\n\n\n Backbone.Collection.prototype.__set = Backbone.Collection.prototype.set\n ###*\n * This \"`set`\" hack checks if the collection belongs to the relation of a model.\n * If yes, handle the models accordingly.\n *\n * @param {Array | Object | Backbone.Model} models The models to set\n * @param {Object} options Options object\n ###\n Backbone.Collection.prototype.set = (models, options) ->\n # check if this collection belongs to a relation\n if not @._relational then return @.__set models, options\n\n if @._relational\n # prepare options and models\n options || (options = {})\n if not _.isArray models\n models = [ models ]\n\n modelsToAdd = []\n idsToRemove = []\n idsToAdd = []\n\n # check if models are instances of Backbone.Model, else prepare them\n for model in models\n if model instanceof Backbone.Model is false\n if not _.isObject model\n # must be id, check if a model with that id already exists, else add to idQueue\n if existModel = Backbone.JJStore._byId @.model.prototype.storeIdentifier, model\n model = existModel\n else\n idsToAdd.push model\n break\n else\n # assume that the user wants a reverse key set to the relational owner\n # (but _.extend it if course, in case they passed in their own)\n if not options.parse and @_relational and @_relational.reverseKey and @_relational.owner\n relAttrs = {}\n relAttrs[@_relational.reverseKey] = @_relational.owner\n model = _.extend(relAttrs, model)\n model = @._prepareModel model, options\n\n # check if models are instances of this collection's model\n if model\n if not this._relational.polymorphic and model instanceof @.model is false\n throw new TypeError 'Invalid model to be added to collection with relation key \"' + @._relational.ownerKey + '\"'\n else\n modelsToAdd.push model\n if model.id then idsToRemove.push model.id\n\n # handle idQueue\n @.removeFromIdQueue idsToRemove\n for id in idsToAdd\n @.addToIdQueue id\n\n # pass on relation if not silentRelation\n if not options.silentRelation\n for modelToAdd in modelsToAdd\n modelToAdd.addToRelation @._relational.owner, @._relational.reverseKey, true\n\n # set options.silentRelation to false for subsequent `set` - calls\n options.silentRelation = false\n\n # set options.merge to false as we have alread merged it with the call to `_prepareModel` above (when working with store)\n if Backbone.JJRelational.Config.work_with_store then options.merge = false\n\n # set parse to false if we've got actual backbone models in the collection, otherwise we'd be re-parsing them\n options.parse = _.filter(modelsToAdd, (m) -> m instanceof Backbone.Model).length == 0\n\n # Normal \"`add`\" and return collection for chainability\n @.__set modelsToAdd, options\n\n ###*\n *\n * @deprecated since Backbone v1.0.0, where `update` and `add` have been merged into `set`\n * still present in Backbone.JJRelational v0.2.5\n *\n * \"`update`\" has to be overridden,\n * because in case of merging, we need to pass `silentRelation: true` to the options.\n *\n * @param {Object | Array | Backbone.Model} models The models to add\n * @param {Object} options Options object\n * @return {Backbone.Collection}\n ###\n ###\n Backbone.Collection.update = (models, options) ->\n add = []\n remove = []\n merge = []\n modelMap = {}\n idAttr = @.model.prototype.idAttribute\n options = _.extend {add:true, merge:true, remove:true}, options\n\n if options.parse then models = @.parse models\n\n # Allow a single model (or no argument) to be passed.\n if not _.isArray models then (models = if models then [models] else [])\n\n # We iterate in every case, because of a different merge-handling\n\n # Determine which models to add and merge, and which to remove\n for model in models\n existing = @.get (model.id || model.cid || model[idAttr])\n if options.remove and existing then modelMap[existing.cid] = true\n if options.add and not existing then add.push model\n if options.merge and existing then merge.push model\n\n if options.remove\n for model in @.models\n if not modelMap[model.cid] then remove.push model\n\n # Remove models (if applicable) before we add and merge the rest\n if remove.length then @.remove(remove, options)\n # set options.merge to true for possible subsequent `add`-calls\n options.merge = true\n if add.length then @.add add, options\n if merge.length\n mergeOptions = _.extend {silentRelation:true}, options\n @.add merge, mergeOptions\n\n @\n ###\n\n Backbone.Collection.prototype.__remove = Backbone.Collection.prototype.remove\n ###*\n * If this is a relational collection, the removal is passed on and the model is informed\n * of the removal.\n *\n * @param {Backbone.Model} models The model to remove\n * @param {Object} options Options object\n * @return {Backbone.Collection}\n ###\n Backbone.Collection.prototype.remove = (models, options) ->\n if not @._relational then return @.__remove models, options\n\n options || (options = {})\n if not _.isArray models\n models = [models]\n else\n models = models.slice()\n\n _.each models, (model) =>\n if model instanceof Backbone.Model is true\n @.__remove model, options\n if not options.silentRelation\n @._relatedModelRemoved model, options\n\n @\n\n ###*\n * Cleanup function for relational collections.\n *\n * @return {Backbone.Collection}\n ###\n Backbone.Collection.prototype._cleanup = ->\n @.remove @.models, {silentRelation:false}\n @._relational.idQueue = []\n @\n\n ###*\n * Informs the removed model of its removal from the collection, so that it can act accordingly.\n *\n * @param {Backbone.JJRelationalModel} model The removed model\n * @param {Object} options Options object\n * @return {Backbone.Collection}\n ###\n Backbone.Collection.prototype._relatedModelRemoved = (model, options) ->\n # invert silentRelation to prevent infinite looping\n if options.silentRelation then silent = false else silent = true\n model.removeFromRelation @._relational.reverseKey, @._relational.owner, silent\n @\n\n Backbone.Collection.prototype.__reset = Backbone.Collection.prototype.reset\n ###*\n * Cleans up a relational collection before resetting with the new ones.\n *\n * @param {Backbone.Model} models Models to reset with\n * @param {Object} options Options object\n * @return {Backbone.Collection}\n ###\n Backbone.Collection.prototype.reset = (models, options) ->\n if @._relational then @._cleanup()\n @.__reset models, options\n @\n\n\n Backbone.Collection.prototype.__fetch = Backbone.Collection.prototype.fetch\n ###*\n * The fetch function...normal fetch is performed, after which the parsed response is checked if there are\n * any models that already exist in the store (via id). If yes: the model will be updated, no matter what.\n * After that, \"`update`\" or \"`reset`\" method is chosen.\n *\n * @param {Object} options Options object\n * @return {Backbone.$.ajax}\n ###\n Backbone.Collection.prototype.fetch = (options) ->\n options = if options then _.clone(options) else {}\n if options.parse is undefined then options.parse = true\n\n success = options.success\n options.success = (resp, status, xhr) =>\n # check if any of the fetched models have an id that already exists\n # if this is the case, merely update the existing model instead of creating a new one\n idAttribute = @.model.prototype.idAttribute\n storeIdentifier = @.model.prototype.storeIdentifier\n parsedResp = @.parse resp\n existingModels = []\n args = []\n args.push parsedResp\n for respObj in parsedResp\n id = respObj[idAttribute]\n existingModel = Backbone.JJStore._byId storeIdentifier, id\n if existingModel\n # this model exists. add it to existingModels[] and simply update the attributes as in 'fetch'\n existingModel.set respObj, options\n existingModels.push existingModel.pick(_.keys(respObj).concat(existingModel.idAttribute))\n args.push respObj\n parsedResp = _.without.apply that, args\n\n # now that we've got everything together, check if to call 'reset' or 'update' and especially check if this is a relational collection\n # if yes, and 'reset', cleanup the whole collection, and ignore the owner model.\n if @._relational then options.ignoreModel = @._relational.owner\n models = existingModels.concat(parsedResp)\n method = if options.reset then 'reset' else 'set'\n # if update, set options.merge to false, as we've already merged the existing ones\n if not options.reset then options.merge = false\n\n @[method](models, options)\n\n if success then success(@, resp)\n @.trigger 'sync', @, resp, options\n\n wrapError @, options\n return @.sync.call(@, 'read', @, options)\n\n ###*\n * If any ids are stored in the collection's idQueue, the missing models will be fetched.\n *\n * @param {Object} options Options object\n * @return {Backbone.$.ajax}\n ###\n Backbone.Collection.prototype.fetchByIdQueue = (options) ->\n if options then options = _.clone(options) else options = {}\n idQueue = @._relational.idQueue\n if idQueue.length > 0\n # set the url appropriately\n options.url = getUrlForIdQueue @, idQueue\n\n if options.parse is undefined then options.parse = true\n\n success = options.success\n options.success = (resp, status, xhr) =>\n # the owner model must be ignored by the fetched models when they're created and the relations are set\n options.ignoreModel = @._relational.owner\n # as we're fetching the rest which isn't present, we're always `add`-ing the model\n # and we have to empty the idQueue, otherwise we'll double add the models (by Backbone.JJStore.Events)\n @._relational.idQueue = []\n @.add(@.parse(resp), options)\n\n if success then success(@, resp)\n @.trigger 'sync', @, resp, options\n\n wrapError @, options\n return @.sync.call(@, 'read', @, options)\n @\n\n ###*\n * Adds an id to the collection's idQueue\n * @param {mixed} id The id to add\n * @return {Backbone.Collection}\n ###\n Backbone.Collection.prototype.addToIdQueue = (id) ->\n queue = @._relational.idQueue\n queue.push id\n @._relational.idQueue = _.uniq queue\n @\n\n ###*\n * Removes ids from the collection's idQueue\n * @param {mixed | Array} ids The (array of) id(s) to remove\n * @return {Backbone.Collection}\n ###\n Backbone.Collection.prototype.removeFromIdQueue = (ids) ->\n ids = if _.isArray then ids else [ids]\n args = [@._relational.idQueue].concat ids\n @._relational.idQueue = _.without.apply that, args\n @\n\n ###*\n * Returns an array of the collection's models' ids + idQueue\n * @return {Array}\n ###\n Backbone.Collection.prototype.getIDArray = ->\n ids = []\n @.each (model) ->\n if model.id then ids.push model.id\n _.union ids, @._relational.idQueue\n\n ###*\n * Returns an array of an attribute of all models.\n * @param {String} attr The attribute's name\n * @return {Array}\n ###\n Backbone.Collection.prototype.getArrayForAttribute = (attr) ->\n if attr is @.model.prototype.idAttribute then return @.getIDArray()\n atts = []\n @.each (model) ->\n atts.push model.get(attr)\n atts\n\n\n # !-\n # !-\n # ! Helpers\n\n # Wrap an optional error callback with a fallback error event.\n # cloned from Backbone core\n wrapError = (model, options) ->\n error = options.error\n options.error = (resp) ->\n if error then error model, resp, options\n model.trigger 'error', model, resp, options\n\n ###*\n * Helper method that flattens relational collections within in an object to an array of models + idQueue.\n * @param {Object} obj The object to flatten\n * @return {Object}\t\t\tThe flattened object\n ###\n flatten = (obj) ->\n for key, value of obj\n if (value instanceof Backbone.Collection) and value._relational then obj[key] = value.models.concat(value._relational.idQueue)\n obj\n\n ###*\n * Helper method to get a value from an object. (functions will be called)\n * @param {Object} object\n * @param {String} prop\n * @return {mixed}\n ###\n getValue = (object, prop) ->\n if not (object and object[prop]) then return null\n if _.isFunction object[prop] then return object[prop]() else return object[prop]\n\n ###*\n * Helper method to get the url for a model (this is comparable to Backbone.Model.url)\n * @param {Backbone.Model} model\n * @param {mixed} id (optional)\n * @return {String}\n ###\n getUrlForModelWithId = (model, id) ->\n base = getValue(model, 'urlRoot') || getValue(model.collection, 'url') || urlError()\n return base + (if base.charAt(base.length - 1) is '\/' then '' else '\/') + encodeURIComponent(if id then id else model.id)\n\n ###*\n * Helper method to get a formatted url based on an object and idQueue.\n * @param {Backbone.Model} obj\n * @param {Array} idQueue\n * @return {String}\n ###\n getUrlForIdQueue = (obj, idQueue) ->\n url = getValue obj, 'url'\n if not url\n urlError()\n return false\n else\n url += (Backbone.JJRelational.Config.url_id_appendix + idQueue.join(','))\n url\n\n ###*\n * Throw an error, when a URL is needed, but none is supplied.\n * @return {Error}\n ###\n urlError = ->\n throw new Error 'A \"url\" property or function must be specified'\n\n isOneType = (relation) ->\n if relation.type is 'has_one' then true else false\n\n isManyType = (relation) ->\n if (relation.type is 'has_many' or relation.type is 'many_many') then true else false\n\n\n @\n","avg_line_length":38.5513819986,"max_line_length":226,"alphanum_fraction":0.6273071549} {"size":443,"ext":"coffee","lang":"CoffeeScript","max_stars_count":4.0,"content":"class RunsApi\n list: ({ onSuccess, onError }) =>\n request = $.get { url: '\/runs\/list' }\n request.done (suitesList) => onSuccess suitesList\n request.fail (err) => onError { message: err.responseText }\n\n start: (suite, { onSuccess, onError }) =>\n request = $.get { url: \"\/runs\/start\/#{suite._id}\" }\n request.done (run) => onSuccess run\n request.fail (err) => onError { message: err.responseText }\n\nexport default new RunsApi\n","avg_line_length":34.0769230769,"max_line_length":63,"alphanum_fraction":0.6410835214} {"size":1077,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"# build-dependencies: _\n\nclass Source\n constructor: (@obs, @sync, @lazy = false) ->\n @queue = []\n subscribe: (sink) -> @obs.dispatcher.subscribe(sink)\n toString: -> @obs.toString()\n markEnded: -> @ended = true\n consume: ->\n if @lazy\n { value: _.always(@queue[0]) }\n else\n @queue[0]\n push: (x) -> @queue = [x]\n mayHave: -> true\n hasAtLeast: -> @queue.length\n flatten: true\n\nclass ConsumingSource extends Source\n consume: -> @queue.shift()\n push: (x) -> @queue.push(x)\n mayHave: (c) -> !@ended or @queue.length >= c\n hasAtLeast: (c) -> @queue.length >= c\n flatten: false\n\nclass BufferingSource extends Source\n constructor: (obs) ->\n super(obs, true)\n consume: ->\n values = @queue\n @queue = []\n {value: -> values}\n push: (x) -> @queue.push(x.value())\n hasAtLeast: -> true\n\nSource.isTrigger = (s) ->\n if s instanceof Source\n s.sync\n else\n s instanceof EventStream\n\nSource.fromObservable = (s) ->\n if s instanceof Source\n s\n else if s instanceof Property\n new Source(s, false)\n else\n new ConsumingSource(s, true)\n","avg_line_length":21.9795918367,"max_line_length":54,"alphanum_fraction":0.6128133705} {"size":789,"ext":"coffee","lang":"CoffeeScript","max_stars_count":5.0,"content":"'use strict'\n\nACTIVE_ICON_19 = 'images\/icon19.png'\nACTIVE_ICON_38 = 'images\/icon38.png'\n\nchrome.runtime.onMessage.addListener (message, sender, sendResponseTo) ->\n if message == 'plugmixer_show_icon'\n chrome.pageAction.setIcon\n \"tabId\": sender.tab.id,\n \"path\":\n \"19\": ACTIVE_ICON_19,\n \"38\": ACTIVE_ICON_38\n chrome.pageAction.show sender.tab.id\n chrome.pageAction.setTitle 'tabId': sender.tab.id, 'title': 'Plugmixer'\n\nchrome.notifications.onButtonClicked.addListener (notificationId, buttonIndex) ->\n if notificationId == 'update' && buttonIndex == 0\n chrome.tabs.create\n url: 'https:\/\/plug.dj'\n chrome.notifications.clear 'update'\n\nchrome.runtime.onInstalled.addListener (details) ->\n if details.previousVersion == '2.1.8'\n return\n\n","avg_line_length":30.3461538462,"max_line_length":81,"alphanum_fraction":0.7021546261} {"size":4842,"ext":"coffee","lang":"CoffeeScript","max_stars_count":1.0,"content":"RedisModel = require '..\/lib\/redis-model'\nredis = require(\"redis\").createClient()\nredis.flushall()\n\nclass Model extends RedisModel\n\tconstructor: ->\n\t\tsuper redis, 'Model'\n\t\t@addFields 'field1', 'field2'\n\t\t\nModel = new Model\n\nclass Model2 extends RedisModel\n\tconstructor: ->\n\t\tsuper redis, 'Model'\n\t\t@addFields 'field1'\n\t\t\nModel2 = new Model2\n\nexports['newItem'] =\n\t'Keeps track of latest key': (test) ->\n\t\ttest.expect 2\n\t\tModel.newItem (err, model) ->\n\t\t\tModel.newItem (err2, mod2) ->\n\t\t\t\ttest.equal model.key, 1\n\t\t\t\ttest.equal mod2.key, 2\n\t\t\t\ttest.done()\n\t\t\n\t'Creates property for a single field': (test) ->\n\t\ttest.expect 1\n\t\tModel2.newItem (err, model) ->\n\t\t\ttest.ok model.field1?, 'Field was not added'\n\t\t\ttest.done()\n\t\n\t'Creates property for multiple fields': (test) ->\t\n\t\ttest.expect 2\n\t\tModel.newItem (err, model) ->\n\t\t\ttest.ok model.field1?, 'Field1 was not added'\n\t\t\ttest.ok model.field2?, 'Field2 was not added'\n\t\t\ttest.done()\n\t\t\t\nexports['withKey'] =\n\t'Sets the correct key': (test) ->\n\t\ttest.expect 1\n\t\tModel.withKey 'id', (err, model) ->\n\t\t\ttest.equal model.key, 'id'\n\t\t\ttest.done()\n\t\t\t\n\t'Creates property for a single field': (test) ->\n\t\ttest.expect 1\n\t\tModel2.withKey 'id', (err, model) ->\n\t\t\ttest.ok model.field1?, 'Field was not added'\n\t\t\ttest.done()\n\t\n\t'Creates property for multiple fields': (test) ->\t\n\t\ttest.expect 2\n\t\tModel.withKey 'id', (err, model) ->\n\t\t\ttest.ok model.field1?, 'Field1 was not added'\n\t\t\ttest.ok model.field2?, 'Field2 was not added'\n\t\t\ttest.done()\n\nexports['clearNamespace'] =\n\t'All keys are cleared': (test) ->\n\t\ttest.expect 1\n\t\tModel.withKey 'id', (e, model) ->\n\t\t\tmodel.field1 'newValue', () ->\n\t\t\t\tModel.clearNamespace () ->\n\t\t\t\t\tmodel.field1 (e2, field1) ->\n\t\t\t\t\t\ttest.ok not field1?, 'Field1 still exists'\n\t\t\t\t\t\ttest.done()\n\t\t\t\nexports['BaseModel'] =\n\t'Not locked can write and read': (test) ->\n\t\ttest.expect 1\n\t\tModel.withKey 'id', (err, model) ->\n\t\t\tmodel.field1 'newValue', () ->\n\t\t\t\tModel.withKey 'id', (err2, model2) ->\n\t\t\t\t\tmodel2.field1 (err3, val) ->\n\t\t\t\t\t\ttest.equal val, 'newValue', 'The value set on the object was not saved'\n\t\t\t\t\t\ttest.done()\n\t\t\t\t\t\t\n\t'Locked can write and read in same object': (test) ->\n\t\ttest.expect 1\n\t\tModel.withKey 'id', (err, model) ->\n\t\t\tmodel.lock()\n\t\t\tmodel.field1 'otherValue'\n\t\t\tmodel.field1 (err2, val) ->\n\t\t\t\ttest.equal val, 'otherValue', 'The value on the object is not saved'\n\t\t\t\ttest.done()\n\t\n\t'Locked does not save': (test) ->\n\t\ttest.expect 1\n\t\tModel.withKey 'otherid', (err, model) ->\n\t\t\tmodel.lock()\n\t\t\tmodel.field1 'foo'\n\t\t\tModel.withKey 'otherid', (err2, mod2) ->\n\t\t\t\tmod2.field1 (err3, val) ->\n\t\t\t\t\ttest.equal val, null, 'The value on the object has been saved when it shouldnt have'\n\t\t\t\t\ttest.done()\t\t\n\t\t\t\t\t\n\t'Unlocking does save': (test) ->\n\t\ttest.expect 1\n\t\tModel.withKey 'otherid', (err, model) ->\n\t\t\tmodel.lock()\n\t\t\tmodel.field1 'foo'\n\t\t\tmodel.unlock ->\n\t\t\t\tModel.withKey 'otherid', (err2, mod2) ->\n\t\t\t\t\tmod2.field1 (err3, val) ->\n\t\t\t\t\t\ttest.equal val, 'foo', 'The value on the object should have been saved'\n\t\t\t\t\t\ttest.done()\t\t\n\t\t\t\t\t\t\n\t'Can save multiple fields at once via locking': (test) ->\n\t\ttest.expect 2\n\t\tModel.withKey 'someid', (err, model) ->\n\t\t\tmodel.lock()\n\t\t\tmodel.field1 'bar'\n\t\t\tmodel.field2 'foobar'\n\t\t\tmodel.unlock ->\n\t\t\t\tModel.withKey 'someid', (err2, mod2) ->\n\t\t\t\t\tmod2.field1 (err3, val) ->\n\t\t\t\t\t\tmod2.field2 (err4, val2) ->\n\t\t\t\t\t\t\ttest.equal val, 'bar', 'The value on the object should have been saved'\n\t\t\t\t\t\t\ttest.equal val2, 'foobar', 'The value on the object should have been saved'\n\t\t\t\t\t\t\ttest.done()\t\t\n\t\t\t\t\t\n\t'Can save multiple fields at once via setAll': (test) ->\n\t\ttest.expect 2\n\t\tModel.withKey 'someid', (err, model) ->\n\t\t\tmodel.setAll { field1: 'barAll', field2: 'foobarAll'}, ->\n\t\t\t\tModel.withKey 'someid', (err2, mod2) ->\n\t\t\t\t\tmod2.field1 (err3, val) ->\n\t\t\t\t\t\tmod2.field2 (err4, val2) ->\n\t\t\t\t\t\t\ttest.equal val, 'barAll', 'The value on the object should have been saved'\n\t\t\t\t\t\t\ttest.equal val2, 'foobarAll', 'The value on the object should have been saved'\n\t\t\t\t\t\t\ttest.done()\n\t\t\t\t\t\t\t\n\t'Can load multiple fields at once': (test) ->\n\t\ttest.expect 2\n\t\tModel.withKey 'someid', (err, model) ->\n\t\t\tmodel.lock()\n\t\t\tmodel.field1 'bar'\n\t\t\tmodel.field2 'foobar'\n\t\t\tmodel.unlock ->\n\t\t\t\tModel.withKey 'someid', (err2, mod2) ->\n\t\t\t\t\tmod2.getAll (err3, obj) ->\n\t\t\t\t\t\ttest.equal obj.field1, 'bar', 'The value on the object should have been saved'\n\t\t\t\t\t\ttest.equal obj.field2, 'foobar', 'The value on the object should have been saved'\n\t\t\t\t\t\ttest.done()\n\t\t\t\t\t\t\n\t'Get all includes the key': (test) ->\n\t\ttest.expect 1\n\t\tModel.withKey 'someid', (err, model) ->\n\t\t\tmodel.getAll (err2, obj) ->\n\t\t\t\tconsole.log obj.key\n\t\t\t\ttest.equal obj.key, 'someid', 'getAll did not return the key'\n\t\t\t\ttest.done()\n\nexports['Complete'] = (test) ->\n\t# This is a dummy test to finish off the tests\n\tredis.flushall ->\n\t\tredis.quit()\n\t\ttest.done()\n","avg_line_length":29.8888888889,"max_line_length":89,"alphanum_fraction":0.6299049979}