Compare commits

...

7 Commits

Author SHA1 Message Date
Ariya Hidayat e2295f805c Lavender.
http://code.google.com/p/phantomjs/issues/detail?id=598
2012-06-20 23:28:04 -07:00
Ariya Hidayat ffc594e264 Fix Twitter-related examples to work with the new site.
http://code.google.com/p/phantomjs/issues/detail?id=609
2012-06-20 22:54:20 -07:00
Ariya Hidayat 78b1e271d6 Merge branch 'master' into 1.6 2012-06-20 21:30:30 -07:00
Ariya Hidayat e524157c81 Merge branch 'master' into 1.6 2012-06-20 09:06:25 -07:00
Ariya Hidayat 7944013141 Merge branch 'master' into 1.6 2012-06-19 17:26:04 -07:00
Ariya Hidayat 1f685ec241 Set version to 1.6.0.
http://code.google.com/p/phantomjs/issues/detail?id=598
2012-06-19 06:58:19 -07:00
Ariya Hidayat c68082e3b1 Undocument the callback mechanism.
This is private for now, see issue 133 for details.

http://code.google.com/p/phantomjs/issues/detail?id=133
2012-06-18 22:35:53 -07:00
9 changed files with 9 additions and 38 deletions

View File

@ -32,6 +32,7 @@ Please see also http://code.google.com/p/phantomjs/wiki/ReleaseNotes.
* Fixed example scripts to exit with the right exit code (issue 544)
* Fixed build failure with glib 2.31.0+ (issue 559)
* Fixed error handler failures in some cases (issue 589)
* Fixed Twitter-related examples to work with the new site (issue 609)
2012-03-20: Version 1.5.0 "Ghost Flower"

View File

@ -2,7 +2,7 @@
PhantomJS ([www.phantomjs.org](http://phantomjs.org)) is a headless WebKit scriptable with JavaScript or CoffeeScript. It is used by hundreds of [developers](http://code.google.com/p/phantomjs/wiki/ExternalArticles) and dozens of [organizations](http://code.google.com/p/phantomjs/wiki/WhoUsesPhantomJS) for web-related development workflow.
The latest [stable release](http://code.google.com/p/phantomjs/wiki/ReleaseNotes) is version 1.5 (codenamed "Ghost Flower"). Follow the official Twitter stream [@HeadlessPhantom](http://twitter.com/HeadlessPhantom) to get the frequent development updates.
The latest [stable release](http://code.google.com/p/phantomjs/wiki/ReleaseNotes) is version 1.6 (codenamed "Lavender"). Follow the official Twitter stream [@HeadlessPhantom](http://twitter.com/HeadlessPhantom) to get the frequent development updates.
PhantomJS is created and maintained by [Ariya Hidayat](http://ariya.ofilabs.com/about) (Twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)), with the help of [many contributors](https://github.com/ariya/phantomjs/contributors).

View File

@ -14,7 +14,7 @@ follow = (user, callback) ->
if status is 'fail'
console.log user + ': ?'
else
data = page.evaluate -> document.querySelector('div.timeline-following').innerText
data = page.evaluate -> document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
console.log user + ': ' + data
callback.apply()

View File

@ -13,7 +13,7 @@ function follow(user, callback) {
console.log(user + ': ?');
} else {
var data = page.evaluate(function () {
return document.querySelector('div.timeline-following').innerText;
return document.querySelector('div.profile td.stat.stat-last div.statnum').innerText;
});
console.log(user + ': ' + data);
}

View File

@ -1,13 +0,0 @@
p = require("webpage").create()
p.onConsoleMessage = (msg) ->
console.log msg
p.onCallback = (msg) ->
console.log "Received by the 'phantom' main context: " + msg
"Hello there, I'm coming to you from the 'phantom' context instead"
p.evaluate ->
callbackResponse = phantomCallback("Hello, I'm coming to you from the 'page' context")
console.log "Received by the 'page' context: " + callbackResponse
phantom.exit()

View File

@ -1,17 +0,0 @@
var p = require("webpage").create();
p.onConsoleMessage = function(msg) { console.log(msg); };
// Calls to "phantomCallback" within the page 'p' arrive here
p.onCallback = function(msg) {
console.log("Received by the 'phantom' main context: "+msg);
return "Hello there, I'm coming to you from the 'phantom' context instead";
};
p.evaluate(function() {
// Return-value of the "onCallback" handler arrive here
var callbackResponse = callPhantom("Hello, I'm coming to you from the 'page' context");
console.log("Received by the 'page' context: "+callbackResponse);
});
phantom.exit();

View File

@ -25,7 +25,7 @@ page.open encodeURI("http://mobile.twitter.com/#{twitterId}"), (status) ->
else
# Execute some DOM inspection within the page context
page.evaluate ->
list = document.querySelectorAll 'span.status'
list = document.querySelectorAll 'div.tweet-text'
for i, j in list
console.log "#{j + 1}: #{i.innerHTML.replace /<.*?>/g, ''}"
console.log "#{j + 1}: #{i.innerText}"
phantom.exit()

View File

@ -27,9 +27,9 @@ page.open(encodeURI("http://mobile.twitter.com/" + twitterId), function (status)
} else {
// Execute some DOM inspection within the page context
page.evaluate(function() {
var list = document.querySelectorAll('span.status');
var list = document.querySelectorAll('div.tweet-text');
for (var i = 0; i < list.length; ++i) {
console.log((i + 1) + ": " + list[i].innerHTML.replace(/<.*?>/g, ''));
console.log((i + 1) + ": " + list[i].innerText);
}
});
}

View File

@ -36,7 +36,7 @@
#define PHANTOMJS_VERSION_MAJOR 1
#define PHANTOMJS_VERSION_MINOR 6
#define PHANTOMJS_VERSION_PATCH 0
#define PHANTOMJS_VERSION_STRING "1.6.0 (development)"
#define PHANTOMJS_VERSION_STRING "1.6.0"
#define COFFEE_SCRIPT_EXTENSION ".coffee"