/>
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | ; Unix-style newlines
2 | [*]
3 | end_of_line = LF
4 | indent_style = tab
5 |
--------------------------------------------------------------------------------
/util/util.md:
--------------------------------------------------------------------------------
1 | @page can.util can.util
2 | @parent canjs
3 |
4 | Utility methods supported by CanJS
--------------------------------------------------------------------------------
/view/test/nested_plugin.ejs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/util/util_test.js:
--------------------------------------------------------------------------------
1 | steal('./fixture/fixture_test.js', './object/object_test.js', './string/string_test.js');
2 |
--------------------------------------------------------------------------------
/view/test/plugin.ejs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/view/ejs/test/binding.ejs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/util/library.js:
--------------------------------------------------------------------------------
1 | // This is mainly used for the AMD build
2 | steal('can/util/jquery', function (can) {
3 | return can;
4 | });
5 |
--------------------------------------------------------------------------------
/view/mustache/test/table.mustache:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/can.js:
--------------------------------------------------------------------------------
1 | steal('can/util', 'can/control/route', 'can/model',
2 | 'can/view/mustache', 'can/component', function(can) {
3 | return can;
4 | });
--------------------------------------------------------------------------------
/util/util.js:
--------------------------------------------------------------------------------
1 | // comments are in func.js for documentation purposes.
2 | steal('can/util/jquery', function (can) {
3 | return can;
4 | });
5 |
--------------------------------------------------------------------------------
/guides/Applications-using-CanJS.md:
--------------------------------------------------------------------------------
1 | ## Jumboiskon
2 | - website - https://jumbo.iskon.hr/index
3 | - developers
4 | - http://www.revolucija.hr
--------------------------------------------------------------------------------
/model/findOneData.md:
--------------------------------------------------------------------------------
1 | @typedef {function} can.Model.findOneData findOneData
2 |
3 | @param {Object} params
4 | @return {can.Deferred} A deferred
5 |
--------------------------------------------------------------------------------
/view/test/hookupvalcall.ejs:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/control/eventHandler.md:
--------------------------------------------------------------------------------
1 | @typedef {function} can.Control.eventHandler eventHandler(element, event)
2 | @parent can.Control.types
3 |
4 | @signature `function(element, event)`
5 |
6 |
--------------------------------------------------------------------------------
/util/fixture/xhr.md:
--------------------------------------------------------------------------------
1 | @typedef {{}} can.AjaxSettings
2 |
3 | @description The options available to be passed to [can.ajax].
4 |
5 | @option {String} url
6 | @option {*} data
7 |
8 |
--------------------------------------------------------------------------------
/view/ejs/test/nested_live_bindings.ejs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/control/eventDescription.md:
--------------------------------------------------------------------------------
1 | @typedef {String} can.Control.eventDescription eventDescription
2 | @parent can.Control.types
3 |
4 | @signature `"[CONTEXT ][SELECTOR ]EVENTNAME"`
5 |
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .tmp*
2 | /dist
3 | *.swp
4 | *.orig
5 | util/can.*.js
6 | *node_modules*
7 | standalone*
8 | docs*
9 | *.DS_Store
10 | .idea
11 | bower_components/
12 | test/pluginified/latest.js
--------------------------------------------------------------------------------
/view/ejs/test/shared_blocks.ejs:
--------------------------------------------------------------------------------
1 | <% for(var i = 0; i < items.length; i++) { %>
2 | <% if(this.mode !== "RESULTS") {
3 | if(items[i] !== "SOME_FAKE_VALUE") { %>
4 | hi
5 | <% }
6 | } else { %>
7 | nope
8 | <% }
9 | } %>
--------------------------------------------------------------------------------
/util/array/makeArray.js:
--------------------------------------------------------------------------------
1 | steal('./each.js', function () {
2 | can.makeArray = function (arr) {
3 | var ret = [];
4 | can.each(arr, function (a, i) {
5 | ret[i] = a;
6 | });
7 | return ret;
8 | };
9 | return can;
10 | });
11 |
--------------------------------------------------------------------------------
/view/ejs/tags.comment.md:
--------------------------------------------------------------------------------
1 | @function can.EJS.tags.comment <%# CODE %>
2 | @parent can.EJS.tags 4
3 |
4 |
5 | @signature `<%# CODE %>`
6 |
7 | Used for explicitly for comments. This will not render anything.
8 |
9 | <%# 'hello world' %>
--------------------------------------------------------------------------------
/guides/3rd-Party-Plugins-and-Extensions.md:
--------------------------------------------------------------------------------
1 | ## AppSwitcher
2 |
3 | Listens to changes in a can.route attribute and loads/unloads apps (can.Control).
4 |
5 | - https://github.com/thecountofzero/tcoz/tree/master/app_switcher
6 | - thecountofzero, @countofzero
--------------------------------------------------------------------------------
/view/ejs/test/indirect1.ejs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/view/ejs/test/indirect2.ejs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/observe/observe.js:
--------------------------------------------------------------------------------
1 | // Loads all observable core modules
2 | steal("can/util", "can/map", "can/list", "can/compute", function (can) {
3 | can.Observe = can.Map;
4 | can.Observe.startBatch = can.batch.start;
5 | can.Observe.stopBatch = can.batch.stop;
6 | can.Observe.triggerBatch = can.batch.trigger;
7 | return can;
8 | });
9 |
--------------------------------------------------------------------------------
/view/test/select.ejs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/guides/Guides.md:
--------------------------------------------------------------------------------
1 | @page guides Guides
2 |
3 | @body
4 | This page contains recipes and tutorials that will get you started with building CanJS projects. Choose a section on the left to learn more about the components that make CanJS work and to see CanJS being used in real projects. If you're new to CanJS, a good starting point is [Why Why CanJS?]
5 |
--------------------------------------------------------------------------------
/util/inserted/inserted_test.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | module('can/util/inserted');
3 | if (window.jQuery) {
4 | test('jquery', function () {
5 | var el = $('
');
6 | el.bind('inserted', function () {
7 | ok(true, 'inserted called');
8 | });
9 | $('#qunit-test-area')
10 | .append(el);
11 | });
12 | }
13 | }());
14 |
--------------------------------------------------------------------------------
/view/mustache/test/recursive.mustache:
--------------------------------------------------------------------------------
1 |
2 | {{#items}}
3 |
4 | {{#item.children}}
5 |
6 | {{>'view/ejs/recursive.ejs'}}
7 |
8 | {{/item.children}}
9 | {{^item.children}}
10 |
L
11 | {{/item.children}}
12 |
13 | {{/items}}
14 |
15 |
--------------------------------------------------------------------------------
/view/ejs/test/test_template.ejs:
--------------------------------------------------------------------------------
1 | <%# Test Something Produces Items%>
2 | <%== something(function(items){ %>
3 | <%== items.length%>
4 | <% can.each(items, function(){ %><%# Test Something Produces Items%>
5 | <%== something(function(items){ %>ItemsLength<%== items.length %><% }) %>
6 | <% }) %>
7 | <% }) %>
8 | <% for( var i =0; i < items.length; i++) { %>for <%= items[i] %><% } %>
--------------------------------------------------------------------------------
/view/bindings/bindings.md:
--------------------------------------------------------------------------------
1 | @page can.view.bindings
2 | @parent can.view.plugins
3 |
4 | Provides template bindings and two-way bindings.
5 |
6 | @body
7 |
8 | ## Use
9 |
10 | The `can/view/bindings` plugin provides helpers useful for template declarative
11 | binding and two-way bindings. This plugin is included by default
12 | in core CanJS.
13 |
14 | @demo can/view/bindings/hyperloop.html
--------------------------------------------------------------------------------
/view/ejs/tags.templated.md:
--------------------------------------------------------------------------------
1 | @function can.EJS.tags.templated <%% CODE %>
2 | @parent can.EJS.tags 3
3 |
4 | @signature `<%% CODE %>`
5 |
6 | Renders <% CODE %> as text in result of the template rather than running CODE itself. This is useful for generators.
7 |
8 | The following results in "<%= 'hello world' %>" rather than the string "hello world."
9 |
10 | <%%= 'hello world' %>
--------------------------------------------------------------------------------
/component/tag.md:
--------------------------------------------------------------------------------
1 | @property {String} can.Component.prototype.tag
2 | @parent can.Component.prototype
3 |
4 | Specifies the HTML tag (or node-name) the can.Component will be created on.
5 |
6 | @option {String} The tag name the can.Component
7 | will be created on. Tag names are typically lower cased and
8 | hypenated like: "foo-bar". Component's register their
9 | tag with [can.view.tag].
10 |
11 |
12 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "CanJS",
3 | "repo": "bitovi/canjs",
4 | "description": "Can do JavaScript MVC",
5 | "main": "can.jquery.js",
6 | "keywords": [
7 | "mvc",
8 | "component",
9 | "amd"
10 | ],
11 | "license": "MIT",
12 | "devDependencies": {
13 | "qunit": "~1.12.0",
14 | "zepto": "~1.0.0",
15 | "benchmark": "~1.0.0",
16 | "requirejs": "~2.1.10"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/view/ejs/tags.unescaped.md:
--------------------------------------------------------------------------------
1 | @function can.EJS.tags.unescaped <%== CODE %>
2 | @parent can.EJS.tags 2
3 |
4 | @signature `<%== CODE %>`
5 |
6 | Runs JS Code and writes the _unescaped_ result into the result of the template.
7 |
8 | The following results in "my favorite element is
B .". Using `<%==` is useful
9 | for sub-templates.
10 |
11 |
my favorite element is <%== 'B ' %>.
--------------------------------------------------------------------------------
/view/ejs/test/recursive.ejs:
--------------------------------------------------------------------------------
1 |
2 | <% items.each(function(item){ %>
3 |
4 | <% if( item.attr('children') ) { %>
5 |
6 | <%== can.view.render(can.test.path('view/ejs/test/recursive.ejs'), {items:item.attr('children')}) %>
7 |
8 | <%} else {%>
9 |
L
10 | <%}%>
11 |
12 | <%}) %>
13 |
14 |
--------------------------------------------------------------------------------
/map/sort/sort.md:
--------------------------------------------------------------------------------
1 | @page can.List.prototype.sort
2 | @parent can.List.prototype
3 | @plugin can/map/sort
4 | @test can/map/sort/test.html
5 |
6 | `list.sort(sortfunc)`
7 |
8 | Sorts the instances in the list.
9 |
10 | var list = new can.List([
11 | { name: 'Justin' },
12 | { name: 'Brian' },
13 | { name: 'Austin' },
14 | { name: 'Mihael' }])
15 |
16 | list.comparator = 'name';
17 | list.sort(); //- sorts the list by the name attribute
--------------------------------------------------------------------------------
/guides/components/template-1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/guides/components/template-0.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/view/mustache/doc/key.md:
--------------------------------------------------------------------------------
1 | @typedef {String} can.Mustache.key key
2 | @parent can.Mustache.types
3 |
4 | A key references a value within the current [can.Mustache.context context] of a
5 | template being rendered. In the following example, the
6 | key is `name`:
7 |
8 |
{{name}}
9 |
10 | If this template is rendered with:
11 |
12 | {
13 | name: "Austin"
14 | }
15 |
16 | The template writes out:
17 |
18 |
Austin
19 |
--------------------------------------------------------------------------------
/guides/components/template-2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/map/benchmark.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/util/all.js:
--------------------------------------------------------------------------------
1 | steal(
2 | 'can/component',
3 | 'can/construct',
4 | 'can/construct/proxy',
5 | 'can/control',
6 | 'can/control/route',
7 | 'can/control/plugin',
8 | 'can/list',
9 | 'can/model',
10 | 'can/observe',
11 | 'can/map/attributes',
12 | 'can/map/backup',
13 | 'can/map/delegate',
14 | 'can/map/setter',
15 | 'can/map/validations',
16 | 'can/route',
17 | 'can/view/ejs',
18 | 'can/util/fixture',
19 | 'can/view/modifiers',
20 | 'can/view/mustache',
21 | 'can/util/func.js');
22 |
--------------------------------------------------------------------------------
/view/ejs/tags.escaped.md:
--------------------------------------------------------------------------------
1 | @function can.EJS.tags.escaped <%= CODE %>
2 | @parent can.EJS.tags 1
3 |
4 |
5 | @signature `<%= CODE %>`
6 |
7 | Runs JS Code and writes the _escaped_ result into the result of the template. This is useful for when you want to show code in your page.
8 |
9 | The following results in the user seeing "my favorite element is <blink>BLINK<blink>" and not
10 |
BLINK .
11 |
12 |
my favorite element is <%= 'BLINK ' %>.
13 |
--------------------------------------------------------------------------------
/view/ejs/test/foo.js:
--------------------------------------------------------------------------------
1 | /*global list,animals*/
2 | var ___v1ew = [];
3 | ___v1ew.push('
myfavorite animals:');
4 | ___v1ew.push(can.view.txt(0, 'div', 0, this, function () {
5 | var ___v1ew = [];
6 | list(animals, function (animal) {
7 | ___v1ew.push('Animal= ');
8 | ___v1ew.push(can.view.txt(1, 'span', 0, this, function () {
9 | return animal;
10 | }));
11 | ___v1ew.push(' ');
12 | });
13 | return ___v1ew.join('');
14 | }));
15 | ___v1ew.push('!
');
16 |
--------------------------------------------------------------------------------
/guides/components/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/compute/computed.md:
--------------------------------------------------------------------------------
1 | @function can.computed compute
2 | @parent can.compute
3 |
4 | @signature `compute( [newVal] )`
5 |
6 | @param {*} [newVal] If `compute` is called with an argument, the first argument is used
7 | to set the compute to a new value. This may trigger a
8 | `"change"` event that can be listened for with [can.computed.bind].
9 |
10 | If the compute is called without any arguments (`compute()`), it simply returns
11 | the current value of the compute.
12 |
13 | @return {*} The current value of the compute.
14 |
--------------------------------------------------------------------------------
/map/map_benchmark.js:
--------------------------------------------------------------------------------
1 | steal('can/map', 'can/list', 'can/test/benchmarks.js', function (Map, List, benchmarks) {
2 | var objects, map;
3 | benchmarks.add('Adding a big array to an object', function () {
4 | objects = [];
5 | for (var i = 0; i < 10; i++) {
6 | objects.push({
7 | prop: 'prop',
8 | nest: {
9 | prop: 'prop',
10 | nest: {
11 | prop: 'prop'
12 | }
13 | }
14 | });
15 | }
16 | }, function () {
17 | map = new can.Map();
18 | map.attr('obj', objects);
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/util/string/classize.js:
--------------------------------------------------------------------------------
1 | steal('./string', function () {
2 | /**
3 | * Like [can.camelize camelize], but the first part is also capitalized
4 | * @param {String} s
5 | * @return {String} the classized string
6 | */
7 | can.classize = function (s, join) {
8 | // this can be moved out ..
9 | // used for getter setter
10 | var parts = s.split(can.undHash),
11 | i = 0;
12 | for (; i < parts.length; i++) {
13 | parts[i] = can.capitalize(parts[i]);
14 | }
15 | return parts.join(join || '');
16 | };
17 | });
18 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/util/hashchange.js:
--------------------------------------------------------------------------------
1 | steal('can/util/can.js', function (can) {
2 | // This is a workaround for libraries that don't natively listen to the window hashchange event
3 | (function () {
4 | var addEvent = function (el, ev, fn) {
5 | if (el.addEventListener) {
6 | el.addEventListener(ev, fn, false);
7 | } else if (el.attachEvent) {
8 | el.attachEvent('on' + ev, fn);
9 | } else {
10 | el['on' + ev] = fn;
11 | }
12 | }, onHashchange = function () {
13 | can.trigger(window, 'hashchange');
14 | };
15 | addEvent(window, 'hashchange', onHashchange);
16 | }());
17 | });
18 |
--------------------------------------------------------------------------------
/model/list/qunit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/map/validations/model_validations.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
20 |
21 |
--------------------------------------------------------------------------------
/component/examples/my_greeting_full.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
27 |
28 |
--------------------------------------------------------------------------------
/guides/recipes.md:
--------------------------------------------------------------------------------
1 | @page Recipes Recipes
2 | @parent guides 4
3 |
4 | @body
5 | To the left is a list of __CanJS__ recipes to help you learn CanJS. To
6 | add your own, simply [edit this file](https://github.com/bitovi/canjs/edit/gh-pages/recipes.md). To
7 | help create a JSFiddle, we've created the following fiddles you can fork:
8 |
9 | - [jQuery and CanJS](http://jsfiddle.net/donejs/qYdwR/)
10 | - [Zepto and CanJS](http://jsfiddle.net/donejs/7Yaxk/)
11 | - [Dojo and CanJS](http://jsfiddle.net/donejs/9x96n/)
12 | - [YUI and CanJS](http://jsfiddle.net/donejs/w6m73/)
13 | - [Mootools and CanJS](http://jsfiddle.net/donejs/mnNJX/)
14 |
--------------------------------------------------------------------------------
/view/bindings/hyperloop.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
30 |
31 |
--------------------------------------------------------------------------------
/view/bindings/input-text.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
30 |
31 |
--------------------------------------------------------------------------------
/model/store/qunit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
store QUnit Test
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/component/examples/click_me.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
23 |
--------------------------------------------------------------------------------
/control/modifier/key/key_test.js:
--------------------------------------------------------------------------------
1 | steal('can/control/modifier/key', function (Control) {
2 | module('can/control/modifier/key');
3 | test('key down triggered', 1, function () {
4 | var Tester = can.Control({
5 | 'keydown': function () {},
6 | 'keydown:(shift+p)': function (elm, ev) {
7 | ok('key event pressed!');
8 | }
9 | });
10 | new Tester(document.body);
11 | // trigger event
12 | var e = jQuery.Event('keydown');
13 | e.which = 80;
14 | e.keyCode = 80;
15 | e.shiftKey = true;
16 | e.altKey = false;
17 | e.charCode = 0;
18 | e.ctrlKey = false;
19 | e.metaKey = false;
20 | $(document.body)
21 | .trigger(e);
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/util/string/deparam/qunit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
associations
14 |
list
15 |
16 |
17 |
--------------------------------------------------------------------------------
/model/findAllData.md:
--------------------------------------------------------------------------------
1 | @typedef {function} can.Model.findAllData findAllData
2 |
3 | Retrieves a list of items for [can.Model.models], typically by making an
4 | Ajax request.
5 |
6 | @param {Object} params Specifies the list to be retrieved.
7 |
8 | @return {can.Deferred} A deferred that resolves to a data structure
9 | that can be understood by [can.Model.models].
10 |
11 |
12 |
13 |
14 | @body
15 |
16 | ## Use
17 |
18 | Typically, `findAll` is implemented with a "string" or [can.AjaxSettings ajax settings object] like:
19 |
20 | findAll: "GET /tasks"
21 |
22 | or
23 |
24 | findAll: {url: "/tasks", dataType: "custom"}
25 |
26 | [can.Model.setup] converts
27 |
--------------------------------------------------------------------------------
/control/view/test/view_test.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | /* global Myproject */
3 | module('can/control/view');
4 | test('complex paths nested inside a controller directory', function () {
5 | can.Control.extend('Myproject.Controllers.Foo.Bar');
6 | //var path = jQuery.Controller._calculatePosition(Myproject.Controllers.Foo.Bar, "init.ejs", "init")
7 | //equal(path, "//myproject/views/foo/bar/init.ejs", "view path is correct")
8 | can.Control.extend('Myproject.Controllers.FooBar');
9 | var path = can.Control._calculatePosition(Myproject.Controllers.FooBar, 'init.ejs', 'init');
10 | equal(path, '//myproject/views/foo_bar/init.ejs', 'view path is correct');
11 | });
12 | }());
13 |
--------------------------------------------------------------------------------
/view/ejs/test/todo_comments.ejs:
--------------------------------------------------------------------------------
1 |
2 | <% this.each(function( todo ) { %>
3 |
4 |
el.data('todo',todo) %>>
5 |
6 | >
8 |
9 |
10 |
11 | <%= todo.attr('name') %>
12 |
13 |
14 |
15 | X
16 |
17 | <% }) %>
--------------------------------------------------------------------------------
/view/mustache/doc/renderer.md:
--------------------------------------------------------------------------------
1 | @typedef {function(Object,Object.
):documentFragment} can.view.renderer(data,helpers) renderer
2 |
3 | @description A function returned by [can.view], [can.view.ejs], [can.view.mustache] that renders a
4 | template into an html documentFragment.
5 |
6 | @param {Object} data An object of data used to render the template.
7 |
8 | @param {Object.} helpers Local helper functions used by the template.
9 |
10 | @return {documentFragment} A documentFragment that contains the HTML rendered by the template.
11 |
12 | @body
13 |
14 | A "renderer" function is a function returned by various [can.view] APIs that can be used
15 | to render data into a documentFragment.
16 |
--------------------------------------------------------------------------------
/component/examples/hello-world.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
29 |
30 |
--------------------------------------------------------------------------------
/guides/components/scope-0.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/guides/components/scope-1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/test.js:
--------------------------------------------------------------------------------
1 | steal('can/util', function() {
2 | var viewCheck = /(\.mustache|\.ejs|extensionless)$/;
3 |
4 | can.test = {
5 | fixture: function (path) {
6 | if (typeof steal !== 'undefined') {
7 | return steal.config('root').toString() + '/' + path;
8 | }
9 |
10 | if (window.require && require.toUrl && !viewCheck.test(path)) {
11 | return require.toUrl(path);
12 | }
13 | return path;
14 | },
15 | path: function (path) {
16 | if (typeof steal !== 'undefined') {
17 | return ""+steal.idToUri(steal.id("can/"+path).toString()) ;
18 | }
19 |
20 | if (window.require && require.toUrl && !viewCheck.test(path)) {
21 | return require.toUrl(path);
22 | }
23 | return path;
24 | }
25 | }
26 | });
27 |
--------------------------------------------------------------------------------
/util/string/rsplit/rsplit.js:
--------------------------------------------------------------------------------
1 | steal('can/util', 'can/util/string', function (can) {
2 | /**
3 | * @add jQuery.String
4 | */
5 | can.rsplit = function (string, regex) {
6 | var result = regex.exec(string),
7 | retArr = [],
8 | first_idx, last_idx;
9 | while (result !== null) {
10 | first_idx = result.index;
11 | last_idx = regex.lastIndex;
12 | if (first_idx !== 0) {
13 | retArr.push(string.substring(0, first_idx));
14 | string = string.slice(first_idx);
15 | }
16 | retArr.push(result[0]);
17 | string = string.slice(result[0].length);
18 | result = regex.exec(string);
19 | }
20 | if (string !== '') {
21 | retArr.push(string);
22 | }
23 | return retArr;
24 | };
25 | return can;
26 | });
27 |
--------------------------------------------------------------------------------
/view/ejs/test/table_test.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Game Name
5 | Rating
6 |
7 |
8 |
9 | <% games.each( function(game) { %>
10 |
11 | <%= game.attr('name') %>
12 | <%= game.attr('rating') %>
13 |
14 | <% }) %>
15 | <% games.each( function(game) { %>
16 |
17 | <%= game.attr('name') %>
18 | <%= game.attr('rating') %>
19 |
20 | <% }) %>
21 |
22 |
--------------------------------------------------------------------------------
/guides/components/scope-2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/component/examples/paginate_next.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
--------------------------------------------------------------------------------
/test/benchmarks.js:
--------------------------------------------------------------------------------
1 | steal("steal","benchmark", function(steal){
2 |
3 | var suite = new Benchmark.Suite;
4 |
5 | suite.on('cycle', function(event) {
6 | console.log(String(event.target));
7 | })
8 |
9 | var benchmarks = {
10 | add: function(name, setup, benchmark){
11 | if(!benchmark){
12 | benchmark = setup;
13 | setup = undefined
14 | }
15 | suite.add(name, benchmark, {
16 | setup: setup
17 | });
18 | return this;
19 | },
20 | run: function(){
21 | suite.run({ 'async': true, 'queued': true });
22 | },
23 | suite: suite,
24 | on: function(){
25 | return suite.on.apply(this, arguments)
26 | }
27 | }
28 | steal.bind("done", function(){
29 | benchmarks.run();
30 | })
31 |
32 | return benchmarks;
33 | })
34 |
--------------------------------------------------------------------------------
/.jsbeautifyrc:
--------------------------------------------------------------------------------
1 | {
2 | "html": {
3 | "braceStyle": "collapse",
4 | "indentWithTabs": true,
5 | "indentScripts": "keep",
6 | "maxPreserveNewlines": 10,
7 | "preserveNewlines": true,
8 | "unformatted": ["a", "sub", "sup", "b", "i", "u"],
9 | "wrapLineLength": 0
10 | },
11 | "css": {
12 | "indentWithTabs": true
13 | },
14 | "js": {
15 | "braceStyle": "expanded",
16 | "breakChainedMethods": true,
17 | "e4x": false,
18 | "evalCode": false,
19 | "indentLevel": 0,
20 | "indentWithTabs": true,
21 | "jslintHappy": true,
22 | "keepFunctionIndentation": false,
23 | "maxPreserveNewlines": 2,
24 | "preserveNewlines": true,
25 | "spaceBeforeConditional": true,
26 | "spaceInParen": false,
27 | "unescapeStrings": false,
28 | "wrapLineLength": 0
29 | }
30 | }
--------------------------------------------------------------------------------
/view/bindings/select.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
30 |
31 |
--------------------------------------------------------------------------------
/test/templates/test.html.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/util/object/qunit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/util/string/qunit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/util/fixture/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/util/object/isplain/qunit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | object QUnit Test
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/model/queue/qunit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
22 |
23 |
24 |