diff options
-rw-r--r-- | bubble.js | 334 | ||||
-rw-r--r-- | phpfspot.class.php | 38 | ||||
-rw-r--r-- | phpfspot.js | 5 | ||||
-rw-r--r-- | resources/bubble_down.png | bin | 5817 -> 0 bytes | |||
-rw-r--r-- | resources/bubble_up.png | bin | 5786 -> 0 bytes | |||
-rw-r--r-- | rpc.php | 5 | ||||
-rw-r--r-- | stylesheet.css | 28 | ||||
-rw-r--r-- | templates/bubble_details.tpl | 13 | ||||
-rw-r--r-- | templates/credits.tpl | 2 | ||||
-rw-r--r-- | templates/header.tpl | 1 |
10 files changed, 0 insertions, 426 deletions
diff --git a/bubble.js b/bubble.js deleted file mode 100644 index d44780e..0000000 --- a/bubble.js +++ /dev/null @@ -1,334 +0,0 @@ -/*
- WebSnapr - Preview Bubble Javascript
- Written by Juan Xavier Larrea
- http://www.websnapr.com - xavier@websnapr.com
-
-*/
-
-// Point this variable to the correct location of the bg.png file
-var bubbleImageUp = 'resources/bubble_up.png';
-var bubbleImageDown = 'resources/bubble_down.png';
-
-if(typeof Array.prototype.push!="function"){
- Array.prototype.push=ArrayPush;
-
- function ArrayPush(_1){
- this[this.length]=_1;
- }
-}
-
-function WSR_getElementsByClassName(oElm, strTagName, oClassNames){
- var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
- var arrReturnElements = new Array();
- var arrRegExpClassNames = new Array();
- if(typeof oClassNames == "object"){
- for(var i=0; i<oClassNames.length; i++){
- arrRegExpClassNames.push(new RegExp("(^|\s)" + oClassNames[i].replace(/-/g, "\-") + "(\s|$)"));
- }
- }
- else{
- arrRegExpClassNames.push(new RegExp("(^|\s)" + oClassNames.replace(/-/g, "\-") + "(\s|$)"));
- }
- var oElement;
- var bMatchesAll;
- for(var j=0; j<arrElements.length; j++){
- oElement = arrElements[j];
- bMatchesAll = true;
- for(var k=0; k<arrRegExpClassNames.length; k++){
- if(!arrRegExpClassNames[k].test(oElement.className)){
- bMatchesAll = false;
- break;
- }
- }
- if(bMatchesAll){
- arrReturnElements.push(oElement);
- }
- }
- return (arrReturnElements)
-}
-/*function WSR_getElementsByClassName(_2,_3,_4){
-
- var _5=(_3=="*"&&_2.all)?_2.all:_2.getElementsByTagName(_3);
- window.alert(_5[0]);
- var _6=new Array();
- _4=_4.replace(/\-/g,"\\-");
- var _7=new RegExp("(^|\\s)"+_4+"(\\s|$)");
- var _8;
- for(var i=0;i<_5.length;i++){
- _8=_5[i];
- if(_7.test(_8.className)){
- _6.push(_8);
- }
- }
- return (_6);
-}*/
-
-function bindBubbles(e){
- lbActions=WSR_getElementsByClassName(document,"img","thumb");
- for(i=0;i<lbActions.length;i++){
- if(window.addEventListener){ // Mozilla, Firefox
- lbActions[i].addEventListener("mouseover",attachBubble,false);
- lbActions[i].addEventListener("mouseout",detachBubble,false);
- lbActions[i].addEventListener("click",detachBubble,false);
- }else if (window.attachEvent) { // IE
- lbActions[i].attachEvent("onmouseover",attachBubble);
- lbActions[i].attachEvent("onmouseout",detachBubble);
- lbActions[i].attachEvent("onclick",detachBubble);
- } else {
- // it seems this browser doesn't support any eventhandling
- }
- }
-}
-
-function attachBubble(_b){
- var _c;
- if(_b["srcElement"]){ // IE
- _c=_b["srcElement"];
- }else{ // Mozilla, Firefox
- _c=_b["target"];
- }
- if (_c.href == undefined){
- _c=_c.parentNode;
- }
-
- var _d=_c.href;
-
- var _10=document.createElement("div");
- document.getElementsByTagName("body")[0].appendChild(_10);
- _10.className="bubble";
-
- if(BrowserDetect.browser != 'Explorer') {
-
- var _e=findPos(_c)[0]+5;
- var cur_height = findPos(_c)[1]-get_scroll_position() + 283;
-
- // should the bubble be displayed above or below the object
- if(cur_height >= get_page_height()) {
- var _f=findPos(_c)[1]-363;
- bubbleImage = bubbleImageUp;
- }
- else {
- var _f=findPos(_c)[1]+17;
- bubbleImage = bubbleImageDown;
- }
- }
- else {
- var _e=findPos(_c)[0]+5;
- var _f=findPos(_c)[1]+129;
- bubbleImage = bubbleImageDown;
- }
- if (BrowserDetect.browser == 'Explorer') {
- _10.style.width="275px";
- _10.style.height="275px";
- _10.style.position="absolute";
- _10.style.top=_f;
- _10.style.zIndex=99999;
- _10.style.left=_e;
- _10.style.textAlign="left";
- _10.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + bubbleImage + "',sizingMethod='image')";
- } else if (BrowserDetect.browser == 'Safari' || BrowserDetect.browser == 'Konqueror' ) {
- _10.setAttribute("style","text-align: center; z-index: 99999; position: absolute; top: "+ _f +"px ; left: "+ _e +"px ; background: url("+ bubbleImage +") no-repeat; width: 275px; height: 275px; padding: 0; margin: 0;");
- } else {
- _10.setAttribute("style","text-align: center; z-index: 99999; position: absolute; top: "+_f+"px ; left: "+ _e +"px ; background: url("+ bubbleImage +") no-repeat; width: 275px; height: 275px; padding: 0; margin: 0;");
- }
-
- if(cur_height >= get_page_height())
- showBubbleDetails(_10, _c.id, 'up');
- else
- showBubbleDetails(_10, _c.id, 'down');
-
-}
-
-function detachBubble(_12){
- lbActions=WSR_getElementsByClassName(document,"div","bubble");
- for(i=0;i<lbActions.length;i++){
- lbActions[i].parentNode.removeChild(lbActions[i]);
- }
-}
-
-function findPos(obj){
- var _14=curtop=0;
- if(obj.offsetParent){
- _14=obj.offsetLeft;
- curtop=obj.offsetTop;
- while(obj=obj.offsetParent){
- _14+=obj.offsetLeft;
- curtop+=obj.offsetTop;
- }
- }
- return [_14,curtop];
-}
-
-var BrowserDetect = {
- init: function () {
- this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
- this.version = this.searchVersion(navigator.userAgent)
- || this.searchVersion(navigator.appVersion)
- || "an unknown version";
- this.OS = this.searchString(this.dataOS) || "an unknown OS";
- },
- searchString: function (data) {
- for (var i=0;i<data.length;i++) {
- var dataString = data[i].string;
- var dataProp = data[i].prop;
- this.versionSearchString = data[i].versionSearch || data[i].identity;
- if (dataString) {
- if (dataString.indexOf(data[i].subString) != -1)
- return data[i].identity;
- }
- else if (dataProp)
- return data[i].identity;
- }
- },
- searchVersion: function (dataString) {
- var index = dataString.indexOf(this.versionSearchString);
- if (index == -1) return;
- return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
- },
- dataBrowser: [
- { string: navigator.userAgent,
- subString: "OmniWeb",
- versionSearch: "OmniWeb/",
- identity: "OmniWeb"
- },
- {
- string: navigator.vendor,
- subString: "Apple",
- identity: "Safari"
- },
- {
- prop: window.opera,
- identity: "Opera"
- },
- {
- string: navigator.vendor,
- subString: "iCab",
- identity: "iCab"
- },
- {
- string: navigator.vendor,
- subString: "KDE",
- identity: "Konqueror"
- },
- {
- string: navigator.userAgent,
- subString: "Firefox",
- identity: "Firefox"
- },
- {
- string: navigator.vendor,
- subString: "Camino",
- identity: "Camino"
- },
- { // for newer Netscapes (6+)
- string: navigator.userAgent,
- subString: "Netscape",
- identity: "Netscape"
- },
- {
- string: navigator.userAgent,
- subString: "MSIE",
- identity: "Explorer",
- versionSearch: "MSIE"
- },
- {
- string: navigator.userAgent,
- subString: "Gecko",
- identity: "Mozilla",
- versionSearch: "rv"
- },
- { // for older Netscapes (4-)
- string: navigator.userAgent,
- subString: "Mozilla",
- identity: "Netscape",
- versionSearch: "Mozilla"
- }
- ],
- dataOS : [
- {
- string: navigator.platform,
- subString: "Win",
- identity: "Windows"
- },
- {
- string: navigator.platform,
- subString: "Mac",
- identity: "Mac"
- },
- {
- string: navigator.platform,
- subString: "Linux",
- identity: "Linux"
- }
- ]
-
-};
-
-function var_dump(arr,level) {
- var dumped_text = "";
- if(!level) level = 0;
-
- //The padding given at the beginning of the line.
- var level_padding = "";
- for(var j=0;j<level+1;j++) level_padding += " ";
-
- if(typeof(arr) == 'object') { //Array/Hashes/Objects
- for(var item in arr) {
- var value = arr[item];
-
- if(typeof(value) == 'object') { //If it is an array,
- dumped_text += level_padding + "'" + item + "' ...\n";
- dumped_text += dump(value,level+1);
- } else {
- dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
- }
- }
- } else { //Stings/Chars/Numbers etc.
- dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
- }
- return dumped_text;
-
-}//end function var_dump
-
-function get_page_height()
-{
- var myHeight = 0;
- if( typeof( window.innerHeight ) == 'number' ) {
- //Non-IE
- myHeight = window.innerHeight;
- } else if( document.documentElement && document.documentElement.clientHeight ) {
- //IE 6+ in 'standards compliant mode'
- myHeight = document.documentElement.clientHeight;
- } else if( document.body && document.body.clientHeight ) {
- //IE 4 compatible
- myHeight = document.body.clientHeight;
- }
-
- return myHeight;
-}
-
-function get_scroll_position()
-{
- if (typeof window.pageYOffset != 'undefined') {
- return window.pageYOffset;
- }
- else {
- if (typeof document.compatMode != 'undefined' &&
- document.compatMode != 'BackCompat' &&
- typeof window.scrollTop != 'undefined')
- return window.scrollTop;
- else {
- if(typeof document.documentElement.scrollTop != 'undefined')
- return document.documentElement.scrollTop;
- else {
- if (typeof document.body.scrollTop != 'undefined')
- return document.body.scrollTop;
- }
- }
- }
-
- return 0;
-
-}
-
-BrowserDetect.init();
diff --git a/phpfspot.class.php b/phpfspot.class.php index 5e25f21..8fe0f77 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -635,43 +635,6 @@ class PHPFSPOT { } // showPhotoIndex() - public function showBubbleDetails($photo, $direction) - { - if($direction == "up") - $direction = "bubbleimg_up"; - else - $direction = "bubbleimg_down"; - - $details = $this->get_photo_details($photo); - $orig_path = $this->translate_path($details['directory_path']) ."/". $details['name']; - - $image_url = "phpfspot_img.php?idx=". $photo ."&width=". $this->cfg->bubble_width; - - $filesize = filesize($orig_path); - $filesize = rand($filesize/1024, 2); - - if(!file_exists($orig_path)) { - $this->_warning("Photo ". $orig_path ." does not exist!<br />\n"); - return; - } - - if(!is_readable($orig_path)) { - $this->_warning("Photo ". $orig_path ." is not readable for user ". get_current_user() ."<br />\n"); - return; - } - - $img = getimagesize($orig_path); - - $this->tmpl->assign('file_size', $filesize); - $this->tmpl->assign('width', $img[0]); - $this->tmpl->assign('height', $img[1]); - $this->tmpl->assign('file_name', $details['name']); - $this->tmpl->assign('image_id', $direction); - $this->tmpl->assign('image_url', $image_url); - $this->tmpl->show("bubble_details.tpl"); - - } // showBubbleDetails() - public function showCredits() { $this->tmpl->assign('version', $this->cfg->version); @@ -849,7 +812,6 @@ class PHPFSPOT { $resolutions = Array( $this->cfg->thumb_width, - $this->cfg->bubble_width, $this->cfg->photo_width, $this->cfg->mini_width, ); diff --git a/phpfspot.js b/phpfspot.js index 9204f32..be15455 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -66,11 +66,6 @@ function showPhotoIndex(begin_with) HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index&begin_with=' + begin_with)); } -function showBubbleDetails(object, id, direction) -{ - HTML_AJAX.replace(object, encodeURI('rpc.php?action=showbubbledetails&id=' + id + '&direction=" + direction')); -} - // if photo index is currently shown, refresh it function refreshPhotoIndex() { diff --git a/resources/bubble_down.png b/resources/bubble_down.png Binary files differdeleted file mode 100644 index a6b0082..0000000 --- a/resources/bubble_down.png +++ /dev/null diff --git a/resources/bubble_up.png b/resources/bubble_up.png Binary files differdeleted file mode 100644 index c1799df..0000000 --- a/resources/bubble_up.png +++ /dev/null @@ -84,11 +84,6 @@ class PHPFSPOT_RPC { $fspot->showPhotoIndex(); break; - case 'showbubbledetails': - - $fspot->showBubbleDetails($_GET['id'], $_GET['direction']); - break; - case 'showcredits': $fspot->showCredits(); diff --git a/stylesheet.css b/stylesheet.css index 0f09bdc..0fe527e 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -60,34 +60,6 @@ img { img.thumb {
}
-img.bubbleimg_up {
- padding-top: 0;
- padding-left: 0;
- padding-right: 0;
- padding-bottom: 0;
- margin-top: 39px;
- margin-left: 36px;
- margin-bottom: 0;
- margin-right: 0;
- border: 0;
- width: 202px;
- height: 152px;
-}
-
-img.bubbleimg_down {
- padding-top: 0;
- padding-left: 0;
- padding-right: 0;
- padding-bottom: 0;
- margin-top: 34px;
- margin-left: 36px;
- margin-bottom: 0;
- margin-right: 0;
- border: 0;
- width: 202px;
- height: 152px;
-}
-
a {
font-size: 14px;
color: #008200;
diff --git a/templates/bubble_details.tpl b/templates/bubble_details.tpl deleted file mode 100644 index 53cd168..0000000 --- a/templates/bubble_details.tpl +++ /dev/null @@ -1,13 +0,0 @@ -<table> - <tr> - <td> - <img class="{$image_id}" src="{$image_url}" /> - </td> - </tr> - <tr> - <td style="text-align: center; padding-left: 36px;"> - {$file_name}<br /> - {$file_size}kb, {$width}x{$height} - </td> - </tr> -</table> diff --git a/templates/credits.tpl b/templates/credits.tpl index b15127e..44c4800 100644 --- a/templates/credits.tpl +++ b/templates/credits.tpl @@ -14,8 +14,6 @@ by Andreas Unterkircher<br /> {mailto address="unki@netshadow.at"} <hr /> - Bubble base JavaScript by <a href="http://www.websnapr.com/index.php?action=previewbubble">WebSnapr</a> - <hr /> <a href="http://wiki.bluga.net/HTML_AJAX/HomePage">HTML_AJAX</a> <hr /> PHP tag-cloud code by <a href="http://prism-perfect.net/archive/php-tag-cloud-tutorial/">Jenny Ferenc</a>. diff --git a/templates/header.tpl b/templates/header.tpl index caac87c..acef8eb 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -6,7 +6,6 @@ <link href="stylesheet.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="rpc.php?mode=init&client=all"></script> <script type="text/javascript" src="phpfspot.js"></script> - <script type="text/javascript" src="bubble.js"></script> <link rel="shortcut icon" href="resources/gpl_16.png" type="image/png" /> <link rel="icon" href="resources/gpl_16.png" type="image/png" /> </head> |