Commit graph

476 commits

Author SHA1 Message Date
Igor Minar
3eb0c8bc67 Simplify dateGetter() within the date filter. 2010-10-26 13:47:50 -07:00
Igor Minar
42855e4363 Simplify implementation of angular.String.toDate() 2010-10-26 13:47:50 -07:00
Igor Minar
4c61fc01f9 Add TzDate to angular-mocks.js
TzDate is a Date-like type that is independent from the timezone
settings of the machine on which TzDate instances are created.
This property makes it ideal for testing code that deals with
timezones in a manner that makes the code portable between timezones.

Closes #81
2010-10-26 13:47:50 -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
841013a4c4 Add millisecond support for date filter
Date filter should translate input which is a number (or number
string) into a date.
2010-10-25 10:44:03 -07:00
Igor Minar
4e9a2aa10e Revert "added support for treating numbers as date in miliseconds"
This reverts commit 1391f19fb4.
2010-10-23 18:26:47 -07:00
Igor Minar
4fc2141458 improving the PersonalLog app
- adding jsdocs and comments
- logs should be ordered in inverse order
2010-10-23 16:25:53 -07:00
Igor Minar
5b40e87ac6 personalLog demo - initial version with spec 2010-10-23 14:38:08 -07:00
Misko Hevery
1391f19fb4 added support for treating numbers as date in miliseconds 2010-10-23 14:38:08 -07:00
Igor Minar
04a4d8b061 adding ng:submit directive for use with forms
- allows for binding angular expressions to onsubmit events
- prevent default submit action (page reload)
2010-10-23 14:22:54 -07:00
Igor Minar
bbd87c9425 simplifying ng:click spec 2010-10-23 14:22:54 -07:00
Elliott Sprehn
64063b5d41 Fix issue where directories don't have a slash on the end and allow specifying a different port 2010-10-23 14:22:54 -07:00
Igor Minar
833e0ae343 $cookieStore should not be a global service
you must use $inject to $inject it as any other non-global service
2010-10-23 14:22:30 -07:00
Misko Hevery
d74ef497de Fix for getting into recursive $eval on scope. Close #59
It sort of worked since the browser would throw stack too deep
exception and the angular would then print the error to console.
So as long as you did not have console open you would not notice
this as an error.
2010-10-23 13:42:11 -07:00
Misko Hevery
6ddcf91861 Fix test which was causing the Chrome runner to fail. Upgraded JSTD to latest. Cleanup whitespace. 2010-10-23 13:12:45 -07:00
Misko Hevery
8a867cee22 Workaround for http://bugs.jquery.com/ticket/7292 2010-10-22 22:46:51 -07:00
Misko Hevery
68217d427c Horrible IE + jQuery hack to make the tests pass 2010-10-22 16:40:04 -07:00
Misko Hevery
1efef67b5f corrected buzz.html to use ng:src on images to prevent sporious browser requests/errors 2010-10-22 14:27:03 -07:00
Misko Hevery
a6cfa43c19 fixed issue with ie .data() method failing tests 2010-10-22 14:26:18 -07:00
Elliott Sprehn
b41bc98c54 Better nodeserver that implements an HTTP server more completely 2010-10-22 00:26:05 +08:00
Misko Hevery
aaabeb8c5e fixed more ie test failures 2010-10-20 23:51:49 -07:00
Misko Hevery
05d4971abb fix some of the failing ie tests 2010-10-20 23:17:59 -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
68f074c299 adding CHANGELOG.md with 0.9.0 release notes 2010-10-20 17:00:36 -07:00
Igor Minar
c53a37ed91 preparing 0.9.1 repulsion-field iteration 2010-10-20 15:52:55 -07:00
Igor Minar
2a9579a0ea cutting the 0.9.0 release 2010-10-20 15:51:36 -07:00
Igor Minar
6f3a757a37 Angular should look for angular-ie-compat file at the right location
The location should be based on the base path of the angular script
and the version identifier of the angular script.

ex: angular.js -> angular-ie-compat.js
    js/angular-0.9.0.min.js -> js/angular-ie-compat-0.9.0.js
2010-10-20 14:48:35 -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
Igor Minar
7530eea703 add missing spec for angularJsConfig 2010-10-20 14:48:35 -07:00
Igor Minar
644c8514c5 extract and test regexp that identifies angular script tag 2010-10-20 14:48:35 -07:00
Elliott Sprehn
2115db6903 Lots of stability and performance updates and UI polish too.
Polish the Scenario Runner UI to include:
- a scroll pane that steps appear in since the list can be very long
- Collapse successful tests
- Show the line where the DSL statements were when there's an error (Chrome, Firefox)

Also:
- Remove lots angular.bind calls to reduce the amount of stack space used.
- Use setTimeout(...,0) to schedule the next future to let the browser breathe and have it repaint the steps. Also prevents overflowing the stack when an it() creates many futures.
- Run afterEach() handlers even if the it() block fails.
- Make navigateTo() take a function as the second argument so you can compute a URL in the future.
- Add wait() DSL statement to allow interactive debugging of tests.
- Allow custom jQuery selectors with element(...).query(fn) DSL statement.

Known Issues:
- All afterEach() handlers run even if a beforeEach() handler fails. Only after handlers for the same level as the failure and above should run.
2010-10-20 14:38:00 -07:00
Misko Hevery
9c8b1800b9 fixed negative numbers in Json 2010-10-20 07:22:15 -07:00
Vojta Jina
a27198d52e Added tests for URL_MATCH and fixed issue with empty path
This commit was produced by a combination of 4 commits:
- Added URL_MATCH test for basic url
- Moved two tests from $location to URL_MATCH, as they should be here
- Added test for host without "/" ending and fix the regexp to pass the test
- Added another test for matching empty abs path ("/") and fix the regexp
2010-10-19 21:58:01 -07:00
Misko Hevery
286d1fe434 fix issue where script calls back before callback registered. 2010-10-19 21:03:34 -07:00
Misko Hevery
c5cfe2b393 fix date filter to igrone falsy input 2010-10-19 20:38:49 -07:00
Misko Hevery
a0ac6725ed fixed Scenario.js so that it does not clobber global vars 2010-10-19 16:25:23 -07:00
Misko Hevery
406373b5db fixed tests 2010-10-19 16:14:16 -07:00
Misko Hevery
977cb7e03e upgrade jstd 2010-10-19 16:02:41 -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
Elliott Sprehn
e7e894a2e3 Significantly clean up the way the scenario DSL works and implement many more DSL statements.
- "this" always means the current chain scope inside a DSL

- addFutureAction callbacks now take ($window, $document, done)

- $document has a special method elements() that uses the currently selected nodes in the document as defined by using() statements.

- $document.elements() allows placeholder insertion into selectors to make them more readable.
  ex. $document.elements('input[name="$1"]', myVar) will substitute the value of myVar for $1 in the selector. Subsequent arguments are $2 and so on.

- $document.elements() results have a special method trigger(event) which should be used to events. This method implements some hacks to make sure browser UI controls update and the correct angular events fire.

- futures now allow custom formatting. By default any chain that results in a future can use toJson() or fromJson() to convert the future value to and from json. A custom parser can be provided with parsedWith(fn) where fn is a callback(value) that must return the parsed result.

Note: The entire widgets.html UI is now able to be controlled and asserted through DSL statements!!! Victory! :)
2010-10-19 00:45:38 -07:00
Igor Minar
a1fa23397f small fixes to the $location services
* fixing the jsdoc format
* rewriting updateHash() method to be easier to read and so that
  it minifies better
2010-10-18 22:24:44 -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
4bef371e5a fixing css class name for currency filter and its spec 2010-10-18 16:24:43 -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
Vojta Jina
d0e55bf446 Removed $location.cancel() method (and related test) 2010-10-18 14:13:48 -07:00
Vojta Jina
1cad16c6f9 Update $location API Close #62
update(objOrString)
updateHash(objOrString [, objOrString])
toString()
cancel()

Examples:
$location.update('http://www.angularjs.org/path#path?a=b');
$location.update({port: 443, protocol: 'https'});
$location.updateHash('hashPath');
$location.updateHash({a: 'b'});
$location.updateHash('hashPath', {a: 'b'});

This commit was produced by squash of more commits, here are the old messages:

- Change tests to use update() instead of parse().
- First implementation of update() method
- Test for update() with object parameter
- Add new tests for location, refactor location code
- Add tests for updateHash()
- Implement updateHash()
- Take one or two arguments, could be string - update hashPath, or hash object - update hashSearch...
- Fixed other service tests, to use new $location.update()
Added $location.cancel() method (with test)
Added $location.parse() for back compatability
Remove parse() method
2010-10-18 10:04:15 -07:00
Vojta Jina
341b2b3a9b Update $location API Close #62
update(objOrString)
updateHash(objOrString [, objOrString])
toString()
cancel()

Examples:
$location.update('http://www.angularjs.org/path#path?a=b');
$location.update({port: 443, protocol: 'https'});
$location.updateHash('hashPath');
$location.updateHash({a: 'b'});
$location.updateHash('hashPath', {a: 'b'});

This commit was produced by squash of more commits, here are the old messages:

- Change tests to use update() instead of parse().
- First implementation of update() method
- Test for update() with object parameter
- Add new tests for location, refactor location code
- Add tests for updateHash()
- Implement updateHash()
- Take one or two arguments, could be string - update hashPath, or hash object - update hashSearch...
- Fixed other service tests, to use new $location.update()
Added $location.cancel() method (with test)
Added $location.parse() for back compatability
Remove parse() method
2010-10-18 09:58:37 -07:00
Misko Hevery
9e9bdbdc40 JSON parser is now strict (ie, expressions are not allowed for security)
Close #57
2010-10-18 08:50:36 -07:00
Misko Hevery
352dbfa38f upgraded jasmine to 1.0.1
Close #63
2010-10-17 21:13:28 -07:00
Igor Minar
f24ec0c8f7 improving angular.copy spec 2010-10-16 22:10:01 -07:00