Merge remote-tracking branch 'remotes/xinruo/select2'
This commit is contained in:
commit
615ae53d90
@ -108,8 +108,8 @@ instance Yesod App where
|
|||||||
addScript $ StaticR jquery_url_js
|
addScript $ StaticR jquery_url_js
|
||||||
addScript $ StaticR jquery_flot_js
|
addScript $ StaticR jquery_flot_js
|
||||||
toWidget [hamlet| \<!--[if lte IE 8]> <script type="text/javascript" src="@{StaticR excanvas_min_js}"></script> <![endif]--> |]
|
toWidget [hamlet| \<!--[if lte IE 8]> <script type="text/javascript" src="@{StaticR excanvas_min_js}"></script> <![endif]--> |]
|
||||||
addScript $ StaticR dhtmlxcommon_js
|
addScript $ StaticR select2_min_js
|
||||||
addScript $ StaticR dhtmlxcombo_js
|
addStylesheet $ StaticR select2_css
|
||||||
addStylesheet $ StaticR style_css
|
addStylesheet $ StaticR style_css
|
||||||
addScript $ StaticR hledger_js
|
addScript $ StaticR hledger_js
|
||||||
$(widgetFile "default-layout")
|
$(widgetFile "default-layout")
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import Text.Blaze (preEscapedString)
|
|||||||
import Text.Blaze.Internal (preEscapedString)
|
import Text.Blaze.Internal (preEscapedString)
|
||||||
#endif
|
#endif
|
||||||
import Text.Printf
|
import Text.Printf
|
||||||
|
import Text.JSON
|
||||||
|
|
||||||
import Hledger.Utils
|
import Hledger.Utils
|
||||||
import Hledger.Data
|
import Hledger.Data
|
||||||
@ -114,19 +115,27 @@ addform :: Text -> ViewData -> HtmlUrl AppRoute
|
|||||||
addform staticRootUrl vd@VD{..} = [hamlet|
|
addform staticRootUrl vd@VD{..} = [hamlet|
|
||||||
<script type=text/javascript>
|
<script type=text/javascript>
|
||||||
\$(document).ready(function() {
|
\$(document).ready(function() {
|
||||||
/* dhtmlxcombo setup */
|
/* select2 setup */
|
||||||
window.dhx_globalImgPath="#{staticRootUrl}/";
|
var param = {
|
||||||
var desccombo = new dhtmlXCombo("description");
|
"width": "250px",
|
||||||
var acct1combo = new dhtmlXCombo("account1");
|
"openOnEnter": false,
|
||||||
var acct2combo = new dhtmlXCombo("account2");
|
// createSearchChoice allows to create new values not in the options
|
||||||
desccombo.enableFilteringMode(true);
|
"createSearchChoice":function(term, data) {
|
||||||
acct1combo.enableFilteringMode(true);
|
if ( $(data).filter( function() {
|
||||||
acct2combo.enableFilteringMode(true);
|
return this.text.localeCompare(term)===0;
|
||||||
desccombo.setSize(300);
|
}).length===0) {
|
||||||
acct1combo.setSize(300);
|
return {text:term};
|
||||||
acct2combo.setSize(300);
|
}
|
||||||
/* desccombo.enableOptionAutoHeight(true, 20); */
|
},
|
||||||
/* desccombo.setOptionHeight(200); */
|
// id is what is passed during post
|
||||||
|
"id": function(object) {
|
||||||
|
return object.text;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
\$("#description").select2($.extend({}, param, {data: #{toSelectData descriptions} }));
|
||||||
|
var accountData = $.extend({}, param, {data: #{toSelectData acctnames} });
|
||||||
|
\$("#account1").select2(accountData);
|
||||||
|
\$("#account2").select2(accountData);
|
||||||
});
|
});
|
||||||
|
|
||||||
<form#addform method=POST style=display:none;>
|
<form#addform method=POST style=display:none;>
|
||||||
@ -143,10 +152,7 @@ addform staticRootUrl vd@VD{..} = [hamlet|
|
|||||||
<td style=padding-left:1em;>
|
<td style=padding-left:1em;>
|
||||||
Description:
|
Description:
|
||||||
<td>
|
<td>
|
||||||
<select id=description name=description>
|
<input type=hidden id=description name=description>
|
||||||
<option>
|
|
||||||
$forall d <- descriptions
|
|
||||||
<option value=#{d}>#{d}
|
|
||||||
<tr.helprow>
|
<tr.helprow>
|
||||||
<td>
|
<td>
|
||||||
<td>
|
<td>
|
||||||
@ -171,16 +177,16 @@ addform staticRootUrl vd@VD{..} = [hamlet|
|
|||||||
deschelp = "eg: supermarket (optional)" :: String
|
deschelp = "eg: supermarket (optional)" :: String
|
||||||
date = "today" :: String
|
date = "today" :: String
|
||||||
descriptions = sort $ nub $ map tdescription $ jtxns j
|
descriptions = sort $ nub $ map tdescription $ jtxns j
|
||||||
|
acctnames = sort $ journalAccountNamesUsed j
|
||||||
|
-- Construct data for select2. Text must be quoted in a json string.
|
||||||
|
toSelectData as = preEscapedString $ encode $ JSArray $ map (\a -> JSObject $ toJSObject [("text", showJSON a)]) as
|
||||||
manyfiles = (length $ files j) > 1
|
manyfiles = (length $ files j) > 1
|
||||||
postingfields :: ViewData -> Int -> HtmlUrl AppRoute
|
postingfields :: ViewData -> Int -> HtmlUrl AppRoute
|
||||||
postingfields _ n = [hamlet|
|
postingfields _ n = [hamlet|
|
||||||
<tr#postingrow>
|
<tr#postingrow>
|
||||||
<td align=right>#{acctlabel}:
|
<td align=right>#{acctlabel}:
|
||||||
<td>
|
<td>
|
||||||
<select id=#{acctvar} name=#{acctvar}>
|
<input type=hidden id=#{acctvar} name=#{acctvar}>
|
||||||
<option>
|
|
||||||
$forall a <- acctnames
|
|
||||||
<option value=#{a} :shouldselect a:selected>#{a}
|
|
||||||
^{amtfield}
|
^{amtfield}
|
||||||
<tr.helprow>
|
<tr.helprow>
|
||||||
<td>
|
<td>
|
||||||
@ -191,11 +197,9 @@ addform staticRootUrl vd@VD{..} = [hamlet|
|
|||||||
<span.help>#{amthelp}
|
<span.help>#{amthelp}
|
||||||
|]
|
|]
|
||||||
where
|
where
|
||||||
shouldselect a = n == 2 && maybe False ((a==).fst) (inAccount qopts)
|
|
||||||
withnumber = (++ show n)
|
withnumber = (++ show n)
|
||||||
acctvar = withnumber "account"
|
acctvar = withnumber "account"
|
||||||
amtvar = withnumber "amount"
|
amtvar = withnumber "amount"
|
||||||
acctnames = sort $ journalAccountNamesUsed j
|
|
||||||
(acctlabel, accthelp, amtfield, amthelp)
|
(acctlabel, accthelp, amtfield, amthelp)
|
||||||
| n == 1 = ("To account"
|
| n == 1 = ("To account"
|
||||||
,"eg: expenses:food"
|
,"eg: expenses:food"
|
||||||
|
|||||||
@ -24,10 +24,11 @@ extra-tmp-files:
|
|||||||
extra-source-files:
|
extra-source-files:
|
||||||
messages/en.msg
|
messages/en.msg
|
||||||
config/routes
|
config/routes
|
||||||
static/combo_select.gif
|
|
||||||
static/css/bootstrap.css
|
static/css/bootstrap.css
|
||||||
static/dhtmlxcombo.js
|
static/select2.css
|
||||||
static/dhtmlxcommon.js
|
static/select2.min.js
|
||||||
|
static/select2-spinner.gif
|
||||||
|
static/select2.png
|
||||||
static/excanvas.min.js
|
static/excanvas.min.js
|
||||||
static/favicon.ico
|
static/favicon.ico
|
||||||
static/hledger.js
|
static/hledger.js
|
||||||
@ -138,6 +139,8 @@ library
|
|||||||
, yesod-core
|
, yesod-core
|
||||||
, yesod-platform >= 1.2.0.1 && < 1.3
|
, yesod-platform >= 1.2.0.1 && < 1.3
|
||||||
, yesod-static
|
, yesod-static
|
||||||
|
, json
|
||||||
|
|
||||||
if flag(blaze_html_0_4)
|
if flag(blaze_html_0_4)
|
||||||
cpp-options: -DBLAZE_HTML_0_4
|
cpp-options: -DBLAZE_HTML_0_4
|
||||||
build-depends:
|
build-depends:
|
||||||
@ -228,6 +231,7 @@ executable hledger-web
|
|||||||
, yesod-core
|
, yesod-core
|
||||||
, yesod-platform >= 1.2.0.1 && < 1.3
|
, yesod-platform >= 1.2.0.1 && < 1.3
|
||||||
, yesod-static
|
, yesod-static
|
||||||
|
, json
|
||||||
|
|
||||||
if flag(blaze_html_0_4)
|
if flag(blaze_html_0_4)
|
||||||
cpp-options: -DBLAZE_HTML_0_4
|
cpp-options: -DBLAZE_HTML_0_4
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 309 B |
File diff suppressed because it is too large
Load Diff
@ -1,940 +0,0 @@
|
|||||||
//v.2.6 build 100722
|
|
||||||
|
|
||||||
/*
|
|
||||||
Copyright DHTMLX LTD. http://www.dhtmlx.com
|
|
||||||
You allowed to use this component or parts of it under GPL terms
|
|
||||||
To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com
|
|
||||||
*/
|
|
||||||
dhtmlx=function(obj){
|
|
||||||
for (var a in obj) dhtmlx[a]=obj[a];
|
|
||||||
return dhtmlx; //simple singleton
|
|
||||||
};
|
|
||||||
dhtmlx.extend_api=function(name,map,ext){
|
|
||||||
var t = window[name];
|
|
||||||
if (!t) return; //component not defined
|
|
||||||
window[name]=function(obj){
|
|
||||||
if (obj && typeof obj == "object" && !obj.tagName){
|
|
||||||
var that = t.apply(this,(map._init?map._init(obj):arguments));
|
|
||||||
//global settings
|
|
||||||
for (var a in dhtmlx)
|
|
||||||
if (map[a]) this[map[a]](dhtmlx[a]);
|
|
||||||
//local settings
|
|
||||||
for (var a in obj){
|
|
||||||
if (map[a]) this[map[a]](obj[a]);
|
|
||||||
else if (a.indexOf("on")==0){
|
|
||||||
this.attachEvent(a,obj[a]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
var that = t.apply(this,arguments);
|
|
||||||
if (map._patch) map._patch(this);
|
|
||||||
return that||this;
|
|
||||||
};
|
|
||||||
window[name].prototype=t.prototype;
|
|
||||||
if (ext)
|
|
||||||
dhtmlXHeir(window[name].prototype,ext);
|
|
||||||
};
|
|
||||||
|
|
||||||
dhtmlxAjax={
|
|
||||||
get:function(url,callback){
|
|
||||||
var t=new dtmlXMLLoaderObject(true);
|
|
||||||
t.async=(arguments.length<3);
|
|
||||||
t.waitCall=callback;
|
|
||||||
t.loadXML(url)
|
|
||||||
return t;
|
|
||||||
},
|
|
||||||
post:function(url,post,callback){
|
|
||||||
var t=new dtmlXMLLoaderObject(true);
|
|
||||||
t.async=(arguments.length<4);
|
|
||||||
t.waitCall=callback;
|
|
||||||
t.loadXML(url,true,post)
|
|
||||||
return t;
|
|
||||||
},
|
|
||||||
getSync:function(url){
|
|
||||||
return this.get(url,null,true)
|
|
||||||
},
|
|
||||||
postSync:function(url,post){
|
|
||||||
return this.post(url,post,null,true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @desc: xmlLoader object
|
|
||||||
* @type: private
|
|
||||||
* @param: funcObject - xml parser function
|
|
||||||
* @param: object - jsControl object
|
|
||||||
* @param: async - sync/async mode (async by default)
|
|
||||||
* @param: rSeed - enable/disable random seed ( prevent IE caching)
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
function dtmlXMLLoaderObject(funcObject, dhtmlObject, async, rSeed){
|
|
||||||
this.xmlDoc="";
|
|
||||||
|
|
||||||
if (typeof (async) != "undefined")
|
|
||||||
this.async=async;
|
|
||||||
else
|
|
||||||
this.async=true;
|
|
||||||
|
|
||||||
this.onloadAction=funcObject||null;
|
|
||||||
this.mainObject=dhtmlObject||null;
|
|
||||||
this.waitCall=null;
|
|
||||||
this.rSeed=rSeed||false;
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @desc: xml loading handler
|
|
||||||
* @type: private
|
|
||||||
* @param: dtmlObject - xmlLoader object
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
dtmlXMLLoaderObject.prototype.waitLoadFunction=function(dhtmlObject){
|
|
||||||
var once = true;
|
|
||||||
this.check=function (){
|
|
||||||
if ((dhtmlObject)&&(dhtmlObject.onloadAction != null)){
|
|
||||||
if ((!dhtmlObject.xmlDoc.readyState)||(dhtmlObject.xmlDoc.readyState == 4)){
|
|
||||||
if (!once)
|
|
||||||
return;
|
|
||||||
|
|
||||||
once=false; //IE 5 fix
|
|
||||||
if (typeof dhtmlObject.onloadAction == "function")
|
|
||||||
dhtmlObject.onloadAction(dhtmlObject.mainObject, null, null, null, dhtmlObject);
|
|
||||||
|
|
||||||
if (dhtmlObject.waitCall){
|
|
||||||
dhtmlObject.waitCall.call(this,dhtmlObject);
|
|
||||||
dhtmlObject.waitCall=null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return this.check;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @desc: return XML top node
|
|
||||||
* @param: tagName - top XML node tag name (not used in IE, required for Safari and Mozilla)
|
|
||||||
* @type: private
|
|
||||||
* @returns: top XML node
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName, oldObj){
|
|
||||||
if (this.xmlDoc.responseXML){
|
|
||||||
var temp = this.xmlDoc.responseXML.getElementsByTagName(tagName);
|
|
||||||
if(temp.length==0 && tagName.indexOf(":")!=-1)
|
|
||||||
var temp = this.xmlDoc.responseXML.getElementsByTagName((tagName.split(":"))[1]);
|
|
||||||
var z = temp[0];
|
|
||||||
} else
|
|
||||||
var z = this.xmlDoc.documentElement;
|
|
||||||
|
|
||||||
if (z){
|
|
||||||
this._retry=false;
|
|
||||||
return z;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((_isIE)&&(!this._retry)){
|
|
||||||
//fall back to MS.XMLDOM
|
|
||||||
var xmlString = this.xmlDoc.responseText;
|
|
||||||
var oldObj = this.xmlDoc;
|
|
||||||
this._retry=true;
|
|
||||||
this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
|
|
||||||
this.xmlDoc.async=false;
|
|
||||||
this.xmlDoc["loadXM"+"L"](xmlString);
|
|
||||||
|
|
||||||
return this.getXMLTopNode(tagName, oldObj);
|
|
||||||
}
|
|
||||||
dhtmlxError.throwError("LoadXML", "Incorrect XML", [
|
|
||||||
(oldObj||this.xmlDoc),
|
|
||||||
this.mainObject
|
|
||||||
]);
|
|
||||||
|
|
||||||
return document.createElement("DIV");
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @desc: load XML from string
|
|
||||||
* @type: private
|
|
||||||
* @param: xmlString - xml string
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
dtmlXMLLoaderObject.prototype.loadXMLString=function(xmlString){
|
|
||||||
{
|
|
||||||
try{
|
|
||||||
var parser = new DOMParser();
|
|
||||||
this.xmlDoc=parser.parseFromString(xmlString, "text/xml");
|
|
||||||
}
|
|
||||||
catch (e){
|
|
||||||
this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
|
|
||||||
this.xmlDoc.async=this.async;
|
|
||||||
this.xmlDoc["loadXM"+"L"](xmlString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.onloadAction(this.mainObject, null, null, null, this);
|
|
||||||
|
|
||||||
if (this.waitCall){
|
|
||||||
this.waitCall();
|
|
||||||
this.waitCall=null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @desc: load XML
|
|
||||||
* @type: private
|
|
||||||
* @param: filePath - xml file path
|
|
||||||
* @param: postMode - send POST request
|
|
||||||
* @param: postVars - list of vars for post request
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
dtmlXMLLoaderObject.prototype.loadXML=function(filePath, postMode, postVars, rpc){
|
|
||||||
if (this.rSeed)
|
|
||||||
filePath+=((filePath.indexOf("?") != -1) ? "&" : "?")+"a_dhx_rSeed="+(new Date()).valueOf();
|
|
||||||
this.filePath=filePath;
|
|
||||||
|
|
||||||
if ((!_isIE)&&(window.XMLHttpRequest))
|
|
||||||
this.xmlDoc=new XMLHttpRequest();
|
|
||||||
else {
|
|
||||||
if (document.implementation&&document.implementation.createDocument){
|
|
||||||
this.xmlDoc=document.implementation.createDocument("", "", null);
|
|
||||||
this.xmlDoc.onload=new this.waitLoadFunction(this);
|
|
||||||
this.xmlDoc.load(filePath);
|
|
||||||
return;
|
|
||||||
} else
|
|
||||||
this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.async)
|
|
||||||
this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);
|
|
||||||
this.xmlDoc.open(postMode ? "POST" : "GET", filePath, this.async);
|
|
||||||
|
|
||||||
if (rpc){
|
|
||||||
this.xmlDoc.setRequestHeader("User-Agent", "dhtmlxRPC v0.1 ("+navigator.userAgent+")");
|
|
||||||
this.xmlDoc.setRequestHeader("Content-type", "text/xml");
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (postMode)
|
|
||||||
this.xmlDoc.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
||||||
|
|
||||||
this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");
|
|
||||||
this.xmlDoc.send(null||postVars);
|
|
||||||
|
|
||||||
if (!this.async)
|
|
||||||
(new this.waitLoadFunction(this))();
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @desc: destructor, cleans used memory
|
|
||||||
* @type: private
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
dtmlXMLLoaderObject.prototype.destructor=function(){
|
|
||||||
this._filterXPath = null;
|
|
||||||
this._getAllNamedChilds = null;
|
|
||||||
this._retry = null;
|
|
||||||
this.async = null;
|
|
||||||
this.rSeed = null;
|
|
||||||
this.filePath = null;
|
|
||||||
this.onloadAction = null;
|
|
||||||
this.mainObject = null;
|
|
||||||
this.xmlDoc = null;
|
|
||||||
this.doXPath = null;
|
|
||||||
this.doXPathOpera = null;
|
|
||||||
this.doXSLTransToObject = null;
|
|
||||||
this.doXSLTransToString = null;
|
|
||||||
this.loadXML = null;
|
|
||||||
this.loadXMLString = null;
|
|
||||||
// this.waitLoadFunction = null;
|
|
||||||
this.doSerialization = null;
|
|
||||||
this.xmlNodeToJSON = null;
|
|
||||||
this.getXMLTopNode = null;
|
|
||||||
this.setXSLParamValue = null;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
dtmlXMLLoaderObject.prototype.xmlNodeToJSON = function(node){
|
|
||||||
var t={};
|
|
||||||
for (var i=0; i<node.attributes.length; i++)
|
|
||||||
t[node.attributes[i].name]=node.attributes[i].value;
|
|
||||||
t["_tagvalue"]=node.firstChild?node.firstChild.nodeValue:"";
|
|
||||||
for (var i=0; i<node.childNodes.length; i++){
|
|
||||||
var name=node.childNodes[i].tagName;
|
|
||||||
if (name){
|
|
||||||
if (!t[name]) t[name]=[];
|
|
||||||
t[name].push(this.xmlNodeToJSON(node.childNodes[i]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @desc: Call wrapper
|
|
||||||
* @type: private
|
|
||||||
* @param: funcObject - action handler
|
|
||||||
* @param: dhtmlObject - user data
|
|
||||||
* @returns: function handler
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
function callerFunction(funcObject, dhtmlObject){
|
|
||||||
this.handler=function(e){
|
|
||||||
if (!e)
|
|
||||||
e=window.event;
|
|
||||||
funcObject(e, dhtmlObject);
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
return this.handler;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @desc: Calculate absolute position of html object
|
|
||||||
* @type: private
|
|
||||||
* @param: htmlObject - html object
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
function getAbsoluteLeft(htmlObject){
|
|
||||||
return getOffset(htmlObject).left;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @desc: Calculate absolute position of html object
|
|
||||||
* @type: private
|
|
||||||
* @param: htmlObject - html object
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
function getAbsoluteTop(htmlObject){
|
|
||||||
return getOffset(htmlObject).top;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getOffsetSum(elem) {
|
|
||||||
var top=0, left=0;
|
|
||||||
while(elem) {
|
|
||||||
top = top + parseInt(elem.offsetTop);
|
|
||||||
left = left + parseInt(elem.offsetLeft);
|
|
||||||
elem = elem.offsetParent;
|
|
||||||
}
|
|
||||||
return {top: top, left: left};
|
|
||||||
}
|
|
||||||
function getOffsetRect(elem) {
|
|
||||||
var box = elem.getBoundingClientRect();
|
|
||||||
var body = document.body;
|
|
||||||
var docElem = document.documentElement;
|
|
||||||
var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;
|
|
||||||
var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
|
|
||||||
var clientTop = docElem.clientTop || body.clientTop || 0;
|
|
||||||
var clientLeft = docElem.clientLeft || body.clientLeft || 0;
|
|
||||||
var top = box.top + scrollTop - clientTop;
|
|
||||||
var left = box.left + scrollLeft - clientLeft;
|
|
||||||
return { top: Math.round(top), left: Math.round(left) };
|
|
||||||
}
|
|
||||||
function getOffset(elem) {
|
|
||||||
if (elem.getBoundingClientRect) {
|
|
||||||
return getOffsetRect(elem);
|
|
||||||
} else {
|
|
||||||
return getOffsetSum(elem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @desc: Convert string to it boolean representation
|
|
||||||
* @type: private
|
|
||||||
* @param: inputString - string for covertion
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
function convertStringToBoolean(inputString){
|
|
||||||
if (typeof (inputString) == "string")
|
|
||||||
inputString=inputString.toLowerCase();
|
|
||||||
|
|
||||||
switch (inputString){
|
|
||||||
case "1":
|
|
||||||
case "true":
|
|
||||||
case "yes":
|
|
||||||
case "y":
|
|
||||||
case 1:
|
|
||||||
case true:
|
|
||||||
return true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default: return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @desc: find out what symbol to use as url param delimiters in further params
|
|
||||||
* @type: private
|
|
||||||
* @param: str - current url string
|
|
||||||
* @topic: 0
|
|
||||||
*/
|
|
||||||
function getUrlSymbol(str){
|
|
||||||
if (str.indexOf("?") != -1)
|
|
||||||
return "&"
|
|
||||||
else
|
|
||||||
return "?"
|
|
||||||
}
|
|
||||||
|
|
||||||
function dhtmlDragAndDropObject(){
|
|
||||||
if (window.dhtmlDragAndDrop)
|
|
||||||
return window.dhtmlDragAndDrop;
|
|
||||||
|
|
||||||
this.lastLanding=0;
|
|
||||||
this.dragNode=0;
|
|
||||||
this.dragStartNode=0;
|
|
||||||
this.dragStartObject=0;
|
|
||||||
this.tempDOMU=null;
|
|
||||||
this.tempDOMM=null;
|
|
||||||
this.waitDrag=0;
|
|
||||||
window.dhtmlDragAndDrop=this;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
dhtmlDragAndDropObject.prototype.removeDraggableItem=function(htmlNode){
|
|
||||||
htmlNode.onmousedown=null;
|
|
||||||
htmlNode.dragStarter=null;
|
|
||||||
htmlNode.dragLanding=null;
|
|
||||||
}
|
|
||||||
dhtmlDragAndDropObject.prototype.addDraggableItem=function(htmlNode, dhtmlObject){
|
|
||||||
htmlNode.onmousedown=this.preCreateDragCopy;
|
|
||||||
htmlNode.dragStarter=dhtmlObject;
|
|
||||||
this.addDragLanding(htmlNode, dhtmlObject);
|
|
||||||
}
|
|
||||||
dhtmlDragAndDropObject.prototype.addDragLanding=function(htmlNode, dhtmlObject){
|
|
||||||
htmlNode.dragLanding=dhtmlObject;
|
|
||||||
}
|
|
||||||
dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(e){
|
|
||||||
if ((e||window.event) && (e||event).button == 2)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (window.dhtmlDragAndDrop.waitDrag){
|
|
||||||
window.dhtmlDragAndDrop.waitDrag=0;
|
|
||||||
document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;
|
|
||||||
document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.dhtmlDragAndDrop.waitDrag=1;
|
|
||||||
window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;
|
|
||||||
window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;
|
|
||||||
window.dhtmlDragAndDrop.dragStartNode=this;
|
|
||||||
window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;
|
|
||||||
document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;
|
|
||||||
document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;
|
|
||||||
window.dhtmlDragAndDrop.downtime = new Date().valueOf();
|
|
||||||
|
|
||||||
|
|
||||||
if ((e)&&(e.preventDefault)){
|
|
||||||
e.preventDefault();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
dhtmlDragAndDropObject.prototype.callDrag=function(e){
|
|
||||||
if (!e)
|
|
||||||
e=window.event;
|
|
||||||
dragger=window.dhtmlDragAndDrop;
|
|
||||||
if ((new Date()).valueOf()-dragger.downtime<100) return;
|
|
||||||
|
|
||||||
if ((e.button == 0)&&(_isIE))
|
|
||||||
return dragger.stopDrag();
|
|
||||||
|
|
||||||
if (!dragger.dragNode&&dragger.waitDrag){
|
|
||||||
dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode, e);
|
|
||||||
|
|
||||||
if (!dragger.dragNode)
|
|
||||||
return dragger.stopDrag();
|
|
||||||
|
|
||||||
dragger.dragNode.onselectstart=function(){return false;}
|
|
||||||
dragger.gldragNode=dragger.dragNode;
|
|
||||||
document.body.appendChild(dragger.dragNode);
|
|
||||||
document.body.onmouseup=dragger.stopDrag;
|
|
||||||
dragger.waitDrag=0;
|
|
||||||
dragger.dragNode.pWindow=window;
|
|
||||||
dragger.initFrameRoute();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dragger.dragNode.parentNode != window.document.body){
|
|
||||||
var grd = dragger.gldragNode;
|
|
||||||
|
|
||||||
if (dragger.gldragNode.old)
|
|
||||||
grd=dragger.gldragNode.old;
|
|
||||||
|
|
||||||
//if (!document.all) dragger.calculateFramePosition();
|
|
||||||
grd.parentNode.removeChild(grd);
|
|
||||||
var oldBody = dragger.dragNode.pWindow;
|
|
||||||
|
|
||||||
if (grd.pWindow && grd.pWindow.dhtmlDragAndDrop.lastLanding)
|
|
||||||
grd.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(grd.pWindow.dhtmlDragAndDrop.lastLanding);
|
|
||||||
|
|
||||||
// var oldp=dragger.dragNode.parentObject;
|
|
||||||
if (_isIE){
|
|
||||||
var div = document.createElement("Div");
|
|
||||||
div.innerHTML=dragger.dragNode.outerHTML;
|
|
||||||
dragger.dragNode=div.childNodes[0];
|
|
||||||
} else
|
|
||||||
dragger.dragNode=dragger.dragNode.cloneNode(true);
|
|
||||||
|
|
||||||
dragger.dragNode.pWindow=window;
|
|
||||||
// dragger.dragNode.parentObject=oldp;
|
|
||||||
|
|
||||||
dragger.gldragNode.old=dragger.dragNode;
|
|
||||||
document.body.appendChild(dragger.dragNode);
|
|
||||||
oldBody.dhtmlDragAndDrop.dragNode=dragger.dragNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
dragger.dragNode.style.left=e.clientX+15+(dragger.fx
|
|
||||||
? dragger.fx*(-1)
|
|
||||||
: 0)
|
|
||||||
+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";
|
|
||||||
dragger.dragNode.style.top=e.clientY+3+(dragger.fy
|
|
||||||
? dragger.fy*(-1)
|
|
||||||
: 0)
|
|
||||||
+(document.body.scrollTop||document.documentElement.scrollTop)+"px";
|
|
||||||
|
|
||||||
if (!e.srcElement)
|
|
||||||
var z = e.target;
|
|
||||||
else
|
|
||||||
z=e.srcElement;
|
|
||||||
dragger.checkLanding(z, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
dhtmlDragAndDropObject.prototype.calculateFramePosition=function(n){
|
|
||||||
//this.fx = 0, this.fy = 0;
|
|
||||||
if (window.name){
|
|
||||||
var el = parent.frames[window.name].frameElement.offsetParent;
|
|
||||||
var fx = 0;
|
|
||||||
var fy = 0;
|
|
||||||
|
|
||||||
while (el){
|
|
||||||
fx+=el.offsetLeft;
|
|
||||||
fy+=el.offsetTop;
|
|
||||||
el=el.offsetParent;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((parent.dhtmlDragAndDrop)){
|
|
||||||
var ls = parent.dhtmlDragAndDrop.calculateFramePosition(1);
|
|
||||||
fx+=ls.split('_')[0]*1;
|
|
||||||
fy+=ls.split('_')[1]*1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (n)
|
|
||||||
return fx+"_"+fy;
|
|
||||||
else
|
|
||||||
this.fx=fx;
|
|
||||||
this.fy=fy;
|
|
||||||
}
|
|
||||||
return "0_0";
|
|
||||||
}
|
|
||||||
dhtmlDragAndDropObject.prototype.checkLanding=function(htmlObject, e){
|
|
||||||
if ((htmlObject)&&(htmlObject.dragLanding)){
|
|
||||||
if (this.lastLanding)
|
|
||||||
this.lastLanding.dragLanding._dragOut(this.lastLanding);
|
|
||||||
this.lastLanding=htmlObject;
|
|
||||||
this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding, this.dragStartNode, e.clientX,
|
|
||||||
e.clientY, e);
|
|
||||||
this.lastLanding_scr=(_isIE ? e.srcElement : e.target);
|
|
||||||
} else {
|
|
||||||
if ((htmlObject)&&(htmlObject.tagName != "BODY"))
|
|
||||||
this.checkLanding(htmlObject.parentNode, e);
|
|
||||||
else {
|
|
||||||
if (this.lastLanding)
|
|
||||||
this.lastLanding.dragLanding._dragOut(this.lastLanding, e.clientX, e.clientY, e);
|
|
||||||
this.lastLanding=0;
|
|
||||||
|
|
||||||
if (this._onNotFound)
|
|
||||||
this._onNotFound();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dhtmlDragAndDropObject.prototype.stopDrag=function(e, mode){
|
|
||||||
dragger=window.dhtmlDragAndDrop;
|
|
||||||
|
|
||||||
if (!mode){
|
|
||||||
dragger.stopFrameRoute();
|
|
||||||
var temp = dragger.lastLanding;
|
|
||||||
dragger.lastLanding=null;
|
|
||||||
|
|
||||||
if (temp)
|
|
||||||
temp.dragLanding._drag(dragger.dragStartNode, dragger.dragStartObject, temp, (_isIE
|
|
||||||
? event.srcElement
|
|
||||||
: e.target));
|
|
||||||
}
|
|
||||||
dragger.lastLanding=null;
|
|
||||||
|
|
||||||
if ((dragger.dragNode)&&(dragger.dragNode.parentNode == document.body))
|
|
||||||
dragger.dragNode.parentNode.removeChild(dragger.dragNode);
|
|
||||||
dragger.dragNode=0;
|
|
||||||
dragger.gldragNode=0;
|
|
||||||
dragger.fx=0;
|
|
||||||
dragger.fy=0;
|
|
||||||
dragger.dragStartNode=0;
|
|
||||||
dragger.dragStartObject=0;
|
|
||||||
document.body.onmouseup=dragger.tempDOMU;
|
|
||||||
document.body.onmousemove=dragger.tempDOMM;
|
|
||||||
dragger.tempDOMU=null;
|
|
||||||
dragger.tempDOMM=null;
|
|
||||||
dragger.waitDrag=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dhtmlDragAndDropObject.prototype.stopFrameRoute=function(win){
|
|
||||||
if (win)
|
|
||||||
window.dhtmlDragAndDrop.stopDrag(1, 1);
|
|
||||||
|
|
||||||
for (var i = 0; i < window.frames.length; i++){
|
|
||||||
try{
|
|
||||||
if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
|
|
||||||
window.frames[i].dhtmlDragAndDrop.stopFrameRoute(window);
|
|
||||||
} catch(e){}
|
|
||||||
}
|
|
||||||
|
|
||||||
try{
|
|
||||||
if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
|
|
||||||
parent.dhtmlDragAndDrop.stopFrameRoute(window);
|
|
||||||
} catch(e){}
|
|
||||||
}
|
|
||||||
dhtmlDragAndDropObject.prototype.initFrameRoute=function(win, mode){
|
|
||||||
if (win){
|
|
||||||
window.dhtmlDragAndDrop.preCreateDragCopy();
|
|
||||||
window.dhtmlDragAndDrop.dragStartNode=win.dhtmlDragAndDrop.dragStartNode;
|
|
||||||
window.dhtmlDragAndDrop.dragStartObject=win.dhtmlDragAndDrop.dragStartObject;
|
|
||||||
window.dhtmlDragAndDrop.dragNode=win.dhtmlDragAndDrop.dragNode;
|
|
||||||
window.dhtmlDragAndDrop.gldragNode=win.dhtmlDragAndDrop.dragNode;
|
|
||||||
window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;
|
|
||||||
window.waitDrag=0;
|
|
||||||
|
|
||||||
if (((!_isIE)&&(mode))&&((!_isFF)||(_FFrv < 1.8)))
|
|
||||||
window.dhtmlDragAndDrop.calculateFramePosition();
|
|
||||||
}
|
|
||||||
try{
|
|
||||||
if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
|
|
||||||
parent.dhtmlDragAndDrop.initFrameRoute(window);
|
|
||||||
}catch(e){}
|
|
||||||
|
|
||||||
for (var i = 0; i < window.frames.length; i++){
|
|
||||||
try{
|
|
||||||
if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
|
|
||||||
window.frames[i].dhtmlDragAndDrop.initFrameRoute(window, ((!win||mode) ? 1 : 0));
|
|
||||||
} catch(e){}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var _isFF = false;
|
|
||||||
var _isIE = false;
|
|
||||||
var _isOpera = false;
|
|
||||||
var _isKHTML = false;
|
|
||||||
var _isMacOS = false;
|
|
||||||
var _isChrome = false;
|
|
||||||
|
|
||||||
if (navigator.userAgent.indexOf('Macintosh') != -1)
|
|
||||||
_isMacOS=true;
|
|
||||||
|
|
||||||
|
|
||||||
if (navigator.userAgent.toLowerCase().indexOf('chrome')>-1)
|
|
||||||
_isChrome=true;
|
|
||||||
|
|
||||||
if ((navigator.userAgent.indexOf('Safari') != -1)||(navigator.userAgent.indexOf('Konqueror') != -1)){
|
|
||||||
var _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Safari')+7, 5));
|
|
||||||
|
|
||||||
if (_KHTMLrv > 525){ //mimic FF behavior for Safari 3.1+
|
|
||||||
_isFF=true;
|
|
||||||
var _FFrv = 1.9;
|
|
||||||
} else
|
|
||||||
_isKHTML=true;
|
|
||||||
} else if (navigator.userAgent.indexOf('Opera') != -1){
|
|
||||||
_isOpera=true;
|
|
||||||
_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Opera')+6, 3));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
else if (navigator.appName.indexOf("Microsoft") != -1){
|
|
||||||
_isIE=true;
|
|
||||||
if (navigator.appVersion.indexOf("MSIE 8.0")!= -1 && document.compatMode != "BackCompat") _isIE=8;
|
|
||||||
} else {
|
|
||||||
_isFF=true;
|
|
||||||
var _FFrv = parseFloat(navigator.userAgent.split("rv:")[1])
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//multibrowser Xpath processor
|
|
||||||
dtmlXMLLoaderObject.prototype.doXPath=function(xpathExp, docObj, namespace, result_type){
|
|
||||||
if (_isKHTML || (!_isIE && !window.XPathResult))
|
|
||||||
return this.doXPathOpera(xpathExp, docObj);
|
|
||||||
|
|
||||||
if (_isIE){ //IE
|
|
||||||
if (!docObj)
|
|
||||||
if (!this.xmlDoc.nodeName)
|
|
||||||
docObj=this.xmlDoc.responseXML
|
|
||||||
else
|
|
||||||
docObj=this.xmlDoc;
|
|
||||||
|
|
||||||
if (!docObj)
|
|
||||||
dhtmlxError.throwError("LoadXML", "Incorrect XML", [
|
|
||||||
(docObj||this.xmlDoc),
|
|
||||||
this.mainObject
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (namespace != null)
|
|
||||||
docObj.setProperty("SelectionNamespaces", "xmlns:xsl='"+namespace+"'"); //
|
|
||||||
|
|
||||||
if (result_type == 'single'){
|
|
||||||
return docObj.selectSingleNode(xpathExp);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return docObj.selectNodes(xpathExp)||new Array(0);
|
|
||||||
}
|
|
||||||
} else { //Mozilla
|
|
||||||
var nodeObj = docObj;
|
|
||||||
|
|
||||||
if (!docObj){
|
|
||||||
if (!this.xmlDoc.nodeName){
|
|
||||||
docObj=this.xmlDoc.responseXML
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
docObj=this.xmlDoc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!docObj)
|
|
||||||
dhtmlxError.throwError("LoadXML", "Incorrect XML", [
|
|
||||||
(docObj||this.xmlDoc),
|
|
||||||
this.mainObject
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (docObj.nodeName.indexOf("document") != -1){
|
|
||||||
nodeObj=docObj;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
nodeObj=docObj;
|
|
||||||
docObj=docObj.ownerDocument;
|
|
||||||
}
|
|
||||||
var retType = XPathResult.ANY_TYPE;
|
|
||||||
|
|
||||||
if (result_type == 'single')
|
|
||||||
retType=XPathResult.FIRST_ORDERED_NODE_TYPE
|
|
||||||
var rowsCol = new Array();
|
|
||||||
var col = docObj.evaluate(xpathExp, nodeObj, function(pref){
|
|
||||||
return namespace
|
|
||||||
}, retType, null);
|
|
||||||
|
|
||||||
if (retType == XPathResult.FIRST_ORDERED_NODE_TYPE){
|
|
||||||
return col.singleNodeValue;
|
|
||||||
}
|
|
||||||
var thisColMemb = col.iterateNext();
|
|
||||||
|
|
||||||
while (thisColMemb){
|
|
||||||
rowsCol[rowsCol.length]=thisColMemb;
|
|
||||||
thisColMemb=col.iterateNext();
|
|
||||||
}
|
|
||||||
return rowsCol;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _dhtmlxError(type, name, params){
|
|
||||||
if (!this.catches)
|
|
||||||
this.catches=new Array();
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
_dhtmlxError.prototype.catchError=function(type, func_name){
|
|
||||||
this.catches[type]=func_name;
|
|
||||||
}
|
|
||||||
_dhtmlxError.prototype.throwError=function(type, name, params){
|
|
||||||
if (this.catches[type])
|
|
||||||
return this.catches[type](type, name, params);
|
|
||||||
|
|
||||||
if (this.catches["ALL"])
|
|
||||||
return this.catches["ALL"](type, name, params);
|
|
||||||
|
|
||||||
alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.dhtmlxError=new _dhtmlxError();
|
|
||||||
|
|
||||||
|
|
||||||
//opera fake, while 9.0 not released
|
|
||||||
//multibrowser Xpath processor
|
|
||||||
dtmlXMLLoaderObject.prototype.doXPathOpera=function(xpathExp, docObj){
|
|
||||||
//this is fake for Opera
|
|
||||||
var z = xpathExp.replace(/[\/]+/gi, "/").split('/');
|
|
||||||
var obj = null;
|
|
||||||
var i = 1;
|
|
||||||
|
|
||||||
if (!z.length)
|
|
||||||
return [];
|
|
||||||
|
|
||||||
if (z[0] == ".")
|
|
||||||
obj=[docObj]; else if (z[0] == ""){
|
|
||||||
obj=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(z[i].replace(/\[[^\]]*\]/g, ""));
|
|
||||||
i++;
|
|
||||||
} else
|
|
||||||
return [];
|
|
||||||
|
|
||||||
for (i; i < z.length; i++)obj=this._getAllNamedChilds(obj, z[i]);
|
|
||||||
|
|
||||||
if (z[i-1].indexOf("[") != -1)
|
|
||||||
obj=this._filterXPath(obj, z[i-1]);
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
dtmlXMLLoaderObject.prototype._filterXPath=function(a, b){
|
|
||||||
var c = new Array();
|
|
||||||
var b = b.replace(/[^\[]*\[\@/g, "").replace(/[\[\]\@]*/g, "");
|
|
||||||
|
|
||||||
for (var i = 0; i < a.length; i++)
|
|
||||||
if (a[i].getAttribute(b))
|
|
||||||
c[c.length]=a[i];
|
|
||||||
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a, b){
|
|
||||||
var c = new Array();
|
|
||||||
|
|
||||||
if (_isKHTML)
|
|
||||||
b=b.toUpperCase();
|
|
||||||
|
|
||||||
for (var i = 0; i < a.length; i++)for (var j = 0; j < a[i].childNodes.length; j++){
|
|
||||||
if (_isKHTML){
|
|
||||||
if (a[i].childNodes[j].tagName&&a[i].childNodes[j].tagName.toUpperCase() == b)
|
|
||||||
c[c.length]=a[i].childNodes[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (a[i].childNodes[j].tagName == b)
|
|
||||||
c[c.length]=a[i].childNodes[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
function dhtmlXHeir(a, b){
|
|
||||||
for (var c in b)
|
|
||||||
if (typeof (b[c]) == "function")
|
|
||||||
a[c]=b[c];
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
function dhtmlxEvent(el, event, handler){
|
|
||||||
if (el.addEventListener)
|
|
||||||
el.addEventListener(event, handler, false);
|
|
||||||
|
|
||||||
else if (el.attachEvent)
|
|
||||||
el.attachEvent("on"+event, handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
//============= XSL Extension ===================================
|
|
||||||
|
|
||||||
dtmlXMLLoaderObject.prototype.xslDoc=null;
|
|
||||||
dtmlXMLLoaderObject.prototype.setXSLParamValue=function(paramName, paramValue, xslDoc){
|
|
||||||
if (!xslDoc)
|
|
||||||
xslDoc=this.xslDoc
|
|
||||||
|
|
||||||
if (xslDoc.responseXML)
|
|
||||||
xslDoc=xslDoc.responseXML;
|
|
||||||
var item =
|
|
||||||
this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+paramName+"']", xslDoc,
|
|
||||||
"http:/\/www.w3.org/1999/XSL/Transform", "single");
|
|
||||||
|
|
||||||
if (item != null)
|
|
||||||
item.firstChild.nodeValue=paramValue
|
|
||||||
}
|
|
||||||
dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(xslDoc, xmlDoc){
|
|
||||||
if (!xslDoc)
|
|
||||||
xslDoc=this.xslDoc;
|
|
||||||
|
|
||||||
if (xslDoc.responseXML)
|
|
||||||
xslDoc=xslDoc.responseXML
|
|
||||||
|
|
||||||
if (!xmlDoc)
|
|
||||||
xmlDoc=this.xmlDoc;
|
|
||||||
|
|
||||||
if (xmlDoc.responseXML)
|
|
||||||
xmlDoc=xmlDoc.responseXML
|
|
||||||
|
|
||||||
//MOzilla
|
|
||||||
if (!_isIE){
|
|
||||||
if (!this.XSLProcessor){
|
|
||||||
this.XSLProcessor=new XSLTProcessor();
|
|
||||||
this.XSLProcessor.importStylesheet(xslDoc);
|
|
||||||
}
|
|
||||||
var result = this.XSLProcessor.transformToDocument(xmlDoc);
|
|
||||||
} else {
|
|
||||||
var result = new ActiveXObject("Msxml2.DOMDocument.3.0");
|
|
||||||
try{
|
|
||||||
xmlDoc.transformNodeToObject(xslDoc, result);
|
|
||||||
}catch(e){
|
|
||||||
result = xmlDoc.transformNode(xslDoc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
dtmlXMLLoaderObject.prototype.doXSLTransToString=function(xslDoc, xmlDoc){
|
|
||||||
var res = this.doXSLTransToObject(xslDoc, xmlDoc);
|
|
||||||
if(typeof(res)=="string")
|
|
||||||
return res;
|
|
||||||
return this.doSerialization(res);
|
|
||||||
}
|
|
||||||
|
|
||||||
dtmlXMLLoaderObject.prototype.doSerialization=function(xmlDoc){
|
|
||||||
if (!xmlDoc)
|
|
||||||
xmlDoc=this.xmlDoc;
|
|
||||||
if (xmlDoc.responseXML)
|
|
||||||
xmlDoc=xmlDoc.responseXML
|
|
||||||
if (!_isIE){
|
|
||||||
var xmlSerializer = new XMLSerializer();
|
|
||||||
return xmlSerializer.serializeToString(xmlDoc);
|
|
||||||
} else
|
|
||||||
return xmlDoc.xml;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @desc:
|
|
||||||
* @type: private
|
|
||||||
*/
|
|
||||||
dhtmlxEventable=function(obj){
|
|
||||||
obj.attachEvent=function(name, catcher, callObj){
|
|
||||||
name='ev_'+name.toLowerCase();
|
|
||||||
if (!this[name])
|
|
||||||
this[name]=new this.eventCatcher(callObj||this);
|
|
||||||
|
|
||||||
return(name+':'+this[name].addEvent(catcher)); //return ID (event name & event ID)
|
|
||||||
}
|
|
||||||
obj.callEvent=function(name, arg0){
|
|
||||||
name='ev_'+name.toLowerCase();
|
|
||||||
if (this[name])
|
|
||||||
return this[name].apply(this, arg0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
obj.checkEvent=function(name){
|
|
||||||
return (!!this['ev_'+name.toLowerCase()])
|
|
||||||
}
|
|
||||||
obj.eventCatcher=function(obj){
|
|
||||||
var dhx_catch = [];
|
|
||||||
var z = function(){
|
|
||||||
var res = true;
|
|
||||||
for (var i = 0; i < dhx_catch.length; i++){
|
|
||||||
if (dhx_catch[i] != null){
|
|
||||||
var zr = dhx_catch[i].apply(obj, arguments);
|
|
||||||
res=res&&zr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
z.addEvent=function(ev){
|
|
||||||
if (typeof (ev) != "function")
|
|
||||||
ev=eval(ev);
|
|
||||||
if (ev)
|
|
||||||
return dhx_catch.push(ev)-1;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
z.removeEvent=function(id){
|
|
||||||
dhx_catch[id]=null;
|
|
||||||
}
|
|
||||||
return z;
|
|
||||||
}
|
|
||||||
obj.detachEvent=function(id){
|
|
||||||
if (id != false){
|
|
||||||
var list = id.split(':'); //get EventName and ID
|
|
||||||
this[list[0]].removeEvent(list[1]); //remove event
|
|
||||||
}
|
|
||||||
}
|
|
||||||
obj.detachAllEvents = function(){
|
|
||||||
for (var name in this){
|
|
||||||
if (name.indexOf("ev_")==0)
|
|
||||||
delete this[name];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
158
hledger-web/static/jquery.js
vendored
158
hledger-web/static/jquery.js
vendored
File diff suppressed because one or more lines are too long
BIN
hledger-web/static/select2-spinner.gif
Executable file
BIN
hledger-web/static/select2-spinner.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
652
hledger-web/static/select2.css
Executable file
652
hledger-web/static/select2.css
Executable file
@ -0,0 +1,652 @@
|
|||||||
|
/*
|
||||||
|
Version: 3.4.0 Timestamp: Tue May 14 08:27:33 PDT 2013
|
||||||
|
*/
|
||||||
|
.select2-container {
|
||||||
|
margin: 0;
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
/* inline-block for ie7 */
|
||||||
|
zoom: 1;
|
||||||
|
*display: inline;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container,
|
||||||
|
.select2-drop,
|
||||||
|
.select2-search,
|
||||||
|
.select2-search input{
|
||||||
|
/*
|
||||||
|
Force border-box so that % widths fit the parent
|
||||||
|
container without overlap because of margin/padding.
|
||||||
|
|
||||||
|
More Info : http://www.quirksmode.org/css/box.html
|
||||||
|
*/
|
||||||
|
-webkit-box-sizing: border-box; /* webkit */
|
||||||
|
-khtml-box-sizing: border-box; /* konqueror */
|
||||||
|
-moz-box-sizing: border-box; /* firefox */
|
||||||
|
-ms-box-sizing: border-box; /* ie */
|
||||||
|
box-sizing: border-box; /* css3 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container .select2-choice {
|
||||||
|
display: block;
|
||||||
|
height: 26px;
|
||||||
|
padding: 0 0 0 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
white-space: nowrap;
|
||||||
|
line-height: 26px;
|
||||||
|
color: #444;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
-webkit-background-clip: padding-box;
|
||||||
|
-moz-background-clip: padding;
|
||||||
|
background-clip: padding-box;
|
||||||
|
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
|
background-color: #fff;
|
||||||
|
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
|
||||||
|
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
|
||||||
|
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
|
||||||
|
background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
|
||||||
|
background-image: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
|
||||||
|
background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container.select2-drop-above .select2-choice {
|
||||||
|
border-bottom-color: #aaa;
|
||||||
|
|
||||||
|
-webkit-border-radius:0 0 4px 4px;
|
||||||
|
-moz-border-radius:0 0 4px 4px;
|
||||||
|
border-radius:0 0 4px 4px;
|
||||||
|
|
||||||
|
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
|
||||||
|
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
|
||||||
|
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
|
||||||
|
background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
|
||||||
|
background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
|
||||||
|
background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container.select2-allowclear .select2-choice span {
|
||||||
|
margin-right: 42px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container .select2-choice span {
|
||||||
|
margin-right: 26px;
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
-ms-text-overflow: ellipsis;
|
||||||
|
-o-text-overflow: ellipsis;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container .select2-choice abbr {
|
||||||
|
display: none;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
position: absolute;
|
||||||
|
right: 24px;
|
||||||
|
top: 8px;
|
||||||
|
|
||||||
|
font-size: 1px;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
border: 0;
|
||||||
|
background: url('select2.png') right top no-repeat;
|
||||||
|
cursor: pointer;
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container.select2-allowclear .select2-choice abbr {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container .select2-choice abbr:hover {
|
||||||
|
background-position: right -11px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-drop-mask {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
z-index: 9998;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-drop {
|
||||||
|
width: 100%;
|
||||||
|
margin-top:-1px;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 9999;
|
||||||
|
top: 100%;
|
||||||
|
|
||||||
|
background: #fff;
|
||||||
|
color: #000;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
border-top: 0;
|
||||||
|
|
||||||
|
-webkit-border-radius: 0 0 4px 4px;
|
||||||
|
-moz-border-radius: 0 0 4px 4px;
|
||||||
|
border-radius: 0 0 4px 4px;
|
||||||
|
|
||||||
|
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||||
|
-moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||||
|
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-drop-auto-width {
|
||||||
|
border-top: 1px solid #aaa;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-drop-auto-width .select2-search {
|
||||||
|
padding-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-drop.select2-drop-above {
|
||||||
|
margin-top: 1px;
|
||||||
|
border-top: 1px solid #aaa;
|
||||||
|
border-bottom: 0;
|
||||||
|
|
||||||
|
-webkit-border-radius: 4px 4px 0 0;
|
||||||
|
-moz-border-radius: 4px 4px 0 0;
|
||||||
|
border-radius: 4px 4px 0 0;
|
||||||
|
|
||||||
|
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||||
|
-moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||||
|
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container .select2-choice div {
|
||||||
|
display: inline-block;
|
||||||
|
width: 18px;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
|
||||||
|
border-left: 1px solid #aaa;
|
||||||
|
-webkit-border-radius: 0 4px 4px 0;
|
||||||
|
-moz-border-radius: 0 4px 4px 0;
|
||||||
|
border-radius: 0 4px 4px 0;
|
||||||
|
|
||||||
|
-webkit-background-clip: padding-box;
|
||||||
|
-moz-background-clip: padding;
|
||||||
|
background-clip: padding-box;
|
||||||
|
|
||||||
|
background: #ccc;
|
||||||
|
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
|
||||||
|
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
|
||||||
|
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
|
||||||
|
background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
|
||||||
|
background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
|
||||||
|
background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container .select2-choice div b {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: url('select2.png') no-repeat 0 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-search {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 26px;
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 4px;
|
||||||
|
padding-right: 4px;
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
z-index: 10000;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-search input {
|
||||||
|
width: 100%;
|
||||||
|
height: auto !important;
|
||||||
|
min-height: 26px;
|
||||||
|
padding: 4px 20px 4px 5px;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
outline: 0;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 1em;
|
||||||
|
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
-webkit-border-radius: 0;
|
||||||
|
-moz-border-radius: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
|
||||||
|
-webkit-box-shadow: none;
|
||||||
|
-moz-box-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
|
|
||||||
|
background: #fff url('select2.png') no-repeat 100% -22px;
|
||||||
|
background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
|
||||||
|
background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||||
|
background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||||
|
background: url('select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
|
||||||
|
background: url('select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
||||||
|
background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-drop.select2-drop-above .select2-search input {
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-search input.select2-active {
|
||||||
|
background: #fff url('select2-spinner.gif') no-repeat 100%;
|
||||||
|
background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
|
||||||
|
background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||||
|
background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||||
|
background: url('select2-spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
|
||||||
|
background: url('select2-spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
||||||
|
background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container-active .select2-choice,
|
||||||
|
.select2-container-active .select2-choices {
|
||||||
|
border: 1px solid #5897fb;
|
||||||
|
outline: none;
|
||||||
|
|
||||||
|
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||||
|
-moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||||
|
box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-dropdown-open .select2-choice {
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
-webkit-box-shadow: 0 1px 0 #fff inset;
|
||||||
|
-moz-box-shadow: 0 1px 0 #fff inset;
|
||||||
|
box-shadow: 0 1px 0 #fff inset;
|
||||||
|
|
||||||
|
-webkit-border-bottom-left-radius: 0;
|
||||||
|
-moz-border-radius-bottomleft: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
|
||||||
|
-webkit-border-bottom-right-radius: 0;
|
||||||
|
-moz-border-radius-bottomright: 0;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
|
||||||
|
background-color: #eee;
|
||||||
|
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
|
||||||
|
background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
|
||||||
|
background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
|
||||||
|
background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
|
||||||
|
background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
|
||||||
|
background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-dropdown-open.select2-drop-above .select2-choice,
|
||||||
|
.select2-dropdown-open.select2-drop-above .select2-choices {
|
||||||
|
border: 1px solid #5897fb;
|
||||||
|
border-top-color: transparent;
|
||||||
|
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, white), color-stop(0.5, #eeeeee));
|
||||||
|
background-image: -webkit-linear-gradient(center top, white 0%, #eeeeee 50%);
|
||||||
|
background-image: -moz-linear-gradient(center top, white 0%, #eeeeee 50%);
|
||||||
|
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
|
||||||
|
background-image: -ms-linear-gradient(bottom, #ffffff 0%,#eeeeee 50%);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
|
||||||
|
background-image: linear-gradient(bottom, #ffffff 0%,#eeeeee 50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-dropdown-open .select2-choice div {
|
||||||
|
background: transparent;
|
||||||
|
border-left: none;
|
||||||
|
filter: none;
|
||||||
|
}
|
||||||
|
.select2-dropdown-open .select2-choice div b {
|
||||||
|
background-position: -18px 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* results */
|
||||||
|
.select2-results {
|
||||||
|
max-height: 200px;
|
||||||
|
padding: 0 0 0 4px;
|
||||||
|
margin: 4px 4px 4px 0;
|
||||||
|
position: relative;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-results ul.select2-result-sub {
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
|
||||||
|
.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
|
||||||
|
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
|
||||||
|
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
|
||||||
|
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
|
||||||
|
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
|
||||||
|
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
|
||||||
|
|
||||||
|
.select2-results li {
|
||||||
|
list-style: none;
|
||||||
|
display: list-item;
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-results li.select2-result-with-children > .select2-result-label {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-results .select2-result-label {
|
||||||
|
padding: 3px 7px 4px;
|
||||||
|
margin: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
min-height: 1em;
|
||||||
|
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-results .select2-highlighted {
|
||||||
|
background: #3875d7;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-results li em {
|
||||||
|
background: #feffde;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-results .select2-highlighted em {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-results .select2-highlighted ul {
|
||||||
|
background: white;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.select2-results .select2-no-results,
|
||||||
|
.select2-results .select2-searching,
|
||||||
|
.select2-results .select2-selection-limit {
|
||||||
|
background: #f4f4f4;
|
||||||
|
display: list-item;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
disabled look for disabled choices in the results dropdown
|
||||||
|
*/
|
||||||
|
.select2-results .select2-disabled.select2-highlighted {
|
||||||
|
color: #666;
|
||||||
|
background: #f4f4f4;
|
||||||
|
display: list-item;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
.select2-results .select2-disabled {
|
||||||
|
background: #f4f4f4;
|
||||||
|
display: list-item;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-results .select2-selected {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-more-results.select2-active {
|
||||||
|
background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-more-results {
|
||||||
|
background: #f4f4f4;
|
||||||
|
display: list-item;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* disabled styles */
|
||||||
|
|
||||||
|
.select2-container.select2-container-disabled .select2-choice {
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
background-image: none;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container.select2-container-disabled .select2-choice div {
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
background-image: none;
|
||||||
|
border-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container.select2-container-disabled .select2-choice abbr {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* multiselect */
|
||||||
|
|
||||||
|
.select2-container-multi .select2-choices {
|
||||||
|
height: auto !important;
|
||||||
|
height: 1%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
cursor: text;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
background-color: #fff;
|
||||||
|
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
|
||||||
|
background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||||
|
background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||||
|
background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||||
|
background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||||
|
background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-locked {
|
||||||
|
padding: 3px 5px 3px 5px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container-multi .select2-choices {
|
||||||
|
min-height: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container-multi.select2-container-active .select2-choices {
|
||||||
|
border: 1px solid #5897fb;
|
||||||
|
outline: none;
|
||||||
|
|
||||||
|
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||||
|
-moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||||
|
box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||||
|
}
|
||||||
|
.select2-container-multi .select2-choices li {
|
||||||
|
float: left;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
.select2-container-multi .select2-choices .select2-search-field {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container-multi .select2-choices .select2-search-field input {
|
||||||
|
padding: 5px;
|
||||||
|
margin: 1px 0;
|
||||||
|
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 100%;
|
||||||
|
color: #666;
|
||||||
|
outline: 0;
|
||||||
|
border: 0;
|
||||||
|
-webkit-box-shadow: none;
|
||||||
|
-moz-box-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
|
||||||
|
background: #fff url('select2-spinner.gif') no-repeat 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-default {
|
||||||
|
color: #999 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container-multi .select2-choices .select2-search-choice {
|
||||||
|
padding: 3px 5px 3px 18px;
|
||||||
|
margin: 3px 0 3px 5px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
line-height: 13px;
|
||||||
|
color: #333;
|
||||||
|
cursor: default;
|
||||||
|
border: 1px solid #aaaaaa;
|
||||||
|
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
border-radius: 3px;
|
||||||
|
|
||||||
|
-webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
||||||
|
-moz-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
||||||
|
box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
||||||
|
|
||||||
|
-webkit-background-clip: padding-box;
|
||||||
|
-moz-background-clip: padding;
|
||||||
|
background-clip: padding-box;
|
||||||
|
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
|
background-color: #e4e4e4;
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 );
|
||||||
|
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
|
||||||
|
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||||
|
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||||
|
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||||
|
background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||||
|
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||||
|
}
|
||||||
|
.select2-container-multi .select2-choices .select2-search-choice span {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
.select2-container-multi .select2-choices .select2-search-choice-focus {
|
||||||
|
background: #d4d4d4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-search-choice-close {
|
||||||
|
display: block;
|
||||||
|
width: 12px;
|
||||||
|
height: 13px;
|
||||||
|
position: absolute;
|
||||||
|
right: 3px;
|
||||||
|
top: 4px;
|
||||||
|
|
||||||
|
font-size: 1px;
|
||||||
|
outline: none;
|
||||||
|
background: url('select2.png') right top no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container-multi .select2-search-choice-close {
|
||||||
|
left: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
|
||||||
|
background-position: right -11px;
|
||||||
|
}
|
||||||
|
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
|
||||||
|
background-position: right -11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* disabled styles */
|
||||||
|
.select2-container-multi.select2-container-disabled .select2-choices{
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
background-image: none;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
|
||||||
|
padding: 3px 5px 3px 5px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
background-image: none;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
|
||||||
|
background:none;
|
||||||
|
}
|
||||||
|
/* end multiselect */
|
||||||
|
|
||||||
|
|
||||||
|
.select2-result-selectable .select2-match,
|
||||||
|
.select2-result-unselectable .select2-match {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-offscreen, .select2-offscreen:focus {
|
||||||
|
clip: rect(0 0 0 0);
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
position: absolute;
|
||||||
|
outline: 0;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-display-none {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select2-measure-scrollbar {
|
||||||
|
position: absolute;
|
||||||
|
top: -10000px;
|
||||||
|
left: -10000px;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
/* Retina-ize icons */
|
||||||
|
|
||||||
|
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
|
||||||
|
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
|
||||||
|
background-image: url('select2x2.png') !important;
|
||||||
|
background-repeat: no-repeat !important;
|
||||||
|
background-size: 60px 40px !important;
|
||||||
|
}
|
||||||
|
.select2-search input {
|
||||||
|
background-position: 100% -21px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
hledger-web/static/select2.min.js
vendored
Executable file
22
hledger-web/static/select2.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
BIN
hledger-web/static/select2.png
Executable file
BIN
hledger-web/static/select2.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 613 B |
Loading…
Reference in New Issue
Block a user