Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
calendar; some more static files copied from ravlog
- Loading branch information
Zbigniew Lukasiak
committed
Aug 12, 2010
1 parent
18a17d6
commit f69fd33
Showing
39 changed files
with
8,343 additions
and
7 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
46c46 | ||
< $self->{'header'} = sprintf("<center><font size=\"+2\">%s %d</font></center>", | ||
--- | ||
> $self->{'header'} = sprintf("<h1 class='month_date'>%s %d</h1>", | ||
261,262c261,262 | ||
< $thiscontent = "<p><b><a href=\"".$self->getdatehref($thisday); | ||
< $thiscontent .= "\">$thisday</a></b></p>\n"; | ||
--- | ||
> $thiscontent = "<span><a href=\"".$self->getdatehref($thisday); | ||
> $thiscontent .= "\">$thisday</a></span>\n"; | ||
264c264 | ||
< $thiscontent = "<p><b>$thisday</b></p>\n"; | ||
--- | ||
> $thiscontent = "<span>$thisday</span>\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
function clear_cache(id) { | ||
var handler = dojo.xhrGet({ | ||
url: '/admin/clear/' + id, | ||
content: { field: null } | ||
}); | ||
handler.addCallback(function(data) { | ||
dojo.byId('jaxdate').innerHTML="Cleared Cache"; | ||
}); | ||
} | ||
|
||
function clear_cache_page(id) { | ||
var handler = dojo.xhrGet({ | ||
url: '/admin/clear_page/' + id, | ||
content: { field: null } | ||
}); | ||
handler.addCallback(function(data) { | ||
dojo.byId('jaxdate').innerHTML="Cleared Cache"; | ||
}); | ||
} | ||
|
||
function help_complete_combobox(field,db_table,db_field) { | ||
var handler = dojo.xhrGet({ | ||
url: '/ajax/help_complete_combobox/'+db_table+'/'+db_field, | ||
mimetype: "text/json", | ||
content: { field: field.getValue() } | ||
}); | ||
handler.addCallback(function(data) { | ||
field.dataProvider.setData(data['result']); | ||
}); | ||
} | ||
|
||
function sort_tags(field) { | ||
var handler = dojo.xhrGet({ | ||
url: '/ajax/sort_by', | ||
content: { field: field.id } | ||
}); | ||
handler.addCallback(function(data) { | ||
dojo.byId('tag_list').innerHTML=data; | ||
}); | ||
} | ||
|
||
function toggle_tag_list() { | ||
dojo.connect( | ||
dojo.byId("alpha"), "onclick" , function (e) { | ||
e.preventDefault(); | ||
dojo.byId("alpha").className="selected"; | ||
dojo.byId("freq").className=""; | ||
sort_tags(dojo.byId("alpha")); | ||
} | ||
); | ||
dojo.connect( | ||
dojo.byId("freq"), "onclick" , function (e) { | ||
e.preventDefault(); | ||
dojo.byId("alpha").className=""; | ||
dojo.byId("freq").className="selected"; | ||
sort_tags(dojo.byId("freq")); | ||
} | ||
); | ||
} | ||
|
||
function switch_editor(what) { | ||
if(what == 'wysiwyg') { | ||
dojo.widget.createWidget("Editor2", | ||
{ shareToolbar: false, | ||
toolbarAlwaysVisible: true, | ||
height: "90%", | ||
width: "800", | ||
focusOnLoad: false | ||
}, dojo.byId("body")); | ||
dojo.byId("pborder").style.border="1px solid"; | ||
} | ||
else { | ||
var value=""; | ||
dojo.forEach(dojo.widget.byType('Editor2'), | ||
function(e) { value= e.getEditorContent(); }); | ||
|
||
dojo.forEach(dojo.widget.byType('Editor2'), | ||
function(e){ e.destroy(); }); | ||
dojo.byId('body').value=value; | ||
dojo.byId("pborder").style.border=""; | ||
} | ||
} | ||
|
||
function toggle_tags() { | ||
if( dojo.byId("select_tags").style.display=="none" ) { | ||
dojo.byId("select_tags").style.display="block"; | ||
} | ||
else { | ||
dojo.byId("select_tags").style.display="none"; | ||
} | ||
} | ||
|
||
function check_articles(field) { | ||
if ((field.value.length > 0 && field.value.length < 3) || field.value.length==0 ) { | ||
dojo.byId('search_board').style.display="none"; | ||
return; | ||
} | ||
var handler = dojo.xhrGet({ | ||
url: '/ajax/check_articles', | ||
content: { field: field.value } | ||
}); | ||
handler.addCallback(function(data) { | ||
dojo.byId('search_board').style.display="block"; | ||
dojo.byId('search_board').innerHTML=data; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
addEvent(window, "load", makeNiceTitles); | ||
|
||
var XHTMLNS = "http://www.w3.org/1999/xhtml"; | ||
var CURRENT_NICE_TITLE; | ||
var browser = new Browser(); | ||
|
||
function makeNiceTitles() { | ||
if (!document.createElement || !document.getElementsByTagName) return; | ||
// add namespace methods to HTML DOM; this makes the script work in both | ||
// HTML and XML contexts. | ||
if(!document.createElementNS) | ||
{ | ||
document.createElementNS = function(ns,elt) { | ||
return document.createElement(elt); | ||
} | ||
} | ||
|
||
if( !document.links ) | ||
{ | ||
document.links = document.getElementsByTagName("a"); | ||
} | ||
for (var ti=0;ti<document.links.length;ti++) { | ||
var lnk = document.links[ti]; | ||
if (lnk.title) { | ||
lnk.setAttribute("nicetitle",lnk.title); | ||
lnk.removeAttribute("title"); | ||
addEvent(lnk,"mouseover",showNiceTitle); | ||
addEvent(lnk,"mouseout",hideNiceTitle); | ||
addEvent(lnk,"focus",showNiceTitle); | ||
addEvent(lnk,"blur",hideNiceTitle); | ||
} | ||
} | ||
var instags = document.getElementsByTagName("ins"); | ||
if (instags) { | ||
for (var ti=0;ti<instags.length;ti++) { | ||
var instag = instags[ti]; | ||
if (instag.dateTime) { | ||
var strDate = instag.dateTime; | ||
var dtIns = new Date(strDate.substring(0,4),parseInt(strDate.substring(4,6)-1),strDate.substring(6,8),strDate.substring(9,11),strDate.substring(11,13),strDate.substring(13,15)); | ||
instag.setAttribute("nicetitle","Added on "+dtIns.toString()); | ||
addEvent(instag,"mouseover",showNiceTitle); | ||
addEvent(instag,"mouseout",hideNiceTitle); | ||
addEvent(instag,"focus",showNiceTitle); | ||
addEvent(instag,"blur",hideNiceTitle); | ||
} | ||
} | ||
} | ||
} | ||
|
||
function findPosition( oLink ) { | ||
if( oLink.offsetParent ) { | ||
for( var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent ) { | ||
posX += oLink.offsetLeft; | ||
posY += oLink.offsetTop; | ||
} | ||
return [ posX, posY ]; | ||
} else { | ||
return [ oLink.x, oLink.y ]; | ||
} | ||
} | ||
|
||
function showNiceTitle(e) { | ||
if (CURRENT_NICE_TITLE) hideNiceTitle(CURRENT_NICE_TITLE); | ||
if (!document.getElementsByTagName) return; | ||
if (window.event && window.event.srcElement) { | ||
lnk = window.event.srcElement | ||
} else if (e && e.target) { | ||
lnk = e.target | ||
} | ||
if (!lnk) return; | ||
if (lnk.nodeType == 3) { | ||
// lnk is a textnode -- ascend parents until we hit a link | ||
lnk = getParent(lnk,"A"); | ||
} | ||
if (!lnk) return; | ||
nicetitle = lnk.getAttribute("nicetitle"); | ||
|
||
var d = document.createElementNS(XHTMLNS,"div"); | ||
d.className = "nicetitle"; | ||
tnt = document.createTextNode(nicetitle); | ||
pat = document.createElementNS(XHTMLNS,"p"); | ||
pat.className = "titletext"; | ||
pat.appendChild(tnt); | ||
d.appendChild(pat); | ||
if (lnk.href) { | ||
tnd = document.createTextNode(lnk.href); | ||
pad = document.createElementNS(XHTMLNS,"p"); | ||
pad.className = "destination"; | ||
pad.appendChild(tnd); | ||
d.appendChild(pad); | ||
} | ||
|
||
STD_WIDTH = 300; | ||
if (lnk.href) { | ||
h = lnk.href.length; | ||
} else { h = nicetitle.length; } | ||
if (nicetitle.length) { | ||
t = nicetitle.length; | ||
} | ||
h_pixels = h*6; t_pixels = t*10; | ||
|
||
if (h_pixels > STD_WIDTH) { | ||
w = h_pixels; | ||
} else if ((STD_WIDTH>t_pixels) && (t_pixels>h_pixels)) { | ||
w = t_pixels; | ||
} else if ((STD_WIDTH>t_pixels) && (h_pixels>t_pixels)) { | ||
w = h_pixels; | ||
} else { | ||
w = STD_WIDTH; | ||
} | ||
|
||
d.style.width = w + 'px'; | ||
|
||
/* | ||
mx = lnk.offsetLeft; | ||
my = lnk.offsetTop; | ||
*/ | ||
mpos = findPosition(lnk); | ||
mx = mpos[0]; | ||
my = mpos[1]; | ||
//xy = getMousePosition(e); | ||
//mx = xy[0]; my = xy[1]; | ||
|
||
d.style.left = (mx+15) + 'px'; | ||
d.style.top = (my+35) + 'px'; | ||
if (window.innerWidth && ((mx+w) > window.innerWidth)) { | ||
d.style.left = (window.innerWidth - w - 25) + "px"; | ||
} | ||
if (document.body.scrollWidth && ((mx+w) > document.body.scrollWidth)) { | ||
d.style.left = (document.body.scrollWidth - w - 25) + "px"; | ||
} | ||
|
||
document.getElementsByTagName("body")[0].appendChild(d); | ||
|
||
CURRENT_NICE_TITLE = d; | ||
} | ||
|
||
function hideNiceTitle(e) { | ||
if (!document.getElementsByTagName) return; | ||
if (CURRENT_NICE_TITLE) { | ||
document.getElementsByTagName("body")[0].removeChild(CURRENT_NICE_TITLE); | ||
CURRENT_NICE_TITLE = null; | ||
} | ||
} | ||
|
||
// Add an eventListener to browsers that can do it somehow. | ||
// Originally by the amazing Scott Andrew. | ||
function addEvent(obj, evType, fn){ | ||
if (obj.addEventListener){ | ||
obj.addEventListener(evType, fn, false); | ||
return true; | ||
} else if (obj.attachEvent){ | ||
var r = obj.attachEvent("on"+evType, fn); | ||
return r; | ||
} else { | ||
return false; | ||
} | ||
} | ||
|
||
function getParent(el, pTagName) { | ||
if (el == null) return null; | ||
else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) // Gecko bug, supposed to be uppercase | ||
return el; | ||
else | ||
return getParent(el.parentNode, pTagName); | ||
} | ||
|
||
function getMousePosition(event) { | ||
if (browser.isIE) { | ||
x = window.event.clientX + document.documentElement.scrollLeft | ||
+ document.body.scrollLeft; | ||
y = window.event.clientY + document.documentElement.scrollTop | ||
+ document.body.scrollTop; | ||
} | ||
if (browser.isNS) { | ||
x = event.clientX + window.scrollX; | ||
y = event.clientY + window.scrollY; | ||
} | ||
return [x,y]; | ||
} | ||
|
||
// Determine browser and version. | ||
|
||
function Browser() { | ||
// blah, browser detect, but mouse-position stuff doesn't work any other way | ||
var ua, s, i; | ||
|
||
this.isIE = false; | ||
this.isNS = false; | ||
this.version = null; | ||
|
||
ua = navigator.userAgent; | ||
|
||
s = "MSIE"; | ||
if ((i = ua.indexOf(s)) >= 0) { | ||
this.isIE = true; | ||
this.version = parseFloat(ua.substr(i + s.length)); | ||
return; | ||
} | ||
|
||
s = "Netscape6/"; | ||
if ((i = ua.indexOf(s)) >= 0) { | ||
this.isNS = true; | ||
this.version = parseFloat(ua.substr(i + s.length)); | ||
return; | ||
} | ||
|
||
// Treat any other "Gecko" browser as NS 6.1. | ||
|
||
s = "Gecko"; | ||
if ((i = ua.indexOf(s)) >= 0) { | ||
this.isNS = true; | ||
this.version = 6.1; | ||
return; | ||
} | ||
} |
Oops, something went wrong.