The Window.Growl Script.aculo.us mod is a modified version of Daniel Mota's Window.Growl adapted for the Script.aculo.us framework.AjaxResponders register
'ajax_loader' duration: 0.3 to: 0.5 ;
if 0 == Ajax activeRequestCount
'ajax_loader' duration: 0.3 from: 0.5 ;
if!request success
var errorMapping = $H
400: 'Bad Request''The request contains bad syntax or cannot be fulfilled.'
401: 'Authorization Required''You need to authenticate to access this page.'
403: 'Forbidden''The request was a legal request, but the server is refusing to respond to it.'
404: 'Page Not Found''The requested resource could not be found.'
405: 'Method Not Allowed''A request was made of a resource using a request method not supported by that resource; for example, using GET on a form which requires data to be presented via POST, or using PUT on a read-only resource.'
406: 'Not Acceptable''The action you tried to perform on this resource was considered unacceptable.'
415: 'Unsupported Media Type''The media type you are requesting is unsupported.'
422: 'Unprocessable Entity''The request was well-formed but was unable to be followed due to semantic errors.'
500: 'Application Error''An error occurred in the application code. Report sent.'
503: 'Service not available''The webserver did not respond to the request.'
505: 'HTTP Version Not Supported''The requested version is not available on this server.'
;
var errorMessage = errorMapping get transportstatus || 'Unknown Error''An error occurred, but could not be determined correctly.' ;
if transport responseJSON && transport responseJSON.error
errorMessage = transport responseJSON.errortitle transport responseJSON.error message
var notifyUser =
title: errorMessage0
message: errorMessage1
image: "/images/elements/growl_warning.png"
type: 'error'
;
;
Growl.Smoke({http://blog.var.cc/static/growl/
title: "Growl.Smoke Script.aculo.us mod",
text: "http://blog.var.cc/static/growl/",
image: "image/var-logo-60.png",
duration: 2.0
});
http://pastie.org/818221
No comments:
Post a Comment