parent
3b3f8234dc
commit
8690b88f0a
@ -1,181 +1,198 @@ |
||||
.chatboxmain { |
||||
position: fixed; |
||||
width: auto; |
||||
z-index: 9000; |
||||
bottom: 0px; |
||||
right: 20px; |
||||
display: block; |
||||
position: fixed; |
||||
width: auto; |
||||
z-index: 9000; |
||||
bottom: 0px; |
||||
right: 20px; |
||||
display: block; |
||||
} |
||||
|
||||
.chatboxheadmain { |
||||
color: #ffffff; |
||||
background-color: #000; |
||||
min-height: 34px; |
||||
padding: 0 10px; |
||||
color: #ffffff; |
||||
background-color: #000; |
||||
min-height: 34px; |
||||
padding: 0 10px; |
||||
} |
||||
|
||||
#chatboxtitlemain { |
||||
font-weight: normal; |
||||
float: left; |
||||
font-size: 12px; |
||||
padding-top: 2px; |
||||
cursor:pointer; |
||||
font-weight: normal; |
||||
float: left; |
||||
font-size: 12px; |
||||
padding-top: 2px; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.user_status_main { |
||||
width:18px; |
||||
display:inline; |
||||
float:left; |
||||
width: 18px; |
||||
display: inline; |
||||
float: left; |
||||
} |
||||
|
||||
.chatbox { |
||||
position: fixed; |
||||
position:expression("absolute"); |
||||
width: 320px; |
||||
display:none; |
||||
z-index: 9000; |
||||
position: fixed; |
||||
position: expression("absolute"); |
||||
width: 320px; |
||||
display: none; |
||||
z-index: 9000; |
||||
} |
||||
|
||||
.chatbox-common { |
||||
word-wrap: break-word; |
||||
} |
||||
|
||||
.chatboxmessage_me { |
||||
background-color: #4080ff; |
||||
color: #fff; |
||||
width: 80%; |
||||
float:right !important; |
||||
float: right !important; |
||||
border-radius: 12px; |
||||
} |
||||
|
||||
.chatboxmessage { |
||||
background-color: #ebedf2; |
||||
color: #2a2f35; |
||||
margin-left:1em; |
||||
margin-left: 1em; |
||||
width: 80%; |
||||
float:left; |
||||
float: left; |
||||
border-radius: 12px; |
||||
} |
||||
|
||||
.chatboxmessagecontent { |
||||
} |
||||
|
||||
.chatboxmessage_me .chatboxmessagecontent a { |
||||
color: #ffffff; |
||||
} |
||||
|
||||
.chatboxcontent { |
||||
font-family: arial,sans-serif; |
||||
font-size: 13px; |
||||
color: #333333; |
||||
height:200px; |
||||
overflow-y:auto; |
||||
overflow-x:auto; |
||||
padding:7px; |
||||
border-left:1px solid #cccccc; |
||||
border-right:1px solid #cccccc; |
||||
border-bottom:1px solid #eeeeee; |
||||
background-color: #ffffff; |
||||
line-height: 1.3em; |
||||
font-family: arial, sans-serif; |
||||
font-size: 13px; |
||||
color: #333333; |
||||
max-height: 200px; |
||||
overflow-y: auto; |
||||
overflow-x: auto; |
||||
padding: 7px; |
||||
border-left: 1px solid #cccccc; |
||||
border-right: 1px solid #cccccc; |
||||
border-bottom: 1px solid #eeeeee; |
||||
background-color: #ffffff; |
||||
line-height: 1.3em; |
||||
} |
||||
|
||||
.chatboxcontent .alert { |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
.user_status { |
||||
width:8px; |
||||
display:inline-block; |
||||
margin-right: 5px; |
||||
width: 8px; |
||||
display: inline-block; |
||||
margin-right: 5px; |
||||
} |
||||
|
||||
.chatimage { |
||||
display: inline-block; |
||||
margin-right: 5px; |
||||
display: inline-block; |
||||
margin-right: 5px; |
||||
} |
||||
|
||||
.chatboxtitle { |
||||
font-weight: normal; |
||||
display: inline-block; |
||||
font-size: 10px; |
||||
width: auto; |
||||
cursor:pointer; |
||||
overflow: hidden; |
||||
padding-left: 2px; |
||||
text-overflow: ellipsis; |
||||
white-space: nowrap; |
||||
line-height: 10px; |
||||
font-weight: normal; |
||||
display: inline-block; |
||||
font-size: 10px; |
||||
width: auto; |
||||
cursor: pointer; |
||||
overflow: hidden; |
||||
padding-left: 2px; |
||||
text-overflow: ellipsis; |
||||
white-space: nowrap; |
||||
line-height: 10px; |
||||
} |
||||
|
||||
.chatboxhead { |
||||
/* background-color: #222; */ |
||||
padding: 5px; |
||||
color: #ffffff; |
||||
border-right:1px solid #222; |
||||
border-left:1px solid #222; |
||||
background-color: #222; |
||||
background-repeat: repeat-x; |
||||
background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222)); |
||||
background-image: -moz-linear-gradient(top, #333333, #222222); |
||||
background-image: -ms-linear-gradient(top, #333333, #222222); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222)); |
||||
background-image: -webkit-linear-gradient(top, #333333, #222222); |
||||
background-image: -o-linear-gradient(top, #333333, #222222); |
||||
background-image: linear-gradient(top, #333333, #222222); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); |
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); |
||||
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); |
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); |
||||
/* background-color: #222; */ |
||||
padding: 5px; |
||||
color: #ffffff; |
||||
border-right: 1px solid #222; |
||||
border-left: 1px solid #222; |
||||
background-color: #222; |
||||
background-repeat: repeat-x; |
||||
background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222)); |
||||
background-image: -moz-linear-gradient(top, #333333, #222222); |
||||
background-image: -ms-linear-gradient(top, #333333, #222222); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222)); |
||||
background-image: -webkit-linear-gradient(top, #333333, #222222); |
||||
background-image: -o-linear-gradient(top, #333333, #222222); |
||||
background-image: linear-gradient(top, #333333, #222222); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); |
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); |
||||
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); |
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); |
||||
} |
||||
|
||||
.chatboxblink { |
||||
background-color: #FF921F; |
||||
border-right:1px solid #EF7A00; |
||||
border-left:1px solid #EF7A00; |
||||
background-color: #FF921F; |
||||
border-right: 1px solid #EF7A00; |
||||
border-left: 1px solid #EF7A00; |
||||
background-repeat: repeat-x; |
||||
background-image: -khtml-gradient(linear, left top, left bottom, from(#FF921F), to(#FF921F)); |
||||
background-image: -moz-linear-gradient(top, #FF921F, #FFAC55); |
||||
background-image: -ms-linear-gradient(top, #FF921F, #FF921F); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #FF921F), color-stop(100%, #FF921F)); |
||||
background-image: -webkit-linear-gradient(top, #FF921F, #FF921F); |
||||
background-image: -o-linear-gradient(top, #FF921F, #FF921F); |
||||
background-image: linear-gradient(top, #FF921F, #FF921F); |
||||
background-image: -khtml-gradient(linear, left top, left bottom, from(#FF921F), to(#FF921F)); |
||||
background-image: -moz-linear-gradient(top, #FF921F, #FFAC55); |
||||
background-image: -ms-linear-gradient(top, #FF921F, #FF921F); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #FF921F), color-stop(100%, #FF921F)); |
||||
background-image: -webkit-linear-gradient(top, #FF921F, #FF921F); |
||||
background-image: -o-linear-gradient(top, #FF921F, #FF921F); |
||||
background-image: linear-gradient(top, #FF921F, #FF921F); |
||||
} |
||||
|
||||
.chatboxinput { |
||||
padding: 5px; |
||||
background-color: #ffffff; |
||||
border-left:1px solid #cccccc; |
||||
border-right:1px solid #cccccc; |
||||
border-bottom:1px solid #cccccc; |
||||
padding: 5px; |
||||
background-color: #ffffff; |
||||
border-left: 1px solid #cccccc; |
||||
border-right: 1px solid #cccccc; |
||||
border-bottom: 1px solid #cccccc; |
||||
} |
||||
|
||||
.chatboxtextarea { |
||||
width: 300px; |
||||
height:44px; |
||||
padding:3px 0pt 3px 3px; |
||||
border: 1px solid #eeeeee; |
||||
margin: 1px; |
||||
overflow:hidden; |
||||
width: 300px; |
||||
height: 44px; |
||||
padding: 3px 0pt 3px 3px; |
||||
border: 1px solid #eeeeee; |
||||
margin: 1px; |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.chatboxtextareaselected { |
||||
border: 2px solid #f99d39; |
||||
margin:0; |
||||
border: 2px solid #f99d39; |
||||
margin: 0; |
||||
} |
||||
|
||||
.chatboxinfo { |
||||
margin-left:-1em; |
||||
color:#666666; |
||||
margin-left: -1em; |
||||
color: #666666; |
||||
} |
||||
|
||||
.chatboxmessagefrom { |
||||
margin-left:-1em; |
||||
font-weight: bold; |
||||
margin-left: -1em; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.chatboxoptions { |
||||
float: right; |
||||
float: right; |
||||
} |
||||
|
||||
.chatboxoptions a { |
||||
text-decoration: none; |
||||
color: white; |
||||
font-weight:bold; |
||||
font-family:Verdana,Arial,"Bitstream Vera Sans",sans-serif; |
||||
text-decoration: none; |
||||
color: white; |
||||
font-weight: bold; |
||||
font-family: Verdana, Arial, "Bitstream Vera Sans", sans-serif; |
||||
} |
||||
|
||||
.chatboxoptions a:hover { |
||||
background-color: #aaa; |
||||
background-color: #aaa; |
||||
} |
||||
|
||||
.chatbox_checks { |
||||
float:right; |
||||
float: right; |
||||
} |
||||
|
||||
.chatbox_checked { |
||||
color: #13A7F0; |
||||
color: #13A7F0; |
||||
} |
||||
|
@ -1,306 +1,110 @@ |
||||
/**** |
||||
* |
||||
* frameReady: Remote function calling for jQuery |
||||
* |
||||
* Version 1.2.1 |
||||
* |
||||
* Copyright (c) 2007 Daemach (John Wilson) <daemach@gmail.com>, http://ideamill.synaptrixgroup.com
|
||||
* Licensed under the MIT License: |
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* |
||||
* Credit John Resig and his excellent book for the ready function concepts. |
||||
* |
||||
* Credit to Mike Alsup for the logging code. |
||||
* ============================================================================================ |
||||
* Usage: $.frameReady(function (function),target (string)[,options (map)][,callback (function)]); |
||||
* |
||||
* Function: (function/required) An anonymous function to be run within the target frame. |
||||
* |
||||
* Target: (string/required) The target frame. This must be a window object name (in quotes), |
||||
* so work from the top down. If you have 3 frames named topFrame, navFrame, mainFrame, and |
||||
* an iframe inside of mainframe named iFrame, use "top.topFrame", "top.navFrame", |
||||
* "top.mainFrame", "top.mainFrame.iFrame" respectively. |
||||
* |
||||
* Options: (object/optional) Map of options in object literal form. Options include: |
||||
* |
||||
* remote: (boolean/ default true) Run the function in the context of the target frame. |
||||
* If true, jQuery will be loaded in the target frame automatically and you can run |
||||
* jQuery selectors in the target frame as if they were local. ie: $("p") instead of |
||||
* $("p",top.mainFrame.document). If false, jQuery will not be loaded automatically |
||||
* and you must use a context in jquery selectors. |
||||
* |
||||
* data: (object) An object to be passed as-is to the target frame. This is where you pass |
||||
* variable data, rather than in a closure. |
||||
* |
||||
* load: (object or array of objects) jquery is loaded by default. You can pass a single object to |
||||
* frameReady, or an array of objects that will be loaded and tested in order. 2 types |
||||
* of files can be loaded. Scripts and stylesheets: |
||||
* |
||||
* scripts: {type:"script", src:"/js/myscript.js", id:"_ms", test:"afunction"} |
||||
* stylesheets: {type:"stylesheet", src:"/css/mycss.css", id:"_ss"} |
||||
* |
||||
* type: (string/required) "script" for script files, "stylesheet" for stylesheets. |
||||
* src: (string/required) The source of the file, ie: /js/myscript.js. |
||||
* id: (string/optional) An id for the id attribute. If one isn't provided it |
||||
* will be generated. |
||||
* test: (sting/optional) The name of a function that should exist once the script |
||||
* is loaded properly. Until this function becomes available, the script will |
||||
* be considered not ready and no other files will be loaded. If a test is not |
||||
* provided, the next file will be loaded immediately. Tests are not useful |
||||
* with stylesheets. |
||||
* |
||||
* One gotcha: You must have something other than space characters within the body tags of |
||||
* target frame documents for frameReady to work properly. A single character is enough. |
||||
* The reason for this is a workaround for an iFrame bug in Firefox, of all things. |
||||
* ============================================================================================== |
||||
* |
||||
* Example: |
||||
* |
||||
* $.frameReady(function(){ |
||||
* $("<div>I am a div element</div>").prependTo("body"); |
||||
* }, "top.mainFrame", |
||||
* { load: [ |
||||
* {type:"script",id:"_fr",src:"/js/jquery.frameReady.js",test: "$.frameReady"}, |
||||
* {type:"stylesheet",id:"_ss",src:"frameReady.css"} |
||||
* ] } |
||||
* ); |
||||
* |
||||
* |
||||
* Release Notes: |
||||
* |
||||
* 1.2.0 - Added provision for a local callback function; |
||||
* Added functionality to reset frame information if frame unloads for any reason; |
||||
* |
||||
* 1.1.0 - Added the ability to load scripts and stylesheets inside the target frame before |
||||
* processing function stack; |
||||
* |
||||
****/ |
||||
|
||||
if (typeof $daemach == "undefined") { |
||||
$daemach = {}; |
||||
$daemach.debug = false; // set this to true to enable logging
|
||||
$daemach.log = function() { |
||||
if (!top.window.console || !top.window.console.log || !$daemach.debug) { |
||||
return; |
||||
} else { |
||||
top.window.console.log([].join.call(arguments,'')); |
||||
}; |
||||
}; |
||||
$daemach.time = function() { |
||||
if (!top.window.console || !top.window.console.time || !$daemach.debug) { |
||||
return; |
||||
} else { |
||||
top.window.console.time([].join.call(arguments,'')); |
||||
}; |
||||
}; |
||||
$daemach.timeEnd = function() { |
||||
if (!top.window.console || !top.window.console.timeEnd || !$daemach.debug) { |
||||
return; |
||||
} else { |
||||
top.window.console.timeEnd([].join.call(arguments,'')); |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
if (typeof $daemach["frameReady"] == "undefined") { |
||||
$daemach["frameReady"] = {}; |
||||
}; |
||||
|
||||
jQuery.frameReady = function(f,t,r,j) { |
||||
|
||||
/************************************************************ |
||||
You must specify the path to your jquery.js file below! |
||||
*************************************************************/ |
||||
|
||||
//var jQueryPath = "/main/inc/lib/javascript/jquery.js";
|
||||
var jQueryPath = jQueryFrameReadyConfigPath; // Define this configuration parameter before loading this script.
|
||||
|
||||
var u = "undefined"; |
||||
var $fr = $daemach["frameReady"]; |
||||
var fn = t.split(".").join("_"); |
||||
// create a branch
|
||||
if (typeof $fr[fn] == u) { |
||||
$fr[fn] = {}; |
||||
$fr[fn]["settings"] = { |
||||
remote: true, |
||||
jquery: true, |
||||
load: [ {type:"script",id:"_jq", src:jQueryPath, test:"jQuery"} ], |
||||
bLoaded: false, |
||||
loadInit: [], |
||||
data: {}, |
||||
callback: false |
||||
}; |
||||
$fr[fn]["target"] = t; |
||||
}; |
||||
|
||||
var fr = $fr[fn]; |
||||
var frs = fr["settings"]; |
||||
|
||||
if (fr.done) { |
||||
$daemach.log(fr.target + " is ready. Running functions now."); |
||||
return (frs.remote) ? eval(fr.target).eval("(" + f.toString() + ")()") : f(); |
||||
}; |
||||
|
||||
// process arguments
|
||||
|
||||
for (var a=2;a<arguments.length;a++){ |
||||
var arg = arguments[a]; |
||||
|
||||
if ($.isFunction(arg)){ |
||||
frs.callback = arg; |
||||
} else if (typeof arg == "object") { |
||||
if (typeof arg.remote !== u) { |
||||
frs.remote = arg.remote; |
||||
}; |
||||
if (typeof arg.jquery !== u) { |
||||
frs.jquery = arg.jquery; |
||||
}; |
||||
if (typeof arg.data !== u) { |
||||
frs.data = arg.data; |
||||
}; |
||||
|
||||
// if we're not running functions in the remote frame itself, no need for jQuery
|
||||
if (!frs.remote || !frs.jquery) { |
||||
frs.load.pop(); |
||||
}; |
||||
|
||||
if (typeof arg.load !== u) { |
||||
var bl = true; |
||||
if (arg.load.constructor == Array && arg.load.length){ |
||||
for (var i=0;i<arg.load.length;i++){ |
||||
bl = true; |
||||
for (var h=0;h<frs.load.length;h++){ |
||||
if (frs.load[h].src == arg.load[i].src) { bl=false; }; |
||||
}; |
||||
if (bl) { frs.load.push(arg.load[i]); }; |
||||
}; |
||||
} else if (typeof arg.load == "object") { |
||||
for (var h=0;h<frs.load.length;h++){ |
||||
if (frs.load[h].src == arg.load.src) { bl=false; }; |
||||
}; |
||||
if (bl) { frs.load.push(arg.load); }; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
if (fr.timer) { |
||||
fr.ready.push(f); |
||||
} else { |
||||
fr.ready=[f]; |
||||
if (typeof addEvent !== "undefined"){ addEvent(window,"load",function(){ jQuery.isFrameReady(fn); }); }; |
||||
fr.timer = setInterval(function(){ jQuery.isFrameReady(fn); },13); |
||||
}; |
||||
}; |
||||
|
||||
jQuery.isFrameReady = function(fn){ |
||||
var u = "undefined"; |
||||
var $d = $daemach; |
||||
var fr = $d["frameReady"][fn]; |
||||
var frs = fr["settings"]; |
||||
|
||||
if (fr.done) { return false; }; |
||||
|
||||
var fx = eval(fr.target); |
||||
|
||||
$d.log(fn, ": New Pass. Checking target"); |
||||
// make sure we have a target
|
||||
if (typeof fx !== "undefined") { |
||||
|
||||
$d.log(fn, ": Found target. Checking DOM"); |
||||
|
||||
try { |
||||
var fd = fx.document; |
||||
} catch (ex) { } |
||||
|
||||
// make sure we have a DOM
|
||||
if (fd && fd.getElementsByTagName && fd.getElementById && fd.body && fd.body.innerHTML.length) { |
||||
|
||||
$d.log(fn, ": Found DOM"); |
||||
|
||||
if (frs.load.length && !frs.bLoaded){ |
||||
for (var i=0;i<frs.load.length;i++){ |
||||
var s = frs.load[i]; |
||||
var _test; |
||||
try { _test = eval('typeof fx.'+s.test+ ' !== "undefined"'); } |
||||
catch(ex){ _test = false;} |
||||
finally { $d.log(fn, ": Running test for script ",i,". ", (_test || !s.test) ? "Passed.":"Failed."); }; |
||||
|
||||
if ((_test || !s.test) && frs.loadInit[i]) { |
||||
frs.bLoaded = (typeof s.test == u) ? true : _test; |
||||
continue; |
||||
} else { |
||||
frs.bLoaded = false; |
||||
if (typeof frs.loadInit[i] == u){ |
||||
var id = s.id || "frs_"+i; |
||||
switch (s.type) { |
||||
case "script" : |
||||
$d.log(fn, ": Loading script "+ i + " (" + s.src + ")"); |
||||
var ele=fd.createElement('script'); |
||||
ele.setAttribute('id', id); |
||||
ele.setAttribute('src', s.src); |
||||
|
||||
if (fd.getElementsByTagName("body") && fd.getElementsByTagName("body")[0]) { |
||||
fd.getElementsByTagName("body")[0].appendChild(ele); |
||||
} |
||||
|
||||
frs.loadInit[i] = true; |
||||
break; |
||||
case "stylesheet" : |
||||
$d.log(fn, ": Loading stylesheet "+ i + " (" + s.src + ")"); |
||||
var ele=fd.createElement('link'); |
||||
ele.setAttribute('href', s.src); |
||||
ele.setAttribute('rel', "stylesheet"); |
||||
ele.setAttribute('type', "text/css"); |
||||
fd.getElementsByTagName("body")[0].appendChild(ele); |
||||
frs.loadInit[i] = true; |
||||
break; |
||||
default : |
||||
$d.log(fn, ": Script "+i+" has a bad or missing type attribute..." ); |
||||
}; |
||||
}; |
||||
break; |
||||
}; |
||||
}; |
||||
} else { |
||||
clearInterval(fr.timer); |
||||
fr.timer = null; |
||||
for (i in frs.data){ |
||||
if (!fx.frData){ |
||||
fx.frData={}; |
||||
} |
||||
fx.frData[i] = frs.data[i]; |
||||
}; |
||||
|
||||
fr.ready.push(function(){ window.frameReadyUnload = function(root, fn){ $(window).bind("unload",function(){ root.jQuery.frameReady.unload(fn); }); } }); |
||||
|
||||
$d.log(fn, ": Processing function stack:"); |
||||
for (var i=0; i<fr.ready.length;i++){ |
||||
(frs.remote) ? fx.eval("(" + fr.ready[i].toString() + ")()") : fr.ready[i](); |
||||
}; |
||||
|
||||
fx.frameReadyUnload(window,fn); |
||||
|
||||
$d.log(fn, ": Function stack processing complete."); |
||||
|
||||
// we're done here. let's have a beer.
|
||||
fr.ready = null; |
||||
fr.done=true; |
||||
|
||||
if (frs.callback){ |
||||
$d.log(fn, ": Found a callback. Executing..."); |
||||
frs.callback(); |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
$d.log(fn, ":"); |
||||
}; |
||||
|
||||
jQuery.frameReady.unload = function(fn){ |
||||
$daemach.log("Frame " + fn + " is unloading. Resetting state."); |
||||
$daemach["frameReady"][fn].done = false; |
||||
$daemach["frameReady"][fn]["settings"].bLoaded = false; |
||||
$daemach["frameReady"][fn]["settings"].loadInit = []; |
||||
}; |
||||
/** |
||||
* @param {function} callback |
||||
* @param {string} target |
||||
* @param {Array} resources |
||||
* @constructor |
||||
*/ |
||||
$.frameReady = function (callback, targetSelector, resources) { |
||||
/** |
||||
* @type {window} |
||||
*/ |
||||
var targetWindow = document.querySelector(targetSelector); |
||||
/** |
||||
* @type {Document} |
||||
*/ |
||||
var targetDocument = null; |
||||
|
||||
var scripts = resources.filter(function (resource) { |
||||
return resource.type === 'script'; |
||||
}); |
||||
var stylesheets = resources.filter(function (resource) { |
||||
return resource.type === 'stylesheet'; |
||||
}); |
||||
|
||||
var scriptsCount = (function () { |
||||
var count = 0; |
||||
|
||||
/** |
||||
* @param {Object} parentScript |
||||
*/ |
||||
function countScripts(parentScript) { |
||||
count++; |
||||
|
||||
if (!parentScript.hasOwnProperty('deps')) { |
||||
return; |
||||
} |
||||
|
||||
parentScript.deps.forEach(countScripts); |
||||
} |
||||
|
||||
scripts.forEach(countScripts); |
||||
|
||||
return count; |
||||
})(); |
||||
var scripsLoadedCount = 0; |
||||
|
||||
targetWindow.onload = function () { |
||||
scripsLoadedCount = 0; |
||||
|
||||
targetDocument = targetWindow.contentDocument; |
||||
|
||||
scripts.forEach(function (script) { |
||||
createScript(script); |
||||
}); |
||||
|
||||
stylesheets.forEach(function (stylesheet) { |
||||
createStylesheet(stylesheet); |
||||
}); |
||||
}; |
||||
|
||||
/** |
||||
* @param {Object} script |
||||
*/ |
||||
function createScript(script) { |
||||
/** |
||||
* @type {HTMLScriptElement} |
||||
*/ |
||||
var elParent = targetWindow.contentDocument.createElement('script'); |
||||
elParent.async = false; |
||||
elParent.onload = function () { |
||||
scripsLoadedCount++; |
||||
|
||||
if (!script.hasOwnProperty('deps')) { |
||||
tryExecuteCallback(); |
||||
|
||||
return; |
||||
} |
||||
|
||||
script.deps.forEach(function (scriptB) { |
||||
createScript(scriptB); |
||||
}); |
||||
}; |
||||
elParent.setAttribute('src', script.src); |
||||
|
||||
targetDocument.body.appendChild(elParent); |
||||
} |
||||
|
||||
/** |
||||
* @param {Object} stylesheet |
||||
*/ |
||||
function createStylesheet(stylesheet) { |
||||
/** |
||||
* @type {HTMLLinkElement} |
||||
*/ |
||||
var el = targetWindow.contentDocument.createElement('link'); |
||||
el.setAttribute('href', stylesheet.src); |
||||
el.setAttribute('rel', "stylesheet"); |
||||
el.setAttribute('type', "text/css"); |
||||
if (targetDocument.head) { |
||||
targetDocument.head.appendChild(el); |
||||
} |
||||
} |
||||
|
||||
function tryExecuteCallback() { |
||||
if (scripsLoadedCount < scriptsCount) { |
||||
return; |
||||
} |
||||
|
||||
targetWindow.contentWindow.eval('(' + callback.toString() + ')();'); |
||||
} |
||||
}; |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,28 @@ |
||||
/* |
||||
OverlappingMarkerSpiderfier |
||||
https://github.com/jawj/OverlappingMarkerSpiderfier
|
||||
Copyright (c) 2011 - 2017 George MacKerron |
||||
Released under the MIT licence: http://opensource.org/licenses/mit-license
|
||||
Note: The Google Maps API v3 must be included *before* this code |
||||
*/ |
||||
(function(){var m,t,w,y,u,z={}.hasOwnProperty,A=[].slice;this.OverlappingMarkerSpiderfier=function(){function r(a,d){var b,f,e;this.map=a;null==d&&(d={});null==this.constructor.N&&(this.constructor.N=!0,h=google.maps,l=h.event,p=h.MapTypeId,c.keepSpiderfied=!1,c.ignoreMapClick=!1,c.markersWontHide=!1,c.markersWontMove=!1,c.basicFormatEvents=!1,c.nearbyDistance=20,c.circleSpiralSwitchover=9,c.circleFootSeparation=23,c.circleStartAngle=x/12,c.spiralFootSeparation=26,c.spiralLengthStart=11,c.spiralLengthFactor= |
||||
4,c.spiderfiedZIndex=h.Marker.MAX_ZINDEX+2E4,c.highlightedLegZIndex=h.Marker.MAX_ZINDEX+1E4,c.usualLegZIndex=h.Marker.MAX_ZINDEX+1,c.legWeight=1.5,c.legColors={usual:{},highlighted:{}},e=c.legColors.usual,f=c.legColors.highlighted,e[p.HYBRID]=e[p.SATELLITE]="#fff",f[p.HYBRID]=f[p.SATELLITE]="#f00",e[p.TERRAIN]=e[p.ROADMAP]="#444",f[p.TERRAIN]=f[p.ROADMAP]="#f00",this.constructor.j=function(a){return this.setMap(a)},this.constructor.j.prototype=new h.OverlayView,this.constructor.j.prototype.draw=function(){}); |
||||
for(b in d)z.call(d,b)&&(f=d[b],this[b]=f);this.g=new this.constructor.j(this.map);this.C();this.c={};this.B=this.l=null;this.addListener("click",function(a,b){return l.trigger(a,"spider_click",b)});this.addListener("format",function(a,b){return l.trigger(a,"spider_format",b)});this.ignoreMapClick||l.addListener(this.map,"click",function(a){return function(){return a.unspiderfy()}}(this));l.addListener(this.map,"maptypeid_changed",function(a){return function(){return a.unspiderfy()}}(this));l.addListener(this.map, |
||||
"zoom_changed",function(a){return function(){a.unspiderfy();if(!a.basicFormatEvents)return a.h()}}(this))}var l,h,m,v,p,c,t,x,u;c=r.prototype;t=[r,c];m=0;for(v=t.length;m<v;m++)u=t[m],u.VERSION="1.0.3";x=2*Math.PI;h=l=p=null;r.markerStatus={SPIDERFIED:"SPIDERFIED",SPIDERFIABLE:"SPIDERFIABLE",UNSPIDERFIABLE:"UNSPIDERFIABLE",UNSPIDERFIED:"UNSPIDERFIED"};c.C=function(){this.a=[];this.s=[]};c.addMarker=function(a,d){a.setMap(this.map);return this.trackMarker(a,d)};c.trackMarker=function(a,d){var b;if(null!= |
||||
a._oms)return this;a._oms=!0;b=[l.addListener(a,"click",function(b){return function(d){return b.V(a,d)}}(this))];this.markersWontHide||b.push(l.addListener(a,"visible_changed",function(b){return function(){return b.D(a,!1)}}(this)));this.markersWontMove||b.push(l.addListener(a,"position_changed",function(b){return function(){return b.D(a,!0)}}(this)));null!=d&&b.push(l.addListener(a,"spider_click",d));this.s.push(b);this.a.push(a);this.basicFormatEvents?this.trigger("format",a,this.constructor.markerStatus.UNSPIDERFIED): |
||||
(this.trigger("format",a,this.constructor.markerStatus.UNSPIDERFIABLE),this.h());return this};c.D=function(a,d){if(!this.J&&!this.K)return null==a._omsData||!d&&a.getVisible()||this.unspiderfy(d?a:null),this.h()};c.getMarkers=function(){return this.a.slice(0)};c.removeMarker=function(a){this.forgetMarker(a);return a.setMap(null)};c.forgetMarker=function(a){var d,b,f,e,g;null!=a._omsData&&this.unspiderfy();d=this.A(this.a,a);if(0>d)return this;g=this.s.splice(d,1)[0];b=0;for(f=g.length;b<f;b++)e=g[b], |
||||
l.removeListener(e);delete a._oms;this.a.splice(d,1);this.h();return this};c.removeAllMarkers=c.clearMarkers=function(){var a,d,b,f;f=this.getMarkers();this.forgetAllMarkers();a=0;for(d=f.length;a<d;a++)b=f[a],b.setMap(null);return this};c.forgetAllMarkers=function(){var a,d,b,f,e,g,c,q;this.unspiderfy();q=this.a;a=d=0;for(b=q.length;d<b;a=++d){g=q[a];e=this.s[a];c=0;for(a=e.length;c<a;c++)f=e[c],l.removeListener(f);delete g._oms}this.C();return this};c.addListener=function(a,d){var b;(null!=(b=this.c)[a]? |
||||
b[a]:b[a]=[]).push(d);return this};c.removeListener=function(a,d){var b;b=this.A(this.c[a],d);0>b||this.c[a].splice(b,1);return this};c.clearListeners=function(a){this.c[a]=[];return this};c.trigger=function(){var a,d,b,f,e,g;d=arguments[0];a=2<=arguments.length?A.call(arguments,1):[];d=null!=(b=this.c[d])?b:[];g=[];f=0;for(e=d.length;f<e;f++)b=d[f],g.push(b.apply(null,a));return g};c.L=function(a,d){var b,f,e,g,c;g=this.circleFootSeparation*(2+a)/x;f=x/a;c=[];for(b=e=0;0<=a?e<a:e>a;b=0<=a?++e:--e)b= |
||||
this.circleStartAngle+b*f,c.push(new h.Point(d.x+g*Math.cos(b),d.y+g*Math.sin(b)));return c};c.M=function(a,d){var b,f,e,c,k;c=this.spiralLengthStart;b=0;k=[];for(f=e=0;0<=a?e<a:e>a;f=0<=a?++e:--e)b+=this.spiralFootSeparation/c+5E-4*f,f=new h.Point(d.x+c*Math.cos(b),d.y+c*Math.sin(b)),c+=x*this.spiralLengthFactor/b,k.push(f);return k};c.V=function(a,d){var b,f,e,c,k,q,n,l,h;(q=null!=a._omsData)&&this.keepSpiderfied||this.unspiderfy();if(q||this.map.getStreetView().getVisible()||"GoogleEarthAPI"=== |
||||
this.map.getMapTypeId())return this.trigger("click",a,d);q=[];n=[];b=this.nearbyDistance;l=b*b;k=this.f(a.position);h=this.a;b=0;for(f=h.length;b<f;b++)e=h[b],null!=e.map&&e.getVisible()&&(c=this.f(e.position),this.i(c,k)<l?q.push({R:e,G:c}):n.push(e));return 1===q.length?this.trigger("click",a,d):this.W(q,n)};c.markersNearMarker=function(a,d){var b,f,e,c,k,q,n,l,h,m;null==d&&(d=!1);if(null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearMarker";b=this.nearbyDistance; |
||||
n=b*b;k=this.f(a.position);q=[];l=this.a;b=0;for(f=l.length;b<f&&!(e=l[b],e!==a&&null!=e.map&&e.getVisible()&&(c=this.f(null!=(h=null!=(m=e._omsData)?m.v:void 0)?h:e.position),this.i(c,k)<n&&(q.push(e),d)));b++);return q};c.F=function(){var a,d,b,f,e,c,k,l,n,h,m;if(null==this.g.getProjection())throw"Must wait for 'idle' event on map before calling markersNearAnyOtherMarker";n=this.nearbyDistance;n*=n;var p;e=this.a;p=[];h=0;for(d=e.length;h<d;h++)f=e[h],p.push({H:this.f(null!=(a=null!=(b=f._omsData)? |
||||
b.v:void 0)?a:f.position),b:!1});h=this.a;a=b=0;for(f=h.length;b<f;a=++b)if(d=h[a],null!=d.getMap()&&d.getVisible()&&(c=p[a],!c.b))for(m=this.a,d=l=0,e=m.length;l<e;d=++l)if(k=m[d],d!==a&&null!=k.getMap()&&k.getVisible()&&(k=p[d],(!(d<a)||k.b)&&this.i(c.H,k.H)<n)){c.b=k.b=!0;break}return p};c.markersNearAnyOtherMarker=function(){var a,d,b,c,e,g,k;e=this.F();g=this.a;k=[];a=d=0;for(b=g.length;d<b;a=++d)c=g[a],e[a].b&&k.push(c);return k};c.setImmediate=function(a){return window.setTimeout(a,0)};c.h= |
||||
function(){if(!this.basicFormatEvents&&null==this.l)return this.l=this.setImmediate(function(a){return function(){a.l=null;return null!=a.g.getProjection()?a.w():null!=a.B?void 0:a.B=l.addListenerOnce(a.map,"idle",function(){return a.w()})}}(this))};c.w=function(){var a,d,b,c,e,g,k;if(this.basicFormatEvents){e=[];d=0;for(b=markers.length;d<b;d++)c=markers[d],a=null!=c._omsData?"SPIDERFIED":"UNSPIDERFIED",e.push(this.trigger("format",c,this.constructor.markerStatus[a]));return e}e=this.F();g=this.a; |
||||
k=[];a=b=0;for(d=g.length;b<d;a=++b)c=g[a],a=null!=c._omsData?"SPIDERFIED":e[a].b?"SPIDERFIABLE":"UNSPIDERFIABLE",k.push(this.trigger("format",c,this.constructor.markerStatus[a]));return k};c.P=function(a){return{m:function(d){return function(){return a._omsData.o.setOptions({strokeColor:d.legColors.highlighted[d.map.mapTypeId],zIndex:d.highlightedLegZIndex})}}(this),u:function(d){return function(){return a._omsData.o.setOptions({strokeColor:d.legColors.usual[d.map.mapTypeId],zIndex:d.usualLegZIndex})}}(this)}}; |
||||
c.W=function(a,d){var b,c,e,g,k,q,n,m,p,r;this.J=!0;r=a.length;b=this.T(function(){var b,d,c;c=[];b=0;for(d=a.length;b<d;b++)m=a[b],c.push(m.G);return c}());g=r>=this.circleSpiralSwitchover?this.M(r,b).reverse():this.L(r,b);b=function(){var b,d,f;f=[];b=0;for(d=g.length;b<d;b++)e=g[b],c=this.U(e),p=this.S(a,function(a){return function(b){return a.i(b.G,e)}}(this)),n=p.R,q=new h.Polyline({map:this.map,path:[n.position,c],strokeColor:this.legColors.usual[this.map.mapTypeId],strokeWeight:this.legWeight, |
||||
zIndex:this.usualLegZIndex}),n._omsData={v:n.getPosition(),X:n.getZIndex(),o:q},this.legColors.highlighted[this.map.mapTypeId]!==this.legColors.usual[this.map.mapTypeId]&&(k=this.P(n),n._omsData.O={m:l.addListener(n,"mouseover",k.m),u:l.addListener(n,"mouseout",k.u)}),this.trigger("format",n,this.constructor.markerStatus.SPIDERFIED),n.setPosition(c),n.setZIndex(Math.round(this.spiderfiedZIndex+e.y)),f.push(n);return f}.call(this);delete this.J;this.I=!0;return this.trigger("spiderfy",b,d)};c.unspiderfy= |
||||
function(a){var d,b,c,e,g,k,h;null==a&&(a=null);if(null==this.I)return this;this.K=!0;h=[];g=[];k=this.a;d=0;for(b=k.length;d<b;d++)e=k[d],null!=e._omsData?(e._omsData.o.setMap(null),e!==a&&e.setPosition(e._omsData.v),e.setZIndex(e._omsData.X),c=e._omsData.O,null!=c&&(l.removeListener(c.m),l.removeListener(c.u)),delete e._omsData,e!==a&&(c=this.basicFormatEvents?"UNSPIDERFIED":"SPIDERFIABLE",this.trigger("format",e,this.constructor.markerStatus[c])),h.push(e)):g.push(e);delete this.K;delete this.I; |
||||
this.trigger("unspiderfy",h,g);return this};c.i=function(a,d){var b,c;b=a.x-d.x;c=a.y-d.y;return b*b+c*c};c.T=function(a){var c,b,f,e,g;c=e=g=0;for(b=a.length;c<b;c++)f=a[c],e+=f.x,g+=f.y;a=a.length;return new h.Point(e/a,g/a)};c.f=function(a){return this.g.getProjection().fromLatLngToDivPixel(a)};c.U=function(a){return this.g.getProjection().fromDivPixelToLatLng(a)};c.S=function(a,c){var b,d,e,g,k,h;e=k=0;for(h=a.length;k<h;e=++k)if(g=a[e],g=c(g),"undefined"===typeof b||null===b||g<d)d=g,b=e;return a.splice(b, |
||||
1)[0]};c.A=function(a,c){var b,d,e,g;if(null!=a.indexOf)return a.indexOf(c);b=d=0;for(e=a.length;d<e;b=++d)if(g=a[b],g===c)return b;return-1};return r}();t=/(\?.*(&|&)|\?)spiderfier_callback=(\w+)/;m=document.currentScript;null==m&&(m=function(){var m,l,h,w,v;h=document.getElementsByTagName("script");v=[];m=0;for(l=h.length;m<l;m++)u=h[m],null!=(w=u.getAttribute("src"))&&w.match(t)&&v.push(u);return v}()[0]);if(null!=m&&(m=null!=(w=m.getAttribute("src"))?null!=(y=w.match(t))?y[3]:void 0:void 0)&& |
||||
"function"===typeof window[m])window[m]();"function"===typeof window.spiderfier_callback&&window.spiderfier_callback()}).call(this); |
||||
/* Thu 11 May 2017 08:40:57 BST */ |
@ -0,0 +1,30 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
require_once __DIR__.'/../inc/global.inc.php'; |
||||
|
||||
$userId = isset($_GET['user_id']) ? (int) $_GET['user_id'] : 0; |
||||
$file = isset($_GET['file']) ? $_GET['file'] : ''; |
||||
|
||||
if (empty($userId) || empty($file)) { |
||||
exit; |
||||
} |
||||
|
||||
$dir = UserManager::getUserPathById($userId, 'system'); |
||||
if (empty($dir)) { |
||||
exit; |
||||
} |
||||
$file = $dir.'/my_files/'.$file; |
||||
|
||||
$config = api_get_configuration_value('block_my_files_access'); |
||||
|
||||
if ($config) { |
||||
api_block_anonymous_users(); |
||||
} |
||||
|
||||
if (Security::check_abs_path($file, $dir.'my_files/')) { |
||||
$result = DocumentManager::file_send_for_download($file); |
||||
if ($result === false) { |
||||
exit; |
||||
} |
||||
} |
Loading…
Reference in new issue