I like the syntactic idioms of Prototype, particularly the Enumerable
module. The methods really help to improve the readability of
JavaScript code.
Right now, I am writing a little program in JavaScript which is
thought for running in batch mode, i.e. from the command line.
I wonder whether it's possible to separate the UI part of Prototype -
connected with the browser - from its syntactic core. How much effort
would it be? When running
cscript prototype.js
on my windows machine, I get error because a "window" object is
missing. I hoped that replacing the initial "Browser" and
"BrowserFeatures" declarations by hashs with all properties set to
"false" could solve the problem. But there are more places where the
browser environment is expected.
How difficult would it be to separate the "core" layer from the
"browser-dependent" layer in Prototype? I don't know the mechanism how
the final Prototype.js is built from its code parts: Would it be
possible to build another product from these parts which only covers
the Prototype core?
Thanks for an answer,
Rüdiger
-- You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
> I like the syntactic idioms of Prototype, particularly the Enumerable
> module. The methods really help to improve the readability of
> JavaScript code.
> Right now, I am writing a little program in JavaScript which is
> thought for running in batch mode, i.e. from the command line.
> I wonder whether it's possible to separate the UI part of Prototype -
> connected with the browser - from its syntactic core. How much effort
> would it be? When running
> cscript prototype.js
> on my windows machine, I get error because a "window" object is
> missing. I hoped that replacing the initial "Browser" and
> "BrowserFeatures" declarations by hashs with all properties set to
> "false" could solve the problem. But there are more places where the
> browser environment is expected.
> How difficult would it be to separate the "core" layer from the
> "browser-dependent" layer in Prototype? I don't know the mechanism how
> the final Prototype.js is built from its code parts: Would it be
> possible to build another product from these parts which only covers
> the Prototype core?
> Thanks for an answer,
> Rüdiger
> --
> You received this message because you are subscribed to the Google Groups
> "Prototype: Core" group.
> To post to this group, send email to prototype-core@googlegroups.com
> To unsubscribe from this group, send email to
> prototype-core-unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/prototype-core?hl=en
-- You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
toxcct, you might want of have a look at a number of really exciting
server side JS frameworks (node.js, narwhal, ringo, etc.).
Best,
Tobie
-- You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
Good news! Looking forward to this then. Probably the best way would
be to adapt the build process: Building two different files from the
sources - one for the batch / server side context, and another one for
the browser context. This variant would be better than having one
"prototype.js" with lots of conditionals that have to be executed at
runtime.
>really exciting server side JS frameworks (node.js, narwhal, ringo, etc.).
I will have a look at those, thanks for the info.
@toxcct:
>Are you sure you are using "Javascript" precisely ?
>Aren't you using some kind of ECMAScript instead ?
Well, my scripts are executed with the same library (%systemroot%
\system32\jscript.dll) that is used by the Internet Explorer for
script execution. The only difference is that there is no browser
around and hence no global "window" object, no "document" etc.
Instead, i execute the JS files with the "cscript" command.
You ask which kind of ECMAScript I am using. For me, it is of no
practical use to classify the capabilities of this jscript.dll. It is
sufficient that it understands the ECMA script standard as a subset of
its language scope. Indeed, I can execute my script in Google Chrome,
in Firefox and in IE, as it only uses the ECMAScript core which is
understood by all these user agents. The point is that I don't want to
run the script in a browser. I want to start it as a batch file with
no UI. And the question was about whether I still could use the nice
language enhancements provided by prototype even in this context. This
has been answered by Tobie now.
Thanks and regards,
Rüdiger
-- You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
JavaScript "without a browser" is becoming increasingly more popular (and
important) in the industry, so I definitely look forward to seeing language
extensions extracted in a separate module/library. If you take a look at the
current source tree now, you'll see effort being made in this direction.
-- You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
-- You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
On Apr 21, 6:51 am, Rüdiger Plantiko <ruediger.plant...@astrotexte.ch>
wrote:
> >Are you sure you are using "Javascript" precisely ?
> >Aren't you using some kind of ECMAScript instead ?
> Well, my scripts are executed with the same library (%systemroot%
> \system32\jscript.dll) that is used by the Internet Explorer for
> script execution. The only difference is that there is no browser
> around and hence no global "window" object, no "document" etc.
> Instead, i execute the JS files with the "cscript" command.
You're right. JScript a decently compliant engine, thought not fast.
It does have the advantage of being installed on every Windows
machine. Classic ASP also uses the same engine. There's a few extra
APIs for ActiveXObjects and basic shell and window alerts (WScript.)
Nathan
-- You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
I've used the Enumerable methods and the core stuff like Function.bind
and Class.create in whatever ECMA flavor the Adobe programs
use(Indesign & Photoshop) so I'm sure it's possible to leverage some
things from prototype in your program.
> > >Are you sure you are using "Javascript" precisely ?
> > >Aren't you using some kind of ECMAScript instead ?
> > Well, my scripts are executed with the same library (%systemroot%
> > \system32\jscript.dll) that is used by the Internet Explorer for
> > script execution. The only difference is that there is no browser
> > around and hence no global "window" object, no "document" etc.
> > Instead, i execute the JS files with the "cscript" command.
> You're right. JScript a decently compliant engine, thought not fast.
> It does have the advantage of being installed on every Windows
> machine. Classic ASP also uses the same engine. There's a few extra
> APIs for ActiveXObjects and basic shell and window alerts (WScript.)
> Nathan
> --
> You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
> To post to this group, send email to prototype-core@googlegroups.com
> To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/prototype-core?hl=en
-- You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
thanks for your suggestions and interesting links. I will study them
and probably
use one of your proposals...
Thanks and regards,
Rüdiger
-- You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
On Apr 22, 9:54 am, Matt Foster <mattfoste...@gmail.com> wrote:
> I've used the Enumerable methods and the core stuff like Function.bind
> and Class.create in whatever ECMA flavor the Adobe programs
> use(Indesign & Photoshop) so I'm sure it's possible to leverage some
> things from prototype in your program.
This may be using some ES5 variant. Many new methods in this new
version of ECMAScript are either inspired by or present in Prototype:
-- You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en