Commit graph

36 commits

Author SHA1 Message Date
Misko Hevery
659af29adb jsdoc parser + generator + viewer + scenario runner
- parse jsdocs from source code
- generate prerendered (markdown + mustache) partials
- generate json
- generate scenario runner for examples in docs
- basic angular doc viewer
2010-11-03 09:47:22 -07:00
Igor Minar
c67af8a038 rename src/Parser.js to src/parser.js 2010-10-27 15:32:30 -07:00
Elliott Sprehn
40d7e66f40 Lots of bug fixes in the scenario runner and a bunch of new features.
- By default the runner now creates multiple output formats as it runs. Nodes are created in the DOM with ids: json, xml, and html.

ex. $('#json').html() => json output of the runner
ex. $('#xml').html() => json output of the runner

$result is also an object tree result.

The permitted formats are html,json,xml,object.

If you don't want certain formats you can select specific ones with the new ng:scenario-output attribute on the script tag.

<script src="angular-scenario.js" ng:scenario-output="xml,json">

- Added element(...).count() that returns the number of matching elements for the selector.

- repeater(...).count() now returns 0 if no elements matched which can be used to check if a repeater is empty.

- Added toBe() matcher that does strict equality with ===

- Implement iit and ddescribe. If iit() is used instead of it() then only that test will run. If ddescribe() is used instead of describe() them only it() statements inside of it will run. Several iit/ddescribe() blocks can be used to run isolated tests.

- Implement new event based model for SpecRunner. You can now listen for events in the runner. This is useful for writing your own UI or connecting a remote process (ex. WebDriver). Event callbacks execute on the Runner instance.

Events, if fired, will always be in the below order. All events always happen
except for Failure and Error events which only happen in error conditions.

Events:
  RunnerBegin
  SpecBegin(spec)
  StepBegin(spec, step)
  StepError(spec, step, error)
  StepFailure(spec, step, error)
  StepEnd(spec, step)
  SpecError(spec, step, error)
  SpecEnd(spec)
  RunnerEnd

- Only allow the browser to repaint every 10 steps. Cuts 700ms off Firefox in benchmark, 200ms off Chrome.

- Bug Fix: Manually navigate anchors on click since trigger wont work in Firefox.
2010-10-26 15:17:57 -07:00
Misko Hevery
4fdab37659 create HTML sanitizer to allow inclusion of untrusted HTML in safe manner.
Sanitization works in two phases:
 1) We parse the HTML into sax-like events (start, end, chars).
    HTML parsing is very complex, and so it may very well be that what
    most browser consider valid HTML may not pares properly here,
    but we do best effort. We treat this parser as untrusted.
 2) We have safe sanitizeWriter which treats its input (start, end, chars)
    as untrusted content and escapes everything. It only allows elements
    in the whitelist and only allows attributes which are whitelisted.
    Any attribute value must not start with 'javascript:'. This check
    is performed after escaping for entity (&xAB; etc..) and ignoring
    any whitespace.

 - Correct linky filter to use safeHtmlWriter
 - Correct html filter to use safeHtmlWriter

Close #33; Close #34
2010-10-26 13:41:07 -07:00
Igor Minar
c6107fe8ac Rakefile should create the build directory when it is needed and doesn't exist 2010-10-20 17:14:31 -07:00
Igor Minar
2e687ee56f Add support for version numbers in the Rakefile
* version number is stored in version.yaml
  - work in progress is marked with version number that ends with '-snapshot'
* all compiled files are stored in the './build/' directory without version numbers
* :package task creates a tarball in the build directory
  - if version number contains '-snapshot', this substring is replaced with sha of the head
  - tarball contains version number in the filename
  - all js files contain version number in the filename
* .gitignore was updated to reflect all these changes
* the .map file is not created by the closure compiler any more
2010-10-20 14:48:35 -07:00
Misko Hevery
01c7abab35 Fix browser triggering in scenario to always do native events.
- Also fixed angular.suffix for scenarios
 - refactored click() to browserTrigger()
 - Fixed Rakefile with CSS and jQuery
2010-10-19 15:56:53 -07:00
Igor Minar
ffb968b08b Remove externs target from the Rakefile
We are not going to do advanced optimization in the forseeable
future, so until then we don't need we should remove them from
Rakefile.
2010-10-18 16:24:44 -07:00
Igor Minar
7059579c74 inline all images into css
* embedded images as data URIs
* rake task to generate multipart js file with embeded images for IE
* move images into a separate directory outside of src or css and
  keep them there for reference
* clean up Rakefile and ruby code
* .gitignore update
* don't penalize IE 8+ with an extra request to the ie-compat.js file
2010-10-18 16:24:43 -07:00
Elliott Sprehn
03df6cbddb New Angular Scenario runner and DSL system with redesigned HTML UI.
Uses the Jasmine syntax for tests, ex:

describe('widgets', function() {
  it('should verify that basic widgets work', function(){
    navigateTo('widgets.html');
    input('text.basic').enter('Carlos');
    expect(binding('text.basic')).toEqual('Carlos');
    input('text.basic').enter('Carlos Santana');
    expect(binding('text.basic')).not().toEqual('Carlos Boozer');
    input('text.password').enter('secret');
    expect(binding('text.password')).toEqual('secret');
    expect(binding('text.hidden')).toEqual('hiddenValue');
    expect(binding('gender')).toEqual('male');
    input('gender').select('female');
    expect(binding('gender')).toEqual('female');
  });
});

Note: To create new UI's implement the interface shown in angular.scenario.ui.Html.
2010-10-14 09:47:39 -07:00
Igor Minar
80c64b48f3 fix Rakefile - add Injector.js to :compile 2010-10-13 17:42:55 -07:00
Igor Minar
818b507d3c updating file list for the :package rake task
- removing angular-scenario.css (it's already inlined in the js)
- adding angular-mocks.js
2010-10-13 17:42:49 -07:00
Misko Hevery
d9abfe8a7e Introduced injector and $new to scope, and injection into link methods and controllers
- added angular.injector(scope, services, instanceCache) which returns inject
    - inject method can return, instance, or call function which have $inject
      property
    - initialize services with $creation=[eager|eager-publish] this means that
      only some of the services are now globally accessible
  - upgraded $become on scope to use injector hence respect the $inject property
    for injection
    - $become should not be run multiple times and will most likely be removed
      in future version
  - added $new on scope to create a child scope
     - $inject is respected on constructor function
  - simplified scopes so that they no longer have separate __proto__ for
    parent, api, behavior and instance this should speed up execution since
    scope will now create one __proto__ chain per scope (not three).

BACKWARD COMPATIBILITY WARNING:
  - services now need to have $inject instead of inject property for proper
    injection this breaks backward compatibility
  - not all services are now published into root scope
    (only: $location, $cookie, $window)
  - if you have widget/directive which uses services on scope
    (such as this.$xhr), you will now have to inject that service in
    (as it is not published on the root scope anymore)
2010-10-12 16:33:06 -07:00
Igor Minar
fbfd160316 adding :package task to the rake file 2010-10-12 16:28:46 -07:00
Misko Hevery
27868f17de cleanup underscore.js form rakefile 2010-09-23 13:53:38 +02:00
Misko Hevery
0649009624 Refactored the Browser:
- change from using prototype to inner functions to help with better compression
  - removed watchers (url/cookie) and introduced a poller concept
  - moved the checking of URL and cookie into services which register with poolers
Benefits:
  - Smaller minified file
  - can call $browser.poll() from tests to simulate polling
  - single place where setTimeout needs to be tested
  - More testable $browser
2010-09-22 16:17:44 +02:00
Misko Hevery
91104f878d add ftp script to auto deploy to angularjs.org 2010-08-14 11:03:36 -07:00
Misko Hevery
412f05977c removed google charts and few other filters, switched to simple optimization for compiler 2010-08-11 11:21:03 -07:00
Andres Ornelas
643b43ffe5 Added new files to Rakefile and consistently used .addFuture 2010-08-05 15:44:54 -07:00
Misko Hevery
00bb790392 fixed IE tests 2010-07-08 15:55:00 -07:00
Misko Hevery
fa0702bad1 change order of initialization 2010-05-28 10:32:03 -07:00
Andres Ornelas
cb5d211927 extracted switchRouteMatcher and added necessary libraries to angular-scenario 2010-05-27 11:26:23 -07:00
Misko Hevery
5992e81b2e added rake task to create a single file for scenario runner 2010-05-25 14:23:52 -07:00
Misko Hevery
0df93fd49c clean up, fixes for app 2010-04-07 10:17:15 -07:00
Misko Hevery
c655b884e2 tests broken, but bootstrap works 2010-03-29 10:40:57 -07:00
Misko Hevery
3d36942400 merge 2010-03-24 12:08:48 -07:00
Misko Hevery
fd72031e96 work in progress 2010-03-24 12:08:09 -07:00
Shyam Seshadri
563a98e4bd Fix rakefile to work with older versions of rake 2010-03-24 10:50:02 -07:00
Adam Abrons
2df072e3f8 twitter using resources 2010-03-16 14:38:56 -07:00
Misko Hevery
a9c182764b added formatters 2010-01-28 22:11:01 -08:00
Adam Abrons
88384854c2 add default rake task (compile and test), send database name to login 2010-01-26 11:27:50 -08:00
Misko Hevery
595b4ea097 checkpoint for integration with angular 2010-01-18 10:47:03 -08:00
Misko Hevery
1aba6b53b8 basic calculator works with minified.js, lots of references still broken 2010-01-10 08:58:57 -08:00
Misko Hevery
9b9a0dadcc removed nglr namespace 2010-01-09 15:02:43 -08:00
Misko Hevery
eb9e66f480 cleanup 2010-01-09 13:21:24 -08:00
Adam Abrons
c9c176a53b angular.js 2010-01-05 16:36:58 -08:00