Added: web2py current files

This commit is contained in:
2021-10-01 10:29:16 +02:00
parent 1615f2425d
commit 3c85651561
90 changed files with 10710 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
403
+1
View File
@@ -0,0 +1 @@
404
+1
View File
@@ -0,0 +1 @@
500
+1
View File
@@ -0,0 +1 @@
<html><body><h1>Temporarily down for maintenance</h1></body></html>
+7
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+7
View File
@@ -0,0 +1,7 @@
.calendar{z-index:2000;position:relative;display:none;background:#fff;border:2px solid #000;font-size:11px;color:#000;cursor:default;font-family:Arial,Helvetica,sans-serif;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}.calendar table{margin:0px;font-size:11px;color:#000;cursor:default;font-family:tahoma,verdana,sans-serif;}.calendar .button{text-align:center;padding:1px;color:#fff;background:#000;}.calendar .nav{background:#000;color:#fff}.calendar thead .title{font-weight:bold;padding:1px;background:#000;color:#fff;text-align:center;}.calendar thead .name{padding:2px;text-align:center;background:#bbb;}.calendar thead .weekend{color:#f00;}.calendar thead .hilite {background-color:#666;}.calendar thead .active{padding:2px 0 0 2px;background-color:#c4c0b8;}.calendar tbody .day{width:2em;text-align:right;padding:2px 4px 2px 2px;}.calendar tbody .day.othermonth{color:#aaa;}.calendar tbody .day.othermonth.oweekend{color:#faa;}.calendar table .wn{padding:2px 3px 2px 2px;background:#bbb;}.calendar tbody .rowhilite td{background:#ddd;}.calendar tbody td.hilite{background:#bbb;}.calendar tbody td.active{background:#bbb;}.calendar tbody td.selected{font-weight:bold;background:#ddd;}.calendar tbody td.weekend{color:#f00;}.calendar tbody td.today{font-weight:bold;color:#00f;}.calendar tbody .disabled{color:#999;}.calendar tbody .emptycell{visibility:hidden;}.calendar tbody .emptyrow{display:none;}.calendar tfoot .ttip{background:#bbb;padding:1px;background:#000;color:#fff;text-align:center;}.calendar tfoot .hilite{background:#ddd;}.calendar tfoot .active{}.calendar .combo{position:absolute;display:none;width:4em;top:0;left:0;cursor:default;background:#e4e0d8;padding:1px;z-index:2001;}.calendar .combo .label,.calendar .combo .label-IEfix{text-align:center;padding:1px;}.calendar .combo .label-IEfix{width:4em;}.calendar .combo .active{background:#c4c0b8;}.calendar .combo .hilite{background:#048;color:#fea;}.calendar td.time{padding:1px 0;text-align:center;background-color:#bbb;}.calendar td.time .hour,.calendar td.time .minute,.calendar td.time .ampm{padding:0 3px 0 4px;font-weight:bold;}.calendar td.time .ampm{text-align:center;}.calendar td.time .colon{padding:0 2px 0 3px;font-weight:bold;}.calendar td.time span.hilite{}.calendar td.time span.active{border-color:#f00;background-color:#000;color:#0f0;}.hour,.minute{font-size:2em;}
#CP_hourcont{z-index:2000;padding:0;position:absolute;border:1px dashed #666;background-color:#eee;display:none;}#CP_minutecont{z-index:2000;background-color:#ddd;padding:1px;position:absolute;width:45px;display:none;}.floatleft{float:left;}.CP_hour{z-index:2000;padding:1px;font-family:Arial,Helvetica,sans-serif;font-size:9px;white-space:nowrap;cursor:pointer;width:35px;}.CP_minute{z-index:2000;padding:1px;font-family:Arial,Helvetica,sans-serif;font-size:9px;white-space:nowrap;cursor:pointer;width:auto;}.CP_over{background-color:#fff;z-index:2000}
+362
View File
@@ -0,0 +1,362 @@
label, th {
font-weigth: bold;
white-space: nowrap;
}
div.w2p_flash {
background-image: none;
border-radius: 4px;
-o-border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
color: #333;
font-weight: 400;
min-width: 28px;
max-width: 300px;
opacity: 1;
vertical-align: baseline;
right: auto;
border-width: 1px;
margin: 0 0 20px;
padding: 15px 35px 15px 15px;
}
.nav-item a {
white-space: nowrap;
}
div.w2p_flash.alert:hover {
opacity: 1;
}
.ie-lte8 div.w2p_flash {
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#222222', endColorstr='#000000', GradientType=0);
}
.ie-lte8 div.w2p_flash:hover {
filter: alpha(opacity=25);
}
.main-container {
margin-top: 20px;
}
div.error {
width: auto;
background: transparent;
border: none;
background-image: none;
color: red;
display: inline-block;
padding: 5px;
}
div.w2p_flash.alert {
display: none;
position: fixed;
top: 70px;
right: 75px;
cursor: pointer;
z-index: 1000;
background-color: #f9edbe;
border-color: #f0c36d;
}
.w2p-toolbar-hidden {
margin: 10px;
}
ul.w2p_list {
margin-left: 0;
padding-left: 0;
}
.w2p_list li {
margin-bottom: 6px;
}
.w2p_list li input {
display: inline-block;
width: 85%;
margin-right: 4px;
}
.w2p_list li a {
margin-bottom: 2px;
}
div[id^=_autocomplete_] {
margin-top: -10px;
z-index: 1;
}
select.autocomplete {
display: block;
font-size: 14px;
line-height: 1.428571429;
color: #555;
vertical-align: middle;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
border-color: #428bca;
padding: 6px 12px;
}
#web2py-logo {
color: #c6cecc;
}
#web2py-logo b {
display: inline-block;
margin-top: -1px;
}
#web2py-logo b>span {
font-size: 22px;
color: #FFF;
}
#web2py-logo:hover {
color: #FFF;
}
.footer > .row {
padding-left: 15px;
padding-right: 15px;
margin-top: 20px;
}
.background {
background: url(../images/background.jpg) no-repeat center center;
}
body {
margin-bottom: 60px;
}
header {
-webkit-box-shadow: 0 0 8px 2px #000;
-moz-box-shadow: 0 0 8px 2px #000;
box-shadow: 0 0 8px 2px #000;
margin-bottom: 10px;
}
html {
position: relative;
min-height: 100%;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
background: #f7f7f7;
}
header h1 {
color: #FFF!important;
text-shadow: 0 0 7px #000;
}
header .jumbotron {
background-color: transparent;
}
.w2p_flash {
opacity: 0.9!important;
right: 100px;
}
.right {
float: right;
text-align: right;
}
.left {
float: left;
text-align: left;
}
.center {
width: 100%;
text-align: center;
vertical-align: middle;
}
td.w2p_fw {
padding-bottom: 1px;
}
td.w2p_fl {
text-align: left;
}
td.w2p_fl,
td.w2p_fw {
padding-right: 7px;
}
td.w2p_fl,
td.w2p_fc {
padding-top: 4px;
}
div.w2p_export_menu {
margin: 5px 0;
}
div.w2p_export_menu a,
div.w2p_wiki_tags a,
div.w2p_cloud a {
margin-left: 5px;
padding: 2px 5px;
}
#submit_record__row td {
padding-top: .5em;
}
div.error_wrapper {
display: block;
}
.copyright {
float: left;
}
#poweredBy {
float: right;
}
.web2py_grid tbody td {
vertical-align: middle;
padding: 2px 5px;
}
.web2py_grid thead th,
.web2py_grid tfoot td {
background-color: #EAEAEA;
padding: 10px 5px;
}
.web2py_grid tr.odd {
background-color: #F9F9F9;
}
.web2py_grid tr:hover {
background-color: #F5F5F5;
}
.web2py_console form {
width: 100%;
display: inline;
vertical-align: middle;
margin: 0 0 0 5px;
}
.web2py_console form select {
margin: 0;
}
.web2py_search_actions {
float: left;
text-align: left;
width: 100%;
}
.web2py_grid .row_buttons {
min-height: 25px;
vertical-align: middle;
}
.web2py_grid .row_buttons a {
margin: 3px;
}
.web2py_grid .row_buttons a,
.web2py_paginator ul li a,
.web2py_search_actions a,
.web2py_console input[type=submit],
.web2py_console input[type=button],
.web2py_console button {
line-height: 20px;
margin-right: 2px;
display: inline-block;
padding: 6px 12px;
}
.web2py_counter {
margin-top: 5px;
margin-right: 2px;
width: 35%;
float: right;
text-align: right;
}
.web2py_table {
clear: both;
display: block;
}
.web2py_paginator {
text-align: right;
background-color: #f2f2f2;
padding: 5px;
}
.web2py_paginator ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.web2py_paginator .current {
font-weight: 700;
}
.web2py_breadcrumbs ul {
list-style: none;
margin-bottom: 18px;
}
li.w2p_grid_breadcrumb_elem {
display: inline-block;
}
.web2py_console input,
.web2py_console select,
.web2py_console a {
margin: 2px;
padding: 6px 12px;
}
#wiki_page_body {
width: 600px;
height: auto;
min-height: 400px;
}
.ie-lte7 .topbar .container {
z-index: 2;
}
.ie9 #w2p_query_panel {
padding-bottom: 2px;
}
.web2py_console .form-control {
width: 20%;
display: inline;
height: 32px;
}
.web2py_console #w2p_keywords {
width: 50%;
}
.web2py_search_actions a,
.web2py_console input[type=submit],
.web2py_console input[type=button],
.web2py_console button {
padding: 6px 12px;
}
td.w2p_fl,
td.w2p_fw,
td.w2p_fc,
#web2py_user_form td,
.web2py_grid .web2py_form td {
vertical-align: top;
}
#auth_user_remember__row label,
.web2py_paginator ul li {
display: inline;
}
.web2py_grid,
.web2py_grid table {
width: 100%;
}
/* form submit block */
#submit_record__row .btn {
margin-bottom: .25rem;
}
@media (min-width: 577px) {
#submit_record__row .btn {
margin-left: .25rem;
}
}
@media (max-width: 576px) {
#submit_record__row .btn {
width: 100%;
margin-left: 0;
}
}
/* for backward compatbility with pre-font-awesome */
.icon.plus,.icon.arrowleft,.icon.download,.icon.trash,.icon.pen,.icon.arrowright,.icon.magnifier {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon.plus:before { content: "\f067";}
.icon.arrowleft:before { content: "\f060";}
.icon.download:before { content: "\f019";}
.icon.trash:before { content: "\f1f8";}
.icon.pen:before { content: "\f040";}
.icon.arrowright:before { content: "\f061";}
.icon.magnifier:before { content: "\f002";}
.web2py_table_selectable_actions {
padding-top: 10px;
float: right;
}
.web2py_table_selectable_actions input {
padding: 5px 7px;
margin-right: 10px;
}
+313
View File
@@ -0,0 +1,313 @@
/** these MUST stay **/
a {text-decoration:none; white-space:nowrap}
a:hover {text-decoration:underline}
a.button {text-decoration:none}
h1,h2,h3,h4,h5,h6 {margin:0.5em 0 0.25em 0; display:block;
font-family:Helvetica}
h1 {font-size:4.00em}
h2 {font-size:3.00em}
h3 {font-size:2.00em}
h4 {font-size:1.50em}
h5 {font-size:1.25em}
h6 {font-size:1.12em}
th,label {font-weight:bold; white-space:nowrap;}
td,th {text-align:left; padding:2px 5px 2px 5px}
th {vertical-align:middle; border-right:1px solid white}
td {vertical-align:top}
form table tr td label {text-align:left}
p,table,ol,ul {padding:0; margin: 0.75em 0}
p {text-align:justify}
ol, ul {list-style-position:outside; margin-left:2em}
li {margin-bottom:0.5em}
span,input,select,textarea,button,label,a {display:inline}
img {border:0}
blockquote,blockquote p,p blockquote {
font-style:italic; margin:0.5em 30px 0.5em 30px; font-size:0.9em}
i,em {font-style:italic}
strong {font-weight:bold}
small {font-size:0.8em}
code {font-family:Courier}
textarea {width:100%}
video {width:400px}
audio {width:200px}
[type="text"], [type="password"], select {
margin-right: 5px; width: 300px;
}
.w2p_hidden {display:none;visibility:visible}
.right {float:right; text-align:right}
.left {float:left; text-align:left}
.center {width:100%; text-align:center; vertical-align:middle}
/** end **/
/* Sticky footer begin */
.main {
padding:20px 0 50px 0;
}
.footer,.push {
height:6em;
padding:1em 0;
clear:both;
}
.footer-content {position:relative; bottom:-4em; width:100%}
.auth_navbar {
white-space:nowrap;
}
/* Sticky footer end */
.footer {
border-top:1px #DEDEDE solid;
}
.header {
/* background:<fill here for header image>; */
}
fieldset {padding:16px; border-top:1px #DEDEDE solid}
fieldset legend {text-transform:uppercase; font-weight:bold; padding:4px 16px 4px 16px; background:#f1f1f1}
/* fix ie problem with menu */
td.w2p_fw {padding-bottom:1px}
td.w2p_fl,td.w2p_fw,td.w2p_fc {vertical-align:top}
td.w2p_fl {text-align:left}
td.w2p_fl, td.w2p_fw {padding-right:7px}
td.w2p_fl,td.w2p_fc {padding-top:4px}
div.w2p_export_menu {margin:5px 0}
div.w2p_export_menu a, div.w2p_wiki_tags a, div.w2p_cloud a {margin-left:5px; padding:2px 5px; background-color:#f1f1f1; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;}
/* tr#submit_record__row {border-top:1px solid #E5E5E5} */
#submit_record__row td {padding-top:.5em}
/* Fix */
#auth_user_remember__row label {display:inline}
#web2py_user_form td {vertical-align:top}
/*********** web2py specific ***********/
div.w2p_flash {
font-weight:bold;
display:none;
position:fixed;
padding:10px;
top:48px;
right:250px;
min-width:280px;
opacity:0.95;
margin:0px 0px 10px 10px;
vertical-align:middle;
cursor:pointer;
color:#fff;
background-color:#000;
border:2px solid #fff;
border-radius:8px;
-o-border-radius: 8px;
-moz-border-radius:8px;
-webkit-border-radius:8px;
background-image: -webkit-linear-gradient(top,#222,#000);
background-image: -o-linear-gradient(top,#222,#000);
background-image: -moz-linear-gradient(90deg, #222, #000);
background-image: linear-gradient(top,#222,#000);
background-repeat: repeat-x;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
z-index:2000;
}
div.w2p_flash #closeflash{color:inherit; float:right; margin-left:15px;}
.ie-lte7 div.flash #closeflash
{color:expression(this.parentNode.currentStyle['color']);float:none;position:absolute;right:4px;}
div.w2p_flash:hover { opacity:0.25; }
div.error_wrapper {display:block}
div.error {
color:red;
padding:5px;
display:inline-block;
}
.topbar {
padding:10px 0;
width:100%;
color:#959595;
vertical-align:middle;
padding:auto;
background-image:-khtml-gradient(linear,left top,left bottom,from(#333333),to(#222222));
background-image:-moz-linear-gradient(top,#333333,#222222);
background-image:-ms-linear-gradient(top,#333333,#222222);
background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#333333),color-stop(100%,#222222));
background-image:-webkit-linear-gradient(top,#333333,#222222);
background-image:-o-linear-gradient(top,#333333,#222222);
background-image:linear-gradient(top,#333333,#222222);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333',endColorstr='#222222',GradientType=0);
-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.25),inset 0 -1px 0 rgba(0,0,0,0.1);
-moz-box-shadow:0 1px 3px rgba(0,0,0,0.25),inset 0 -1px 0 rgba(0,0,0,0.1);
box-shadow:0 1px 3px rgba(0,0,0,0.25),inset 0 -1px 0 rgba(0,0,0,0.1);
}
.topbar a {
color:#e1e1e1;
}
#navbar {float:right; padding:5px; /* same as superfish */}
.statusbar {
background-color:#F5F5F5;
margin-top:1em;
margin-bottom:1em;
padding:.5em 1em;
border:1px solid #ddd;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
}
.breadcrumbs {float:left}
.copyright {float:left}
#poweredBy {float:right}
/* #MEDIA QUERIES SECTION */
/*
*Grid
*
* The default style for SQLFORM.grid even using jquery-iu or another ui framework
* will look better with the declarations below
* if needed to remove base.css consider keeping these following lines in some css file.
*/
/* .web2py_table {border:1px solid #ccc} */
.web2py_paginator {}
.web2py_grid {width:100%}
.web2py_grid table {width:100%}
.web2py_grid tbody td {padding:2px 5px 2px 5px; vertical-align: middle;}
.web2py_grid .web2py_form td {vertical-align: top;}
.web2py_grid thead th,.web2py_grid tfoot td {
background-color:#EAEAEA;
padding:10px 5px 10px 5px;
}
.web2py_grid tr.odd {background-color:#F9F9F9}
.web2py_grid tr:hover {background-color:#F5F5F5}
/*
.web2py_breadcrumbs a {
line-height:20px; margin-right:5px; display:inline-block;
padding:3px 5px 3px 5px;
font-family:'lucida grande',tahoma,verdana,arial,sans-serif;
color:#3C3C3D;
text-shadow:1px 1px 0 #FFFFFF;
white-space:nowrap; overflow:visible; cursor:pointer;
background:#ECECEC;
border:1px solid #CACACA;
-webkit-border-radius:2px; -moz-border-radius:2px;
-webkit-background-clip:padding-box; border-radius:2px;
outline:none; position:relative; zoom:1; *display:inline;
}
*/
.web2py_console form {
width: 100%;
display: inline;
vertical-align: middle;
margin: 0 0 0 5px;
}
.web2py_console form select {
margin:0;
}
.web2py_search_actions {
float:left;
text-align:left;
}
.web2py_grid .row_buttons {
min-height:25px;
vertical-align:middle;
}
.web2py_grid .row_buttons a {
margin:3px;
}
.web2py_search_actions {
width:100%;
}
.web2py_grid .row_buttons a,
.web2py_paginator ul li a,
.web2py_search_actions a,
.web2py_console input[type=submit],
.web2py_console input[type=button],
.web2py_console button {
line-height:20px;
margin-right:2px; display:inline-block;
padding:3px 5px 3px 5px;
}
.web2py_counter {
margin-top:5px;
margin-right:2px;
width:35%;
float:right;
text-align:right;
}
/*Fix firefox problem*/
.web2py_table {clear:both; display:block}
.web2py_paginator {
padding:5px;
text-align:right;
background-color:#f2f2f2;
}
.web2py_paginator ul {
list-style-type:none;
margin:0px;
padding:0px;
}
.web2py_paginator ul li {
display:inline;
}
.web2py_paginator .current {
font-weight:bold;
}
.web2py_breadcrumbs ul {
list-style:none;
margin-bottom:18px;
}
li.w2p_grid_breadcrumb_elem {
display:inline-block;
}
.web2py_console form { vertical-align: middle; }
.web2py_console input, .web2py_console select,
.web2py_console a { margin: 2px; }
#wiki_page_body {
width: 600px;
height: auto;
min-height: 400px;
}
/* fix some IE problems */
.ie-lte7 .topbar .container {z-index:2}
.ie-lte8 div.w2p_flash{ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#222222', endColorstr='#000000', GradientType=0 ); }
.ie-lte8 div.w2p_flash:hover {filter:alpha(opacity=25);}
.ie9 #w2p_query_panel {padding-bottom:2px}
.web2py_console .form-control {width: 20%; display: inline;}
.web2py_console #w2p_keywords {width: 50%;}
.web2py_search_actions a, .web2py_console input[type=submit], .web2py_console input[type=button], .web2py_console button { padding: 6px 12px; }
Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+8
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+82
View File
@@ -0,0 +1,82 @@
(function($, undefined) {
$.web2py.ajax_fields = function(target) {
/*
*this attaches something to a newly loaded fragment/page
* Ideally all events should be bound to the document, so we can avoid calling
* this over and over... all will be bound to the document
*/
/*adds btn class to buttons*/
$('button:not([class^="btn"])', target).addClass('btn btn-default');
$("p.w2p-autocomplete-widget input").addClass('form-control');
$('form input[type="submit"]:not([class^="btn"]), form input[type="button"]:not([class^="btn"])', target).addClass('btn btn-default');
/* javascript for PasswordWidget*/
$('input[type=password][data-w2p_entropy]', target).each(function() {
$.web2py.validate_entropy($(this));
});
/* javascript for ListWidget*/
$('ul.w2p_list', target).each(function() {
function pe(ul, e) {
var new_line = ml(ul);
rel(ul);
if ($(e.target).closest('li').is(':visible')) {
/* make sure we didn't delete the element before we insert after */
new_line.insertAfter($(e.target).closest('li'));
} else {
/* the line we clicked on was deleted, just add to end of list */
new_line.appendTo(ul);
}
new_line.find(":text").focus();
return false;
}
function rl(ul, e) {
if ($(ul).find('li').length > 1) {
/* only remove if we have more than 1 item so the list is never empty */
$(e.target).closest('li').remove();
}
}
function ml(ul) {
/* clone the first field */
var line = $(ul).find("li:first").clone(true);
line.find(':text').val('');
return line;
}
function rel(ul) {
/* keep only as many as needed*/
$(ul).find("li").each(function() {
var trimmed = $.trim($(this).find(":text").val());
if (trimmed == '') $(this).remove();
else $(this).find(":text").val(trimmed);
});
}
var ul = this;
$(ul).find(":text").addClass('form-control').wrap("<div class='input-group'></div>").after('<div class="input-group-append"><i class="fa fa-plus-circle"></i></div>&nbsp;<div class="input-group-append"><i class="fa fa-minus-circle"></i></div>').keypress(function(e) {
return (e.which == 13) ? pe(ul, e) : true;
}).next().click(function(e) {
pe(ul, e);
e.preventDefault();
}).next().click(function(e) {
rl(ul, e);
e.preventDefault();
});
});
}
$(function() {
$(".nav ul.dropdown-menu").each(function() {
var toggle = jQuery(this).parent();
if (toggle.parent().hasClass("nav")) {
toggle.attr("data-w2pmenulevel", "l0");
toggle.children("a")
.addClass("dropdown-toggle")
.append('<span class="caret"> </span>')
.attr("data-toggle", "dropdown");
} else {
toggle.addClass("dropdown-submenu").removeClass("dropdown");
};
});
});
})(jQuery);
+850
View File
@@ -0,0 +1,850 @@
(function ($, undefined) {
/*
* Unobtrusive scripting adapter for jQuery, largely taken from
* the wonderful https://github.com/rails/jquery-ujs
*
*
* Released under the MIT license
*
*/
'use strict';
if ($.web2py !== undefined) {
$.error('web2py.js has already been loaded!');
}
var FORMDATA_IS_SUPPORTED = typeof(FormData) !== 'undefined';
var animateIn = 'fadeIn';
// var animateIn = 'slideDown';
String.prototype.reverse = function () {
return this.split('').reverse().join('');
};
var web2py;
$.web2py = web2py = {
isUndefined: function (obj) {
/* grabbed from underscore.js */
return obj === void 0;
},
popup: function (url) {
/* popup a window */
var newwindow = window.open(url, 'name', 'height=400,width=600');
if (window.focus) newwindow.focus();
return false;
},
collapse: function (id) {
/* toggle an element */
$('#' + id).slideToggle();
},
fade: function (id, value) {
/*fade something*/
if (value > 0) $('#' + id).hide().fadeIn('slow');
else $('#' + id).show().fadeOut('slow');
},
ajax: function (u, s, t, options) {
/*simple ajax function*/
// set options default value
options = typeof options !== 'undefined' ? options : {};
var query = '';
if (typeof s == 'string') {
var d = $(s).serialize();
if (d) {
query = d;
}
} else {
var pcs = [];
if (s !== null && !web2py.isUndefined(s))
for (var i = 0; i < s.length; i++) {
var q = $('[name=' + s[i] + ']').serialize();
if (q) {
pcs.push(q);
}
}
if (pcs.length > 0) {
query = pcs.join('&');
}
}
// default success action
var success_function = function (msg) {
if (t) {
if (t == ':eval') eval(msg);
else if (typeof t == 'string') $('#' + t).html(msg);
else t(msg);
}
};
// declare success actions as array
var success = [success_function];
// add user success actions
if ($.isArray(options.done)){
success = $.merge(success, options.done);
} else {
success.push(options.done);
}
// default jquery ajax options
var ajax_options = {
type: 'POST',
url: u,
data: query,
success: success
};
//remove custom "done" option if exists
delete options.done;
// merge default ajax options with user custom options
for (var attrname in options) {
ajax_options[attrname] = options[attrname];
}
// call ajax function
$.ajax(ajax_options);
},
ajax_fields: function (target) {
/*
*this attaches something to a newly loaded fragment/page
* Ideally all events should be bound to the document, so we can avoid calling
* this over and over... all will be bound to the document
*/
/*adds btn class to buttons*/
$('button:not([class^="btn"])', target).addClass('btn');
$(
'form input[type="submit"]:not([class^="btn"]), form input[type="button"]:not([class^="btn"])',
target).addClass('btn');
/* javascript for PasswordWidget*/
$('input[type=password][data-w2p_entropy]', target).each(function () {
web2py.validate_entropy($(this));
});
/* javascript for ListWidget*/
$('ul.w2p_list', target).each(function () {
function pe(ul, e) {
var new_line = ml(ul);
rel(ul);
if ($(e.target).parent().is(':visible')) {
/* make sure we didn't delete the element before we insert after */
new_line.insertAfter($(e.target).parent());
} else {
/* the line we clicked on was deleted, just add to end of list */
new_line.appendTo(ul);
}
new_line.find(':text').focus();
return false;
}
function rl(ul, e) {
if ($(ul).children().length > 1) {
/* only remove if we have more than 1 item so the list is never empty */
$(e.target).parent().remove();
}
}
function ml(ul) {
/* clone the first field */
var line = $(ul).find('li:first').clone(true);
line.find(':text').val('');
return line;
}
function rel(ul) {
/* keep only as many as needed*/
$(ul).find('li').each(function () {
var trimmed = $.trim($(this.firstChild).val());
if (trimmed === '') $(this).remove();
else $(this.firstChild).val(trimmed);
});
}
var ul = this;
$(ul).find(':text').after('<a href="#">+</a>&nbsp;<a href="#">-</a>').keypress(
function (e) {
return (e.which == 13) ? pe(ul, e) : true;
}).next().click(function (e) {
pe(ul, e);
e.preventDefault();
}).next().click(function (e) {
rl(ul, e);
e.preventDefault();
});
});
},
ajax_init: function (target) {
/*called whenever a fragment gets loaded */
$('.w2p_hidden', target).hide();
web2py.manage_errors(target);
web2py.ajax_fields(target);
web2py.show_if_handler(target);
web2py.component_handler(target);
},
/* manage errors in forms */
manage_errors: function (target) {
$('div.error', target).hide()[animateIn]('slow');
},
after_ajax: function (xhr) {
/* called whenever an ajax request completes */
var command = xhr.getResponseHeader('web2py-component-command');
var flash = xhr.getResponseHeader('web2py-component-flash');
if (command !== null) {
eval(decodeURIComponent(command));
}
if (flash) {
web2py.flash(decodeURIComponent(flash));
}
},
event_handlers: function () {
/*
* This is called once for page
* Ideally it should bound all the things that are needed
* and require no dom manipulations
*/
var doc = $(document);
doc.on('click', '.w2p_flash', function (event) {
event.preventDefault();
var t = $(this);
if (t.css('top') == '0px') t.slideUp('slow');
else t.fadeOut();
});
doc.on('keyup', 'input.integer', function () {
var nvalue = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse();
if (this.value != nvalue) this.value = nvalue;
});
doc.on('keyup', 'input.double, input.decimal', function () {
var nvalue = this.value.reverse().replace(
/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse();
if (this.value != nvalue) this.value = nvalue;
});
var confirm_message = !web2py.isUndefined(w2p_ajax_confirm_message) ? w2p_ajax_confirm_message :
'Are you sure you want to delete this object?';
doc.on('click', 'input[type="checkbox"].delete', function () {
if (this.checked)
if (!web2py.confirm(confirm_message)) this.checked = false;
});
var datetime_format = !web2py.isUndefined(w2p_ajax_datetime_format) ? w2p_ajax_datetime_format :
'%Y-%m-%d %H:%M:%S';
doc.on('click', 'input.datetime', function () {
var tformat = $(this).data('w2p_datetime_format');
var active = $(this).data('w2p_datetime');
var format = !web2py.isUndefined(tformat) ? tformat : datetime_format;
if (active === undefined) {
Calendar.setup({
inputField: this,
ifFormat: format,
showsTime: true,
timeFormat: '24'
});
$(this).attr('autocomplete', 'off');
$(this).data('w2p_datetime', 1);
$(this).trigger('click');
}
});
var date_format = !web2py.isUndefined(w2p_ajax_date_format) ? w2p_ajax_date_format : '%Y-%m-%d';
doc.on('click', 'input.date', function () {
var tformat = $(this).data('w2p_date_format');
var active = $(this).data('w2p_date');
var format = !web2py.isUndefined(tformat) ? tformat : date_format;
if (active === undefined) {
Calendar.setup({
inputField: this,
ifFormat: format,
showsTime: false
});
$(this).data('w2p_date', 1);
$(this).attr('autocomplete', 'off');
$(this).trigger('click');
}
});
doc.on('focus', 'input.time', function () {
var active = $(this).data('w2p_time');
if (web2py.isUndefined(active)) {
$(this).timeEntry({
spinnerImage: ''
}).attr('autocomplete', 'off');
$(this).data('w2p_time', 1);
}
});
/* help preventing double form submission for normal form (not LOADed) */
$(doc).on('submit', 'form', function (e) {
var submit_buttons = $(this).find(web2py.formInputClickSelector);
submit_buttons.each(function() {
web2py.disableElement($(this));
})
/* safeguard in case the form doesn't trigger a refresh,
see https://github.com/web2py/web2py/issues/1100 */
setTimeout(function () {
submit_buttons.each(function() {
web2py.enableElement($(this));
});
}, 5000);
});
doc.ajaxSuccess(function (e, xhr) {
var redirect = xhr.getResponseHeader('web2py-redirect-location');
if (redirect !== null) {
if (!redirect.endsWith('#')) {
window.location.href = redirect;
} else {
window.location.reload();
}
}
/* run this here only if this Ajax request is NOT for a web2py component. */
if (xhr.getResponseHeader('web2py-component-content') === null) {
web2py.after_ajax(xhr);
}
});
doc.ajaxError(function (e, xhr, settings, exception) {
/*personally I don't like it.
*if there's an error it it flashed and can be removed
*as any other message
*doc.off('click', '.w2p_flash')
*/
switch (xhr.status) {
case 500:
web2py.flash(ajax_error_500);
}
});
},
trap_form: function (action, target) {
/* traps any LOADed form */
$('#' + target + ' form').each(function () {
var form = $(this);
if (form.hasClass('no_trap')) {
return;
}
var w2p_target = $(this).attr('data-w2p_target');
if (web2py.isUndefined(w2p_target) || w2p_target === false) {
form.attr('data-w2p_target', target);
} else {
target = w2p_target;
}
var url = form.attr('action');
if ((url === '') || (url === '#') || web2py.isUndefined(url)) {
/* form has no action. Use component url. */
url = action;
}
form.submit(function (e) {
web2py.disableElement(form.find(web2py.formInputClickSelector));
web2py.hide_flash();
var formData;
if (FORMDATA_IS_SUPPORTED) {
formData = new FormData(form[0]); // Allows file uploads.
} else {
formData = form.serialize(); // Fallback for older browsers.
}
web2py.ajax_page('post', url, formData, target);
e.preventDefault();
});
form.on('click', web2py.formInputClickSelector, function (e) {
e.preventDefault();
var input_name = $(this).attr('name');
if (!web2py.isUndefined(input_name)) {
$('<input type="hidden" />').attr('name', input_name)
.attr('value', $(this).val()).appendTo(form);
}
form.trigger('submit');
});
});
},
ajax_page: function (method, action, data, target, element) {
/* element is a new parameter, but should be put be put in front */
if (web2py.isUndefined(element)) element = $(document);
/* if target is not there, fill it with something that there isn't in the page*/
if (web2py.isUndefined(target) || target === '') target = 'w2p_none';
/* processData and contentType must be set to false when passing a FormData
object to jQuery.ajax. */
var isFormData = Object.prototype.toString.call(data) === '[object FormData]';
var contentType = isFormData ? false : 'application/x-www-form-urlencoded; charset=UTF-8';
if (web2py.fire(element, 'ajax:before', null, target)) { /*test a usecase, should stop here if returns false */
$.ajax({
'type': method,
'url': action,
'data': data,
'processData': !isFormData,
'contentType': contentType,
'xhr': function() {
var xhr = new window.XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt) {
if (evt.lengthComputable) {
var percentComplete = evt.loaded / evt.total;
percentComplete = parseInt(percentComplete * 100);
web2py.fire(element, 'w2p:uploadProgress', [percentComplete], target);
if (percentComplete === 100) {
web2py.fire(element, 'w2p:uploadComplete', [], target);
}
}
}, false);
return xhr;
},
'beforeSend': function (xhr, settings) {
xhr.setRequestHeader('web2py-component-location', document.location);
xhr.setRequestHeader('web2py-component-element', target);
web2py.fire(element, 'w2p:componentBegin', [xhr, settings], target);
return web2py.fire(element, 'ajax:beforeSend', [xhr, settings], target); //test a usecase, should stop here if returns false
},
'success': function (data, status, xhr) {
/*bummer for form submissions....the element is not there after complete
*because it gets replaced by the new response....
*/
web2py.fire(element, 'ajax:success', [data, status, xhr], target);
},
'error': function (xhr, status, error) {
/*bummer for form submissions....in addition to the element being not there after
*complete because it gets replaced by the new response, standard form
*handling just returns the same status code for good and bad
*form submissions (i.e. that triggered a validator error)
*/
web2py.fire(element, 'ajax:error', [xhr, status, error], target);
},
'complete': function (xhr, status) {
web2py.fire(element, 'ajax:complete', [xhr, status], target);
web2py.updatePage(xhr, target); /* Parse and load the html received */
web2py.trap_form(action, target);
web2py.ajax_init('#' + target);
web2py.after_ajax(xhr);
web2py.fire(element, 'w2p:componentComplete', [xhr, status], target); // Let us know the component is finished loading
}
});
}
},
component: function (action, target, timeout, times, el) {
/* element is a new parameter, but should be put in front */
$(function () {
var jelement = $('#' + target);
var element = jelement.get(0);
var statement = 'jQuery("#' + target + '").get(0).reload();';
element.reload = function () {
/* Continue if times is Infinity or
* the times limit is not reached
*/
if (element.reload_check()) {
web2py.ajax_page('get', action, null, target, el);
}
};
/* Method to check timing limit */
element.reload_check = function () {
if (jelement.hasClass('w2p_component_stop')) {
clearInterval(this.timing);
return false;
}
if (this.reload_counter == Infinity) {
return true;
} else {
if (!isNaN(this.reload_counter)) {
this.reload_counter -= 1;
if (this.reload_counter < 0) {
if (!this.run_once) {
clearInterval(this.timing);
return false;
}
} else {
return true;
}
}
}
return false;
};
if (!isNaN(timeout)) {
element.timeout = timeout;
element.reload_counter = times;
if (times > 1) {
/* Multiple or infinite reload
* Run first iteration
*/
web2py.ajax_page('get', action, null, target, el);
element.run_once = false;
element.timing = setInterval(statement, timeout);
element.reload_counter -= 1;
} else if (times == 1) {
/* Run once with timeout */
element.run_once = true;
element.setTimeout = setTimeout;
element.timing = setTimeout(statement, timeout);
}
} else {
/* run once (no timeout specified) */
element.reload_counter = Infinity;
web2py.ajax_page('get', action, null, target, el);
}
});
},
updatePage: function (xhr, target) {
var t = $('#' + target);
var html = $.parseHTML(xhr.responseText, document, true);
var title_elements = $(html).filter('title').add($(html).find('title'));
var title = title_elements.last().text();
if (title) {
title_elements.remove(); /* Remove any title elements from the response */
document.title = $.trim(title); /* Set the new document title */
}
var content = xhr.getResponseHeader('web2py-component-content');
if (content == 'prepend') t.prepend(xhr.responseText);
else if (content == 'append') t.append(xhr.responseText);
else if (content != 'hide') t.html(html);
},
calc_entropy: function (mystring) {
/* calculate a simple entropy for a given string */
var csets = new Array(
'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'0123456789', '!@#$\%^&*()', '~`-_=+[]{}\|;:\'",.<>?/',
'0123456789abcdefghijklmnopqrstuvwxyz');
var score = 0,
other = {},
seen = {},
lastset = null,
mystringlist = mystring.split('');
for (var i = 0; i < mystringlist.length; i++) { /* classify this character */
var c = mystringlist[i],
inset = 5;
for (var j = 0; j < csets.length; j++)
if (csets[j].indexOf(c) != -1) {
inset = j;
break;
}
/*calculate effect of character on alphabet size */
if (!(inset in seen)) {
seen[inset] = 1;
score += csets[inset].length;
} else if (!(c in other)) {
score += 1;
other[c] = 1;
}
if (inset != lastset) {
score += 1;
lastset = inset;
}
}
var entropy = mystring.length * Math.log(score) / 0.6931471805599453;
return Math.round(entropy * 100) / 100;
},
validate_entropy: function (myfield, req_entropy) {
if (!web2py.isUndefined(myfield.data('w2p_entropy'))) req_entropy = myfield.data('w2p_entropy');
var validator = function () {
var v = (web2py.calc_entropy(myfield.val()) || 0) / req_entropy;
var r = 0,
g = 0,
b = 0,
rs = function (x) {
return Math.round(x * 15).toString(16);
};
if (v <= 0.5) {
r = 1.0;
g = 2.0 * v;
} else {
r = (1.0 - 2.0 * (Math.max(v, 0) - 0.5));
g = 1.0;
}
var color = '#' + rs(r) + rs(g) + rs(b);
myfield.css('background-color', color);
var entropy_callback = myfield.data('entropy_callback');
if (entropy_callback) entropy_callback(v);
};
if (!myfield.hasClass('entropy_check')) myfield.on('keyup', validator).on('keydown', validator)
.addClass('entropy_check');
},
web2py_websocket: function (url, onmessage, onopen, onclose) {
if ('WebSocket' in window) {
var ws = new WebSocket(url);
ws.onopen = onopen ? onopen : (function () {});
ws.onmessage = onmessage;
ws.onclose = onclose ? onclose : (function () {});
return true; /* supported */
} else return false; /* not supported */
},
/* new from here */
/* Form input elements bound by web2py.js */
formInputClickSelector: 'input[type=submit], input[type=image], button[type=submit], button:not([type])',
/* Form input elements disabled during form submission */
disableSelector: 'input, button, textarea, select',
/* Form input elements re-enabled after form submission */
enableSelector: 'input:disabled, button:disabled, textarea:disabled, select:disabled',
/* Triggers an event on an element and returns false if the event result is false */
fire: function (obj, type, data, target) {
var event = $.Event(type, {
'containerTarget': $('#' + target)[0]
});
obj.trigger(event, data);
return event.result !== false;
},
/* Helper function, needed to provide consistent behavior in IE */
stopEverything: function (e) {
$(e.target).trigger('w2p:everythingStopped');
e.stopImmediatePropagation();
return false;
},
confirm: function (message) {
return confirm(message);
},
/* replace element's html with the 'data-disable-with' after storing original html
* and prevent clicking on it */
disableElement: function (el) {
if (!web2py.isUndefined(el.data('w2p_disable'))) {
return false;
}
el.addClass('disabled');
var method = el.is('input') ? 'val' : 'html';
//method = el.attr('name') ? 'html' : 'val';
var disable_with_message = (!web2py.isUndefined(w2p_ajax_disable_with_message)) ?
w2p_ajax_disable_with_message : 'Working...';
/*store enabled state if not already disabled */
if (web2py.isUndefined(el.data('w2p_enable_with'))) {
el.data('w2p_enable_with', el[method]());
}
/*if you don't want to see "working..." on buttons, replace the following
* two lines with this one
* el.data('w2p_disable_with', el[method]());
*/
if ((el.data('w2p_disable_with') == 'default') || (web2py.isUndefined(el.data(
'w2p_disable_with')))) {
el.data('w2p_disable_with', disable_with_message);
}
/* set to disabled state*/
el[method](el.data('w2p_disable_with'));
el.bind('click.w2pDisable', function (e) { /* prevent further clicking*/
return web2py.stopEverything(e);
});
},
/* restore element to its original state which was disabled by 'disableElement' above*/
enableElement: function (el) {
var method = el.is('input') ? 'val' : 'html';
if (!web2py.isUndefined(el.data('w2p_enable_with'))) {
/* set to old enabled state */
el[method](el.data('w2p_enable_with'));
el.removeData('w2p_enable_with');
}
el.removeClass('disabled');
el.unbind('click.w2pDisable');
},
/*convenience wrapper, internal use only */
simple_component: function (action, target, element) {
web2py.component(action, target, 0, 1, element);
},
/*helper for flash messages*/
flash: function (message, status) {
var flash = $('.w2p_flash');
web2py.hide_flash();
flash.text(message).addClass(status);
if (flash.html()) flash.append('<span id="closeflash"> &times; </span>')[animateIn]();
},
hide_flash: function () {
$('.w2p_flash').fadeOut(0).html('');
},
show_if_handler: function (target) {
var triggers = {};
var show_if = function () {
var t = $(this);
var id = t.attr('id');
t.attr('value', t.val());
for (var k = 0; k < triggers[id].length; k++) {
var dep = $('#' + triggers[id][k], target);
var tr = $('#' + triggers[id][k] + '__row', target);
if (t.is(dep.attr('data-show-if'))) tr[animateIn]();
else tr.hide();
}
};
$('[data-show-trigger]', target).each(function () {
var name = $(this).attr('data-show-trigger');
// The field exists only when creating/editing a row
if ($('#' + name).length) {
if (!triggers[name]) triggers[name] = [];
triggers[name].push($(this).attr('id'));
}
});
for (var name in triggers) {
$('#' + name, target).change(show_if).keyup(show_if);
show_if.call($('#' + name, target));
}
},
component_handler: function (target) {
$('div[data-w2p_remote]', target).each(function () {
var remote, times, timeout, target;
var el = $(this);
remote = el.data('w2p_remote');
times = el.data('w2p_times');
timeout = el.data('w2p_timeout');
target = el.attr('id');
web2py.component(remote, target, timeout, times, $(this));
});
},
a_handler: function (el, e) {
e.preventDefault();
var method = el.data('w2p_method');
var action = el.attr('href');
var target = el.data('w2p_target');
var confirm_message = el.data('w2p_confirm');
var pre_call = el.data('w2p_pre_call');
if (!web2py.isUndefined(pre_call)) {
eval(pre_call);
}
if (confirm_message) {
if (confirm_message == 'default') {
confirm_message = !web2py.isUndefined(w2p_ajax_confirm_message) ?
w2p_ajax_confirm_message : 'Are you sure you want to delete this object?';
}
if (!web2py.confirm(confirm_message)) {
web2py.stopEverything(e);
return;
}
}
if (web2py.isUndefined(target)) {
if (method == 'GET') {
web2py.ajax_page('get', action, [], '', el);
} else if (method == 'POST') {
web2py.ajax_page('post', action, [], '', el);
}
} else {
if (method == 'GET') {
web2py.ajax_page('get', action, [], target, el);
} else if (method == 'POST') {
web2py.ajax_page('post', action, [], target, el);
}
}
},
a_handlers: function () {
var el = $(document);
el.on('click', 'a[data-w2p_method]', function (e) {
web2py.a_handler($(this), e);
});
/* removal of element should happen only on success */
el.on('ajax:success', 'a[data-w2p_method][data-w2p_remove]', function () {
var el = $(this);
var toremove = el.data('w2p_remove');
if (!web2py.isUndefined(toremove)) {
toremove = el.closest(toremove);
if (!toremove.length) {
/*this enables removal of whatever selector if a closest is not found */
toremove = $(toremove);
}
toremove.remove();
}
});
el.on('ajax:beforeSend', 'a[data-w2p_method][data-w2p_disable_with]', function () {
web2py.disableElement($(this));
});
/*re-enable click on completion*/
el.on('ajax:complete', 'a[data-w2p_method][data-w2p_disable_with]', function () {
web2py.enableElement($(this));
});
},
/* Disables form elements:
- Does not disable elements with 'data-w2p_disable' attribute
- Caches element value in 'w2p_enable_with' data store
- Replaces element text with value of 'data-w2p_disable_with' attribute
- Sets disabled property to true
*/
disableFormElements: function (form) {
form.find(web2py.disableSelector).each(function () {
var element = $(this),
method = element.is('button') ? 'html' : 'val';
var disable_with = element.data('w2p_disable_with');
var disable = element.data('w2p_disable');
if (!web2py.isUndefined(disable)) {
return false;
}
if (!element.is(':file')) { // Altering file input values is not allowed.
if (web2py.isUndefined(disable_with)) {
element.data('w2p_disable_with', element[method]());
}
if (web2py.isUndefined(element.data('w2p_enable_with'))) {
element.data('w2p_enable_with', element[method]());
}
element[method](element.data('w2p_disable_with'));
}
element.prop('disabled', true);
});
},
/* Re-enables disabled form elements:
- Replaces element text with cached value from 'w2p_enable_with' data store (created in `disableFormElements`)
- Sets disabled property to false
*/
enableFormElements: function (form) {
form.find(web2py.enableSelector).each(function () {
var element = $(this),
method = element.is('button') ? 'html' : 'val';
if (element.data('w2p_enable_with')) {
element[method](element.data('w2p_enable_with'));
element.removeData('w2p_enable_with');
}
element.prop('disabled', false);
});
},
form_handlers: function () {
var el = $(document);
el.on('ajax:beforeSend', 'form[data-w2p_target]', function () {
web2py.disableFormElements($(this));
});
el.on('ajax:complete', 'form[data-w2p_target]', function () {
web2py.enableFormElements($(this));
});
},
/* Invalidate and force reload of a web2py component
*/
invalidate: function (target) {
$('div[data-w2p_remote]', target).each(function () {
var el = $('#' + $(this).attr('id')).get(0);
if (!web2py.isUndefined(el.timing)) { // Block triggering regular routines
clearInterval(el.timing);
}
});
$.web2py.component_handler(target);
},
main_hook: function () {
var flash = $('.w2p_flash');
flash.hide();
if (flash.html()) web2py.flash(flash.html());
web2py.ajax_init(document);
web2py.event_handlers();
web2py.a_handlers();
web2py.form_handlers();
}
};
/*end of functions */
/*main hook*/
$(function () {
web2py.main_hook();
});
})(jQuery);
/* compatibility code - start */
ajax = jQuery.web2py.ajax;
web2py_component = jQuery.web2py.component;
web2py_websocket = jQuery.web2py.web2py_websocket;
web2py_ajax_page = jQuery.web2py.ajax_page;
/*needed for IS_STRONG(entropy)*/
web2py_validate_entropy = jQuery.web2py.validate_entropy;
/*needed for crud.search and SQLFORM.grid's search*/
web2py_ajax_fields = jQuery.web2py.ajax_fields;
/*used for LOAD(ajax=False)*/
web2py_trap_form = jQuery.web2py.trap_form;
/*undocumented - rare*/
popup = jQuery.web2py.popup;
collapse = jQuery.web2py.collapse;
fade = jQuery.web2py.fade;
/* internals - shouldn't be needed
web2py_ajax_init = jQuery.web2py.ajax_init;
web2py_event_handlers = jQuery.web2py.event_handlers;
web2py_trap_link = jQuery.web2py.trap_link;
web2py_calc_entropy = jQuery.web2py.calc_entropy;
*/
/* compatibility code - end*/