![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
= Buttons
NOTE: This is a very early version of Buttons. Expect it to change rapidly.
Buttons is a Rack framework for working with JavaScript-heavy applications. It automatically creates Ajax endpoints for Ruby methods, and creates a set of JavaScript functions to access those endpoints.
== Example
Here's an example. The Ruby class below will automatically generate the JavaScript found beneath it. For now, we only generate code that relies on jQuery, but that's planned to change.
Ruby code:
class ProfileButton < Buttons::Button
get :show
post :login
def login(username, password)
# The variable's set just to show that it's being returned.
token = generate_login_token(username, password)
token
end
def show(profile_id)
Profile.find(profile_id)
end
end
JavaScript code (found at /profile.js):
(function () {
this.Profile = {};
Profile.login = function (username, password, _ajaxOptions) {
var data = { 'username': username, 'password': password };
if (_ajaxOptions === undefined || typeof(_ajaxOptions) != "object") {
_ajaxOptions = {};
}
_ajaxOptions['type'] = "POST";
_ajaxOptions['url'] = "/profile/login";
_ajaxOptions['data'] = data;
if (_ajaxOptions['dataType'] === 'undefined') {
_ajaxOptions['dataType'] = 'json';
}
return jQuery.ajax(_ajaxOptions);
};
Profile.show = function (profileId, _ajaxOptions) {
var data = { 'profile_id': profileId };
if (_ajaxOptions === undefined || typeof(_ajaxOptions) != "object") {
_ajaxOptions = {};
}
_ajaxOptions['type'] = "GET";
_ajaxOptions['url'] = "/profile/show";
_ajaxOptions['data'] = data;
if (_ajaxOptions['dataType'] === 'undefined') {
_ajaxOptions['dataType'] = 'json';
}
return jQuery.ajax(_ajaxOptions);
};
})();
== How to use this
Run buttons to create a new Buttons application in that directory. There's not any helpers or generators yet, but you can look at the generated application to figure it out for now.
FAQs
Unknown package
We found that buttons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.