init
61
config/dns.yml
Executable file
|
@ -0,0 +1,61 @@
|
|||
dns:
|
||||
types:
|
||||
- "A"
|
||||
- "AAAA"
|
||||
- "CNAME"
|
||||
- "MX"
|
||||
- "NS"
|
||||
- "PTR"
|
||||
- "SOA"
|
||||
- "TXT"
|
||||
servers:
|
||||
# orange:
|
||||
# title: "Orange"
|
||||
# logo: "orange-logo.jpg"
|
||||
# servers:
|
||||
# - "80.10.246.2"
|
||||
# - "80.10.246.129"
|
||||
bbox:
|
||||
title: "Bouygues BBOX"
|
||||
logo: "bouygues-logo.png"
|
||||
servers:
|
||||
- "194.158.122.10"
|
||||
- "194.158.122.15"
|
||||
free:
|
||||
title: "Free"
|
||||
logo: "free-logo.jpg"
|
||||
servers:
|
||||
- "212.27.53.252"
|
||||
- "212.27.54.252"
|
||||
numericable:
|
||||
title: "Numericable"
|
||||
logo: "numericable-logo.png"
|
||||
servers:
|
||||
- "212.76.224.172"
|
||||
- "82.216.111.122"
|
||||
- "82.216.111.121"
|
||||
- "82.216.111.123"
|
||||
darty_box:
|
||||
title: "Darty box"
|
||||
logo: "dartybox-logo.jpg"
|
||||
servers:
|
||||
- "212.99.2.8"
|
||||
- "195.167.224.150"
|
||||
google:
|
||||
title: "Google"
|
||||
logo: "google-logo.png"
|
||||
servers:
|
||||
- "8.8.8.8"
|
||||
- "8.8.4.4"
|
||||
opendns:
|
||||
title: "OpenDns"
|
||||
logo: "open-dns-logo.png"
|
||||
servers:
|
||||
- "208.67.222.222"
|
||||
- "208.67.220.220"
|
||||
# ovh:
|
||||
# title: "OVH"
|
||||
# logo: "ovh-logo.png"
|
||||
# servers:
|
||||
# - "213.186.33.102"
|
||||
# - "213.251.128.136"
|
BIN
css/.main.css.swp
Normal file
4647
css/bootstrap.css
vendored
Executable file
705
css/bootstrap.min.css
vendored
Executable file
|
@ -0,0 +1,705 @@
|
|||
/*!
|
||||
* Bootstrap v2.0.2
|
||||
*
|
||||
* Copyright 2012 Twitter, Inc
|
||||
* Licensed under the Apache License v2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Designed and built with all the love in the world @twitter by @mdo and @fat.
|
||||
*/
|
||||
.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";}
|
||||
.clearfix:after{clear:both;}
|
||||
.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap;}
|
||||
.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}
|
||||
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}
|
||||
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
|
||||
audio:not([controls]){display:none;}
|
||||
html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
|
||||
a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
|
||||
a:hover,a:active{outline:0;}
|
||||
sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;}
|
||||
sup{top:-0.5em;}
|
||||
sub{bottom:-0.25em;}
|
||||
img{height:auto;border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;}
|
||||
button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;}
|
||||
button,input{*overflow:visible;line-height:normal;}
|
||||
button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;}
|
||||
button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
|
||||
input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;}
|
||||
input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;}
|
||||
textarea{overflow:auto;vertical-align:top;}
|
||||
body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:#333333;background-color:#ffffff;}
|
||||
a{color:#0088cc;text-decoration:none;}
|
||||
a:hover{color:#005580;text-decoration:underline;}
|
||||
.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";}
|
||||
.row:after{clear:both;}
|
||||
[class*="span"]{float:left;margin-left:20px;}
|
||||
.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;}
|
||||
.span12{width:940px;}
|
||||
.span11{width:860px;}
|
||||
.span10{width:780px;}
|
||||
.span9{width:700px;}
|
||||
.span8{width:620px;}
|
||||
.span7{width:540px;}
|
||||
.span6{width:460px;}
|
||||
.span5{width:380px;}
|
||||
.span4{width:300px;}
|
||||
.span3{width:220px;}
|
||||
.span2{width:140px;}
|
||||
.span1{width:60px;}
|
||||
.offset12{margin-left:980px;}
|
||||
.offset11{margin-left:900px;}
|
||||
.offset10{margin-left:820px;}
|
||||
.offset9{margin-left:740px;}
|
||||
.offset8{margin-left:660px;}
|
||||
.offset7{margin-left:580px;}
|
||||
.offset6{margin-left:500px;}
|
||||
.offset5{margin-left:420px;}
|
||||
.offset4{margin-left:340px;}
|
||||
.offset3{margin-left:260px;}
|
||||
.offset2{margin-left:180px;}
|
||||
.offset1{margin-left:100px;}
|
||||
.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";}
|
||||
.row-fluid:after{clear:both;}
|
||||
.row-fluid>[class*="span"]{float:left;margin-left:2.127659574%;}
|
||||
.row-fluid>[class*="span"]:first-child{margin-left:0;}
|
||||
.row-fluid > .span12{width:99.99999998999999%;}
|
||||
.row-fluid > .span11{width:91.489361693%;}
|
||||
.row-fluid > .span10{width:82.97872339599999%;}
|
||||
.row-fluid > .span9{width:74.468085099%;}
|
||||
.row-fluid > .span8{width:65.95744680199999%;}
|
||||
.row-fluid > .span7{width:57.446808505%;}
|
||||
.row-fluid > .span6{width:48.93617020799999%;}
|
||||
.row-fluid > .span5{width:40.425531911%;}
|
||||
.row-fluid > .span4{width:31.914893614%;}
|
||||
.row-fluid > .span3{width:23.404255317%;}
|
||||
.row-fluid > .span2{width:14.89361702%;}
|
||||
.row-fluid > .span1{width:6.382978723%;}
|
||||
.container{margin-left:auto;margin-right:auto;*zoom:1;}.container:before,.container:after{display:table;content:"";}
|
||||
.container:after{clear:both;}
|
||||
.container-fluid{padding-left:20px;padding-right:20px;*zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";}
|
||||
.container-fluid:after{clear:both;}
|
||||
p{margin:0 0 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;}p small{font-size:11px;color:#999999;}
|
||||
.lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px;}
|
||||
h1,h2,h3,h4,h5,h6{margin:0;font-family:inherit;font-weight:bold;color:inherit;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;color:#999999;}
|
||||
h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;}
|
||||
h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;}
|
||||
h3{line-height:27px;font-size:18px;}h3 small{font-size:14px;}
|
||||
h4,h5,h6{line-height:18px;}
|
||||
h4{font-size:14px;}h4 small{font-size:12px;}
|
||||
h5{font-size:12px;}
|
||||
h6{font-size:11px;color:#999999;text-transform:uppercase;}
|
||||
.page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #eeeeee;}
|
||||
.page-header h1{line-height:1;}
|
||||
ul,ol{padding:0;margin:0 0 9px 25px;}
|
||||
ul ul,ul ol,ol ol,ol ul{margin-bottom:0;}
|
||||
ul{list-style:disc;}
|
||||
ol{list-style:decimal;}
|
||||
li{line-height:18px;}
|
||||
ul.unstyled,ol.unstyled{margin-left:0;list-style:none;}
|
||||
dl{margin-bottom:18px;}
|
||||
dt,dd{line-height:18px;}
|
||||
dt{font-weight:bold;line-height:17px;}
|
||||
dd{margin-left:9px;}
|
||||
.dl-horizontal dt{float:left;clear:left;width:120px;text-align:right;}
|
||||
.dl-horizontal dd{margin-left:130px;}
|
||||
hr{margin:18px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;}
|
||||
strong{font-weight:bold;}
|
||||
em{font-style:italic;}
|
||||
.muted{color:#999999;}
|
||||
abbr[title]{border-bottom:1px dotted #ddd;cursor:help;}
|
||||
abbr.initialism{font-size:90%;text-transform:uppercase;}
|
||||
blockquote{padding:0 0 0 15px;margin:0 0 18px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:22.5px;}
|
||||
blockquote small{display:block;line-height:18px;color:#999999;}blockquote small:before{content:'\2014 \00A0';}
|
||||
blockquote.pull-right{float:right;padding-left:0;padding-right:15px;border-left:0;border-right:5px solid #eeeeee;}blockquote.pull-right p,blockquote.pull-right small{text-align:right;}
|
||||
q:before,q:after,blockquote:before,blockquote:after{content:"";}
|
||||
address{display:block;margin-bottom:18px;line-height:18px;font-style:normal;}
|
||||
small{font-size:100%;}
|
||||
cite{font-style:normal;}
|
||||
code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;}
|
||||
pre{display:block;padding:8.5px;margin:0 0 9px;font-size:12.025px;line-height:18px;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;white-space:pre;white-space:pre-wrap;word-break:break-all;word-wrap:break-word;}pre.prettyprint{margin-bottom:18px;}
|
||||
pre code{padding:0;color:inherit;background-color:transparent;border:0;}
|
||||
.pre-scrollable{max-height:340px;overflow-y:scroll;}
|
||||
.label{padding:1px 4px 2px;font-size:10.998px;font-weight:bold;line-height:13px;color:#ffffff;vertical-align:middle;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#999999;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
.label:hover{color:#ffffff;text-decoration:none;}
|
||||
.label-important{background-color:#b94a48;}
|
||||
.label-important:hover{background-color:#953b39;}
|
||||
.label-warning{background-color:#f89406;}
|
||||
.label-warning:hover{background-color:#c67605;}
|
||||
.label-success{background-color:#468847;}
|
||||
.label-success:hover{background-color:#356635;}
|
||||
.label-info{background-color:#3a87ad;}
|
||||
.label-info:hover{background-color:#2d6987;}
|
||||
.label-inverse{background-color:#333333;}
|
||||
.label-inverse:hover{background-color:#1a1a1a;}
|
||||
.badge{padding:1px 9px 2px;font-size:12.025px;font-weight:bold;white-space:nowrap;color:#ffffff;background-color:#999999;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;}
|
||||
.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;}
|
||||
.badge-error{background-color:#b94a48;}
|
||||
.badge-error:hover{background-color:#953b39;}
|
||||
.badge-warning{background-color:#f89406;}
|
||||
.badge-warning:hover{background-color:#c67605;}
|
||||
.badge-success{background-color:#468847;}
|
||||
.badge-success:hover{background-color:#356635;}
|
||||
.badge-info{background-color:#3a87ad;}
|
||||
.badge-info:hover{background-color:#2d6987;}
|
||||
.badge-inverse{background-color:#333333;}
|
||||
.badge-inverse:hover{background-color:#1a1a1a;}
|
||||
table{max-width:100%;border-collapse:collapse;border-spacing:0;background-color:transparent;}
|
||||
.table{width:100%;margin-bottom:18px;}.table th,.table td{padding:8px;line-height:18px;text-align:left;vertical-align:top;border-top:1px solid #dddddd;}
|
||||
.table th{font-weight:bold;}
|
||||
.table thead th{vertical-align:bottom;}
|
||||
.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0;}
|
||||
.table tbody+tbody{border-top:2px solid #dddddd;}
|
||||
.table-condensed th,.table-condensed td{padding:4px 5px;}
|
||||
.table-bordered{border:1px solid #dddddd;border-left:0;border-collapse:separate;*border-collapse:collapsed;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered td{border-left:1px solid #dddddd;}
|
||||
.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;}
|
||||
.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;}
|
||||
.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;}
|
||||
.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;}
|
||||
.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;}
|
||||
.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;}
|
||||
.table tbody tr:hover td,.table tbody tr:hover th{background-color:#f5f5f5;}
|
||||
table .span1{float:none;width:44px;margin-left:0;}
|
||||
table .span2{float:none;width:124px;margin-left:0;}
|
||||
table .span3{float:none;width:204px;margin-left:0;}
|
||||
table .span4{float:none;width:284px;margin-left:0;}
|
||||
table .span5{float:none;width:364px;margin-left:0;}
|
||||
table .span6{float:none;width:444px;margin-left:0;}
|
||||
table .span7{float:none;width:524px;margin-left:0;}
|
||||
table .span8{float:none;width:604px;margin-left:0;}
|
||||
table .span9{float:none;width:684px;margin-left:0;}
|
||||
table .span10{float:none;width:764px;margin-left:0;}
|
||||
table .span11{float:none;width:844px;margin-left:0;}
|
||||
table .span12{float:none;width:924px;margin-left:0;}
|
||||
table .span13{float:none;width:1004px;margin-left:0;}
|
||||
table .span14{float:none;width:1084px;margin-left:0;}
|
||||
table .span15{float:none;width:1164px;margin-left:0;}
|
||||
table .span16{float:none;width:1244px;margin-left:0;}
|
||||
table .span17{float:none;width:1324px;margin-left:0;}
|
||||
table .span18{float:none;width:1404px;margin-left:0;}
|
||||
table .span19{float:none;width:1484px;margin-left:0;}
|
||||
table .span20{float:none;width:1564px;margin-left:0;}
|
||||
table .span21{float:none;width:1644px;margin-left:0;}
|
||||
table .span22{float:none;width:1724px;margin-left:0;}
|
||||
table .span23{float:none;width:1804px;margin-left:0;}
|
||||
table .span24{float:none;width:1884px;margin-left:0;}
|
||||
form{margin:0 0 18px;}
|
||||
fieldset{padding:0;margin:0;border:0;}
|
||||
legend{display:block;width:100%;padding:0;margin-bottom:27px;font-size:19.5px;line-height:36px;color:#333333;border:0;border-bottom:1px solid #eee;}legend small{font-size:13.5px;color:#999999;}
|
||||
label,input,button,select,textarea{font-size:13px;font-weight:normal;line-height:18px;}
|
||||
input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;}
|
||||
label{display:block;margin-bottom:5px;color:#333333;}
|
||||
input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;margin-bottom:9px;font-size:13px;line-height:18px;color:#555555;border:1px solid #cccccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
.uneditable-textarea{width:auto;height:auto;}
|
||||
label input,label textarea,label select{display:block;}
|
||||
input[type="image"],input[type="checkbox"],input[type="radio"]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;cursor:pointer;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;border:0 \9;}
|
||||
input[type="image"]{border:0;}
|
||||
input[type="file"]{width:auto;padding:initial;line-height:initial;border:initial;background-color:#ffffff;background-color:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
|
||||
input[type="button"],input[type="reset"],input[type="submit"]{width:auto;height:auto;}
|
||||
select,input[type="file"]{height:28px;*margin-top:4px;line-height:28px;}
|
||||
input[type="file"]{line-height:18px \9;}
|
||||
select{width:220px;background-color:#ffffff;}
|
||||
select[multiple],select[size]{height:auto;}
|
||||
input[type="image"]{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
|
||||
textarea{height:auto;}
|
||||
input[type="hidden"]{display:none;}
|
||||
.radio,.checkbox{padding-left:18px;}
|
||||
.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px;}
|
||||
.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px;}
|
||||
.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle;}
|
||||
.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px;}
|
||||
input,textarea{-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-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 linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;}
|
||||
input:focus,textarea:focus{border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);outline:0;outline:thin dotted \9;}
|
||||
input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus,select:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
|
||||
.input-mini{width:60px;}
|
||||
.input-small{width:90px;}
|
||||
.input-medium{width:150px;}
|
||||
.input-large{width:210px;}
|
||||
.input-xlarge{width:270px;}
|
||||
.input-xxlarge{width:530px;}
|
||||
input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{float:none;margin-left:0;}
|
||||
input,textarea,.uneditable-input{margin-left:0;}
|
||||
input.span12, textarea.span12, .uneditable-input.span12{width:930px;}
|
||||
input.span11, textarea.span11, .uneditable-input.span11{width:850px;}
|
||||
input.span10, textarea.span10, .uneditable-input.span10{width:770px;}
|
||||
input.span9, textarea.span9, .uneditable-input.span9{width:690px;}
|
||||
input.span8, textarea.span8, .uneditable-input.span8{width:610px;}
|
||||
input.span7, textarea.span7, .uneditable-input.span7{width:530px;}
|
||||
input.span6, textarea.span6, .uneditable-input.span6{width:450px;}
|
||||
input.span5, textarea.span5, .uneditable-input.span5{width:370px;}
|
||||
input.span4, textarea.span4, .uneditable-input.span4{width:290px;}
|
||||
input.span3, textarea.span3, .uneditable-input.span3{width:210px;}
|
||||
input.span2, textarea.span2, .uneditable-input.span2{width:130px;}
|
||||
input.span1, textarea.span1, .uneditable-input.span1{width:50px;}
|
||||
input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{background-color:#eeeeee;border-color:#ddd;cursor:not-allowed;}
|
||||
.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853;}
|
||||
.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;border-color:#c09853;}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:0 0 6px #dbc59e;-moz-box-shadow:0 0 6px #dbc59e;box-shadow:0 0 6px #dbc59e;}
|
||||
.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853;}
|
||||
.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48;}
|
||||
.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;border-color:#b94a48;}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:0 0 6px #d59392;-moz-box-shadow:0 0 6px #d59392;box-shadow:0 0 6px #d59392;}
|
||||
.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48;}
|
||||
.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847;}
|
||||
.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;border-color:#468847;}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:0 0 6px #7aba7b;-moz-box-shadow:0 0 6px #7aba7b;box-shadow:0 0 6px #7aba7b;}
|
||||
.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847;}
|
||||
input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b;}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;}
|
||||
.form-actions{padding:17px 20px 18px;margin-top:18px;margin-bottom:18px;background-color:#eeeeee;border-top:1px solid #ddd;*zoom:1;}.form-actions:before,.form-actions:after{display:table;content:"";}
|
||||
.form-actions:after{clear:both;}
|
||||
.uneditable-input{display:block;background-color:#ffffff;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;}
|
||||
:-moz-placeholder{color:#999999;}
|
||||
::-webkit-input-placeholder{color:#999999;}
|
||||
.help-block,.help-inline{color:#555555;}
|
||||
.help-block{display:block;margin-bottom:9px;}
|
||||
.help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px;}
|
||||
.input-prepend,.input-append{margin-bottom:5px;}.input-prepend input,.input-append input,.input-prepend select,.input-append select,.input-prepend .uneditable-input,.input-append .uneditable-input{*margin-left:0;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}.input-prepend input:focus,.input-append input:focus,.input-prepend select:focus,.input-append select:focus,.input-prepend .uneditable-input:focus,.input-append .uneditable-input:focus{position:relative;z-index:2;}
|
||||
.input-prepend .uneditable-input,.input-append .uneditable-input{border-left-color:#ccc;}
|
||||
.input-prepend .add-on,.input-append .add-on{display:inline-block;width:auto;min-width:16px;height:18px;padding:4px 5px;font-weight:normal;line-height:18px;text-align:center;text-shadow:0 1px 0 #ffffff;vertical-align:middle;background-color:#eeeeee;border:1px solid #ccc;}
|
||||
.input-prepend .add-on,.input-append .add-on,.input-prepend .btn,.input-append .btn{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
|
||||
.input-prepend .active,.input-append .active{background-color:#a9dba9;border-color:#46a546;}
|
||||
.input-prepend .add-on,.input-prepend .btn{margin-right:-1px;}
|
||||
.input-append input,.input-append select .uneditable-input{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
|
||||
.input-append .uneditable-input{border-left-color:#eee;border-right-color:#ccc;}
|
||||
.input-append .add-on,.input-append .btn{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}
|
||||
.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
|
||||
.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
|
||||
.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}
|
||||
.search-query{padding-left:14px;padding-right:14px;margin-bottom:0;-webkit-border-radius:14px;-moz-border-radius:14px;border-radius:14px;}
|
||||
.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;margin-bottom:0;}
|
||||
.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none;}
|
||||
.form-search label,.form-inline label{display:inline-block;}
|
||||
.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0;}
|
||||
.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle;}
|
||||
.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-left:0;margin-right:3px;}
|
||||
.control-group{margin-bottom:9px;}
|
||||
legend+.control-group{margin-top:18px;-webkit-margin-top-collapse:separate;}
|
||||
.form-horizontal .control-group{margin-bottom:18px;*zoom:1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";}
|
||||
.form-horizontal .control-group:after{clear:both;}
|
||||
.form-horizontal .control-label{float:left;width:140px;padding-top:5px;text-align:right;}
|
||||
.form-horizontal .controls{margin-left:160px;*display:inline-block;*margin-left:0;*padding-left:20px;}
|
||||
.form-horizontal .help-block{margin-top:9px;margin-bottom:0;}
|
||||
.form-horizontal .form-actions{padding-left:160px;}
|
||||
.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 10px 4px;margin-bottom:0;font-size:13px;line-height:18px;color:#333333;text-align:center;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);vertical-align:middle;background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #ffffff, #e6e6e6);background-image:-ms-linear-gradient(top, #ffffff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #ffffff, #e6e6e6);background-image:-o-linear-gradient(top, #ffffff, #e6e6e6);background-image:linear-gradient(top, #ffffff, #e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);border:1px solid #cccccc;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);cursor:pointer;*margin-left:.3em;}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{background-color:#e6e6e6;}
|
||||
.btn:active,.btn.active{background-color:#cccccc \9;}
|
||||
.btn:first-child{*margin-left:0;}
|
||||
.btn:hover{color:#333333;text-decoration:none;background-color:#e6e6e6;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-ms-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;}
|
||||
.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
|
||||
.btn.active,.btn:active{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);background-color:#e6e6e6;background-color:#d9d9d9 \9;outline:0;}
|
||||
.btn.disabled,.btn[disabled]{cursor:default;background-image:none;background-color:#e6e6e6;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
|
||||
.btn-large{padding:9px 14px;font-size:15px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
|
||||
.btn-large [class^="icon-"]{margin-top:1px;}
|
||||
.btn-small{padding:5px 9px;font-size:11px;line-height:16px;}
|
||||
.btn-small [class^="icon-"]{margin-top:-1px;}
|
||||
.btn-mini{padding:2px 6px;font-size:11px;line-height:14px;}
|
||||
.btn-primary,.btn-primary:hover,.btn-warning,.btn-warning:hover,.btn-danger,.btn-danger:hover,.btn-success,.btn-success:hover,.btn-info,.btn-info:hover,.btn-inverse,.btn-inverse:hover{text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);color:#ffffff;}
|
||||
.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255, 255, 255, 0.75);}
|
||||
.btn-primary{background-color:#0074cc;background-image:-moz-linear-gradient(top, #0088cc, #0055cc);background-image:-ms-linear-gradient(top, #0088cc, #0055cc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc));background-image:-webkit-linear-gradient(top, #0088cc, #0055cc);background-image:-o-linear-gradient(top, #0088cc, #0055cc);background-image:linear-gradient(top, #0088cc, #0055cc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);border-color:#0055cc #0055cc #003580;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{background-color:#0055cc;}
|
||||
.btn-primary:active,.btn-primary.active{background-color:#004099 \9;}
|
||||
.btn-warning{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{background-color:#f89406;}
|
||||
.btn-warning:active,.btn-warning.active{background-color:#c67605 \9;}
|
||||
.btn-danger{background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-ms-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(top, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{background-color:#bd362f;}
|
||||
.btn-danger:active,.btn-danger.active{background-color:#942a25 \9;}
|
||||
.btn-success{background-color:#5bb75b;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-ms-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(top, #62c462, #51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{background-color:#51a351;}
|
||||
.btn-success:active,.btn-success.active{background-color:#408140 \9;}
|
||||
.btn-info{background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-ms-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(top, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{background-color:#2f96b4;}
|
||||
.btn-info:active,.btn-info.active{background-color:#24748c \9;}
|
||||
.btn-inverse{background-color:#414141;background-image:-moz-linear-gradient(top, #555555, #222222);background-image:-ms-linear-gradient(top, #555555, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));background-image:-webkit-linear-gradient(top, #555555, #222222);background-image:-o-linear-gradient(top, #555555, #222222);background-image:linear-gradient(top, #555555, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{background-color:#222222;}
|
||||
.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9;}
|
||||
button.btn,input[type="submit"].btn{*padding-top:2px;*padding-bottom:2px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;}
|
||||
button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px;}
|
||||
button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px;}
|
||||
button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px;}
|
||||
[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;}[class^="icon-"]:last-child,[class*=" icon-"]:last-child{*margin-left:0;}
|
||||
.icon-white{background-image:url("../img/glyphicons-halflings-white.png");}
|
||||
.icon-glass{background-position:0 0;}
|
||||
.icon-music{background-position:-24px 0;}
|
||||
.icon-search{background-position:-48px 0;}
|
||||
.icon-envelope{background-position:-72px 0;}
|
||||
.icon-heart{background-position:-96px 0;}
|
||||
.icon-star{background-position:-120px 0;}
|
||||
.icon-star-empty{background-position:-144px 0;}
|
||||
.icon-user{background-position:-168px 0;}
|
||||
.icon-film{background-position:-192px 0;}
|
||||
.icon-th-large{background-position:-216px 0;}
|
||||
.icon-th{background-position:-240px 0;}
|
||||
.icon-th-list{background-position:-264px 0;}
|
||||
.icon-ok{background-position:-288px 0;}
|
||||
.icon-remove{background-position:-312px 0;}
|
||||
.icon-zoom-in{background-position:-336px 0;}
|
||||
.icon-zoom-out{background-position:-360px 0;}
|
||||
.icon-off{background-position:-384px 0;}
|
||||
.icon-signal{background-position:-408px 0;}
|
||||
.icon-cog{background-position:-432px 0;}
|
||||
.icon-trash{background-position:-456px 0;}
|
||||
.icon-home{background-position:0 -24px;}
|
||||
.icon-file{background-position:-24px -24px;}
|
||||
.icon-time{background-position:-48px -24px;}
|
||||
.icon-road{background-position:-72px -24px;}
|
||||
.icon-download-alt{background-position:-96px -24px;}
|
||||
.icon-download{background-position:-120px -24px;}
|
||||
.icon-upload{background-position:-144px -24px;}
|
||||
.icon-inbox{background-position:-168px -24px;}
|
||||
.icon-play-circle{background-position:-192px -24px;}
|
||||
.icon-repeat{background-position:-216px -24px;}
|
||||
.icon-refresh{background-position:-240px -24px;}
|
||||
.icon-list-alt{background-position:-264px -24px;}
|
||||
.icon-lock{background-position:-287px -24px;}
|
||||
.icon-flag{background-position:-312px -24px;}
|
||||
.icon-headphones{background-position:-336px -24px;}
|
||||
.icon-volume-off{background-position:-360px -24px;}
|
||||
.icon-volume-down{background-position:-384px -24px;}
|
||||
.icon-volume-up{background-position:-408px -24px;}
|
||||
.icon-qrcode{background-position:-432px -24px;}
|
||||
.icon-barcode{background-position:-456px -24px;}
|
||||
.icon-tag{background-position:0 -48px;}
|
||||
.icon-tags{background-position:-25px -48px;}
|
||||
.icon-book{background-position:-48px -48px;}
|
||||
.icon-bookmark{background-position:-72px -48px;}
|
||||
.icon-print{background-position:-96px -48px;}
|
||||
.icon-camera{background-position:-120px -48px;}
|
||||
.icon-font{background-position:-144px -48px;}
|
||||
.icon-bold{background-position:-167px -48px;}
|
||||
.icon-italic{background-position:-192px -48px;}
|
||||
.icon-text-height{background-position:-216px -48px;}
|
||||
.icon-text-width{background-position:-240px -48px;}
|
||||
.icon-align-left{background-position:-264px -48px;}
|
||||
.icon-align-center{background-position:-288px -48px;}
|
||||
.icon-align-right{background-position:-312px -48px;}
|
||||
.icon-align-justify{background-position:-336px -48px;}
|
||||
.icon-list{background-position:-360px -48px;}
|
||||
.icon-indent-left{background-position:-384px -48px;}
|
||||
.icon-indent-right{background-position:-408px -48px;}
|
||||
.icon-facetime-video{background-position:-432px -48px;}
|
||||
.icon-picture{background-position:-456px -48px;}
|
||||
.icon-pencil{background-position:0 -72px;}
|
||||
.icon-map-marker{background-position:-24px -72px;}
|
||||
.icon-adjust{background-position:-48px -72px;}
|
||||
.icon-tint{background-position:-72px -72px;}
|
||||
.icon-edit{background-position:-96px -72px;}
|
||||
.icon-share{background-position:-120px -72px;}
|
||||
.icon-check{background-position:-144px -72px;}
|
||||
.icon-move{background-position:-168px -72px;}
|
||||
.icon-step-backward{background-position:-192px -72px;}
|
||||
.icon-fast-backward{background-position:-216px -72px;}
|
||||
.icon-backward{background-position:-240px -72px;}
|
||||
.icon-play{background-position:-264px -72px;}
|
||||
.icon-pause{background-position:-288px -72px;}
|
||||
.icon-stop{background-position:-312px -72px;}
|
||||
.icon-forward{background-position:-336px -72px;}
|
||||
.icon-fast-forward{background-position:-360px -72px;}
|
||||
.icon-step-forward{background-position:-384px -72px;}
|
||||
.icon-eject{background-position:-408px -72px;}
|
||||
.icon-chevron-left{background-position:-432px -72px;}
|
||||
.icon-chevron-right{background-position:-456px -72px;}
|
||||
.icon-plus-sign{background-position:0 -96px;}
|
||||
.icon-minus-sign{background-position:-24px -96px;}
|
||||
.icon-remove-sign{background-position:-48px -96px;}
|
||||
.icon-ok-sign{background-position:-72px -96px;}
|
||||
.icon-question-sign{background-position:-96px -96px;}
|
||||
.icon-info-sign{background-position:-120px -96px;}
|
||||
.icon-screenshot{background-position:-144px -96px;}
|
||||
.icon-remove-circle{background-position:-168px -96px;}
|
||||
.icon-ok-circle{background-position:-192px -96px;}
|
||||
.icon-ban-circle{background-position:-216px -96px;}
|
||||
.icon-arrow-left{background-position:-240px -96px;}
|
||||
.icon-arrow-right{background-position:-264px -96px;}
|
||||
.icon-arrow-up{background-position:-289px -96px;}
|
||||
.icon-arrow-down{background-position:-312px -96px;}
|
||||
.icon-share-alt{background-position:-336px -96px;}
|
||||
.icon-resize-full{background-position:-360px -96px;}
|
||||
.icon-resize-small{background-position:-384px -96px;}
|
||||
.icon-plus{background-position:-408px -96px;}
|
||||
.icon-minus{background-position:-433px -96px;}
|
||||
.icon-asterisk{background-position:-456px -96px;}
|
||||
.icon-exclamation-sign{background-position:0 -120px;}
|
||||
.icon-gift{background-position:-24px -120px;}
|
||||
.icon-leaf{background-position:-48px -120px;}
|
||||
.icon-fire{background-position:-72px -120px;}
|
||||
.icon-eye-open{background-position:-96px -120px;}
|
||||
.icon-eye-close{background-position:-120px -120px;}
|
||||
.icon-warning-sign{background-position:-144px -120px;}
|
||||
.icon-plane{background-position:-168px -120px;}
|
||||
.icon-calendar{background-position:-192px -120px;}
|
||||
.icon-random{background-position:-216px -120px;}
|
||||
.icon-comment{background-position:-240px -120px;}
|
||||
.icon-magnet{background-position:-264px -120px;}
|
||||
.icon-chevron-up{background-position:-288px -120px;}
|
||||
.icon-chevron-down{background-position:-313px -119px;}
|
||||
.icon-retweet{background-position:-336px -120px;}
|
||||
.icon-shopping-cart{background-position:-360px -120px;}
|
||||
.icon-folder-close{background-position:-384px -120px;}
|
||||
.icon-folder-open{background-position:-408px -120px;}
|
||||
.icon-resize-vertical{background-position:-432px -119px;}
|
||||
.icon-resize-horizontal{background-position:-456px -118px;}
|
||||
.btn-group{position:relative;*zoom:1;*margin-left:.3em;}.btn-group:before,.btn-group:after{display:table;content:"";}
|
||||
.btn-group:after{clear:both;}
|
||||
.btn-group:first-child{*margin-left:0;}
|
||||
.btn-group+.btn-group{margin-left:5px;}
|
||||
.btn-toolbar{margin-top:9px;margin-bottom:9px;}.btn-toolbar .btn-group{display:inline-block;*display:inline;*zoom:1;}
|
||||
.btn-group .btn{position:relative;float:left;margin-left:-1px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
|
||||
.btn-group .btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;}
|
||||
.btn-group .btn:last-child,.btn-group .dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;}
|
||||
.btn-group .btn.large:first-child{margin-left:0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px;}
|
||||
.btn-group .btn.large:last-child,.btn-group .large.dropdown-toggle{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px;}
|
||||
.btn-group .btn:hover,.btn-group .btn:focus,.btn-group .btn:active,.btn-group .btn.active{z-index:2;}
|
||||
.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;}
|
||||
.btn-group .dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);*padding-top:3px;*padding-bottom:3px;}
|
||||
.btn-group .btn-mini.dropdown-toggle{padding-left:5px;padding-right:5px;*padding-top:1px;*padding-bottom:1px;}
|
||||
.btn-group .btn-small.dropdown-toggle{*padding-top:4px;*padding-bottom:4px;}
|
||||
.btn-group .btn-large.dropdown-toggle{padding-left:12px;padding-right:12px;}
|
||||
.btn-group.open{*z-index:1000;}.btn-group.open .dropdown-menu{display:block;margin-top:1px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
|
||||
.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);}
|
||||
.btn .caret{margin-top:7px;margin-left:0;}
|
||||
.btn:hover .caret,.open.btn-group .caret{opacity:1;filter:alpha(opacity=100);}
|
||||
.btn-mini .caret{margin-top:5px;}
|
||||
.btn-small .caret{margin-top:6px;}
|
||||
.btn-large .caret{margin-top:6px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;}
|
||||
.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:0.75;filter:alpha(opacity=75);}
|
||||
.nav{margin-left:0;margin-bottom:18px;list-style:none;}
|
||||
.nav>li>a{display:block;}
|
||||
.nav>li>a:hover{text-decoration:none;background-color:#eeeeee;}
|
||||
.nav .nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:18px;color:#999999;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);text-transform:uppercase;}
|
||||
.nav li+.nav-header{margin-top:9px;}
|
||||
.nav-list{padding-left:15px;padding-right:15px;margin-bottom:0;}
|
||||
.nav-list>li>a,.nav-list .nav-header{margin-left:-15px;margin-right:-15px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);}
|
||||
.nav-list>li>a{padding:3px 15px;}
|
||||
.nav-list>.active>a,.nav-list>.active>a:hover{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.2);background-color:#0088cc;}
|
||||
.nav-list [class^="icon-"]{margin-right:2px;}
|
||||
.nav-list .divider{height:1px;margin:8px 1px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;*width:100%;*margin:-5px 0 5px;}
|
||||
.nav-tabs,.nav-pills{*zoom:1;}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;content:"";}
|
||||
.nav-tabs:after,.nav-pills:after{clear:both;}
|
||||
.nav-tabs>li,.nav-pills>li{float:left;}
|
||||
.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px;}
|
||||
.nav-tabs{border-bottom:1px solid #ddd;}
|
||||
.nav-tabs>li{margin-bottom:-1px;}
|
||||
.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:18px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #dddddd;}
|
||||
.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555555;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;}
|
||||
.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
|
||||
.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#ffffff;background-color:#0088cc;}
|
||||
.nav-stacked>li{float:none;}
|
||||
.nav-stacked>li>a{margin-right:0;}
|
||||
.nav-tabs.nav-stacked{border-bottom:0;}
|
||||
.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
|
||||
.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}
|
||||
.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}
|
||||
.nav-tabs.nav-stacked>li>a:hover{border-color:#ddd;z-index:2;}
|
||||
.nav-pills.nav-stacked>li>a{margin-bottom:3px;}
|
||||
.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px;}
|
||||
.nav-tabs .dropdown-menu,.nav-pills .dropdown-menu{margin-top:1px;border-width:1px;}
|
||||
.nav-pills .dropdown-menu{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
|
||||
.nav-tabs .dropdown-toggle .caret,.nav-pills .dropdown-toggle .caret{border-top-color:#0088cc;border-bottom-color:#0088cc;margin-top:6px;}
|
||||
.nav-tabs .dropdown-toggle:hover .caret,.nav-pills .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580;}
|
||||
.nav-tabs .active .dropdown-toggle .caret,.nav-pills .active .dropdown-toggle .caret{border-top-color:#333333;border-bottom-color:#333333;}
|
||||
.nav>.dropdown.active>a:hover{color:#000000;cursor:pointer;}
|
||||
.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>.open.active>a:hover{color:#ffffff;background-color:#999999;border-color:#999999;}
|
||||
.nav .open .caret,.nav .open.active .caret,.nav .open a:hover .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:1;filter:alpha(opacity=100);}
|
||||
.tabs-stacked .open>a:hover{border-color:#999999;}
|
||||
.tabbable{*zoom:1;}.tabbable:before,.tabbable:after{display:table;content:"";}
|
||||
.tabbable:after{clear:both;}
|
||||
.tab-content{display:table;width:100%;}
|
||||
.tabs-below .nav-tabs,.tabs-right .nav-tabs,.tabs-left .nav-tabs{border-bottom:0;}
|
||||
.tab-content>.tab-pane,.pill-content>.pill-pane{display:none;}
|
||||
.tab-content>.active,.pill-content>.active{display:block;}
|
||||
.tabs-below .nav-tabs{border-top:1px solid #ddd;}
|
||||
.tabs-below .nav-tabs>li{margin-top:-1px;margin-bottom:0;}
|
||||
.tabs-below .nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.tabs-below .nav-tabs>li>a:hover{border-bottom-color:transparent;border-top-color:#ddd;}
|
||||
.tabs-below .nav-tabs .active>a,.tabs-below .nav-tabs .active>a:hover{border-color:transparent #ddd #ddd #ddd;}
|
||||
.tabs-left .nav-tabs>li,.tabs-right .nav-tabs>li{float:none;}
|
||||
.tabs-left .nav-tabs>li>a,.tabs-right .nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px;}
|
||||
.tabs-left .nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd;}
|
||||
.tabs-left .nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;}
|
||||
.tabs-left .nav-tabs>li>a:hover{border-color:#eeeeee #dddddd #eeeeee #eeeeee;}
|
||||
.tabs-left .nav-tabs .active>a,.tabs-left .nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#ffffff;}
|
||||
.tabs-right .nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd;}
|
||||
.tabs-right .nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;}
|
||||
.tabs-right .nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #eeeeee #dddddd;}
|
||||
.tabs-right .nav-tabs .active>a,.tabs-right .nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#ffffff;}
|
||||
.navbar{*position:relative;*z-index:2;overflow:visible;margin-bottom:18px;}
|
||||
.navbar-inner{padding-left:20px;padding-right:20px;background-color:#2c2c2c;background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-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);}
|
||||
.navbar .container{width:auto;}
|
||||
.btn-navbar{display:none;float:right;padding:7px 10px;margin-left:5px;margin-right:5px;background-color:#2c2c2c;background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);}.btn-navbar:hover,.btn-navbar:active,.btn-navbar.active,.btn-navbar.disabled,.btn-navbar[disabled]{background-color:#222222;}
|
||||
.btn-navbar:active,.btn-navbar.active{background-color:#080808 \9;}
|
||||
.btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);-moz-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);}
|
||||
.btn-navbar .icon-bar+.icon-bar{margin-top:3px;}
|
||||
.nav-collapse.collapse{height:auto;}
|
||||
.navbar{color:#999999;}.navbar .brand:hover{text-decoration:none;}
|
||||
.navbar .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;font-size:20px;font-weight:200;line-height:1;color:#ffffff;}
|
||||
.navbar .navbar-text{margin-bottom:0;line-height:40px;}
|
||||
.navbar .btn,.navbar .btn-group{margin-top:5px;}
|
||||
.navbar .btn-group .btn{margin-top:0;}
|
||||
.navbar-form{margin-bottom:0;*zoom:1;}.navbar-form:before,.navbar-form:after{display:table;content:"";}
|
||||
.navbar-form:after{clear:both;}
|
||||
.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px;}
|
||||
.navbar-form input,.navbar-form select{display:inline-block;margin-bottom:0;}
|
||||
.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px;}
|
||||
.navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap;}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0;}
|
||||
.navbar-search{position:relative;float:left;margin-top:6px;margin-bottom:0;}.navbar-search .search-query{padding:4px 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;color:#ffffff;background-color:#626262;border:1px solid #151515;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;}.navbar-search .search-query:-moz-placeholder{color:#cccccc;}
|
||||
.navbar-search .search-query::-webkit-input-placeholder{color:#cccccc;}
|
||||
.navbar-search .search-query:focus,.navbar-search .search-query.focused{padding:5px 10px;color:#333333;text-shadow:0 1px 0 #ffffff;background-color:#ffffff;border:0;-webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);box-shadow:0 0 3px rgba(0, 0, 0, 0.15);outline:0;}
|
||||
.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0;}
|
||||
.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-left:0;padding-right:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
|
||||
.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;}
|
||||
.navbar-fixed-top{top:0;}
|
||||
.navbar-fixed-bottom{bottom:0;}
|
||||
.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0;}
|
||||
.navbar .nav.pull-right{float:right;}
|
||||
.navbar .nav>li{display:block;float:left;}
|
||||
.navbar .nav>li>a{float:none;padding:10px 10px 11px;line-height:19px;color:#999999;text-decoration:none;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);}
|
||||
.navbar .nav>li>a:hover{background-color:transparent;color:#ffffff;text-decoration:none;}
|
||||
.navbar .nav .active>a,.navbar .nav .active>a:hover{color:#ffffff;text-decoration:none;background-color:#222222;}
|
||||
.navbar .divider-vertical{height:40px;width:1px;margin:0 9px;overflow:hidden;background-color:#222222;border-right:1px solid #333333;}
|
||||
.navbar .nav.pull-right{margin-left:10px;margin-right:0;}
|
||||
.navbar .dropdown-menu{margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.navbar .dropdown-menu:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0, 0, 0, 0.2);position:absolute;top:-7px;left:9px;}
|
||||
.navbar .dropdown-menu:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #ffffff;position:absolute;top:-6px;left:10px;}
|
||||
.navbar-fixed-bottom .dropdown-menu:before{border-top:7px solid #ccc;border-top-color:rgba(0, 0, 0, 0.2);border-bottom:0;bottom:-7px;top:auto;}
|
||||
.navbar-fixed-bottom .dropdown-menu:after{border-top:6px solid #ffffff;border-bottom:0;bottom:-6px;top:auto;}
|
||||
.navbar .nav .dropdown-toggle .caret,.navbar .nav .open.dropdown .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;}
|
||||
.navbar .nav .active .caret{opacity:1;filter:alpha(opacity=100);}
|
||||
.navbar .nav .open>.dropdown-toggle,.navbar .nav .active>.dropdown-toggle,.navbar .nav .open.active>.dropdown-toggle{background-color:transparent;}
|
||||
.navbar .nav .active>.dropdown-toggle:hover{color:#ffffff;}
|
||||
.navbar .nav.pull-right .dropdown-menu,.navbar .nav .dropdown-menu.pull-right{left:auto;right:0;}.navbar .nav.pull-right .dropdown-menu:before,.navbar .nav .dropdown-menu.pull-right:before{left:auto;right:12px;}
|
||||
.navbar .nav.pull-right .dropdown-menu:after,.navbar .nav .dropdown-menu.pull-right:after{left:auto;right:13px;}
|
||||
.breadcrumb{padding:7px 14px;margin:0 0 18px;list-style:none;background-color:#fbfbfb;background-image:-moz-linear-gradient(top, #ffffff, #f5f5f5);background-image:-ms-linear-gradient(top, #ffffff, #f5f5f5);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5));background-image:-webkit-linear-gradient(top, #ffffff, #f5f5f5);background-image:-o-linear-gradient(top, #ffffff, #f5f5f5);background-image:linear-gradient(top, #ffffff, #f5f5f5);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);border:1px solid #ddd;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;}.breadcrumb li{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 0 #ffffff;}
|
||||
.breadcrumb .divider{padding:0 5px;color:#999999;}
|
||||
.breadcrumb .active a{color:#333333;}
|
||||
.pagination{height:36px;margin:18px 0;}
|
||||
.pagination ul{display:inline-block;*display:inline;*zoom:1;margin-left:0;margin-bottom:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);}
|
||||
.pagination li{display:inline;}
|
||||
.pagination a{float:left;padding:0 14px;line-height:34px;text-decoration:none;border:1px solid #ddd;border-left-width:0;}
|
||||
.pagination a:hover,.pagination .active a{background-color:#f5f5f5;}
|
||||
.pagination .active a{color:#999999;cursor:default;}
|
||||
.pagination .disabled span,.pagination .disabled a,.pagination .disabled a:hover{color:#999999;background-color:transparent;cursor:default;}
|
||||
.pagination li:first-child a{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
|
||||
.pagination li:last-child a{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}
|
||||
.pagination-centered{text-align:center;}
|
||||
.pagination-right{text-align:right;}
|
||||
.pager{margin-left:0;margin-bottom:18px;list-style:none;text-align:center;*zoom:1;}.pager:before,.pager:after{display:table;content:"";}
|
||||
.pager:after{clear:both;}
|
||||
.pager li{display:inline;}
|
||||
.pager a{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;}
|
||||
.pager a:hover{text-decoration:none;background-color:#f5f5f5;}
|
||||
.pager .next a{float:right;}
|
||||
.pager .previous a{float:left;}
|
||||
.pager .disabled a,.pager .disabled a:hover{color:#999999;background-color:#fff;cursor:default;}
|
||||
.thumbnails{margin-left:-20px;list-style:none;*zoom:1;}.thumbnails:before,.thumbnails:after{display:table;content:"";}
|
||||
.thumbnails:after{clear:both;}
|
||||
.thumbnails>li{float:left;margin:0 0 18px 20px;}
|
||||
.thumbnail{display:block;padding:4px;line-height:1;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);}
|
||||
a.thumbnail:hover{border-color:#0088cc;-webkit-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);-moz-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);}
|
||||
.thumbnail>img{display:block;max-width:100%;margin-left:auto;margin-right:auto;}
|
||||
.thumbnail .caption{padding:9px;}
|
||||
.alert{padding:8px 35px 8px 14px;margin-bottom:18px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;color:#c09853;}
|
||||
.alert-heading{color:inherit;}
|
||||
.alert .close{position:relative;top:-2px;right:-21px;line-height:18px;}
|
||||
.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847;}
|
||||
.alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;color:#b94a48;}
|
||||
.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad;}
|
||||
.alert-block{padding-top:14px;padding-bottom:14px;}
|
||||
.alert-block>p,.alert-block>ul{margin-bottom:0;}
|
||||
.alert-block p+p{margin-top:5px;}
|
||||
@-webkit-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@-moz-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@-ms-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}.progress{overflow:hidden;height:18px;margin-bottom:18px;background-color:#f7f7f7;background-image:-moz-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-ms-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));background-image:-webkit-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-o-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:linear-gradient(top, #f5f5f5, #f9f9f9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
|
||||
.progress .bar{width:0%;height:18px;color:#ffffff;font-size:12px;text-align:center;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top, #149bdf, #0480be);background-image:-ms-linear-gradient(top, #149bdf, #0480be);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));background-image:-webkit-linear-gradient(top, #149bdf, #0480be);background-image:-o-linear-gradient(top, #149bdf, #0480be);background-image:linear-gradient(top, #149bdf, #0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width 0.6s ease;-moz-transition:width 0.6s ease;-ms-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease;}
|
||||
.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px;}
|
||||
.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite;}
|
||||
.progress-danger .bar{background-color:#dd514c;background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-ms-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(top, #ee5f5b, #c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);}
|
||||
.progress-danger.progress-striped .bar{background-color:#ee5f5b;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
|
||||
.progress-success .bar{background-color:#5eb95e;background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-ms-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(top, #62c462, #57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);}
|
||||
.progress-success.progress-striped .bar{background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
|
||||
.progress-info .bar{background-color:#4bb1cf;background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-ms-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(top, #5bc0de, #339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);}
|
||||
.progress-info.progress-striped .bar{background-color:#5bc0de;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
|
||||
.progress-warning .bar{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);}
|
||||
.progress-warning.progress-striped .bar{background-color:#fbb450;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
|
||||
.hero-unit{padding:60px;margin-bottom:30px;background-color:#eeeeee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;color:inherit;letter-spacing:-1px;}
|
||||
.hero-unit p{font-size:18px;font-weight:200;line-height:27px;color:inherit;}
|
||||
.tooltip{position:absolute;z-index:1020;display:block;visibility:visible;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);}
|
||||
.tooltip.top{margin-top:-2px;}
|
||||
.tooltip.right{margin-left:2px;}
|
||||
.tooltip.bottom{margin-top:2px;}
|
||||
.tooltip.left{margin-left:-2px;}
|
||||
.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;}
|
||||
.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;}
|
||||
.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;}
|
||||
.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;}
|
||||
.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
|
||||
.tooltip-arrow{position:absolute;width:0;height:0;}
|
||||
.popover{position:absolute;top:0;left:0;z-index:1010;display:none;padding:5px;}.popover.top{margin-top:-5px;}
|
||||
.popover.right{margin-left:5px;}
|
||||
.popover.bottom{margin-top:5px;}
|
||||
.popover.left{margin-left:-5px;}
|
||||
.popover.top .arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;}
|
||||
.popover.right .arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;}
|
||||
.popover.bottom .arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;}
|
||||
.popover.left .arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;}
|
||||
.popover .arrow{position:absolute;width:0;height:0;}
|
||||
.popover-inner{padding:3px;width:280px;overflow:hidden;background:#000000;background:rgba(0, 0, 0, 0.8);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);}
|
||||
.popover-title{padding:9px 15px;line-height:1;background-color:#f5f5f5;border-bottom:1px solid #eee;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;}
|
||||
.popover-content{padding:14px;background-color:#ffffff;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0;}
|
||||
.modal-open .dropdown-menu{z-index:2050;}
|
||||
.modal-open .dropdown.open{*z-index:2050;}
|
||||
.modal-open .popover{z-index:2060;}
|
||||
.modal-open .tooltip{z-index:2070;}
|
||||
.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000;}.modal-backdrop.fade{opacity:0;}
|
||||
.modal-backdrop,.modal-backdrop.fade.in{opacity:0.8;filter:alpha(opacity=80);}
|
||||
.modal{position:fixed;top:50%;left:50%;z-index:1050;overflow:auto;width:560px;margin:-250px 0 0 -280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-ms-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;}
|
||||
.modal.fade.in{top:50%;}
|
||||
.modal-header{padding:9px 15px;border-bottom:1px solid #eee;}.modal-header .close{margin-top:2px;}
|
||||
.modal-body{overflow-y:auto;max-height:400px;padding:15px;}
|
||||
.modal-form{margin-bottom:0;}
|
||||
.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;*zoom:1;}.modal-footer:before,.modal-footer:after{display:table;content:"";}
|
||||
.modal-footer:after{clear:both;}
|
||||
.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0;}
|
||||
.modal-footer .btn-group .btn+.btn{margin-left:-1px;}
|
||||
.dropdown{position:relative;}
|
||||
.dropdown-toggle{*margin-bottom:-3px;}
|
||||
.dropdown-toggle:active,.open .dropdown-toggle{outline:0;}
|
||||
.caret{display:inline-block;width:0;height:0;vertical-align:top;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000000;opacity:0.3;filter:alpha(opacity=30);content:"";}
|
||||
.dropdown .caret{margin-top:8px;margin-left:2px;}
|
||||
.dropdown:hover .caret,.open.dropdown .caret{opacity:1;filter:alpha(opacity=100);}
|
||||
.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;padding:4px 0;margin:0;list-style:none;background-color:#ffffff;border-color:#ccc;border-color:rgba(0, 0, 0, 0.2);border-style:solid;border-width:1px;-webkit-border-radius:0 0 5px 5px;-moz-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;*border-right-width:2px;*border-bottom-width:2px;}.dropdown-menu.pull-right{right:0;left:auto;}
|
||||
.dropdown-menu .divider{height:1px;margin:8px 1px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;*width:100%;*margin:-5px 0 5px;}
|
||||
.dropdown-menu a{display:block;padding:3px 15px;clear:both;font-weight:normal;line-height:18px;color:#333333;white-space:nowrap;}
|
||||
.dropdown-menu li>a:hover,.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#ffffff;text-decoration:none;background-color:#0088cc;}
|
||||
.dropdown.open{*z-index:1000;}.dropdown.open .dropdown-toggle{color:#ffffff;background:#ccc;background:rgba(0, 0, 0, 0.3);}
|
||||
.dropdown.open .dropdown-menu{display:block;}
|
||||
.pull-right .dropdown-menu{left:auto;right:0;}
|
||||
.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000000;content:"\2191";}
|
||||
.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px;}
|
||||
.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
|
||||
.accordion{margin-bottom:18px;}
|
||||
.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
|
||||
.accordion-heading{border-bottom:0;}
|
||||
.accordion-heading .accordion-toggle{display:block;padding:8px 15px;}
|
||||
.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5;}
|
||||
.carousel{position:relative;margin-bottom:18px;line-height:1;}
|
||||
.carousel-inner{overflow:hidden;width:100%;position:relative;}
|
||||
.carousel .item{display:none;position:relative;-webkit-transition:0.6s ease-in-out left;-moz-transition:0.6s ease-in-out left;-ms-transition:0.6s ease-in-out left;-o-transition:0.6s ease-in-out left;transition:0.6s ease-in-out left;}
|
||||
.carousel .item>img{display:block;line-height:1;}
|
||||
.carousel .active,.carousel .next,.carousel .prev{display:block;}
|
||||
.carousel .active{left:0;}
|
||||
.carousel .next,.carousel .prev{position:absolute;top:0;width:100%;}
|
||||
.carousel .next{left:100%;}
|
||||
.carousel .prev{left:-100%;}
|
||||
.carousel .next.left,.carousel .prev.right{left:0;}
|
||||
.carousel .active.left{left:-100%;}
|
||||
.carousel .active.right{left:100%;}
|
||||
.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#ffffff;text-align:center;background:#222222;border:3px solid #ffffff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:0.5;filter:alpha(opacity=50);}.carousel-control.right{left:auto;right:15px;}
|
||||
.carousel-control:hover{color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90);}
|
||||
.carousel-caption{position:absolute;left:0;right:0;bottom:0;padding:10px 15px 5px;background:#333333;background:rgba(0, 0, 0, 0.75);}
|
||||
.carousel-caption h4,.carousel-caption p{color:#ffffff;}
|
||||
.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);}
|
||||
.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
|
||||
.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
.close{float:right;font-size:20px;font-weight:bold;line-height:18px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover{color:#000000;text-decoration:none;opacity:0.4;filter:alpha(opacity=40);cursor:pointer;}
|
||||
.pull-right{float:right;}
|
||||
.pull-left{float:left;}
|
||||
.hide{display:none;}
|
||||
.show{display:block;}
|
||||
.invisible{visibility:hidden;}
|
||||
.fade{-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;}
|
||||
.collapse{-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-ms-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;position:relative;overflow:hidden;height:0;}.collapse.in{height:auto;}
|
||||
.hidden{display:none;visibility:hidden;}
|
||||
.visible-phone{display:none;}
|
||||
.visible-tablet{display:none;}
|
||||
.visible-desktop{display:block;}
|
||||
.hidden-phone{display:block;}
|
||||
.hidden-tablet{display:block;}
|
||||
.hidden-desktop{display:none;}
|
56
css/main.css
Executable file
|
@ -0,0 +1,56 @@
|
|||
body {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
#main {
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
.loading {
|
||||
display: none;
|
||||
left: 40%;
|
||||
position: fixed;
|
||||
width: 250px;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
background: #fff;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
button a {
|
||||
color:inherit;
|
||||
}
|
||||
|
||||
#analyse, #whois {
|
||||
margin-top: -21px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 855px !important;
|
||||
}
|
||||
|
||||
th {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-right: 4px;
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
|
||||
#description {
|
||||
width: 855px;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
#domain {
|
||||
margin-top: -13px;
|
||||
}
|
||||
|
||||
.input_error {
|
||||
background: #FFD1D2;
|
||||
}
|
BIN
img/fai/bouygues-logo.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
img/fai/dartybox-logo.jpg
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
img/fai/free-logo.jpg
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
img/fai/google-logo.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
img/fai/none.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
img/fai/numericable-logo.png
Normal file
After Width: | Height: | Size: 900 B |
BIN
img/fai/open-dns-logo.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
img/fai/orange-logo.jpg
Normal file
After Width: | Height: | Size: 547 B |
BIN
img/fai/ovh-logo.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
img/glyphicons-halflings-white.png
Executable file
After Width: | Height: | Size: 4.3 KiB |
BIN
img/glyphicons-halflings.png
Executable file
After Width: | Height: | Size: 4.3 KiB |
120
index.php
Executable file
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
|
||||
require 'lib'.DIRECTORY_SEPARATOR.'bootstrap.php';
|
||||
|
||||
XajaxSg::getInstance()->processRequest();
|
||||
|
||||
?><!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var dns_length = <?php echo count(mySfYaml::get('dns.servers')); ?>;
|
||||
</script>
|
||||
<script type="text/javascript" src="/js/bootstrap-modal.js"></script>
|
||||
<script type="text/javascript" src="/js/main.js"></script>
|
||||
<?php XajaxSg::getInstance()->printJavascript(); ?>
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="/css/main.css" />
|
||||
<link rel="shortcut icon" href="/favicon.ico" />
|
||||
<title>DNS Lookup - Deblan.fr</title>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container-fluid">
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<a class="brand" href="/">DNSLookup</a>
|
||||
<div class="nav-collapse">
|
||||
<ul class="nav">
|
||||
<li class="active"><a href="/">Accueil</a></li>
|
||||
<li><a href="http://www.deblan.tv">Blog</a></li>
|
||||
<li><a href="http://www.deblan.tv/contact">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="main" class="container-fluid">
|
||||
<p id="description"><strong>DNSLookup</strong> de Deblan est un service en ligne qui vous permet instantanément d'<strong>effectuer une recherche DNS</strong> pour vérifier l'enregistrement DNS associé à un nom de domaine sur une sélection de serveurs de noms français. Ceci est particulièrement utile pour vérifier l'état actuel de la propagation des DNS après avoir modifié vos zones domaines.</p>
|
||||
|
||||
<div class="row-fluid" id="form">
|
||||
<div class="btn-toolbar">
|
||||
<div>
|
||||
<input type="hidden" name="type" id="type" value="A" />
|
||||
<input type="hidden" name="ipv" id="ipv" value="1" />
|
||||
<input type="text" placeholder="Nom de domaine" id="domain" />
|
||||
|
||||
<button class="btn btn-primary" id="analyse">Analyser</button>
|
||||
<button class="btn btn-primary" id="whois">Whois</button>
|
||||
|
||||
<span class="btn-group" id="selection_types">
|
||||
<?php foreach(mySfYaml::get('dns.types') as $k => $type): ?>
|
||||
<button class="btn <?php echo $k == 0 ? 'btn-primary' : '' ?>" value="<?php echo $type; ?>"><?php echo $type; ?></button>
|
||||
<?php endforeach; ?>
|
||||
</span>
|
||||
|
||||
<span class="btn-group" id="selection_ipv">
|
||||
<button class="btn btn-primary" value="1">IPV4</button>
|
||||
<button class="btn" value="2">IPV6</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="loading" id="loading">
|
||||
<h3>Chargement…</h3>
|
||||
<p>Veuillez patienter pendant que les requêtes DNS se font :)</p>
|
||||
<div class="progress progress-striped active">
|
||||
<div class="bar"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="loading" id="loading2">
|
||||
<h3>Chargement…</h3>
|
||||
<p>Veuillez patienter un instant :)</p>
|
||||
<div class="progress progress-striped active">
|
||||
<div class="bar"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="results"></div>
|
||||
|
||||
<hr />
|
||||
<footer>
|
||||
<p>Service proposé par Simon Vieille - <a href="#about" data-toggle="modal">A propos</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="modal hide" id="about">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h3>Télécharger les sources</h3>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<p><strong>DNSLookup est un programme sous licence <a href="http://fr.wikipedia.org/wiki/Licence_BSD">BSD</a>.</strong>.</p>
|
||||
<p>Le <strong><a href="http://twitter.github.com/bootstrap/index.html">Boostrap Twitter</a></strong> est sous licence <strong><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License v2.0</a></strong>.</p>
|
||||
<p>Les icones sont de <strong><a href="http://glyphicons.com/">Glyphicons Free</a></strong>, sous licence <strong><a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a></strong>.</p>
|
||||
<p><strong>Xajax</strong> est sous licence <strong><a href="http://fr.wikipedia.org/wiki/Licence_BSD">BSD</a></strong>.</p>
|
||||
|
||||
<code>git clone git://git.deblan.org/dns-lookup.git</code>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn" data-dismiss="modal">Fermer</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
218
js/bootstrap-modal.js
vendored
Normal file
|
@ -0,0 +1,218 @@
|
|||
/* =========================================================
|
||||
* bootstrap-modal.js v2.0.4
|
||||
* http://twitter.github.com/bootstrap/javascript.html#modals
|
||||
* =========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================= */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* MODAL CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var Modal = function (content, options) {
|
||||
this.options = options
|
||||
this.$element = $(content)
|
||||
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
||||
}
|
||||
|
||||
Modal.prototype = {
|
||||
|
||||
constructor: Modal
|
||||
|
||||
, toggle: function () {
|
||||
return this[!this.isShown ? 'show' : 'hide']()
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var that = this
|
||||
, e = $.Event('show')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
$('body').addClass('modal-open')
|
||||
|
||||
this.isShown = true
|
||||
|
||||
escape.call(this)
|
||||
backdrop.call(this, function () {
|
||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||
|
||||
if (!that.$element.parent().length) {
|
||||
that.$element.appendTo(document.body) //don't move modals dom position
|
||||
}
|
||||
|
||||
that.$element
|
||||
.show()
|
||||
|
||||
if (transition) {
|
||||
that.$element[0].offsetWidth // force reflow
|
||||
}
|
||||
|
||||
that.$element.addClass('in')
|
||||
|
||||
transition ?
|
||||
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
|
||||
that.$element.trigger('shown')
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
, hide: function (e) {
|
||||
e && e.preventDefault()
|
||||
|
||||
var that = this
|
||||
|
||||
e = $.Event('hide')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (!this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = false
|
||||
|
||||
$('body').removeClass('modal-open')
|
||||
|
||||
escape.call(this)
|
||||
|
||||
this.$element.removeClass('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade') ?
|
||||
hideWithTransition.call(this) :
|
||||
hideModal.call(this)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* MODAL PRIVATE METHODS
|
||||
* ===================== */
|
||||
|
||||
function hideWithTransition() {
|
||||
var that = this
|
||||
, timeout = setTimeout(function () {
|
||||
that.$element.off($.support.transition.end)
|
||||
hideModal.call(that)
|
||||
}, 500)
|
||||
|
||||
this.$element.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
hideModal.call(that)
|
||||
})
|
||||
}
|
||||
|
||||
function hideModal(that) {
|
||||
this.$element
|
||||
.hide()
|
||||
.trigger('hidden')
|
||||
|
||||
backdrop.call(this)
|
||||
}
|
||||
|
||||
function backdrop(callback) {
|
||||
var that = this
|
||||
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||
|
||||
if (this.isShown && this.options.backdrop) {
|
||||
var doAnimate = $.support.transition && animate
|
||||
|
||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||
.appendTo(document.body)
|
||||
|
||||
if (this.options.backdrop != 'static') {
|
||||
this.$backdrop.click($.proxy(this.hide, this))
|
||||
}
|
||||
|
||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||
|
||||
this.$backdrop.addClass('in')
|
||||
|
||||
doAnimate ?
|
||||
this.$backdrop.one($.support.transition.end, callback) :
|
||||
callback()
|
||||
|
||||
} else if (!this.isShown && this.$backdrop) {
|
||||
this.$backdrop.removeClass('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade')?
|
||||
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
|
||||
removeBackdrop.call(this)
|
||||
|
||||
} else if (callback) {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
function removeBackdrop() {
|
||||
this.$backdrop.remove()
|
||||
this.$backdrop = null
|
||||
}
|
||||
|
||||
function escape() {
|
||||
var that = this
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
$(document).on('keyup.dismiss.modal', function ( e ) {
|
||||
e.which == 27 && that.hide()
|
||||
})
|
||||
} else if (!this.isShown) {
|
||||
$(document).off('keyup.dismiss.modal')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* MODAL PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
$.fn.modal = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('modal')
|
||||
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
|
||||
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
else if (options.show) data.show()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.modal.defaults = {
|
||||
backdrop: true
|
||||
, keyboard: true
|
||||
, show: true
|
||||
}
|
||||
|
||||
$.fn.modal.Constructor = Modal
|
||||
|
||||
|
||||
/* MODAL DATA-API
|
||||
* ============== */
|
||||
|
||||
$(function () {
|
||||
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
|
||||
var $this = $(this), href
|
||||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
|
||||
|
||||
e.preventDefault()
|
||||
$target.modal(option)
|
||||
})
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
1737
js/bootstrap.js
vendored
Executable file
7
js/bootstrap.min.js
vendored
Executable file
149
js/main.js
Executable file
|
@ -0,0 +1,149 @@
|
|||
var add_dns_result = function(obj) {
|
||||
if(obj) {
|
||||
var title = obj.title;
|
||||
var logo = '/img/fai/'+obj.logo;
|
||||
|
||||
var html = '<div class="dns_result">';
|
||||
html+= '<h2>'+title+' <img src="'+logo+'" title="'+logo+'" alt="'+logo+'" /></h2>';
|
||||
|
||||
if(!obj.servers.length) {
|
||||
html+= '<div class="alert alert-warning">Echec</div>';
|
||||
}
|
||||
else {
|
||||
html+= '<table class="table table-striped table-bordered table-condensed">';
|
||||
|
||||
$(obj.servers).each(function(i, v) {
|
||||
html+= '<tr>';
|
||||
html+= '<th>'+v.dns+'</th>';
|
||||
|
||||
if(!v.datas) {
|
||||
html+= '<td><i class="icon-exclamation-sign"></i> Aucun réponse</td>';
|
||||
}
|
||||
else {
|
||||
if(v.datas.indexOf('REFUSED') != -1) {
|
||||
v.datas = '<i class="icon-exclamation-sign"></i> '+v.datas;
|
||||
}
|
||||
html+= '<td>'+v.datas+'</td>';
|
||||
}
|
||||
html+= '</tr>';
|
||||
});
|
||||
}
|
||||
|
||||
html+= '</div>';
|
||||
html+= '</div>';
|
||||
|
||||
$('#results').append(html);
|
||||
}
|
||||
}
|
||||
|
||||
var add_whois_result = function(obj) {
|
||||
if(obj) {
|
||||
var title = obj.title;
|
||||
var logo = '/img/fai/'+obj.logo;
|
||||
|
||||
var html = '<div class="dns_result">';
|
||||
html+= '<h2>'+title+'</h2>';
|
||||
|
||||
if(!obj.datas) {
|
||||
html+= '<div class="alert alert-warning">Echec</div>';
|
||||
}
|
||||
else {
|
||||
html+= '<table class="table table-striped table-bordered table-condensed">';
|
||||
|
||||
html+= '<tr>';
|
||||
html+= '<td>'+obj.datas+'</td>';
|
||||
html+= '</tr>';
|
||||
}
|
||||
|
||||
html+= '</div>';
|
||||
html+= '</div>';
|
||||
|
||||
$('#results').append(html);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var init = function(loading2) {
|
||||
if(!loading2) {
|
||||
$('#results').html('');
|
||||
$('#loading .bar').css('width', 0);
|
||||
$('#loading').fadeIn();
|
||||
}
|
||||
else {
|
||||
$('#results').html('');
|
||||
$('#loading2 .bar').css('width', 0);
|
||||
$('#loading2').fadeIn();
|
||||
}
|
||||
}
|
||||
|
||||
var dns_done = 0;
|
||||
var results = null;
|
||||
|
||||
var end = function(loading2) {
|
||||
if(!loading2) {
|
||||
$('#loading').fadeOut();
|
||||
}
|
||||
else {
|
||||
$('#loading2').fadeOut();
|
||||
}
|
||||
}
|
||||
|
||||
var update = function() {
|
||||
dns_done++;
|
||||
|
||||
$('#loading .bar').css('width', (100*dns_done/dns_length)+'%');
|
||||
|
||||
if(dns_done == dns_length) {
|
||||
window.setTimeout(function() {
|
||||
end();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
var analyse = function() {
|
||||
var type = $('#type').val();
|
||||
var ipv = $('#type').val() == 1 ? '4' : '6';
|
||||
var domain = $('#domain').val().replace(/\s*/, '');
|
||||
|
||||
if(!domain) {
|
||||
$('#domain').addClass('input_error');
|
||||
return false;
|
||||
}
|
||||
|
||||
dns_done = 0;
|
||||
init();
|
||||
$('#domain').removeClass('input_error');
|
||||
|
||||
for(var u=0; u<dns_length; u++) {
|
||||
xajax_dns_request(u, domain, type, ipv);
|
||||
};
|
||||
}
|
||||
|
||||
var whois = function() {
|
||||
var domain = $('#domain').val().replace(/\s*/, '');
|
||||
|
||||
if(!domain) {
|
||||
$('#domain').addClass('input_error');
|
||||
return false;
|
||||
}
|
||||
|
||||
init(true);
|
||||
xajax_whois_request(domain);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('#selection_types button').click(function() {
|
||||
$('#type').val($(this).val());
|
||||
$('#selection_types button').removeClass('btn-primary');
|
||||
$(this).addClass('btn-primary');
|
||||
});
|
||||
|
||||
$('#selection_ipv button').click(function() {
|
||||
$('#ipv').val($(this).val());
|
||||
$('#selection_ipv button').removeClass('btn-primary');
|
||||
$(this).addClass('btn-primary');
|
||||
});
|
||||
|
||||
$('#analyse').bind('click', analyse);
|
||||
$('#whois').bind('click', whois);
|
||||
});
|
15
lib/bootstrap.php
Executable file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
define('ROOT', dirname(__FILE__).DIRECTORY_SEPARATOR.'..');
|
||||
|
||||
require ROOT.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'sfYaml'.DIRECTORY_SEPARATOR.'sfYamlInline.class.php';
|
||||
require ROOT.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'sfYaml'.DIRECTORY_SEPARATOR.'sfYamlParser.class.php';
|
||||
require ROOT.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'sfYaml'.DIRECTORY_SEPARATOR.'sfYaml.class.php';
|
||||
require ROOT.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'sfYaml'.DIRECTORY_SEPARATOR.'mySfYaml.class.php';
|
||||
require ROOT.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'xajax'.DIRECTORY_SEPARATOR.'xajax_core'.DIRECTORY_SEPARATOR.'xajax.inc.php';
|
||||
require ROOT.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'xajax'.DIRECTORY_SEPARATOR.'XajaxSg.class.php';
|
||||
require ROOT.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'functions.php';
|
||||
|
||||
mySfYaml::merge(ROOT.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'dns.yml');
|
77
lib/functions.php
Executable file
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
function dns_request($dns_server_index, $domain, $type, $ipv) {
|
||||
$objResponse = new xajaxResponse();
|
||||
$dns_servers = mySfYaml::get('dns.servers');
|
||||
$keys = array_keys($dns_servers);
|
||||
$dns_server = $dns_servers[$keys[$dns_server_index]];
|
||||
$servers = array();
|
||||
|
||||
$ipv = in_array($ipv, array('4', '6')) ? $ipv : '4';
|
||||
$type = in_array($type, mySfYaml::get('dns.types')) ? $type : 'A';
|
||||
$domain = escapeshellarg($domain);
|
||||
|
||||
foreach($dns_server['servers'] as $dns) {
|
||||
$command = 'host -W 2 -t '.$type.' -'.$ipv.' '.$domain.' '.escapeshellarg($dns);
|
||||
$hosts = shell_exec($command);
|
||||
|
||||
if($hosts) {
|
||||
$lines = explode("\n", $hosts);
|
||||
$empty = false;
|
||||
|
||||
foreach($lines as $k => $v) {
|
||||
if(!$empty) {
|
||||
if(trim($v) == "") {
|
||||
unset($lines[$k]);
|
||||
$empty = true;
|
||||
}
|
||||
else {
|
||||
unset($lines[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
if(trim($v) == "") {
|
||||
unset($lines[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
$servers[] = array(
|
||||
'dns' => $dns,
|
||||
'datas' => nl2br(htmlentities(implode("\n", $lines)))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$datas = array(
|
||||
'title' => $dns_server['title'],
|
||||
'logo' => $dns_server['logo'],
|
||||
'servers' => $servers
|
||||
);
|
||||
|
||||
$json_datas = json_encode($datas);
|
||||
|
||||
$objResponse->script('add_dns_result('.$json_datas.');');
|
||||
$objResponse->script("update();");
|
||||
|
||||
return $objResponse;
|
||||
}
|
||||
|
||||
function whois_request($domain) {
|
||||
$objResponse = new xajaxResponse();
|
||||
$domain = escapeshellarg($domain);
|
||||
$command = 'whois '.$domain;
|
||||
$whois = shell_exec($command);
|
||||
|
||||
$json_datas = json_encode(array(
|
||||
'title' => 'Whois de '.htmlentities(str_replace("'", '', $domain)),
|
||||
'datas' => implode('<br />', explode("\n", $whois))
|
||||
));
|
||||
|
||||
$objResponse->script('add_whois_result('.$json_datas.');');
|
||||
$objResponse->script("end(true);");
|
||||
return $objResponse;
|
||||
|
||||
}
|
||||
|
||||
XajaxSg::getInstance()->registerFunction('dns_request');
|
||||
XajaxSg::getInstance()->registerFunction('whois_request');
|
79
lib/sfYaml/mySfYaml.class.php
Executable file
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
|
||||
class mySfYaml extends sfYaml {
|
||||
private static $file_loaded = false;
|
||||
private static $global_config = null;
|
||||
|
||||
public static function load($input) {
|
||||
self::$global_config = parent::load($input);
|
||||
self::$file_loaded = true;
|
||||
return self::$global_config;
|
||||
}
|
||||
|
||||
public static function merge($input) {
|
||||
if(!self::$file_loaded) {
|
||||
return self::load($input);
|
||||
}
|
||||
|
||||
$config = sfYaml::load($input);
|
||||
|
||||
if($config) {
|
||||
self::recursiveMerge(self::$global_config, $config);
|
||||
}
|
||||
|
||||
return self::$global_config;
|
||||
}
|
||||
|
||||
private static function recursiveMerge(&$global_config, $config) {
|
||||
foreach($config as $key => $value) {
|
||||
if(!isset($global_config[$key])) {
|
||||
$global_config[$key] = $value;
|
||||
}
|
||||
else {
|
||||
if(is_array($value)) {
|
||||
foreach($value as $vkey => $vvalue) {
|
||||
if(!isset($global_config[$key][$vkey])) {
|
||||
$global_config[$key][$vkey] = $vvalue;
|
||||
}
|
||||
else {
|
||||
self::recursiveMerge($global_config[$key], $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$global_config[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function getAll() {
|
||||
return self::$global_config;
|
||||
}
|
||||
|
||||
public static function get($var) {
|
||||
if(!self::$file_loaded) {
|
||||
throw new Exception('Yaml file is not loaded yet, please see sfYaml::load method');
|
||||
}
|
||||
|
||||
$road = self::$global_config;
|
||||
|
||||
$parts = explode('.', $var);
|
||||
|
||||
while(true) {
|
||||
$shift = array_shift($parts);
|
||||
|
||||
if(isset($road[$shift])) {
|
||||
if(empty($parts)) {
|
||||
return $road[$shift];
|
||||
}
|
||||
else {
|
||||
$road = $road[$shift];
|
||||
}
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
133
lib/sfYaml/sfYaml.class.php
Executable file
|
@ -0,0 +1,133 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the symfony package.
|
||||
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* sfYaml offers convenience methods to load and dump YAML.
|
||||
*
|
||||
* @package symfony
|
||||
* @subpackage yaml
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
* @version SVN: $Id: sfYaml.class.php 8988 2008-05-15 20:24:26Z fabien $
|
||||
*/
|
||||
class sfYaml
|
||||
{
|
||||
static protected
|
||||
$spec = '1.2';
|
||||
|
||||
/**
|
||||
* Sets the YAML specification version to use.
|
||||
*
|
||||
* @param string $version The YAML specification version
|
||||
*/
|
||||
static public function setSpecVersion($version)
|
||||
{
|
||||
if (!in_array($version, array('1.1', '1.2')))
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf('Version %s of the YAML specifications is not supported', $version));
|
||||
}
|
||||
|
||||
self::$spec = $version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the YAML specification version to use.
|
||||
*
|
||||
* @return string The YAML specification version
|
||||
*/
|
||||
static public function getSpecVersion()
|
||||
{
|
||||
return self::$spec;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads YAML into a PHP array.
|
||||
*
|
||||
* The load method, when supplied with a YAML stream (string or file),
|
||||
* will do its best to convert YAML in a file into a PHP array.
|
||||
*
|
||||
* Usage:
|
||||
* <code>
|
||||
* $array = sfYaml::load('config.yml');
|
||||
* print_r($array);
|
||||
* </code>
|
||||
*
|
||||
* @param string $input Path of YAML file or string containing YAML
|
||||
*
|
||||
* @return array The YAML converted to a PHP array
|
||||
*
|
||||
* @throws InvalidArgumentException If the YAML is not valid
|
||||
*/
|
||||
public static function load($input)
|
||||
{
|
||||
$file = '';
|
||||
|
||||
// if input is a file, process it
|
||||
if (strpos($input, "\n") === false && is_file($input))
|
||||
{
|
||||
$file = $input;
|
||||
|
||||
ob_start();
|
||||
$retval = include($input);
|
||||
$content = ob_get_clean();
|
||||
|
||||
// if an array is returned by the config file assume it's in plain php form else in YAML
|
||||
$input = is_array($retval) ? $retval : $content;
|
||||
}
|
||||
|
||||
// if an array is returned by the config file assume it's in plain php form else in YAML
|
||||
if (is_array($input))
|
||||
{
|
||||
return $input;
|
||||
}
|
||||
|
||||
$yaml = new sfYamlParser();
|
||||
|
||||
try
|
||||
{
|
||||
$ret = $yaml->parse($input);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf('Unable to parse %s: %s', $file ? sprintf('file "%s"', $file) : 'string', $e->getMessage()));
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps a PHP array to a YAML string.
|
||||
*
|
||||
* The dump method, when supplied with an array, will do its best
|
||||
* to convert the array into friendly YAML.
|
||||
*
|
||||
* @param array $array PHP array
|
||||
* @param integer $inline The level where you switch to inline YAML
|
||||
*
|
||||
* @return string A YAML string representing the original PHP array
|
||||
*/
|
||||
public static function dump($array, $inline = 2)
|
||||
{
|
||||
require_once dirname(__FILE__).'/sfYamlDumper.php';
|
||||
|
||||
$yaml = new sfYamlDumper();
|
||||
|
||||
return $yaml->dump($array, $inline);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps echo to automatically provide a newline.
|
||||
*
|
||||
* @param string $string The string to echo with new line
|
||||
*/
|
||||
function echoln($string)
|
||||
{
|
||||
echo $string."\n";
|
||||
}
|
58
lib/sfYaml/sfYamlDumper.class.php
Executable file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the symfony package.
|
||||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* sfYamlDumper dumps PHP variables to YAML strings.
|
||||
*
|
||||
* @package symfony
|
||||
* @subpackage yaml
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
* @version SVN: $Id: sfYamlDumper.class.php 10575 2008-08-01 13:08:42Z nicolas $
|
||||
*/
|
||||
class sfYamlDumper
|
||||
{
|
||||
/**
|
||||
* Dumps a PHP value to YAML.
|
||||
*
|
||||
* @param mixed $input The PHP value
|
||||
* @param integer $inline The level where you switch to inline YAML
|
||||
* @param integer $indent The level o indentation indentation (used internally)
|
||||
*
|
||||
* @return string The YAML representation of the PHP value
|
||||
*/
|
||||
public function dump($input, $inline = 0, $indent = 0)
|
||||
{
|
||||
$output = '';
|
||||
$prefix = $indent ? str_repeat(' ', $indent) : '';
|
||||
|
||||
if ($inline <= 0 || !is_array($input) || empty($input))
|
||||
{
|
||||
$output .= $prefix.sfYamlInline::dump($input);
|
||||
}
|
||||
else
|
||||
{
|
||||
$isAHash = array_keys($input) !== range(0, count($input) - 1);
|
||||
|
||||
foreach ($input as $key => $value)
|
||||
{
|
||||
$willBeInlined = $inline - 1 <= 0 || !is_array($value) || empty($value);
|
||||
|
||||
$output .= sprintf('%s%s%s%s',
|
||||
$prefix,
|
||||
$isAHash ? sfYamlInline::dump($key).':' : '-',
|
||||
$willBeInlined ? ' ' : "\n",
|
||||
$this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + 2)
|
||||
).($willBeInlined ? "\n" : '');
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
440
lib/sfYaml/sfYamlInline.class.php
Executable file
|
@ -0,0 +1,440 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the symfony package.
|
||||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* sfYamlInline implements a YAML parser/dumper for the YAML inline syntax.
|
||||
*
|
||||
* @package symfony
|
||||
* @subpackage yaml
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
* @version SVN: $Id: sfYamlInline.class.php 16177 2009-03-11 08:32:48Z fabien $
|
||||
*/
|
||||
class sfYamlInline
|
||||
{
|
||||
const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\']*(?:\'\'[^\']*)*)\')';
|
||||
|
||||
/**
|
||||
* Convert a YAML string to a PHP array.
|
||||
*
|
||||
* @param string $value A YAML string
|
||||
*
|
||||
* @return array A PHP array representing the YAML string
|
||||
*/
|
||||
static public function load($value)
|
||||
{
|
||||
$value = trim($value);
|
||||
|
||||
if (0 == strlen($value))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2)
|
||||
{
|
||||
$mbEncoding = mb_internal_encoding();
|
||||
mb_internal_encoding('ASCII');
|
||||
}
|
||||
|
||||
switch ($value[0])
|
||||
{
|
||||
case '[':
|
||||
$result = self::parseSequence($value);
|
||||
break;
|
||||
case '{':
|
||||
$result = self::parseMapping($value);
|
||||
break;
|
||||
default:
|
||||
$result = self::parseScalar($value);
|
||||
}
|
||||
|
||||
if (isset($mbEncoding))
|
||||
{
|
||||
mb_internal_encoding($mbEncoding);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps a given PHP variable to a YAML string.
|
||||
*
|
||||
* @param mixed $value The PHP variable to convert
|
||||
*
|
||||
* @return string The YAML string representing the PHP array
|
||||
*/
|
||||
static public function dump($value)
|
||||
{
|
||||
if ('1.1' === sfYaml::getSpecVersion())
|
||||
{
|
||||
$trueValues = array('true', 'on', '+', 'yes', 'y');
|
||||
$falseValues = array('false', 'off', '-', 'no', 'n');
|
||||
}
|
||||
else
|
||||
{
|
||||
$trueValues = array('true');
|
||||
$falseValues = array('false');
|
||||
}
|
||||
|
||||
switch (true)
|
||||
{
|
||||
case is_resource($value):
|
||||
throw new InvalidArgumentException('Unable to dump PHP resources in a YAML file.');
|
||||
case is_object($value):
|
||||
return '!!php/object:'.serialize($value);
|
||||
case is_array($value):
|
||||
return self::dumpArray($value);
|
||||
case null === $value:
|
||||
return 'null';
|
||||
case true === $value:
|
||||
return 'true';
|
||||
case false === $value:
|
||||
return 'false';
|
||||
case ctype_digit($value):
|
||||
return is_string($value) ? "'$value'" : (int) $value;
|
||||
case is_numeric($value):
|
||||
return is_infinite($value) ? str_ireplace('INF', '.Inf', strval($value)) : (is_string($value) ? "'$value'" : $value);
|
||||
case false !== strpos($value, "\n") || false !== strpos($value, "\r"):
|
||||
return sprintf('"%s"', str_replace(array('"', "\n", "\r"), array('\\"', '\n', '\r'), $value));
|
||||
case preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ - ? | < > = ! % @ ` ]/x', $value):
|
||||
return sprintf("'%s'", str_replace('\'', '\'\'', $value));
|
||||
case '' == $value:
|
||||
return "''";
|
||||
case preg_match(self::getTimestampRegex(), $value):
|
||||
return "'$value'";
|
||||
case in_array(strtolower($value), $trueValues):
|
||||
return "'$value'";
|
||||
case in_array(strtolower($value), $falseValues):
|
||||
return "'$value'";
|
||||
case in_array(strtolower($value), array('null', '~')):
|
||||
return "'$value'";
|
||||
default:
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps a PHP array to a YAML string.
|
||||
*
|
||||
* @param array $value The PHP array to dump
|
||||
*
|
||||
* @return string The YAML string representing the PHP array
|
||||
*/
|
||||
static protected function dumpArray($value)
|
||||
{
|
||||
// array
|
||||
$keys = array_keys($value);
|
||||
if (
|
||||
(1 == count($keys) && '0' == $keys[0])
|
||||
||
|
||||
(count($keys) > 1 && array_reduce($keys, create_function('$v,$w', 'return (integer) $v + $w;'), 0) == count($keys) * (count($keys) - 1) / 2))
|
||||
{
|
||||
$output = array();
|
||||
foreach ($value as $val)
|
||||
{
|
||||
$output[] = self::dump($val);
|
||||
}
|
||||
|
||||
return sprintf('[%s]', implode(', ', $output));
|
||||
}
|
||||
|
||||
// mapping
|
||||
$output = array();
|
||||
foreach ($value as $key => $val)
|
||||
{
|
||||
$output[] = sprintf('%s: %s', self::dump($key), self::dump($val));
|
||||
}
|
||||
|
||||
return sprintf('{ %s }', implode(', ', $output));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a scalar to a YAML string.
|
||||
*
|
||||
* @param scalar $scalar
|
||||
* @param string $delimiters
|
||||
* @param array $stringDelimiter
|
||||
* @param integer $i
|
||||
* @param boolean $evaluate
|
||||
*
|
||||
* @return string A YAML string
|
||||
*/
|
||||
static public function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true)
|
||||
{
|
||||
if (in_array($scalar[$i], $stringDelimiters))
|
||||
{
|
||||
// quoted scalar
|
||||
$output = self::parseQuotedScalar($scalar, $i);
|
||||
}
|
||||
else
|
||||
{
|
||||
// "normal" string
|
||||
if (!$delimiters)
|
||||
{
|
||||
$output = substr($scalar, $i);
|
||||
$i += strlen($output);
|
||||
|
||||
// remove comments
|
||||
if (false !== $strpos = strpos($output, ' #'))
|
||||
{
|
||||
$output = rtrim(substr($output, 0, $strpos));
|
||||
}
|
||||
}
|
||||
else if (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match))
|
||||
{
|
||||
$output = $match[1];
|
||||
$i += strlen($output);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf('Malformed inline YAML string (%s).', $scalar));
|
||||
}
|
||||
|
||||
$output = $evaluate ? self::evaluateScalar($output) : $output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a quoted scalar to YAML.
|
||||
*
|
||||
* @param string $scalar
|
||||
* @param integer $i
|
||||
*
|
||||
* @return string A YAML string
|
||||
*/
|
||||
static protected function parseQuotedScalar($scalar, &$i)
|
||||
{
|
||||
if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match))
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i)));
|
||||
}
|
||||
|
||||
$output = substr($match[0], 1, strlen($match[0]) - 2);
|
||||
|
||||
if ('"' == $scalar[$i])
|
||||
{
|
||||
// evaluate the string
|
||||
$output = str_replace(array('\\"', '\\n', '\\r'), array('"', "\n", "\r"), $output);
|
||||
}
|
||||
else
|
||||
{
|
||||
// unescape '
|
||||
$output = str_replace('\'\'', '\'', $output);
|
||||
}
|
||||
|
||||
$i += strlen($match[0]);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a sequence to a YAML string.
|
||||
*
|
||||
* @param string $sequence
|
||||
* @param integer $i
|
||||
*
|
||||
* @return string A YAML string
|
||||
*/
|
||||
static protected function parseSequence($sequence, &$i = 0)
|
||||
{
|
||||
$output = array();
|
||||
$len = strlen($sequence);
|
||||
$i += 1;
|
||||
|
||||
// [foo, bar, ...]
|
||||
while ($i < $len)
|
||||
{
|
||||
switch ($sequence[$i])
|
||||
{
|
||||
case '[':
|
||||
// nested sequence
|
||||
$output[] = self::parseSequence($sequence, $i);
|
||||
break;
|
||||
case '{':
|
||||
// nested mapping
|
||||
$output[] = self::parseMapping($sequence, $i);
|
||||
break;
|
||||
case ']':
|
||||
return $output;
|
||||
case ',':
|
||||
case ' ':
|
||||
break;
|
||||
default:
|
||||
$isQuoted = in_array($sequence[$i], array('"', "'"));
|
||||
$value = self::parseScalar($sequence, array(',', ']'), array('"', "'"), $i);
|
||||
|
||||
if (!$isQuoted && false !== strpos($value, ': '))
|
||||
{
|
||||
// embedded mapping?
|
||||
try
|
||||
{
|
||||
$value = self::parseMapping('{'.$value.'}');
|
||||
}
|
||||
catch (InvalidArgumentException $e)
|
||||
{
|
||||
// no, it's not
|
||||
}
|
||||
}
|
||||
|
||||
$output[] = $value;
|
||||
|
||||
--$i;
|
||||
}
|
||||
|
||||
++$i;
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException(sprintf('Malformed inline YAML string %s', $sequence));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a mapping to a YAML string.
|
||||
*
|
||||
* @param string $mapping
|
||||
* @param integer $i
|
||||
*
|
||||
* @return string A YAML string
|
||||
*/
|
||||
static protected function parseMapping($mapping, &$i = 0)
|
||||
{
|
||||
$output = array();
|
||||
$len = strlen($mapping);
|
||||
$i += 1;
|
||||
|
||||
// {foo: bar, bar:foo, ...}
|
||||
while ($i < $len)
|
||||
{
|
||||
switch ($mapping[$i])
|
||||
{
|
||||
case ' ':
|
||||
case ',':
|
||||
++$i;
|
||||
continue 2;
|
||||
case '}':
|
||||
return $output;
|
||||
}
|
||||
|
||||
// key
|
||||
$key = self::parseScalar($mapping, array(':', ' '), array('"', "'"), $i, false);
|
||||
|
||||
// value
|
||||
$done = false;
|
||||
while ($i < $len)
|
||||
{
|
||||
switch ($mapping[$i])
|
||||
{
|
||||
case '[':
|
||||
// nested sequence
|
||||
$output[$key] = self::parseSequence($mapping, $i);
|
||||
$done = true;
|
||||
break;
|
||||
case '{':
|
||||
// nested mapping
|
||||
$output[$key] = self::parseMapping($mapping, $i);
|
||||
$done = true;
|
||||
break;
|
||||
case ':':
|
||||
case ' ':
|
||||
break;
|
||||
default:
|
||||
$output[$key] = self::parseScalar($mapping, array(',', '}'), array('"', "'"), $i);
|
||||
$done = true;
|
||||
--$i;
|
||||
}
|
||||
|
||||
++$i;
|
||||
|
||||
if ($done)
|
||||
{
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException(sprintf('Malformed inline YAML string %s', $mapping));
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates scalars and replaces magic values.
|
||||
*
|
||||
* @param string $scalar
|
||||
*
|
||||
* @return string A YAML string
|
||||
*/
|
||||
static protected function evaluateScalar($scalar)
|
||||
{
|
||||
$scalar = trim($scalar);
|
||||
|
||||
if ('1.1' === sfYaml::getSpecVersion())
|
||||
{
|
||||
$trueValues = array('true', 'on', '+', 'yes', 'y');
|
||||
$falseValues = array('false', 'off', '-', 'no', 'n');
|
||||
}
|
||||
else
|
||||
{
|
||||
$trueValues = array('true');
|
||||
$falseValues = array('false');
|
||||
}
|
||||
|
||||
switch (true)
|
||||
{
|
||||
case 'null' == strtolower($scalar):
|
||||
case '' == $scalar:
|
||||
case '~' == $scalar:
|
||||
return null;
|
||||
case 0 === strpos($scalar, '!str'):
|
||||
return (string) substr($scalar, 5);
|
||||
case 0 === strpos($scalar, '! '):
|
||||
return intval(self::parseScalar(substr($scalar, 2)));
|
||||
case 0 === strpos($scalar, '!!php/object:'):
|
||||
return unserialize(substr($scalar, 13));
|
||||
case ctype_digit($scalar):
|
||||
$raw = $scalar;
|
||||
$cast = intval($scalar);
|
||||
return '0' == $scalar[0] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw);
|
||||
case in_array(strtolower($scalar), $trueValues):
|
||||
return true;
|
||||
case in_array(strtolower($scalar), $falseValues):
|
||||
return false;
|
||||
case is_numeric($scalar):
|
||||
return '0x' == $scalar[0].$scalar[1] ? hexdec($scalar) : floatval($scalar);
|
||||
case 0 == strcasecmp($scalar, '.inf'):
|
||||
case 0 == strcasecmp($scalar, '.NaN'):
|
||||
return -log(0);
|
||||
case 0 == strcasecmp($scalar, '-.inf'):
|
||||
return log(0);
|
||||
case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar):
|
||||
return floatval(str_replace(',', '', $scalar));
|
||||
case preg_match(self::getTimestampRegex(), $scalar):
|
||||
return strtotime($scalar);
|
||||
default:
|
||||
return (string) $scalar;
|
||||
}
|
||||
}
|
||||
|
||||
static protected function getTimestampRegex()
|
||||
{
|
||||
return <<<EOF
|
||||
~^
|
||||
(?P<year>[0-9][0-9][0-9][0-9])
|
||||
-(?P<month>[0-9][0-9]?)
|
||||
-(?P<day>[0-9][0-9]?)
|
||||
(?:(?:[Tt]|[ \t]+)
|
||||
(?P<hour>[0-9][0-9]?)
|
||||
:(?P<minute>[0-9][0-9])
|
||||
:(?P<second>[0-9][0-9])
|
||||
(?:\.(?P<fraction>[0-9]*))?
|
||||
(?:[ \t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?)
|
||||
(?::(?P<tz_minute>[0-9][0-9]))?))?)?
|
||||
$~x
|
||||
EOF;
|
||||
}
|
||||
}
|
620
lib/sfYaml/sfYamlParser.class.php
Executable file
|
@ -0,0 +1,620 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the symfony package.
|
||||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if (!defined('PREG_BAD_UTF8_OFFSET_ERROR'))
|
||||
{
|
||||
define('PREG_BAD_UTF8_OFFSET_ERROR', 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* sfYamlParser parses YAML strings to convert them to PHP arrays.
|
||||
*
|
||||
* @package symfony
|
||||
* @subpackage yaml
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
* @version SVN: $Id: sfYamlParser.class.php 10832 2008-08-13 07:46:08Z fabien $
|
||||
*/
|
||||
class sfYamlParser
|
||||
{
|
||||
protected
|
||||
$offset = 0,
|
||||
$lines = array(),
|
||||
$currentLineNb = -1,
|
||||
$currentLine = '',
|
||||
$refs = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param integer $offset The offset of YAML document (used for line numbers in error messages)
|
||||
*/
|
||||
public function __construct($offset = 0)
|
||||
{
|
||||
$this->offset = $offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a YAML string to a PHP value.
|
||||
*
|
||||
* @param string $value A YAML string
|
||||
*
|
||||
* @return mixed A PHP value
|
||||
*
|
||||
* @throws InvalidArgumentException If the YAML is not valid
|
||||
*/
|
||||
public function parse($value)
|
||||
{
|
||||
$this->currentLineNb = -1;
|
||||
$this->currentLine = '';
|
||||
$this->lines = explode("\n", $this->cleanup($value));
|
||||
|
||||
if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2)
|
||||
{
|
||||
$mbEncoding = mb_internal_encoding();
|
||||
mb_internal_encoding('UTF-8');
|
||||
}
|
||||
|
||||
$data = array();
|
||||
while ($this->moveToNextLine())
|
||||
{
|
||||
if ($this->isCurrentLineEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// tab?
|
||||
if (preg_match('#^\t+#', $this->currentLine))
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf('A YAML file cannot contain tabs as indentation at line %d (%s).', $this->getRealCurrentLineNb() + 1, $this->currentLine));
|
||||
}
|
||||
|
||||
$isRef = $isInPlace = $isProcessed = false;
|
||||
if (preg_match('#^\-((?P<leadspaces>\s+)(?P<value>.+?))?\s*$#u', $this->currentLine, $values))
|
||||
{
|
||||
if (isset($values['value']) && preg_match('#^&(?P<ref>[^ ]+) *(?P<value>.*)#u', $values['value'], $matches))
|
||||
{
|
||||
$isRef = $matches['ref'];
|
||||
$values['value'] = $matches['value'];
|
||||
}
|
||||
|
||||
// array
|
||||
if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#'))
|
||||
{
|
||||
$c = $this->getRealCurrentLineNb() + 1;
|
||||
$parser = new sfYamlParser($c);
|
||||
$parser->refs =& $this->refs;
|
||||
$data[] = $parser->parse($this->getNextEmbedBlock());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($values['leadspaces'])
|
||||
&& ' ' == $values['leadspaces']
|
||||
&& preg_match('#^(?P<key>'.sfYamlInline::REGEX_QUOTED_STRING.'|[^ \'"\{].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $values['value'], $matches))
|
||||
{
|
||||
// this is a compact notation element, add to next block and parse
|
||||
$c = $this->getRealCurrentLineNb();
|
||||
$parser = new sfYamlParser($c);
|
||||
$parser->refs =& $this->refs;
|
||||
|
||||
$block = $values['value'];
|
||||
if (!$this->isNextLineIndented())
|
||||
{
|
||||
$block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + 2);
|
||||
}
|
||||
|
||||
$data[] = $parser->parse($block);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data[] = $this->parseValue($values['value']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (preg_match('#^(?P<key>'.sfYamlInline::REGEX_QUOTED_STRING.'|[^ \'"].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->currentLine, $values))
|
||||
{
|
||||
$key = sfYamlInline::parseScalar($values['key']);
|
||||
|
||||
if ('<<' === $key)
|
||||
{
|
||||
if (isset($values['value']) && '*' === substr($values['value'], 0, 1))
|
||||
{
|
||||
$isInPlace = substr($values['value'], 1);
|
||||
if (!array_key_exists($isInPlace, $this->refs))
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf('Reference "%s" does not exist at line %s (%s).', $isInPlace, $this->getRealCurrentLineNb() + 1, $this->currentLine));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($values['value']) && $values['value'] !== '')
|
||||
{
|
||||
$value = $values['value'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = $this->getNextEmbedBlock();
|
||||
}
|
||||
$c = $this->getRealCurrentLineNb() + 1;
|
||||
$parser = new sfYamlParser($c);
|
||||
$parser->refs =& $this->refs;
|
||||
$parsed = $parser->parse($value);
|
||||
|
||||
$merged = array();
|
||||
if (!is_array($parsed))
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf("YAML merge keys used with a scalar value instead of an array at line %s (%s)", $this->getRealCurrentLineNb() + 1, $this->currentLine));
|
||||
}
|
||||
else if (isset($parsed[0]))
|
||||
{
|
||||
// Numeric array, merge individual elements
|
||||
foreach (array_reverse($parsed) as $parsedItem)
|
||||
{
|
||||
if (!is_array($parsedItem))
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf("Merge items must be arrays at line %s (%s).", $this->getRealCurrentLineNb() + 1, $parsedItem));
|
||||
}
|
||||
$merged = array_merge($parsedItem, $merged);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Associative array, merge
|
||||
$merged = array_merge($merged, $parsed);
|
||||
}
|
||||
|
||||
$isProcessed = $merged;
|
||||
}
|
||||
}
|
||||
else if (isset($values['value']) && preg_match('#^&(?P<ref>[^ ]+) *(?P<value>.*)#u', $values['value'], $matches))
|
||||
{
|
||||
$isRef = $matches['ref'];
|
||||
$values['value'] = $matches['value'];
|
||||
}
|
||||
|
||||
if ($isProcessed)
|
||||
{
|
||||
// Merge keys
|
||||
$data = $isProcessed;
|
||||
}
|
||||
// hash
|
||||
else if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#'))
|
||||
{
|
||||
// if next line is less indented or equal, then it means that the current value is null
|
||||
if ($this->isNextLineIndented())
|
||||
{
|
||||
$data[$key] = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$c = $this->getRealCurrentLineNb() + 1;
|
||||
$parser = new sfYamlParser($c);
|
||||
$parser->refs =& $this->refs;
|
||||
$data[$key] = $parser->parse($this->getNextEmbedBlock());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($isInPlace)
|
||||
{
|
||||
$data = $this->refs[$isInPlace];
|
||||
}
|
||||
else
|
||||
{
|
||||
$data[$key] = $this->parseValue($values['value']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 1-liner followed by newline
|
||||
if (2 == count($this->lines) && empty($this->lines[1]))
|
||||
{
|
||||
$value = sfYamlInline::load($this->lines[0]);
|
||||
if (is_array($value))
|
||||
{
|
||||
$first = reset($value);
|
||||
if ('*' === substr($first, 0, 1))
|
||||
{
|
||||
$data = array();
|
||||
foreach ($value as $alias)
|
||||
{
|
||||
$data[] = $this->refs[substr($alias, 1)];
|
||||
}
|
||||
$value = $data;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($mbEncoding))
|
||||
{
|
||||
mb_internal_encoding($mbEncoding);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
switch (preg_last_error())
|
||||
{
|
||||
case PREG_INTERNAL_ERROR:
|
||||
$error = 'Internal PCRE error on line';
|
||||
break;
|
||||
case PREG_BACKTRACK_LIMIT_ERROR:
|
||||
$error = 'pcre.backtrack_limit reached on line';
|
||||
break;
|
||||
case PREG_RECURSION_LIMIT_ERROR:
|
||||
$error = 'pcre.recursion_limit reached on line';
|
||||
break;
|
||||
case PREG_BAD_UTF8_ERROR:
|
||||
$error = 'Malformed UTF-8 data on line';
|
||||
break;
|
||||
case PREG_BAD_UTF8_OFFSET_ERROR:
|
||||
$error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point on line';
|
||||
break;
|
||||
default:
|
||||
$error = 'Unable to parse line';
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException(sprintf('%s %d (%s).', $error, $this->getRealCurrentLineNb() + 1, $this->currentLine));
|
||||
}
|
||||
|
||||
if ($isRef)
|
||||
{
|
||||
$this->refs[$isRef] = end($data);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($mbEncoding))
|
||||
{
|
||||
mb_internal_encoding($mbEncoding);
|
||||
}
|
||||
|
||||
return empty($data) ? null : $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current line number (takes the offset into account).
|
||||
*
|
||||
* @return integer The current line number
|
||||
*/
|
||||
protected function getRealCurrentLineNb()
|
||||
{
|
||||
return $this->currentLineNb + $this->offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current line indentation.
|
||||
*
|
||||
* @return integer The current line indentation
|
||||
*/
|
||||
protected function getCurrentLineIndentation()
|
||||
{
|
||||
return strlen($this->currentLine) - strlen(ltrim($this->currentLine, ' '));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next embed block of YAML.
|
||||
*
|
||||
* @param integer $indentation The indent level at which the block is to be read, or null for default
|
||||
*
|
||||
* @return string A YAML string
|
||||
*/
|
||||
protected function getNextEmbedBlock($indentation = null)
|
||||
{
|
||||
$this->moveToNextLine();
|
||||
|
||||
if (null === $indentation)
|
||||
{
|
||||
$newIndent = $this->getCurrentLineIndentation();
|
||||
|
||||
if (!$this->isCurrentLineEmpty() && 0 == $newIndent)
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf('Indentation problem at line %d (%s)', $this->getRealCurrentLineNb() + 1, $this->currentLine));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$newIndent = $indentation;
|
||||
}
|
||||
|
||||
$data = array(substr($this->currentLine, $newIndent));
|
||||
|
||||
while ($this->moveToNextLine())
|
||||
{
|
||||
if ($this->isCurrentLineEmpty())
|
||||
{
|
||||
if ($this->isCurrentLineBlank())
|
||||
{
|
||||
$data[] = substr($this->currentLine, $newIndent);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$indent = $this->getCurrentLineIndentation();
|
||||
|
||||
if (preg_match('#^(?P<text> *)$#', $this->currentLine, $match))
|
||||
{
|
||||
// empty line
|
||||
$data[] = $match['text'];
|
||||
}
|
||||
else if ($indent >= $newIndent)
|
||||
{
|
||||
$data[] = substr($this->currentLine, $newIndent);
|
||||
}
|
||||
else if (0 == $indent)
|
||||
{
|
||||
$this->moveToPreviousLine();
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf('Indentation problem at line %d (%s)', $this->getRealCurrentLineNb() + 1, $this->currentLine));
|
||||
}
|
||||
}
|
||||
|
||||
return implode("\n", $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the parser to the next line.
|
||||
*/
|
||||
protected function moveToNextLine()
|
||||
{
|
||||
if ($this->currentLineNb >= count($this->lines) - 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->currentLine = $this->lines[++$this->currentLineNb];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the parser to the previous line.
|
||||
*/
|
||||
protected function moveToPreviousLine()
|
||||
{
|
||||
$this->currentLine = $this->lines[--$this->currentLineNb];
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a YAML value.
|
||||
*
|
||||
* @param string $value A YAML value
|
||||
*
|
||||
* @return mixed A PHP value
|
||||
*/
|
||||
protected function parseValue($value)
|
||||
{
|
||||
if ('*' === substr($value, 0, 1))
|
||||
{
|
||||
if (false !== $pos = strpos($value, '#'))
|
||||
{
|
||||
$value = substr($value, 1, $pos - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = substr($value, 1);
|
||||
}
|
||||
|
||||
if (!array_key_exists($value, $this->refs))
|
||||
{
|
||||
throw new InvalidArgumentException(sprintf('Reference "%s" does not exist (%s).', $value, $this->currentLine));
|
||||
}
|
||||
return $this->refs[$value];
|
||||
}
|
||||
|
||||
if (preg_match('/^(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?$/', $value, $matches))
|
||||
{
|
||||
$modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : '';
|
||||
|
||||
return $this->parseFoldedScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), intval(abs($modifiers)));
|
||||
}
|
||||
else
|
||||
{
|
||||
return sfYamlInline::load($value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a folded scalar.
|
||||
*
|
||||
* @param string $separator The separator that was used to begin this folded scalar (| or >)
|
||||
* @param string $indicator The indicator that was used to begin this folded scalar (+ or -)
|
||||
* @param integer $indentation The indentation that was used to begin this folded scalar
|
||||
*
|
||||
* @return string The text value
|
||||
*/
|
||||
protected function parseFoldedScalar($separator, $indicator = '', $indentation = 0)
|
||||
{
|
||||
$separator = '|' == $separator ? "\n" : ' ';
|
||||
$text = '';
|
||||
|
||||
$notEOF = $this->moveToNextLine();
|
||||
|
||||
while ($notEOF && $this->isCurrentLineBlank())
|
||||
{
|
||||
$text .= "\n";
|
||||
|
||||
$notEOF = $this->moveToNextLine();
|
||||
}
|
||||
|
||||
if (!$notEOF)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
if (!preg_match('#^(?P<indent>'.($indentation ? str_repeat(' ', $indentation) : ' +').')(?P<text>.*)$#u', $this->currentLine, $matches))
|
||||
{
|
||||
$this->moveToPreviousLine();
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
$textIndent = $matches['indent'];
|
||||
$previousIndent = 0;
|
||||
|
||||
$text .= $matches['text'].$separator;
|
||||
while ($this->currentLineNb + 1 < count($this->lines))
|
||||
{
|
||||
$this->moveToNextLine();
|
||||
|
||||
if (preg_match('#^(?P<indent> {'.strlen($textIndent).',})(?P<text>.+)$#u', $this->currentLine, $matches))
|
||||
{
|
||||
if (' ' == $separator && $previousIndent != $matches['indent'])
|
||||
{
|
||||
$text = substr($text, 0, -1)."\n";
|
||||
}
|
||||
$previousIndent = $matches['indent'];
|
||||
|
||||
$text .= str_repeat(' ', $diff = strlen($matches['indent']) - strlen($textIndent)).$matches['text'].($diff ? "\n" : $separator);
|
||||
}
|
||||
else if (preg_match('#^(?P<text> *)$#', $this->currentLine, $matches))
|
||||
{
|
||||
$text .= preg_replace('#^ {1,'.strlen($textIndent).'}#', '', $matches['text'])."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->moveToPreviousLine();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (' ' == $separator)
|
||||
{
|
||||
// replace last separator by a newline
|
||||
$text = preg_replace('/ (\n*)$/', "\n$1", $text);
|
||||
}
|
||||
|
||||
switch ($indicator)
|
||||
{
|
||||
case '':
|
||||
$text = preg_replace('#\n+$#s', "\n", $text);
|
||||
break;
|
||||
case '+':
|
||||
break;
|
||||
case '-':
|
||||
$text = preg_replace('#\n+$#s', '', $text);
|
||||
break;
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the next line is indented.
|
||||
*
|
||||
* @return Boolean Returns true if the next line is indented, false otherwise
|
||||
*/
|
||||
protected function isNextLineIndented()
|
||||
{
|
||||
$currentIndentation = $this->getCurrentLineIndentation();
|
||||
$notEOF = $this->moveToNextLine();
|
||||
|
||||
while ($notEOF && $this->isCurrentLineEmpty())
|
||||
{
|
||||
$notEOF = $this->moveToNextLine();
|
||||
}
|
||||
|
||||
if (false === $notEOF)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$ret = false;
|
||||
if ($this->getCurrentLineIndentation() <= $currentIndentation)
|
||||
{
|
||||
$ret = true;
|
||||
}
|
||||
|
||||
$this->moveToPreviousLine();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current line is blank or if it is a comment line.
|
||||
*
|
||||
* @return Boolean Returns true if the current line is empty or if it is a comment line, false otherwise
|
||||
*/
|
||||
protected function isCurrentLineEmpty()
|
||||
{
|
||||
return $this->isCurrentLineBlank() || $this->isCurrentLineComment();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current line is blank.
|
||||
*
|
||||
* @return Boolean Returns true if the current line is blank, false otherwise
|
||||
*/
|
||||
protected function isCurrentLineBlank()
|
||||
{
|
||||
return '' == trim($this->currentLine, ' ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current line is a comment line.
|
||||
*
|
||||
* @return Boolean Returns true if the current line is a comment line, false otherwise
|
||||
*/
|
||||
protected function isCurrentLineComment()
|
||||
{
|
||||
//checking explicitly the first char of the trim is faster than loops or strpos
|
||||
$ltrimmedLine = ltrim($this->currentLine, ' ');
|
||||
return $ltrimmedLine[0] === '#';
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanups a YAML string to be parsed.
|
||||
*
|
||||
* @param string $value The input YAML string
|
||||
*
|
||||
* @return string A cleaned up YAML string
|
||||
*/
|
||||
protected function cleanup($value)
|
||||
{
|
||||
$value = str_replace(array("\r\n", "\r"), "\n", $value);
|
||||
|
||||
if (!preg_match("#\n$#", $value))
|
||||
{
|
||||
$value .= "\n";
|
||||
}
|
||||
|
||||
// strip YAML header
|
||||
$count = 0;
|
||||
$value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#su', '', $value, -1, $count);
|
||||
$this->offset += $count;
|
||||
|
||||
// remove leading comments
|
||||
$trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count);
|
||||
if ($count == 1)
|
||||
{
|
||||
// items have been removed, update the offset
|
||||
$this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n");
|
||||
$value = $trimmedValue;
|
||||
}
|
||||
|
||||
// remove start of the document marker (---)
|
||||
$trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count);
|
||||
if ($count == 1)
|
||||
{
|
||||
// items have been removed, update the offset
|
||||
$this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n");
|
||||
$value = $trimmedValue;
|
||||
|
||||
// remove end of the document marker (...)
|
||||
$value = preg_replace('#\.\.\.\s*$#s', '', $value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
9
lib/xajax/XajaxSg.class.php
Executable file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
class XajaxSg extends xajax {
|
||||
private static $instance = null;
|
||||
|
||||
public static function getInstance() {
|
||||
return self::$instance !== null ? self::$instance : self::$instance = new xajax();
|
||||
}
|
||||
}
|
54
lib/xajax/copyright.inc.php
Executable file
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
/*
|
||||
File: copyright.inc.php
|
||||
|
||||
This file contains detailed information regarding the xajax project,
|
||||
current version, copyrights, licnese and documentation.
|
||||
|
||||
You do not need to include this file in your project for xajax to
|
||||
function properly.
|
||||
*/
|
||||
|
||||
/*
|
||||
Section: Current Version
|
||||
|
||||
xajax version 0.5
|
||||
*/
|
||||
|
||||
/*
|
||||
Section: Copyright
|
||||
|
||||
- copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
- copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
*/
|
||||
|
||||
/*
|
||||
Section: Description
|
||||
|
||||
xajax is an open source PHP class library for easily creating powerful
|
||||
PHP-driven, web-based Ajax Applications. Using xajax, you can asynchronously
|
||||
call PHP functions and update the content of your your webpage without
|
||||
reloading the page.
|
||||
*/
|
||||
|
||||
/*
|
||||
Section: License
|
||||
|
||||
xajax is released under the terms of the BSD license
|
||||
http://www.xajaxproject.org/bsd_license.txt
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: copyright.inc.php 327 2007-02-28 16:55:26Z calltoconstruct $
|
||||
@copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Section: Online documentation
|
||||
|
||||
Online documentation for this class is available on the xajax wiki at:
|
||||
http://xajaxproject.org/en/docs-tutorials/
|
||||
*/
|
73
lib/xajax/xajax_core/legacy.inc.php
Executable file
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
class legacyXajaxResponse extends xajaxResponse {
|
||||
function outputEntitiesOn() { $this->setOutputEntities(true); }
|
||||
function outputEntitiesOff() { $this->setOutputEntities(false); }
|
||||
function addConfirmCommands() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'confirmCommands'), $temp); }
|
||||
function addAssign() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'assign'), $temp); }
|
||||
function addAppend() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'append'), $temp); }
|
||||
function addPrepend() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'prepend'), $temp); }
|
||||
function addReplace() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'replace'), $temp); }
|
||||
function addClear() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'clear'), $temp); }
|
||||
function addAlert() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'alert'), $temp); }
|
||||
function addRedirect() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'redirect'), $temp); }
|
||||
function addScript() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'script'), $temp); }
|
||||
function addScriptCall() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'call'), $temp); }
|
||||
function addRemove() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'remove'), $temp); }
|
||||
function addCreate() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'create'), $temp); }
|
||||
function addInsert() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'insert'), $temp); }
|
||||
function addInsertAfter() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'insertAfter'), $temp); }
|
||||
function addCreateInput() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'createInput'), $temp); }
|
||||
function addInsertInput() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'insertInput'), $temp); }
|
||||
function addInsertInputAfter() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'insertInputAfter'), $temp); }
|
||||
function addRemoveHandler() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'removeHandler'), $temp); }
|
||||
function addIncludeScript() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'includeScript'), $temp); }
|
||||
function addIncludeCSS() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'includeCSS'), $temp); }
|
||||
function &getXML() { return $this; }
|
||||
}
|
||||
|
||||
class legacyXajax extends xajax {
|
||||
function legacyXajax($sRequestURI='', $sWrapperPrefix='xajax_', $sEncoding=XAJAX_DEFAULT_CHAR_ENCODING, $bDebug=false)
|
||||
{
|
||||
parent::xajax();
|
||||
$this->configure('requestURI', $sRequestURI);
|
||||
$this->configure('wrapperPrefix', $sWrapperPrefix);
|
||||
$this->configure('characterEncoding', $sEncoding);
|
||||
$this->configure('debug', $bDebug);
|
||||
}
|
||||
function registerExternalFunction($mFunction, $sInclude)
|
||||
{
|
||||
$xuf =& new xajaxUserFunction($mFunction, $sInclude);
|
||||
$this->register(XAJAX_FUNCTION, $xuf);
|
||||
}
|
||||
function registerCatchAllFunction($mFunction)
|
||||
{
|
||||
if (is_array($mFunction)) array_shift($mFunction);
|
||||
$this->register(XAJAX_PROCESSING_EVENT, XAJAX_PROCESSING_EVENT_INVALID, $mFunction);
|
||||
}
|
||||
function registerPreFunction($mFunction)
|
||||
{
|
||||
if (is_array($mFunction)) array_shift($mFunction);
|
||||
$this->register(XAJAX_PROCESSING_EVENT, XAJAX_PROCESSING_EVENT_BEFORE, $mFunction);
|
||||
}
|
||||
function canProcessRequests() { return $this->canProcessRequest(); }
|
||||
function processRequests() { return $this->processRequest(); }
|
||||
function setCallableObject(&$oObject) { return $this->register(XAJAX_CALLABLE_OBJECT, $oObject); }
|
||||
function debugOn() { return $this->configure('debug',true); }
|
||||
function debugOff() { return $this->configure('debug',false); }
|
||||
function statusMessagesOn() { return $this->configure('statusMessages',true); }
|
||||
function statusMessagesOff() { return $this->configure('statusMessages',false); }
|
||||
function waitCursorOn() { return $this->configure('waitCursor',true); }
|
||||
function waitCursorOff() { return $this->configure('waitCursor',false); }
|
||||
function exitAllowedOn() { return $this->configure('exitAllowed',true); }
|
||||
function exitAllowedOff() { return $this->configure('exitAllowed',false); }
|
||||
function errorHandlerOn() { return $this->configure('errorHandler',true); }
|
||||
function errorHandlerOff() { return $this->configure('errorHandler',false); }
|
||||
function cleanBufferOn() { return $this->configure('cleanBuffer',true); }
|
||||
function cleanBufferOff() { return $this->configure('cleanBuffer',false); }
|
||||
function decodeUTF8InputOn() { return $this->configure('decodeUTF8Input',true); }
|
||||
function decodeUTF8InputOff() { return $this->configure('decodeUTF8Input',false); }
|
||||
function outputEntitiesOn() { return $this->configure('outputEntities',true); }
|
||||
function outputEntitiesOff() { return $this->configure('outputEntities',false); }
|
||||
function allowBlankResponseOn() { return $this->configure('allowBlankResponse',true); }
|
||||
function allowBlankResponseOff() { return $this->configure('allowBlankResponse',false); }
|
||||
}
|
228
lib/xajax/xajax_core/plugin_layer/support/xajaxCallableObject.inc.php
Executable file
|
@ -0,0 +1,228 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxCallableObject.inc.php
|
||||
|
||||
Contains the xajaxCallableObject class
|
||||
|
||||
Title: xajaxCallableObject class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxCallableObject.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Class: xajaxCallableObject
|
||||
|
||||
A class that stores a reference to an object whose methods can be called from
|
||||
the client via a xajax request. <xajax> will call
|
||||
<xajaxCallableObject->generateClientScript> so that stub functions can be
|
||||
generated and sent to the browser.
|
||||
*/
|
||||
class xajaxCallableObject
|
||||
{
|
||||
/*
|
||||
Object: obj
|
||||
|
||||
A reference to the callable object.
|
||||
*/
|
||||
var $obj;
|
||||
|
||||
/*
|
||||
Array: aConfiguration
|
||||
|
||||
An associative array that will contain configuration options for zero
|
||||
or more of the objects methods. These configuration options will
|
||||
define the call options for each request. The call options will be
|
||||
passed to the client browser when the function stubs are generated.
|
||||
*/
|
||||
var $aConfiguration;
|
||||
|
||||
/*
|
||||
Function: xajaxCallableObject
|
||||
|
||||
Constructs and initializes the <xajaxCallableObject>
|
||||
|
||||
obj - (object): The object to reference.
|
||||
*/
|
||||
function xajaxCallableObject(&$obj)
|
||||
{
|
||||
$this->obj =& $obj;
|
||||
$this->aConfiguration = array();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getName
|
||||
|
||||
Returns the name of this callable object. This is typically the
|
||||
class name of the object.
|
||||
*/
|
||||
function getName()
|
||||
{
|
||||
return get_class($this->obj);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
|
||||
Used to set configuration options / call options for each method.
|
||||
|
||||
sMethod - (string): The name of the method.
|
||||
sName - (string): The name of the configuration option.
|
||||
sValue - (string): The value to be set.
|
||||
*/
|
||||
function configure($sMethod, $sName, $sValue)
|
||||
{
|
||||
$sMethod = strtolower($sMethod);
|
||||
|
||||
if (false == isset($this->aConfiguration[$sMethod]))
|
||||
$this->aConfiguration[$sMethod] = array();
|
||||
|
||||
$this->aConfiguration[$sMethod][$sName] = $sValue;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateRequests
|
||||
|
||||
Produces an array of <xajaxRequest> objects, one for each method
|
||||
exposed by this callable object.
|
||||
|
||||
sXajaxPrefix - (string): The prefix to be prepended to the
|
||||
javascript function names; this will correspond to the name
|
||||
used for the function stubs that are generated by the
|
||||
<xajaxCallableObject->generateClientScript> call.
|
||||
*/
|
||||
function generateRequests($sXajaxPrefix)
|
||||
{
|
||||
$aRequests = array();
|
||||
|
||||
$sClass = get_class($this->obj);
|
||||
|
||||
foreach (get_class_methods($this->obj) as $sMethodName)
|
||||
{
|
||||
$bInclude = true;
|
||||
// exclude magic __call method
|
||||
if ("__call" == $sMethodName)
|
||||
$bInclude = false;
|
||||
// exclude constructor
|
||||
if ($sClass == $sMethodName)
|
||||
$bInclude = false;
|
||||
if ($bInclude)
|
||||
$aRequests[strtolower($sMethodName)] =&
|
||||
new xajaxRequest("{$sXajaxPrefix}{$sClass}.{$sMethodName}");
|
||||
}
|
||||
|
||||
return $aRequests;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateClientScript
|
||||
|
||||
Called by <xajaxCallableObject->generateClientScript> while <xajax> is
|
||||
generating the javascript to be sent to the browser.
|
||||
|
||||
sXajaxPrefix - (string): The prefix to be prepended to the
|
||||
javascript function names.
|
||||
*/
|
||||
function generateClientScript($sXajaxPrefix)
|
||||
{
|
||||
$sClass = get_class($this->obj);
|
||||
|
||||
echo "{$sXajaxPrefix}{$sClass} = {};\n";
|
||||
|
||||
foreach (get_class_methods($this->obj) as $sMethodName)
|
||||
{
|
||||
$bInclude = true;
|
||||
// exclude magic __call, __construct, __destruct methods
|
||||
if (2 < strlen($sMethodName))
|
||||
if ("__" == substr($sMethodName, 0, 2))
|
||||
$bInclude = false;
|
||||
// exclude constructor
|
||||
if ($sClass == $sMethodName)
|
||||
$bInclude = false;
|
||||
if ($bInclude)
|
||||
{
|
||||
echo "{$sXajaxPrefix}{$sClass}.{$sMethodName} = function() { ";
|
||||
echo "return xajax.request( ";
|
||||
echo "{ xjxcls: '{$sClass}', xjxmthd: '{$sMethodName}' }, ";
|
||||
echo "{ parameters: arguments";
|
||||
|
||||
$sSeparator = ", ";
|
||||
if (isset($this->aConfiguration['*']))
|
||||
foreach ($this->aConfiguration['*'] as $sKey => $sValue)
|
||||
echo "{$sSeparator}{$sKey}: {$sValue}";
|
||||
if (isset($this->aConfiguration[strtolower($sMethodName)]))
|
||||
foreach ($this->aConfiguration[strtolower($sMethodName)] as $sKey => $sValue)
|
||||
echo "{$sSeparator}{$sKey}: {$sValue}";
|
||||
|
||||
echo " } ); ";
|
||||
echo "};\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: isClass
|
||||
|
||||
Determins if the specified class name matches the class name of the
|
||||
object referenced by <xajaxCallableObject->obj>.
|
||||
|
||||
sClass - (string): The name of the class to check.
|
||||
|
||||
Returns:
|
||||
|
||||
boolean - True of the specified class name matches the class of
|
||||
the object being referenced; false otherwise.
|
||||
*/
|
||||
function isClass($sClass)
|
||||
{
|
||||
if(get_class($this->obj) === $sClass)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: hasMethod
|
||||
|
||||
Determines if the specified method name is one of the methods of the
|
||||
object referenced by <xajaxCallableObject->obj>.
|
||||
|
||||
sMethod - (object): The name of the method to check.
|
||||
|
||||
Returns:
|
||||
|
||||
boolean - True of the referenced object contains the specified method,
|
||||
false otherwise.
|
||||
*/
|
||||
function hasMethod($sMethod)
|
||||
{
|
||||
return method_exists($this->obj, $sMethod) || method_exists($this->obj, "__call");
|
||||
}
|
||||
|
||||
/*
|
||||
Function: call
|
||||
|
||||
Call the specified method of the object being referenced using the specified
|
||||
array of arguments.
|
||||
|
||||
sMethod - (string): The name of the method to call.
|
||||
aArgs - (array): The arguments to pass to the method.
|
||||
*/
|
||||
function call($sMethod, $aArgs)
|
||||
{
|
||||
$objResponseManager =& xajaxResponseManager::getInstance();
|
||||
$objResponseManager->append(
|
||||
call_user_func_array(
|
||||
array(&$this->obj, $sMethod),
|
||||
$aArgs
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
162
lib/xajax/xajax_core/plugin_layer/support/xajaxEvent.inc.php
Executable file
|
@ -0,0 +1,162 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxEvent.inc.php
|
||||
|
||||
Definition of the xajax Event object.
|
||||
|
||||
Title: xajaxEvent
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxEvent.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
// require_once is necessary here as the function plugin also includes this
|
||||
//SkipAIO
|
||||
require_once dirname(__FILE__) . '/xajaxUserFunction.inc.php';
|
||||
//EndSkipAIO
|
||||
|
||||
/*
|
||||
Class: xajaxEvent
|
||||
|
||||
A container class which holds a reference to handler functions and configuration
|
||||
options associated with a registered event.
|
||||
*/
|
||||
class xajaxEvent
|
||||
{
|
||||
/*
|
||||
String: sName
|
||||
|
||||
The name of the event.
|
||||
*/
|
||||
var $sName;
|
||||
|
||||
/*
|
||||
Array: aConfiguration
|
||||
|
||||
Configuration / call options to be used when initiating a xajax request
|
||||
to trigger this event.
|
||||
*/
|
||||
var $aConfiguration;
|
||||
|
||||
/*
|
||||
Array: aHandlers
|
||||
|
||||
A list of <xajaxUserFunction> objects associated with this registered
|
||||
event. Each of these functions will be called when the event is triggered.
|
||||
*/
|
||||
var $aHandlers;
|
||||
|
||||
/*
|
||||
Function: xajaxEvent
|
||||
|
||||
Construct and initialize this <xajaxEvent> object.
|
||||
*/
|
||||
function xajaxEvent($sName)
|
||||
{
|
||||
$this->sName = $sName;
|
||||
$this->aConfiguration = array();
|
||||
$this->aHandlers = array();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getName
|
||||
|
||||
Returns the name of the event.
|
||||
|
||||
Returns:
|
||||
|
||||
string - the name of the event.
|
||||
*/
|
||||
function getName()
|
||||
{
|
||||
return $this->sName;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
|
||||
Sets/stores configuration options that will be used when generating
|
||||
the client script that is sent to the browser.
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
$this->aConfiguration[$sName] = $mValue;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: addHandler
|
||||
|
||||
Adds a <xajaxUserFunction> object to the list of handlers that will
|
||||
be fired when the event is triggered.
|
||||
*/
|
||||
function addHandler(&$xuf)
|
||||
{
|
||||
$this->aHandlers[] =& $xuf;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateRequest
|
||||
|
||||
Generates a <xajaxRequest> object that corresponds to the
|
||||
event so that the client script can easily invoke this event.
|
||||
|
||||
sXajaxPrefix - (string): The prefix that will be prepended to
|
||||
the client script stub function associated with this event.
|
||||
|
||||
sEventPrefix - (string): The prefix prepended to the client script
|
||||
function stub and <xajaxRequest> script.
|
||||
*/
|
||||
function generateRequest($sXajaxPrefix, $sEventPrefix)
|
||||
{
|
||||
$sEvent = $this->sName;
|
||||
return new xajaxRequest("{$sXajaxPrefix}{$sEventPrefix}{$sEvent}");
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateClientScript
|
||||
|
||||
Generates a block of javascript code that declares a stub function
|
||||
that can be used to easily trigger the event from the browser.
|
||||
*/
|
||||
function generateClientScript($sXajaxPrefix, $sEventPrefix)
|
||||
{
|
||||
$sMode = '';
|
||||
$sMethod = '';
|
||||
|
||||
if (isset($this->aConfiguration['mode']))
|
||||
$sMode = $this->aConfiguration['mode'];
|
||||
|
||||
if (isset($this->aConfiguration['method']))
|
||||
$sMethod = $this->aConfiguration['method'];
|
||||
|
||||
if (0 < strlen($sMode))
|
||||
$sMode = ", mode: '{$sMode}'";
|
||||
|
||||
if (0 < strlen($sMethod))
|
||||
$sMethod = ", method: '{$sMethod}'";
|
||||
|
||||
$sEvent = $this->sName;
|
||||
echo "{$sXajaxPrefix}{$sEventPrefix}{$sEvent} = function() { return xajax.request( { xjxevt: '{$sEvent}' }, { parameters: arguments{$sMode}{$sMethod} } ); };\n";
|
||||
}
|
||||
|
||||
/*
|
||||
Function: fire
|
||||
|
||||
Called by the <xajaxEventPlugin> when the event has been triggered.
|
||||
*/
|
||||
function fire($aArgs)
|
||||
{
|
||||
$objResponseManager =& xajaxResponseManager::getInstance();
|
||||
|
||||
foreach (array_keys($this->aHandlers) as $sKey)
|
||||
$this->aHandlers[$sKey]->call($aArgs);
|
||||
}
|
||||
}
|
233
lib/xajax/xajax_core/plugin_layer/support/xajaxUserFunction.inc.php
Executable file
|
@ -0,0 +1,233 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxUserFunction.inc.php
|
||||
|
||||
Contains the xajaxUserFunction class
|
||||
|
||||
Title: xajaxUserFunction class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxUserFunction.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Class: xajaxUserFunction
|
||||
|
||||
Construct instances of this class to define functions that will be registered
|
||||
with the <xajax> request processor. This class defines the parameters that
|
||||
are needed for the definition of a xajax enabled function. While you can
|
||||
still specify functions by name during registration, it is advised that you
|
||||
convert to using this class when you wish to register external functions or
|
||||
to specify call options as well.
|
||||
*/
|
||||
class xajaxUserFunction
|
||||
{
|
||||
/*
|
||||
String: sAlias
|
||||
|
||||
An alias to use for this function. This is useful when you want
|
||||
to call the same xajax enabled function with a different set of
|
||||
call options from what was already registered.
|
||||
*/
|
||||
var $sAlias;
|
||||
|
||||
/*
|
||||
Object: uf
|
||||
|
||||
A string or array which defines the function to be registered.
|
||||
*/
|
||||
var $uf;
|
||||
|
||||
/*
|
||||
String: sInclude
|
||||
|
||||
The path and file name of the include file that contains the function.
|
||||
*/
|
||||
var $sInclude;
|
||||
|
||||
/*
|
||||
Array: aConfiguration
|
||||
|
||||
An associative array containing call options that will be sent to the
|
||||
browser curing client script generation.
|
||||
*/
|
||||
var $aConfiguration;
|
||||
|
||||
/*
|
||||
Function: xajaxUserFunction
|
||||
|
||||
Constructs and initializes the <xajaxUserFunction> object.
|
||||
|
||||
$uf - (mixed): A function specification in one of the following formats:
|
||||
|
||||
- a three element array:
|
||||
(string) Alternate function name: when a method of a class has the same
|
||||
name as another function in the system, you can provide an alias to
|
||||
help avoid collisions.
|
||||
(object or class name) Class: the name of the class or an instance of
|
||||
the object which contains the function to be called.
|
||||
(string) Method: the name of the method that will be called.
|
||||
- a two element array:
|
||||
(object or class name) Class: the name of the class or an instance of
|
||||
the object which contains the function to be called.
|
||||
(string) Method: the name of the method that will be called.
|
||||
- a string:
|
||||
the name of the function that is available at global scope (not in a
|
||||
class.
|
||||
$sInclude - (string, optional): The path and file name of the include file
|
||||
that contains the class or function to be called.
|
||||
|
||||
$aConfiguration - (array, optional): An associative array of call options
|
||||
that will be used when sending the request from the client.
|
||||
|
||||
Examples:
|
||||
|
||||
$myFunction = array('alias', 'myClass', 'myMethod');
|
||||
$myFunction = array('alias', &$myObject, 'myMethod');
|
||||
$myFunction = array('myClass', 'myMethod');
|
||||
$myFunction = array(&$myObject, 'myMethod');
|
||||
$myFunction = 'myFunction';
|
||||
|
||||
$myUserFunction = new xajaxUserFunction($myFunction, 'myFile.inc.php', array(
|
||||
'method' => 'get',
|
||||
'mode' => 'synchronous'
|
||||
));
|
||||
|
||||
$xajax->register(XAJAX_FUNCTION, $myUserFunction);
|
||||
*/
|
||||
function xajaxUserFunction($uf, $sInclude=NULL, $aConfiguration=array())
|
||||
{
|
||||
$this->sAlias = '';
|
||||
$this->uf =& $uf;
|
||||
$this->sInclude = $sInclude;
|
||||
$this->aConfiguration = array();
|
||||
foreach ($aConfiguration as $sKey => $sValue)
|
||||
$this->configure($sKey, $sValue);
|
||||
|
||||
if (is_array($this->uf) && 2 < count($this->uf))
|
||||
{
|
||||
$this->sAlias = $this->uf[0];
|
||||
$this->uf = array_slice($this->uf, 1);
|
||||
}
|
||||
|
||||
//SkipDebug
|
||||
if (is_array($this->uf) && 2 != count($this->uf))
|
||||
trigger_error(
|
||||
'Invalid function declaration for xajaxUserFunction.',
|
||||
E_USER_ERROR
|
||||
);
|
||||
//EndSkipDebug
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getName
|
||||
|
||||
Get the name of the function being referenced.
|
||||
|
||||
Returns:
|
||||
|
||||
string - the name of the function contained within this object.
|
||||
*/
|
||||
function getName()
|
||||
{
|
||||
// Do not use sAlias here!
|
||||
if (is_array($this->uf))
|
||||
return $this->uf[1];
|
||||
return $this->uf;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
|
||||
Call this to set call options for this instance.
|
||||
*/
|
||||
function configure($sName, $sValue)
|
||||
{
|
||||
if ('alias' == $sName)
|
||||
$this->sAlias = $sValue;
|
||||
else
|
||||
$this->aConfiguration[$sName] = $sValue;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateRequest
|
||||
|
||||
Constructs and returns a <xajaxRequest> object which is capable
|
||||
of generating the javascript call to invoke this xajax enabled
|
||||
function.
|
||||
*/
|
||||
function generateRequest($sXajaxPrefix)
|
||||
{
|
||||
$sAlias = $this->getName();
|
||||
if (0 < strlen($this->sAlias))
|
||||
$sAlias = $this->sAlias;
|
||||
return new xajaxRequest("{$sXajaxPrefix}{$sAlias}");
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateClientScript
|
||||
|
||||
Called by the <xajaxPlugin> that is referencing this function
|
||||
reference during the client script generation phase. This function
|
||||
will generate the javascript function stub that is sent to the
|
||||
browser on initial page load.
|
||||
*/
|
||||
function generateClientScript($sXajaxPrefix)
|
||||
{
|
||||
$sFunction = $this->getName();
|
||||
$sAlias = $sFunction;
|
||||
if (0 < strlen($this->sAlias))
|
||||
$sAlias = $this->sAlias;
|
||||
echo "{$sXajaxPrefix}{$sAlias} = function() { ";
|
||||
echo "return xajax.request( ";
|
||||
echo "{ xjxfun: '{$sFunction}' }, ";
|
||||
echo "{ parameters: arguments";
|
||||
|
||||
$sSeparator = ", ";
|
||||
foreach ($this->aConfiguration as $sKey => $sValue)
|
||||
echo "{$sSeparator}{$sKey}: {$sValue}";
|
||||
|
||||
echo " } ); ";
|
||||
echo "};\n";
|
||||
}
|
||||
|
||||
/*
|
||||
Function: call
|
||||
|
||||
Called by the <xajaxPlugin> that references this function during the
|
||||
request processing phase. This function will call the specified
|
||||
function, including an external file if needed and passing along
|
||||
the specified arguments.
|
||||
*/
|
||||
function call($aArgs=array())
|
||||
{
|
||||
$objResponseManager =& xajaxResponseManager::getInstance();
|
||||
|
||||
if (NULL != $this->sInclude)
|
||||
{
|
||||
ob_start();
|
||||
require_once $this->sInclude;
|
||||
$sOutput = ob_get_clean();
|
||||
|
||||
//SkipDebug
|
||||
if (0 < strlen($sOutput))
|
||||
{
|
||||
$sOutput = 'From include file: ' . $this->sInclude . ' => ' . $sOutput;
|
||||
$objResponseManager->debug($sOutput);
|
||||
}
|
||||
//EndSkipDebug
|
||||
}
|
||||
|
||||
$mFunction = $this->uf;
|
||||
$objResponseManager->append(call_user_func_array($mFunction, $aArgs));
|
||||
}
|
||||
}
|
||||
?>
|
219
lib/xajax/xajax_core/plugin_layer/xajaxCallableObjectPlugin.inc.php
Executable file
|
@ -0,0 +1,219 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxCallableObjectPlugin.inc.php
|
||||
|
||||
Contains the xajaxCallableObjectPlugin class
|
||||
|
||||
Title: xajaxCallableObjectPlugin class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxCallableObjectPlugin.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Constant: XAJAX_CALLABLE_OBJECT
|
||||
Specifies that the item being registered via the <xajax->register> function is a
|
||||
object who's methods will be callable from the browser.
|
||||
*/
|
||||
if (!defined ('XAJAX_CALLABLE_OBJECT')) define ('XAJAX_CALLABLE_OBJECT', 'callable object');
|
||||
|
||||
//SkipAIO
|
||||
require dirname(__FILE__) . '/support/xajaxCallableObject.inc.php';
|
||||
//EndSkipAIO
|
||||
|
||||
/*
|
||||
Class: xajaxCallableObjectPlugin
|
||||
*/
|
||||
class xajaxCallableObjectPlugin extends xajaxRequestPlugin
|
||||
{
|
||||
/*
|
||||
Array: aCallableObjects
|
||||
*/
|
||||
var $aCallableObjects;
|
||||
|
||||
/*
|
||||
String: sXajaxPrefix
|
||||
*/
|
||||
var $sXajaxPrefix;
|
||||
|
||||
/*
|
||||
String: sDefer
|
||||
*/
|
||||
var $sDefer;
|
||||
|
||||
var $bDeferScriptGeneration;
|
||||
|
||||
/*
|
||||
String: sRequestedClass
|
||||
*/
|
||||
var $sRequestedClass;
|
||||
|
||||
/*
|
||||
String: sRequestedMethod
|
||||
*/
|
||||
var $sRequestedMethod;
|
||||
|
||||
/*
|
||||
Function: xajaxCallableObjectPlugin
|
||||
*/
|
||||
function xajaxCallableObjectPlugin()
|
||||
{
|
||||
$this->aCallableObjects = array();
|
||||
|
||||
$this->sXajaxPrefix = 'xajax_';
|
||||
$this->sDefer = '';
|
||||
$this->bDeferScriptGeneration = false;
|
||||
|
||||
$this->sRequestedClass = NULL;
|
||||
$this->sRequestedMethod = NULL;
|
||||
|
||||
if (!empty($_GET['xjxcls'])) $this->sRequestedClass = $_GET['xjxcls'];
|
||||
if (!empty($_GET['xjxmthd'])) $this->sRequestedMethod = $_GET['xjxmthd'];
|
||||
if (!empty($_POST['xjxcls'])) $this->sRequestedClass = $_POST['xjxcls'];
|
||||
if (!empty($_POST['xjxmthd'])) $this->sRequestedMethod = $_POST['xjxmthd'];
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
if ('wrapperPrefix' == $sName) {
|
||||
$this->sXajaxPrefix = $mValue;
|
||||
} else if ('scriptDefferal' == $sName) {
|
||||
if (true === $mValue) $this->sDefer = 'defer ';
|
||||
else $this->sDefer = '';
|
||||
} else if ('deferScriptGeneration' == $sName) {
|
||||
if (true === $mValue || false === $mValue)
|
||||
$this->bDeferScriptGeneration = $mValue;
|
||||
else if ('deferred' === $mValue)
|
||||
$this->bDeferScriptGeneration = $mValue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: register
|
||||
*/
|
||||
function register($aArgs)
|
||||
{
|
||||
if (1 < count($aArgs))
|
||||
{
|
||||
$sType = $aArgs[0];
|
||||
|
||||
if (XAJAX_CALLABLE_OBJECT == $sType)
|
||||
{
|
||||
$xco =& $aArgs[1];
|
||||
|
||||
//SkipDebug
|
||||
if (false === is_object($xco))
|
||||
{
|
||||
trigger_error("To register a callable object, please provide an instance of the desired class.", E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
//EndSkipDebug
|
||||
|
||||
if (false === is_a($xco, 'xajaxCallableObject'))
|
||||
$xco =& new xajaxCallableObject($xco);
|
||||
|
||||
if (2 < count($aArgs))
|
||||
if (is_array($aArgs[2]))
|
||||
foreach ($aArgs[2] as $sKey => $aValue)
|
||||
foreach ($aValue as $sName => $sValue)
|
||||
$xco->configure($sKey, $sName, $sValue);
|
||||
|
||||
$this->aCallableObjects[] =& $xco;
|
||||
|
||||
return $xco->generateRequests($this->sXajaxPrefix);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateClientScript
|
||||
*/
|
||||
function generateClientScript()
|
||||
{
|
||||
if (false === $this->bDeferScriptGeneration || 'deferred' === $this->bDeferScriptGeneration)
|
||||
{
|
||||
if (0 < count($this->aCallableObjects))
|
||||
{
|
||||
$sCrLf = "\n";
|
||||
|
||||
echo $sCrLf;
|
||||
echo '<';
|
||||
echo 'script type="text/javascript" ';
|
||||
echo $this->sDefer;
|
||||
echo 'charset="UTF-8">';
|
||||
echo $sCrLf;
|
||||
echo '/* <';
|
||||
echo '![CDATA[ */';
|
||||
echo $sCrLf;
|
||||
|
||||
foreach(array_keys($this->aCallableObjects) as $sKey)
|
||||
$this->aCallableObjects[$sKey]->generateClientScript($this->sXajaxPrefix);
|
||||
|
||||
echo '/* ]]> */';
|
||||
echo $sCrLf;
|
||||
echo '<';
|
||||
echo '/script>';
|
||||
echo $sCrLf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: canProcessRequest
|
||||
*/
|
||||
function canProcessRequest()
|
||||
{
|
||||
if (NULL == $this->sRequestedClass)
|
||||
return false;
|
||||
if (NULL == $this->sRequestedMethod)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: processRequest
|
||||
*/
|
||||
function processRequest()
|
||||
{
|
||||
if (NULL == $this->sRequestedClass)
|
||||
return false;
|
||||
if (NULL == $this->sRequestedMethod)
|
||||
return false;
|
||||
|
||||
$objArgumentManager =& xajaxArgumentManager::getInstance();
|
||||
$aArgs = $objArgumentManager->process();
|
||||
|
||||
foreach (array_keys($this->aCallableObjects) as $sKey)
|
||||
{
|
||||
$xco =& $this->aCallableObjects[$sKey];
|
||||
|
||||
if ($xco->isClass($this->sRequestedClass))
|
||||
{
|
||||
if ($xco->hasMethod($this->sRequestedMethod))
|
||||
{
|
||||
$xco->call($this->sRequestedMethod, $aArgs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 'Invalid request for a callable object.';
|
||||
}
|
||||
}
|
||||
|
||||
$objPluginManager =& xajaxPluginManager::getInstance();
|
||||
$objPluginManager->registerPlugin(new xajaxCallableObjectPlugin(), 102);
|
352
lib/xajax/xajax_core/plugin_layer/xajaxDefaultIncludePlugin.inc.php
Executable file
|
@ -0,0 +1,352 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxDefaultIncludePlugin.inc.php
|
||||
|
||||
Contains the default script include plugin class.
|
||||
|
||||
Title: xajax default script include plugin class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxDefaultIncludePlugin.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Class: xajaxIncludeClientScript
|
||||
|
||||
Generates the SCRIPT tags necessary to 'include' the xajax javascript
|
||||
library on the browser.
|
||||
|
||||
This is called when the page is first loaded.
|
||||
*/
|
||||
class xajaxIncludeClientScriptPlugin extends xajaxRequestPlugin
|
||||
{
|
||||
var $sJsURI;
|
||||
var $aJsFiles;
|
||||
var $sDefer;
|
||||
var $sRequestURI;
|
||||
var $sStatusMessages;
|
||||
var $sWaitCursor;
|
||||
var $sVersion;
|
||||
var $sDefaultMode;
|
||||
var $sDefaultMethod;
|
||||
var $bDebug;
|
||||
var $bVerboseDebug;
|
||||
var $nScriptLoadTimeout;
|
||||
var $bUseUncompressedScripts;
|
||||
var $bDeferScriptGeneration;
|
||||
var $sLanguage;
|
||||
var $nResponseQueueSize;
|
||||
|
||||
function xajaxIncludeClientScriptPlugin()
|
||||
{
|
||||
$this->sJsURI = '';
|
||||
$this->aJsFiles = array();
|
||||
$this->sDefer = '';
|
||||
$this->sRequestURI = '';
|
||||
$this->sStatusMessages = 'false';
|
||||
$this->sWaitCursor = 'true';
|
||||
$this->sVersion = 'unknown';
|
||||
$this->sDefaultMode = 'asynchronous';
|
||||
$this->sDefaultMethod = 'POST'; // W3C: Method is case sensitive
|
||||
$this->bDebug = false;
|
||||
$this->bVerboseDebug = false;
|
||||
$this->nScriptLoadTimeout = 2000;
|
||||
$this->bUseUncompressedScripts = false;
|
||||
$this->bDeferScriptGeneration = false;
|
||||
$this->sLanguage = null;
|
||||
$this->nResponseQueueSize = null;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
if ('javascript URI' == $sName) {
|
||||
$this->sJsURI = $mValue;
|
||||
} else if ("javascript files" == $sName) {
|
||||
$this->aJsFiles = $mValue;
|
||||
} else if ("scriptDefferal" == $sName) {
|
||||
if (true === $mValue) $this->sDefer = "defer ";
|
||||
else $this->sDefer = "";
|
||||
} else if ("requestURI" == $sName) {
|
||||
$this->sRequestURI = $mValue;
|
||||
} else if ("statusMessages" == $sName) {
|
||||
if (true === $mValue) $this->sStatusMessages = "true";
|
||||
else $this->sStatusMessages = "false";
|
||||
} else if ("waitCursor" == $sName) {
|
||||
if (true === $mValue) $this->sWaitCursor = "true";
|
||||
else $this->sWaitCursor = "false";
|
||||
} else if ("version" == $sName) {
|
||||
$this->sVersion = $mValue;
|
||||
} else if ("defaultMode" == $sName) {
|
||||
if ("asynchronous" == $mValue || "synchronous" == $mValue)
|
||||
$this->sDefaultMode = $mValue;
|
||||
} else if ("defaultMethod" == $sName) {
|
||||
if ("POST" == $mValue || "GET" == $mValue) // W3C: Method is case sensitive
|
||||
$this->sDefaultMethod = $mValue;
|
||||
} else if ("debug" == $sName) {
|
||||
if (true === $mValue || false === $mValue)
|
||||
$this->bDebug = $mValue;
|
||||
} else if ("verboseDebug" == $sName) {
|
||||
if (true === $mValue || false === $mValue)
|
||||
$this->bVerboseDebug = $mValue;
|
||||
} else if ("scriptLoadTimeout" == $sName) {
|
||||
$this->nScriptLoadTimeout = $mValue;
|
||||
} else if ("useUncompressedScripts" == $sName) {
|
||||
if (true === $mValue || false === $mValue)
|
||||
$this->bUseUncompressedScripts = $mValue;
|
||||
} else if ('deferScriptGeneration' == $sName) {
|
||||
if (true === $mValue || false === $mValue)
|
||||
$this->bDeferScriptGeneration = $mValue;
|
||||
else if ('deferred' == $mValue)
|
||||
$this->bDeferScriptGeneration = $mValue;
|
||||
} else if ('language' == $sName) {
|
||||
$this->sLanguage = $mValue;
|
||||
} else if ('responseQueueSize' == $sName) {
|
||||
$this->nResponseQueueSize = $mValue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateClientScript
|
||||
*/
|
||||
function generateClientScript()
|
||||
{
|
||||
if (false === $this->bDeferScriptGeneration)
|
||||
{
|
||||
$this->printJavascriptConfig();
|
||||
$this->printJavascriptInclude();
|
||||
}
|
||||
else if (true === $this->bDeferScriptGeneration)
|
||||
{
|
||||
$this->printJavascriptInclude();
|
||||
}
|
||||
else if ('deferred' == $this->bDeferScriptGeneration)
|
||||
{
|
||||
$this->printJavascriptConfig();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getJavascriptConfig
|
||||
|
||||
Generates the xajax settings that will be used by the xajax javascript
|
||||
library when making requests back to the server.
|
||||
|
||||
Returns:
|
||||
|
||||
string - The javascript code necessary to configure the settings on
|
||||
the browser.
|
||||
*/
|
||||
function getJavascriptConfig()
|
||||
{
|
||||
ob_start();
|
||||
$this->printJavascriptConfig();
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: printJavascriptConfig
|
||||
|
||||
See <xajaxIncludeClientScriptPlugin::getJavascriptConfig>
|
||||
*/
|
||||
function printJavascriptConfig()
|
||||
{
|
||||
$sCrLf = "\n";
|
||||
|
||||
echo $sCrLf;
|
||||
echo '<';
|
||||
echo 'script type="text/javascript" ';
|
||||
echo $this->sDefer;
|
||||
echo 'charset="UTF-8">';
|
||||
echo $sCrLf;
|
||||
echo '/* <';
|
||||
echo '![CDATA[ */';
|
||||
echo $sCrLf;
|
||||
echo 'try { if (undefined == xajax.config) xajax.config = {}; } catch (e) { xajax = {}; xajax.config = {}; };';
|
||||
echo $sCrLf;
|
||||
echo 'xajax.config.requestURI = "';
|
||||
echo $this->sRequestURI;
|
||||
echo '";';
|
||||
echo $sCrLf;
|
||||
echo 'xajax.config.statusMessages = ';
|
||||
echo $this->sStatusMessages;
|
||||
echo ';';
|
||||
echo $sCrLf;
|
||||
echo 'xajax.config.waitCursor = ';
|
||||
echo $this->sWaitCursor;
|
||||
echo ';';
|
||||
echo $sCrLf;
|
||||
echo 'xajax.config.version = "';
|
||||
echo $this->sVersion;
|
||||
echo '";';
|
||||
echo $sCrLf;
|
||||
echo 'xajax.config.legacy = false;';
|
||||
echo $sCrLf;
|
||||
echo 'xajax.config.defaultMode = "';
|
||||
echo $this->sDefaultMode;
|
||||
echo '";';
|
||||
echo $sCrLf;
|
||||
echo 'xajax.config.defaultMethod = "';
|
||||
echo $this->sDefaultMethod;
|
||||
echo '";';
|
||||
|
||||
if (false === (null === $this->nResponseQueueSize))
|
||||
{
|
||||
echo $sCrLf;
|
||||
echo 'xajax.config.responseQueueSize = ';
|
||||
echo $this->nResponseQueueSize;
|
||||
echo ';';
|
||||
}
|
||||
|
||||
echo $sCrLf;
|
||||
echo '/* ]]> */';
|
||||
echo $sCrLf;
|
||||
echo '<';
|
||||
echo '/script>';
|
||||
echo $sCrLf;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getJavascriptInclude
|
||||
|
||||
Generates SCRIPT tags necessary to load the javascript libraries on
|
||||
the browser.
|
||||
|
||||
sJsURI - (string): The relative or fully qualified PATH that will be
|
||||
used to compose the URI to the specified javascript files.
|
||||
aJsFiles - (array): List of javascript files to include.
|
||||
|
||||
Returns:
|
||||
|
||||
string - The SCRIPT tags that will cause the browser to load the
|
||||
specified files.
|
||||
*/
|
||||
function getJavascriptInclude()
|
||||
{
|
||||
ob_start();
|
||||
$this->printJavascriptInclude();
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: printJavascriptInclude
|
||||
|
||||
See <xajaxIncludeClientScriptPlugin::getJavascriptInclude>
|
||||
*/
|
||||
function printJavascriptInclude()
|
||||
{
|
||||
$aJsFiles = $this->aJsFiles;
|
||||
$sJsURI = $this->sJsURI;
|
||||
|
||||
if (0 == count($aJsFiles)) {
|
||||
$aJsFiles[] = array($this->_getScriptFilename('xajax_js/xajax_core.js'), 'xajax');
|
||||
|
||||
if (true === $this->bDebug)
|
||||
$aJsFiles[] = array($this->_getScriptFilename('xajax_js/xajax_debug.js'), 'xajax.debug');
|
||||
|
||||
if (true === $this->bVerboseDebug)
|
||||
$aJsFiles[] = array($this->_getScriptFilename('xajax_js/xajax_verbose.js'), 'xajax.debug.verbose');
|
||||
|
||||
if (null !== $this->sLanguage)
|
||||
$aJsFiles[] = array($this->_getScriptFilename('xajax_js/xajax_lang_' . $this->sLanguage . '.js'), 'xajax');
|
||||
}
|
||||
|
||||
if ($sJsURI != '' && substr($sJsURI, -1) != '/')
|
||||
$sJsURI .= '/';
|
||||
|
||||
$sCrLf = "\n";
|
||||
|
||||
foreach ($aJsFiles as $aJsFile) {
|
||||
echo '<';
|
||||
echo 'script type="text/javascript" src="';
|
||||
echo $sJsURI;
|
||||
echo $aJsFile[0];
|
||||
echo '" ';
|
||||
echo $this->sDefer;
|
||||
echo 'charset="UTF-8"><';
|
||||
echo '/script>';
|
||||
echo $sCrLf;
|
||||
}
|
||||
|
||||
if (0 < $this->nScriptLoadTimeout) {
|
||||
foreach ($aJsFiles as $aJsFile) {
|
||||
echo '<';
|
||||
echo 'script type="text/javascript" ';
|
||||
echo $this->sDefer;
|
||||
echo 'charset="UTF-8">';
|
||||
echo $sCrLf;
|
||||
echo '/* <';
|
||||
echo '![CDATA[ */';
|
||||
echo $sCrLf;
|
||||
echo 'window.setTimeout(';
|
||||
echo $sCrLf;
|
||||
echo ' function() {';
|
||||
echo $sCrLf;
|
||||
echo ' var scriptExists = false;';
|
||||
echo $sCrLf;
|
||||
echo ' try { if (';
|
||||
echo $aJsFile[1];
|
||||
echo '.isLoaded) scriptExists = true; }';
|
||||
echo $sCrLf;
|
||||
echo ' catch (e) {}';
|
||||
echo $sCrLf;
|
||||
echo ' if (!scriptExists) {';
|
||||
echo $sCrLf;
|
||||
echo ' alert("Error: the ';
|
||||
echo $aJsFile[1];
|
||||
echo ' Javascript component could not be included. Perhaps the URL is incorrect?\nURL: ';
|
||||
echo $sJsURI;
|
||||
echo $aJsFile[0];
|
||||
echo '");';
|
||||
echo $sCrLf;
|
||||
echo ' }';
|
||||
echo $sCrLf;
|
||||
echo ' }, ';
|
||||
echo $this->nScriptLoadTimeout;
|
||||
echo ');';
|
||||
echo $sCrLf;
|
||||
echo '/* ]]> */';
|
||||
echo $sCrLf;
|
||||
echo '<';
|
||||
echo '/script>';
|
||||
echo $sCrLf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: _getScriptFilename
|
||||
|
||||
Returns the name of the script file, based on the current settings.
|
||||
|
||||
sFilename - (string): The base filename.
|
||||
|
||||
Returns:
|
||||
|
||||
string - The filename as it should be specified in the script tags
|
||||
on the browser.
|
||||
*/
|
||||
function _getScriptFilename($sFilename)
|
||||
{
|
||||
if ($this->bUseUncompressedScripts) {
|
||||
return str_replace('.js', '_uncompressed.js', $sFilename);
|
||||
}
|
||||
return $sFilename;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Register the xajaxIncludeClientScriptPlugin object with the xajaxPluginManager.
|
||||
*/
|
||||
$objPluginManager =& xajaxPluginManager::getInstance();
|
||||
$objPluginManager->registerPlugin(new xajaxIncludeClientScriptPlugin(), 99);
|
229
lib/xajax/xajax_core/plugin_layer/xajaxEventPlugin.inc.php
Executable file
|
@ -0,0 +1,229 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxEventPlugin.inc.php
|
||||
|
||||
Contains the xajaxEventPlugin class
|
||||
|
||||
Title: xajaxEventPlugin class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxEventPlugin.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Constant: XAJAX_EVENT
|
||||
Specifies that the item being registered via the <xajax->register> function
|
||||
is an event.
|
||||
|
||||
Constant: XAJAX_EVENT_HANDLER
|
||||
Specifies that the item being registered via the <xajax->register> function
|
||||
is an event handler.
|
||||
*/
|
||||
if (!defined ('XAJAX_EVENT')) define ('XAJAX_EVENT', 'xajax event');
|
||||
if (!defined ('XAJAX_EVENT_HANDLER')) define ('XAJAX_EVENT_HANDLER', 'xajax event handler');
|
||||
|
||||
//SkipAIO
|
||||
require dirname(__FILE__) . '/support/xajaxEvent.inc.php';
|
||||
//EndSkipAIO
|
||||
|
||||
/*
|
||||
Class: xajaxEventPlugin
|
||||
|
||||
Plugin that adds server side event handling capabilities to xajax. Events can
|
||||
be registered, then event handlers attached.
|
||||
*/
|
||||
class xajaxEventPlugin extends xajaxRequestPlugin
|
||||
{
|
||||
/*
|
||||
Array: aEvents
|
||||
*/
|
||||
var $aEvents;
|
||||
|
||||
/*
|
||||
String: sXajaxPrefix
|
||||
*/
|
||||
var $sXajaxPrefix;
|
||||
|
||||
/*
|
||||
String: sEventPrefix
|
||||
*/
|
||||
var $sEventPrefix;
|
||||
|
||||
/*
|
||||
String: sDefer
|
||||
*/
|
||||
var $sDefer;
|
||||
|
||||
var $bDeferScriptGeneration;
|
||||
|
||||
/*
|
||||
String: sRequestedEvent
|
||||
*/
|
||||
var $sRequestedEvent;
|
||||
|
||||
/*
|
||||
Function: xajaxEventPlugin
|
||||
*/
|
||||
function xajaxEventPlugin()
|
||||
{
|
||||
$this->aEvents = array();
|
||||
|
||||
$this->sXajaxPrefix = 'xajax_';
|
||||
$this->sEventPrefix = 'event_';
|
||||
$this->sDefer = '';
|
||||
$this->bDeferScriptGeneration = false;
|
||||
|
||||
$this->sRequestedEvent = NULL;
|
||||
|
||||
if (isset($_GET['xjxevt'])) $this->sRequestedEvent = $_GET['xjxevt'];
|
||||
if (isset($_POST['xjxevt'])) $this->sRequestedEvent = $_POST['xjxevt'];
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
if ('wrapperPrefix' == $sName) {
|
||||
$this->sXajaxPrefix = $mValue;
|
||||
} else if ('eventPrefix' == $sName) {
|
||||
$this->sEventPrefix = $mValue;
|
||||
} else if ('scriptDefferal' == $sName) {
|
||||
if (true === $mValue) $this->sDefer = 'defer ';
|
||||
else $this->sDefer = '';
|
||||
} else if ('deferScriptGeneration' == $sName) {
|
||||
if (true === $mValue || false === $mValue)
|
||||
$this->bDeferScriptGeneration = $mValue;
|
||||
else if ('deferred' === $mValue)
|
||||
$this->bDeferScriptGeneration = $mValue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: register
|
||||
|
||||
$sType - (string): type of item being registered
|
||||
$sEvent - (string): the name of the event
|
||||
$ufHandler - (function name or reference): a reference to the user function to call
|
||||
$aConfiguration - (array): an array containing configuration options
|
||||
*/
|
||||
function register($aArgs)
|
||||
{
|
||||
if (1 < count($aArgs))
|
||||
{
|
||||
$sType = $aArgs[0];
|
||||
|
||||
if (XAJAX_EVENT == $sType)
|
||||
{
|
||||
$sEvent = $aArgs[1];
|
||||
|
||||
if (false === isset($this->aEvents[$sEvent]))
|
||||
{
|
||||
$xe =& new xajaxEvent($sEvent);
|
||||
|
||||
if (2 < count($aArgs))
|
||||
if (is_array($aArgs[2]))
|
||||
foreach ($aArgs[2] as $sKey => $sValue)
|
||||
$xe->configure($sKey, $sValue);
|
||||
|
||||
$this->aEvents[$sEvent] =& $xe;
|
||||
|
||||
return $xe->generateRequest($this->sXajaxPrefix, $this->sEventPrefix);
|
||||
}
|
||||
}
|
||||
|
||||
if (XAJAX_EVENT_HANDLER == $sType)
|
||||
{
|
||||
$sEvent = $aArgs[1];
|
||||
|
||||
if (isset($this->aEvents[$sEvent]))
|
||||
{
|
||||
if (isset($aArgs[2]))
|
||||
{
|
||||
$xuf =& $aArgs[2];
|
||||
|
||||
if (false === is_a($xuf, 'xajaxUserFunction'))
|
||||
$xuf =& new xajaxUserFunction($xuf);
|
||||
|
||||
$objEvent =& $this->aEvents[$sEvent];
|
||||
$objEvent->addHandler($xuf);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateClientScript
|
||||
*/
|
||||
function generateClientScript()
|
||||
{
|
||||
if (false === $this->bDeferScriptGeneration || 'deferred' === $this->bDeferScriptGeneration)
|
||||
{
|
||||
if (0 < count($this->aEvents))
|
||||
{
|
||||
echo "\n<script type='text/javascript' ";
|
||||
echo $this->sDefer;
|
||||
echo "charset='UTF-8'>\n";
|
||||
echo "/* <![CDATA[ */\n";
|
||||
|
||||
foreach (array_keys($this->aEvents) as $sKey)
|
||||
$this->aEvents[$sKey]->generateClientScript($this->sXajaxPrefix, $this->sEventPrefix);
|
||||
|
||||
echo "/* ]]> */\n";
|
||||
echo "</script>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: canProcessRequest
|
||||
*/
|
||||
function canProcessRequest()
|
||||
{
|
||||
if (NULL == $this->sRequestedEvent)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: processRequest
|
||||
*/
|
||||
function processRequest()
|
||||
{
|
||||
if (NULL == $this->sRequestedEvent)
|
||||
return false;
|
||||
|
||||
$objArgumentManager =& xajaxArgumentManager::getInstance();
|
||||
$aArgs = $objArgumentManager->process();
|
||||
|
||||
foreach (array_keys($this->aEvents) as $sKey)
|
||||
{
|
||||
$objEvent =& $this->aEvents[$sKey];
|
||||
|
||||
if ($objEvent->getName() == $this->sRequestedEvent)
|
||||
{
|
||||
$objEvent->fire($aArgs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return 'Invalid event request received; no event was registered with this name.';
|
||||
}
|
||||
}
|
||||
|
||||
$objPluginManager =& xajaxPluginManager::getInstance();
|
||||
$objPluginManager->registerPlugin(new xajaxEventPlugin(), 103);
|
231
lib/xajax/xajax_core/plugin_layer/xajaxFunctionPlugin.inc.php
Executable file
|
@ -0,0 +1,231 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxFunctionPlugin.inc.php
|
||||
|
||||
Contains the xajaxFunctionPlugin class
|
||||
|
||||
Title: xajaxFunctionPlugin class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxFunctionPlugin.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Constant: XAJAX_FUNCTION
|
||||
Specifies that the item being registered via the <xajax->register> function
|
||||
is a php function available at global scope, or a specific function from
|
||||
an instance of an object.
|
||||
*/
|
||||
if (!defined ('XAJAX_FUNCTION')) define ('XAJAX_FUNCTION', 'function');
|
||||
|
||||
// require_once is necessary here as the xajaxEvent class will include this also
|
||||
//SkipAIO
|
||||
require_once dirname(__FILE__) . '/support/xajaxUserFunction.inc.php';
|
||||
//EndSkipAIO
|
||||
|
||||
/*
|
||||
Class: xajaxFunctionPlugin
|
||||
*/
|
||||
class xajaxFunctionPlugin extends xajaxRequestPlugin
|
||||
{
|
||||
/*
|
||||
Array: aFunctions
|
||||
|
||||
An array of <xajaxUserFunction> object that are registered and
|
||||
available via a <xajax.request> call.
|
||||
*/
|
||||
var $aFunctions;
|
||||
|
||||
/*
|
||||
String: sXajaxPrefix
|
||||
|
||||
A configuration setting that is stored locally and used during
|
||||
the client script generation phase.
|
||||
*/
|
||||
var $sXajaxPrefix;
|
||||
|
||||
/*
|
||||
String: sDefer
|
||||
|
||||
Configuration option that can be used to request that the
|
||||
javascript file is loaded after the page has been fully loaded.
|
||||
*/
|
||||
var $sDefer;
|
||||
|
||||
var $bDeferScriptGeneration;
|
||||
|
||||
/*
|
||||
String: sRequestedFunction
|
||||
|
||||
This string is used to temporarily hold the name of the function
|
||||
that is being requested (during the request processing phase).
|
||||
|
||||
Since canProcessRequest loads this value from the get or post
|
||||
data, it is unnecessary to load it again.
|
||||
*/
|
||||
var $sRequestedFunction;
|
||||
|
||||
/*
|
||||
Function: xajaxFunctionPlugin
|
||||
|
||||
Constructs and initializes the <xajaxFunctionPlugin>. The GET and POST
|
||||
data is searched for xajax function call parameters. This will later
|
||||
be used to determine if the request is for a registered function in
|
||||
<xajaxFunctionPlugin->canProcessRequest>
|
||||
*/
|
||||
function xajaxFunctionPlugin()
|
||||
{
|
||||
$this->aFunctions = array();
|
||||
|
||||
$this->sXajaxPrefix = 'xajax_';
|
||||
$this->sDefer = '';
|
||||
$this->bDeferScriptGeneration = false;
|
||||
|
||||
$this->sRequestedFunction = NULL;
|
||||
|
||||
if (isset($_GET['xjxfun'])) $this->sRequestedFunction = $_GET['xjxfun'];
|
||||
if (isset($_POST['xjxfun'])) $this->sRequestedFunction = $_POST['xjxfun'];
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
|
||||
Sets/stores configuration options used by this plugin.
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
if ('wrapperPrefix' == $sName) {
|
||||
$this->sXajaxPrefix = $mValue;
|
||||
} else if ('scriptDefferal' == $sName) {
|
||||
if (true === $mValue) $this->sDefer = 'defer ';
|
||||
else $this->sDefer = '';
|
||||
} else if ('deferScriptGeneration' == $sName) {
|
||||
if (true === $mValue || false === $mValue)
|
||||
$this->bDeferScriptGeneration = $mValue;
|
||||
else if ('deferred' === $mValue)
|
||||
$this->bDeferScriptGeneration = $mValue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: register
|
||||
|
||||
Provides a mechanism for functions to be registered and made available to
|
||||
the page via the javascript <xajax.request> call.
|
||||
*/
|
||||
function register($aArgs)
|
||||
{
|
||||
if (1 < count($aArgs))
|
||||
{
|
||||
$sType = $aArgs[0];
|
||||
|
||||
if (XAJAX_FUNCTION == $sType)
|
||||
{
|
||||
$xuf =& $aArgs[1];
|
||||
|
||||
if (false === is_a($xuf, 'xajaxUserFunction'))
|
||||
$xuf =& new xajaxUserFunction($xuf);
|
||||
|
||||
if (2 < count($aArgs))
|
||||
if (is_array($aArgs[2]))
|
||||
foreach ($aArgs[2] as $sName => $sValue)
|
||||
$xuf->configure($sName, $sValue);
|
||||
|
||||
$this->aFunctions[] =& $xuf;
|
||||
|
||||
return $xuf->generateRequest($this->sXajaxPrefix);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateClientScript
|
||||
|
||||
Called by the <xajaxPluginManager> during the client script generation
|
||||
phase. This is used to generate a block of javascript code that will
|
||||
contain function declarations that can be used on the browser through
|
||||
javascript to initiate xajax requests.
|
||||
*/
|
||||
function generateClientScript()
|
||||
{
|
||||
if (false === $this->bDeferScriptGeneration || 'deferred' === $this->bDeferScriptGeneration)
|
||||
{
|
||||
if (0 < count($this->aFunctions))
|
||||
{
|
||||
echo "\n<script type='text/javascript' " . $this->sDefer . "charset='UTF-8'>\n";
|
||||
echo "/* <![CDATA[ */\n";
|
||||
|
||||
foreach (array_keys($this->aFunctions) as $sKey)
|
||||
$this->aFunctions[$sKey]->generateClientScript($this->sXajaxPrefix);
|
||||
|
||||
echo "/* ]]> */\n";
|
||||
echo "</script>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: canProcessRequest
|
||||
|
||||
Determines whether or not the current request can be processed
|
||||
by this plugin.
|
||||
|
||||
Returns:
|
||||
|
||||
boolean - True if the current request can be handled by this plugin;
|
||||
false otherwise.
|
||||
*/
|
||||
function canProcessRequest()
|
||||
{
|
||||
if (NULL == $this->sRequestedFunction)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: processRequest
|
||||
|
||||
Called by the <xajaxPluginManager> when a request needs to be
|
||||
processed.
|
||||
|
||||
Returns:
|
||||
|
||||
mixed - True when the request has been processed successfully.
|
||||
An error message when an error has occurred.
|
||||
*/
|
||||
function processRequest()
|
||||
{
|
||||
if (NULL == $this->sRequestedFunction)
|
||||
return false;
|
||||
|
||||
$objArgumentManager =& xajaxArgumentManager::getInstance();
|
||||
$aArgs = $objArgumentManager->process();
|
||||
|
||||
foreach (array_keys($this->aFunctions) as $sKey)
|
||||
{
|
||||
$xuf =& $this->aFunctions[$sKey];
|
||||
|
||||
if ($xuf->getName() == $this->sRequestedFunction)
|
||||
{
|
||||
$xuf->call($aArgs);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return 'Invalid function request received; no request processor found with this name.';
|
||||
}
|
||||
}
|
||||
|
||||
$objPluginManager =& xajaxPluginManager::getInstance();
|
||||
$objPluginManager->registerPlugin(new xajaxFunctionPlugin(), 100);
|
266
lib/xajax/xajax_core/plugin_layer/xajaxScriptPlugin.inc.php
Executable file
|
@ -0,0 +1,266 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxScriptPlugin.inc.php
|
||||
|
||||
Contains the xajaxScriptPlugin class declaration.
|
||||
|
||||
Title: xajaxScriptPlugin class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxScriptPlugin.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Class: xajaxScriptPlugin
|
||||
|
||||
Contains the code that can produce script and style data during deferred script
|
||||
generation. This allows the xajax generated javascript and style sheet information
|
||||
to be loaded via an external file reference instead of inlined into the page
|
||||
source.
|
||||
*/
|
||||
class xajaxScriptPlugin extends xajaxRequestPlugin
|
||||
{
|
||||
/*
|
||||
String: sRequest
|
||||
*/
|
||||
var $sRequest;
|
||||
|
||||
/*
|
||||
String: sHash
|
||||
*/
|
||||
var $sHash;
|
||||
|
||||
/*
|
||||
String: sRequestURI
|
||||
*/
|
||||
var $sRequestURI;
|
||||
|
||||
/*
|
||||
Boolean: bDeferScriptGeneration
|
||||
*/
|
||||
var $bDeferScriptGeneration;
|
||||
|
||||
/*
|
||||
Boolean: bValidateHash
|
||||
*/
|
||||
var $bValidateHash;
|
||||
|
||||
/*
|
||||
Boolean: bWorking
|
||||
*/
|
||||
var $bWorking;
|
||||
|
||||
/*
|
||||
Function: xajaxScriptPlugin
|
||||
|
||||
Construct and initialize the xajax script plugin object. During
|
||||
initialization, this plugin will look for hash codes in the
|
||||
GET data (parameters passed on the request URI) and store them
|
||||
for later use.
|
||||
*/
|
||||
function xajaxScriptPlugin()
|
||||
{
|
||||
$this->sRequestURI = '';
|
||||
$this->bDeferScriptGeneration = false;
|
||||
$this->bValidateHash = true;
|
||||
|
||||
$this->bWorking = false;
|
||||
|
||||
$this->sRequest = '';
|
||||
$this->sHash = null;
|
||||
|
||||
if (isset($_GET['xjxGenerateJavascript'])) {
|
||||
$this->sRequest = 'script';
|
||||
$this->sHash = $_GET['xjxGenerateJavascript'];
|
||||
}
|
||||
|
||||
if (isset($_GET['xjxGenerateStyle'])) {
|
||||
$this->sRequest = 'style';
|
||||
$this->sHash = $_GET['xjxGenerateStyle'];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
|
||||
Sets/stores configuration options used by this plugin. See also:
|
||||
<xajax::configure>. This plugin will watch for and store the current
|
||||
setting for the following configuration options:
|
||||
|
||||
- <requestURI> (string): The requestURI of the current script file.
|
||||
- <deferScriptGeneration> (boolean): A flag that indicates whether
|
||||
script deferral is in effect or not.
|
||||
- <deferScriptValidateHash> (boolean): A flag that indicates whether
|
||||
or not the script hash should be validated.
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
if ('requestURI' == $sName) {
|
||||
$this->sRequestURI = $mValue;
|
||||
} else if ('deferScriptGeneration' == $sName) {
|
||||
if (true === $mValue || false === $mValue)
|
||||
$this->bDeferScriptGeneration = $mValue;
|
||||
} else if ('deferScriptValidateHash' == $sName) {
|
||||
if (true === $mValue || false === $mValue)
|
||||
$this->bValidateHash = $mValue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateClientScript
|
||||
|
||||
Called by the <xajaxPluginManager> when the text of the client script
|
||||
(or style) declarations are needed.
|
||||
|
||||
This function will only output script or style information if the
|
||||
request URI contained an appropriate hash code and script deferral
|
||||
is in effect.
|
||||
*/
|
||||
function generateClientScript()
|
||||
{
|
||||
if ($this->bWorking)
|
||||
return;
|
||||
|
||||
if (true === $this->bDeferScriptGeneration)
|
||||
{
|
||||
$this->bWorking = true;
|
||||
|
||||
$sQueryBase = '?';
|
||||
if (0 < strpos($this->sRequestURI, '?'))
|
||||
$sQueryBase = '&';
|
||||
|
||||
$aScripts = $this->_getSections('script');
|
||||
if (0 < count($aScripts))
|
||||
{
|
||||
// echo "<!--" . print_r($aScripts, true) . "-->";
|
||||
|
||||
$sHash = md5(implode($aScripts));
|
||||
$sQuery = $sQueryBase . "xjxGenerateJavascript=" . $sHash;
|
||||
|
||||
echo "\n<script type='text/javascript' src='" . $this->sRequestURI . $sQuery . "' charset='UTF-8'></script>\n";
|
||||
}
|
||||
|
||||
$aStyles = $this->_getSections('style');
|
||||
if (0 < count($aStyles))
|
||||
{
|
||||
// echo "<!--" . print_r($aStyles, true) . "-->";
|
||||
|
||||
$sHash = md5(implode($aStyles));
|
||||
$sQuery = $sQueryBase . "xjxGenerateStyle=" . $sHash;
|
||||
|
||||
echo "\n<link href='" . $this->sRequestURI . $sQuery . "' rel='Stylesheet' />\n";
|
||||
}
|
||||
|
||||
$this->bWorking = false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: canProcessRequest
|
||||
|
||||
Called by the <xajaxPluginManager> to determine if this plugin can
|
||||
process the current request. This will return true when the
|
||||
requestURI contains an appropriate hash code.
|
||||
*/
|
||||
function canProcessRequest()
|
||||
{
|
||||
return ('' != $this->sRequest);
|
||||
}
|
||||
|
||||
function &_getSections($sType)
|
||||
{
|
||||
$objPluginManager =& xajaxPluginManager::getInstance();
|
||||
|
||||
$objPluginManager->configure('deferScriptGeneration', 'deferred');
|
||||
|
||||
$aSections = array();
|
||||
|
||||
// buffer output
|
||||
|
||||
ob_start();
|
||||
$objPluginManager->generateClientScript();
|
||||
$sScript = ob_get_clean();
|
||||
|
||||
// parse out blocks
|
||||
|
||||
$aParts = explode('</' . $sType . '>', $sScript);
|
||||
foreach ($aParts as $sPart)
|
||||
{
|
||||
$aValues = explode('<' . $sType, $sPart, 2);
|
||||
if (2 == count($aValues))
|
||||
{
|
||||
list($sJunk, $sPart) = $aValues;
|
||||
|
||||
$aValues = explode('>', $sPart, 2);
|
||||
if (2 == count($aValues))
|
||||
{
|
||||
list($sJunk, $sPart) = $aValues;
|
||||
|
||||
if (0 < strlen($sPart))
|
||||
$aSections[] = $sPart;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$objPluginManager->configure('deferScriptGeneration', $this->bDeferScriptGeneration);
|
||||
|
||||
return $aSections;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: processRequest
|
||||
|
||||
Called by the <xajaxPluginManager> when the current request should be
|
||||
processed. This plugin will generate the javascript or style sheet information
|
||||
that would normally be output by the other xajax plugin objects, when script
|
||||
deferral is in effect. If script deferral is disabled, this function returns
|
||||
without performing any functions.
|
||||
*/
|
||||
function processRequest()
|
||||
{
|
||||
if ($this->canProcessRequest())
|
||||
{
|
||||
$aSections =& $this->_getSections($this->sRequest);
|
||||
|
||||
// echo "<!--" . print_r($aSections, true) . "-->";
|
||||
|
||||
// validate the hash
|
||||
$sHash = md5(implode($aSections));
|
||||
if (false == $this->bValidateHash || $sHash == $this->sHash)
|
||||
{
|
||||
$sType = 'text/javascript';
|
||||
if ('style' == $this->sRequest)
|
||||
$sType = 'text/css';
|
||||
|
||||
$objResponse =& new xajaxCustomResponse($sType);
|
||||
|
||||
foreach ($aSections as $sSection)
|
||||
$objResponse->append($sSection . "\n");
|
||||
|
||||
$objResponseManager =& xajaxResponseManager::getInstance();
|
||||
$objResponseManager->append($objResponse);
|
||||
|
||||
header ('Expires: ' . gmdate('D, d M Y H:i:s', time() + (60*60*24)) . ' GMT');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return 'Invalid script or style request.';
|
||||
trigger_error('Hash mismatch: ' . $this->sRequest . ': ' . $sHash . ' <==> ' . $this->sHash, E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Register the plugin with the xajax plugin manager.
|
||||
*/
|
||||
$objPluginManager =& xajaxPluginManager::getInstance();
|
||||
$objPluginManager->registerPlugin(new xajaxScriptPlugin(), 9999);
|
1423
lib/xajax/xajax_core/xajax.inc.php
Executable file
466
lib/xajax/xajax_core/xajaxArgumentManager.inc.php
Executable file
|
@ -0,0 +1,466 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxArgumentManager.inc.php
|
||||
|
||||
Contains the xajaxArgumentManager class
|
||||
|
||||
Title: xajaxArgumentManager class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxArgumentManager.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
if (!defined('XAJAX_METHOD_UNKNOWN')) define('XAJAX_METHOD_UNKNOWN', 0);
|
||||
if (!defined('XAJAX_METHOD_GET')) define('XAJAX_METHOD_GET', 1);
|
||||
if (!defined('XAJAX_METHOD_POST')) define('XAJAX_METHOD_POST', 2);
|
||||
|
||||
/*
|
||||
Class: xajaxArgumentManager
|
||||
|
||||
This class processes the input arguments from the GET or POST data of
|
||||
the request. If this is a request for the initial page load, no arguments
|
||||
will be processed. During a xajax request, any arguments found in the
|
||||
GET or POST will be converted to a PHP array.
|
||||
*/
|
||||
class xajaxArgumentManager
|
||||
{
|
||||
/*
|
||||
Array: aArgs
|
||||
|
||||
An array of arguments received via the GET or POST parameter
|
||||
xjxargs.
|
||||
*/
|
||||
var $aArgs;
|
||||
|
||||
/*
|
||||
Boolean: bDecodeUTF8Input
|
||||
|
||||
A configuration option used to indicate whether input data should be
|
||||
UTF8 decoded automatically.
|
||||
*/
|
||||
var $bDecodeUTF8Input;
|
||||
|
||||
/*
|
||||
String: sCharacterEncoding
|
||||
|
||||
The character encoding in which the input data will be received.
|
||||
*/
|
||||
var $sCharacterEncoding;
|
||||
|
||||
/*
|
||||
Integer: nMethod
|
||||
|
||||
Stores the method that was used to send the arguments from the client. Will
|
||||
be one of: XAJAX_METHOD_UNKNOWN, XAJAX_METHOD_GET, XAJAX_METHOD_POST
|
||||
*/
|
||||
var $nMethod;
|
||||
|
||||
/*
|
||||
Array: aSequence
|
||||
|
||||
Stores the decoding sequence table.
|
||||
*/
|
||||
var $aSequence;
|
||||
|
||||
/*
|
||||
Function: convertStringToBool
|
||||
|
||||
Converts a string to a bool var.
|
||||
|
||||
Parameters:
|
||||
$sValue - (string):
|
||||
|
||||
Returns:
|
||||
(bool) : true / false
|
||||
|
||||
*/
|
||||
|
||||
function convertStringToBool($sValue)
|
||||
{
|
||||
if (0 == strcasecmp($sValue, 'true'))
|
||||
return true;
|
||||
if (0 == strcasecmp($sValue, 'false'))
|
||||
return false;
|
||||
if (is_numeric($sValue))
|
||||
{
|
||||
if (0 == $sValue)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function argumentStripSlashes(&$sArg)
|
||||
{
|
||||
if (false == is_string($sArg))
|
||||
return;
|
||||
|
||||
$sArg = stripslashes($sArg);
|
||||
}
|
||||
|
||||
function argumentDecodeXML(&$sArg)
|
||||
{
|
||||
if (false == is_string($sArg))
|
||||
return;
|
||||
|
||||
if (0 == strlen($sArg))
|
||||
return;
|
||||
|
||||
$nStackDepth = 0;
|
||||
$aStack = array();
|
||||
$aArg = array();
|
||||
|
||||
$nCurrent = 0;
|
||||
$nLast = 0;
|
||||
$aExpecting = array();
|
||||
$nFound = 0;
|
||||
list($aExpecting, $nFound) = $this->aSequence['start'];
|
||||
|
||||
$nLength = strlen($sArg);
|
||||
|
||||
$sKey = '';
|
||||
$mValue = '';
|
||||
|
||||
while ($nCurrent < $nLength)
|
||||
{
|
||||
$bFound = false;
|
||||
|
||||
foreach ($aExpecting as $sExpecting => $nExpectedLength)
|
||||
{
|
||||
if ($sArg[$nCurrent] == $sExpecting[0])
|
||||
{
|
||||
if ($sExpecting == substr($sArg, $nCurrent, $nExpectedLength))
|
||||
{
|
||||
list($aExpecting, $nFound) = $this->aSequence[$sExpecting];
|
||||
|
||||
switch ($nFound)
|
||||
{
|
||||
case 3: // k
|
||||
$sKey = '';
|
||||
break;
|
||||
case 4: // /k
|
||||
$sKey = str_replace(
|
||||
array('<'.'![CDATA[', ']]>'),
|
||||
'',
|
||||
substr($sArg, $nLast, $nCurrent - $nLast)
|
||||
);
|
||||
break;
|
||||
case 5: // v
|
||||
$mValue = '';
|
||||
break;
|
||||
case 6: // /v
|
||||
if ($nLast < $nCurrent)
|
||||
{
|
||||
$mValue = str_replace(
|
||||
array('<'.'![CDATA[', ']]>'),
|
||||
'',
|
||||
substr($sArg, $nLast, $nCurrent - $nLast)
|
||||
);
|
||||
|
||||
$cType = substr($mValue, 0, 1);
|
||||
$sValue = substr($mValue, 1);
|
||||
switch ($cType) {
|
||||
case 'S': $mValue = false === $sValue ? '' : $sValue; break;
|
||||
case 'B': $mValue = $this->convertStringToBool($sValue); break;
|
||||
case 'N': $mValue = floatval($sValue); break;
|
||||
case '*': $mValue = null; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7: // /e
|
||||
$aArg[$sKey] = $mValue;
|
||||
break;
|
||||
case 1: // xjxobj
|
||||
++$nStackDepth;
|
||||
array_push($aStack, $aArg);
|
||||
$aArg = array();
|
||||
array_push($aStack, $sKey);
|
||||
$sKey = '';
|
||||
break;
|
||||
case 8: // /xjxobj
|
||||
if (1 < $nStackDepth) {
|
||||
$mValue = $aArg;
|
||||
$sKey = array_pop($aStack);
|
||||
$aArg = array_pop($aStack);
|
||||
--$nStackDepth;
|
||||
} else {
|
||||
$sArg = $aArg;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
$nCurrent += $nExpectedLength;
|
||||
$nLast = $nCurrent;
|
||||
$bFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (false == $bFound)
|
||||
{
|
||||
if (0 == $nCurrent)
|
||||
{
|
||||
$sArg = str_replace(
|
||||
array('<'.'![CDATA[', ']]>'),
|
||||
'',
|
||||
$sArg
|
||||
);
|
||||
|
||||
$cType = substr($sArg, 0, 1);
|
||||
$sValue = substr($sArg, 1);
|
||||
switch ($cType) {
|
||||
case 'S': $sArg = false === $sValue ? '' : $sValue; break;
|
||||
case 'B': $sArg = $this->convertStringToBool($sValue); break;
|
||||
case 'N': $sArg = floatval($sValue); break;
|
||||
case '*': $sArg = null; break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// for larger arg data, performance may suffer using concatenation
|
||||
// $sText .= $sArg[$nCurrent];
|
||||
$nCurrent++;
|
||||
}
|
||||
}
|
||||
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('ARGMGR:ERR:01')
|
||||
. $sExpecting
|
||||
. $objLanguageManager->getText('ARGMGR:ERR:02')
|
||||
. $sArg
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
function argumentDecodeUTF8_iconv(&$mArg)
|
||||
{
|
||||
if (is_array($mArg))
|
||||
{
|
||||
foreach (array_keys($mArg) as $sKey)
|
||||
{
|
||||
$sNewKey = $sKey;
|
||||
$this->argumentDecodeUTF8_iconv($sNewKey);
|
||||
|
||||
if ($sNewKey != $sKey)
|
||||
{
|
||||
$mArg[$sNewKey] = $mArg[$sKey];
|
||||
unset($mArg[$sKey]);
|
||||
$sKey = $sNewKey;
|
||||
}
|
||||
|
||||
$this->argumentDecodeUTF8_iconv($mArg[$sKey]);
|
||||
}
|
||||
}
|
||||
else if (is_string($mArg))
|
||||
$mArg = iconv("UTF-8", $this->sCharacterEncoding.'//TRANSLIT', $mArg);
|
||||
}
|
||||
|
||||
function argumentDecodeUTF8_mb_convert_encoding(&$mArg)
|
||||
{
|
||||
if (is_array($mArg))
|
||||
{
|
||||
foreach (array_keys($mArg) as $sKey)
|
||||
{
|
||||
$sNewKey = $sKey;
|
||||
$this->argumentDecodeUTF8_mb_convert_encoding($sNewKey);
|
||||
|
||||
if ($sNewKey != $sKey)
|
||||
{
|
||||
$mArg[$sNewKey] = $mArg[$sKey];
|
||||
unset($mArg[$sKey]);
|
||||
$sKey = $sNewKey;
|
||||
}
|
||||
|
||||
$this->argumentDecodeUTF8_mb_convert_encoding($mArg[$sKey]);
|
||||
}
|
||||
}
|
||||
else if (is_string($mArg))
|
||||
$mArg = mb_convert_encoding($mArg, $this->sCharacterEncoding, "UTF-8");
|
||||
}
|
||||
|
||||
function argumentDecodeUTF8_utf8_decode(&$mArg)
|
||||
{
|
||||
if (is_array($mArg))
|
||||
{
|
||||
foreach (array_keys($mArg) as $sKey)
|
||||
{
|
||||
$sNewKey = $sKey;
|
||||
$this->argumentDecodeUTF8_utf8_decode($sNewKey);
|
||||
|
||||
if ($sNewKey != $sKey)
|
||||
{
|
||||
$mArg[$sNewKey] = $mArg[$sKey];
|
||||
unset($mArg[$sKey]);
|
||||
$sKey = $sNewKey;
|
||||
}
|
||||
|
||||
$this->argumentDecodeUTF8_utf8_decode($mArg[$sKey]);
|
||||
}
|
||||
}
|
||||
else if (is_string($mArg))
|
||||
$mArg = utf8_decode($mArg);
|
||||
}
|
||||
|
||||
/*
|
||||
Constructor: xajaxArgumentManager
|
||||
|
||||
Initializes configuration settings to their default values and reads
|
||||
the argument data from the GET or POST data.
|
||||
*/
|
||||
function xajaxArgumentManager()
|
||||
{
|
||||
$this->aArgs = array();
|
||||
|
||||
$this->bDecodeUTF8Input = false;
|
||||
$this->sCharacterEncoding = 'UTF-8';
|
||||
$this->nMethod = XAJAX_METHOD_UNKNOWN;
|
||||
|
||||
$this->aSequence = array(
|
||||
'<'.'k'.'>' => array(array(
|
||||
'<'.'/k'.'>' => 4
|
||||
), 3),
|
||||
'<'.'/k'.'>' => array(array(
|
||||
'<'.'v'.'>' => 3,
|
||||
'<'.'/e'.'>' => 4
|
||||
), 4),
|
||||
'<'.'v'.'>' => array(array(
|
||||
'<'.'xjxobj'.'>' => 8,
|
||||
'<'.'/v'.'>' => 4
|
||||
), 5),
|
||||
'<'.'/v'.'>' => array(array(
|
||||
'<'.'/e'.'>' => 4,
|
||||
'<'.'k'.'>' => 3
|
||||
), 6),
|
||||
'<'.'e'.'>' => array(array(
|
||||
'<'.'k'.'>' => 3,
|
||||
'<'.'v'.'>' => 3,
|
||||
'<'.'/e'.'>' => 4
|
||||
), 2),
|
||||
'<'.'/e'.'>' => array(array(
|
||||
'<'.'e'.'>' => 3,
|
||||
'<'.'/xjxobj'.'>' => 9
|
||||
), 7),
|
||||
'<'.'xjxobj'.'>' => array(array(
|
||||
'<'.'e'.'>' => 3,
|
||||
'<'.'/xjxobj'.'>' => 9
|
||||
), 1),
|
||||
'<'.'/xjxobj'.'>' => array(array(
|
||||
'<'.'/v'.'>' => 4
|
||||
), 8),
|
||||
'start' => array(array(
|
||||
'<'.'xjxobj'.'>' => 8
|
||||
), 9)
|
||||
);
|
||||
|
||||
if (isset($_POST['xjxargs'])) {
|
||||
$this->nMethod = XAJAX_METHOD_POST;
|
||||
$this->aArgs = $_POST['xjxargs'];
|
||||
} else if (isset($_GET['xjxargs'])) {
|
||||
$this->nMethod = XAJAX_METHOD_GET;
|
||||
$this->aArgs = $_GET['xjxargs'];
|
||||
}
|
||||
|
||||
if (1 == get_magic_quotes_gpc())
|
||||
array_walk($this->aArgs, array(&$this, 'argumentStripSlashes'));
|
||||
|
||||
array_walk($this->aArgs, array(&$this, 'argumentDecodeXML'));
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getInstance
|
||||
|
||||
Returns:
|
||||
|
||||
object - A reference to an instance of this class. This function is
|
||||
used to implement the singleton pattern.
|
||||
*/
|
||||
function &getInstance()
|
||||
{
|
||||
static $obj;
|
||||
if (!$obj) {
|
||||
$obj = new xajaxArgumentManager();
|
||||
}
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
|
||||
Accepts configuration settings from the main <xajax> object.
|
||||
|
||||
Parameters:
|
||||
|
||||
|
||||
The <xajaxArgumentManager> tracks the following configuration settings:
|
||||
|
||||
<decodeUTF8Input> - (boolean): See <xajaxArgumentManager->bDecodeUTF8Input>
|
||||
<characterEncoding> - (string): See <xajaxArgumentManager->sCharacterEncoding>
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
if ('decodeUTF8Input' == $sName) {
|
||||
if (true === $mValue || false === $mValue)
|
||||
$this->bDecodeUTF8Input = $mValue;
|
||||
} else if ('characterEncoding' == $sName) {
|
||||
$this->sCharacterEncoding = $mValue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getRequestMethod
|
||||
|
||||
Returns the method that was used to send the arguments from the client.
|
||||
*/
|
||||
function getRequestMethod()
|
||||
{
|
||||
return $this->nMethod;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: process
|
||||
|
||||
Returns the array of arguments that were extracted and parsed from
|
||||
the GET or POST data.
|
||||
*/
|
||||
function process()
|
||||
{
|
||||
if ($this->bDecodeUTF8Input)
|
||||
{
|
||||
$sFunction = '';
|
||||
|
||||
if (function_exists('iconv'))
|
||||
$sFunction = "iconv";
|
||||
else if (function_exists('mb_convert_encoding'))
|
||||
$sFunction = "mb_convert_encoding";
|
||||
else if ($this->sCharacterEncoding == "ISO-8859-1")
|
||||
$sFunction = "utf8_decode";
|
||||
else {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('ARGMGR:ERR:03')
|
||||
, E_USER_NOTICE
|
||||
);
|
||||
}
|
||||
|
||||
$mFunction = array(&$this, 'argumentDecodeUTF8_' . $sFunction);
|
||||
|
||||
array_walk($this->aArgs, $mFunction);
|
||||
|
||||
$this->bDecodeUTF8Input = false;
|
||||
}
|
||||
|
||||
return $this->aArgs;
|
||||
}
|
||||
}
|
389
lib/xajax/xajax_core/xajaxCall.inc.php
Executable file
|
@ -0,0 +1,389 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxCall.inc.php
|
||||
|
||||
Contains the xajaxCall class
|
||||
|
||||
Title: xajaxCall class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxCall.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Class: xajaxCall
|
||||
|
||||
Create a piece of javascript code that will invoke the <xajax.call>
|
||||
function.
|
||||
|
||||
This class is deprecated and will be removed in future versions; please use
|
||||
<xajaxRequest> instead.
|
||||
*/
|
||||
class xajaxCall {
|
||||
|
||||
/**#@+
|
||||
* @access protected
|
||||
*/
|
||||
|
||||
/*
|
||||
String: sFunction
|
||||
|
||||
Required: The name of the xajax enabled function to call
|
||||
*/
|
||||
var $sFunction;
|
||||
|
||||
/*
|
||||
String: sReturnValue
|
||||
|
||||
Required: The value to return once the <xajax.call> has
|
||||
returned. (for asynchronous calls, this is immediate)
|
||||
*/
|
||||
var $sReturnValue;
|
||||
|
||||
/*
|
||||
Array: aParameters
|
||||
|
||||
The associative array that will be used to store the parameters for this
|
||||
call.
|
||||
- key: The textual representation of the parameter.
|
||||
- value: A boolean value indicating whether or not to use quotes around
|
||||
this parameter.
|
||||
*/
|
||||
var $aParameters;
|
||||
|
||||
/*
|
||||
String: sMode
|
||||
|
||||
The mode to use for the call
|
||||
- 'synchronous'
|
||||
- 'asynchronous'
|
||||
*/
|
||||
var $sMode;
|
||||
|
||||
/*
|
||||
String: sRequestType
|
||||
|
||||
The request type that will be used for the call
|
||||
- 'GET'
|
||||
- 'POST'
|
||||
*/
|
||||
var $sRequestType;
|
||||
|
||||
/*
|
||||
String: sResponseProcessor
|
||||
|
||||
The name of the javascript function that will be invoked
|
||||
to handle the response.
|
||||
*/
|
||||
var $sResponseProcessor;
|
||||
|
||||
/*
|
||||
String: sRequestURI
|
||||
|
||||
The URI for where this request will be sent.
|
||||
*/
|
||||
var $sRequestURI;
|
||||
|
||||
/*
|
||||
String: sContentType
|
||||
|
||||
The content type to use for the request.
|
||||
*/
|
||||
var $sContentType;
|
||||
|
||||
/*
|
||||
Constructor: xajaxCall
|
||||
|
||||
Initializes the xajaxCall object.
|
||||
|
||||
Parameters:
|
||||
|
||||
sFunction - (string): The name of the xajax enabled function
|
||||
that will be invoked when this javascript code is executed
|
||||
on the browser. This function name should match a PHP
|
||||
function from your script.
|
||||
*/
|
||||
function xajaxCall($sFunction = '') {
|
||||
$this->sFunction = $sFunction;
|
||||
$this->aParameters = array();
|
||||
$this->sMode = '';
|
||||
$this->sRequestType = '';
|
||||
$this->sResponseProcessor = '';
|
||||
$this->sRequestURI = '';
|
||||
$this->sContentType = '';
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setFunction
|
||||
|
||||
Override the function name set in the constructor.
|
||||
|
||||
Parameters:
|
||||
|
||||
sFunction - (string): The name of the xajax enabled function
|
||||
that will be invoked when this javascript code is executed
|
||||
on the browser. This function name should match a PHP
|
||||
function from your script.
|
||||
|
||||
Returns:
|
||||
|
||||
object : The <xajaxCall> object.
|
||||
*/
|
||||
function setFunction($sFunction) {
|
||||
$this->sFunction = $sFunction;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: clearParameters
|
||||
|
||||
Clear the list of parameters being accumulated for this
|
||||
call.
|
||||
|
||||
Returns:
|
||||
|
||||
object : The <xajaxCall> object.
|
||||
*/
|
||||
function clearParameters() {
|
||||
$this->aParameters = array();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: addParameter
|
||||
|
||||
Adds a parameter to the list that will be specified for the
|
||||
request generated by this <xajaxCall> object.
|
||||
|
||||
Parameters:
|
||||
|
||||
sParameter - (string): The parameter value or name.
|
||||
bUseQuotes - (boolean): Whether or not to put quotes around this value.
|
||||
|
||||
If you specify the name of a javascript variable, or provide a javascript
|
||||
function call as a parameter, do not use quotes around the value.
|
||||
|
||||
Returns:
|
||||
|
||||
object : The <xajaxCall> object.
|
||||
*/
|
||||
function addParameter($sParameter, $bUseQuotes = true) {
|
||||
$this->aParameters[] = array($sParameter, $bUseQuotes);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: addFormValuesParameter
|
||||
|
||||
Add a parameter value that is the result of calling <xajax.getFormValues>
|
||||
for the specified form.
|
||||
|
||||
Parameters:
|
||||
|
||||
sFormID - (string): The id of the form for which you wish to return
|
||||
the input values.
|
||||
|
||||
Returns:
|
||||
|
||||
object : The <xajaxCall> object.
|
||||
*/
|
||||
function addFormValuesParameter($sFormID) {
|
||||
$this->aParameters[] = array('xajax.getFormValues("'.$sFormID.'")');
|
||||
return $this;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setMode
|
||||
|
||||
Sets the mode that will be specified for this <xajax.call>
|
||||
|
||||
Parameters:
|
||||
|
||||
$sMode - (string): The mode to be set.
|
||||
- 'synchronous'
|
||||
- 'asynchronous'
|
||||
|
||||
Returns:
|
||||
|
||||
object : The <xajaxCall> object.
|
||||
*/
|
||||
function setMode($sMode) {
|
||||
$this->sMode = $sMode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setRequestType
|
||||
|
||||
Sets the request type which will be specified for the
|
||||
generated <xajax.call>.
|
||||
|
||||
Parameters:
|
||||
|
||||
- 'GET'
|
||||
- 'POST'
|
||||
|
||||
Returns:
|
||||
|
||||
object : The <xajaxCall> object.
|
||||
*/
|
||||
function setRequestType($sRequestType) {
|
||||
$this->sRequestType = $sRequestType;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setResponseProcessor
|
||||
|
||||
Sets the name of the javascript function that will be used
|
||||
to process this response. This is an advanced function, use
|
||||
with caution.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
object : The <xajaxCall> object.
|
||||
*/
|
||||
function setResponseProcessor($sResponseProcessor) {
|
||||
$this->sResponseProcessor = $sResponseProcessor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setRequestURI
|
||||
|
||||
Override the default URI with the specified one.
|
||||
|
||||
Parameters:
|
||||
|
||||
sRequestURI - (string): The URI that the generated request will be sent
|
||||
to.
|
||||
|
||||
Returns:
|
||||
|
||||
object : The <xajaxCall> object.
|
||||
*/
|
||||
function setRequestURI($sRequestURI) {
|
||||
$this->sRequestURI = $sRequestURI;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setContentType
|
||||
|
||||
Sets the content type that will be used by the generated request.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
object : The <xajaxCall> object.
|
||||
*/
|
||||
function setContentType($sContentType) {
|
||||
$this->sContentType = $sContentType;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setReturnValue
|
||||
|
||||
Sets the value that will be returned after the generated call.
|
||||
Set to an empty string if no return value is desired.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
object : The <xajaxCall> object.
|
||||
*/
|
||||
function setReturnValue($sReturnValue) {
|
||||
$this->sReturnValue = $sReturnValue;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generate
|
||||
|
||||
Construct a <xajax.call> statement in javascript that can be used
|
||||
to make a xajax request with the parameters and settings previously
|
||||
configured for this <xajaxCall> object.
|
||||
|
||||
The output from this function can be used as an event handler in your
|
||||
javascript code.
|
||||
|
||||
Returns:
|
||||
|
||||
string - The javascript statement that will invoked the <xajax.call>
|
||||
function on the browser, causing a xajax request to be sent to
|
||||
the server.
|
||||
*/
|
||||
function generate() {
|
||||
$output = 'xajax.call("';
|
||||
$output .= $this->sFunction;
|
||||
$output .= '", {';
|
||||
$separator = '';
|
||||
if (0 < count($this->aParameters)) {
|
||||
$output .= 'parameters: [';
|
||||
foreach ($this->aParameters as $aParameter) {
|
||||
$output .= $separator;
|
||||
$bUseQuotes = $aParameter[1];
|
||||
if ($bUseQuotes)
|
||||
$output .= '"';
|
||||
$output .= $aParameter[0];
|
||||
if ($bUseQuotes)
|
||||
$output .= '"';
|
||||
$separator = ',';
|
||||
}
|
||||
$output .= ']';
|
||||
}
|
||||
if (0 < strlen($this->sMode)) {
|
||||
$output .= $separator;
|
||||
$output .= 'mode:"';
|
||||
$output .= $this->sMode;
|
||||
$output .= '"';
|
||||
$separator = ',';
|
||||
}
|
||||
if (0 < strlen($this->sRequestType)) {
|
||||
$output .= $separator;
|
||||
$output .= 'requestType:"';
|
||||
$output .= $this->sRequestType;
|
||||
$output .= '"';
|
||||
$separator = ',';
|
||||
}
|
||||
if (0 < strlen($this->sResponseProcessor)) {
|
||||
$output .= $separator;
|
||||
$output .= 'responseProcessor:';
|
||||
$output .= $this->sResponseProcessor;
|
||||
$separator = ',';
|
||||
}
|
||||
if (0 < strlen($this->sRequestURI)) {
|
||||
$output .= $separator;
|
||||
$output .= 'requestURI:"';
|
||||
$output .= $this->sRequestURI;
|
||||
$output .= '"';
|
||||
$separator = ',';
|
||||
}
|
||||
if (0 < strlen($this->sContentType)) {
|
||||
$output .= $separator;
|
||||
$output .= 'contentType:"';
|
||||
$output .= $this->sContentType;
|
||||
$output .= '"';
|
||||
$separator = ',';
|
||||
}
|
||||
$output .= '}); ';
|
||||
if (0 < strlen($this->sReturnValue)) {
|
||||
$output .= 'return ';
|
||||
$output .= $this->sReturnValue;
|
||||
} else {
|
||||
$output .= 'return false;';
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
148
lib/xajax/xajax_core/xajaxCompress.inc.php
Executable file
|
@ -0,0 +1,148 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Function: xajaxCompressFile
|
||||
|
||||
<xajax> will call this function internally to compress the javascript code for
|
||||
more efficient delivery.
|
||||
|
||||
Parameters:
|
||||
|
||||
$sFile - (stirng): The file to be compressed.
|
||||
*/
|
||||
function xajaxCompressFile($sFile)
|
||||
{
|
||||
//remove windows cariage returns
|
||||
$sFile = str_replace("\r",'',$sFile);
|
||||
|
||||
//array to store replaced literal strings
|
||||
$literal_strings = array();
|
||||
|
||||
//explode the string into lines
|
||||
$lines = explode("\n",$sFile);
|
||||
//loop through all the lines, building a new string at the same time as removing literal strings
|
||||
$clean = '';
|
||||
$inComment = false;
|
||||
$literal = '';
|
||||
$inQuote = false;
|
||||
$escaped = false;
|
||||
$quoteChar = '';
|
||||
|
||||
$iLen = count($lines);
|
||||
for($i=0; $i<$iLen; ++$i)
|
||||
{
|
||||
$line = $lines[$i];
|
||||
$inNormalComment = false;
|
||||
|
||||
//loop through line's characters and take out any literal strings, replace them with ___i___ where i is the index of this string
|
||||
$jLen = strlen($line);
|
||||
for($j=0; $j<$jLen; ++$j)
|
||||
{
|
||||
$c = substr($line,$j,1);
|
||||
$d = substr($line,$j,2);
|
||||
|
||||
//look for start of quote
|
||||
if(!$inQuote && !$inComment)
|
||||
{
|
||||
//is this character a quote or a comment
|
||||
if(($c=='"' || $c=="'") && !$inComment && !$inNormalComment)
|
||||
{
|
||||
$inQuote = true;
|
||||
$inComment = false;
|
||||
$escaped = false;
|
||||
$quoteChar = $c;
|
||||
$literal = $c;
|
||||
}
|
||||
else if($d=="/*" && !$inNormalComment)
|
||||
{
|
||||
$inQuote = false;
|
||||
$inComment = true;
|
||||
$escaped = false;
|
||||
$quoteChar = $d;
|
||||
$literal = $d;
|
||||
$j++;
|
||||
}
|
||||
else if($d=="//") //ignore string markers that are found inside comments
|
||||
{
|
||||
$inNormalComment = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$inNormalComment)
|
||||
$clean .= $c;
|
||||
}
|
||||
}
|
||||
else //allready in a string so find end quote
|
||||
{
|
||||
if($c == $quoteChar && !$escaped && !$inComment)
|
||||
{
|
||||
$inQuote = false;
|
||||
$literal .= $c;
|
||||
|
||||
//subsitute in a marker for the string
|
||||
$clean .= "___" . count($literal_strings) . "___";
|
||||
|
||||
//push the string onto our array
|
||||
array_push($literal_strings,$literal);
|
||||
|
||||
}
|
||||
else if($inComment && $d=="*/")
|
||||
{
|
||||
$inComment = false;
|
||||
$literal .= $d;
|
||||
++$j;
|
||||
}
|
||||
else if($c == "\\" && !$escaped)
|
||||
$escaped = true;
|
||||
else
|
||||
$escaped = false;
|
||||
|
||||
$literal .= $c;
|
||||
}
|
||||
}
|
||||
if($inComment) $literal .= "\n";
|
||||
$clean .= "\n";
|
||||
}
|
||||
//explode the clean string into lines again
|
||||
$lines = explode("\n",$clean);
|
||||
|
||||
//now process each line at a time
|
||||
$iLen = count($lines);
|
||||
for($i=0; $i<$iLen; ++$i)
|
||||
{
|
||||
$line = $lines[$i];
|
||||
|
||||
//remove comments
|
||||
$line = preg_replace("/\/\/(.*)/","",$line);
|
||||
|
||||
//strip leading and trailing whitespace
|
||||
$line = trim($line);
|
||||
|
||||
//remove all whitespace with a single space
|
||||
$line = preg_replace("/\s+/"," ",$line);
|
||||
|
||||
//remove any whitespace that occurs after/before an operator
|
||||
$line = preg_replace("/\s*([!\}\{;,&=\|\-\+\*\/\)\(:])\s*/","\\1",$line);
|
||||
|
||||
$lines[$i] = $line;
|
||||
}
|
||||
|
||||
//implode the lines
|
||||
$sFile = implode("\n",$lines);
|
||||
|
||||
//make sure there is a max of 1 \n after each line
|
||||
$sFile = preg_replace("/[\n]+/","\n",$sFile);
|
||||
|
||||
//strip out line breaks that immediately follow a semi-colon
|
||||
$sFile = preg_replace("/;\n/",";",$sFile);
|
||||
|
||||
//curly brackets aren't on their own
|
||||
$sFile = preg_replace("/[\n]*\{[\n]*/","{",$sFile);
|
||||
|
||||
//finally loop through and replace all the literal strings:
|
||||
$iLen = count($literal_strings);
|
||||
for($i=0; $i<$iLen; ++$i)
|
||||
$sFile = str_replace('___'.$i.'___',$literal_strings[$i],$sFile);
|
||||
|
||||
return $sFile;
|
||||
}
|
682
lib/xajax/xajax_core/xajaxControl.inc.php
Executable file
|
@ -0,0 +1,682 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxControl.inc.php
|
||||
|
||||
Contains the base class for all controls.
|
||||
|
||||
Title: xajaxControl class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxControl.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Constant: XAJAX_HTML_CONTROL_DOCTYPE_FORMAT
|
||||
|
||||
Defines the doctype of the current document; this will effect how the HTML is formatted
|
||||
when the html control library is used to construct html documents and fragments. This can
|
||||
be one of the following values:
|
||||
|
||||
'XHTML' - (default) Typical effects are that certain elements are closed with '/>'
|
||||
'HTML' - Typical differences are that closing tags for certain elements cannot be '/>'
|
||||
*/
|
||||
if (false == defined('XAJAX_HTML_CONTROL_DOCTYPE_FORMAT')) define('XAJAX_HTML_CONTROL_DOCTYPE_FORMAT', 'XHTML');
|
||||
|
||||
/*
|
||||
Constant: XAJAX_HTML_CONTROL_DOCTYPE_VERSION
|
||||
*/
|
||||
if (false == defined('XAJAX_HTML_CONTROL_DOCTYPE_VERSION')) define('XAJAX_HTML_CONTROL_DOCTYPE_VERSION', '1.0');
|
||||
|
||||
/*
|
||||
Constant: XAJAX_HTML_CONTROL_DOCTYPE_VALIDATION
|
||||
*/
|
||||
if (false == defined('XAJAX_HTML_CONTROL_DOCTYPE_VALIDATION')) define('XAJAX_HTML_CONTROL_DOCTYPE_VALIDATION', 'TRANSITIONAL');
|
||||
|
||||
/*
|
||||
Class: xajaxControl
|
||||
|
||||
The base class for all xajax enabled controls. Derived classes will generate the
|
||||
HTML and javascript code that will be sent to the browser via <xajaxControl->printHTML>
|
||||
or sent to the browser in a <xajaxResponse> via <xajaxControl->getHTML>.
|
||||
*/
|
||||
class xajaxControl
|
||||
{
|
||||
/*
|
||||
String: sTag
|
||||
*/
|
||||
var $sTag;
|
||||
|
||||
/*
|
||||
Boolean: sEndTag
|
||||
|
||||
'required' - (default) Indicates the control must have a full end tag
|
||||
'optional' - The control may have an abbr. begin tag or a full end tag
|
||||
'forbidden' - The control must have an abbr. begin tag and no end tag
|
||||
*/
|
||||
var $sEndTag;
|
||||
|
||||
/*
|
||||
Array: aAttributes
|
||||
|
||||
An associative array of attributes that will be used in the generation
|
||||
of the HMTL code for this control.
|
||||
*/
|
||||
var $aAttributes;
|
||||
|
||||
/*
|
||||
Array: aEvents
|
||||
|
||||
An associative array of events that will be assigned to this control. Each
|
||||
event declaration will include a reference to a <xajaxRequest> object; it's
|
||||
script will be extracted using <xajaxRequest->printScript> or
|
||||
<xajaxRequest->getScript>.
|
||||
*/
|
||||
var $aEvents;
|
||||
|
||||
/*
|
||||
String: sClass
|
||||
|
||||
Contains a declaration of the class of this control. %inline controls do not
|
||||
need to be indented, %block controls should be indented.
|
||||
*/
|
||||
var $sClass;
|
||||
|
||||
/*
|
||||
Function: xajaxControl
|
||||
|
||||
Parameters:
|
||||
|
||||
$aConfiguration - (array): An associative array that contains a variety
|
||||
of configuration options for this <xajaxControl> object.
|
||||
|
||||
Note:
|
||||
This array may contain the following entries:
|
||||
|
||||
'attributes' - (array): An associative array containing attributes
|
||||
that will be passed to the <xajaxControl->setAttribute> function.
|
||||
|
||||
'children' - (array): An array of <xajaxControl> derived objects that
|
||||
will be the children of this control.
|
||||
*/
|
||||
function xajaxControl($sTag, $aConfiguration=array())
|
||||
{
|
||||
$this->sTag = $sTag;
|
||||
|
||||
$this->clearAttributes();
|
||||
|
||||
if (isset($aConfiguration['attributes']))
|
||||
if (is_array($aConfiguration['attributes']))
|
||||
foreach ($aConfiguration['attributes'] as $sKey => $sValue)
|
||||
$this->setAttribute($sKey, $sValue);
|
||||
|
||||
$this->clearEvents();
|
||||
|
||||
if (isset($aConfiguration['event']))
|
||||
call_user_func_array(array(&$this, 'setEvent'), $aConfiguration['event']);
|
||||
|
||||
else if (isset($aConfiguration['events']))
|
||||
if (is_array($aConfiguration['events']))
|
||||
foreach ($aConfiguration['events'] as $aEvent)
|
||||
call_user_func_array(array(&$this, 'setEvent'), $aEvent);
|
||||
|
||||
$this->sClass = '%block';
|
||||
$this->sEndTag = 'forbidden';
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getClass
|
||||
|
||||
Returns the *adjusted* class of the element
|
||||
*/
|
||||
function getClass()
|
||||
{
|
||||
return $this->sClass;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: clearAttributes
|
||||
|
||||
Removes all attributes assigned to this control.
|
||||
*/
|
||||
function clearAttributes()
|
||||
{
|
||||
$this->aAttributes = array();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setAttribute
|
||||
|
||||
Call to set various control specific attributes to be included in the HTML
|
||||
script that is returned when <xajaxControl->printHTML> or <xajaxControl->getHTML>
|
||||
is called.
|
||||
|
||||
Parameters:
|
||||
$sName - (string): The attribute name to set the value.
|
||||
$sValue - (string): The value to be set.
|
||||
*/
|
||||
function setAttribute($sName, $sValue)
|
||||
{
|
||||
//SkipDebug
|
||||
if (class_exists('clsValidator'))
|
||||
{
|
||||
$objValidator =& clsValidator::getInstance();
|
||||
if (false == $objValidator->attributeValid($this->sTag, $sName)) {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXCTL:IAERR:01')
|
||||
. $sName
|
||||
. $objLanguageManager->getText('XJXCTL:IAERR:02')
|
||||
. $this->sTag
|
||||
. $objLanguageManager->getText('XJXCTL:IAERR:03')
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
}
|
||||
//EndSkipDebug
|
||||
|
||||
$this->aAttributes[$sName] = $sValue;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getAttribute
|
||||
|
||||
Call to obtain the value currently associated with the specified attribute
|
||||
if set.
|
||||
|
||||
Parameters:
|
||||
|
||||
sName - (string): The name of the attribute to be returned.
|
||||
|
||||
Returns:
|
||||
|
||||
mixed : The value associated with the attribute, or null.
|
||||
*/
|
||||
function getAttribute($sName)
|
||||
{
|
||||
if (false == isset($this->aAttributes[$sName]))
|
||||
return null;
|
||||
|
||||
return $this->aAttributes[$sName];
|
||||
}
|
||||
|
||||
/*
|
||||
Function: clearEvents
|
||||
|
||||
Clear the events that have been associated with this object.
|
||||
*/
|
||||
function clearEvents()
|
||||
{
|
||||
$this->aEvents = array();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setEvent
|
||||
|
||||
Call this function to assign a <xajaxRequest> object as the handler for
|
||||
the specific DOM event. The <xajaxRequest->printScript> function will
|
||||
be called to generate the javascript for this request.
|
||||
|
||||
Parameters:
|
||||
|
||||
sEvent - (string): A string containing the name of the event to be assigned.
|
||||
objRequest - (xajaxRequest object): The <xajaxRequest> object to be associated
|
||||
with the specified event.
|
||||
aParameters - (array, optional): An array containing parameter declarations
|
||||
that will be passed to this <xajaxRequest> object just before the javascript
|
||||
is generated.
|
||||
sBeforeRequest - (string, optional): a string containing a snippet of javascript code
|
||||
to execute prior to calling the xajaxRequest function
|
||||
sAfterRequest - (string, optional): a string containing a snippet of javascript code
|
||||
to execute after calling the xajaxRequest function
|
||||
*/
|
||||
function setEvent($sEvent, &$objRequest, $aParameters=array(), $sBeforeRequest='', $sAfterRequest='; return false;')
|
||||
{
|
||||
//SkipDebug
|
||||
if (false == is_a($objRequest, 'xajaxRequest')) {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXCTL:IRERR:01')
|
||||
. $this->backtrace()
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
if (class_exists('clsValidator')) {
|
||||
$objValidator =& clsValidator::getInstance();
|
||||
if (false == $objValidator->attributeValid($this->sTag, $sEvent)) {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXCTL:IEERR:01')
|
||||
. $sEvent
|
||||
. $objLanguageManager->getText('XJXCTL:IEERR:02')
|
||||
. $this->sTag
|
||||
. $objLanguageManager->getText('XJXCTL:IEERR:03')
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
}
|
||||
//EndSkipDebug
|
||||
|
||||
$this->aEvents[$sEvent] = array(
|
||||
&$objRequest,
|
||||
$aParameters,
|
||||
$sBeforeRequest,
|
||||
$sAfterRequest
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getHTML
|
||||
|
||||
Generates and returns the HTML representation of this control and
|
||||
it's children.
|
||||
|
||||
Returns:
|
||||
|
||||
string : The HTML representation of this control.
|
||||
*/
|
||||
function getHTML($bFormat=false)
|
||||
{
|
||||
ob_start();
|
||||
if ($bFormat)
|
||||
$this->printHTML();
|
||||
else
|
||||
$this->printHTML(false);
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: printHTML
|
||||
|
||||
Generates and prints the HTML representation of this control and
|
||||
it's children.
|
||||
|
||||
Returns:
|
||||
|
||||
string : The HTML representation of this control.
|
||||
*/
|
||||
function printHTML($sIndent='')
|
||||
{
|
||||
//SkipDebug
|
||||
if (class_exists('clsValidator'))
|
||||
{
|
||||
$objValidator =& clsValidator::getInstance();
|
||||
$sMissing = '';
|
||||
if (false == $objValidator->checkRequiredAttributes($this->sTag, $this->aAttributes, $sMissing)) {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXCTL:MAERR:01')
|
||||
. $sMissing
|
||||
. $objLanguageManager->getText('XJXCTL:MAERR:02')
|
||||
. $this->sTag
|
||||
. $objLanguageManager->getText('XJXCTL:MAERR:03')
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
}
|
||||
//EndSkipDebug
|
||||
|
||||
$sClass = $this->getClass();
|
||||
|
||||
if ('%inline' != $sClass)
|
||||
// this odd syntax is necessary to detect request for no formatting
|
||||
if (false === (false === $sIndent))
|
||||
echo $sIndent;
|
||||
|
||||
echo '<';
|
||||
echo $this->sTag;
|
||||
echo ' ';
|
||||
$this->_printAttributes();
|
||||
$this->_printEvents();
|
||||
|
||||
if ('forbidden' == $this->sEndTag)
|
||||
{
|
||||
if ('HTML' == XAJAX_HTML_CONTROL_DOCTYPE_FORMAT)
|
||||
echo '>';
|
||||
else if ('XHTML' == XAJAX_HTML_CONTROL_DOCTYPE_FORMAT)
|
||||
echo '/>';
|
||||
|
||||
if ('%inline' != $sClass)
|
||||
// this odd syntax is necessary to detect request for no formatting
|
||||
if (false === (false === $sIndent))
|
||||
echo "\n";
|
||||
|
||||
return;
|
||||
}
|
||||
else if ('optional' == $this->sEndTag)
|
||||
{
|
||||
echo '/>';
|
||||
|
||||
if ('%inline' == $sClass)
|
||||
// this odd syntax is necessary to detect request for no formatting
|
||||
if (false === (false === $sIndent))
|
||||
echo "\n";
|
||||
|
||||
return;
|
||||
}
|
||||
//SkipDebug
|
||||
else
|
||||
{
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXCTL:IETERR:01')
|
||||
. $this->backtrace()
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
//EndSkipDebug
|
||||
}
|
||||
|
||||
function _printAttributes()
|
||||
{
|
||||
// NOTE: Special case here: disabled='false' does not work in HTML; does work in javascript
|
||||
foreach ($this->aAttributes as $sKey => $sValue)
|
||||
if ('disabled' != $sKey || 'false' != $sValue)
|
||||
echo "{$sKey}='{$sValue}' ";
|
||||
}
|
||||
|
||||
function _printEvents()
|
||||
{
|
||||
foreach (array_keys($this->aEvents) as $sKey)
|
||||
{
|
||||
$aEvent =& $this->aEvents[$sKey];
|
||||
$objRequest =& $aEvent[0];
|
||||
$aParameters = $aEvent[1];
|
||||
$sBeforeRequest = $aEvent[2];
|
||||
$sAfterRequest = $aEvent[3];
|
||||
|
||||
foreach ($aParameters as $aParameter)
|
||||
{
|
||||
$nParameter = $aParameter[0];
|
||||
$sType = $aParameter[1];
|
||||
$sValue = $aParameter[2];
|
||||
$objRequest->setParameter($nParameter, $sType, $sValue);
|
||||
}
|
||||
|
||||
$objRequest->useDoubleQuote();
|
||||
|
||||
echo "{$sKey}='{$sBeforeRequest}";
|
||||
|
||||
$objRequest->printScript();
|
||||
|
||||
echo "{$sAfterRequest}' ";
|
||||
}
|
||||
}
|
||||
|
||||
function backtrace()
|
||||
{
|
||||
// debug_backtrace was added to php in version 4.3.0
|
||||
// version_compare was added to php in version 4.0.7
|
||||
if (0 <= version_compare(PHP_VERSION, '4.3.0'))
|
||||
return '<div><div>Backtrace:</div><pre>'
|
||||
. print_r(debug_backtrace(), true)
|
||||
. '</pre></div>';
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Class: xajaxControlContainer
|
||||
|
||||
This class is used as the base class for controls that will contain
|
||||
other child controls.
|
||||
*/
|
||||
class xajaxControlContainer extends xajaxControl
|
||||
{
|
||||
/*
|
||||
Array: aChildren
|
||||
|
||||
An array of child controls.
|
||||
*/
|
||||
var $aChildren;
|
||||
|
||||
/*
|
||||
Boolean: sChildClass
|
||||
|
||||
Will contain '%inline' if all children are class = '%inline', '%block' if all children are '%block' or
|
||||
'%flow' if both '%inline' and '%block' elements are detected.
|
||||
*/
|
||||
var $sChildClass;
|
||||
|
||||
/*
|
||||
Function: xajaxControlContainer
|
||||
|
||||
Called to construct and configure this control.
|
||||
|
||||
Parameters:
|
||||
|
||||
aConfiguration - (array): See <xajaxControl->xajaxControl> for more
|
||||
information.
|
||||
*/
|
||||
function xajaxControlContainer($sTag, $aConfiguration=array())
|
||||
{
|
||||
xajaxControl::xajaxControl($sTag, $aConfiguration);
|
||||
|
||||
$this->clearChildren();
|
||||
|
||||
if (isset($aConfiguration['child']))
|
||||
$this->addChild($aConfiguration['child']);
|
||||
|
||||
else if (isset($aConfiguration['children']))
|
||||
$this->addChildren($aConfiguration['children']);
|
||||
|
||||
$this->sEndTag = 'required';
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getClass
|
||||
|
||||
Returns the *adjusted* class of the element
|
||||
*/
|
||||
function getClass()
|
||||
{
|
||||
$sClass = xajaxControl::getClass();
|
||||
|
||||
if (0 < count($this->aChildren) && '%flow' == $sClass)
|
||||
return $this->getContentClass();
|
||||
else if (0 == count($this->aChildren) || '%inline' == $sClass || '%block' == $sClass)
|
||||
return $sClass;
|
||||
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXCTL:ICERR:01')
|
||||
. $this->backtrace()
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getContentClass
|
||||
|
||||
Returns the *adjusted* class of the content (children) of this element
|
||||
*/
|
||||
function getContentClass()
|
||||
{
|
||||
$sClass = '';
|
||||
|
||||
foreach (array_keys($this->aChildren) as $sKey)
|
||||
{
|
||||
if ('' == $sClass)
|
||||
$sClass = $this->aChildren[$sKey]->getClass();
|
||||
else if ($sClass != $this->aChildren[$sKey]->getClass())
|
||||
return '%flow';
|
||||
}
|
||||
|
||||
if ('' == $sClass)
|
||||
return '%inline';
|
||||
|
||||
return $sClass;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: clearChildren
|
||||
|
||||
Clears the list of child controls associated with this control.
|
||||
*/
|
||||
function clearChildren()
|
||||
{
|
||||
$this->sChildClass = '%inline';
|
||||
$this->aChildren = array();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: addChild
|
||||
|
||||
Adds a control to the array of child controls. Child controls
|
||||
must be derived from <xajaxControl>.
|
||||
*/
|
||||
function addChild(&$objControl)
|
||||
{
|
||||
//SkipDebug
|
||||
if (false == is_a($objControl, 'xajaxControl')) {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXCTL:ICLERR:01')
|
||||
. $this->backtrace()
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
if (class_exists('clsValidator'))
|
||||
{
|
||||
$objValidator =& clsValidator::getInstance();
|
||||
if (false == $objValidator->childValid($this->sTag, $objControl->sTag)) {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXCTL:ICLERR:02')
|
||||
. $objControl->sTag
|
||||
. $objLanguageManager->getText('XJXCTL:ICLERR:03')
|
||||
. $this->sTag
|
||||
. $objLanguageManager->getText('XJXCTL:ICLERR:04')
|
||||
. $this->backtrace()
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
}
|
||||
//EndSkipDebug
|
||||
|
||||
$this->aChildren[] =& $objControl;
|
||||
}
|
||||
|
||||
function addChildren(&$aChildren)
|
||||
{
|
||||
//SkipDebug
|
||||
if (false == is_array($aChildren)) {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXCTL:ICHERR:01')
|
||||
. $this->backtrace()
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
//EndSkipDebug
|
||||
|
||||
foreach (array_keys($aChildren) as $sKey)
|
||||
$this->addChild($aChildren[$sKey]);
|
||||
}
|
||||
|
||||
function printHTML($sIndent='')
|
||||
{
|
||||
//SkipDebug
|
||||
if (class_exists('clsValidator'))
|
||||
{
|
||||
$objValidator =& clsValidator::getInstance();
|
||||
$sMissing = '';
|
||||
if (false == $objValidator->checkRequiredAttributes($this->sTag, $this->aAttributes, $sMissing)) {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXCTL:MRAERR:01')
|
||||
. $sMissing
|
||||
. $objLanguageManager->getText('XJXCTL:MRAERR:02')
|
||||
. $this->sTag
|
||||
. $objLanguageManager->getText('XJXCTL:MRAERR:03')
|
||||
, E_USER_ERROR
|
||||
);
|
||||
}
|
||||
}
|
||||
//EndSkipDebug
|
||||
|
||||
$sClass = $this->getClass();
|
||||
|
||||
if ('%inline' != $sClass)
|
||||
// this odd syntax is necessary to detect request for no formatting
|
||||
if (false === (false === $sIndent))
|
||||
echo $sIndent;
|
||||
|
||||
echo '<';
|
||||
echo $this->sTag;
|
||||
echo ' ';
|
||||
$this->_printAttributes();
|
||||
$this->_printEvents();
|
||||
|
||||
if (0 == count($this->aChildren))
|
||||
{
|
||||
if ('optional' == $this->sEndTag)
|
||||
{
|
||||
echo '/>';
|
||||
|
||||
if ('%inline' != $sClass)
|
||||
// this odd syntax is necessary to detect request for no formatting
|
||||
if (false === (false === $sIndent))
|
||||
echo "\n";
|
||||
|
||||
return;
|
||||
}
|
||||
//SkipDebug
|
||||
else if ('required' != $this->sEndTag)
|
||||
trigger_error("Invalid end tag designation; should be optional or required.\n"
|
||||
. $this->backtrace(),
|
||||
E_USER_ERROR
|
||||
);
|
||||
//EndSkipDebug
|
||||
}
|
||||
|
||||
echo '>';
|
||||
|
||||
$sContentClass = $this->getContentClass();
|
||||
|
||||
if ('%inline' != $sContentClass)
|
||||
// this odd syntax is necessary to detect request for no formatting
|
||||
if (false === (false === $sIndent))
|
||||
echo "\n";
|
||||
|
||||
$this->_printChildren($sIndent);
|
||||
|
||||
if ('%inline' != $sContentClass)
|
||||
// this odd syntax is necessary to detect request for no formatting
|
||||
if (false === (false === $sIndent))
|
||||
echo $sIndent;
|
||||
|
||||
echo '<' . '/';
|
||||
echo $this->sTag;
|
||||
echo '>';
|
||||
|
||||
if ('%inline' != $sClass)
|
||||
// this odd syntax is necessary to detect request for no formatting
|
||||
if (false === (false === $sIndent))
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
function _printChildren($sIndent='')
|
||||
{
|
||||
if (false == is_a($this, 'clsDocument'))
|
||||
// this odd syntax is necessary to detect request for no formatting
|
||||
if (false === (false === $sIndent))
|
||||
$sIndent .= "\t";
|
||||
|
||||
// children
|
||||
foreach (array_keys($this->aChildren) as $sKey)
|
||||
{
|
||||
$objChild =& $this->aChildren[$sKey];
|
||||
$objChild->printHTML($sIndent);
|
||||
}
|
||||
}
|
||||
}
|
188
lib/xajax/xajax_core/xajaxLanguageManager.inc.php
Executable file
|
@ -0,0 +1,188 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxLanguageManager.inc.php
|
||||
|
||||
Contains the code that manages the inclusion of alternate language support
|
||||
files; so debug and error messages can be shown in a language other than
|
||||
the default (english) language.
|
||||
|
||||
Title: xajaxLanguageManager class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxLanguageManager.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Class: xajaxLanguageManager
|
||||
|
||||
This class contains the default language (english) and the code used to supply
|
||||
debug and error messages upon request; as well as the code used to load alternate
|
||||
language text as requested via the <xajax::configure> function.
|
||||
*/
|
||||
class xajaxLanguageManager
|
||||
{
|
||||
/*
|
||||
Array: aMessages
|
||||
|
||||
An array of the currently registered languages.
|
||||
*/
|
||||
var $aMessages;
|
||||
|
||||
/*
|
||||
String: sLanguage
|
||||
|
||||
The currently configured language.
|
||||
*/
|
||||
var $sLanguage;
|
||||
|
||||
/*
|
||||
Function: xajaxLanguageManager
|
||||
|
||||
Construct and initialize the one and only xajax language manager object.
|
||||
*/
|
||||
function xajaxLanguageManager()
|
||||
{
|
||||
$this->aMessages = array();
|
||||
|
||||
$this->aMessages['en'] = array(
|
||||
'LOGHDR:01' => '** xajax Error Log - ',
|
||||
'LOGHDR:02' => " **\n",
|
||||
'LOGHDR:03' => "\n\n\n",
|
||||
'LOGERR:01' => "** Logging Error **\n\nxajax was unable to write to the error log file:\n",
|
||||
'LOGMSG:01' => "** PHP Error Messages: **",
|
||||
'CMPRSJS:RDERR:01' => 'The xajax uncompressed Javascript file could not be found in the <b>',
|
||||
'CMPRSJS:RDERR:02' => '</b> folder. Error ',
|
||||
'CMPRSJS:WTERR:01' => 'The xajax compressed javascript file could not be written in the <b>',
|
||||
'CMPRSJS:WTERR:02' => '</b> folder. Error ',
|
||||
'CMPRSPHP:WTERR:01' => 'The xajax compressed file <b>',
|
||||
'CMPRSPHP:WTERR:02' => '</b> could not be written to. Error ',
|
||||
'CMPRSAIO:WTERR:01' => 'The xajax compressed file <b>',
|
||||
'CMPRSAIO:WTERR:02' => '/xajaxAIO.inc.php</b> could not be written to. Error ',
|
||||
'DTCTURI:01' => 'xajax Error: xajax failed to automatically identify your Request URI.',
|
||||
'DTCTURI:02' => 'Please set the Request URI explicitly when you instantiate the xajax object.',
|
||||
'ARGMGR:ERR:01' => 'Malformed object argument received: ',
|
||||
'ARGMGR:ERR:02' => ' <==> ',
|
||||
'ARGMGR:ERR:03' => 'The incoming xajax data could not be converted from UTF-8',
|
||||
'XJXCTL:IAERR:01' => 'Invalid attribute [',
|
||||
'XJXCTL:IAERR:02' => '] for element [',
|
||||
'XJXCTL:IAERR:03' => '].',
|
||||
'XJXCTL:IRERR:01' => 'Invalid request object passed to xajaxControl::setEvent',
|
||||
'XJXCTL:IEERR:01' => 'Invalid attribute (event name) [',
|
||||
'XJXCTL:IEERR:02' => '] for element [',
|
||||
'XJXCTL:IEERR:03' => '].',
|
||||
'XJXCTL:MAERR:01' => 'Missing required attribute [',
|
||||
'XJXCTL:MAERR:02' => '] for element [',
|
||||
'XJXCTL:MAERR:03' => '].',
|
||||
'XJXCTL:IETERR:01' => "Invalid end tag designation; should be forbidden or optional.\n",
|
||||
'XJXCTL:ICERR:01' => "Invalid class specified for html control; should be %inline, %block or %flow.\n",
|
||||
'XJXCTL:ICLERR:01' => 'Invalid control passed to addChild; should be derived from xajaxControl.',
|
||||
'XJXCTL:ICLERR:02' => 'Invalid control passed to addChild [',
|
||||
'XJXCTL:ICLERR:03' => '] for element [',
|
||||
'XJXCTL:ICLERR:04' => "].\n",
|
||||
'XJXCTL:ICHERR:01' => 'Invalid parameter passed to xajaxControl::addChildren; should be array of xajaxControl objects',
|
||||
'XJXCTL:MRAERR:01' => 'Missing required attribute [',
|
||||
'XJXCTL:MRAERR:02' => '] for element [',
|
||||
'XJXCTL:MRAERR:03' => '].',
|
||||
'XJXPLG:GNERR:01' => 'Response plugin should override the getName function.',
|
||||
'XJXPLG:PERR:01' => 'Response plugin should override the process function.',
|
||||
'XJXPM:IPLGERR:01' => 'Attempt to register invalid plugin: ',
|
||||
'XJXPM:IPLGERR:02' => ' should be derived from xajaxRequestPlugin or xajaxResponsePlugin.',
|
||||
'XJXPM:MRMERR:01' => 'Failed to locate registration method for the following: ',
|
||||
'XJXRSP:EDERR:01' => 'Passing character encoding to the xajaxResponse constructor is deprecated, instead use $xajax->configure("characterEncoding", ...);',
|
||||
'XJXRSP:MPERR:01' => 'Invalid or missing plugin name detected in call to xajaxResponse::plugin',
|
||||
'XJXRSP:CPERR:01' => "The \$sType parameter of addCreate has been deprecated. Use the addCreateInput() method instead.",
|
||||
'XJXRSP:LCERR:01' => "The xajax response object could not load commands as the data provided was not a valid array.",
|
||||
'XJXRSP:AKERR:01' => 'Invalid tag name encoded in array.',
|
||||
'XJXRSP:IEAERR:01' => 'Improperly encoded array.',
|
||||
'XJXRSP:NEAERR:01' => 'Non-encoded array detected.',
|
||||
'XJXRSP:MBEERR:01' => 'The xajax response output could not be converted to HTML entities because the mb_convert_encoding function is not available',
|
||||
'XJXRSP:MXRTERR' => 'Error: Cannot mix types in a single response.',
|
||||
'XJXRSP:MXCTERR' => 'Error: Cannot mix content types in a single response.',
|
||||
'XJXRSP:MXCEERR' => 'Error: Cannot mix character encodings in a single response.',
|
||||
'XJXRSP:MXOEERR' => 'Error: Cannot mix output entities (true/false) in a single response.',
|
||||
'XJXRM:IRERR' => 'An invalid response was returned while processing this request.',
|
||||
'XJXRM:MXRTERR' => 'Error: You cannot mix response types while processing a single request: '
|
||||
);
|
||||
|
||||
$this->sLanguage = 'en';
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getInstance
|
||||
|
||||
Implements the singleton pattern: provides a single instance of the xajax
|
||||
language manager object to all object which request it.
|
||||
*/
|
||||
function &getInstance()
|
||||
{
|
||||
static $obj;
|
||||
if (!$obj) {
|
||||
$obj = new xajaxLanguageManager();
|
||||
}
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
|
||||
Called by the main xajax object as configuration options are set. See also:
|
||||
<xajax::configure>. The <xajaxLanguageManager> tracks the following configuration
|
||||
options.
|
||||
Parameters:
|
||||
|
||||
- language (string, default 'en'): The currently selected language.
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
if ('language' == $sName) {
|
||||
if ($mValue !== $this->sLanguage) {
|
||||
$sFolder = dirname(__FILE__);
|
||||
@include $sFolder . '/xajax_lang_' . $mValue . '.inc.php';
|
||||
// require $sFolder . '/xajax_lang_' . $mValue . '.inc.php';
|
||||
$this->sLanguage = $mValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: register
|
||||
|
||||
Called to register an array of alternate language messages.
|
||||
|
||||
Parameters:
|
||||
|
||||
sLanguage - (string): the character code which represents the language being registered.
|
||||
aMessages - (array): the array of translated debug and error messages
|
||||
*/
|
||||
function register($sLanguage, $aMessages) {
|
||||
$this->aMessages[$sLanguage] = $aMessages;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getText
|
||||
|
||||
Called by the main xajax object and other objects during the initial page generation
|
||||
or request processing phase to obtain language specific debug and error messages.
|
||||
|
||||
sMessage - (string): A code indicating the message text being requested.
|
||||
*/
|
||||
function getText($sMessage)
|
||||
{
|
||||
if (isset($this->aMessages[$this->sLanguage]))
|
||||
if (isset($this->aMessages[$this->sLanguage][$sMessage]))
|
||||
return $this->aMessages[$this->sLanguage][$sMessage];
|
||||
|
||||
return '(Unknown language or message identifier)'
|
||||
. $this->sLanguage
|
||||
. '::'
|
||||
. $sMessage;
|
||||
}
|
||||
}
|
191
lib/xajax/xajax_core/xajaxPlugin.inc.php
Executable file
|
@ -0,0 +1,191 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxPlugin.inc.php
|
||||
|
||||
Contains the xajaxPlugin class
|
||||
|
||||
Title: xajaxPlugin class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxPlugin.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Class: xajaxPlugin
|
||||
|
||||
The base class for all xajax plugins.
|
||||
*/
|
||||
class xajaxPlugin
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
Class: xajaxRequestPlugin
|
||||
|
||||
The base class for all xajax request plugins.
|
||||
|
||||
Request plugins handle the registration, client script generation and processing of
|
||||
xajax enabled requests. Each plugin should have a unique signature for both
|
||||
the registration and processing of requests. During registration, the user will
|
||||
specify a type which will allow the plugin to detect and handle it. During client
|
||||
script generation, the plugin will generate a <xajax.request> stub with the
|
||||
prescribed call options and request signature. During request processing, the
|
||||
plugin will detect the signature generated previously and process the request
|
||||
accordingly.
|
||||
*/
|
||||
class xajaxRequestPlugin extends xajaxPlugin
|
||||
{
|
||||
/*
|
||||
Function: configure
|
||||
|
||||
Called by the <xajaxPluginManager> when a configuration setting is changing.
|
||||
Plugins should store a local copy of the settings they wish to use during
|
||||
registration, client script generation or request processing.
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
Function: register
|
||||
|
||||
Called by the <xajaxPluginManager> when a user script when a function, event
|
||||
or callable object is to be registered. Additional plugins may support other
|
||||
registration types.
|
||||
*/
|
||||
function register($aArgs)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateClientScript
|
||||
|
||||
Called by <xajaxPluginManager> when the page's HTML is being sent to the browser.
|
||||
This allows each plugin to inject some script / style or other appropriate tags
|
||||
into the HEAD of the document. Each block must be appropriately enclosed, meaning
|
||||
javascript code must be enclosed in SCRIPT and /SCRIPT tags.
|
||||
*/
|
||||
function generateClientScript()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
Function: canProcessRequest
|
||||
|
||||
Called by the <xajaxPluginManager> when a request has been received to determine
|
||||
if the request is for a xajax enabled function or for the initial page load.
|
||||
*/
|
||||
function canProcessRequest()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: processRequest
|
||||
|
||||
Called by the <xajaxPluginManager> when a request is being processed. This
|
||||
will only occur when <xajax> has determined that the current request is a valid
|
||||
(registered) xajax enabled function via <xajax->canProcessRequest>.
|
||||
|
||||
Returns:
|
||||
false
|
||||
*/
|
||||
function processRequest()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Class: xajaxResponsePlugin
|
||||
|
||||
Base class for all xajax response plugins.
|
||||
|
||||
A response plugin provides additional services not already provided by the
|
||||
<xajaxResponse> class with regard to sending response commands to the
|
||||
client. In addition, a response command may send javascript to the browser
|
||||
at page load to aid in the processing of it's response commands.
|
||||
*/
|
||||
class xajaxResponsePlugin extends xajaxPlugin
|
||||
{
|
||||
/*
|
||||
Object: objResponse
|
||||
|
||||
A reference to the current <xajaxResponse> object that is being used
|
||||
to build the response that will be sent to the client browser.
|
||||
*/
|
||||
var $objResponse;
|
||||
|
||||
/*
|
||||
Function: setResponse
|
||||
|
||||
Called by the <xajaxResponse> object that is currently being used
|
||||
to build the response that will be sent to the client browser.
|
||||
|
||||
Parameters:
|
||||
|
||||
objResponse - (object): A reference to the <xajaxResponse> object
|
||||
*/
|
||||
function setResponse(&$objResponse)
|
||||
{
|
||||
$this->objResponse =& $objResponse;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: addCommand
|
||||
|
||||
Used internally to add a command to the response command list. This
|
||||
will call <xajaxResponse->addPluginCommand> using the reference provided
|
||||
in <xajaxResponsePlugin->setResponse>.
|
||||
*/
|
||||
function addCommand($aAttributes, $sData)
|
||||
{
|
||||
$this->objResponse->addPluginCommand($this, $aAttributes, $sData);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getName
|
||||
|
||||
Called by the <xajaxPluginManager> when the user script requests a plugin.
|
||||
This name must match the plugin name requested in the called to
|
||||
<xajaxResponse->plugin>.
|
||||
*/
|
||||
function getName()
|
||||
{
|
||||
//SkipDebug
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXPLG:GNERR:01')
|
||||
, E_USER_ERROR
|
||||
);
|
||||
//EndSkipDebug
|
||||
}
|
||||
|
||||
/*
|
||||
Function: process
|
||||
|
||||
Called by <xajaxResponse> when a user script requests the service of a
|
||||
response plugin. The parameters provided by the user will be used to
|
||||
determine which response command and parameters will be sent to the
|
||||
client upon completion of the xajax request process.
|
||||
*/
|
||||
function process()
|
||||
{
|
||||
//SkipDebug
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXPLG:PERR:01')
|
||||
, E_USER_ERROR
|
||||
);
|
||||
//EndSkipDebug
|
||||
}
|
||||
}
|
344
lib/xajax/xajax_core/xajaxPluginManager.inc.php
Executable file
|
@ -0,0 +1,344 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxPluginManager.inc.php
|
||||
|
||||
Contains the xajax plugin manager.
|
||||
|
||||
Title: xajax plugin manager
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxPluginManager.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
//SkipAIO
|
||||
require(dirname(__FILE__) . '/xajaxPlugin.inc.php');
|
||||
//EndSkipAIO
|
||||
|
||||
/*
|
||||
Class: xajaxPluginManager
|
||||
*/
|
||||
class xajaxPluginManager
|
||||
{
|
||||
/*
|
||||
Array: aRequestPlugins
|
||||
*/
|
||||
var $aRequestPlugins;
|
||||
|
||||
/*
|
||||
Array: aResponsePlugins
|
||||
*/
|
||||
var $aResponsePlugins;
|
||||
|
||||
/*
|
||||
Array: aConfigurable
|
||||
*/
|
||||
var $aConfigurable;
|
||||
|
||||
/*
|
||||
Array: aRegistrars
|
||||
*/
|
||||
var $aRegistrars;
|
||||
|
||||
/*
|
||||
Array: aProcessors
|
||||
*/
|
||||
var $aProcessors;
|
||||
|
||||
/*
|
||||
Array: aClientScriptGenerators
|
||||
*/
|
||||
var $aClientScriptGenerators;
|
||||
|
||||
/*
|
||||
Function: xajaxPluginManager
|
||||
|
||||
Construct and initialize the one and only xajax plugin manager.
|
||||
*/
|
||||
function xajaxPluginManager()
|
||||
{
|
||||
$this->aRequestPlugins = array();
|
||||
$this->aResponsePlugins = array();
|
||||
|
||||
$this->aConfigurable = array();
|
||||
$this->aRegistrars = array();
|
||||
$this->aProcessors = array();
|
||||
$this->aClientScriptGenerators = array();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getInstance
|
||||
|
||||
Implementation of the singleton pattern: returns the one and only instance of the
|
||||
xajax plugin manager.
|
||||
|
||||
Returns:
|
||||
|
||||
object : a reference to the one and only instance of the
|
||||
plugin manager.
|
||||
*/
|
||||
function &getInstance()
|
||||
{
|
||||
static $obj;
|
||||
if (!$obj) {
|
||||
$obj = new xajaxPluginManager();
|
||||
}
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: loadPlugins
|
||||
|
||||
Loads plugins from the folders specified.
|
||||
|
||||
Parameters:
|
||||
$aFolders - (array): Array of folders to check for plugins
|
||||
*/
|
||||
function loadPlugins($aFolders)
|
||||
{
|
||||
foreach ($aFolders as $sFolder) {
|
||||
if (is_dir($sFolder))
|
||||
if ($handle = opendir($sFolder)) {
|
||||
while (!(false === ($sName = readdir($handle)))) {
|
||||
$nLength = strlen($sName);
|
||||
if (8 < $nLength) {
|
||||
$sFileName = substr($sName, 0, $nLength - 8);
|
||||
$sExtension = substr($sName, $nLength - 8, 8);
|
||||
if ('.inc.php' == $sExtension) {
|
||||
require $sFolder . '/' . $sFileName . $sExtension;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: _insertIntoArray
|
||||
|
||||
Inserts an entry into an array given the specified priority number.
|
||||
If a plugin already exists with the given priority, the priority is
|
||||
automatically incremented until a free spot is found. The plugin
|
||||
is then inserted into the empty spot in the array.
|
||||
|
||||
Parameters:
|
||||
|
||||
$aPlugins - (array): Plugins array
|
||||
$objPlugin - (object): A reference to an instance of a plugin.
|
||||
$nPriority - (number): The desired priority, used to order
|
||||
the plugins.
|
||||
|
||||
*/
|
||||
function _insertIntoArray(&$aPlugins, &$objPlugin, $nPriority)
|
||||
{
|
||||
while (isset($aPlugins[$nPriority]))
|
||||
$nPriority++;
|
||||
|
||||
$aPlugins[$nPriority] =& $objPlugin;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: registerPlugin
|
||||
|
||||
Registers a plugin.
|
||||
|
||||
Parameters:
|
||||
|
||||
objPlugin - (object): A reference to an instance of a plugin.
|
||||
|
||||
Note:
|
||||
Below is a table for priorities and their description:
|
||||
0 thru 999: Plugins that are part of or extensions to the xajax core
|
||||
1000 thru 8999: User created plugins, typically, these plugins don't care about order
|
||||
9000 thru 9999: Plugins that generally need to be last or near the end of the plugin list
|
||||
*/
|
||||
function registerPlugin(&$objPlugin, $nPriority=1000)
|
||||
{
|
||||
if (is_a($objPlugin, 'xajaxRequestPlugin'))
|
||||
{
|
||||
$this->_insertIntoArray($this->aRequestPlugins, $objPlugin, $nPriority);
|
||||
|
||||
if (method_exists($objPlugin, 'register'))
|
||||
$this->_insertIntoArray($this->aRegistrars, $objPlugin, $nPriority);
|
||||
|
||||
if (method_exists($objPlugin, 'canProcessRequest'))
|
||||
if (method_exists($objPlugin, 'processRequest'))
|
||||
$this->_insertIntoArray($this->aProcessors, $objPlugin, $nPriority);
|
||||
}
|
||||
else if (is_a($objPlugin, 'xajaxResponsePlugin'))
|
||||
{
|
||||
$this->aResponsePlugins[] =& $objPlugin;
|
||||
}
|
||||
else
|
||||
{
|
||||
//SkipDebug
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXPM:IPLGERR:01')
|
||||
. get_class($objPlugin)
|
||||
. $objLanguageManager->getText('XJXPM:IPLGERR:02')
|
||||
, E_USER_ERROR
|
||||
);
|
||||
//EndSkipDebug
|
||||
}
|
||||
|
||||
if (method_exists($objPlugin, 'configure'))
|
||||
$this->_insertIntoArray($this->aConfigurable, $objPlugin, $nPriority);
|
||||
|
||||
if (method_exists($objPlugin, 'generateClientScript'))
|
||||
$this->_insertIntoArray($this->aClientScriptGenerators, $objPlugin, $nPriority);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: canProcessRequest
|
||||
|
||||
Calls each of the request plugins and determines if the
|
||||
current request can be processed by one of them. If no processor identifies
|
||||
the current request, then the request must be for the initial page load.
|
||||
|
||||
See <xajax->canProcessRequest> for more information.
|
||||
*/
|
||||
function canProcessRequest()
|
||||
{
|
||||
$bHandled = false;
|
||||
|
||||
$aKeys = array_keys($this->aProcessors);
|
||||
sort($aKeys);
|
||||
foreach ($aKeys as $sKey) {
|
||||
$mResult = $this->aProcessors[$sKey]->canProcessRequest();
|
||||
if (true === $mResult)
|
||||
$bHandled = true;
|
||||
else if (is_string($mResult))
|
||||
return $mResult;
|
||||
}
|
||||
|
||||
return $bHandled;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: processRequest
|
||||
|
||||
Calls each of the request plugins to request that they process the
|
||||
current request. If the plugin processes the request, it will
|
||||
return true.
|
||||
*/
|
||||
function processRequest()
|
||||
{
|
||||
$bHandled = false;
|
||||
|
||||
$aKeys = array_keys($this->aProcessors);
|
||||
sort($aKeys);
|
||||
foreach ($aKeys as $sKey) {
|
||||
$mResult = $this->aProcessors[$sKey]->processRequest();
|
||||
if (true === $mResult)
|
||||
$bHandled = true;
|
||||
else if (is_string($mResult))
|
||||
return $mResult;
|
||||
}
|
||||
|
||||
return $bHandled;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
|
||||
Call each of the request plugins passing along the configuration
|
||||
setting specified.
|
||||
|
||||
Parameters:
|
||||
|
||||
sName - (string): The name of the configuration setting to set.
|
||||
mValue - (mixed): The value to be set.
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
$aKeys = array_keys($this->aConfigurable);
|
||||
sort($aKeys);
|
||||
foreach ($aKeys as $sKey)
|
||||
$this->aConfigurable[$sKey]->configure($sName, $mValue);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: register
|
||||
|
||||
Call each of the request plugins and give them the opportunity to
|
||||
handle the registration of the specified function, event or callable object.
|
||||
|
||||
Parameters:
|
||||
$aArgs - (array) :
|
||||
*/
|
||||
function register($aArgs)
|
||||
{
|
||||
$aKeys = array_keys($this->aRegistrars);
|
||||
sort($aKeys);
|
||||
foreach ($aKeys as $sKey)
|
||||
{
|
||||
$objPlugin =& $this->aRegistrars[$sKey];
|
||||
$mResult =& $objPlugin->register($aArgs);
|
||||
if (is_a($mResult, 'xajaxRequest'))
|
||||
return $mResult;
|
||||
if (is_array($mResult))
|
||||
return $mResult;
|
||||
if (is_bool($mResult))
|
||||
if (true === $mResult)
|
||||
return true;
|
||||
}
|
||||
//SkipDebug
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
trigger_error(
|
||||
$objLanguageManager->getText('XJXPM:MRMERR:01')
|
||||
. print_r($aArgs, true)
|
||||
, E_USER_ERROR
|
||||
);
|
||||
//EndSkipDebug
|
||||
}
|
||||
|
||||
/*
|
||||
Function: generateClientScript
|
||||
|
||||
Call each of the request and response plugins giving them the
|
||||
opportunity to output some javascript to the page being generated. This
|
||||
is called only when the page is being loaded initially. This is not
|
||||
called when processing a request.
|
||||
*/
|
||||
function generateClientScript()
|
||||
{
|
||||
$aKeys = array_keys($this->aClientScriptGenerators);
|
||||
sort($aKeys);
|
||||
foreach ($aKeys as $sKey)
|
||||
$this->aClientScriptGenerators[$sKey]->generateClientScript();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getPlugin
|
||||
|
||||
Locate the specified response plugin by name and return
|
||||
a reference to it if one exists.
|
||||
|
||||
Parameters:
|
||||
$sName - (string): Name of the plugin.
|
||||
|
||||
Returns:
|
||||
mixed : Returns plugin or false if not found.
|
||||
*/
|
||||
function &getPlugin($sName)
|
||||
{
|
||||
$aKeys = array_keys($this->aResponsePlugins);
|
||||
sort($aKeys);
|
||||
foreach ($aKeys as $sKey)
|
||||
if (is_a($this->aResponsePlugins[$sKey], $sName))
|
||||
return $this->aResponsePlugins[$sKey];
|
||||
|
||||
$bFailure = false;
|
||||
return $bFailure;
|
||||
}
|
||||
}
|
359
lib/xajax/xajax_core/xajaxRequest.inc.php
Executable file
|
@ -0,0 +1,359 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxRequest.inc.php
|
||||
|
||||
Contains the xajaxRequest class
|
||||
|
||||
Title: xajaxRequest class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxRequest.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Constant: XAJAX_FORM_VALUES
|
||||
Specifies that the parameter will consist of an array of form values.
|
||||
*/
|
||||
if (!defined ('XAJAX_FORM_VALUES')) define ('XAJAX_FORM_VALUES', 'get form values');
|
||||
/*
|
||||
Constant: XAJAX_INPUT_VALUE
|
||||
Specifies that the parameter will contain the value of an input control.
|
||||
*/
|
||||
if (!defined ('XAJAX_INPUT_VALUE')) define ('XAJAX_INPUT_VALUE', 'get input value');
|
||||
/*
|
||||
Constant: XAJAX_CHECKED_VALUE
|
||||
Specifies that the parameter will consist of a boolean value of a checkbox.
|
||||
*/
|
||||
if (!defined ('XAJAX_CHECKED_VALUE')) define ('XAJAX_CHECKED_VALUE', 'get checked value');
|
||||
/*
|
||||
Constant: XAJAX_ELEMENT_INNERHTML
|
||||
Specifies that the parameter value will be the innerHTML value of the element.
|
||||
*/
|
||||
if (!defined ('XAJAX_ELEMENT_INNERHTML')) define ('XAJAX_ELEMENT_INNERHTML', 'get element innerHTML');
|
||||
/*
|
||||
Constant: XAJAX_QUOTED_VALUE
|
||||
Specifies that the parameter will be a quoted value (string).
|
||||
*/
|
||||
if (!defined ('XAJAX_QUOTED_VALUE')) define ('XAJAX_QUOTED_VALUE', 'quoted value');
|
||||
/*
|
||||
Constant: XAJAX_JS_VALUE
|
||||
Specifies that the parameter will be a non-quoted value (evaluated by the
|
||||
browsers javascript engine at run time.
|
||||
*/
|
||||
if (!defined ('XAJAX_JS_VALUE')) define ('XAJAX_JS_VALUE', 'unquoted value');
|
||||
|
||||
/*
|
||||
Class: xajaxRequest
|
||||
|
||||
Used to store and generate the client script necessary to invoke
|
||||
a xajax request from the browser to the server script.
|
||||
|
||||
This object is typically generated by the <xajax->register> method
|
||||
and can be used to quickly generate the javascript that is used
|
||||
to initiate a xajax request to the registered function, object, event
|
||||
or other xajax call.
|
||||
*/
|
||||
class xajaxRequest
|
||||
{
|
||||
/*
|
||||
String: sName
|
||||
|
||||
The name of the function.
|
||||
*/
|
||||
var $sName;
|
||||
|
||||
/*
|
||||
String: sQuoteCharacter
|
||||
|
||||
A string containing either a single or a double quote character
|
||||
that will be used during the generation of the javascript for
|
||||
this function. This can be set prior to calling <xajaxRequest->printScript>
|
||||
*/
|
||||
var $sQuoteCharacter;
|
||||
|
||||
/*
|
||||
Array: aParameters
|
||||
|
||||
An array of parameters that will be used to populate the argument list
|
||||
for this function when the javascript is output in <xajaxRequest->printScript>
|
||||
*/
|
||||
var $aParameters;
|
||||
|
||||
/*
|
||||
Function: xajaxRequest
|
||||
|
||||
Construct and initialize this request.
|
||||
|
||||
sName - (string): The name of this request.
|
||||
*/
|
||||
function xajaxRequest($sName)
|
||||
{
|
||||
$this->aParameters = array();
|
||||
$this->sQuoteCharacter = '"';
|
||||
$this->sName = $sName;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: useSingleQuote
|
||||
|
||||
Call this to instruct the request to use single quotes when generating
|
||||
the javascript.
|
||||
*/
|
||||
function useSingleQuote()
|
||||
{
|
||||
$this->sQuoteCharacter = "'";
|
||||
}
|
||||
|
||||
/*
|
||||
Function: useDoubleQuote
|
||||
|
||||
Call this to instruct the request to use double quotes while generating
|
||||
the javascript.
|
||||
*/
|
||||
function useDoubleQuote()
|
||||
{
|
||||
$this->sQuoteCharacter = '"';
|
||||
}
|
||||
|
||||
/*
|
||||
Function: clearParameters
|
||||
|
||||
Clears the parameter list associated with this request.
|
||||
*/
|
||||
function clearParameters()
|
||||
{
|
||||
$this->aParameters = array();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: addParameter
|
||||
|
||||
Adds a parameter value to the parameter list for this request.
|
||||
|
||||
sType - (string): The type of the value to be used.
|
||||
sValue - (string: The value to be used.
|
||||
|
||||
See Also:
|
||||
See <xajaxRequest->setParameter> for details.
|
||||
*/
|
||||
function addParameter()
|
||||
{
|
||||
$aArgs = func_get_args();
|
||||
|
||||
if (1 < count($aArgs))
|
||||
$this->setParameter(
|
||||
count($this->aParameters),
|
||||
$aArgs[0],
|
||||
$aArgs[1]);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setParameter
|
||||
|
||||
Sets a specific parameter value.
|
||||
|
||||
Parameters:
|
||||
|
||||
nParameter - (number): The index of the parameter to set
|
||||
sType - (string): The type of value
|
||||
sValue - (string): The value as it relates to the specified type
|
||||
|
||||
Note:
|
||||
|
||||
Types should be one of the following <XAJAX_FORM_VALUES>, <XAJAX_QUOTED_VALUE>,
|
||||
<XAJAX_JS_VALUE>, <XAJAX_INPUT_VALUE>, <XAJAX_CHECKED_VALUE>.
|
||||
The value should be as follows:
|
||||
<XAJAX_FORM_VALUES> - Use the ID of the form you want to process.
|
||||
<XAJAX_QUOTED_VALUE> - The string data to be passed.
|
||||
<XAJAX_JS_VALUE> - A string containing valid javascript (either a javascript
|
||||
variable name that will be in scope at the time of the call or a
|
||||
javascript function call whose return value will become the parameter.
|
||||
|
||||
*/
|
||||
function setParameter()
|
||||
{
|
||||
$aArgs = func_get_args();
|
||||
|
||||
if (2 < count($aArgs))
|
||||
{
|
||||
$nParameter = $aArgs[0];
|
||||
$sType = $aArgs[1];
|
||||
|
||||
if (XAJAX_FORM_VALUES == $sType)
|
||||
{
|
||||
$sFormID = $aArgs[2];
|
||||
$this->aParameters[$nParameter] =
|
||||
"xajax.getFormValues("
|
||||
. $this->sQuoteCharacter
|
||||
. $sFormID
|
||||
. $this->sQuoteCharacter
|
||||
. ")";
|
||||
}
|
||||
else if (XAJAX_INPUT_VALUE == $sType)
|
||||
{
|
||||
$sInputID = $aArgs[2];
|
||||
$this->aParameters[$nParameter] =
|
||||
"xajax.$("
|
||||
. $this->sQuoteCharacter
|
||||
. $sInputID
|
||||
. $this->sQuoteCharacter
|
||||
. ").value";
|
||||
}
|
||||
else if (XAJAX_CHECKED_VALUE == $sType)
|
||||
{
|
||||
$sCheckedID = $aArgs[2];
|
||||
$this->aParameters[$nParameter] =
|
||||
"xajax.$("
|
||||
. $this->sQuoteCharacter
|
||||
. $sCheckedID
|
||||
. $this->sQuoteCharacter
|
||||
. ").checked";
|
||||
}
|
||||
else if (XAJAX_ELEMENT_INNERHTML == $sType)
|
||||
{
|
||||
$sElementID = $aArgs[2];
|
||||
$this->aParameters[$nParameter] =
|
||||
"xajax.$("
|
||||
. $this->sQuoteCharacter
|
||||
. $sElementID
|
||||
. $this->sQuoteCharacter
|
||||
. ").innerHTML";
|
||||
}
|
||||
else if (XAJAX_QUOTED_VALUE == $sType)
|
||||
{
|
||||
$sValue = $aArgs[2];
|
||||
$this->aParameters[$nParameter] =
|
||||
$this->sQuoteCharacter
|
||||
. $sValue
|
||||
. $this->sQuoteCharacter;
|
||||
}
|
||||
else if (XAJAX_JS_VALUE == $sType)
|
||||
{
|
||||
$sValue = $aArgs[2];
|
||||
$this->aParameters[$nParameter] = $sValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getScript
|
||||
|
||||
Returns a string representation of the script output (javascript) from
|
||||
this request object. See also: <xajaxRequest::printScript>
|
||||
*/
|
||||
function getScript()
|
||||
{
|
||||
ob_start();
|
||||
$this->printScript();
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: printScript
|
||||
|
||||
Generates a block of javascript code that can be used to invoke
|
||||
the specified xajax request.
|
||||
*/
|
||||
function printScript()
|
||||
{
|
||||
echo $this->sName;
|
||||
echo '(';
|
||||
|
||||
$sSeparator = '';
|
||||
|
||||
foreach ($this->aParameters as $sParameter)
|
||||
{
|
||||
echo $sSeparator;
|
||||
echo $sParameter;
|
||||
$sSeparator = ', ';
|
||||
}
|
||||
|
||||
echo ')';
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Class: xajaxCustomRequest
|
||||
|
||||
This class extends the <xajaxRequest> class such that simple javascript
|
||||
can be put in place of a xajax request to the server. The primary purpose
|
||||
of this class is to provide simple scripting services to the <xajaxControl>
|
||||
based objects, like <clsInput>, <clsTable> and <clsButton>.
|
||||
*/
|
||||
class xajaxCustomRequest extends xajaxRequest
|
||||
{
|
||||
/*
|
||||
Array: aVariables;
|
||||
*/
|
||||
var $aVariables;
|
||||
|
||||
/*
|
||||
String: sScript;
|
||||
*/
|
||||
var $sScript;
|
||||
|
||||
/*
|
||||
Function: xajaxCustomRequest
|
||||
|
||||
Constructs and initializes an instance of the object.
|
||||
|
||||
Parameters:
|
||||
|
||||
sScript - (string): The javascript (template) that will be printed
|
||||
upon request.
|
||||
aVariables - (associative array, optional): An array of variable name,
|
||||
value pairs that will be passed to <xajaxCustomRequest->setVariable>
|
||||
*/
|
||||
function xajaxCustomRequest($sScript)
|
||||
{
|
||||
$this->aVariables = array();
|
||||
$this->sScript = $sScript;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: clearVariables
|
||||
|
||||
Clears the array of variables that will be used to modify the script before
|
||||
it is printed and sent to the client.
|
||||
*/
|
||||
function clearVariables()
|
||||
{
|
||||
$this->aVariables = array();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: setVariable
|
||||
|
||||
Sets a value that will be used to modify the script before it is sent to
|
||||
the browser. The <xajaxCustomRequest> object will perform a string
|
||||
replace operation on each of the values set with this function.
|
||||
|
||||
Parameters:
|
||||
$sName - (string): Variable name
|
||||
$sValue - (string): Value
|
||||
|
||||
*/
|
||||
function setVariable($sName, $sValue)
|
||||
{
|
||||
$this->aVariables[$sName] = $sValue;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: printScript
|
||||
*/
|
||||
function printScript()
|
||||
{
|
||||
$sScript = $this->sScript;
|
||||
foreach ($this->aVariables as $sKey => $sValue)
|
||||
$sScript = str_replace($sKey, $sValue, $sScript);
|
||||
echo $sScript;
|
||||
}
|
||||
}
|
1908
lib/xajax/xajax_core/xajaxResponse.inc.php
Executable file
231
lib/xajax/xajax_core/xajaxResponseManager.inc.php
Executable file
|
@ -0,0 +1,231 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajaxResponseManager.inc.php
|
||||
|
||||
Contains the xajaxResponseManager class
|
||||
|
||||
Title: xajaxResponseManager class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajaxResponseManager.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
/*
|
||||
Class: xajaxResponseManager
|
||||
|
||||
This class stores and tracks the response that will be returned after
|
||||
processing a request. The response manager represents a single point
|
||||
of contact for working with <xajaxResponse> objects as well as
|
||||
<xajaxCustomResponse> objects.
|
||||
*/
|
||||
class xajaxResponseManager
|
||||
{
|
||||
/*
|
||||
Object: objResponse
|
||||
|
||||
The current response object that will be sent back to the browser
|
||||
once the request processing phase is complete.
|
||||
*/
|
||||
var $objResponse;
|
||||
|
||||
/*
|
||||
String: sCharacterEncoding
|
||||
*/
|
||||
var $sCharacterEncoding;
|
||||
|
||||
/*
|
||||
Boolean: bOutputEntities
|
||||
*/
|
||||
var $bOutputEntities;
|
||||
|
||||
/*
|
||||
Array: aDebugMessages
|
||||
*/
|
||||
var $aDebugMessages;
|
||||
|
||||
/*
|
||||
Function: xajaxResponseManager
|
||||
|
||||
Construct and initialize the one and only xajaxResponseManager object.
|
||||
*/
|
||||
function xajaxResponseManager()
|
||||
{
|
||||
$this->objResponse = NULL;
|
||||
$this->aDebugMessages = array();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getInstance
|
||||
|
||||
Implementation of the singleton pattern: provide a single instance of the <xajaxResponseManager>
|
||||
to all who request it.
|
||||
*/
|
||||
function &getInstance()
|
||||
{
|
||||
static $obj;
|
||||
if (!$obj) {
|
||||
$obj = new xajaxResponseManager();
|
||||
}
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: configure
|
||||
|
||||
Called by the xajax object when configuration options are set in the main script. Option
|
||||
values are passed to each of the main xajax components and stored locally as needed. The
|
||||
<xajaxResponseManager> will track the characterEncoding and outputEntities settings.
|
||||
|
||||
Parameters:
|
||||
$sName - (string): Setting name
|
||||
$mValue - (mixed): Value
|
||||
*/
|
||||
function configure($sName, $mValue)
|
||||
{
|
||||
if ('characterEncoding' == $sName)
|
||||
{
|
||||
$this->sCharacterEncoding = $mValue;
|
||||
|
||||
if (isset($this->objResponse))
|
||||
$this->objResponse->setCharacterEncoding($this->sCharacterEncoding);
|
||||
}
|
||||
else if ('outputEntities' == $sName)
|
||||
{
|
||||
if (true === $mValue || false === $mValue)
|
||||
{
|
||||
$this->bOutputEntities = $mValue;
|
||||
|
||||
if (isset($this->objResponse))
|
||||
$this->objResponse->setOutputEntities($this->bOutputEntities);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: clear
|
||||
|
||||
Clear the current response. A new response will need to be appended
|
||||
before the request processing is complete.
|
||||
*/
|
||||
function clear()
|
||||
{
|
||||
$this->objResponse = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: append
|
||||
|
||||
Used, primarily internally, to append one response object onto the end of another. You can
|
||||
append one xajaxResponse to the end of another, or append a xajaxCustomResponse onto the end of
|
||||
another xajaxCustomResponse. However, you cannot append a standard response object onto the end
|
||||
of a custom response and likewise, you cannot append a custom response onto the end of a standard
|
||||
response.
|
||||
|
||||
Parameters:
|
||||
|
||||
$mResponse - (object): The new response object to be added to the current response object.
|
||||
|
||||
If no prior response has been appended, this response becomes the main response object to which other
|
||||
response objects will be appended.
|
||||
*/
|
||||
function append($mResponse)
|
||||
{
|
||||
if (is_a($mResponse, 'xajaxResponse')) {
|
||||
if (NULL == $this->objResponse) {
|
||||
$this->objResponse = $mResponse;
|
||||
} else if (is_a($this->objResponse, 'xajaxResponse')) {
|
||||
if ($this->objResponse != $mResponse)
|
||||
$this->objResponse->absorb($mResponse);
|
||||
} else {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
$this->debug(
|
||||
$objLanguageManager->getText('XJXRM:MXRTERR')
|
||||
. get_class($this->objResponse)
|
||||
. ')'
|
||||
);
|
||||
}
|
||||
} else if (is_a($mResponse, 'xajaxCustomResponse')) {
|
||||
if (NULL == $this->objResponse) {
|
||||
$this->objResponse = $mResponse;
|
||||
} else if (is_a($this->objResponse, 'xajaxCustomResponse')) {
|
||||
if ($this->objResponse != $mResponse)
|
||||
$this->objResponse->absorb($mResponse);
|
||||
} else {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
$this->debug(
|
||||
$objLanguageManager->getText('XJXRM:MXRTERR')
|
||||
. get_class($this->objResponse)
|
||||
. ')'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
$this->debug($objLanguageManager->getText('XJXRM:IRERR'));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: debug
|
||||
|
||||
Appends a debug message on the end of the debug message queue. Debug messages
|
||||
will be sent to the client with the normal response (if the response object supports
|
||||
the sending of debug messages, see: <xajaxResponse>)
|
||||
|
||||
Parameters:
|
||||
|
||||
$sMessage - (string): The text of the debug message to be sent.
|
||||
*/
|
||||
function debug($sMessage)
|
||||
{
|
||||
$this->aDebugMessages[] = $sMessage;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: send
|
||||
|
||||
Prints the response object to the output stream, thus sending the response to the client.
|
||||
*/
|
||||
function send()
|
||||
{
|
||||
if (NULL != $this->objResponse) {
|
||||
foreach ($this->aDebugMessages as $sMessage)
|
||||
$this->objResponse->debug($sMessage);
|
||||
$this->aDebugMessages = array();
|
||||
$this->objResponse->printOutput();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getCharacterEncoding
|
||||
|
||||
Called automatically by new response objects as they are constructed to obtain the
|
||||
current character encoding setting. As the character encoding is changed, the <xajaxResponseManager>
|
||||
will automatically notify the current response object since it would have been constructed
|
||||
prior to the setting change, see <xajaxResponseManager::configure>.
|
||||
*/
|
||||
function getCharacterEncoding()
|
||||
{
|
||||
return $this->sCharacterEncoding;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getOutputEntities
|
||||
|
||||
Called automatically by new response objects as they are constructed to obtain the
|
||||
current output entities setting. As the output entities setting is changed, the
|
||||
<xajaxResponseManager> will automatically notify the current response object since it would
|
||||
have been constructed prior to the setting change, see <xajaxResponseManager::configure>.
|
||||
*/
|
||||
function getOutputEntities()
|
||||
{
|
||||
return $this->bOutputEntities;
|
||||
}
|
||||
}
|
88
lib/xajax/xajax_core/xajax_lang_de.inc.php
Executable file
|
@ -0,0 +1,88 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajax_lang_de.inc.php
|
||||
|
||||
Contains the debug and error messages output by xajax translated to German.
|
||||
|
||||
Title: xajax class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
|
||||
Translations provided by: (Thank you!)
|
||||
- mic <info@joomx.com>
|
||||
- q_no
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajax_lang_de.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
//SkipAIO
|
||||
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
$objLanguageManager->register('de', array(
|
||||
'LOGHDR:01' => '** xajax Fehler Protokoll - ',
|
||||
'LOGHDR:02' => " **\n",
|
||||
'LOGHDR:03' => "\n\n\n",
|
||||
'LOGERR:01' => "** Protokolliere Fehler **\n\nxajax konnte den Fehler nicht in die Protokolldatei schreiben:\n",
|
||||
'LOGMSG:01' => "** PHP Fehlermeldungen: **",
|
||||
'CMPRSJS:RDERR:01' => 'Die unkomprimierte JavaScript-Datei konnte nicht gefunden werden im Verzeichnis: <b>',
|
||||
'CMPRSJS:RDERR:02' => '</b>. Fehler ',
|
||||
'CMPRSJS:WTERR:01' => 'Die komprimierte xajax JavaScript-Datei konnte nicht in das Verzeichnis <b>',
|
||||
'CMPRSJS:WTERR:02' => '</b> geschrieben werden. Fehler ',
|
||||
'CMPRSPHP:WTERR:01' => 'Die komprimierte xajax Datei <b>',
|
||||
'CMPRSPHP:WTERR:02' => '</b> konnte nicht geschrieben werden. Fehler ',
|
||||
'CMPRSAIO:WTERR:01' => 'Die komprimierte xajax Datei <b>',
|
||||
'CMPRSAIO:WTERR:02' => '/xajaxAIO.inc.php</b> konnte nicht geschrieben werden. Fehler ',
|
||||
'DTCTURI:01' => 'xajax Fehler: xajax konnte die Request URI nicht automatisch identifizieren.',
|
||||
'DTCTURI:02' => 'Bitte setzen sie die Request URI explizit wenn sie die xajax Klasse instanziieren.',
|
||||
'ARGMGR:ERR:01' => 'Fehlerhaftes Objekt erhalten: ',
|
||||
'ARGMGR:ERR:02' => ' <==> ',
|
||||
'ARGMGR:ERR:03' => 'Die erhaltenen xajax Daten konnte nicht aus UTF8 konvertiert werden.',
|
||||
'XJXCTL:IAERR:01' => 'Ungültiges Attribut [',
|
||||
'XJXCTL:IAERR:02' => '] für Element [',
|
||||
'XJXCTL:IAERR:03' => '].',
|
||||
'XJXCTL:IRERR:01' => 'Ungültiges Request-Objekt übergeben an xajaxControl::setEvent',
|
||||
'XJXCTL:IEERR:01' => 'Ungültiges Attribut (event name) [',
|
||||
'XJXCTL:IEERR:02' => '] für Element [',
|
||||
'XJXCTL:IEERR:03' => '].',
|
||||
'XJXCTL:MAERR:01' => 'Erforderliches Attribut fehlt [',
|
||||
'XJXCTL:MAERR:02' => '] für Element [',
|
||||
'XJXCTL:MAERR:03' => '].',
|
||||
'XJXCTL:IETERR:01' => "Ungültiges End-Tag; Sollte 'forbidden' oder 'optional' sein.\n",
|
||||
'XJXCTL:ICERR:01' => "Ungültige Klasse für html control angegeben.; Sollte %inline, %block oder %flow sein.\n",
|
||||
'XJXCTL:ICLERR:01' => 'Ungültige Klasse (control) an addChild übergeben; Sollte abgeleitet sein von xajaxControl.',
|
||||
'XJXCTL:ICLERR:02' => 'Ungültige Klasse (control) an addChild übergeben [',
|
||||
'XJXCTL:ICLERR:03' => '] für Element [',
|
||||
'XJXCTL:ICLERR:04' => "].\n",
|
||||
'XJXCTL:ICHERR:01' => 'Ungültiger Parameter übergeben für xajaxControl::addChildren; Array aus xajaxControl Objekten erwartet.',
|
||||
'XJXCTL:MRAERR:01' => 'Erforderliches Attribut fehlt [',
|
||||
'XJXCTL:MRAERR:02' => '] für Element [',
|
||||
'XJXCTL:MRAERR:03' => '].',
|
||||
'XJXPLG:GNERR:01' => 'Response plugin sollte die Funktion getName überschreiben.',
|
||||
'XJXPLG:PERR:01' => 'Response plugin sollte die process Funktion überschreiben.',
|
||||
'XJXPM:IPLGERR:01' => 'Versuch ungültiges Plugin zu registrieren: : ',
|
||||
'XJXPM:IPLGERR:02' => ' Ableitung von xajaxRequestPlugin oder xajaxResponsePlugin erwartet.',
|
||||
'XJXPM:MRMERR:01' => 'Konnte die Registrierungsmethode nicht finden für: : ',
|
||||
'XJXRSP:EDERR:01' => 'Die Angabe der Zeichensatzkodierung in der xajaxResponse ist veraltet. Die neue Funktion lautet: $xajax->configure("characterEncoding", ...);',
|
||||
'XJXRSP:MPERR:01' => 'Ungültiger oder fehlender Pluginname festgestellt im Aufruf von xajaxResponse::plugin',
|
||||
'XJXRSP:CPERR:01' => "Der Parameter \$sType in addCreate ist veraltet. Die neue Funktion lautet addCreateInput()",
|
||||
'XJXRSP:LCERR:01' => "Das xajax response Objeckt konnte die Befehler nich verarbeiten, da kein gültiges Array übergeben wurde.",
|
||||
'XJXRSP:AKERR:01' => 'Ungültiger Tag-Name im Array.',
|
||||
'XJXRSP:IEAERR:01' => 'Ungeeignet kodiertes Array.',
|
||||
'XJXRSP:NEAERR:01' => 'Nicht kodiertes Array festgestellt.',
|
||||
'XJXRSP:MBEERR:01' => 'Die Ausgabe vonn xajax response konnte nicht in htmlentities umgewandelt werden, da die Funktion mb_convert_encoding nicht verfügbar ist.',
|
||||
'XJXRSP:MXRTERR' => 'Fehler: Kann keine verschiedenen Typen in einer einzelnen Antwort verarbeiten.',
|
||||
'XJXRSP:MXCTERR' => 'Fehler: Kann keine verschiedenen Content-Types in einer einzelnen Antwort verarbeiten.',
|
||||
'XJXRSP:MXCEERR' => 'Fehler: Kann keine verschiedenen Zeichensatzkodierungen in einer einzelnen Antwort verarbeiten.',
|
||||
'XJXRSP:MXOEERR' => 'Fehler: Kann keine output entities (true/false) in ener einzelnen Antwort verarbeiten.',
|
||||
'XJXRM:IRERR' => 'Ungültige Antwort erhalten während der Ausführung der Anfrage.',
|
||||
'XJXRM:MXRTERR' => 'Fehler: Kann kkeine verschiedenen reponse types benutzen während der Ausführung einer Anfrage: '
|
||||
));
|
||||
|
||||
//EndSkipAIO
|
79
lib/xajax/xajax_core/xajax_lang_nl.inc.php
Executable file
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
/*
|
||||
File: xajax_lang_nl.inc.php
|
||||
|
||||
Contains the debug and error messages output by xajax translated to Dutch.
|
||||
|
||||
Title: xajax class
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
|
||||
Translations provided by: (Thank you!)
|
||||
- Jeffrey <walkingsoul@gmail.com>
|
||||
*/
|
||||
|
||||
//SkipAIO
|
||||
|
||||
$objLanguageManager =& xajaxLanguageManager::getInstance();
|
||||
$objLanguageManager->register('nl', array(
|
||||
'LOGHDR:01' => '** xajax Foutmelding logboek - ',
|
||||
'LOGHDR:02' => " **\n",
|
||||
'LOGHDR:03' => "\n\n\n",
|
||||
'LOGERR:01' => "** Logboek fouten **\n\nxajax was niet in staat om te schrijven naar het logboek:\n",
|
||||
'LOGMSG:01' => "** PHP Foutmeldingen: **",
|
||||
'CMPRSJS:RDERR:01' => 'Het xajax ongecomprimeerde Javascript bestand kon niet worden gevonden in de: <b>',
|
||||
'CMPRSJS:RDERR:02' => '</b>. map. ',
|
||||
'CMPRSJS:WTERR:01' => 'Het xajax gecomprimeerde Javascript bestand kon niet worden geschreven in de: <b>',
|
||||
'CMPRSJS:WTERR:02' => '</b> map. Fout ',
|
||||
'CMPRSPHP:WTERR:01' => 'Naar het xajax gecomprimeerde bestand <b>',
|
||||
'CMPRSPHP:WTERR:02' => '</b> kon niet worden geschreven. Fout ',
|
||||
'CMPRSAIO:WTERR:01' => 'Naar het xajax gecomprimeerde bestand <b>',
|
||||
'CMPRSAIO:WTERR:02' => '/xajaxAIO.inc.php</b> kon niet worden geschreven. Fout ',
|
||||
'DTCTURI:01' => 'xajax Fout: xajax kon de Request URI niet automatisch identificeren.',
|
||||
'DTCTURI:02' => 'Alstublieft, specificeer de Request URI expliciet bij het initiëren van het xajax object.',
|
||||
'ARGMGR:ERR:01' => 'Misvormd object argument ontvangen: ',
|
||||
'ARGMGR:ERR:02' => ' <==> ',
|
||||
'ARGMGR:ERR:03' => 'De binnenkomende xajax data kon niet wordt geconverteerd van UTF-8.',
|
||||
'XJXCTL:IAERR:01' => 'Ongeldig attribuut [',
|
||||
'XJXCTL:IAERR:02' => '] voor element [',
|
||||
'XJXCTL:IAERR:03' => '].',
|
||||
'XJXCTL:IRERR:01' => 'Ongeldige object aanvraag doorgegeven aan xajaxControl::setEvent',
|
||||
'XJXCTL:IEERR:01' => 'Ongeldig attribuut (event name) [',
|
||||
'XJXCTL:IEERR:02' => '] voor element [',
|
||||
'XJXCTL:IEERR:03' => '].',
|
||||
'XJXCTL:MAERR:01' => 'Ontbrekend attribuut [',
|
||||
'XJXCTL:MAERR:02' => '] voor element [',
|
||||
'XJXCTL:MAERR:03' => '].',
|
||||
'XJXCTL:IETERR:01' => "Ongeldige eind-tag; zou 'forbidden' of 'optional' moeten zijn..\n",
|
||||
'XJXCTL:ICERR:01' => "Ongeldige klasse gespecificeerd voor html control.; zou %inline, %block of %flow moeten zijn.\n",
|
||||
'XJXCTL:ICLERR:01' => 'Ongeldige (control) doorgegeven aan addChild; Zou moeten worden afgeleid van xajaxControl.',
|
||||
'XJXCTL:ICLERR:02' => 'Ongeldige (control) doorgegeven aan addChild [',
|
||||
'XJXCTL:ICLERR:03' => '] voor element [',
|
||||
'XJXCTL:ICLERR:04' => "].\n",
|
||||
'XJXCTL:ICHERR:01' => 'Ongeldige parameter doorgegeven aan xajaxControl::addChildren; Array moet bestaan uit xajaxControl objecten.',
|
||||
'XJXCTL:MRAERR:01' => 'Ontbrekend attribuut [',
|
||||
'XJXCTL:MRAERR:02' => '] voor element [',
|
||||
'XJXCTL:MRAERR:03' => '].',
|
||||
'XJXPLG:GNERR:01' => 'Retourneer plugin zou de getName functie moeten overschrijven.',
|
||||
'XJXPLG:PERR:01' => 'Retourneer plugin zou de proces functie moeten overschrijven.',
|
||||
'XJXPM:IPLGERR:01' => 'Poging om ongeldige plugin te registreren: : ',
|
||||
'XJXPM:IPLGERR:02' => ' afleiding moet komen van xajaxRequestPlugin of xajaxResponsePlugin.',
|
||||
'XJXPM:MRMERR:01' => 'Localisatie van registratie methode faalde voor het volgende: : ',
|
||||
'XJXRSP:EDERR:01' => 'Doorgeven van karakter decodering naar de xajaxResponse constructie is verouderd. De nieuwe functie luidt: $xajax->configure("characterEncoding", ...);',
|
||||
'XJXRSP:MPERR:01' => 'Ongeldige of ontbrekende plugin naam gedetecteerd in een aanvraag naar xajaxResponse::plugin',
|
||||
'XJXRSP:CPERR:01' => "De parameter \$sType in addCreate is verouderd.. De nieuwe functie luidt addCreateInput()",
|
||||
'XJXRSP:LCERR:01' => "Het xajax antwoord object kon de commando's niet laden, gezien de meegegeven data geen geldige array is.",
|
||||
'XJXRSP:AKERR:01' => 'Ongeldige ge-encodeerde tag naam in array',
|
||||
'XJXRSP:IEAERR:01' => 'Ungeeignet kodiertes Array.',
|
||||
'XJXRSP:NEAERR:01' => 'Niet gecodeerde array gedetecteerd.',
|
||||
'XJXRSP:MBEERR:01' => 'De xajax output kon niet worden geconverteerd naar HTML entities, gezien mb_convert_encoding niet beschikbaar is.',
|
||||
'XJXRSP:MXRTERR' => 'Fout: Kann keine verschiedenen Typen in einer einzelnen Antwort verarbeiten.',
|
||||
'XJXRSP:MXCTERR' => 'Fout: Kan geen meerdere typen verwisselen in een enkele teruggave.',
|
||||
'XJXRSP:MXCEERR' => 'Fout: Kan geen meerdere karakter decoderingen verwerken in een enkele teruggave.',
|
||||
'XJXRSP:MXOEERR' => 'Fout: kan geen output entities (true/false) in een enkele teruggave verwerken.',
|
||||
'XJXRM:IRERR' => 'Een ongeldig antwoord is geretourneerd tijdens het verwerken van deze aanvraag.',
|
||||
'XJXRM:MXRTERR' => 'Fout: Kan geen meerdere typen verwisselen tijdens het verwerken van een enkele aanvraag: '
|
||||
));
|
||||
|
||||
//EndSkipAIO
|
411
lib/xajax/xajax_js/xajax_core.js
Executable file
|
@ -0,0 +1,411 @@
|
|||
|
||||
if('undefined'==typeof xajax)
|
||||
xajax={};if('undefined'==typeof xajax.config)
|
||||
xajax.config={};xajax.config.setDefault=function(option,defaultValue){if('undefined'==typeof xajax.config[option])
|
||||
xajax.config[option]=defaultValue;}
|
||||
xajax.config.setDefault('commonHeaders',{'If-Modified-Since':'Sat, 1 Jan 2000 00:00:00 GMT'
|
||||
});xajax.config.setDefault('postHeaders',{});xajax.config.setDefault('getHeaders',{});xajax.config.setDefault('waitCursor',false);xajax.config.setDefault('statusMessages',false);xajax.config.setDefault('baseDocument',document);xajax.config.setDefault('requestURI',xajax.config.baseDocument.URL);xajax.config.setDefault('defaultMode','asynchronous');xajax.config.setDefault('defaultHttpVersion','HTTP/1.1');xajax.config.setDefault('defaultContentType','application/x-www-form-urlencoded');xajax.config.setDefault('defaultResponseDelayTime',1000);xajax.config.setDefault('defaultExpirationTime',10000);xajax.config.setDefault('defaultMethod','POST');xajax.config.setDefault('defaultRetry',5);xajax.config.setDefault('defaultReturnValue',false);xajax.config.setDefault('maxObjectDepth',20);xajax.config.setDefault('maxObjectSize',2000);xajax.config.setDefault('responseQueueSize',1000);xajax.config.status={update:function(){return{onRequest:function(){window.status='Sending Request...';},
|
||||
onWaiting:function(){window.status='Waiting for Response...';},
|
||||
onProcessing:function(){window.status='Processing...';},
|
||||
onComplete:function(){window.status='Done.';}
|
||||
}
|
||||
},
|
||||
dontUpdate:function(){return{onRequest:function(){},
|
||||
onWaiting:function(){},
|
||||
onProcessing:function(){},
|
||||
onComplete:function(){}
|
||||
}
|
||||
}
|
||||
}
|
||||
xajax.config.cursor={update:function(){return{onWaiting:function(){if(xajax.config.baseDocument.body)
|
||||
xajax.config.baseDocument.body.style.cursor='wait';},
|
||||
onComplete:function(){xajax.config.baseDocument.body.style.cursor='auto';}
|
||||
}
|
||||
},
|
||||
dontUpdate:function(){return{onWaiting:function(){},
|
||||
onComplete:function(){}
|
||||
}
|
||||
}
|
||||
}
|
||||
xajax.tools={}
|
||||
xajax.tools.$=function(sId){if(!sId)
|
||||
return null;var oDoc=xajax.config.baseDocument;var obj=oDoc.getElementById(sId);if(obj)
|
||||
return obj;if(oDoc.all)
|
||||
return oDoc.all[sId];return obj;}
|
||||
xajax.tools.arrayContainsValue=function(array,valueToCheck){var i=0;var l=array.length;while(i < l){if(array[i]==valueToCheck)
|
||||
return true;++i;}
|
||||
return false;}
|
||||
xajax.tools.doubleQuotes=function(haystack){return haystack.replace(new RegExp("'",'g'),'"');}
|
||||
xajax.tools.singleQuotes=function(haystack){return haystack.replace(new RegExp('"','g'),"'");}
|
||||
xajax.tools._escape=function(data){if('undefined'==typeof data)
|
||||
return data;if('string'!=typeof data)
|
||||
return data;var needCDATA=false;if(encodeURIComponent(data)!=data){needCDATA=true;var segments=data.split('<![CDATA[');var segLen=segments.length;data=[];for(var i=0;i < segLen;++i){var segment=segments[i];var fragments=segment.split(']]>');var fragLen=fragments.length;segment='';for(var j=0;j < fragLen;++j){if(0!=j)
|
||||
segment+=']]]]><![CDATA[>';segment+=fragments[j];}
|
||||
if(0!=i)
|
||||
data.push('<![]]><![CDATA[CDATA[');data.push(segment);}
|
||||
data=data.join('');}
|
||||
if(needCDATA)
|
||||
data='<![CDATA['+data+']]>';return data;}
|
||||
xajax.tools._objectToXML=function(obj,guard){var aXml=[];aXml.push('<xjxobj>');for(var key in obj){++guard.size;if(guard.maxSize < guard.size)
|
||||
return aXml.join('');if('undefined'!=typeof obj[key]){if('constructor'==key)
|
||||
continue;if('function'==typeof obj[key])
|
||||
continue;aXml.push('<e><k>');var val=xajax.tools._escape(key);aXml.push(val);aXml.push('</k><v>');if('object'==typeof obj[key]){++guard.depth;if(guard.maxDepth > guard.depth){try{aXml.push(xajax.tools._objectToXML(obj[key],guard));}catch(e){}
|
||||
}
|
||||
--guard.depth;}else{var val=xajax.tools._escape(obj[key]);if('undefined'==typeof val||null==val){aXml.push('*');}else{var sType=typeof val;if('string'==sType)
|
||||
aXml.push('S');else if('boolean'==sType)
|
||||
aXml.push('B');else if('number'==sType)
|
||||
aXml.push('N');aXml.push(val);}
|
||||
}
|
||||
aXml.push('</v></e>');}
|
||||
}
|
||||
aXml.push('</xjxobj>');return aXml.join('');}
|
||||
xajax.tools._enforceDataType=function(value){value=new String(value);var type=value.substr(0,1);value=value.substr(1);if('*'==type)
|
||||
value=null;else if('N'==type)
|
||||
value=value-0;else if('B'==type)
|
||||
value=!!value;return value;}
|
||||
xajax.tools._nodeToObject=function(node){if(null==node)
|
||||
return '';if('undefined'!=typeof node.nodeName){if('#cdata-section'==node.nodeName||'#text'==node.nodeName){var data='';do if(node.data)data+=node.data;while(node=node.nextSibling);return xajax.tools._enforceDataType(data);}else if('xjxobj'==node.nodeName){var key=null;var value=null;var data=new Array;var child=node.firstChild;while(child){if('e'==child.nodeName){var grandChild=child.firstChild;while(grandChild){if('k'==grandChild.nodeName)
|
||||
key=xajax.tools._enforceDataType(grandChild.firstChild.data);else('v'==grandChild.nodeName)
|
||||
value=xajax.tools._nodeToObject(grandChild.firstChild);grandChild=grandChild.nextSibling;}
|
||||
if(null!=key){data[key]=value;key=value=null;}
|
||||
}
|
||||
child=child.nextSibling;}
|
||||
return data;}
|
||||
}
|
||||
throw{code:10001,data:node.nodeName};}
|
||||
xajax.tools.getRequestObject=function(){if('undefined'!=typeof XMLHttpRequest){xajax.tools.getRequestObject=function(){return new XMLHttpRequest();}
|
||||
}else if('undefined'!=typeof ActiveXObject){xajax.tools.getRequestObject=function(){try{return new ActiveXObject('Msxml2.XMLHTTP.4.0');}catch(e){xajax.tools.getRequestObject=function(){try{return new ActiveXObject('Msxml2.XMLHTTP');}catch(e2){xajax.tools.getRequestObject=function(){return new ActiveXObject('Microsoft.XMLHTTP');}
|
||||
return xajax.tools.getRequestObject();}
|
||||
}
|
||||
return xajax.tools.getRequestObject();}
|
||||
}
|
||||
}else if(window.createRequest){xajax.tools.getRequestObject=function(){return window.createRequest();}
|
||||
}else{xajax.tools.getRequestObject=function(){throw{code:10002};}
|
||||
}
|
||||
return xajax.tools.getRequestObject();}
|
||||
xajax.tools.getBrowserHTML=function(sValue){var oDoc=xajax.config.baseDocument;if(!oDoc.body)
|
||||
return '';var elWorkspace=xajax.$('xajax_temp_workspace');if(!elWorkspace){elWorkspace=oDoc.createElement('div');elWorkspace.setAttribute('id','xajax_temp_workspace');elWorkspace.style.display='none';elWorkspace.style.visibility='hidden';oDoc.body.appendChild(elWorkspace);}
|
||||
elWorkspace.innerHTML=sValue;var browserHTML=elWorkspace.innerHTML;elWorkspace.innerHTML='';return browserHTML;}
|
||||
xajax.tools.willChange=function(element,attribute,newData){if('string'==typeof element)
|
||||
element=xajax.$(element);if(element){var oldData;eval('oldData=element.'+attribute);return(newData!=oldData);}
|
||||
return false;}
|
||||
xajax.tools.getFormValues=function(parent){var submitDisabledElements=false;if(arguments.length > 1&&arguments[1]==true)
|
||||
submitDisabledElements=true;var prefix='';if(arguments.length > 2)
|
||||
prefix=arguments[2];if('string'==typeof parent)
|
||||
parent=xajax.$(parent);var aFormValues={};if(parent)
|
||||
if(parent.childNodes)
|
||||
xajax.tools._getFormValues(aFormValues,parent.childNodes,submitDisabledElements,prefix);return aFormValues;}
|
||||
xajax.tools._getFormValues=function(aFormValues,children,submitDisabledElements,prefix){var iLen=children.length;for(var i=0;i < iLen;++i){var child=children[i];if('undefined'!=typeof child.childNodes)
|
||||
xajax.tools._getFormValues(aFormValues,child.childNodes,submitDisabledElements,prefix);xajax.tools._getFormValue(aFormValues,child,submitDisabledElements,prefix);}
|
||||
}
|
||||
xajax.tools._getFormValue=function(aFormValues,child,submitDisabledElements,prefix){if(!child.name)
|
||||
return;if('PARAM'==child.tagName)return;if(child.disabled)
|
||||
if(true==child.disabled)
|
||||
if(false==submitDisabledElements)
|
||||
return;if(prefix!=child.name.substring(0,prefix.length))
|
||||
return;if(child.type)
|
||||
if(child.type=='radio'||child.type=='checkbox')
|
||||
if(false==child.checked)
|
||||
return;var name=child.name;var values=[];if('select-multiple'==child.type){var jLen=child.length;for(var j=0;j < jLen;++j){var option=child.options[j];if(true==option.selected)
|
||||
values.push(option.value);}
|
||||
}else{values=child.value;}
|
||||
var keyBegin=name.indexOf('[');if(0 <=keyBegin){var n=name;var k=n.substr(0,n.indexOf('['));var a=n.substr(n.indexOf('['));if(typeof aFormValues[k]=='undefined')
|
||||
aFormValues[k]=[];var p=aFormValues;while(a.length!=0){var sa=a.substr(0,a.indexOf(']')+1);var lk=k;var lp=p;a=a.substr(a.indexOf(']')+1);p=p[k];k=sa.substr(1,sa.length-2);if(k==''){if('select-multiple'==child.type){k=lk;p=lp;}else{k=p.length;}
|
||||
}
|
||||
if(typeof p[k]=='undefined')
|
||||
p[k]=[];}
|
||||
p[k]=values;}else{aFormValues[name]=values;}
|
||||
}
|
||||
xajax.tools.stripOnPrefix=function(sEventName){sEventName=sEventName.toLowerCase();if(0==sEventName.indexOf('on'))
|
||||
sEventName=sEventName.replace(/on/,'');return sEventName;}
|
||||
xajax.tools.addOnPrefix=function(sEventName){sEventName=sEventName.toLowerCase();if(0!=sEventName.indexOf('on'))
|
||||
sEventName='on'+sEventName;return sEventName;}
|
||||
xajax.tools.xml={};xajax.tools.xml.parseAttributes=function(child,obj){var iLen=child.attributes.length;for(var i=0;i < iLen;++i){var attr=child.attributes[i];obj[attr.name]=attr.value;}
|
||||
}
|
||||
xajax.tools.xml.parseChildren=function(child,obj){obj.data='';if(0 < child.childNodes.length){if(1 < child.childNodes.length){var grandChild=child.firstChild;do{if('#cdata-section'==grandChild.nodeName||'#text'==grandChild.nodeName){obj.data+=grandChild.data;}
|
||||
}while(grandChild=grandChild.nextSibling);}else{var grandChild=child.firstChild;if('xjxobj'==grandChild.nodeName){obj.data=xajax.tools._nodeToObject(grandChild);return;}else if('#cdata-section'==grandChild.nodeName||'#text'==grandChild.nodeName){obj.data=grandChild.data;}
|
||||
}
|
||||
}else if('undefined'!=typeof child.data){obj.data=child.data;}
|
||||
obj.data=xajax.tools._enforceDataType(obj.data);}
|
||||
xajax.tools.xml.processFragment=function(xmlNode,seq,oRet,oRequest){var xx=xajax;var xt=xx.tools;while(xmlNode){if('cmd'==xmlNode.nodeName){var obj={};obj.fullName='*unknown*';obj.sequence=seq;obj.request=oRequest;obj.context=oRequest.context;xt.xml.parseAttributes(xmlNode,obj);xt.xml.parseChildren(xmlNode,obj);xt.queue.push(xx.response,obj);}else if('xjxrv'==xmlNode.nodeName){oRet=xt._nodeToObject(xmlNode.firstChild);}else if('debugmsg'==xmlNode.nodeName){}else
|
||||
throw{code:10004,data:xmlNode.nodeName}
|
||||
++seq;xmlNode=xmlNode.nextSibling;}
|
||||
return oRet;}
|
||||
xajax.tools.queue={}
|
||||
xajax.tools.queue.create=function(size){return{start:0,
|
||||
size:size,
|
||||
end:0,
|
||||
commands:[],
|
||||
timeout:null
|
||||
}
|
||||
}
|
||||
xajax.tools.queue.retry=function(obj,count){var retries=obj.retries;if(retries){--retries;if(1 > retries)
|
||||
return false;}else retries=count;obj.retries=retries;return true;}
|
||||
xajax.tools.queue.rewind=function(theQ){if(0 < theQ.start)
|
||||
--theQ.start;else
|
||||
theQ.start=theQ.size;}
|
||||
xajax.tools.queue.setWakeup=function(theQ,when){if(null!=theQ.timeout){clearTimeout(theQ.timeout);theQ.timeout=null;}
|
||||
theQ.timout=setTimeout(function(){xajax.tools.queue.process(theQ);},when);}
|
||||
xajax.tools.queue.process=function(theQ){if(null!=theQ.timeout){clearTimeout(theQ.timeout);theQ.timeout=null;}
|
||||
var obj=xajax.tools.queue.pop(theQ);while(null!=obj){try{if(false==xajax.executeCommand(obj))
|
||||
return false;}catch(e){}
|
||||
delete obj;obj=xajax.tools.queue.pop(theQ);}
|
||||
return true;}
|
||||
xajax.tools.queue.push=function(theQ,obj){var next=theQ.end+1;if(next > theQ.size)
|
||||
next=0;if(next!=theQ.start){theQ.commands[theQ.end]=obj;theQ.end=next;}else
|
||||
throw{code:10003}
|
||||
}
|
||||
xajax.tools.queue.pushFront=function(theQ,obj){xajax.tools.queue.rewind(theQ);theQ.commands[theQ.start]=obj;}
|
||||
xajax.tools.queue.pop=function(theQ){var next=theQ.start;if(next==theQ.end)
|
||||
return null;next++;if(next > theQ.size)
|
||||
next=0;var obj=theQ.commands[theQ.start];delete theQ.commands[theQ.start];theQ.start=next;return obj;}
|
||||
xajax.responseProcessor={};xajax.responseProcessor.xml=function(oRequest){var xx=xajax;var xt=xx.tools;var xcb=xx.callback;var gcb=xcb.global;var lcb=oRequest.callback;var oRet=oRequest.returnValue;if(xt.arrayContainsValue(xx.responseSuccessCodes,oRequest.request.status)){xcb.execute([gcb,lcb],'onSuccess',oRequest);var seq=0;if(oRequest.request.responseXML){var responseXML=oRequest.request.responseXML;if(responseXML.documentElement){oRequest.status.onProcessing();var child=responseXML.documentElement.firstChild;oRet=xt.xml.processFragment(child,seq,oRet,oRequest);}
|
||||
}
|
||||
var obj={};obj.fullName='Response Complete';obj.sequence=seq;obj.request=oRequest;obj.context=oRequest.context;obj.cmd='rcmplt';xt.queue.push(xx.response,obj);if(null==xx.response.timeout)
|
||||
xt.queue.process(xx.response);}else if(xt.arrayContainsValue(xx.responseRedirectCodes,oRequest.request.status)){xcb.execute([gcb,lcb],'onRedirect',oRequest);window.location=oRequest.request.getResponseHeader('location');xx.completeResponse(oRequest);}else if(xt.arrayContainsValue(xx.responseErrorsForAlert,oRequest.request.status)){xcb.execute([gcb,lcb],'onFailure',oRequest);xx.completeResponse(oRequest);}
|
||||
return oRet;}
|
||||
xajax.js={}
|
||||
xajax.js.includeScriptOnce=function(command){command.fullName='includeScriptOnce';var fileName=command.data;var oDoc=xajax.config.baseDocument;var loadedScripts=oDoc.getElementsByTagName('script');var iLen=loadedScripts.length;for(var i=0;i < iLen;++i){var script=loadedScripts[i];if(script.src){if(0 <=script.src.indexOf(fileName))
|
||||
return true;}
|
||||
}
|
||||
return xajax.js.includeScript(command);}
|
||||
xajax.js.includeScript=function(command){command.fullName='includeScript';var oDoc=xajax.config.baseDocument;var objHead=oDoc.getElementsByTagName('head');var objScript=oDoc.createElement('script');objScript.src=command.data;if('undefined'==typeof command.type)objScript.type='text/javascript';else objScript.type=command.type;if('undefined'!=typeof command.type)objScript.setAttribute('id',command.elm_id);objHead[0].appendChild(objScript);return true;}
|
||||
xajax.js.removeScript=function(command){command.fullName='removeScript';var fileName=command.data;var unload=command.unld;var oDoc=xajax.config.baseDocument;var loadedScripts=oDoc.getElementsByTagName('script');var iLen=loadedScripts.length;for(var i=0;i < iLen;++i){var script=loadedScripts[i];if(script.src){if(0 <=script.src.indexOf(fileName)){if('undefined'!=typeof unload){var args={};args.data=unload;args.context=window;xajax.js.execute(args);}
|
||||
var parent=script.parentNode;parent.removeChild(script);}
|
||||
}
|
||||
}
|
||||
return true;}
|
||||
xajax.js.sleep=function(command){command.fullName='sleep';if(xajax.tools.queue.retry(command,command.prop)){xajax.tools.queue.setWakeup(xajax.response,100);return false;}
|
||||
return true;}
|
||||
xajax.js.confirmCommands=function(command){command.fullName='confirmCommands';var msg=command.data;var numberOfCommands=command.id;if(false==confirm(msg)){while(0 < numberOfCommands){xajax.tools.queue.pop(xajax.response);--numberOfCommands;}
|
||||
}
|
||||
return true;}
|
||||
xajax.js.execute=function(args){args.fullName='execute Javascript';var returnValue=true;args.context.xajaxDelegateCall=function(){eval(args.data);}
|
||||
args.context.xajaxDelegateCall();return returnValue;}
|
||||
xajax.js.waitFor=function(args){args.fullName='waitFor';var bResult=false;var cmdToEval='bResult = (';cmdToEval+=args.data;cmdToEval+=');';try{args.context.xajaxDelegateCall=function(){eval(cmdToEval);}
|
||||
args.context.xajaxDelegateCall();}catch(e){}
|
||||
if(false==bResult){if(xajax.tools.queue.retry(args,args.prop)){xajax.tools.queue.setWakeup(xajax.response,100);return false;}
|
||||
}
|
||||
return true;}
|
||||
xajax.js.call=function(args){args.fullName='call js function';var parameters=args.data;var scr=new Array();scr.push(args.func);scr.push('(');if('undefined'!=typeof parameters){if('object'==typeof parameters){var iLen=parameters.length;if(0 < iLen){scr.push('parameters[0]');for(var i=1;i < iLen;++i)
|
||||
scr.push(', parameters['+i+']');}
|
||||
}
|
||||
}
|
||||
scr.push(');');args.context.xajaxDelegateCall=function(){eval(scr.join(''));}
|
||||
args.context.xajaxDelegateCall();return true;}
|
||||
xajax.js.setFunction=function(args){args.fullName='setFunction';var code=new Array();code.push(args.func);code.push(' = function(');if('object'==typeof args.prop){var separator='';for(var m in args.prop){code.push(separator);code.push(args.prop[m]);separator=',';}
|
||||
}else code.push(args.prop);code.push(') { ');code.push(args.data);code.push(' }');args.context.xajaxDelegateCall=function(){eval(code.join(''));}
|
||||
args.context.xajaxDelegateCall();return true;}
|
||||
xajax.js.wrapFunction=function(args){args.fullName='wrapFunction';var code=new Array();code.push(args.func);code.push(' = xajax.js.makeWrapper(');code.push(args.func);code.push(', args.prop, args.data, args.type, args.context);');args.context.xajaxDelegateCall=function(){eval(code.join(''));}
|
||||
args.context.xajaxDelegateCall();return true;}
|
||||
xajax.js.makeWrapper=function(origFun,args,codeBlocks,returnVariable,context){var originalCall='';if(0 < returnVariable.length){originalCall+=returnVariable;originalCall+=' = ';}
|
||||
var originalCall='origFun(';originalCall+=args;originalCall+='); ';var code='wrapper = function(';code+=args;code+=') { ';if(0 < returnVariable.length){code+=' var ';code+=returnVariable;code+=' = null;';}
|
||||
var separator='';var bLen=codeBlocks.length;for(var b=0;b < bLen;++b){code+=separator;code+=codeBlocks[b];separator=originalCall;}
|
||||
if(0 < returnVariable.length){code+=' return ';code+=returnVariable;code+=';';}
|
||||
code+=' } ';var wrapper=null;context.xajaxDelegateCall=function(){eval(code);}
|
||||
context.xajaxDelegateCall();return wrapper;}
|
||||
xajax.dom={}
|
||||
xajax.dom.assign=function(element,property,data){if('string'==typeof element)
|
||||
element=xajax.$(element);switch(property){case 'innerHTML':
|
||||
element.innerHTML=data;break;case 'outerHTML':
|
||||
if('undefined'==typeof element.outerHTML){var r=xajax.config.baseDocument.createRange();r.setStartBefore(element);var df=r.createContextualFragment(data);element.parentNode.replaceChild(df,element);}else element.outerHTML=data;break;default:
|
||||
if(xajax.tools.willChange(element,property,data))
|
||||
eval('element.'+property+' = data;');break;}
|
||||
return true;}
|
||||
xajax.dom.append=function(element,property,data){if('string'==typeof element)
|
||||
element=xajax.$(element);eval('element.'+property+' += data;');return true;}
|
||||
xajax.dom.prepend=function(element,property,data){if('string'==typeof element)
|
||||
element=xajax.$(element);eval('element.'+property+' = data + element.'+property);return true;}
|
||||
xajax.dom.replace=function(element,sAttribute,aData){var sSearch=aData['s'];var sReplace=aData['r'];if(sAttribute=='innerHTML')
|
||||
sSearch=xajax.tools.getBrowserHTML(sSearch);if('string'==typeof element)
|
||||
element=xajax.$(element);eval('var txt = element.'+sAttribute);var bFunction=false;if('function'==typeof txt){txt=txt.join('');bFunction=true;}
|
||||
var start=txt.indexOf(sSearch);if(start >-1){var newTxt=[];while(start >-1){var end=start+sSearch.length;newTxt.push(txt.substr(0,start));newTxt.push(sReplace);txt=txt.substr(end,txt.length-end);start=txt.indexOf(sSearch);}
|
||||
newTxt.push(txt);newTxt=newTxt.join('');if(bFunction){eval('element.'+sAttribute+'=newTxt;');}else if(xajax.tools.willChange(element,sAttribute,newTxt)){eval('element.'+sAttribute+'=newTxt;');}
|
||||
}
|
||||
return true;}
|
||||
xajax.dom.remove=function(element){if('string'==typeof element)
|
||||
element=xajax.$(element);if(element&&element.parentNode&&element.parentNode.removeChild)
|
||||
element.parentNode.removeChild(element);return true;}
|
||||
xajax.dom.create=function(objParent,sTag,sId){if('string'==typeof objParent)
|
||||
objParent=xajax.$(objParent);var target=xajax.config.baseDocument.createElement(sTag);target.setAttribute('id',sId);if(objParent)
|
||||
objParent.appendChild(target);return true;}
|
||||
xajax.dom.insert=function(objSibling,sTag,sId){if('string'==typeof objSibling)
|
||||
objSibling=xajax.$(objSibling);var target=xajax.config.baseDocument.createElement(sTag);target.setAttribute('id',sId);objSibling.parentNode.insertBefore(target,objSibling);return true;}
|
||||
xajax.dom.insertAfter=function(objSibling,sTag,sId){if('string'==typeof objSibling)
|
||||
objSibling=xajax.$(objSibling);var target=xajax.config.baseDocument.createElement(sTag);target.setAttribute('id',sId);objSibling.parentNode.insertBefore(target,objSibling.nextSibling);return true;}
|
||||
xajax.dom.contextAssign=function(args){args.fullName='context assign';var code=[];code.push('this.');code.push(args.prop);code.push(' = data;');code=code.join('');args.context.xajaxDelegateCall=function(data){eval(code);}
|
||||
args.context.xajaxDelegateCall(args.data);return true;}
|
||||
xajax.dom.contextAppend=function(args){args.fullName='context append';var code=[];code.push('this.');code.push(args.prop);code.push(' += data;');code=code.join('');args.context.xajaxDelegateCall=function(data){eval(code);}
|
||||
args.context.xajaxDelegateCall(args.data);return true;}
|
||||
xajax.dom.contextPrepend=function(args){args.fullName='context prepend';var code=[];code.push('this.');code.push(args.prop);code.push(' = data + this.');code.push(args.prop);code.push(';');code=code.join('');args.context.xajaxDelegateCall=function(data){eval(code);}
|
||||
args.context.xajaxDelegateCall(args.data);return true;}
|
||||
xajax.css={}
|
||||
xajax.css.add=function(fileName,media){var oDoc=xajax.config.baseDocument;var oHeads=oDoc.getElementsByTagName('head');var oHead=oHeads[0];var oLinks=oHead.getElementsByTagName('link');var found=false;var iLen=oLinks.length;for(var i=0;i < iLen&&false==found;++i)
|
||||
if(0 <=oLinks[i].href.indexOf(fileName)&&oLinks[i].media==media)
|
||||
found=true;if(false==found){var oCSS=oDoc.createElement('link');oCSS.rel='stylesheet';oCSS.type='text/css';oCSS.href=fileName;oCSS.media=media;oHead.appendChild(oCSS);}
|
||||
return true;}
|
||||
xajax.css.remove=function(fileName,media){var oDoc=xajax.config.baseDocument;var oHeads=oDoc.getElementsByTagName('head');var oHead=oHeads[0];var oLinks=oHead.getElementsByTagName('link');var i=0;while(i < oLinks.length)
|
||||
if(0 <=oLinks[i].href.indexOf(fileName)&&oLinks[i].media==media)
|
||||
oHead.removeChild(oLinks[i]);else++i;return true;}
|
||||
xajax.css.waitForCSS=function(args){var oDocSS=xajax.config.baseDocument.styleSheets;var ssEnabled=[];var iLen=oDocSS.length;for(var i=0;i < iLen;++i){ssEnabled[i]=0;try{ssEnabled[i]=oDocSS[i].cssRules.length;}catch(e){try{ssEnabled[i]=oDocSS[i].rules.length;}catch(e){}
|
||||
}
|
||||
}
|
||||
var ssLoaded=true;var iLen=ssEnabled.length;for(var i=0;i < iLen;++i)
|
||||
if(0==ssEnabled[i])
|
||||
ssLoaded=false;if(false==ssLoaded){if(xajax.tools.queue.retry(args,args.prop)){xajax.tools.queue.setWakeup(xajax.response,10);return false;}
|
||||
}
|
||||
return true;}
|
||||
xajax.forms={}
|
||||
xajax.forms.getInput=function(type,name,id){if('undefined'==typeof window.addEventListener){xajax.forms.getInput=function(type,name,id){return xajax.config.baseDocument.createElement('<input type="'+type+'" name="'+name+'" id="'+id+'">');}
|
||||
}else{xajax.forms.getInput=function(type,name,id){var oDoc=xajax.config.baseDocument;var Obj=oDoc.createElement('input');Obj.setAttribute('type',type);Obj.setAttribute('name',name);Obj.setAttribute('id',id);return Obj;}
|
||||
}
|
||||
return xajax.forms.getInput(type,name,id);}
|
||||
xajax.forms.createInput=function(command){command.fullName='createInput';var objParent=command.id;var sType=command.type;var sName=command.data;var sId=command.prop;if('string'==typeof objParent)
|
||||
objParent=xajax.$(objParent);var target=xajax.forms.getInput(sType,sName,sId);if(objParent&&target){objParent.appendChild(target);}
|
||||
return true;}
|
||||
xajax.forms.insertInput=function(command){command.fullName='insertInput';var objSibling=command.id;var sType=command.type;var sName=command.data;var sId=command.prop;if('string'==typeof objSibling)
|
||||
objSibling=xajax.$(objSibling);var target=xajax.forms.getInput(sType,sName,sId);if(target&&objSibling&&objSibling.parentNode)
|
||||
objSibling.parentNode.insertBefore(target,objSibling);return true;}
|
||||
xajax.forms.insertInputAfter=function(command){command.fullName='insertInputAfter';var objSibling=command.id;var sType=command.type;var sName=command.data;var sId=command.prop;if('string'==typeof objSibling)
|
||||
objSibling=xajax.$(objSibling);var target=xajax.forms.getInput(sType,sName,sId);if(target&&objSibling&&objSibling.parentNode)
|
||||
objSibling.parentNode.insertBefore(target,objSibling.nextSibling);return true;}
|
||||
xajax.events={}
|
||||
xajax.events.setEvent=function(command){command.fullName='addEvent';var element=command.id;var sEvent=command.prop;var code=command.data;if('string'==typeof element)
|
||||
element=xajax.$(element);sEvent=xajax.tools.addOnPrefix(sEvent);code=xajax.tools.doubleQuotes(code);eval('element.'+sEvent+' = function() { '+code+'; }');return true;}
|
||||
xajax.events.addHandler=function(element,sEvent,fun){if(window.addEventListener){xajax.events.addHandler=function(command){command.fullName='addHandler';var element=command.id;var sEvent=command.prop;var fun=command.data;if('string'==typeof element)
|
||||
element=xajax.$(element);sEvent=xajax.tools.stripOnPrefix(sEvent);eval('element.addEventListener("'+sEvent+'", '+fun+', false);');return true;}
|
||||
}else{xajax.events.addHandler=function(command){command.fullName='addHandler';var element=command.id;var sEvent=command.prop;var fun=command.data;if('string'==typeof element)
|
||||
element=xajax.$(element);sEvent=xajax.tools.addOnPrefix(sEvent);eval('element.attachEvent("'+sEvent+'", '+fun+', false);');return true;}
|
||||
}
|
||||
return xajax.events.addHandler(element,sEvent,fun);}
|
||||
xajax.events.removeHandler=function(element,sEvent,fun){if(window.removeEventListener){xajax.events.removeHandler=function(command){command.fullName='removeHandler';var element=command.id;var sEvent=command.prop;var fun=command.data;if('string'==typeof element)
|
||||
element=xajax.$(element);sEvent=xajax.tools.stripOnPrefix(sEvent);eval('element.removeEventListener("'+sEvent+'", '+fun+', false);');return true;}
|
||||
}else{xajax.events.removeHandler=function(command){command.fullName='removeHandler';var element=command.id;var sEvent=command.prop;var fun=command.data;if('string'==typeof element)
|
||||
element=xajax.$(element);sEvent=xajax.tools.addOnPrefix(sEvent);eval('element.detachEvent("'+sEvent+'", '+fun+', false);');return true;}
|
||||
}
|
||||
return xajax.events.removeHandler(element,sEvent,fun);}
|
||||
xajax.callback={}
|
||||
xajax.callback.create=function(){var xx=xajax;var xc=xx.config;var xcb=xx.callback;var oCB={}
|
||||
oCB.timers={};oCB.timers.onResponseDelay=xcb.setupTimer(
|
||||
(arguments.length > 0)
|
||||
? arguments[0]
|
||||
:xc.defaultResponseDelayTime);oCB.timers.onExpiration=xcb.setupTimer(
|
||||
(arguments.length > 1)
|
||||
? arguments[1]
|
||||
:xc.defaultExpirationTime);oCB.onRequest=null;oCB.onResponseDelay=null;oCB.onExpiration=null;oCB.beforeResponseProcessing=null;oCB.onFailure=null;oCB.onRedirect=null;oCB.onSuccess=null;oCB.onComplete=null;return oCB;}
|
||||
xajax.callback.setupTimer=function(iDelay){return{timer:null,delay:iDelay};}
|
||||
xajax.callback.clearTimer=function(oCallback,sFunction){if('undefined'!=typeof oCallback.timers){if('undefined'!=typeof oCallback.timers[sFunction]){clearTimeout(oCallback.timers[sFunction].timer);}
|
||||
}else if('object'==typeof oCallback){var iLen=oCallback.length;for(var i=0;i < iLen;++i)
|
||||
xajax.callback.clearTimer(oCallback[i],sFunction);}
|
||||
}
|
||||
xajax.callback.execute=function(oCallback,sFunction,args){if('undefined'!=typeof oCallback[sFunction]){var func=oCallback[sFunction];if('function'==typeof func){if('undefined'!=typeof oCallback.timers[sFunction]){oCallback.timers[sFunction].timer=setTimeout(function(){func(args);},oCallback.timers[sFunction].delay);}
|
||||
else{func(args);}
|
||||
}
|
||||
}else if('object'==typeof oCallback){var iLen=oCallback.length;for(var i=0;i < iLen;++i)
|
||||
xajax.callback.execute(oCallback[i],sFunction,args);}
|
||||
}
|
||||
xajax.callback.global=xajax.callback.create();xajax.response=xajax.tools.queue.create(xajax.config.responseQueueSize);xajax.responseSuccessCodes=['0','200'];xajax.responseErrorsForAlert=['400','401','402','403','404','500','501','502','503'];xajax.responseRedirectCodes=['301','302','307'];if('undefined'==typeof xajax.command)
|
||||
xajax.command={};xajax.command.create=function(sequence,request,context){var newCmd={};newCmd.cmd='*';newCmd.fullName='* unknown command name *';newCmd.sequence=sequence;newCmd.request=request;newCmd.context=context;return newCmd;}
|
||||
if('undefined'==typeof xajax.command.handler)
|
||||
xajax.command.handler={};if('undefined'==typeof xajax.command.handler.handlers)
|
||||
xajax.command.handler.handlers=[];xajax.command.handler.register=function(shortName,func){xajax.command.handler.handlers[shortName]=func;}
|
||||
xajax.command.handler.unregister=function(shortName){var func=xajax.command.handler.handlers[shortName];delete xajax.command.handler.handlers[shortName];return func;}
|
||||
xajax.command.handler.isRegistered=function(command){var shortName=command.cmd;if(xajax.command.handler.handlers[shortName])
|
||||
return true;return false;}
|
||||
xajax.command.handler.call=function(command){var shortName=command.cmd;return xajax.command.handler.handlers[shortName](command);}
|
||||
xajax.command.handler.register('rcmplt',function(args){xajax.completeResponse(args.request);return true;});xajax.command.handler.register('css',function(args){args.fullName='includeCSS';if('undefined'==typeof args.media)
|
||||
args.media='screen';return xajax.css.add(args.data,args.media);});xajax.command.handler.register('rcss',function(args){args.fullName='removeCSS';if('undefined'==typeof args.media)
|
||||
args.media='screen';return xajax.css.remove(args.data,args.media);});xajax.command.handler.register('wcss',function(args){args.fullName='waitForCSS';return xajax.css.waitForCSS(args);});xajax.command.handler.register('as',function(args){args.fullName='assign/clear';try{return xajax.dom.assign(args.target,args.prop,args.data);}catch(e){}
|
||||
return true;});xajax.command.handler.register('ap',function(args){args.fullName='append';return xajax.dom.append(args.target,args.prop,args.data);});xajax.command.handler.register('pp',function(args){args.fullName='prepend';return xajax.dom.prepend(args.target,args.prop,args.data);});xajax.command.handler.register('rp',function(args){args.fullName='replace';return xajax.dom.replace(args.id,args.prop,args.data);});xajax.command.handler.register('rm',function(args){args.fullName='remove';return xajax.dom.remove(args.id);});xajax.command.handler.register('ce',function(args){args.fullName='create';return xajax.dom.create(args.id,args.data,args.prop);});xajax.command.handler.register('ie',function(args){args.fullName='insert';return xajax.dom.insert(args.id,args.data,args.prop);});xajax.command.handler.register('ia',function(args){args.fullName='insertAfter';return xajax.dom.insertAfter(args.id,args.data,args.prop);});xajax.command.handler.register('c:as',xajax.dom.contextAssign);xajax.command.handler.register('c:ap',xajax.dom.contextAppend);xajax.command.handler.register('c:pp',xajax.dom.contextPrepend);xajax.command.handler.register('s',xajax.js.sleep);xajax.command.handler.register('ino',xajax.js.includeScriptOnce);xajax.command.handler.register('in',xajax.js.includeScript);xajax.command.handler.register('rjs',xajax.js.removeScript);xajax.command.handler.register('wf',xajax.js.waitFor);xajax.command.handler.register('js',xajax.js.execute);xajax.command.handler.register('jc',xajax.js.call);xajax.command.handler.register('sf',xajax.js.setFunction);xajax.command.handler.register('wpf',xajax.js.wrapFunction);xajax.command.handler.register('al',function(args){args.fullName='alert';alert(args.data);return true;});xajax.command.handler.register('cc',xajax.js.confirmCommands);xajax.command.handler.register('ci',xajax.forms.createInput);xajax.command.handler.register('ii',xajax.forms.insertInput);xajax.command.handler.register('iia',xajax.forms.insertInputAfter);xajax.command.handler.register('ev',xajax.events.setEvent);xajax.command.handler.register('ah',xajax.events.addHandler);xajax.command.handler.register('rh',xajax.events.removeHandler);xajax.command.handler.register('dbg',function(args){args.fullName='debug message';return true;});xajax.initializeRequest=function(oRequest){var xx=xajax;var xc=xx.config;oRequest.append=function(opt,def){if('undefined'!=typeof this[opt]){for(var itmName in def)
|
||||
if('undefined'==typeof this[opt][itmName])
|
||||
this[opt][itmName]=def[itmName];}else this[opt]=def;}
|
||||
oRequest.append('commonHeaders',xc.commonHeaders);oRequest.append('postHeaders',xc.postHeaders);oRequest.append('getHeaders',xc.getHeaders);oRequest.set=function(option,defaultValue){if('undefined'==typeof this[option])
|
||||
this[option]=defaultValue;}
|
||||
oRequest.set('statusMessages',xc.statusMessages);oRequest.set('waitCursor',xc.waitCursor);oRequest.set('mode',xc.defaultMode);oRequest.set('method',xc.defaultMethod);oRequest.set('URI',xc.requestURI);oRequest.set('httpVersion',xc.defaultHttpVersion);oRequest.set('contentType',xc.defaultContentType);oRequest.set('retry',xc.defaultRetry);oRequest.set('returnValue',xc.defaultReturnValue);oRequest.set('maxObjectDepth',xc.maxObjectDepth);oRequest.set('maxObjectSize',xc.maxObjectSize);oRequest.set('context',window);var xcb=xx.callback;var gcb=xcb.global;var lcb=xcb.create();lcb.take=function(frm,opt){if('undefined'!=typeof frm[opt]){lcb[opt]=frm[opt];lcb.hasEvents=true;}
|
||||
delete frm[opt];}
|
||||
lcb.take(oRequest,'onRequest');lcb.take(oRequest,'onResponseDelay');lcb.take(oRequest,'onExpiration');lcb.take(oRequest,'beforeResponseProcessing');lcb.take(oRequest,'onFailure');lcb.take(oRequest,'onRedirect');lcb.take(oRequest,'onSuccess');lcb.take(oRequest,'onComplete');if('undefined'!=typeof oRequest.callback){if(lcb.hasEvents)
|
||||
oRequest.callback=[oRequest.callback,lcb];}else
|
||||
oRequest.callback=lcb;oRequest.status=(oRequest.statusMessages)
|
||||
? xc.status.update()
|
||||
:xc.status.dontUpdate();oRequest.cursor=(oRequest.waitCursor)
|
||||
? xc.cursor.update()
|
||||
:xc.cursor.dontUpdate();oRequest.method=oRequest.method.toUpperCase();if('GET'!=oRequest.method)
|
||||
oRequest.method='POST';oRequest.requestRetry=oRequest.retry;oRequest.append('postHeaders',{'content-type':oRequest.contentType
|
||||
});delete oRequest['append'];delete oRequest['set'];delete oRequest['take'];if('undefined'==typeof oRequest.URI)
|
||||
throw{code:10005}
|
||||
}
|
||||
xajax.processParameters=function(oRequest){var xx=xajax;var xt=xx.tools;var rd=[];var separator='';for(var sCommand in oRequest.functionName){if('constructor'!=sCommand){rd.push(separator);rd.push(sCommand);rd.push('=');rd.push(encodeURIComponent(oRequest.functionName[sCommand]));separator='&';}
|
||||
}
|
||||
var dNow=new Date();rd.push('&xjxr=');rd.push(dNow.getTime());delete dNow;if(oRequest.parameters){var i=0;var iLen=oRequest.parameters.length;while(i < iLen){var oVal=oRequest.parameters[i];if('object'==typeof oVal&&null!=oVal){try{var oGuard={};oGuard.depth=0;oGuard.maxDepth=oRequest.maxObjectDepth;oGuard.size=0;oGuard.maxSize=oRequest.maxObjectSize;oVal=xt._objectToXML(oVal,oGuard);}catch(e){oVal='';}
|
||||
rd.push('&xjxargs[]=');oVal=encodeURIComponent(oVal);rd.push(oVal);++i;}else{rd.push('&xjxargs[]=');oVal=xt._escape(oVal);if('undefined'==typeof oVal||null==oVal){rd.push('*');}else{var sType=typeof oVal;if('string'==sType)
|
||||
rd.push('S');else if('boolean'==sType)
|
||||
rd.push('B');else if('number'==sType)
|
||||
rd.push('N');oVal=encodeURIComponent(oVal);rd.push(oVal);}
|
||||
++i;}
|
||||
}
|
||||
}
|
||||
oRequest.requestURI=oRequest.URI;if('GET'==oRequest.method){oRequest.requestURI+=oRequest.requestURI.indexOf('?')==-1 ? '?':'&';oRequest.requestURI+=rd.join('');rd=[];}
|
||||
oRequest.requestData=rd.join('');}
|
||||
xajax.prepareRequest=function(oRequest){var xx=xajax;var xt=xx.tools;oRequest.request=xt.getRequestObject();oRequest.setRequestHeaders=function(headers){if('object'==typeof headers){for(var optionName in headers)
|
||||
this.request.setRequestHeader(optionName,headers[optionName]);}
|
||||
}
|
||||
oRequest.setCommonRequestHeaders=function(){this.setRequestHeaders(this.commonHeaders);}
|
||||
oRequest.setPostRequestHeaders=function(){this.setRequestHeaders(this.postHeaders);}
|
||||
oRequest.setGetRequestHeaders=function(){this.setRequestHeaders(this.getHeaders);}
|
||||
if('asynchronous'==oRequest.mode){oRequest.request.onreadystatechange=function(){if(oRequest.request.readyState!=4)
|
||||
return;xajax.responseReceived(oRequest);}
|
||||
oRequest.finishRequest=function(){return this.returnValue;}
|
||||
}else{oRequest.finishRequest=function(){return xajax.responseReceived(oRequest);}
|
||||
}
|
||||
if('undefined'!=typeof oRequest.userName&&'undefined'!=typeof oRequest.password){oRequest.open=function(){this.request.open(
|
||||
this.method,
|
||||
this.requestURI,
|
||||
'asynchronous'==this.mode,
|
||||
oRequest.userName,
|
||||
oRequest.password);}
|
||||
}else{oRequest.open=function(){this.request.open(
|
||||
this.method,
|
||||
this.requestURI,
|
||||
'asynchronous'==this.mode);}
|
||||
}
|
||||
if('POST'==oRequest.method){oRequest.applyRequestHeaders=function(){this.setCommonRequestHeaders();try{this.setPostRequestHeaders();}catch(e){this.method='GET';this.requestURI+=this.requestURI.indexOf('?')==-1 ? '?':'&';this.requestURI+=this.requestData;this.requestData='';if(0==this.requestRetry)this.requestRetry=1;throw e;}
|
||||
}
|
||||
}else{oRequest.applyRequestHeaders=function(){this.setCommonRequestHeaders();this.setGetRequestHeaders();}
|
||||
}
|
||||
}
|
||||
xajax.request=function(){var numArgs=arguments.length;if(0==numArgs)
|
||||
return false;var oRequest={}
|
||||
if(1 < numArgs)
|
||||
oRequest=arguments[1];oRequest.functionName=arguments[0];var xx=xajax;xx.initializeRequest(oRequest);xx.processParameters(oRequest);while(0 < oRequest.requestRetry){try{--oRequest.requestRetry;xx.prepareRequest(oRequest);return xx.submitRequest(oRequest);}catch(e){xajax.callback.execute(
|
||||
[xajax.callback.global,oRequest.callback],
|
||||
'onFailure',oRequest);if(0==oRequest.requestRetry)
|
||||
throw e;}
|
||||
}
|
||||
}
|
||||
xajax.call=function(){var numArgs=arguments.length;if(0==numArgs)
|
||||
return false;var oRequest={}
|
||||
if(1 < numArgs)
|
||||
oRequest=arguments[1];oRequest.functionName={xjxfun:arguments[0]};var xx=xajax;xx.initializeRequest(oRequest);xx.processParameters(oRequest);while(0 < oRequest.requestRetry){try{--oRequest.requestRetry;xx.prepareRequest(oRequest);return xx.submitRequest(oRequest);}catch(e){xajax.callback.execute(
|
||||
[xajax.callback.global,oRequest.callback],
|
||||
'onFailure',oRequest);if(0==oRequest.requestRetry)
|
||||
throw e;}
|
||||
}
|
||||
}
|
||||
xajax.submitRequest=function(oRequest){oRequest.status.onRequest();var xcb=xajax.callback;var gcb=xcb.global;var lcb=oRequest.callback;xcb.execute([gcb,lcb],'onResponseDelay',oRequest);xcb.execute([gcb,lcb],'onExpiration',oRequest);xcb.execute([gcb,lcb],'onRequest',oRequest);oRequest.open();oRequest.applyRequestHeaders();oRequest.cursor.onWaiting();oRequest.status.onWaiting();xajax._internalSend(oRequest);return oRequest.finishRequest();}
|
||||
xajax._internalSend=function(oRequest){oRequest.request.send(oRequest.requestData);}
|
||||
xajax.abortRequest=function(oRequest){oRequest.aborted=true;oRequest.request.abort();xajax.completeResponse(oRequest);}
|
||||
xajax.responseReceived=function(oRequest){var xx=xajax;var xcb=xx.callback;var gcb=xcb.global;var lcb=oRequest.callback;if(oRequest.aborted)
|
||||
return;xcb.clearTimer([gcb,lcb],'onExpiration');xcb.clearTimer([gcb,lcb],'onResponseDelay');xcb.execute([gcb,lcb],'beforeResponseProcessing',oRequest);var fProc=xx.getResponseProcessor(oRequest);if('undefined'==typeof fProc){xcb.execute([gcb,lcb],'onFailure',oRequest);xx.completeResponse(oRequest);return;}
|
||||
return fProc(oRequest);}
|
||||
xajax.getResponseProcessor=function(oRequest){var fProc;if('undefined'==typeof oRequest.responseProcessor){var cTyp=oRequest.request.getResponseHeader('content-type');if(cTyp){if(0 <=cTyp.indexOf('text/xml')){fProc=xajax.responseProcessor.xml;}
|
||||
}
|
||||
}else fProc=oRequest.responseProcessor;return fProc;}
|
||||
xajax.executeCommand=function(command){if(xajax.command.handler.isRegistered(command)){if(command.id)
|
||||
command.target=xajax.$(command.id);if(false==xajax.command.handler.call(command)){xajax.tools.queue.pushFront(xajax.response,command);return false;}
|
||||
}
|
||||
return true;}
|
||||
xajax.completeResponse=function(oRequest){xajax.callback.execute(
|
||||
[xajax.callback.global,oRequest.callback],
|
||||
'onComplete',oRequest);oRequest.cursor.onComplete();oRequest.status.onComplete();delete oRequest['functionName'];delete oRequest['requestURI'];delete oRequest['requestData'];delete oRequest['requestRetry'];delete oRequest['request'];delete oRequest['set'];delete oRequest['open'];delete oRequest['setRequestHeaders'];delete oRequest['setCommonRequestHeaders'];delete oRequest['setPostRequestHeaders'];delete oRequest['setGetRequestHeaders'];delete oRequest['applyRequestHeaders'];delete oRequest['finishRequest'];delete oRequest['status'];delete oRequest['cursor'];}
|
||||
xajax.$=xajax.tools.$;xajax.getFormValues=xajax.tools.getFormValues;xajax.isLoaded=true;xjx={}
|
||||
xjx.$=xajax.tools.$;xjx.getFormValues=xajax.tools.getFormValues;xjx.call=xajax.call;xjx.request=xajax.request;
|
3553
lib/xajax/xajax_js/xajax_core_uncompressed.js
Executable file
117
lib/xajax/xajax_js/xajax_debug.js
Executable file
|
@ -0,0 +1,117 @@
|
|||
|
||||
try{if('undefined'==typeof xajax)
|
||||
throw{name:'SequenceError',message:'Error: xajax core was not detected, debug module disabled.'}
|
||||
if('undefined'==typeof xajax.debug)
|
||||
xajax.debug={}
|
||||
xajax.debug.workId='xajaxWork'+new Date().getTime();xajax.debug.windowSource='about:blank';xajax.debug.windowID='xajax_debug_'+xajax.debug.workId;if('undefined'==typeof xajax.debug.windowStyle)
|
||||
xajax.debug.windowStyle=
|
||||
'width=800,'+
|
||||
'height=600,'+
|
||||
'scrollbars=yes,'+
|
||||
'resizable=yes,'+
|
||||
'status=yes';if('undefined'==typeof xajax.debug.windowTemplate)
|
||||
xajax.debug.windowTemplate=
|
||||
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'+
|
||||
'<html><head>'+
|
||||
'<title>xajax debug output</title>'+
|
||||
'<style type="text/css">'+
|
||||
'/* <![CDATA[ */'+
|
||||
'.debugEntry { margin: 3px; padding: 3px; border-top: 1px solid #999999; } '+
|
||||
'.debugDate { font-weight: bold; margin: 2px; } '+
|
||||
'.debugText { margin: 2px; } '+
|
||||
'.warningText { margin: 2px; font-weight: bold; } '+
|
||||
'.errorText { margin: 2px; font-weight: bold; color: #ff7777; }'+
|
||||
'/* ]]> */'+
|
||||
'</style>'+
|
||||
'</head><body>'+
|
||||
'<h2>xajax debug output</h2>'+
|
||||
'<div id="debugTag"></div>'+
|
||||
'</body></html>';xajax.debug.text=[];xajax.debug.text[100]='WARNING: ';xajax.debug.text[101]='ERROR: ';xajax.debug.text[102]='XAJAX DEBUG MESSAGE:\n';xajax.debug.text[103]='...\n[LONG RESPONSE]\n...';xajax.debug.text[104]='SENDING REQUEST';xajax.debug.text[105]='SENT [';xajax.debug.text[106]=' bytes]';xajax.debug.text[107]='CALLING: ';xajax.debug.text[108]='URI: ';xajax.debug.text[109]='INITIALIZING REQUEST';xajax.debug.text[110]='PROCESSING PARAMETERS [';xajax.debug.text[111]=']';xajax.debug.text[112]='NO PARAMETERS TO PROCESS';xajax.debug.text[113]='PREPARING REQUEST';xajax.debug.text[114]='STARTING XAJAX CALL (deprecated: use xajax.request instead)';xajax.debug.text[115]='STARTING XAJAX REQUEST';xajax.debug.text[116]='No response processor is available to process the response from the server.\n';xajax.debug.text[117]='.\nCheck for error messages from the server.';xajax.debug.text[118]='RECEIVED [status: ';xajax.debug.text[119]=', size: ';xajax.debug.text[120]=' bytes, time: ';xajax.debug.text[121]='ms]:\n';xajax.debug.text[122]='The server returned the following HTTP status: ';xajax.debug.text[123]='\nRECEIVED:\n';xajax.debug.text[124]='The server returned a redirect to:<br />';xajax.debug.text[125]='DONE [';xajax.debug.text[126]='ms]';xajax.debug.text[127]='INITIALIZING REQUEST OBJECT';xajax.debug.exceptions=[];xajax.debug.exceptions[10001]='Invalid response XML: The response contains an unknown tag: {data}.';xajax.debug.exceptions[10002]='GetRequestObject: XMLHttpRequest is not available, xajax is disabled.';xajax.debug.exceptions[10003]='Queue overflow: Cannot push object onto queue because it is full.';xajax.debug.exceptions[10004]='Invalid response XML: The response contains an unexpected tag or text: {data}.';xajax.debug.exceptions[10005]='Invalid request URI: Invalid or missing URI; autodetection failed; please specify a one explicitly.';xajax.debug.exceptions[10006]='Invalid response command: Malformed response command received.';xajax.debug.exceptions[10007]='Invalid response command: Command [{data}] is not a known command.';xajax.debug.exceptions[10008]='Element with ID [{data}] not found in the document.';xajax.debug.exceptions[10009]='Invalid request: Missing function name parameter.';xajax.debug.exceptions[10010]='Invalid request: Missing function object parameter.';xajax.debug.getExceptionText=function(e){if('undefined'!=typeof e.code){if('undefined'!=typeof xajax.debug.exceptions[e.code]){var msg=xajax.debug.exceptions[e.code];if('undefined'!=typeof e.data){msg.replace('{data}',e.data);}
|
||||
return msg;}
|
||||
}else if('undefined'!=typeof e.name){var msg=e.name;if('undefined'!=typeof e.message){msg+=': ';msg+=e.message;}
|
||||
return msg;}
|
||||
return 'An unknown error has occurred.';}
|
||||
xajax.debug.writeMessage=function(text,prefix,cls){try{var xd=xajax.debug;if('undefined'==typeof xd.window||true==xd.window.closed){xd.window=window.open(xd.windowSource,xd.windowID,xd.windowStyle);if("about:blank"==xd.windowSource)
|
||||
xd.window.document.write(xd.windowTemplate);}
|
||||
var xdw=xd.window;var xdwd=xdw.document;if('undefined'==typeof prefix)
|
||||
prefix='';if('undefined'==typeof cls)
|
||||
cls='debugText';text=xajax.debug.prepareDebugText(text);var debugTag=xdwd.getElementById('debugTag');var debugEntry=xdwd.createElement('div');var debugDate=xdwd.createElement('span');var debugText=xdwd.createElement('pre');debugDate.innerHTML=new Date().toString();debugText.innerHTML=prefix+text;debugEntry.appendChild(debugDate);debugEntry.appendChild(debugText);debugTag.insertBefore(debugEntry,debugTag.firstChild);try{debugEntry.className='debugEntry';debugDate.className='debugDate';debugText.className=cls;}catch(e){}
|
||||
}catch(e){if(text.length > 1000)text=text.substr(0,1000)+xajax.debug.text[102];alert(xajax.debug.text[102]+text);}
|
||||
}
|
||||
xajax.debug.prepareDebugText=function(text){try{text=text.replace(/&/g,'&')
|
||||
.replace(/</g,'<')
|
||||
.replace(/>/g,'>')
|
||||
.replace(/\n/g,'<br />');return text;}catch(e){xajax.debug.stringReplace=function(haystack,needle,newNeedle){var segments=haystack.split(needle);haystack='';for(var i=0;i < segments.length;++i){if(0!=i)
|
||||
haystack+=newNeedle;haystack+=segments[i];}
|
||||
return haystack;}
|
||||
xajax.debug.prepareDebugText=function(text){text=xajax.debug.stringReplace(text,'&','&');text=xajax.debug.stringReplace(text,'<','<');text=xajax.debug.stringReplace(text,'>','>');text=xajax.debug.stringReplace(text,'\n','<br />');return text;}
|
||||
xajax.debug.prepareDebugText(text);}
|
||||
}
|
||||
xajax.debug.executeCommand=xajax.executeCommand;xajax.executeCommand=function(args){try{if('undefined'==typeof args.cmd)
|
||||
throw{code:10006};if(false==xajax.command.handler.isRegistered(args))
|
||||
throw{code:10007,data:args.cmd};return xajax.debug.executeCommand(args);}catch(e){var msg='ExecuteCommand (';if('undefined'!=typeof args.sequence){msg+='#';msg+=args.sequence;msg+=', ';}
|
||||
if('undefined'!=typeof args.cmdFullName){msg+='"';msg+=args.cmdFullName;msg+='"';}
|
||||
msg+='):\n';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');}
|
||||
return true;}
|
||||
xajax.debug.parseAttributes=xajax.parseAttributes;xajax.parseAttributes=function(child,obj){try{xajax.debug.parseAttributes(child,obj);}catch(e){var msg='ParseAttributes:\n';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');}
|
||||
}
|
||||
xajax.debug.commandHandler=xajax.command.handler.unregister('dbg');xajax.command.handler.register('dbg',function(args){args.cmdFullName='debug message';xajax.debug.writeMessage(args.data,xajax.debug.text[100],'warningText');return xajax.debug.commandHandler(args);});xajax.debug.$=xajax.tools.$;xajax.tools.$=function(sId){try{var returnValue=xajax.debug.$(sId);if('object'!=typeof returnValue)
|
||||
throw{code:10008};}
|
||||
catch(e){var msg='$:';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[100],'warningText');}
|
||||
return returnValue;}
|
||||
xajax.debug._objectToXML=xajax.tools._objectToXML;xajax.tools._objectToXML=function(obj,guard){try{if(0==guard.size){var msg='OBJECT TO XML: maxDepth = ';msg+=guard.maxDepth;msg+=', maxSize = ';msg+=guard.maxSize;xajax.debug.writeMessage(msg);}
|
||||
var r=xajax.debug._objectToXML(obj,guard);if(0==guard.depth){var msg='OBJECT TO XML: size = ';msg+=guard.size;xajax.debug.writeMessage(msg);}
|
||||
return r;}catch(e){var msg='ObjectToXML: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');}
|
||||
return '';}
|
||||
xajax.debug._internalSend=xajax._internalSend;xajax._internalSend=function(oRequest){try{xajax.debug.writeMessage(xajax.debug.text[104]);xajax.debug.writeMessage(
|
||||
xajax.debug.text[105]+
|
||||
oRequest.requestData.length+
|
||||
xajax.debug.text[106]
|
||||
);oRequest.beginDate=new Date();xajax.debug._internalSend(oRequest);}catch(e){var msg='InternalSend: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');throw e;}
|
||||
}
|
||||
xajax.debug.submitRequest=xajax.submitRequest;xajax.submitRequest=function(oRequest){var msg=oRequest.method;msg+=': ';text=decodeURIComponent(oRequest.requestData);text=text.replace(new RegExp('&xjx','g'),'\n&xjx');text=text.replace(new RegExp('<xjxobj>','g'),'\n<xjxobj>');text=text.replace(new RegExp('<e>','g'),'\n<e>');text=text.replace(new RegExp('</xjxobj>','g'),'\n</xjxobj>\n');msg+=text;xajax.debug.writeMessage(msg);msg=xajax.debug.text[107];var separator='\n';for(var mbr in oRequest.functionName){msg+=separator;msg+=mbr;msg+=': ';msg+=oRequest.functionName[mbr];separator='\n';}
|
||||
msg+=separator;msg+=xajax.debug.text[108];msg+=separator;msg+=oRequest.URI;xajax.debug.writeMessage(msg);try{return xajax.debug.submitRequest(oRequest);}catch(e){xajax.debug.writeMessage(e.message);if(0 < oRequest.retry)
|
||||
throw e;}
|
||||
}
|
||||
xajax.debug.initializeRequest=xajax.initializeRequest;xajax.initializeRequest=function(oRequest){try{var msg=xajax.debug.text[109];xajax.debug.writeMessage(msg);return xajax.debug.initializeRequest(oRequest);}catch(e){var msg='InitializeRequest: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');throw e;}
|
||||
}
|
||||
xajax.debug.processParameters=xajax.processParameters;xajax.processParameters=function(oRequest){try{if('undefined'!=typeof oRequest.parameters){var msg=xajax.debug.text[110];msg+=oRequest.parameters.length;msg+=xajax.debug.text[111];xajax.debug.writeMessage(msg);}else{var msg=xajax.debug.text[112];xajax.debug.writeMessage(msg);}
|
||||
return xajax.debug.processParameters(oRequest);}catch(e){var msg='ProcessParameters: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');throw e;}
|
||||
}
|
||||
xajax.debug.prepareRequest=xajax.prepareRequest;xajax.prepareRequest=function(oRequest){try{var msg=xajax.debug.text[113];xajax.debug.writeMessage(msg);return xajax.debug.prepareRequest(oRequest);}catch(e){var msg='PrepareRequest: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');throw e;}
|
||||
}
|
||||
xajax.debug.call=xajax.call;xajax.call=function(){try{xajax.debug.writeMessage(xajax.debug.text[114]);var numArgs=arguments.length;if(0==numArgs)
|
||||
throw{code:10009};var functionName=arguments[0];var oOptions={}
|
||||
if(1 < numArgs)
|
||||
oOptions=arguments[1];oOptions.debugging=true;return xajax.debug.call(functionName,oOptions);}catch(e){var msg='Call: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');throw e;}
|
||||
}
|
||||
xajax.debug.request=xajax.request;xajax.request=function(){try{xajax.debug.writeMessage(xajax.debug.text[115]);var numArgs=arguments.length;if(0==numArgs)
|
||||
throw{code:10010};var oFunction=arguments[0];var oOptions={}
|
||||
if(1 < numArgs)
|
||||
oOptions=arguments[1];oOptions.debugging=true;return xajax.debug.request(oFunction,oOptions);}catch(e){var msg='Request: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');throw e;}
|
||||
}
|
||||
xajax.debug.getResponseProcessor=xajax.getResponseProcessor;xajax.getResponseProcessor=function(oRequest){try{var fProc=xajax.debug.getResponseProcessor(oRequest);if('undefined'==typeof fProc){var msg=xajax.debug.text[116];try{var contentType=oRequest.request.getResponseHeader('content-type');msg+="Content-Type: ";msg+=contentType;if('text/html'==contentType){msg+=xajax.debug.text[117];}
|
||||
}catch(e){}
|
||||
xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');}
|
||||
return fProc;}catch(e){var msg='GetResponseProcessor: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');throw e;}
|
||||
}
|
||||
xajax.debug.responseReceived=xajax.responseReceived;xajax.responseReceived=function(oRequest){var xx=xajax;var xt=xx.tools;var xd=xx.debug;var oRet;try{var status=oRequest.request.status;if(xt.arrayContainsValue(xx.responseSuccessCodes,status)){var packet=oRequest.request.responseText;packet=packet.replace(new RegExp('<cmd','g'),'\n<cmd');packet=packet.replace(new RegExp('<xjx>','g'),'\n<xjx>');packet=packet.replace(new RegExp('<xjxobj>','g'),'\n<xjxobj>');packet=packet.replace(new RegExp('<e>','g'),'\n<e>');packet=packet.replace(new RegExp('</xjxobj>','g'),'\n</xjxobj>\n');packet=packet.replace(new RegExp('</xjx>','g'),'\n</xjx>');oRequest.midDate=new Date();var msg=xajax.debug.text[118];msg+=oRequest.request.status;msg+=xajax.debug.text[119];msg+=packet.length;msg+=xajax.debug.text[120];msg+=(oRequest.midDate-oRequest.beginDate);msg+=xajax.debug.text[121];msg+=packet;xd.writeMessage(msg);}else if(xt.arrayContainsValue(xx.responseErrorsForAlert,status)){var msg=xajax.debug.text[122];msg+=status;msg+=xajax.debug.text[123];msg+=oRequest.request.responseText;xd.writeMessage(msg,xajax.debug.text[101],'errorText');}else if(xt.arrayContainsValue(xx.responseRedirectCodes,status)){var msg=xajax.debug.text[124];msg+=oRequest.request.getResponseHeader('location');xd.writeMessage(msg);}
|
||||
oRet=xd.responseReceived(oRequest);}catch(e){var msg='ResponseReceived: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xd.writeMessage(msg,xajax.debug.text[101],'errorText');}
|
||||
return oRet;}
|
||||
xajax.debug.completeResponse=xajax.completeResponse;xajax.completeResponse=function(oRequest){try{var returnValue=xajax.debug.completeResponse(oRequest);oRequest.endDate=new Date();var msg=xajax.debug.text[125];msg+=(oRequest.endDate-oRequest.beginDate);msg+=xajax.debug.text[126];xajax.debug.writeMessage(msg);return returnValue;}catch(e){var msg='CompleteResponse: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');throw e;}
|
||||
}
|
||||
xajax.debug.getRequestObject=xajax.tools.getRequestObject;xajax.tools.getRequestObject=function(){try{xajax.debug.writeMessage(xajax.debug.text[127]);return xajax.debug.getRequestObject();}catch(e){var msg='GetRequestObject: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');throw e;}
|
||||
}
|
||||
if(xajax.dom.assign){xajax.debug.assign=xajax.dom.assign;xajax.dom.assign=function(element,property,data){try{return xajax.debug.assign(element,property,data);}catch(e){var msg='xajax.dom.assign: ';msg+=xajax.debug.getExceptionText(e);msg+='\n';msg+='Eval: element.';msg+=property;msg+=' = data;\n';xajax.debug.writeMessage(msg,xajax.debug.text[101],'errorText');}
|
||||
return true;}
|
||||
}
|
||||
if(xajax.tools){if(xajax.tools.queue){if(xajax.tools.queue.retry){if('undefined'==typeof xajax.debug.tools)
|
||||
xajax.debug.tools={};if('undefined'==typeof xajax.debug.tools.queue)
|
||||
xajax.debug.tools.queue={};xajax.debug.tools.queue.retry=xajax.tools.queue.retry;xajax.tools.queue.retry=function(obj,count){if(xajax.debug.tools.queue.retry(obj,count))
|
||||
return true;if(obj.cmd&&'s'==obj.cmd)
|
||||
return false;xajax.debug.writeMessage('Retry count exceeded.');return false;}
|
||||
}
|
||||
}
|
||||
}
|
||||
xajax.debug.isLoaded=true;xjx={}
|
||||
xjx.$=xajax.tools.$;xjx.getFormValues=xajax.tools.getFormValues;xjx.call=xajax.call;xjx.request=xajax.request;xajax.$=xajax.tools.$;xajax.getFormValues=xajax.tools.getFormValues;}catch(e){alert(e.name+': '+e.message);}
|
883
lib/xajax/xajax_js/xajax_debug_uncompressed.js
Executable file
|
@ -0,0 +1,883 @@
|
|||
/*
|
||||
File: xajax_debug.js
|
||||
|
||||
This optional file contains the debugging module for use with xajax. If
|
||||
you include this module after the standard <xajax_core.js> module, you
|
||||
will receive debugging messages, including errors, that occur during
|
||||
the processing of your xajax requests.
|
||||
|
||||
Title: xajax debugging module
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajax_debug_uncompressed.js 327 2007-02-28 16:55:26Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
try
|
||||
{
|
||||
/*
|
||||
Class: xajax.debug
|
||||
|
||||
This object contains the variables and functions used to display process state
|
||||
messages and to trap error conditions and report them to the user via
|
||||
a secondary browser window or alert messages as necessary.
|
||||
*/
|
||||
if ('undefined' == typeof xajax)
|
||||
throw { name: 'SequenceError', message: 'Error: xajax core was not detected, debug module disabled.' }
|
||||
|
||||
if ('undefined' == typeof xajax.debug)
|
||||
xajax.debug = {}
|
||||
|
||||
/*
|
||||
String: xajax.debug.workId
|
||||
|
||||
Stores a 'unique' identifier for this session so that an existing debugging
|
||||
window can be detected, else one will be created.
|
||||
*/
|
||||
xajax.debug.workId = 'xajaxWork'+ new Date().getTime();
|
||||
|
||||
/*
|
||||
String: xajax.debug.windowSource
|
||||
|
||||
The default URL that is given to the debugging window upon creation.
|
||||
*/
|
||||
xajax.debug.windowSource = 'about:blank';
|
||||
|
||||
/*
|
||||
String: xajax.debug.windowID
|
||||
|
||||
A 'unique' name used to identify the debugging window that is attached
|
||||
to this xajax session.
|
||||
*/
|
||||
xajax.debug.windowID = 'xajax_debug_'+xajax.debug.workId;
|
||||
|
||||
/*
|
||||
String: windowStyle
|
||||
|
||||
The parameters that will be used to create the debugging window.
|
||||
*/
|
||||
if ('undefined' == typeof xajax.debug.windowStyle)
|
||||
xajax.debug.windowStyle =
|
||||
'width=800,' +
|
||||
'height=600,' +
|
||||
'scrollbars=yes,' +
|
||||
'resizable=yes,' +
|
||||
'status=yes';
|
||||
|
||||
/*
|
||||
String: windowTemplate
|
||||
|
||||
The HTML template and CSS style information used to populate the
|
||||
debugging window upon creation.
|
||||
*/
|
||||
if ('undefined' == typeof xajax.debug.windowTemplate)
|
||||
xajax.debug.windowTemplate =
|
||||
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">' +
|
||||
'<html><head>' +
|
||||
'<title>xajax debug output</title>' +
|
||||
'<style type="text/css">' +
|
||||
'/* <![CDATA[ */' +
|
||||
'.debugEntry { margin: 3px; padding: 3px; border-top: 1px solid #999999; } ' +
|
||||
'.debugDate { font-weight: bold; margin: 2px; } ' +
|
||||
'.debugText { margin: 2px; } ' +
|
||||
'.warningText { margin: 2px; font-weight: bold; } ' +
|
||||
'.errorText { margin: 2px; font-weight: bold; color: #ff7777; }' +
|
||||
'/* ]]> */' +
|
||||
'</style>' +
|
||||
'</head><body>' +
|
||||
'<h2>xajax debug output</h2>' +
|
||||
'<div id="debugTag"></div>' +
|
||||
'</body></html>';
|
||||
|
||||
/*
|
||||
Object: window
|
||||
|
||||
A reference to the debugging window, once constructed, where messages will
|
||||
be displayed throughout the request process. This is constructed internally
|
||||
as needed.
|
||||
*/
|
||||
|
||||
/*
|
||||
Array: xajax.debug.text
|
||||
*/
|
||||
xajax.debug.text = [];
|
||||
xajax.debug.text[100] = 'WARNING: ';
|
||||
xajax.debug.text[101] = 'ERROR: ';
|
||||
xajax.debug.text[102] = 'XAJAX DEBUG MESSAGE:\n';
|
||||
xajax.debug.text[103] = '...\n[LONG RESPONSE]\n...';
|
||||
xajax.debug.text[104] = 'SENDING REQUEST';
|
||||
xajax.debug.text[105] = 'SENT [';
|
||||
xajax.debug.text[106] = ' bytes]';
|
||||
xajax.debug.text[107] = 'CALLING: ';
|
||||
xajax.debug.text[108] = 'URI: ';
|
||||
xajax.debug.text[109] = 'INITIALIZING REQUEST';
|
||||
xajax.debug.text[110] = 'PROCESSING PARAMETERS [';
|
||||
xajax.debug.text[111] = ']';
|
||||
xajax.debug.text[112] = 'NO PARAMETERS TO PROCESS';
|
||||
xajax.debug.text[113] = 'PREPARING REQUEST';
|
||||
xajax.debug.text[114] = 'STARTING XAJAX CALL (deprecated: use xajax.request instead)';
|
||||
xajax.debug.text[115] = 'STARTING XAJAX REQUEST';
|
||||
xajax.debug.text[116] = 'No response processor is available to process the response from the server.\n';
|
||||
xajax.debug.text[117] = '.\nCheck for error messages from the server.';
|
||||
xajax.debug.text[118] = 'RECEIVED [status: ';
|
||||
xajax.debug.text[119] = ', size: ';
|
||||
xajax.debug.text[120] = ' bytes, time: ';
|
||||
xajax.debug.text[121] = 'ms]:\n';
|
||||
xajax.debug.text[122] = 'The server returned the following HTTP status: ';
|
||||
xajax.debug.text[123] = '\nRECEIVED:\n';
|
||||
xajax.debug.text[124] = 'The server returned a redirect to:<br />';
|
||||
xajax.debug.text[125] = 'DONE [';
|
||||
xajax.debug.text[126] = 'ms]';
|
||||
xajax.debug.text[127] = 'INITIALIZING REQUEST OBJECT';
|
||||
|
||||
/*
|
||||
Array: xajax.debug.exceptions
|
||||
*/
|
||||
xajax.debug.exceptions = [];
|
||||
xajax.debug.exceptions[10001] = 'Invalid response XML: The response contains an unknown tag: {data}.';
|
||||
xajax.debug.exceptions[10002] = 'GetRequestObject: XMLHttpRequest is not available, xajax is disabled.';
|
||||
xajax.debug.exceptions[10003] = 'Queue overflow: Cannot push object onto queue because it is full.';
|
||||
xajax.debug.exceptions[10004] = 'Invalid response XML: The response contains an unexpected tag or text: {data}.';
|
||||
xajax.debug.exceptions[10005] = 'Invalid request URI: Invalid or missing URI; autodetection failed; please specify a one explicitly.';
|
||||
xajax.debug.exceptions[10006] = 'Invalid response command: Malformed response command received.';
|
||||
xajax.debug.exceptions[10007] = 'Invalid response command: Command [{data}] is not a known command.';
|
||||
xajax.debug.exceptions[10008] = 'Element with ID [{data}] not found in the document.';
|
||||
xajax.debug.exceptions[10009] = 'Invalid request: Missing function name parameter.';
|
||||
xajax.debug.exceptions[10010] = 'Invalid request: Missing function object parameter.';
|
||||
|
||||
/*
|
||||
Function: xajax.debug.getExceptionText
|
||||
|
||||
Parameters:
|
||||
e - (object): Exception
|
||||
*/
|
||||
xajax.debug.getExceptionText = function(e) {
|
||||
if ('undefined' != typeof e.code) {
|
||||
if ('undefined' != typeof xajax.debug.exceptions[e.code]) {
|
||||
var msg = xajax.debug.exceptions[e.code];
|
||||
if ('undefined' != typeof e.data) {
|
||||
msg.replace('{data}', e.data);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
} else if ('undefined' != typeof e.name) {
|
||||
var msg = e.name;
|
||||
if ('undefined' != typeof e.message) {
|
||||
msg += ': ';
|
||||
msg += e.message;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
return 'An unknown error has occurred.';
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.debug.writeMessage
|
||||
|
||||
Output a debug message to the debug window if available or send to an
|
||||
alert box. If the debug window has not been created, attempt to
|
||||
create it.
|
||||
|
||||
Parameters:
|
||||
|
||||
text - (string): The text to output.
|
||||
|
||||
prefix - (string): The prefix to use; this is prepended onto the
|
||||
message; it should indicate the type of message (warning, error)
|
||||
|
||||
cls - (stirng): The className that will be applied to the message;
|
||||
invoking a style from the CSS provided in
|
||||
<xajax.debug.windowTemplate>. Should be one of the following:
|
||||
- warningText
|
||||
- errorText
|
||||
*/
|
||||
xajax.debug.writeMessage = function(text, prefix, cls) {
|
||||
try {
|
||||
var xd = xajax.debug;
|
||||
if ('undefined' == typeof xd.window || true == xd.window.closed) {
|
||||
xd.window = window.open(xd.windowSource, xd.windowID, xd.windowStyle);
|
||||
if ("about:blank" == xd.windowSource)
|
||||
xd.window.document.write(xd.windowTemplate);
|
||||
}
|
||||
var xdw = xd.window;
|
||||
var xdwd = xdw.document;
|
||||
if ('undefined' == typeof prefix)
|
||||
prefix = '';
|
||||
if ('undefined' == typeof cls)
|
||||
cls = 'debugText';
|
||||
|
||||
text = xajax.debug.prepareDebugText(text);
|
||||
|
||||
var debugTag = xdwd.getElementById('debugTag');
|
||||
var debugEntry = xdwd.createElement('div');
|
||||
var debugDate = xdwd.createElement('span');
|
||||
var debugText = xdwd.createElement('pre');
|
||||
|
||||
debugDate.innerHTML = new Date().toString();
|
||||
debugText.innerHTML = prefix + text;
|
||||
|
||||
debugEntry.appendChild(debugDate);
|
||||
debugEntry.appendChild(debugText);
|
||||
debugTag.insertBefore(debugEntry, debugTag.firstChild);
|
||||
// don't allow 'style' issues to hinder the debug output
|
||||
try {
|
||||
debugEntry.className = 'debugEntry';
|
||||
debugDate.className = 'debugDate';
|
||||
debugText.className = cls;
|
||||
} catch (e) {
|
||||
}
|
||||
} catch (e) {
|
||||
if (text.length > 1000) text = text.substr(0,1000) + xajax.debug.text[102];
|
||||
alert(xajax.debug.text[102] + text);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.debug.prepareDebugText
|
||||
|
||||
Convert special characters to their HTML equivellents so they
|
||||
will show up in the <xajax.debug.window>.
|
||||
|
||||
Parameters:
|
||||
text - (string): Debug text
|
||||
*/
|
||||
xajax.debug.prepareDebugText = function(text) {
|
||||
try {
|
||||
text = text.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/\n/g, '<br />');
|
||||
return text;
|
||||
} catch (e) {
|
||||
xajax.debug.stringReplace = function(haystack, needle, newNeedle) {
|
||||
var segments = haystack.split(needle);
|
||||
haystack = '';
|
||||
for (var i = 0; i < segments.length; ++i) {
|
||||
if (0 != i)
|
||||
haystack += newNeedle;
|
||||
haystack += segments[i];
|
||||
}
|
||||
return haystack;
|
||||
}
|
||||
xajax.debug.prepareDebugText = function(text) {
|
||||
text = xajax.debug.stringReplace(text, '&', '&');
|
||||
text = xajax.debug.stringReplace(text, '<', '<');
|
||||
text = xajax.debug.stringReplace(text, '>', '>');
|
||||
text = xajax.debug.stringReplace(text, '\n', '<br />');
|
||||
return text;
|
||||
}
|
||||
xajax.debug.prepareDebugText(text);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.debug.executeCommand
|
||||
|
||||
Catch any exceptions that are thrown by a response command handler
|
||||
and display a message in the debugger.
|
||||
|
||||
This is a wrapper function which surrounds the standard
|
||||
<xajax.executeCommand> function.
|
||||
*/
|
||||
xajax.debug.executeCommand = xajax.executeCommand;
|
||||
xajax.executeCommand = function(args) {
|
||||
try {
|
||||
if ('undefined' == typeof args.cmd)
|
||||
throw { code: 10006 };
|
||||
if (false == xajax.command.handler.isRegistered(args))
|
||||
throw { code: 10007, data: args.cmd };
|
||||
return xajax.debug.executeCommand(args);
|
||||
} catch(e) {
|
||||
var msg = 'ExecuteCommand (';
|
||||
if ('undefined' != typeof args.sequence) {
|
||||
msg += '#';
|
||||
msg += args.sequence;
|
||||
msg += ', ';
|
||||
}
|
||||
if ('undefined' != typeof args.cmdFullName) {
|
||||
msg += '"';
|
||||
msg += args.cmdFullName;
|
||||
msg += '"';
|
||||
}
|
||||
msg += '):\n';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.parseAttributes
|
||||
|
||||
Catch any exception thrown during the parsing of response
|
||||
command attributes and display an appropriate debug message.
|
||||
|
||||
This is a wrapper around the standard <xajax.parseAttributes>
|
||||
function.
|
||||
|
||||
Parameters:
|
||||
child - (object): Childnode
|
||||
obj - (object): Object
|
||||
|
||||
*/
|
||||
xajax.debug.parseAttributes = xajax.parseAttributes;
|
||||
xajax.parseAttributes = function(child, obj) {
|
||||
try {
|
||||
xajax.debug.parseAttributes(child, obj);
|
||||
} catch(e) {
|
||||
var msg = 'ParseAttributes:\n';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
}
|
||||
}
|
||||
|
||||
xajax.debug.commandHandler = xajax.command.handler.unregister('dbg');
|
||||
xajax.command.handler.register('dbg', function(args) {
|
||||
args.cmdFullName = 'debug message';
|
||||
xajax.debug.writeMessage(args.data, xajax.debug.text[100], 'warningText');
|
||||
return xajax.debug.commandHandler(args);
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
Function: xajax.tools.$
|
||||
|
||||
Catch any exceptions thrown while attempting to locate an
|
||||
HTML element by it's unique name.
|
||||
|
||||
This is a wrapper around the standard <xajax.tools.$> function.
|
||||
|
||||
Parameters:
|
||||
sId - (string): Element ID or name
|
||||
|
||||
*/
|
||||
xajax.debug.$ = xajax.tools.$;
|
||||
xajax.tools.$ = function(sId) {
|
||||
try {
|
||||
var returnValue = xajax.debug.$(sId);
|
||||
if ('object' != typeof returnValue)
|
||||
throw { code: 10008 };
|
||||
}
|
||||
catch (e) {
|
||||
var msg = '$:';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[100], 'warningText');
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.tools._objectToXML
|
||||
|
||||
Generate a message indicating that a javascript object is
|
||||
being converted to xml. Indicate the max depth and size. Then
|
||||
display the size of the object upon completion. Catch any
|
||||
exceptions thrown during the conversion process.
|
||||
|
||||
This is a wrapper around the standard <xajax.tools._objectToXML>
|
||||
function.
|
||||
|
||||
Parameters:
|
||||
obj - (object):
|
||||
guard - (object):
|
||||
|
||||
*/
|
||||
xajax.debug._objectToXML = xajax.tools._objectToXML;
|
||||
xajax.tools._objectToXML = function(obj, guard) {
|
||||
try {
|
||||
if (0 == guard.size) {
|
||||
var msg = 'OBJECT TO XML: maxDepth = ';
|
||||
msg += guard.maxDepth;
|
||||
msg += ', maxSize = ';
|
||||
msg += guard.maxSize;
|
||||
xajax.debug.writeMessage(msg);
|
||||
}
|
||||
var r = xajax.debug._objectToXML(obj, guard);
|
||||
if (0 == guard.depth) {
|
||||
var msg = 'OBJECT TO XML: size = ';
|
||||
msg += guard.size;
|
||||
xajax.debug.writeMessage(msg);
|
||||
}
|
||||
return r;
|
||||
} catch(e) {
|
||||
var msg = 'ObjectToXML: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax._internalSend
|
||||
|
||||
Generate a message indicating that the xajax request is
|
||||
about the be sent to the server.
|
||||
|
||||
This is a wrapper around the standard <xajax._internalSend>
|
||||
function.
|
||||
*/
|
||||
xajax.debug._internalSend = xajax._internalSend;
|
||||
xajax._internalSend = function(oRequest) {
|
||||
try {
|
||||
xajax.debug.writeMessage(xajax.debug.text[104]);
|
||||
xajax.debug.writeMessage(
|
||||
xajax.debug.text[105] +
|
||||
oRequest.requestData.length +
|
||||
xajax.debug.text[106]
|
||||
);
|
||||
oRequest.beginDate = new Date();
|
||||
xajax.debug._internalSend(oRequest);
|
||||
} catch (e) {
|
||||
var msg = 'InternalSend: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.submitRequest
|
||||
|
||||
Generate a message indicating that a request is ready to be
|
||||
submitted; providing the URL and the function being invoked.
|
||||
|
||||
Catch any exceptions thrown and display a message.
|
||||
|
||||
This is a wrapper around the standard <xajax.submitRequest>
|
||||
function.
|
||||
*/
|
||||
xajax.debug.submitRequest = xajax.submitRequest;
|
||||
xajax.submitRequest = function(oRequest) {
|
||||
var msg = oRequest.method;
|
||||
msg += ': ';
|
||||
text = decodeURIComponent(oRequest.requestData);
|
||||
text = text.replace(new RegExp('&xjx', 'g'), '\n&xjx');
|
||||
text = text.replace(new RegExp('<xjxobj>', 'g'), '\n<xjxobj>');
|
||||
text = text.replace(new RegExp('<e>', 'g'), '\n<e>');
|
||||
text = text.replace(new RegExp('</xjxobj>', 'g'), '\n</xjxobj>\n');
|
||||
msg += text;
|
||||
xajax.debug.writeMessage(msg);
|
||||
msg = xajax.debug.text[107];
|
||||
var separator = '\n';
|
||||
for (var mbr in oRequest.functionName) {
|
||||
msg += separator;
|
||||
msg += mbr;
|
||||
msg += ': ';
|
||||
msg += oRequest.functionName[mbr];
|
||||
separator = '\n';
|
||||
}
|
||||
msg += separator;
|
||||
msg += xajax.debug.text[108];
|
||||
msg += separator;
|
||||
msg += oRequest.URI;
|
||||
xajax.debug.writeMessage(msg);
|
||||
|
||||
try {
|
||||
return xajax.debug.submitRequest(oRequest);
|
||||
} catch (e) {
|
||||
xajax.debug.writeMessage(e.message);
|
||||
if (0 < oRequest.retry)
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.initializeRequest
|
||||
|
||||
Generate a message indicating that the request object is
|
||||
being initialized.
|
||||
|
||||
This is a wrapper around the standard <xajax.initializeRequest>
|
||||
function.
|
||||
*/
|
||||
xajax.debug.initializeRequest = xajax.initializeRequest;
|
||||
xajax.initializeRequest = function(oRequest) {
|
||||
try {
|
||||
var msg = xajax.debug.text[109];
|
||||
xajax.debug.writeMessage(msg);
|
||||
return xajax.debug.initializeRequest(oRequest);
|
||||
} catch (e) {
|
||||
var msg = 'InitializeRequest: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.processParameters
|
||||
|
||||
Generate a message indicating that the request object is
|
||||
being populated with the parameters provided.
|
||||
|
||||
This is a wrapper around the standard <xajax.processParameters>
|
||||
function.
|
||||
*/
|
||||
xajax.debug.processParameters = xajax.processParameters;
|
||||
xajax.processParameters = function(oRequest) {
|
||||
try {
|
||||
if ('undefined' != typeof oRequest.parameters) {
|
||||
var msg = xajax.debug.text[110];
|
||||
msg += oRequest.parameters.length;
|
||||
msg += xajax.debug.text[111];
|
||||
xajax.debug.writeMessage(msg);
|
||||
} else {
|
||||
var msg = xajax.debug.text[112];
|
||||
xajax.debug.writeMessage(msg);
|
||||
}
|
||||
return xajax.debug.processParameters(oRequest);
|
||||
} catch (e) {
|
||||
var msg = 'ProcessParameters: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.prepareRequest
|
||||
|
||||
Generate a message indicating that the request is being
|
||||
prepared. This may occur more than once for a request
|
||||
if it errors and a retry is attempted.
|
||||
|
||||
This is a wrapper around the standard <xajax.prepareRequest>
|
||||
*/
|
||||
xajax.debug.prepareRequest = xajax.prepareRequest;
|
||||
xajax.prepareRequest = function(oRequest) {
|
||||
try {
|
||||
var msg = xajax.debug.text[113];
|
||||
xajax.debug.writeMessage(msg);
|
||||
return xajax.debug.prepareRequest(oRequest);
|
||||
} catch (e) {
|
||||
var msg = 'PrepareRequest: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.call
|
||||
|
||||
Validates that a function name was provided, generates a message
|
||||
indicating that a xajax call is starting and sets a flag in the
|
||||
request object indicating that debugging is enabled for this call.
|
||||
|
||||
This is a wrapper around the standard <xajax.call> function.
|
||||
*/
|
||||
xajax.debug.call = xajax.call;
|
||||
xajax.call = function() {
|
||||
try {
|
||||
xajax.debug.writeMessage(xajax.debug.text[114]);
|
||||
|
||||
var numArgs = arguments.length;
|
||||
|
||||
if (0 == numArgs)
|
||||
throw { code: 10009 };
|
||||
|
||||
var functionName = arguments[0];
|
||||
var oOptions = {}
|
||||
if (1 < numArgs)
|
||||
oOptions = arguments[1];
|
||||
|
||||
oOptions.debugging = true;
|
||||
|
||||
return xajax.debug.call(functionName, oOptions);
|
||||
} catch (e) {
|
||||
var msg = 'Call: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.request
|
||||
|
||||
Validates that a function name was provided, generates a message
|
||||
indicating that a xajax request is starting and sets a flag in the
|
||||
request object indicating that debugging is enabled for this request.
|
||||
|
||||
This is a wrapper around the standard <xajax.request> function.
|
||||
*/
|
||||
xajax.debug.request = xajax.request;
|
||||
xajax.request = function() {
|
||||
try {
|
||||
xajax.debug.writeMessage(xajax.debug.text[115]);
|
||||
|
||||
var numArgs = arguments.length;
|
||||
|
||||
if (0 == numArgs)
|
||||
throw { code: 10010 };
|
||||
|
||||
var oFunction = arguments[0];
|
||||
var oOptions = {}
|
||||
if (1 < numArgs)
|
||||
oOptions = arguments[1];
|
||||
|
||||
oOptions.debugging = true;
|
||||
|
||||
return xajax.debug.request(oFunction, oOptions);
|
||||
} catch (e) {
|
||||
var msg = 'Request: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.getResponseProcessor
|
||||
|
||||
Generate an error message when no reponse processor is available
|
||||
to process the type of response returned from the server.
|
||||
|
||||
This is a wrapper around the standard <xajax.getResponseProcessor>
|
||||
function.
|
||||
*/
|
||||
xajax.debug.getResponseProcessor = xajax.getResponseProcessor;
|
||||
xajax.getResponseProcessor = function(oRequest) {
|
||||
try {
|
||||
var fProc = xajax.debug.getResponseProcessor(oRequest);
|
||||
|
||||
if ('undefined' == typeof fProc) {
|
||||
var msg = xajax.debug.text[116];
|
||||
try {
|
||||
var contentType = oRequest.request.getResponseHeader('content-type');
|
||||
msg += "Content-Type: ";
|
||||
msg += contentType;
|
||||
if ('text/html' == contentType) {
|
||||
msg += xajax.debug.text[117];
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
}
|
||||
|
||||
return fProc;
|
||||
} catch (e) {
|
||||
var msg = 'GetResponseProcessor: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.responseReceived
|
||||
|
||||
Generate a message indicating that a response has been received
|
||||
from the server; provide some statistical data regarding the
|
||||
response and the response time.
|
||||
|
||||
Catch any exceptions that are thrown during the processing of
|
||||
the response and generate a message.
|
||||
|
||||
This is a wrapper around the standard <xajax.responseReceived>
|
||||
function.
|
||||
*/
|
||||
xajax.debug.responseReceived = xajax.responseReceived;
|
||||
xajax.responseReceived = function(oRequest) {
|
||||
var xx = xajax;
|
||||
var xt = xx.tools;
|
||||
var xd = xx.debug;
|
||||
|
||||
var oRet;
|
||||
|
||||
try {
|
||||
var status = oRequest.request.status;
|
||||
if (xt.arrayContainsValue(xx.responseSuccessCodes, status)) {
|
||||
var packet = oRequest.request.responseText;
|
||||
packet = packet.replace(new RegExp('<cmd', 'g'), '\n<cmd');
|
||||
packet = packet.replace(new RegExp('<xjx>', 'g'), '\n<xjx>');
|
||||
packet = packet.replace(new RegExp('<xjxobj>', 'g'), '\n<xjxobj>');
|
||||
packet = packet.replace(new RegExp('<e>', 'g'), '\n<e>');
|
||||
packet = packet.replace(new RegExp('</xjxobj>', 'g'), '\n</xjxobj>\n');
|
||||
packet = packet.replace(new RegExp('</xjx>', 'g'), '\n</xjx>');
|
||||
oRequest.midDate = new Date();
|
||||
var msg = xajax.debug.text[118];
|
||||
msg += oRequest.request.status;
|
||||
msg += xajax.debug.text[119];
|
||||
msg += packet.length;
|
||||
msg += xajax.debug.text[120];
|
||||
msg += (oRequest.midDate - oRequest.beginDate);
|
||||
msg += xajax.debug.text[121];
|
||||
msg += packet;
|
||||
xd.writeMessage(msg);
|
||||
} else if (xt.arrayContainsValue(xx.responseErrorsForAlert, status)) {
|
||||
var msg = xajax.debug.text[122];
|
||||
msg += status;
|
||||
msg += xajax.debug.text[123];
|
||||
msg += oRequest.request.responseText;
|
||||
xd.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
} else if (xt.arrayContainsValue(xx.responseRedirectCodes, status)) {
|
||||
var msg = xajax.debug.text[124];
|
||||
msg += oRequest.request.getResponseHeader('location');
|
||||
xd.writeMessage(msg);
|
||||
}
|
||||
oRet = xd.responseReceived(oRequest);
|
||||
} catch (e) {
|
||||
var msg = 'ResponseReceived: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xd.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
}
|
||||
|
||||
return oRet;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.completeResponse
|
||||
|
||||
Generate a message indicating that the request has completed
|
||||
and provide some statistics regarding the request and response.
|
||||
|
||||
This is a wrapper around the standard <xajax.completeResponse>
|
||||
function.
|
||||
*/
|
||||
xajax.debug.completeResponse = xajax.completeResponse;
|
||||
xajax.completeResponse = function(oRequest) {
|
||||
try {
|
||||
var returnValue = xajax.debug.completeResponse(oRequest);
|
||||
oRequest.endDate = new Date();
|
||||
var msg = xajax.debug.text[125];
|
||||
msg += (oRequest.endDate - oRequest.beginDate);
|
||||
msg += xajax.debug.text[126];
|
||||
xajax.debug.writeMessage(msg);
|
||||
return returnValue;
|
||||
} catch (e) {
|
||||
var msg = 'CompleteResponse: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.tools.getRequestObject
|
||||
|
||||
Generate a message indicating that the request object is
|
||||
being initialized.
|
||||
|
||||
Catch any exceptions that are thrown during the process or
|
||||
initializing a new request object.
|
||||
|
||||
This is a wrapper around the standard <xajax.getRequestObject>
|
||||
function.
|
||||
*/
|
||||
xajax.debug.getRequestObject = xajax.tools.getRequestObject;
|
||||
xajax.tools.getRequestObject = function() {
|
||||
try {
|
||||
xajax.debug.writeMessage(xajax.debug.text[127]);
|
||||
return xajax.debug.getRequestObject();
|
||||
} catch (e) {
|
||||
var msg = 'GetRequestObject: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.dom.assign
|
||||
|
||||
Catch any exceptions thrown during the assignment and
|
||||
display an error message.
|
||||
|
||||
This is a wrapper around the standard <xajax.dom.assign>
|
||||
function.
|
||||
*/
|
||||
if (xajax.dom.assign) {
|
||||
xajax.debug.assign = xajax.dom.assign;
|
||||
xajax.dom.assign = function(element, property, data) {
|
||||
try {
|
||||
return xajax.debug.assign(element, property, data);
|
||||
} catch (e) {
|
||||
var msg = 'xajax.dom.assign: ';
|
||||
msg += xajax.debug.getExceptionText(e);
|
||||
msg += '\n';
|
||||
msg += 'Eval: element.';
|
||||
msg += property;
|
||||
msg += ' = data;\n';
|
||||
xajax.debug.writeMessage(msg, xajax.debug.text[101], 'errorText');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.tools.queue.retry
|
||||
*/
|
||||
if (xajax.tools) {
|
||||
if (xajax.tools.queue) {
|
||||
if (xajax.tools.queue.retry) {
|
||||
if ('undefined' == typeof xajax.debug.tools)
|
||||
xajax.debug.tools = {};
|
||||
if ('undefined' == typeof xajax.debug.tools.queue)
|
||||
xajax.debug.tools.queue = {};
|
||||
xajax.debug.tools.queue.retry = xajax.tools.queue.retry;
|
||||
xajax.tools.queue.retry = function(obj, count) {
|
||||
if (xajax.debug.tools.queue.retry(obj, count))
|
||||
return true;
|
||||
// no 'exceeded' message for sleep command
|
||||
if (obj.cmd && 's' == obj.cmd)
|
||||
return false;
|
||||
xajax.debug.writeMessage('Retry count exceeded.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Boolean: xajax.debug.isLoaded
|
||||
|
||||
true - indicates that the debugging module is loaded
|
||||
*/
|
||||
xajax.debug.isLoaded = true;
|
||||
|
||||
/*
|
||||
Section: Redefine shortcuts.
|
||||
|
||||
Must redefine these shortcuts so they point to the new debug (wrapper) versions:
|
||||
- <xjx.$>
|
||||
- <xjx.getFormValues>
|
||||
- <xjx.call>
|
||||
|
||||
Must redefine these shortcuts as well:
|
||||
- <xajax.$>
|
||||
- <xajax.getFormValues>
|
||||
*/
|
||||
xjx = {}
|
||||
|
||||
xjx.$ = xajax.tools.$;
|
||||
xjx.getFormValues = xajax.tools.getFormValues;
|
||||
xjx.call = xajax.call;
|
||||
xjx.request = xajax.request;
|
||||
|
||||
xajax.$ = xajax.tools.$;
|
||||
xajax.getFormValues = xajax.tools.getFormValues;
|
||||
} catch (e) {
|
||||
alert(e.name + ': ' + e.message);
|
||||
}
|
10
lib/xajax/xajax_js/xajax_lang_bg.js
Executable file
|
@ -0,0 +1,10 @@
|
|||
|
||||
if('undefined'!=typeof xajax.debug){xajax.debug.text=[];xajax.debug.text[100]='ПРЕДУПРЕЖДЕНИЕ: ';xajax.debug.text[101]='ГРЕШКА: ';xajax.debug.text[102]='XAJAX ДЕБЪГ СЪОБЩЕНИЕ:\n';xajax.debug.text[103]='...\n[ДЪЛЪГ ОТГОВОР]\n...';xajax.debug.text[104]='ИЗПРАЩАНЕ НА ЗАЯВКИ';xajax.debug.text[105]='ИЗПРАТЕНИ [';xajax.debug.text[106]=' байта]';xajax.debug.text[107]='ИЗВИКВАНЕ: ';xajax.debug.text[108]='Адрес: ';xajax.debug.text[109]='ИНИЦИАЛИЗИРАНЕ НА ЗАЯВКАТА';xajax.debug.text[110]='ОБРАБОТВАНЕ НА ПАРАМЕТРИТЕ [';xajax.debug.text[111]=']';xajax.debug.text[112]='НЯМА ПАРАМЕТРИ ЗА ОБРАБОТВАНЕ';xajax.debug.text[113]='ПОДГОТВЯВАНЕ НА ЗАЯВКАТА';xajax.debug.text[114]='СТАРТИРАНЕ НА XAJAX ПОВИКВАНЕТО (остаряло: вместо това използвай xajax.request)';xajax.debug.text[115]='СТАРТИРАНЕ НА XAJAX ЗАЯВКАТА';xajax.debug.text[116]='Няма регистрирани функции, които да обработят заявката ви на сървъра!\n';xajax.debug.text[117]='.\nПровери за съобщения за грешки на сървъра.';xajax.debug.text[118]='ПОЛУЧЕНИ [статус: ';xajax.debug.text[119]=', размер: ';xajax.debug.text[120]=' байта, време: ';xajax.debug.text[121]='мсек]:\n';xajax.debug.text[122]='Сървъра върна следния HTTP статус: ';xajax.debug.text[123]='\nПОЛУЧЕНИ:\n';xajax.debug.text[124]='Сървъра върна пренасочване към:<br />';xajax.debug.text[125]='ГОТОВО [';xajax.debug.text[126]='мсек]';xajax.debug.text[127]='ИНИЦИАЛИЗИРАНЕ НА ОБЕКТА НА ЗАЯВКАТА';xajax.debug.exceptions=[];xajax.debug.exceptions[10001]='Невалиден XML отговор: Отговора съдържа непознат таг: {data}.';xajax.debug.exceptions[10002]='GetRequestObject: Няма XMLHttpRequest, xajax е изключен.';xajax.debug.exceptions[10003]='Препълване на опашката: Обекта не може да бъде сложен на опашката, защото тя е пълна.';xajax.debug.exceptions[10004]='Невалиден XML отговор: Отговора съдържа неочакван таг или текст: {data}.';xajax.debug.exceptions[10005]='Невалиден адрес: Невалиден или липсващ адрес; автоматичното откриване неуспешнп; please specify a one explicitly.';xajax.debug.exceptions[10006]='Невалидна команда в отговора: Получена беше невалидна команда като отговор.';xajax.debug.exceptions[10007]='Невалидна команда в отговора: Командата [{data}] е непозната.';xajax.debug.exceptions[10008]='Елемент с ID [{data}] не беше намерен в документа.';xajax.debug.exceptions[10009]='Невалидна заявка: Параметъра с името на функцията липсва.';xajax.debug.exceptions[10010]='Невалидна заявка: Липсва обекта на функцията.';}
|
||||
if('undefined'!=typeof xajax.config){if('undefined'!=typeof xajax.config.status){xajax.config.status.update=function(){return{onRequest:function(){window.status='Изпращане на заявка...';},
|
||||
onWaiting:function(){window.status='Изчакване на отговор...';},
|
||||
onProcessing:function(){window.status='Изпълнение...';},
|
||||
onComplete:function(){window.status='Готово.';}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
81
lib/xajax/xajax_js/xajax_lang_bg_uncompressed.js
Executable file
|
@ -0,0 +1,81 @@
|
|||
/**
|
||||
* translation for: xajax v.x.x
|
||||
* @version: 1.0.0
|
||||
* @author: mic <info@joomx.com>
|
||||
* @copyright xajax project
|
||||
* @license GNU/GPL
|
||||
* @package xajax x.x.x
|
||||
* @since v.x.x.x
|
||||
* save as UTF-8
|
||||
*/
|
||||
|
||||
if ('undefined' != typeof xajax.debug) {
|
||||
/*
|
||||
Array: text
|
||||
*/
|
||||
xajax.debug.text = [];
|
||||
xajax.debug.text[100] = 'ПРЕДУПРЕЖДЕНИЕ: ';
|
||||
xajax.debug.text[101] = 'ГРЕШКА: ';
|
||||
xajax.debug.text[102] = 'XAJAX ДЕБЪГ СЪОБЩЕНИЕ:\n';
|
||||
xajax.debug.text[103] = '...\n[ДЪЛЪГ ОТГОВОР]\n...';
|
||||
xajax.debug.text[104] = 'ИЗПРАЩАНЕ НА ЗАЯВКИ';
|
||||
xajax.debug.text[105] = 'ИЗПРАТЕНИ [';
|
||||
xajax.debug.text[106] = ' байта]';
|
||||
xajax.debug.text[107] = 'ИЗВИКВАНЕ: ';
|
||||
xajax.debug.text[108] = 'Адрес: ';
|
||||
xajax.debug.text[109] = 'ИНИЦИАЛИЗИРАНЕ НА ЗАЯВКАТА';
|
||||
xajax.debug.text[110] = 'ОБРАБОТВАНЕ НА ПАРАМЕТРИТЕ [';
|
||||
xajax.debug.text[111] = ']';
|
||||
xajax.debug.text[112] = 'НЯМА ПАРАМЕТРИ ЗА ОБРАБОТВАНЕ';
|
||||
xajax.debug.text[113] = 'ПОДГОТВЯВАНЕ НА ЗАЯВКАТА';
|
||||
xajax.debug.text[114] = 'СТАРТИРАНЕ НА XAJAX ПОВИКВАНЕТО (остаряло: вместо това използвай xajax.request)';
|
||||
xajax.debug.text[115] = 'СТАРТИРАНЕ НА XAJAX ЗАЯВКАТА';
|
||||
xajax.debug.text[116] = 'Няма регистрирани функции, които да обработят заявката ви на сървъра!\n';
|
||||
xajax.debug.text[117] = '.\nПровери за съобщения за грешки на сървъра.';
|
||||
xajax.debug.text[118] = 'ПОЛУЧЕНИ [статус: ';
|
||||
xajax.debug.text[119] = ', размер: ';
|
||||
xajax.debug.text[120] = ' байта, време: ';
|
||||
xajax.debug.text[121] = 'мсек]:\n';
|
||||
xajax.debug.text[122] = 'Сървъра върна следния HTTP статус: ';
|
||||
xajax.debug.text[123] = '\nПОЛУЧЕНИ:\n';
|
||||
xajax.debug.text[124] = 'Сървъра върна пренасочване към:<br />';
|
||||
xajax.debug.text[125] = 'ГОТОВО [';
|
||||
xajax.debug.text[126] = 'мсек]';
|
||||
xajax.debug.text[127] = 'ИНИЦИАЛИЗИРАНЕ НА ОБЕКТА НА ЗАЯВКАТА';
|
||||
|
||||
xajax.debug.exceptions = [];
|
||||
xajax.debug.exceptions[10001] = 'Невалиден XML отговор: Отговора съдържа непознат таг: {data}.';
|
||||
xajax.debug.exceptions[10002] = 'GetRequestObject: Няма XMLHttpRequest, xajax е изключен.';
|
||||
xajax.debug.exceptions[10003] = 'Препълване на опашката: Обекта не може да бъде сложен на опашката, защото тя е пълна.';
|
||||
xajax.debug.exceptions[10004] = 'Невалиден XML отговор: Отговора съдържа неочакван таг или текст: {data}.';
|
||||
xajax.debug.exceptions[10005] = 'Невалиден адрес: Невалиден или липсващ адрес; автоматичното откриване неуспешнп; please specify a one explicitly.';
|
||||
xajax.debug.exceptions[10006] = 'Невалидна команда в отговора: Получена беше невалидна команда като отговор.';
|
||||
xajax.debug.exceptions[10007] = 'Невалидна команда в отговора: Командата [{data}] е непозната.';
|
||||
xajax.debug.exceptions[10008] = 'Елемент с ID [{data}] не беше намерен в документа.';
|
||||
xajax.debug.exceptions[10009] = 'Невалидна заявка: Параметъра с името на функцията липсва.';
|
||||
xajax.debug.exceptions[10010] = 'Невалидна заявка: Липсва обекта на функцията.';
|
||||
}
|
||||
|
||||
if ('undefined' != typeof xajax.config) {
|
||||
if ('undefined' != typeof xajax.config.status) {
|
||||
/*
|
||||
Object: update
|
||||
*/
|
||||
xajax.config.status.update = function() {
|
||||
return {
|
||||
onRequest: function() {
|
||||
window.status = 'Изпращане на заявка...';
|
||||
},
|
||||
onWaiting: function() {
|
||||
window.status = 'Изчакване на отговор...';
|
||||
},
|
||||
onProcessing: function() {
|
||||
window.status = 'Изпълнение...';
|
||||
},
|
||||
onComplete: function() {
|
||||
window.status = 'Готово.';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
9
lib/xajax/xajax_js/xajax_lang_de.js
Executable file
|
@ -0,0 +1,9 @@
|
|||
if('undefined'!=typeof xajax.debug){xajax.debug.text=[];xajax.debug.text[100]='WARNUNG: ';xajax.debug.text[101]='FEHLER: ';xajax.debug.text[102]='XAJAX FEHLERSUCHE NACHRICHT:\n';xajax.debug.text[103]='...\n[UMGFANGREICHE ANTWORT]\n...';xajax.debug.text[104]='SENDE ANFRAGE';xajax.debug.text[105]='GESENDET [';xajax.debug.text[106]=' bytes]';xajax.debug.text[107]='STARTE AUFRUF: ';xajax.debug.text[108]='URI: ';xajax.debug.text[109]='BEGINNE ANFRAGE';xajax.debug.text[110]='PARAMETER IN BEARBEITUNG [';xajax.debug.text[111]=']';xajax.debug.text[112]='KEINE PARAMETER ZU VERARBEITEN';xajax.debug.text[113]='BEREITE REQUEST VOR';xajax.debug.text[114]='BEGINNE XAJAX CALL (veraltet: verwendet stattdessen xajax.request)';xajax.debug.text[115]='BEGINNE XAJAX ANFRAGE';xajax.debug.text[116]='Die vom Server erhaltenen Daten konnten nicht verarbeitet werden.\n';xajax.debug.text[117]='.\nPrüfe auf Fehlermeldungen des Servers.';xajax.debug.text[118]='ERHALTEN [status: ';xajax.debug.text[119]=', Größe: ';xajax.debug.text[120]=' bytes, Zeit: ';xajax.debug.text[121]='ms]:\n';xajax.debug.text[122]='Der Server hat folgenden HTTP-Status zurück gesendet: ';xajax.debug.text[123]='\nERHALTEN:\n';xajax.debug.text[124]='Der Server lieferte einen Redirect nach:<br />';xajax.debug.text[125]='ABGESCHLOSSEN [';xajax.debug.text[126]='ms]';xajax.debug.text[127]='INITIALISIERE REQUEST OBJEKT';xajax.debug.exceptions=[];xajax.debug.exceptions[10001]='Ungültige XML-Antwort: die Antwort enthält ein ungültiges Tag: {data}.';xajax.debug.exceptions[10002]='GetRequestObject: XMLHttpRequest ist nicht verfügbar, XajaX ist nicht verfügbar.';xajax.debug.exceptions[10003]='Warteschleife-Überlauf: kann Objekt nicht an Warteschleife übergeben da diese voll ist.';xajax.debug.exceptions[10004]='Ungültige XML-Antwort: die Antwort enthält einen unerwarteten Tag oder Text: {data}.';xajax.debug.exceptions[10005]='Ungültige Request-URI: Ungültige oder Fehlende URI; Autoerkennung fehlgeschlagen; bitte nur eine einzige URI angeben.';xajax.debug.exceptions[10006]='Ungültiges Antwort-Befehl: Unvollständiges Objekt zurück erhalten.';xajax.debug.exceptions[10007]='Ungültiges Antwort-Befehl: Befehl [{data}] ist nicht bekannt.';xajax.debug.exceptions[10008]='Es konnte kein Element mit der ID [{data}] konnte im Dokument gefunden werden.';xajax.debug.exceptions[10009]='Ungültige Anfrage: Fehlender Funktionsparameter - name.';xajax.debug.exceptions[10010]='Ungültige Anfrage: Fehlender Funktionsparameter - object.';}
|
||||
if('undefined'!=typeof xajax.config){if('undefined'!=typeof xajax.config.status){xajax.config.status.update=function(){return{onRequest:function(){window.status='Sende Anfrage...';},
|
||||
onWaiting:function(){window.status='Warten auf Antwort...';},
|
||||
onProcessing:function(){window.status='Verarbeitung...';},
|
||||
onComplete:function(){window.status='Fertig.';}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
84
lib/xajax/xajax_js/xajax_lang_de_uncompressed.js
Executable file
|
@ -0,0 +1,84 @@
|
|||
/**
|
||||
* translation for: xajax v.x.x
|
||||
* @version: 1.0.0
|
||||
* @author: mic <info@joomx.com>
|
||||
* @copyright xajax project
|
||||
* @license GNU/GPL
|
||||
* @package xajax x.x.x
|
||||
* @since v.x.x.x
|
||||
* save as UTF-8
|
||||
*/
|
||||
|
||||
if ('undefined' != typeof xajax.debug) {
|
||||
/*
|
||||
Array: text
|
||||
*/
|
||||
xajax.debug.text = [];
|
||||
xajax.debug.text[100] = 'WARNUNG: ';
|
||||
xajax.debug.text[101] = 'FEHLER: ';
|
||||
xajax.debug.text[102] = 'XAJAX FEHLERSUCHE NACHRICHT:\n';
|
||||
xajax.debug.text[103] = '...\n[UMGFANGREICHE ANTWORT]\n...';
|
||||
xajax.debug.text[104] = 'SENDE ANFRAGE';
|
||||
xajax.debug.text[105] = 'GESENDET [';
|
||||
xajax.debug.text[106] = ' bytes]';
|
||||
xajax.debug.text[107] = 'STARTE AUFRUF: ';
|
||||
xajax.debug.text[108] = 'URI: ';
|
||||
xajax.debug.text[109] = 'BEGINNE ANFRAGE';
|
||||
xajax.debug.text[110] = 'PARAMETER IN BEARBEITUNG [';
|
||||
xajax.debug.text[111] = ']';
|
||||
xajax.debug.text[112] = 'KEINE PARAMETER ZU VERARBEITEN';
|
||||
xajax.debug.text[113] = 'BEREITE REQUEST VOR';
|
||||
xajax.debug.text[114] = 'BEGINNE XAJAX CALL (veraltet: verwendet stattdessen xajax.request)';
|
||||
xajax.debug.text[115] = 'BEGINNE XAJAX ANFRAGE';
|
||||
xajax.debug.text[116] = 'Die vom Server erhaltenen Daten konnten nicht verarbeitet werden.\n';
|
||||
xajax.debug.text[117] = '.\nPrüfe auf Fehlermeldungen des Servers.';
|
||||
xajax.debug.text[118] = 'ERHALTEN [status: ';
|
||||
xajax.debug.text[119] = ', Größe: ';
|
||||
xajax.debug.text[120] = ' bytes, Zeit: ';
|
||||
xajax.debug.text[121] = 'ms]:\n';
|
||||
xajax.debug.text[122] = 'Der Server hat folgenden HTTP-Status zurück gesendet: ';
|
||||
xajax.debug.text[123] = '\nERHALTEN:\n';
|
||||
xajax.debug.text[124] = 'Der Server lieferte einen Redirect nach:<br />';
|
||||
xajax.debug.text[125] = 'ABGESCHLOSSEN [';
|
||||
xajax.debug.text[126] = 'ms]';
|
||||
xajax.debug.text[127] = 'INITIALISIERE REQUEST OBJEKT';
|
||||
|
||||
/*
|
||||
Array: exceptions
|
||||
*/
|
||||
xajax.debug.exceptions = [];
|
||||
xajax.debug.exceptions[10001] = 'Ungültige XML-Antwort: die Antwort enthält ein ungültiges Tag: {data}.';
|
||||
xajax.debug.exceptions[10002] = 'GetRequestObject: XMLHttpRequest ist nicht verfügbar, XajaX ist nicht verfügbar.';
|
||||
xajax.debug.exceptions[10003] = 'Warteschleife-Überlauf: kann Objekt nicht an Warteschleife übergeben da diese voll ist.';
|
||||
xajax.debug.exceptions[10004] = 'Ungültige XML-Antwort: die Antwort enthält einen unerwarteten Tag oder Text: {data}.';
|
||||
xajax.debug.exceptions[10005] = 'Ungültige Request-URI: Ungültige oder Fehlende URI; Autoerkennung fehlgeschlagen; bitte nur eine einzige URI angeben.';
|
||||
xajax.debug.exceptions[10006] = 'Ungültiges Antwort-Befehl: Unvollständiges Objekt zurück erhalten.';
|
||||
xajax.debug.exceptions[10007] = 'Ungültiges Antwort-Befehl: Befehl [{data}] ist nicht bekannt.';
|
||||
xajax.debug.exceptions[10008] = 'Es konnte kein Element mit der ID [{data}] konnte im Dokument gefunden werden.';
|
||||
xajax.debug.exceptions[10009] = 'Ungültige Anfrage: Fehlender Funktionsparameter - name.';
|
||||
xajax.debug.exceptions[10010] = 'Ungültige Anfrage: Fehlender Funktionsparameter - object.';
|
||||
}
|
||||
|
||||
if ('undefined' != typeof xajax.config) {
|
||||
if ('undefined' != typeof xajax.config.status) {
|
||||
/*
|
||||
Object: update
|
||||
*/
|
||||
xajax.config.status.update = function() {
|
||||
return {
|
||||
onRequest: function() {
|
||||
window.status = 'Sende Anfrage...';
|
||||
},
|
||||
onWaiting: function() {
|
||||
window.status = 'Warten auf Antwort...';
|
||||
},
|
||||
onProcessing: function() {
|
||||
window.status = 'Verarbeitung...';
|
||||
},
|
||||
onComplete: function() {
|
||||
window.status = 'Fertig.';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
10
lib/xajax/xajax_js/xajax_lang_es.js
Executable file
|
@ -0,0 +1,10 @@
|
|||
|
||||
if('undefined'!=typeof xajax.debug){xajax.debug.text=[];xajax.debug.text[100]='ALERTA: ';xajax.debug.text[101]='ERROR: ';xajax.debug.text[102]='MENSAJE XAJAX DEBUG:\n';xajax.debug.text[103]='...\n[RESPUESTA LARGA]\n...';xajax.debug.text[104]='ENVIANDO PETICION';xajax.debug.text[105]='ENVIADO [';xajax.debug.text[106]=' bytes]';xajax.debug.text[107]='LLAMADA: ';xajax.debug.text[108]='URI: ';xajax.debug.text[109]='INICIALIZANDO PETICION';xajax.debug.text[110]='PROCESANDO PARAMETROS [';xajax.debug.text[111]=']';xajax.debug.text[112]='NO HAY PARAMETROS A PROCESAR';xajax.debug.text[113]='PREPARANDO PETICION';xajax.debug.text[114]='INICIANDO XAJAX CALL (En desuso: use xajax.request)';xajax.debug.text[115]='INICIANDO XAJAX REQUEST';xajax.debug.text[116]='Ningún procesador de respuesta esta disponible para tratar la respuesta del servidor.\n';xajax.debug.text[117]='.\nRevisa mensajes de error del servidor.';xajax.debug.text[118]='RECIBIDO [status: ';xajax.debug.text[119]=', size: ';xajax.debug.text[120]=' bytes, time: ';xajax.debug.text[121]='ms]:\n';xajax.debug.text[122]='El servidor retorno el siguiente estado HTTP: ';xajax.debug.text[123]='\nRECIBIDO:\n';xajax.debug.text[124]='El servidor retorno una redireccion a:<br />';xajax.debug.text[125]='HECHO [';xajax.debug.text[126]='ms]';xajax.debug.text[127]='INICIALIZANDO PETICION OBJETO';xajax.debug.exceptions=[];xajax.debug.exceptions[10001]='Invalid response XML: La respuesta contiene una etiqueta desconocida: {data}.';xajax.debug.exceptions[10002]='GetRequestObject: XMLHttpRequest no disponible, xajax esta deshabilitado.';xajax.debug.exceptions[10003]='Queue overflow: No se puede colocar objeto en cola porque esta llena.';xajax.debug.exceptions[10004]='Invalid response XML: La respuesta contiene una etiqueta o texto inesperado: {data}.';xajax.debug.exceptions[10005]='Invalid request URI: URI invalida o perdida; autodeteccion fallida; por favor especifica una explicitamente.';xajax.debug.exceptions[10006]='Invalid response command: Orden de respuesta mal formado recibido.';xajax.debug.exceptions[10007]='Invalid response command: Comando [{data}] no es un comando conocido.';xajax.debug.exceptions[10008]='Elemento con ID [{data}] no encontrado en el documento.';xajax.debug.exceptions[10009]='Invalid request: Nombre parametro de funcion perdido.';xajax.debug.exceptions[10010]='Invalid request: Objeto parametro de funcion perdido.';}
|
||||
if('undefined'!=typeof xajax.config){if('undefined'!=typeof xajax.config.status){xajax.config.status.update=function(){return{onRequest:function(){window.status='Enviando Peticion...';},
|
||||
onWaiting:function(){window.status='Esperando Respuesta...';},
|
||||
onProcessing:function(){window.status='Procesando...';},
|
||||
onComplete:function(){window.status='Hecho.';}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
81
lib/xajax/xajax_js/xajax_lang_es_uncompressed.js
Executable file
|
@ -0,0 +1,81 @@
|
|||
/**
|
||||
* translation for: xajax v.x.x
|
||||
* @version: 1.0.0
|
||||
* @author: mic <info@joomx.com>
|
||||
* @copyright xajax project
|
||||
* @license GNU/GPL
|
||||
* @package xajax x.x.x
|
||||
* @since v.x.x.x
|
||||
* save as UTF-8
|
||||
*/
|
||||
|
||||
if ('undefined' != typeof xajax.debug) {
|
||||
/*
|
||||
Array: text
|
||||
*/
|
||||
xajax.debug.text = [];
|
||||
xajax.debug.text[100] = 'ALERTA: ';
|
||||
xajax.debug.text[101] = 'ERROR: ';
|
||||
xajax.debug.text[102] = 'MENSAJE XAJAX DEBUG:\n';
|
||||
xajax.debug.text[103] = '...\n[RESPUESTA LARGA]\n...';
|
||||
xajax.debug.text[104] = 'ENVIANDO PETICION';
|
||||
xajax.debug.text[105] = 'ENVIADO [';
|
||||
xajax.debug.text[106] = ' bytes]';
|
||||
xajax.debug.text[107] = 'LLAMADA: ';
|
||||
xajax.debug.text[108] = 'URI: ';
|
||||
xajax.debug.text[109] = 'INICIALIZANDO PETICION';
|
||||
xajax.debug.text[110] = 'PROCESANDO PARAMETROS [';
|
||||
xajax.debug.text[111] = ']';
|
||||
xajax.debug.text[112] = 'NO HAY PARAMETROS A PROCESAR';
|
||||
xajax.debug.text[113] = 'PREPARANDO PETICION';
|
||||
xajax.debug.text[114] = 'INICIANDO XAJAX CALL (En desuso: use xajax.request)';
|
||||
xajax.debug.text[115] = 'INICIANDO XAJAX REQUEST';
|
||||
xajax.debug.text[116] = 'Ning<6E>n procesador de respuesta esta disponible para tratar la respuesta del servidor.\n';
|
||||
xajax.debug.text[117] = '.\nRevisa mensajes de error del servidor.';
|
||||
xajax.debug.text[118] = 'RECIBIDO [status: ';
|
||||
xajax.debug.text[119] = ', size: ';
|
||||
xajax.debug.text[120] = ' bytes, time: ';
|
||||
xajax.debug.text[121] = 'ms]:\n';
|
||||
xajax.debug.text[122] = 'El servidor retorno el siguiente estado HTTP: ';
|
||||
xajax.debug.text[123] = '\nRECIBIDO:\n';
|
||||
xajax.debug.text[124] = 'El servidor retorno una redireccion a:<br />';
|
||||
xajax.debug.text[125] = 'HECHO [';
|
||||
xajax.debug.text[126] = 'ms]';
|
||||
xajax.debug.text[127] = 'INICIALIZANDO PETICION OBJETO';
|
||||
|
||||
xajax.debug.exceptions = [];
|
||||
xajax.debug.exceptions[10001] = 'Invalid response XML: La respuesta contiene una etiqueta desconocida: {data}.';
|
||||
xajax.debug.exceptions[10002] = 'GetRequestObject: XMLHttpRequest no disponible, xajax esta deshabilitado.';
|
||||
xajax.debug.exceptions[10003] = 'Queue overflow: No se puede colocar objeto en cola porque esta llena.';
|
||||
xajax.debug.exceptions[10004] = 'Invalid response XML: La respuesta contiene una etiqueta o texto inesperado: {data}.';
|
||||
xajax.debug.exceptions[10005] = 'Invalid request URI: URI invalida o perdida; autodeteccion fallida; por favor especifica una explicitamente.';
|
||||
xajax.debug.exceptions[10006] = 'Invalid response command: Orden de respuesta mal formado recibido.';
|
||||
xajax.debug.exceptions[10007] = 'Invalid response command: Comando [{data}] no es un comando conocido.';
|
||||
xajax.debug.exceptions[10008] = 'Elemento con ID [{data}] no encontrado en el documento.';
|
||||
xajax.debug.exceptions[10009] = 'Invalid request: Nombre parametro de funcion perdido.';
|
||||
xajax.debug.exceptions[10010] = 'Invalid request: Objeto parametro de funcion perdido.';
|
||||
}
|
||||
|
||||
if ('undefined' != typeof xajax.config) {
|
||||
if ('undefined' != typeof xajax.config.status) {
|
||||
/*
|
||||
Object: update
|
||||
*/
|
||||
xajax.config.status.update = function() {
|
||||
return {
|
||||
onRequest: function() {
|
||||
window.status = 'Enviando Peticion...';
|
||||
},
|
||||
onWaiting: function() {
|
||||
window.status = 'Esperando Respuesta...';
|
||||
},
|
||||
onProcessing: function() {
|
||||
window.status = 'Procesando...';
|
||||
},
|
||||
onComplete: function() {
|
||||
window.status = 'Hecho.';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
8
lib/xajax/xajax_js/xajax_lang_fr.js
Executable file
|
@ -0,0 +1,8 @@
|
|||
xajax.debug.text=[];xajax.debug.text[100]='ATTENTION : ';xajax.debug.text[101]='ERREUR : ';xajax.debug.text[102]='MESSAGE DE DEBUG XAJAX :\n';xajax.debug.text[103]='...\n[RÉPONSE LONGUE]\n...';xajax.debug.text[104]='ENVOI DE LA REQUÊTE';xajax.debug.text[105]='ENVOYÉ [';xajax.debug.text[106]=' octets]';xajax.debug.text[107]='APPEL : ';xajax.debug.text[108]='URI : ';xajax.debug.text[109]='INITIALISATION DE LA REQUÊTE';xajax.debug.text[110]='TRAITEMENT DES PARAMÈTRES [';xajax.debug.text[111]=']';xajax.debug.text[112]='AUCUN PARAMÈTRE À TRAITER';xajax.debug.text[113]='PRÉPARATION DE LA REQUÊTE';xajax.debug.text[114]='DÉBUT DE L\'APPEL XAJAX (déprécié: utilisez plutôt xajax.request)';xajax.debug.text[115]='DÉBUT DE LA REQUÊTE';xajax.debug.text[116]='Aucun traitement disponible pour traiter la réponse du serveur.\n';xajax.debug.text[117]='.\nVérifie s\'il existe des messages d\'erreur du serveur.';xajax.debug.text[118]='REÇUS [statut : ';xajax.debug.text[119]=', taille: ';xajax.debug.text[120]=' octets, temps: ';xajax.debug.text[121]='ms] :\n';xajax.debug.text[122]='Le serveur a retourné la statut HTTP suivant : ';xajax.debug.text[123]='\nREÇUS :\n';xajax.debug.text[124]='Le serveur a indiqué une redirection vers :<br />';xajax.debug.text[125]='FAIT [';xajax.debug.text[126]='ms]';xajax.debug.text[127]='INITIALISATION DE L\'OBJET REQUÊTE';xajax.debug.exceptions=[];xajax.debug.exceptions[10001]='Réponse XML non valide : La réponse contient une balise inconnue : {data}.';xajax.debug.exceptions[10002]='GetRequestObject : XMLHttpRequest n\'est pas disponible, xajax est désactivé.';xajax.debug.exceptions[10003]='File pleine : Ne peut ajouter un objet à la file car elle est pleine.';xajax.debug.exceptions[10004]='Réponse XML non valide : La réponse contient une balise ou un texte inattendu : {data}.';xajax.debug.exceptions[10005]='URI de la requête non valide : URI non valide ou manquante; auto-détection échouée; veuillez en spécifier une explicitement.';xajax.debug.exceptions[10006]='Réponse de commande invalide : Commande de réponse reçue mal formée.';xajax.debug.exceptions[10007]='Réponse de commande invalide : Commande [{data}] est inconnue.';xajax.debug.exceptions[10008]='L\'élément d\'ID [{data}] est introuvable dans le document.';xajax.debug.exceptions[10009]='Requête invalide : Aucun nom de fonction indiqué en paramètre.';xajax.debug.exceptions[10010]='Requête invalide : Aucun objet indiqué en paramètre pour la fonction.';if('undefined'!=typeof xajax.config){if('undefined'!=typeof xajax.config.status){xajax.config.status.update=function(){return{onRequest:function(){window.status='Envoi de la requête...';},
|
||||
onWaiting:function(){window.status='Attente de la réponse...';},
|
||||
onProcessing:function(){window.status='En cours de traitement...';},
|
||||
onComplete:function(){window.status='Fait.';}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
65
lib/xajax/xajax_js/xajax_lang_fr_uncompressed.js
Executable file
|
@ -0,0 +1,65 @@
|
|||
xajax.debug.text = [];
|
||||
xajax.debug.text[100] = 'ATTENTION : ';
|
||||
xajax.debug.text[101] = 'ERREUR : ';
|
||||
xajax.debug.text[102] = 'MESSAGE DE DEBUG XAJAX :\n';
|
||||
xajax.debug.text[103] = '...\n[R<>PONSE LONGUE]\n...';
|
||||
xajax.debug.text[104] = 'ENVOI DE LA REQU<51>TE';
|
||||
xajax.debug.text[105] = 'ENVOY<4F> [';
|
||||
xajax.debug.text[106] = ' octets]';
|
||||
xajax.debug.text[107] = 'APPEL : ';
|
||||
xajax.debug.text[108] = 'URI : ';
|
||||
xajax.debug.text[109] = 'INITIALISATION DE LA REQU<51>TE';
|
||||
xajax.debug.text[110] = 'TRAITEMENT DES PARAM<41>TRES [';
|
||||
xajax.debug.text[111] = ']';
|
||||
xajax.debug.text[112] = 'AUCUN PARAM<41>TRE <20> TRAITER';
|
||||
xajax.debug.text[113] = 'PR<50>PARATION DE LA REQU<51>TE';
|
||||
xajax.debug.text[114] = 'D<>BUT DE L\'APPEL XAJAX (d<>pr<70>ci<63>: utilisez plut<75>t xajax.request)';
|
||||
xajax.debug.text[115] = 'D<>BUT DE LA REQU<51>TE';
|
||||
xajax.debug.text[116] = 'Aucun traitement disponible pour traiter la r<>ponse du serveur.\n';
|
||||
xajax.debug.text[117] = '.\nV<6E>rifie s\'il existe des messages d\'erreur du serveur.';
|
||||
xajax.debug.text[118] = 'RE<52>US [statut : ';
|
||||
xajax.debug.text[119] = ', taille: ';
|
||||
xajax.debug.text[120] = ' octets, temps: ';
|
||||
xajax.debug.text[121] = 'ms] :\n';
|
||||
xajax.debug.text[122] = 'Le serveur a retourn<72> la statut HTTP suivant : ';
|
||||
xajax.debug.text[123] = '\nRE<52>US :\n';
|
||||
xajax.debug.text[124] = 'Le serveur a indiqu<71> une redirection vers :<br />';
|
||||
xajax.debug.text[125] = 'FAIT [';
|
||||
xajax.debug.text[126] = 'ms]';
|
||||
xajax.debug.text[127] = 'INITIALISATION DE L\'OBJET REQU<51>TE';
|
||||
|
||||
xajax.debug.exceptions = [];
|
||||
xajax.debug.exceptions[10001] = 'R<>ponse XML non valide : La r<>ponse contient une balise inconnue : {data}.';
|
||||
xajax.debug.exceptions[10002] = 'GetRequestObject : XMLHttpRequest n\'est pas disponible, xajax est d<>sactiv<69>.';
|
||||
xajax.debug.exceptions[10003] = 'File pleine : Ne peut ajouter un objet <20> la file car elle est pleine.';
|
||||
xajax.debug.exceptions[10004] = 'R<>ponse XML non valide : La r<>ponse contient une balise ou un texte inattendu : {data}.';
|
||||
xajax.debug.exceptions[10005] = 'URI de la requ<71>te non valide : URI non valide ou manquante; auto-d<>tection <20>chou<6F>e; veuillez en sp<73>cifier une explicitement.';
|
||||
xajax.debug.exceptions[10006] = 'R<>ponse de commande invalide : Commande de r<>ponse re<72>ue mal form<72>e.';
|
||||
xajax.debug.exceptions[10007] = 'R<>ponse de commande invalide : Commande [{data}] est inconnue.';
|
||||
xajax.debug.exceptions[10008] = 'L\'<27>l<EFBFBD>ment d\'ID [{data}] est introuvable dans le document.';
|
||||
xajax.debug.exceptions[10009] = 'Requ<71>te invalide : Aucun nom de fonction indiqu<71> en param<61>tre.';
|
||||
xajax.debug.exceptions[10010] = 'Requ<71>te invalide : Aucun objet indiqu<71> en param<61>tre pour la fonction.';
|
||||
|
||||
if ('undefined' != typeof xajax.config) {
|
||||
if ('undefined' != typeof xajax.config.status) {
|
||||
/*
|
||||
Object: mise <EFBFBD> jour
|
||||
*/
|
||||
xajax.config.status.update = function() {
|
||||
return {
|
||||
onRequest: function() {
|
||||
window.status = 'Envoi de la requ<71>te...';
|
||||
},
|
||||
onWaiting: function() {
|
||||
window.status = 'Attente de la r<>ponse...';
|
||||
},
|
||||
onProcessing: function() {
|
||||
window.status = 'En cours de traitement...';
|
||||
},
|
||||
onComplete: function() {
|
||||
window.status = 'Fait.';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
9
lib/xajax/xajax_js/xajax_lang_nl.js
Executable file
|
@ -0,0 +1,9 @@
|
|||
if('undefined'!=typeof xajax.debug){xajax.debug.text=[];xajax.debug.text[100]='FOUTMELDING: ';xajax.debug.text[101]='FOUT: ';xajax.debug.text[102]='XAJAX FOUTMELDINGS BERICHT:\n';xajax.debug.text[103]='...\n[LANG ANTWOORD]\n...';xajax.debug.text[104]='VERZENDING AANVRAAG';xajax.debug.text[105]='VERZONDEN [';xajax.debug.text[106]=' bytes]';xajax.debug.text[107]='AANROEPING: ';xajax.debug.text[108]='URI: ';xajax.debug.text[109]='INITIALISATIE AANVRAAG';xajax.debug.text[110]='VERWERKING PARAMETERS [';xajax.debug.text[111]=']';xajax.debug.text[112]='GEEN PARAMETERS OM TE VERWERKEN';xajax.debug.text[113]='VOORBEREIDING AANVRAAG';xajax.debug.text[114]='BEGIN XAJAX AANVRAAG (verouderd: gebruik xajax.request)';xajax.debug.text[115]='BEGIN XAJAX AANVRAAG';xajax.debug.text[116]='Er is geen verwerkingsbestand gespecificeerd om de aanvraag te verwerken.\n';xajax.debug.text[117]='.\nBekijk foutmeldingen van de server.';xajax.debug.text[118]='ONTVANGEN [status: ';xajax.debug.text[119]=', omvang: ';xajax.debug.text[120]=' bytes, Zeit: ';xajax.debug.text[121]='ms]:\n';xajax.debug.text[122]='De server retourneert de volgende HTTP-status: ';xajax.debug.text[123]='\nONTVANGEN:\n';xajax.debug.text[124]='De server retourneert een doorverwijzing naar:<br />';xajax.debug.text[125]='KLAAR [';xajax.debug.text[126]='ms]';xajax.debug.text[127]='INITIALISATIE OBJECT AANVRAAG';xajax.debug.exceptions=[];xajax.debug.exceptions[10001]='Ongeldig XML-antwoord: het antwoord bevat een onbekende tag: {data}.';xajax.debug.exceptions[10002]='GetRequestObject: XMLHttpRequest is niet beschikbaar, XajaX is uitgeschakeld.';xajax.debug.exceptions[10003]='Wachtrij limiet overschreden: kan het object niet in de wachtrij plaatsen, omdat die vol is.';xajax.debug.exceptions[10004]='Ongeldig XML-antwoord: het antwoord bevat een onverwachte tag of tekst: {data}.';xajax.debug.exceptions[10005]='Ongeldige Request-URI: Ongeldige of ontbrekende URI; automatische detectie faalt; specificeer een URI expliciet.';xajax.debug.exceptions[10006]='Ongeldig antwoord bevel: misvormd antwoord bevel ontvangen.';xajax.debug.exceptions[10007]='Ongeldig antwoord bevel: Bevel [{data}] is niet bekend.';xajax.debug.exceptions[10008]='Element met het ID [{data}] kon niet in het document worden gevonden.';xajax.debug.exceptions[10009]='Ongeldige aanvraag: Missende functie parameter - naam.';xajax.debug.exceptions[10010]='Ongeldige aanvraag: Missende functie parameter - object.';}
|
||||
if('undefined'!=typeof xajax.config){if('undefined'!=typeof xajax.config.status){xajax.config.status.update=function(){return{onRequest:function(){window.status="Verzenden aanvraag...";},
|
||||
onWaiting:function(){window.status="Wachten op antwoord...";},
|
||||
onProcessing:function(){window.status="Verwerking...";},
|
||||
onComplete:function(){window.status="Afgesloten.";}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
84
lib/xajax/xajax_js/xajax_lang_nl_uncompressed.js
Executable file
|
@ -0,0 +1,84 @@
|
|||
/**
|
||||
* translation for: xajax v.x.x
|
||||
* @version: 1.0.0
|
||||
* @author: jeffrey <walkingsoul@gmail.com>
|
||||
* @copyright xajax project
|
||||
* @license GNU/GPL
|
||||
* @package xajax x.x.x
|
||||
* @since v.x.x.x
|
||||
* save as UTF-8
|
||||
*/
|
||||
|
||||
if ('undefined' != typeof xajax.debug) {
|
||||
/*
|
||||
Array: text
|
||||
*/
|
||||
xajax.debug.text = [];
|
||||
xajax.debug.text[100] = 'FOUTMELDING: ';
|
||||
xajax.debug.text[101] = 'FOUT: ';
|
||||
xajax.debug.text[102] = 'XAJAX FOUTMELDINGS BERICHT:\n';
|
||||
xajax.debug.text[103] = '...\n[LANG ANTWOORD]\n...';
|
||||
xajax.debug.text[104] = 'VERZENDING AANVRAAG';
|
||||
xajax.debug.text[105] = 'VERZONDEN [';
|
||||
xajax.debug.text[106] = ' bytes]';
|
||||
xajax.debug.text[107] = 'AANROEPING: ';
|
||||
xajax.debug.text[108] = 'URI: ';
|
||||
xajax.debug.text[109] = 'INITIALISATIE AANVRAAG';
|
||||
xajax.debug.text[110] = 'VERWERKING PARAMETERS [';
|
||||
xajax.debug.text[111] = ']';
|
||||
xajax.debug.text[112] = 'GEEN PARAMETERS OM TE VERWERKEN';
|
||||
xajax.debug.text[113] = 'VOORBEREIDING AANVRAAG';
|
||||
xajax.debug.text[114] = 'BEGIN XAJAX AANVRAAG (verouderd: gebruik xajax.request)';
|
||||
xajax.debug.text[115] = 'BEGIN XAJAX AANVRAAG';
|
||||
xajax.debug.text[116] = 'Er is geen verwerkingsbestand gespecificeerd om de aanvraag te verwerken.\n';
|
||||
xajax.debug.text[117] = '.\nBekijk foutmeldingen van de server.';
|
||||
xajax.debug.text[118] = 'ONTVANGEN [status: ';
|
||||
xajax.debug.text[119] = ', omvang: ';
|
||||
xajax.debug.text[120] = ' bytes, Zeit: ';
|
||||
xajax.debug.text[121] = 'ms]:\n';
|
||||
xajax.debug.text[122] = 'De server retourneert de volgende HTTP-status: ';
|
||||
xajax.debug.text[123] = '\nONTVANGEN:\n';
|
||||
xajax.debug.text[124] = 'De server retourneert een doorverwijzing naar:<br />';
|
||||
xajax.debug.text[125] = 'KLAAR [';
|
||||
xajax.debug.text[126] = 'ms]';
|
||||
xajax.debug.text[127] = 'INITIALISATIE OBJECT AANVRAAG';
|
||||
|
||||
/*
|
||||
Array: exceptions
|
||||
*/
|
||||
xajax.debug.exceptions = [];
|
||||
xajax.debug.exceptions[10001] = 'Ongeldig XML-antwoord: het antwoord bevat een onbekende tag: {data}.';
|
||||
xajax.debug.exceptions[10002] = 'GetRequestObject: XMLHttpRequest is niet beschikbaar, XajaX is uitgeschakeld.';
|
||||
xajax.debug.exceptions[10003] = 'Wachtrij limiet overschreden: kan het object niet in de wachtrij plaatsen, omdat die vol is.';
|
||||
xajax.debug.exceptions[10004] = 'Ongeldig XML-antwoord: het antwoord bevat een onverwachte tag of tekst: {data}.';
|
||||
xajax.debug.exceptions[10005] = 'Ongeldige Request-URI: Ongeldige of ontbrekende URI; automatische detectie faalt; specificeer een URI expliciet.';
|
||||
xajax.debug.exceptions[10006] = 'Ongeldig antwoord bevel: misvormd antwoord bevel ontvangen.';
|
||||
xajax.debug.exceptions[10007] = 'Ongeldig antwoord bevel: Bevel [{data}] is niet bekend.';
|
||||
xajax.debug.exceptions[10008] = 'Element met het ID [{data}] kon niet in het document worden gevonden.';
|
||||
xajax.debug.exceptions[10009] = 'Ongeldige aanvraag: Missende functie parameter - naam.';
|
||||
xajax.debug.exceptions[10010] = 'Ongeldige aanvraag: Missende functie parameter - object.';
|
||||
}
|
||||
|
||||
if ('undefined' != typeof xajax.config) {
|
||||
if ('undefined' != typeof xajax.config.status) {
|
||||
/*
|
||||
Object: update
|
||||
*/
|
||||
xajax.config.status.update = function() {
|
||||
return {
|
||||
onRequest: function() {
|
||||
window.status = "Verzenden aanvraag...";
|
||||
},
|
||||
onWaiting: function() {
|
||||
window.status = "Wachten op antwoord...";
|
||||
},
|
||||
onProcessing: function() {
|
||||
window.status = "Verwerking...";
|
||||
},
|
||||
onComplete: function() {
|
||||
window.status = "Afgesloten.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
10
lib/xajax/xajax_js/xajax_lang_tr.js
Executable file
|
@ -0,0 +1,10 @@
|
|||
|
||||
if('undefined'!=typeof xajax.debug){xajax.debug.text=[];xajax.debug.text[100]='IKAZ: ';xajax.debug.text[101]='HATA: ';xajax.debug.text[102]='XAJAX DEBUG (HATA AYIKLAMASI) MESAJI:\n';xajax.debug.text[103]='...\n[UZUN YANIT]\n...';xajax.debug.text[104]='ISTEK GÖNDERILIYOR';xajax.debug.text[105]='GÖNDERILDI [';xajax.debug.text[106]=' byte]';xajax.debug.text[107]='ÇAGIRILIYOR: ';xajax.debug.text[108]='URI: ';xajax.debug.text[109]='ISTEK BASLATILIYOR';xajax.debug.text[110]='PARAMETRELER ISLENIYOR [';xajax.debug.text[111]=']';xajax.debug.text[112]='ISLENECEK PARAMETRE YOK';xajax.debug.text[113]='ISTEK HAZIRLANIYOR';xajax.debug.text[114]='XAJAX ÇAGRISI BASLATILIYOR (kullanimi tavsiye edilmiyor: yerine xajax.request kullanin)';xajax.debug.text[115]='XAJAX ISTEGI BASLATILIYOR';xajax.debug.text[116]='Sunucudan gelen cevabi isleyecek cevap islemcisi yok.\n';xajax.debug.text[117]='.\nSunucudan gelen hata mesajlarini kontrol edin.';xajax.debug.text[118]='ALINDI [durum: ';xajax.debug.text[119]=', boyut: ';xajax.debug.text[120]=' byte, süre: ';xajax.debug.text[121]='ms]:\n';xajax.debug.text[122]='Sunucu asagidaki HTTP durumunu gönderdi: ';xajax.debug.text[123]='\nALINDI:\n';xajax.debug.text[124]='Sunucu su adrese yönlendirme istegi gönderdi :<br />';xajax.debug.text[125]='TAMAMLANDI [';xajax.debug.text[126]='ms]';xajax.debug.text[127]='ISTEK NESNESI BASLATILIYOR';xajax.debug.exceptions=[];xajax.debug.exceptions[10001]='Geçersiz XML cevabi: Cevap bilinmeyen bir etiket tasiyor: {data}.';xajax.debug.exceptions[10002]='GetRequestObject: XMLHttpRequest hazir degil, xajax nesnesi etkisizlestirildi.';xajax.debug.exceptions[10003]='Islem kuyrugu fazla yüklendi: Kuyruk dolu oldugu için nesne kuyruga eklenemiyor.';xajax.debug.exceptions[10004]='Geçersiz XML cevabi: Cevap bilinmeyen bir etiket veya metin tasiyor: {data}.';xajax.debug.exceptions[10005]='Geçersiz istek URI: Geçersiz veya kayip URI; otomatik tespit yapilamadi; lütfen açikça bir tane belirleyiniz.';xajax.debug.exceptions[10006]='Geçersiz cevap komutu: Bozulmus cevap komutu alindi.';xajax.debug.exceptions[10007]='Geçersiz cevap komutu: [{data}] komutu bilinmiyor.';xajax.debug.exceptions[10008]='[{data}] ID li element dosya içinde bulunamadi.';xajax.debug.exceptions[10009]='Geçersiz istek: Fonksiyon isim parametresi eksik.';xajax.debug.exceptions[10010]='Geçersiz istek: Fonksiyon nesne parametresi eksik.';}
|
||||
if('undefined'!=typeof xajax.config){if('undefined'!=typeof xajax.config.status){xajax.config.status.update=function(){return{onRequest:function(){window.status='İstek Gönderiliyor...';},
|
||||
onWaiting:function(){window.status='Cevap Bekleniyor...';},
|
||||
onProcessing:function(){window.status='İşlem Devam Ediyor...';},
|
||||
onComplete:function(){window.status='Tamamlandı.';}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
82
lib/xajax/xajax_js/xajax_lang_tr_uncompressed.js
Executable file
|
@ -0,0 +1,82 @@
|
|||
/**
|
||||
* translation for: xajax v.x.x
|
||||
* @version: 1.0.0
|
||||
* @author: mic <info@joomx.com>
|
||||
* @copyright xajax project
|
||||
* @license GNU/GPL
|
||||
* @package xajax x.x.x
|
||||
* @since v.x.x.x
|
||||
* save as UTF-8
|
||||
*/
|
||||
|
||||
if ('undefined' != typeof xajax.debug) {
|
||||
|
||||
xajax.debug.text = [];
|
||||
xajax.debug.text[100] = 'IKAZ: ';
|
||||
xajax.debug.text[101] = 'HATA: ';
|
||||
xajax.debug.text[102] = 'XAJAX DEBUG (HATA AYIKLAMASI) MESAJI:\n';
|
||||
xajax.debug.text[103] = '...\n[UZUN YANIT]\n...';
|
||||
xajax.debug.text[104] = 'ISTEK GÖNDERILIYOR';
|
||||
xajax.debug.text[105] = 'GÖNDERILDI [';
|
||||
xajax.debug.text[106] = ' byte]';
|
||||
xajax.debug.text[107] = 'ÇAGIRILIYOR: ';
|
||||
xajax.debug.text[108] = 'URI: ';
|
||||
xajax.debug.text[109] = 'ISTEK BASLATILIYOR';
|
||||
xajax.debug.text[110] = 'PARAMETRELER ISLENIYOR [';
|
||||
xajax.debug.text[111] = ']';
|
||||
xajax.debug.text[112] = 'ISLENECEK PARAMETRE YOK';
|
||||
xajax.debug.text[113] = 'ISTEK HAZIRLANIYOR';
|
||||
xajax.debug.text[114] = 'XAJAX ÇAGRISI BASLATILIYOR (kullanimi tavsiye edilmiyor: yerine xajax.request kullanin)';
|
||||
xajax.debug.text[115] = 'XAJAX ISTEGI BASLATILIYOR';
|
||||
xajax.debug.text[116] = 'Sunucudan gelen cevabi isleyecek cevap islemcisi yok.\n';
|
||||
xajax.debug.text[117] = '.\nSunucudan gelen hata mesajlarini kontrol edin.';
|
||||
xajax.debug.text[118] = 'ALINDI [durum: ';
|
||||
xajax.debug.text[119] = ', boyut: ';
|
||||
xajax.debug.text[120] = ' byte, süre: ';
|
||||
xajax.debug.text[121] = 'ms]:\n';
|
||||
xajax.debug.text[122] = 'Sunucu asagidaki HTTP durumunu gönderdi: ';
|
||||
xajax.debug.text[123] = '\nALINDI:\n';
|
||||
xajax.debug.text[124] = 'Sunucu su adrese yönlendirme istegi gönderdi :<br />';
|
||||
xajax.debug.text[125] = 'TAMAMLANDI [';
|
||||
xajax.debug.text[126] = 'ms]';
|
||||
xajax.debug.text[127] = 'ISTEK NESNESI BASLATILIYOR';
|
||||
|
||||
/*
|
||||
Array: exceptions
|
||||
*/
|
||||
xajax.debug.exceptions = [];
|
||||
xajax.debug.exceptions[10001] = 'Geçersiz XML cevabi: Cevap bilinmeyen bir etiket tasiyor: {data}.';
|
||||
xajax.debug.exceptions[10002] = 'GetRequestObject: XMLHttpRequest hazir degil, xajax nesnesi etkisizlestirildi.';
|
||||
xajax.debug.exceptions[10003] = 'Islem kuyrugu fazla yüklendi: Kuyruk dolu oldugu için nesne kuyruga eklenemiyor.';
|
||||
xajax.debug.exceptions[10004] = 'Geçersiz XML cevabi: Cevap bilinmeyen bir etiket veya metin tasiyor: {data}.';
|
||||
xajax.debug.exceptions[10005] = 'Geçersiz istek URI: Geçersiz veya kayip URI; otomatik tespit yapilamadi; lütfen açikça bir tane belirleyiniz.';
|
||||
xajax.debug.exceptions[10006] = 'Geçersiz cevap komutu: Bozulmus cevap komutu alindi.';
|
||||
xajax.debug.exceptions[10007] = 'Geçersiz cevap komutu: [{data}] komutu bilinmiyor.';
|
||||
xajax.debug.exceptions[10008] = '[{data}] ID li element dosya içinde bulunamadi.';
|
||||
xajax.debug.exceptions[10009] = 'Geçersiz istek: Fonksiyon isim parametresi eksik.';
|
||||
xajax.debug.exceptions[10010] = 'Geçersiz istek: Fonksiyon nesne parametresi eksik.';
|
||||
}
|
||||
|
||||
if ('undefined' != typeof xajax.config) {
|
||||
if ('undefined' != typeof xajax.config.status) {
|
||||
/*
|
||||
Object: update
|
||||
*/
|
||||
xajax.config.status.update = function() {
|
||||
return {
|
||||
onRequest: function() {
|
||||
window.status = 'İstek Gönderiliyor...';
|
||||
},
|
||||
onWaiting: function() {
|
||||
window.status = 'Cevap Bekleniyor...';
|
||||
},
|
||||
onProcessing: function() {
|
||||
window.status = 'İşlem Devam Ediyor...';
|
||||
},
|
||||
onComplete: function() {
|
||||
window.status = 'Tamamlandı.';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
14
lib/xajax/xajax_js/xajax_legacy.js
Executable file
|
@ -0,0 +1,14 @@
|
|||
|
||||
try{if('undefined'==typeof xajax)
|
||||
throw{name:'SequenceError',message:'Error: xajax core was not detected, legacy module disabled.'}
|
||||
if('undefined'==typeof xajax.legacy)
|
||||
xajax.legacy={}
|
||||
xajax.legacy.call=xajax.call;xajax.call=function(sFunction,objParameters){var oOpt={}
|
||||
oOpt.parameters=objParameters;if(undefined!=xajax.loadingFunction){if(undefined==oOpt.callback)
|
||||
oOpt.callback={}
|
||||
oOpt.callback.onResponseDelay=xajax.loadingFunction;}
|
||||
if(undefined!=xajax.doneLoadingFunction){if(undefined==oOpt.callback)
|
||||
oOpt.callback={}
|
||||
oOpt.callback.onComplete=xajax.doneLoadingFunction;}
|
||||
return xajax.legacy.call(sFunction,oOpt);}
|
||||
xajax.legacy.isLoaded=true;}catch(e){alert(e.name+': '+e.message);}
|
69
lib/xajax/xajax_js/xajax_legacy_uncompressed.js
Executable file
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
File: xajax_legacy.js
|
||||
|
||||
Provides support for legacy scripts that have not been updated to the
|
||||
latest syntax.
|
||||
|
||||
Title: xajax legacy support module
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajax_legacy_uncompressed.php 327 2007-02-28 16:55:26Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
try
|
||||
{
|
||||
/*
|
||||
Class: xajax.legacy
|
||||
*/
|
||||
if ('undefined' == typeof xajax)
|
||||
throw { name: 'SequenceError', message: 'Error: xajax core was not detected, legacy module disabled.' }
|
||||
|
||||
if ('undefined' == typeof xajax.legacy)
|
||||
xajax.legacy = {}
|
||||
|
||||
/*
|
||||
Function: xajax.legacy.call
|
||||
|
||||
Convert call parameters from the 0.2.x syntax to the new *improved*
|
||||
call format.
|
||||
|
||||
Parameters:
|
||||
sFunction - (string): Registered PHP Functionname to be called
|
||||
objParametes - (object): Paramter object for the request.
|
||||
|
||||
This is a wrapper function around the standard <xajax.call> function.
|
||||
*/
|
||||
xajax.legacy.call = xajax.call;
|
||||
xajax.call = function(sFunction, objParameters) {
|
||||
var oOpt = {}
|
||||
oOpt.parameters = objParameters;
|
||||
if (undefined != xajax.loadingFunction) {
|
||||
if (undefined == oOpt.callback)
|
||||
oOpt.callback = {}
|
||||
oOpt.callback.onResponseDelay = xajax.loadingFunction;
|
||||
}
|
||||
if (undefined != xajax.doneLoadingFunction) {
|
||||
if (undefined == oOpt.callback)
|
||||
oOpt.callback = {}
|
||||
oOpt.callback.onComplete = xajax.doneLoadingFunction;
|
||||
}
|
||||
return xajax.legacy.call(sFunction, oOpt);
|
||||
}
|
||||
|
||||
/*
|
||||
Boolean: isLoaded
|
||||
|
||||
true - Indicates that the <xajax.legacy> module is loaded.
|
||||
*/
|
||||
xajax.legacy.isLoaded = true;
|
||||
} catch (e) {
|
||||
alert(e.name + ': ' + e.message);
|
||||
}
|
18
lib/xajax/xajax_js/xajax_verbose.js
Executable file
|
@ -0,0 +1,18 @@
|
|||
|
||||
try{if('undefined'==typeof xajax)
|
||||
throw{name:'SequenceError',message:'Error: xajax core was not detected, verbose module disabled.'}
|
||||
if('undefined'==typeof xajax.debug)
|
||||
throw{name:'SequenceError',message:'Error: xajax debugger was not detected, verbose module disabled.'}
|
||||
xajax.debug.verbose={}
|
||||
xajax.debug.verbose.expandObject=function(obj){var rec=true;if(1 < arguments.length)
|
||||
rec=arguments[1];if('function'==typeof(obj)){return '[Function]';}else if('object'==typeof(obj)){if(true==rec){var t=' { ';var separator='';for(var m in obj){t+=separator;t+=m;t+=': ';try{t+=xajax.debug.verbose.expandObject(obj[m],false);}catch(e){t+='[n/a]';}
|
||||
separator=', ';}
|
||||
t+=' } ';return t;}else return '[Object]';}else return '"'+obj+'"';}
|
||||
xajax.debug.verbose.makeFunction=function(obj,name){return function(){var fun=name;fun+='(';var separator='';var pLen=arguments.length;for(var p=0;p < pLen;++p){fun+=separator;fun+=xajax.debug.verbose.expandObject(arguments[p]);separator=',';}
|
||||
fun+=');';var msg='--> ';msg+=fun;xajax.debug.writeMessage(msg);var returnValue=true;var code='returnValue = obj(';separator='';for(var p=0;p < pLen;++p){code+=separator;code+='arguments['+p+']';separator=',';}
|
||||
code+=');';eval(code);msg='<-- ';msg+=fun;msg+=' returns ';msg+=xajax.debug.verbose.expandObject(returnValue);xajax.debug.writeMessage(msg);return returnValue;}
|
||||
}
|
||||
xajax.debug.verbose.hook=function(x,base){for(var m in x){if('function'==typeof(x[m])){x[m]=xajax.debug.verbose.makeFunction(x[m],base+m);}
|
||||
}
|
||||
}
|
||||
xajax.debug.verbose.hook(xajax,'xajax.');xajax.debug.verbose.hook(xajax.callback,'xajax.callback.');xajax.debug.verbose.hook(xajax.css,'xajax.css.');xajax.debug.verbose.hook(xajax.dom,'xajax.dom.');xajax.debug.verbose.hook(xajax.events,'xajax.events.');xajax.debug.verbose.hook(xajax.forms,'xajax.forms.');xajax.debug.verbose.hook(xajax.js,'xajax.js.');xajax.debug.verbose.hook(xajax.tools,'xajax.tools.');xajax.debug.verbose.hook(xajax.tools.queue,'xajax.tools.queue.');xajax.debug.verbose.hook(xajax.command,'xajax.command.');xajax.debug.verbose.hook(xajax.command.handler,'xajax.command.handler.');xajax.debug.verbose.isLoaded=true;}catch(e){alert(e.name+': '+e.message);}
|
176
lib/xajax/xajax_js/xajax_verbose_uncompressed.js
Executable file
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
File: xajax_verbose.js
|
||||
|
||||
The xajax verbose debugging module. This is an optional module, include in
|
||||
your project with care. :)
|
||||
|
||||
Title: xajax verbose debugging module
|
||||
|
||||
Please see <copyright.inc.php> for a detailed description, copyright
|
||||
and license information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@package xajax
|
||||
@version $Id: xajax_verbose_uncompressed 327 2007-02-28 16:55:26Z calltoconstruct $
|
||||
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
|
||||
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
|
||||
@license http://www.xajaxproject.org/bsd_license.txt BSD License
|
||||
*/
|
||||
|
||||
try {
|
||||
if ('undefined' == typeof xajax)
|
||||
throw { name: 'SequenceError', message: 'Error: xajax core was not detected, verbose module disabled.' }
|
||||
if ('undefined' == typeof xajax.debug)
|
||||
throw { name: 'SequenceError', message: 'Error: xajax debugger was not detected, verbose module disabled.' }
|
||||
|
||||
/*
|
||||
Class: xajax.debug.verbose
|
||||
|
||||
Provide a high level of detail which can be used to debug hard to find
|
||||
problems.
|
||||
*/
|
||||
xajax.debug.verbose = {}
|
||||
|
||||
/*
|
||||
Function: xajax.debug.verbose.expandObject
|
||||
|
||||
Generate a debug message expanding all the first level
|
||||
members found therein.
|
||||
|
||||
|
||||
Parameters:
|
||||
|
||||
obj - (object): The object to be enumerated.
|
||||
|
||||
Returns:
|
||||
|
||||
string - The textual representation of all the first
|
||||
level members.
|
||||
*/
|
||||
xajax.debug.verbose.expandObject = function(obj) {
|
||||
var rec = true;
|
||||
if (1 < arguments.length)
|
||||
rec = arguments[1];
|
||||
if ('function' == typeof (obj)) {
|
||||
return '[Function]';
|
||||
} else if ('object' == typeof (obj)) {
|
||||
if (true == rec) {
|
||||
var t = ' { ';
|
||||
var separator = '';
|
||||
for (var m in obj) {
|
||||
t += separator;
|
||||
t += m;
|
||||
t += ': ';
|
||||
try {
|
||||
t += xajax.debug.verbose.expandObject(obj[m], false);
|
||||
} catch (e) {
|
||||
t += '[n/a]';
|
||||
}
|
||||
separator = ', ';
|
||||
}
|
||||
t += ' } ';
|
||||
return t;
|
||||
} else return '[Object]';
|
||||
} else return '"' + obj + '"';
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.debug.verbose.makeFunction
|
||||
|
||||
Generate a wrapper function around the specified function.
|
||||
|
||||
Parameters:
|
||||
|
||||
obj - (object): The object that contains the function to be
|
||||
wrapped.
|
||||
name - (string): The name of the function to be wrapped.
|
||||
|
||||
Returns:
|
||||
|
||||
function - The wrapper function.
|
||||
*/
|
||||
xajax.debug.verbose.makeFunction = function(obj, name) {
|
||||
return function() {
|
||||
var fun = name;
|
||||
fun += '(';
|
||||
|
||||
var separator = '';
|
||||
var pLen = arguments.length;
|
||||
for (var p = 0; p < pLen; ++p) {
|
||||
fun += separator;
|
||||
fun += xajax.debug.verbose.expandObject(arguments[p]);
|
||||
separator = ',';
|
||||
}
|
||||
|
||||
fun += ');';
|
||||
|
||||
var msg = '--> ';
|
||||
msg += fun;
|
||||
|
||||
xajax.debug.writeMessage(msg);
|
||||
|
||||
var returnValue = true;
|
||||
var code = 'returnValue = obj(';
|
||||
separator = '';
|
||||
for (var p = 0; p < pLen; ++p) {
|
||||
code += separator;
|
||||
code += 'arguments[' + p + ']';
|
||||
separator = ',';
|
||||
}
|
||||
code += ');';
|
||||
|
||||
eval(code);
|
||||
|
||||
msg = '<-- ';
|
||||
msg += fun;
|
||||
msg += ' returns ';
|
||||
msg += xajax.debug.verbose.expandObject(returnValue);
|
||||
|
||||
xajax.debug.writeMessage(msg);
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: xajax.debug.verbose.hook
|
||||
|
||||
Generate a wrapper function around each of the functions
|
||||
contained within the specified object.
|
||||
|
||||
Parameters:
|
||||
|
||||
x - (object): The object to be scanned.
|
||||
base - (string): The base reference to be prepended to the
|
||||
generated wrapper functions.
|
||||
*/
|
||||
xajax.debug.verbose.hook = function(x, base) {
|
||||
for (var m in x) {
|
||||
if ('function' == typeof (x[m])) {
|
||||
x[m] = xajax.debug.verbose.makeFunction(x[m], base + m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xajax.debug.verbose.hook(xajax, 'xajax.');
|
||||
xajax.debug.verbose.hook(xajax.callback, 'xajax.callback.');
|
||||
xajax.debug.verbose.hook(xajax.css, 'xajax.css.');
|
||||
xajax.debug.verbose.hook(xajax.dom, 'xajax.dom.');
|
||||
xajax.debug.verbose.hook(xajax.events, 'xajax.events.');
|
||||
xajax.debug.verbose.hook(xajax.forms, 'xajax.forms.');
|
||||
xajax.debug.verbose.hook(xajax.js, 'xajax.js.');
|
||||
xajax.debug.verbose.hook(xajax.tools, 'xajax.tools.');
|
||||
xajax.debug.verbose.hook(xajax.tools.queue, 'xajax.tools.queue.');
|
||||
xajax.debug.verbose.hook(xajax.command, 'xajax.command.');
|
||||
xajax.debug.verbose.hook(xajax.command.handler, 'xajax.command.handler.');
|
||||
|
||||
/*
|
||||
Boolean: isLoaded
|
||||
|
||||
true - indicates that the verbose debugging module is loaded.
|
||||
*/
|
||||
xajax.debug.verbose.isLoaded = true;
|
||||
} catch (e) {
|
||||
alert(e.name + ': ' + e.message);
|
||||
}
|