From 35128ef2c95d8f76afd3edea594623cc265da673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Mon, 27 Feb 2012 22:01:17 +0000 Subject: Avoid a Notice --- include/event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/event.php b/include/event.php index 4a9a9a004..29202badd 100755 --- a/include/event.php +++ b/include/event.php @@ -163,7 +163,7 @@ function bbtoevent($s) { if(preg_match("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",$s,$match)) $ev['adjust'] = $match[1]; $match = ''; - $ev['nofinish'] = (($ev['start'] && (!x($ev, 'finish') || !$ev['finish'])) ? 1 : 0); + $ev['nofinish'] = (((x($ev, 'start') && $ev['start']) && (!x($ev, 'finish') || !$ev['finish'])) ? 1 : 0); return $ev; } -- cgit v1.2.3 From e33c2b8f89d0174b6b2bcbd31d8d89c2ee664340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Mon, 27 Feb 2012 22:08:00 +0000 Subject: Avoid a Notice --- include/items.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 7d52571c2..5452dfbda 100755 --- a/include/items.php +++ b/include/items.php @@ -682,7 +682,7 @@ function item_store($arr,$force_parent = false) { unset($arr['dsprsig']); } - if($arr['gravity']) + if(x($arr, 'gravity')) $arr['gravity'] = intval($arr['gravity']); elseif($arr['parent-uri'] === $arr['uri']) $arr['gravity'] = 0; @@ -800,6 +800,8 @@ function item_store($arr,$force_parent = false) { logger('item_store: item parent was not found - ignoring item'); return 0; } + + $parent_deleted = 0; } } -- cgit v1.2.3 From 7c30fca98186538eff731519bdd0c76527237192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Mon, 27 Feb 2012 22:17:57 +0000 Subject: Avoid a Notice --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 54f318e5e..c89dae27c 100755 --- a/boot.php +++ b/boot.php @@ -1335,7 +1335,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ array( 'label' => t('Profile'), 'url' => $url.'/?tab=profile', - 'sel' => (($tab=='profile')?'active':''), + 'sel' => ((isset($tab) && $tab=='profile')?'active':''), ), array( 'label' => t('Photos'), -- cgit v1.2.3 From e55d13c2b4425183dde64da8ca27c794f4c04900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Tue, 28 Feb 2012 12:56:16 +0000 Subject: Avoid a notice --- include/items.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/items.php b/include/items.php index 5452dfbda..5268dfc1d 100755 --- a/include/items.php +++ b/include/items.php @@ -742,6 +742,7 @@ function item_store($arr,$force_parent = false) { if($arr['parent-uri'] === $arr['uri']) { $parent_id = 0; + $parent_deleted = 0; $allow_cid = $arr['allow_cid']; $allow_gid = $arr['allow_gid']; $deny_cid = $arr['deny_cid']; -- cgit v1.2.3 From 1204210c69eade767bb19af5a5a18cee4a9db215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Tue, 28 Feb 2012 13:01:58 +0000 Subject: wasn't actually changed before --- include/conversation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 53369cf20..6f0dc3687 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -976,8 +976,8 @@ function conv_sort($arr,$order) { usort($parents,'sort_thr_commented'); if(count($parents)) - foreach($parents as $x) - $x['children'] = array(); + foreach($parents as $i=>$_x) + $parents[$i]['children'] = array(); foreach($arr as $x) { if($x['id'] != $x['parent']) { -- cgit v1.2.3 From f48556cbc08c0600e256f5964a553c666ee66372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Tue, 28 Feb 2012 13:40:41 +0000 Subject: contact.network is used later to check if a direct link or a redirect by /redir/contactid should be used --- mod/message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/message.php b/mod/message.php index 4b494e906..e293d62d9 100755 --- a/mod/message.php +++ b/mod/message.php @@ -176,7 +176,7 @@ function message_content(&$a) { $a->set_pager_total($r[0]['total']); $r = q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`, - `mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` + `mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` , `contact`.`network` FROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id` WHERE `mail`.`uid` = %d AND `from-url` $eq '%s' GROUP BY `parent-uri` ORDER BY `created` DESC LIMIT %d , %d ", intval(local_user()), -- cgit v1.2.3 From 36a1a43f06dc2a0d55463c83154cce55fa3948ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Tue, 28 Feb 2012 13:42:12 +0000 Subject: Avoid notices --- boot.php | 2 +- mod/dfrn_request.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index c89dae27c..e39504e11 100755 --- a/boot.php +++ b/boot.php @@ -1209,7 +1209,7 @@ function current_theme(){ $a = get_app(); $system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : ''); - $theme_name = ((is_array($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme); + $theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme); if($theme_name && file_exists('view/theme/' . $theme_name . '/style.css')) return($theme_name); diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index bc159137d..452fec166 100755 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -43,7 +43,7 @@ function dfrn_request_post(&$a) { return; - if($_POST['cancel']) { + if(x($_POST, 'cancel')) { goaway(z_root()); } -- cgit v1.2.3 From 5bb8ed4b8b5310acc8556ef2fba7b3958284b2a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Tue, 28 Feb 2012 21:56:42 +0000 Subject: Mostly some checks in order to avoid Notices; 1 real bugfix in /mod/network.php --- include/conversation.php | 5 +++-- include/oembed.php | 2 +- include/template_processor.php | 9 +++++++-- mod/network.php | 14 ++++++++------ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 9f564843e..bd9b11bee 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -373,7 +373,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $comments[$item['parent']] = 1; else $comments[$item['parent']] += 1; - } + } elseif(! x($comments,$item['parent'])) + $comments[$item['parent']] = 0; // avoid notices later on } // map all the like/dislike activities for each parent item @@ -921,7 +922,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { $o .= replace_macros($tpl,array( '$return_path' => $a->cmd, '$action' => $a->get_baseurl().'/item', - '$share' => (($x['button']) ? $x['button'] : t('Share')), + '$share' => (x($x,'button') ? $x['button'] : t('Share')), '$upload' => t('Upload photo'), '$shortupload' => t('upload photo'), '$attach' => t('Attach file'), diff --git a/include/oembed.php b/include/oembed.php index 5c3c595f5..52068efc7 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -62,7 +62,7 @@ function oembed_fetch_url($embedurl){ function oembed_format_object($j){ $embedurl = $j->embedurl; - $jhtml = oembed_iframe($j->embedurl,$j->width,$j->height ); + $jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null) ); $ret=""; switch ($j->type) { case "video": { diff --git a/include/template_processor.php b/include/template_processor.php index 28c3f07dd..7a4cba64e 100755 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -92,8 +92,13 @@ */ private function _replcb_for($args){ $m = array_map('trim', explode(" as ", $args[2])); - list($keyname, $varname) = explode("=>",$m[1]); - if (is_null($varname)) { $varname=$keyname; $keyname=""; } + $x = explode("=>",$m[1]); + if (count($x) == 1) { + $varname = $x[0]; + $keyname = ""; + } else { + list($keyname, $varname) = $x; + } if ($m[0]=="" || $varname=="" || is_null($varname)) die("template error: 'for ".$m[0]." as ".$varname."'") ; //$vals = $this->r[$m[0]]; $vals = $this->_get_var($m[0]); diff --git a/mod/network.php b/mod/network.php index 03a671b61..26265f5a0 100755 --- a/mod/network.php +++ b/mod/network.php @@ -44,7 +44,7 @@ function network_init(&$a) { } $a->page['aside'] .= group_side('network','network',true,$group_id); - $a->page['aside'] .= networks_widget($a->get_baseurl() . '/network',(($_GET['nets']) ? $_GET['nets'] : '')); + $a->page['aside'] .= networks_widget($a->get_baseurl() . '/network',(x($_GET, 'nets') ? $_GET['nets'] : '')); $a->page['aside'] .= saved_searches($search); } @@ -130,15 +130,15 @@ function network_content(&$a, $update = 0) { $starred_active = 'active'; } - if($_GET['bmark']) { + if(x($_GET,'bmark')) { $bookmarked_active = 'active'; } - if($_GET['conv']) { + if(x($_GET,'conv')) { $conv_active = 'active'; } - if($_GET['spam']) { + if(x($_GET,'spam')) { $spam_active = 'active'; } @@ -245,7 +245,7 @@ function network_content(&$a, $update = 0) { $def_acl = array('allow_cid' => '<' . intval($cid) . '>'); if(! $update) { - if(group) { + if($group) { if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { notice( sprintf( tt('Warning: This group contains %s member from an insecure network.', 'Warning: This group contains %s members from an insecure network.', @@ -492,7 +492,9 @@ function network_content(&$a, $update = 0) { $items = conv_sort($items,$ordering); - } + } else { + $items = array(); + } } -- cgit v1.2.3 From 52ea842e872cc004fd012496c828e9fb6186bec9 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 2 Mar 2012 10:33:39 +0100 Subject: html2bbcode: don't convert sizes and fonts. --- include/html2bbcode.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/html2bbcode.php b/include/html2bbcode.php index 65920380b..442e38691 100755 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -10,7 +10,7 @@ Originally made for the syncom project: http://wiki.piratenpartei.de/Syncom function node2bbcode(&$doc, $oldnode, $attributes, $startbb, $endbb) { do { - $done = node2bbcodesub(&$doc, $oldnode, $attributes, $startbb, $endbb); + $done = node2bbcodesub($doc, $oldnode, $attributes, $startbb, $endbb); } while ($done); } @@ -150,10 +150,14 @@ function html2bbcode($message) node2bbcode($doc, 'font', array('size'=>'/(\d+)/'), '[size=$1]', '[/size]'); node2bbcode($doc, 'font', array('color'=>'/(.+)/'), '[color=$1]', '[/color]'); - node2bbcode($doc, 'span', array('style'=>'/.*color:\s*(.+?)[,;].*/'), '[color="$1"]', '[/color]'); - node2bbcode($doc, 'span', array('style'=>'/.*font-size:\s*(\d+)/'), '[size=$1]', '[/size]'); + // Untested + //node2bbcode($doc, 'span', array('style'=>'/.*font-size:\s*(.+?)[,;].*font-family:\s*(.+?)[,;].*color:\s*(.+?)[,;].*/'), '[size=$1][font=$2][color=$3]', '[/color][/font][/size]'); + //node2bbcode($doc, 'span', array('style'=>'/.*font-size:\s*(\d+)[,;].*/'), '[size=$1]', '[/size]'); + //node2bbcode($doc, 'span', array('style'=>'/.*font-size:\s*(.+?)[,;].*/'), '[size=$1]', '[/size]'); + node2bbcode($doc, 'span', array('style'=>'/.*color:\s*(.+?)[,;].*/'), '[color="$1"]', '[/color]'); //node2bbcode($doc, 'span', array('style'=>'/.*font-family:\s*(.+?)[,;].*/'), '[font=$1]', '[/font]'); + //node2bbcode($doc, 'div', array('style'=>'/.*font-family:\s*(.+?)[,;].*font-size:\s*(\d+?)pt.*/'), '[font=$1][size=$2]', '[/size][/font]'); //node2bbcode($doc, 'div', array('style'=>'/.*font-family:\s*(.+?)[,;].*font-size:\s*(\d+?)px.*/'), '[font=$1][size=$2]', '[/size][/font]'); //node2bbcode($doc, 'div', array('style'=>'/.*font-family:\s*(.+?)[,;].*/'), '[font=$1]', '[/font]'); -- cgit v1.2.3 From 02a9fd5dc1d1d9e848e2f406f2e13c4cf0ce228b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Sat, 3 Mar 2012 10:44:34 +0000 Subject: A 'PHP Fatal error: Call to a member function getElementsByTagName() on a non-object in mod/parse_url.php on line 191' occurred when the linked HTML-File doesn't have a HEAD. The HTML-file couln't be link to in the editor therefore. --- mod/parse_url.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/parse_url.php b/mod/parse_url.php index e0b378f68..27dac4d5d 100755 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -188,7 +188,7 @@ function parse_url_content(&$a) { if(! $text) { logger('parsing meta'); - $items = $domhead->getElementsByTagName('meta'); + $items = (isset($domhead) && is_object($domhead) ? $domhead->getElementsByTagName('meta') : null); if($items) { foreach($items as $item) { $property = $item->getAttribute('property'); -- cgit v1.2.3 From fbc017cdba81fa7b159bca5fd0b3a4fb4885c5ad Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Mon, 5 Mar 2012 22:22:10 +0100 Subject: added test blueprints, fixed? encoding issues --- tests/xss_filter_tests.php | 140 +++++++++++++++++++++++++++++++++++++++++++++ view/de/strings.php | 20 +++---- 2 files changed, 150 insertions(+), 10 deletions(-) create mode 100644 tests/xss_filter_tests.php diff --git a/tests/xss_filter_tests.php b/tests/xss_filter_tests.php new file mode 100644 index 000000000..2d29e390a --- /dev/null +++ b/tests/xss_filter_tests.php @@ -0,0 +1,140 @@ +' + +$validstring=notags($invalidstring); +$escapedString=escape_tags($invalidstring); + +assert("[submit type="button" onclick="alert(\'failed!\');" /]", $validstring); +assert("what ever", $escapedString); + +/** +*autonames should be random, even length +*/ +$autoname1=autoname(10); +$autoname2=autoname(10); + +assertNotEquals($autoname1, $autoname2); + +/** +*autonames should be random, odd length +*/ +$autoname1=autoname(9); +$autoname2=autoname(9); + +assertNotEquals($autoname1, $autoname2); + +/** +* try to fail autonames +*/ +$autoname1=autoname(0); +$autoname2=autoname(MAX_VALUE); +$autoname3=autoname(1); +assert(count($autoname1), 0); +assert(count($autoname2), MAX_VALUE); +assert(count($autoname3), 1); + +/** +*xmlify and unxmlify +*/ +$text="I want to break\n this!11!" +$xml=xmlify($text); //test whether it actually may be part of a xml document +$retext=unxmlify($text); + +assert($text, $retext); + +/** +* test hex2bin and reverse +*/ + +assert(-3, hex2bin(bin2hex(-3))); +assert(0, hex2bin(bin2hex(0))); +assert(12, hex2bin(bin2hex(12))); +assert(MAX_INT, hex2bin(bin2hex(MAX_INT))); + +/** +* test expand_acl +*/ +$text="<1><2><3>"; +assert(array(1, 2, 3), $text); + +$text="<1><279012><15>"; +assert(array(1, 279012, 15), $text); + +$text="<1><279012>"; //maybe that's invalid +assert(array(1, 279012, "tt"), $text); + +$text="<1><279 012>"; //maybe that's invalid +assert(array(1, "279 012", "tt"), $text); + +$text=""; //maybe that's invalid +assert(array(), $text); + +$text="According to documentation, that's invalid. "; //should be invalid +assert(array(), $text); + +$text=" diff --git a/view/de/strings.php b/view/de/strings.php index 284c87f2f..2d29f69e2 100755 --- a/view/de/strings.php +++ b/view/de/strings.php @@ -4,7 +4,7 @@ function string_plural_select_de($n){ return ($n != 1); } ; -$a->strings["Post successful."] = "Beitrag erfolgreich veröffentlicht."; +$a->strings["Post successful."] = "Beitrag erfolgreich veröffentlicht."; $a->strings["[Embedded content - reload page to view]"] = "[Eingebetteter Inhalt - Seite neu laden zum Betrachten]"; $a->strings["Contact settings applied."] = "Einstellungen zum Kontakt angewandt."; $a->strings["Contact update failed."] = "Konnte den Kontakt nicht aktualisieren."; @@ -12,15 +12,15 @@ $a->strings["Permission denied."] = "Zugriff verweigert."; $a->strings["Contact not found."] = "Kontakt nicht gefunden."; $a->strings["Repair Contact Settings"] = "Kontakt-Einstellungen reparieren"; $a->strings["WARNING: This is highly advanced and if you enter incorrect information your communications with this contact may stop working."] = "ACHTUNG: Das sind Experten-Einstellungen! Wenn Du etwas falsches eingibst, funktioniert die Kommunikation mit diesem Kontakt evtl. nicht mehr."; -$a->strings["Please use your browser 'Back' button now if you are uncertain what to do on this page."] = "Bitte nutze den Zurück-Button deines Browsers jetzt, wenn du dir unsicher bist, was auf dieser Seite gemacht wird."; -$a->strings["Return to contact editor"] = "Zurück zum Kontakteditor"; +$a->strings["Please use your browser 'Back' button now if you are uncertain what to do on this page."] = "Bitte nutze den Zurück-Button deines Browsers jetzt, wenn du dir unsicher bist, was auf dieser Seite gemacht wird."; +$a->strings["Return to contact editor"] = "Zurück zum Kontakteditor"; $a->strings["Name"] = "Name"; $a->strings["Account Nickname"] = "Account-Spitzname"; -$a->strings["@Tagname - overrides Name/Nickname"] = "@Tagname - überschreibt Name/Spitzname"; +$a->strings["@Tagname - overrides Name/Nickname"] = "@Tagname - überschreibt Name/Spitzname"; $a->strings["Account URL"] = "Account-URL"; -$a->strings["Friend Request URL"] = "URL für Freundschaftsanfragen"; -$a->strings["Friend Confirm URL"] = "URL für Bestätigungen von Freundschaftsanfragen"; -$a->strings["Notification Endpoint URL"] = "URL-Endpunkt für Benachrichtigungen"; +$a->strings["Friend Request URL"] = "URL für Freundschaftsanfragen"; +$a->strings["Friend Confirm URL"] = "URL für Bestätigungen von Freundschaftsanfragen"; +$a->strings["Notification Endpoint URL"] = "URL-Endpunkt für Benachrichtigungen"; $a->strings["Poll/Feed URL"] = "Pull/Feed-URL"; $a->strings["New photo from this URL"] = "Neues Foto von dieser URL"; $a->strings["Submit"] = "Senden"; @@ -28,7 +28,7 @@ $a->strings["Help:"] = "Hilfe:"; $a->strings["Help"] = "Hilfe"; $a->strings["Not Found"] = "Nicht gefunden"; $a->strings["Page not found."] = "Seite nicht gefunden."; -$a->strings["File exceeds size limit of %d"] = "Die Datei ist größer als das erlaubte Limit von %d"; +$a->strings["File exceeds size limit of %d"] = "Die Datei ist größer als das erlaubte Limit von %d"; $a->strings["File upload failed."] = "Hochladen der Datei fehlgeschlagen."; $a->strings["Friend suggestion sent."] = "Kontaktvorschlag gesendet."; $a->strings["Suggest Friends"] = "Kontakte vorschlagen"; @@ -40,7 +40,7 @@ $a->strings["link to source"] = "Link zum Originalbeitrag"; $a->strings["Events"] = "Veranstaltungen"; $a->strings["Create New Event"] = "Neue Veranstaltung erstellen"; $a->strings["Previous"] = "Vorherige"; -$a->strings["Next"] = "Nächste"; +$a->strings["Next"] = "Nächste"; $a->strings["hour:minute"] = "Stunde:Minute"; $a->strings["Event details"] = "Veranstaltungsdetails"; $a->strings["Format is %s %s. Starting date and Description are required."] = "Format ist %s %s. Anfangsdatum und Beschreibung sind notwendig."; @@ -643,7 +643,7 @@ $a->strings["Site name"] = "Seitenname"; $a->strings["Banner/Logo"] = "Banner/Logo"; $a->strings["System language"] = "Systemsprache"; $a->strings["System theme"] = "Systemweites Thema"; -$a->strings["Maximum image size"] = "Maximale Größe von Bildern"; +$a->strings["Maximum image size"] = "Maximale Größe von Bildern"; $a->strings["Register policy"] = "Registrierungsmethode"; $a->strings["Register text"] = "Registrierungstext"; $a->strings["Accounts abandoned after x days"] = "Accounts gelten nach x Tagen als unbenutzt"; -- cgit v1.2.3 From 185fcd0701946babf61066b49582225286061563 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Thu, 8 Mar 2012 17:43:12 +0100 Subject: better tests --- build.xml | 52 ++++++++++- tests/xss_filter_test.php | 217 +++++++++++++++++++++++++++++++++++++++++++++ tests/xss_filter_tests.php | 140 ----------------------------- 3 files changed, 265 insertions(+), 144 deletions(-) create mode 100644 tests/xss_filter_test.php delete mode 100644 tests/xss_filter_tests.php diff --git a/build.xml b/build.xml index 83c530026..0f5745072 100644 --- a/build.xml +++ b/build.xml @@ -1,14 +1,58 @@ - + + + set_include_path( + get_include_path() . PATH_SEPARATOR + . 'include' . PATH_SEPARATOR + . 'library' . PATH_SEPARATOR + . 'library/phpsec' . PATH_SEPARATOR + . '.' ); + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/xss_filter_test.php b/tests/xss_filter_test.php new file mode 100644 index 000000000..e480ef7ec --- /dev/null +++ b/tests/xss_filter_test.php @@ -0,0 +1,217 @@ +'; + + $validstring=notags($invalidstring); + $escapedString=escape_tags($invalidstring); + + $this->assertEquals('[submit type="button" onclick="alert(\'failed!\');" /]', $validstring); + $this->assertEquals("<submit type="button" onclick="alert('failed!');" />", $escapedString); + } + + /** + *autonames should be random, even length + */ + public function testAutonameEven() { + $autoname1=autoname(10); + $autoname2=autoname(10); + + $this->assertNotEquals($autoname1, $autoname2); + } + + /** + *autonames should be random, odd length + */ + public function testAutonameOdd() { + $autoname1=autoname(9); + $autoname2=autoname(9); + + $this->assertNotEquals($autoname1, $autoname2); + } + + /** + * try to fail autonames + */ + public function testAutonameNoLength() { + $autoname1=autoname(0); + $this->assertEquals(0, count($autoname1)); + } + + public function testAutonameNegativeLength() { + $autoname1=autoname(-23); + $this->assertEquals(0, count($autoname1)); + } + +// public function testAutonameMaxLength() { +// $autoname2=autoname(PHP_INT_MAX); +// $this->assertEquals(PHP_INT_MAX, count($autoname2)); +// } + + public function testAutonameLength1() { + $autoname3=autoname(1); + $this->assertEquals(1, count($autoname3)); + } + + /** + *xmlify and unxmlify + */ + public function testXmlify() { + $text="I want to break\n this!11!"; + $xml=xmlify($text); //test whether it actually may be part of a xml document + $retext=unxmlify($text); + + $this->assertEquals($text, $retext); + } + + /** + * test hex2bin and reverse + */ + + public function testHex2Bin() { + $this->assertEquals(-3, hex2bin(bin2hex(-3))); + $this->assertEquals(0, hex2bin(bin2hex(0))); + $this->assertEquals(12, hex2bin(bin2hex(12))); + $this->assertEquals(PHP_INT_MAX, hex2bin(bin2hex(PHP_INT_MAX))); + } + + /** + * test expand_acl + */ + public function testExpandAclNormal() { + $text="<1><2><3>"; + $this->assertEquals(array(1, 2, 3), expand_acl($text)); + } + + public function testExpandAclBigNumber() { + $text="<1><279012><15>"; + $this->assertEquals(array(1, 279012, 15), expand_acl($text)); + } + + public function testExpandAclString() { + $text="<1><279012>"; //maybe that's invalid + $this->assertEquals(array(1, 279012, 'tt'), expand_acl($text)); + } + + public function testExpandAclSpace() { + $text="<1><279 012><32>"; //maybe that's invalid + $this->assertEquals(array(1, "279 012", "32"), expand_acl($text)); + } + + public function testExpandAclEmpty() { + $text=""; //maybe that's invalid + $this->assertEquals(array(), expand_acl($text)); + } + + public function testExpandAclNoBrackets() { + $text="According to documentation, that's invalid. "; //should be invalid + $this->assertEquals(array(), expand_acl($text)); + } + + public function testExpandAclJustOneBracket1() { + $text="assertEquals(array(), expand_acl($text)); + } + + public function testExpandAclJustOneBracket2() { + $text="Another invalid> string"; //should be invalid + $this->assertEquals(array(), expand_acl($text)); + } + + public function testExpandAclCloseOnly() { + $text="Another> invalid> string>"; //should be invalid + $this->assertEquals(array(), expand_acl($text)); + } + + public function testExpandAclOpenOnly() { + $text="assertEquals(array(), expand_acl($text)); + } + + public function testExpandAclNoMatching1() { + $text=" invalid "; //should be invalid + $this->assertEquals(array(), expand_acl($text)); + } + + public function testExpandAclNoMatching2() { + $text="<1>2><3>"; + $this->assertEquals(array(), expand_acl($text)); + } + + /** + * test attribute contains + */ + public function testAttributeContains1() { + $testAttr="class1 notclass2 class3"; + $this->assertTrue(attribute_contains($testAttr, "class3")); + $this->assertFalse(attribute_contains($testAttr, "class2")); + } + + /** + * test attribute contains + */ + public function testAttributeContains2() { + $testAttr="class1 not-class2 class3"; + $this->assertTrue(attribute_contains($testAttr, "class3")); + $this->assertFalse(attribute_contains($testAttr, "class2")); + } + + public function testAttributeContainsEmpty() { + $testAttr=""; + $this->assertFalse(attribute_contains($testAttr, "class2")); + } + + public function testAttributeContainsSpecialChars() { + $testAttr="--... %\$ä() /(=?}"; + $this->assertFalse(attribute_contains($testAttr, "class2")); + } + + /** + * test get_tags + */ + public function testGetTags() { + $text="hi @Mike, I'm just writing #test_cases, " + ." so @somebody@friendica.com may change #things. Of course I " + ."look for a lot of #pitfalls, like #tags at the end of a sentence " + ."@comment. I hope noone forgets about @fullstops.because that might" + ." break #things. @Mike@campino@friendica.eu is also #nice, isn't it? " + ."Now, add a @first_last tag. "; + //check whether this are all variants (no, auto-stuff is missing). + + $tags=get_tags($text); + + $this->assertEquals("@Mike", $tags[0]); + $this->assertEquals("#test_cases", $tags[1]); + $this->assertEquals("@somebody@friendica.com", $tags[2]); + $this->assertEquals("#things", $tags[3]); + $this->assertEquals("#pitfalls", $tags[4]); + $this->assertEquals("#tags", $tags[5]); + $this->assertEquals("@comment", $tags[6]); + $this->assertEquals("@fullstops", $tags[7]); + $this->assertEquals("#things", $tags[8]); + $this->assertEquals("@Mike", $tags[9]); + $this->assertEquals("@campino@friendica.eu", $tags[10]); + $this->assertEquals("#nice", $tags[11]); + $this->assertEquals("@first_last", $tags[12]); + } + + public function testGetTagsEmpty() { + $tags=get_tags(""); + $this->assertEquals(0, count($tags)); + } +//function qp, quick and dirty?? +//get_mentions +//get_contact_block, bis Zeile 538 +} +?> diff --git a/tests/xss_filter_tests.php b/tests/xss_filter_tests.php deleted file mode 100644 index 2d29e390a..000000000 --- a/tests/xss_filter_tests.php +++ /dev/null @@ -1,140 +0,0 @@ -' - -$validstring=notags($invalidstring); -$escapedString=escape_tags($invalidstring); - -assert("[submit type="button" onclick="alert(\'failed!\');" /]", $validstring); -assert("what ever", $escapedString); - -/** -*autonames should be random, even length -*/ -$autoname1=autoname(10); -$autoname2=autoname(10); - -assertNotEquals($autoname1, $autoname2); - -/** -*autonames should be random, odd length -*/ -$autoname1=autoname(9); -$autoname2=autoname(9); - -assertNotEquals($autoname1, $autoname2); - -/** -* try to fail autonames -*/ -$autoname1=autoname(0); -$autoname2=autoname(MAX_VALUE); -$autoname3=autoname(1); -assert(count($autoname1), 0); -assert(count($autoname2), MAX_VALUE); -assert(count($autoname3), 1); - -/** -*xmlify and unxmlify -*/ -$text="I want to break\n this!11!" -$xml=xmlify($text); //test whether it actually may be part of a xml document -$retext=unxmlify($text); - -assert($text, $retext); - -/** -* test hex2bin and reverse -*/ - -assert(-3, hex2bin(bin2hex(-3))); -assert(0, hex2bin(bin2hex(0))); -assert(12, hex2bin(bin2hex(12))); -assert(MAX_INT, hex2bin(bin2hex(MAX_INT))); - -/** -* test expand_acl -*/ -$text="<1><2><3>"; -assert(array(1, 2, 3), $text); - -$text="<1><279012><15>"; -assert(array(1, 279012, 15), $text); - -$text="<1><279012>"; //maybe that's invalid -assert(array(1, 279012, "tt"), $text); - -$text="<1><279 012>"; //maybe that's invalid -assert(array(1, "279 012", "tt"), $text); - -$text=""; //maybe that's invalid -assert(array(), $text); - -$text="According to documentation, that's invalid. "; //should be invalid -assert(array(), $text); - -$text=" -- cgit v1.2.3 From fbd7e8f8ba4a2736b231ee254e205b36e28d17cc Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Thu, 8 Mar 2012 17:44:57 +0100 Subject: excludes reports from git --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 6302bc1c8..2531fe4cd 100755 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,9 @@ addon #ignore documentation, it should be newly built doc/api +#ignore reports, should be generted with every build +report/ + #ignore config files from eclipse, we don't want IDE files in our repository .project .buildpath -- cgit v1.2.3 From 2e3116a11e020cd1f2bbe00b03c77210aad33fe5 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Thu, 8 Mar 2012 17:46:40 +0100 Subject: added library and include to .htaccess --- .htaccess | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.htaccess b/.htaccess index 1df509670..5f9531a7e 100755 --- a/.htaccess +++ b/.htaccess @@ -5,6 +5,9 @@ AddType audio/ogg .oga Deny from all + +Deny from all + RewriteEngine on -- cgit v1.2.3 From f84c191f8df126b95d8a41f70e785a9592018390 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Fri, 9 Mar 2012 12:16:58 +0100 Subject: added some tests --- build.xml | 28 +++++------ tests/xss_filter_test.php | 116 +++++++++++++++++++++++++++++++++++----------- util/db_update.php | 2 +- 3 files changed, 102 insertions(+), 44 deletions(-) diff --git a/build.xml b/build.xml index 0f5745072..a61a5123d 100644 --- a/build.xml +++ b/build.xml @@ -1,16 +1,6 @@ - - - set_include_path( - get_include_path() . PATH_SEPARATOR - . 'include' . PATH_SEPARATOR - . 'library' . PATH_SEPARATOR - . 'library/phpsec' . PATH_SEPARATOR - . '.' ); - - @@ -32,16 +22,17 @@ - + + @@ -50,9 +41,9 @@ - + @@ -75,6 +66,9 @@ + + + diff --git a/tests/xss_filter_test.php b/tests/xss_filter_test.php index e480ef7ec..00e97cf98 100644 --- a/tests/xss_filter_test.php +++ b/tests/xss_filter_test.php @@ -1,16 +1,26 @@ '; @@ -53,12 +63,12 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase { $autoname1=autoname(-23); $this->assertEquals(0, count($autoname1)); } - -// public function testAutonameMaxLength() { -// $autoname2=autoname(PHP_INT_MAX); -// $this->assertEquals(PHP_INT_MAX, count($autoname2)); -// } - + + // public function testAutonameMaxLength() { + // $autoname2=autoname(PHP_INT_MAX); + // $this->assertEquals(PHP_INT_MAX, count($autoname2)); + // } + public function testAutonameLength1() { $autoname3=autoname(1); $this->assertEquals(1, count($autoname3)); @@ -68,7 +78,7 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase { *xmlify and unxmlify */ public function testXmlify() { - $text="I want to break\n this!11!"; + $text="I want to break\n this!11!"; $xml=xmlify($text); //test whether it actually may be part of a xml document $retext=unxmlify($text); @@ -85,7 +95,7 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase { $this->assertEquals(12, hex2bin(bin2hex(12))); $this->assertEquals(PHP_INT_MAX, hex2bin(bin2hex(PHP_INT_MAX))); } - + /** * test expand_acl */ @@ -93,7 +103,7 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase { $text="<1><2><3>"; $this->assertEquals(array(1, 2, 3), expand_acl($text)); } - + public function testExpandAclBigNumber() { $text="<1><279012><15>"; $this->assertEquals(array(1, 279012, 15), expand_acl($text)); @@ -133,19 +143,19 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase { $text="Another> invalid> string>"; //should be invalid $this->assertEquals(array(), expand_acl($text)); } - + public function testExpandAclOpenOnly() { $text="assertEquals(array(), expand_acl($text)); } - + public function testExpandAclNoMatching1() { $text=" invalid "; //should be invalid $this->assertEquals(array(), expand_acl($text)); } - + public function testExpandAclNoMatching2() { - $text="<1>2><3>"; + $text="<1>2><3>"; $this->assertEquals(array(), expand_acl($text)); } @@ -166,7 +176,7 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase { $this->assertTrue(attribute_contains($testAttr, "class3")); $this->assertFalse(attribute_contains($testAttr, "class2")); } - + public function testAttributeContainsEmpty() { $testAttr=""; $this->assertFalse(attribute_contains($testAttr, "class2")); @@ -176,17 +186,71 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase { $testAttr="--... %\$ä() /(=?}"; $this->assertFalse(attribute_contains($testAttr, "class2")); } - + /** * test get_tags */ + public function testGetTagsShortPerson() { + $text="hi @Mike"; + + $tags=get_tags($text); + + $this->assertEquals("@Mike", $tags[0]); + } + + public function testGetTagsShortTag() { + $text="This is a #test_case"; + + $tags=get_tags($text); + + $this->assertEquals("#test_case", $tags[0]); + } + + public function testGetTagsShortTagAndPerson() { + $text="hi @Mike This is a #test_case"; + + $tags=get_tags($text); + + $this->assertEquals("@Mike", $tags[0]); + $this->assertEquals("#test_case", $tags[1]); + } + + public function testGetTagsShortTagAndPersonSpecialChars() { + $text="hi @Mike, This is a #test_case."; + + $tags=get_tags($text); + + $this->assertEquals("@Mike", $tags[0]); + $this->assertEquals("#test_case", $tags[1]); + } + + public function testGetTagsPersonOnly() { + $text="@Mike I saw the Theme Dev group was created."; + + $tags=get_tags($text); + + $this->assertEquals("@Mike", $tags[0]); + } + + public function testGetTags2Persons1TagSpecialChars() { + $text="hi @Mike, I'm just writing #test_cases, so" + ." so @somebody@friendica.com may change #things."; + + $tags=get_tags($text); + + $this->assertEquals("@Mike", $tags[0]); + $this->assertEquals("#test_cases", $tags[1]); + $this->assertEquals("@somebody@friendica.com", $tags[2]); + $this->assertEquals("#things", $tags[3]); + } + public function testGetTags() { $text="hi @Mike, I'm just writing #test_cases, " ." so @somebody@friendica.com may change #things. Of course I " ."look for a lot of #pitfalls, like #tags at the end of a sentence " ."@comment. I hope noone forgets about @fullstops.because that might" ." break #things. @Mike@campino@friendica.eu is also #nice, isn't it? " - ."Now, add a @first_last tag. "; + ."Now, add a @first_last tag. "; //check whether this are all variants (no, auto-stuff is missing). $tags=get_tags($text); @@ -210,8 +274,8 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase { $tags=get_tags(""); $this->assertEquals(0, count($tags)); } -//function qp, quick and dirty?? -//get_mentions -//get_contact_block, bis Zeile 538 + //function qp, quick and dirty?? + //get_mentions + //get_contact_block, bis Zeile 538 } ?> diff --git a/util/db_update.php b/util/db_update.php index a6177324a..35620e80b 100755 --- a/util/db_update.php +++ b/util/db_update.php @@ -26,7 +26,7 @@ echo "New DB VERSION: " . DB_UPDATE_VERSION . "\n"; if($build != DB_UPDATE_VERSION) { echo "Updating database..."; - check_config(); + check_config($a); echo "Done\n"; } -- cgit v1.2.3 From 21589c5eced7869d7105fa439c433e6a12c89531 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Fri, 9 Mar 2012 12:18:37 +0100 Subject: changed a test string --- tests/xss_filter_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/xss_filter_test.php b/tests/xss_filter_test.php index 00e97cf98..35d3b1be9 100644 --- a/tests/xss_filter_test.php +++ b/tests/xss_filter_test.php @@ -225,11 +225,11 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase { } public function testGetTagsPersonOnly() { - $text="@Mike I saw the Theme Dev group was created."; + $text="@Test I saw the Theme Dev group was created."; $tags=get_tags($text); - $this->assertEquals("@Mike", $tags[0]); + $this->assertEquals("@Test", $tags[0]); } public function testGetTags2Persons1TagSpecialChars() { -- cgit v1.2.3 From f8042d04451905486fb766c520736f4060ae9a12 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Fri, 9 Mar 2012 12:57:11 +0100 Subject: splitted test cases. --- mod/item.php | 212 +++++++++++++++++++++++----------------------- tests/get_tags_test.php | 147 ++++++++++++++++++++++++++++++++ tests/xss_filter_test.php | 88 ------------------- 3 files changed, 255 insertions(+), 192 deletions(-) create mode 100644 tests/get_tags_test.php diff --git a/mod/item.php b/mod/item.php index 81d7c753b..a9edf0da6 100755 --- a/mod/item.php +++ b/mod/item.php @@ -425,110 +425,7 @@ function item_post(&$a) { if(count($tags)) { foreach($tags as $tag) { - - if(isset($profile)) - unset($profile); - if(strpos($tag,'#') === 0) { - if(strpos($tag,'[url=')) - continue; - $basetag = str_replace('_',' ',substr($tag,1)); - $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); - - $newtag = '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]'; - if(! stristr($str_tags,$newtag)) { - if(strlen($str_tags)) - $str_tags .= ','; - $str_tags .= $newtag; - } - continue; - } - if(strpos($tag,'@') === 0) { - if(strpos($tag,'[url=')) - continue; - $stat = false; - $name = substr($tag,1); - if((strpos($name,'@')) || (strpos($name,'http://'))) { - $newname = $name; - $links = @lrdd($name); - if(count($links)) { - foreach($links as $link) { - if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') - $profile = $link['@attributes']['href']; - if($link['@attributes']['rel'] === 'salmon') { - if(strlen($inform)) - $inform .= ','; - $inform .= 'url:' . str_replace(',','%2c',$link['@attributes']['href']); - } - } - } - } - else { - $newname = $name; - $alias = ''; - $tagcid = 0; - if(strrpos($newname,'+')) { - $tagcid = intval(substr($newname,strrpos($newname,'+') + 1)); - if(strpos($name,' ')) - $name = substr($name,0,strpos($name,' ')); - } - if($tagcid) { - $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval($tagcid), - intval($profile_uid) - ); - } - elseif(strstr($name,'_') || strstr($name,' ')) { - $newname = str_replace('_',' ',$name); - $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1", - dbesc($newname), - intval($profile_uid) - ); - } - else { - $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1", - dbesc($name), - dbesc($name), - intval($profile_uid) - ); - } - if(count($r)) { - $profile = $r[0]['url']; - if($r[0]['network'] === 'stat') { - $newname = $r[0]['nick']; - $stat = true; - if($r[0]['alias']) - $alias = $r[0]['alias']; - } - else - $newname = $r[0]['name']; - if(strlen($inform)) - $inform .= ','; - $inform .= 'cid:' . $r[0]['id']; - } - } - if($profile) { - $body = str_replace('@' . $name, '@' . '[url=' . $profile . ']' . $newname . '[/url]', $body); - $profile = str_replace(',','%2c',$profile); - $newtag = '@[url=' . $profile . ']' . $newname . '[/url]'; - if(! stristr($str_tags,$newtag)) { - if(strlen($str_tags)) - $str_tags .= ','; - $str_tags .= $newtag; - } - - // Status.Net seems to require the numeric ID URL in a mention if the person isn't - // subscribed to you. But the nickname URL is OK if they are. Grrr. We'll tag both. - - if(strlen($alias)) { - $newtag = '@[url=' . $alias . ']' . $newname . '[/url]'; - if(! stristr($str_tags,$newtag)) { - if(strlen($str_tags)) - $str_tags .= ','; - $str_tags .= $newtag; - } - } - } - } + handle_tag($body, $inform, $str_tags, $profile_uid, $tag); } } @@ -922,3 +819,110 @@ function item_content(&$a) { drop_item($a->argv[2]); } } + +function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) { + $profile=null; + if(isset($profile)) + unset($profile); + if(strpos($tag,'#') === 0) { + if(strpos($tag,'[url=')) + continue; + $basetag = str_replace('_',' ',substr($tag,1)); + $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); + + $newtag = '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]'; + if(! stristr($str_tags,$newtag)) { + if(strlen($str_tags)) + $str_tags .= ','; + $str_tags .= $newtag; + } + continue; + } + if(strpos($tag,'@') === 0) { + if(strpos($tag,'[url=')) + continue; + $stat = false; + $name = substr($tag,1); + if((strpos($name,'@')) || (strpos($name,'http://'))) { + $newname = $name; + $links = @lrdd($name); + if(count($links)) { + foreach($links as $link) { + if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') + $profile = $link['@attributes']['href']; + if($link['@attributes']['rel'] === 'salmon') { + if(strlen($inform)) + $inform .= ','; + $inform .= 'url:' . str_replace(',','%2c',$link['@attributes']['href']); + } + } + } + } + else { + $newname = $name; + $alias = ''; + $tagcid = 0; + if(strrpos($newname,'+')) { + $tagcid = intval(substr($newname,strrpos($newname,'+') + 1)); + if(strpos($name,' ')) + $name = substr($name,0,strpos($name,' ')); + } + if($tagcid) { + $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($tagcid), + intval($profile_uid) + ); + } + elseif(strstr($name,'_') || strstr($name,' ')) { + $newname = str_replace('_',' ',$name); + $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1", + dbesc($newname), + intval($profile_uid) + ); + } + else { + $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1", + dbesc($name), + dbesc($name), + intval($profile_uid) + ); + } + if(count($r)) { + $profile = $r[0]['url']; + if($r[0]['network'] === 'stat') { + $newname = $r[0]['nick']; + $stat = true; + if($r[0]['alias']) + $alias = $r[0]['alias']; + } + else + $newname = $r[0]['name']; + if(strlen($inform)) + $inform .= ','; + $inform .= 'cid:' . $r[0]['id']; + } + } + if($profile) { + $body = str_replace('@' . $name, '@' . '[url=' . $profile . ']' . $newname . '[/url]', $body); + $profile = str_replace(',','%2c',$profile); + $newtag = '@[url=' . $profile . ']' . $newname . '[/url]'; + if(! stristr($str_tags,$newtag)) { + if(strlen($str_tags)) + $str_tags .= ','; + $str_tags .= $newtag; + } + + // Status.Net seems to require the numeric ID URL in a mention if the person isn't + // subscribed to you. But the nickname URL is OK if they are. Grrr. We'll tag both. + + if(strlen($alias)) { + $newtag = '@[url=' . $alias . ']' . $newname . '[/url]'; + if(! stristr($str_tags,$newtag)) { + if(strlen($str_tags)) + $str_tags .= ','; + $str_tags .= $newtag; + } + } + } + } +} diff --git a/tests/get_tags_test.php b/tests/get_tags_test.php new file mode 100644 index 000000000..a458f0fbc --- /dev/null +++ b/tests/get_tags_test.php @@ -0,0 +1,147 @@ +15, 'network'=>'stat', 'alias'=>'Mike', 'nick'=>'Mike', 'url'=>"http://justatest.de")); + +} +function dbesc($str) { + echo $str; +} + +class GetTagsTest extends PHPUnit_Framework_TestCase { + + public function setUp() { + set_include_path( + get_include_path() . PATH_SEPARATOR + . 'include' . PATH_SEPARATOR + . 'library' . PATH_SEPARATOR + . 'library/phpsec' . PATH_SEPARATOR + . '.' ); + } + + /** + * test with one Person tag + */ + public function testGetTagsShortPerson() { + $text="hi @Mike"; + + $tags=get_tags($text); + + $inform=''; + $str_tags=''; + handle_body($text, $inform, $str_tags, 11, $tags[0]); + + $this->assertEquals("@Mike", $tags[0]); + $this->assertEquals($text, "hi @[url=http://justatest.de]Mike[/url]"); + } + + /** + * Test with one hash tag. + */ + public function testGetTagsShortTag() { + $text="This is a #test_case"; + + $tags=get_tags($text); + + $this->assertEquals("#test_case", $tags[0]); + } + + /** + * test with a person and a hash tag + */ + public function testGetTagsShortTagAndPerson() { + $text="hi @Mike This is a #test_case"; + + $tags=get_tags($text); + + $inform=''; + $str_tags=''; + handle_body($text, $inform, $str_tags, 11, $tags[0]); + + $this->assertEquals("hi @[url=http://justatest.de]Mike[/url] This is a #test_case", $text); + $this->assertEquals("@Mike", $tags[0]); + $this->assertEquals("#test_case", $tags[1]); + } + + /** + * test with a person, a hash tag and some special chars. + */ + public function testGetTagsShortTagAndPersonSpecialChars() { + $text="hi @Mike, This is a #test_case."; + + $tags=get_tags($text); + + $this->assertEquals("@Mike", $tags[0]); + $this->assertEquals("#test_case", $tags[1]); + } + + /** + * Test with a person tag and text behind it. + */ + public function testGetTagsPersonOnly() { + $text="@Test I saw the Theme Dev group was created."; + + $tags=get_tags($text); + + $this->assertEquals("@Test", $tags[0]); + } + + /** + * test with two persons and one special tag. + */ + public function testGetTags2Persons1TagSpecialChars() { + $text="hi @Mike, I'm just writing #test_cases, so" + ." so @somebody@friendica.com may change #things."; + + $tags=get_tags($text); + + $this->assertEquals("@Mike", $tags[0]); + $this->assertEquals("#test_cases", $tags[1]); + $this->assertEquals("@somebody@friendica.com", $tags[2]); + $this->assertEquals("#things", $tags[3]); + } + + /** + * test with a long text. + */ + public function testGetTags() { + $text="hi @Mike, I'm just writing #test_cases, " + ." so @somebody@friendica.com may change #things. Of course I " + ."look for a lot of #pitfalls, like #tags at the end of a sentence " + ."@comment. I hope noone forgets about @fullstops.because that might" + ." break #things. @Mike@campino@friendica.eu is also #nice, isn't it? " + ."Now, add a @first_last tag. "; + //TODO check whether this are all variants (no, auto-stuff is missing). + + $tags=get_tags($text); + + $this->assertEquals("@Mike", $tags[0]); + $this->assertEquals("#test_cases", $tags[1]); + $this->assertEquals("@somebody@friendica.com", $tags[2]); + $this->assertEquals("#things", $tags[3]); + $this->assertEquals("#pitfalls", $tags[4]); + $this->assertEquals("#tags", $tags[5]); + $this->assertEquals("@comment", $tags[6]); + $this->assertEquals("@fullstops", $tags[7]); + $this->assertEquals("#things", $tags[8]); + $this->assertEquals("@Mike", $tags[9]); + $this->assertEquals("@campino@friendica.eu", $tags[10]); + $this->assertEquals("#nice", $tags[11]); + $this->assertEquals("@first_last", $tags[12]); + } + + /** + * test with an empty string + */ + public function testGetTagsEmpty() { + $tags=get_tags(""); + $this->assertEquals(0, count($tags)); + } +} \ No newline at end of file diff --git a/tests/xss_filter_test.php b/tests/xss_filter_test.php index 35d3b1be9..fe944c2a7 100644 --- a/tests/xss_filter_test.php +++ b/tests/xss_filter_test.php @@ -1,6 +1,5 @@ assertFalse(attribute_contains($testAttr, "class2")); } - /** - * test get_tags - */ - public function testGetTagsShortPerson() { - $text="hi @Mike"; - - $tags=get_tags($text); - - $this->assertEquals("@Mike", $tags[0]); - } - - public function testGetTagsShortTag() { - $text="This is a #test_case"; - - $tags=get_tags($text); - - $this->assertEquals("#test_case", $tags[0]); - } - - public function testGetTagsShortTagAndPerson() { - $text="hi @Mike This is a #test_case"; - - $tags=get_tags($text); - - $this->assertEquals("@Mike", $tags[0]); - $this->assertEquals("#test_case", $tags[1]); - } - - public function testGetTagsShortTagAndPersonSpecialChars() { - $text="hi @Mike, This is a #test_case."; - - $tags=get_tags($text); - - $this->assertEquals("@Mike", $tags[0]); - $this->assertEquals("#test_case", $tags[1]); - } - - public function testGetTagsPersonOnly() { - $text="@Test I saw the Theme Dev group was created."; - - $tags=get_tags($text); - - $this->assertEquals("@Test", $tags[0]); - } - - public function testGetTags2Persons1TagSpecialChars() { - $text="hi @Mike, I'm just writing #test_cases, so" - ." so @somebody@friendica.com may change #things."; - - $tags=get_tags($text); - - $this->assertEquals("@Mike", $tags[0]); - $this->assertEquals("#test_cases", $tags[1]); - $this->assertEquals("@somebody@friendica.com", $tags[2]); - $this->assertEquals("#things", $tags[3]); - } - - public function testGetTags() { - $text="hi @Mike, I'm just writing #test_cases, " - ." so @somebody@friendica.com may change #things. Of course I " - ."look for a lot of #pitfalls, like #tags at the end of a sentence " - ."@comment. I hope noone forgets about @fullstops.because that might" - ." break #things. @Mike@campino@friendica.eu is also #nice, isn't it? " - ."Now, add a @first_last tag. "; - //check whether this are all variants (no, auto-stuff is missing). - - $tags=get_tags($text); - - $this->assertEquals("@Mike", $tags[0]); - $this->assertEquals("#test_cases", $tags[1]); - $this->assertEquals("@somebody@friendica.com", $tags[2]); - $this->assertEquals("#things", $tags[3]); - $this->assertEquals("#pitfalls", $tags[4]); - $this->assertEquals("#tags", $tags[5]); - $this->assertEquals("@comment", $tags[6]); - $this->assertEquals("@fullstops", $tags[7]); - $this->assertEquals("#things", $tags[8]); - $this->assertEquals("@Mike", $tags[9]); - $this->assertEquals("@campino@friendica.eu", $tags[10]); - $this->assertEquals("#nice", $tags[11]); - $this->assertEquals("@first_last", $tags[12]); - } - - public function testGetTagsEmpty() { - $tags=get_tags(""); - $this->assertEquals(0, count($tags)); - } //function qp, quick and dirty?? //get_mentions //get_contact_block, bis Zeile 538 -- cgit v1.2.3 From cb1ecf2c5ad649eb372db9eb3bd1da756f207fb6 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 10 Mar 2012 00:15:27 +0100 Subject: diabook: Moving the location between the icons --- view/theme/diabook/style.css | 3 +++ view/theme/diabook/wall_item.tpl | 3 +-- view/theme/diabook/wallwall_item.tpl | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index bccfea149..2d4670dca 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -1113,6 +1113,7 @@ section { } .wall-item-container .wall-item-location { padding-right: 40px; + display: table-cell; } .wall-item-container .wall-item-ago { word-wrap: break-word; @@ -1168,6 +1169,7 @@ section { .wall-item-container .wall-item-actions-social { float: left; margin-bottom: 1px; + display: table-cell; } .wall-item-container .wall-item-actions-social a { margin-right: 1em; @@ -1178,6 +1180,7 @@ section { .wall-item-container .wall-item-actions-tools { float: right; width: 80px; + display: table-cell; } .wall-item-container .wall-item-actions-tools a { float: right; diff --git a/view/theme/diabook/wall_item.tpl b/view/theme/diabook/wall_item.tpl index b1a014949..8c892fd2a 100644 --- a/view/theme/diabook/wall_item.tpl +++ b/view/theme/diabook/wall_item.tpl @@ -46,7 +46,6 @@
-
$item.location 
@@ -82,7 +81,7 @@ {{ endif }}
- +
$item.location 
diff --git a/view/theme/diabook/wallwall_item.tpl b/view/theme/diabook/wallwall_item.tpl index 603a908c5..3b103745b 100644 --- a/view/theme/diabook/wallwall_item.tpl +++ b/view/theme/diabook/wallwall_item.tpl @@ -52,7 +52,6 @@
-
$item.location 
@@ -88,7 +87,8 @@ {{ endif }}
- +
$item.location 
+
@@ -100,4 +100,4 @@
$item.comment -
\ No newline at end of file +
-- cgit v1.2.3 From 15916a2cb717828367fc7e0bb74137942836a772 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 10 Mar 2012 09:52:20 +0100 Subject: Mail: Removing signatures, gpg, unnecessary line breaks --- include/email.php | 14 ++++ include/msgclean.php | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++ include/poller.php | 3 +- 3 files changed, 240 insertions(+), 2 deletions(-) create mode 100644 include/msgclean.php diff --git a/include/email.php b/include/email.php index 659978b6e..a3449a424 100755 --- a/include/email.php +++ b/include/email.php @@ -1,5 +1,7 @@ parts) { $ret['body'] = email_get_part($mbox,$uid,$struc,0, 'html'); + $html = $ret['body']; if (trim($ret['body']) == '') $ret['body'] = email_get_part($mbox,$uid,$struc,0, 'plain'); @@ -107,6 +110,17 @@ function email_get_msg($mbox,$uid) { else $ret['body'] = $text; } + + $ret['body'] = removegpg($ret['body']); + $msg = removesig($ret['body']); + $ret['body'] = $msg['body']; + $ret['body'] = convertquote($ret['body'], false); + + if (trim($html) != '') + $ret['body'] = removelinebreak($ret['body']); + + $ret['body'] = unifyattributionline($ret['body']); + return $ret; } diff --git a/include/msgclean.php b/include/msgclean.php new file mode 100644 index 000000000..284ad1ce4 --- /dev/null +++ b/include/msgclean.php @@ -0,0 +1,225 @@ +\s.*?To: (.*?)\s*?Cc: (.*?)\s*?Sent: (.*?)\s.*?Subject: ([^\n].*)\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/----- Original Message -----\s.*?From: "([^<"].*?)" <(.*?)>\s.*?To: (.*?)\s*?Sent: (.*?)\s.*?Subject: ([^\n].*)\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/-------- Original-Nachricht --------\s*\['.$quote.'\]\nDatum: (.*?)\nVon: (.*?) <(.*?)>\nAn: (.*?)\nBetreff: (.*?)\n/i', "[".$quote."='$2']\n", $message); + $message = savereplace('/-------- Original-Nachricht --------\s*\['.$quote.'\]\sDatum: (.*?)\s.*Von: "([^<"].*?)" <(.*?)>\s.*An: (.*?)\n.*/i', "[".$quote."='$2']\n", $message); + $message = savereplace('/-------- Original-Nachricht --------\s*\['.$quote.'\]\nDatum: (.*?)\nVon: (.*?)\nAn: (.*?)\nBetreff: (.*?)\n/i', "[".$quote."='$2']\n", $message); + + $message = savereplace('/-----Urspr.*?ngliche Nachricht-----\sVon: "([^<"].*?)" <(.*?)>\s.*Gesendet: (.*?)\s.*An: (.*?)\s.*Betreff: ([^\n].*?).*:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/-----Urspr.*?ngliche Nachricht-----\sVon: "([^<"].*?)" <(.*?)>\s.*Gesendet: (.*?)\s.*An: (.*?)\s.*Betreff: ([^\n].*?)\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/Am (.*?), schrieb (.*?):\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + + $message = savereplace('/Am .*?, \d+ .*? \d+ \d+:\d+:\d+ \+\d+\sschrieb\s(.*?)\s<(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/Am (.*?) schrieb (.*?) <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + $message = savereplace('/Am (.*?) schrieb <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + $message = savereplace('/Am (.*?) schrieb (.*?):\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + $message = savereplace('/Am (.*?) schrieb (.*?)\n(.*?):\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + + $message = savereplace('/(\d+)\/(\d+)\/(\d+) ([^<"].*?) <(.*?)>\s*\['.$quote.'\]/i', "[".$quote."='$4']\n", $message); + + $message = savereplace('/On .*?, \d+ .*? \d+ \d+:\d+:\d+ \+\d+\s(.*?)\s<(.*?)>\swrote:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/On (.*?) at (.*?), (.*?)\s<(.*?)>\swrote:\s*\['.$quote.'\]/i', "[".$quote."='$3']\n", $message); + $message = savereplace('/On (.*?)\n([^<].*?)\s<(.*?)>\swrote:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + $message = savereplace('/On (.*?), (.*?), (.*?)\s<(.*?)>\swrote:\s*\['.$quote.'\]/i', "[".$quote."='$3']\n", $message); + $message = savereplace('/On ([^,].*?), (.*?)\swrote:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + $message = savereplace('/On (.*?), (.*?)\swrote\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + + // Der loescht manchmal den Body - was eigentlich unmoeglich ist + $message = savereplace('/On (.*?),(.*?),(.*?),(.*?), (.*?) wrote:\s*\['.$quote.'\]/i', "[".$quote."='$5']\n", $message); + + $message = savereplace('/Zitat von ([^<].*?) <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/Quoting ([^<].*?) <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/From: "([^<"].*?)" <(.*?)>\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/From: <(.*?)>\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/Du \(([^)].*?)\) schreibst:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/--- (.*?) <.*?> schrieb am (.*?):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/--- (.*?) schrieb am (.*?):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/\* (.*?) <(.*?)> hat geschrieben:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/(.*?) <(.*?)> schrieb (.*?)\):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/(.*?) <(.*?)> schrieb am (.*?) um (.*):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/(.*?) schrieb am (.*?) um (.*):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/(.*?) \((.*?)\) schrieb:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + $message = savereplace('/(.*?) schrieb:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/(.*?) <(.*?)> writes:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/(.*?) \((.*?)\) writes:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + $message = savereplace('/(.*?) writes:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/\* (.*?) wrote:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/(.*?) wrote \(.*?\):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/(.*?) wrote:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/([^<].*?) <.*?> hat am (.*?)\sum\s(.*)\sgeschrieben:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + + $message = savereplace('/(\d+)\/(\d+)\/(\d+) ([^<"].*?) <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$4']\n", $message); + $message = savereplace('/(\d+)\/(\d+)\/(\d+) (.*?) <(.*?)>\s*\['.$quote.'\]/i', "[".$quote."='$4']\n", $message); + $message = savereplace('/(\d+)\/(\d+)\/(\d+) <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$4']\n", $message); + $message = savereplace('/(\d+)\/(\d+)\/(\d+) <(.*?)>\s*\['.$quote.'\]/i', "[".$quote."='$4']\n", $message); + + $message = savereplace('/(.*?) <(.*?)> schrubselte:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message); + $message = savereplace('/(.*?) \((.*?)\) schrubselte:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message); + + } + return($message); +} + +function removegpg($message) +{ + + $pattern = '/(.*)\s*-----BEGIN PGP SIGNED MESSAGE-----\s*[\r\n].*Hash:.*?[\r\n](.*)'. + '[\r\n]\s*-----BEGIN PGP SIGNATURE-----\s*[\r\n].*'. + '[\r\n]\s*-----END PGP SIGNATURE-----(.*)/is'; + + preg_match($pattern, $message, $result); + + $cleaned = trim($result[1].$result[2].$result[3]); + + $cleaned = str_replace(array("\n- --\n", "\n- -"), array("\n-- \n", "\n-"), $cleaned); + + + if ($cleaned == '') + $cleaned = $message; + + return($cleaned); +} + +function removesig($message) +{ + $sigpos = strrpos($message, "\n-- \n"); + $quotepos = strrpos($message, "[/quote]"); + + if ($sigpos == 0) { + // Speziell fuer web.de, die das als Trenner verwenden + $message = str_replace("\n___________________________________________________________\n", "\n-- \n", $message); + $sigpos = strrpos($message, "\n-- \n"); + $quotepos = strrpos($message, "[/quote]"); + } + + // Sollte sich der Signaturtrenner innerhalb eines Quotes befinden + // wird keine Signaturtrennung ausgefuehrt + if (($sigpos < $quotepos) and ($sigpos != 0)) + return(array('body' => $message, 'sig' => '')); + + // To-Do: Regexp umstellen, so dass auf 1 oder kein Leerzeichen + // geprueft wird + //$message = str_replace("\n--\n", "\n-- \n", $message); + + $pattern = '/(.*)[\r\n]-- [\r\n](.*)/is'; + + preg_match($pattern, $message, $result); + + if (($result[1] != '') and ($result[2] != '')) { + $cleaned = trim($result[1])."\n"; + $sig = trim($result[2]); + // '[hr][size=x-small][color=darkblue]'.trim($result[2]).'[/color][/size]'; + } else { + $cleaned = $message; + $sig = ''; + } + + return(array('body' => $cleaned, 'sig' => $sig)); +} + +function removelinebreak($message) +{ + $arrbody = explode("\n", trim($message)); + + $lines = array(); + $lineno = 0; + + foreach($arrbody as $i => $line) { + $currquotelevel = 0; + $currline = $line; + while ((strlen($currline)>0) and ((substr($currline, 0, 1) == '>') + or (substr($currline, 0, 1) == ' '))) { + if (substr($currline, 0, 1) == '>') + $currquotelevel++; + + $currline = ltrim(substr($currline, 1)); + } + + $quotelevel = 0; + $nextline = trim($arrbody[$i+1]); + while ((strlen($nextline)>0) and ((substr($nextline, 0, 1) == '>') + or (substr($nextline, 0, 1) == ' '))) { + if (substr($nextline, 0, 1) == '>') + $quotelevel++; + + $nextline = ltrim(substr($nextline, 1)); + } + + $len = strlen($line); + $firstword = strpos($nextline.' ', ' '); + + $specialchars = ((substr(trim($nextline), 0, 1) == '-') or + (substr(trim($nextline), 0, 1) == '=') or + (substr(trim($nextline), 0, 1) == '*') or + (substr(trim($nextline), 0, 1) == '·') or + (substr(trim($nextline), 0, 4) == '[url') or + (substr(trim($nextline), 0, 5) == '[size') or + (substr(trim($nextline), 0, 7) == 'http://') or + (substr(trim($nextline), 0, 8) == 'https://')); + + if (!$specialchars) + $specialchars = ((substr(rtrim($line), -1) == '-') or + (substr(rtrim($line), -1) == '=') or + (substr(rtrim($line), -1) == '*') or + (substr(rtrim($line), -1) == '·') or + (substr(rtrim($line), -6) == '[/url]') or + (substr(rtrim($line), -7) == '[/size]')); + + //if ($specialchars) + // echo ("Special\n"); + + if ($lines[$lineno] != '') { + if (substr($lines[$lineno], -1) != ' ') + $lines[$lineno] .= ' '; + + while ((strlen($line)>0) and ((substr($line, 0, 1) == '>') + or (substr($line, 0, 1) == ' '))) { + + $line = ltrim(substr($line, 1)); + } + + } + //else + // $lines[$lineno] = $quotelevel.'-'.$len.'-'.$firstword.'-'; + + $lines[$lineno] .= $line; + //if ((($len + $firstword < 68) and (substr($line, -1, 1) != ' ')) + // or ($quotelevel != $currquotelevel) or $specialchars) + if (((substr($line, -1, 1) != ' ')) + or ($quotelevel != $currquotelevel)) + $lineno++; + } + return(implode("\n", $lines)); + +} +?> diff --git a/include/poller.php b/include/poller.php index cfbc46b87..3be6caebd 100755 --- a/include/poller.php +++ b/include/poller.php @@ -1,7 +1,6 @@ Date: Sat, 10 Mar 2012 11:29:40 +0100 Subject: New config options if ostatus polling should use the priority in the contacts --- include/poller.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/poller.php b/include/poller.php index 3be6caebd..f165ad590 100755 --- a/include/poller.php +++ b/include/poller.php @@ -140,7 +140,10 @@ function poller_run($argv, $argc){ if($manual_id) $contact['last-update'] = '0000-00-00 00:00:00'; - if($contact['network'] === NETWORK_DFRN || $contact['network'] === NETWORK_OSTATUS) + if($contact['network'] === NETWORK_DFRN) + $contact['priority'] = 2; + + if(!get_config('system','ostatus_use_priority') and ($contact['network'] === NETWORK_OSTATUS)) $contact['priority'] = 2; if($contact['priority'] || $contact['subhub']) { -- cgit v1.2.3 From 74b3e9f273b019729d213f3ccaeba1bb11d61d24 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 10 Mar 2012 15:50:35 +0100 Subject: Enabled Caching for items. Changed color of tags in diabook. --- include/text.php | 17 ++++++++++++++++- view/theme/diabook/style.css | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/include/text.php b/include/text.php index 5ad0154d7..38736d836 100644 --- a/include/text.php +++ b/include/text.php @@ -874,6 +874,14 @@ function link_compare($a,$b) { if(! function_exists('prepare_body')) { function prepare_body($item,$attach = false) { + $cache = get_config('system','itemcache'); + + if (($cache != '')) { + $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".$attach; + if (file_exists($cachefile)) + return(file_get_contents($cachefile)); + } + call_hooks('prepare_body_init', $item); $s = prepare_text($item['body']); @@ -882,8 +890,11 @@ function prepare_body($item,$attach = false) { call_hooks('prepare_body', $prep_arr); $s = $prep_arr['html']; - if(! $attach) + if(! $attach) { + if ($cache != '') + file_put_contents($cachefile, $s); return $s; + } $arr = explode(',',$item['attach']); if(count($arr)) { @@ -917,6 +928,10 @@ function prepare_body($item,$attach = false) { $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body_final', $prep_arr); + + if ($cache != '') + file_put_contents($cachefile, $prep_arr['html']); + return $prep_arr['html']; }} diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index 2d4670dca..0504ce96a 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -1277,14 +1277,14 @@ section { } .tag { /*background: url("../../../images/tag_b.png") repeat-x center left;*/ - color: #3465A4; + color: #999; padding-left: 3px; font-size: 12px; } .tag a { padding-right: 5px; /*background: url("../../../images/tag.png") no-repeat center right;*/ - color: #3465A4; + color: #999; } .wwto { position: absolute !important; -- cgit v1.2.3 From 670b571c8ac0532cc80fff6351f91b1b0fa58e0c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 10 Mar 2012 18:19:00 +0100 Subject: Caching improved. --- include/text.php | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/include/text.php b/include/text.php index 38736d836..5bf815105 100644 --- a/include/text.php +++ b/include/text.php @@ -874,25 +874,27 @@ function link_compare($a,$b) { if(! function_exists('prepare_body')) { function prepare_body($item,$attach = false) { + call_hooks('prepare_body_init', $item); + $cache = get_config('system','itemcache'); if (($cache != '')) { - $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".$attach; - if (file_exists($cachefile)) - return(file_get_contents($cachefile)); - } - - call_hooks('prepare_body_init', $item); + $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".$attach."-".hash("crc32", $item['body']); - $s = prepare_text($item['body']); + if (file_exists($cachefile)) + $s = file_get_contents($cachefile); + else { + $s = prepare_text($item['body']); + file_put_contents($cachefile, $s); + } + } else + $s = prepare_text($item['body']); $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body', $prep_arr); $s = $prep_arr['html']; if(! $attach) { - if ($cache != '') - file_put_contents($cachefile, $s); return $s; } @@ -925,13 +927,9 @@ function prepare_body($item,$attach = false) { $s .= '
'; } - $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body_final', $prep_arr); - if ($cache != '') - file_put_contents($cachefile, $prep_arr['html']); - return $prep_arr['html']; }} -- cgit v1.2.3 From eb3b211461906c405c7d016401cb3cd6d7d03b83 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 11 Mar 2012 14:22:19 +0100 Subject: New plugin that shows community pages in the sidebar --- addon/pages/README | 3 +++ addon/pages/pages.php | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 addon/pages/README create mode 100755 addon/pages/pages.php diff --git a/addon/pages/README b/addon/pages/README new file mode 100755 index 000000000..6ec314b70 --- /dev/null +++ b/addon/pages/README @@ -0,0 +1,3 @@ +Pages + +Shows lists of community pages diff --git a/addon/pages/pages.php b/addon/pages/pages.php new file mode 100755 index 000000000..13e6c4b59 --- /dev/null +++ b/addon/pages/pages.php @@ -0,0 +1,39 @@ + + * + */ + +function pages_install() { + register_hook('page_end', 'addon/pages/pages.php', 'pages_page_end'); +} + +function pages_uninstall() { + unregister_hook('page_end', 'addon/pages/pages.php', 'pages_page_end'); +} + +function pages_page_end($a,&$b) { + if (($a->module != "network") OR ($a->user['uid'] == 0)) + return; + + $pages = '

'.t("Community").'

    '; + $contacts = q("SELECT `contact`.`id`, `contact`.`url`, `contact`.`Name` FROM `contact`, `user` + WHERE `network`= 'dfrn' AND `duplex` + AND `contact`.`nick`=`user`.`nickname` + AND `user`.`page-flags`= %d + AND `contact`.`uid` = %d", + intval(PAGE_COMMUNITY), + intval($a->user['uid'])); + foreach($contacts as $contact) { + $pages .= '
  • '.$contact["Name"]."
  • "; + } + $pages .= "
"; + if (sizeof($contacts) > 0) + $a->page['aside'] = $pages.$a->page['aside']; + +} + +?> -- cgit v1.2.3 From b879a1ddf1575a3bd355edcee634be4a8d179c25 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 11 Mar 2012 17:45:12 +0100 Subject: Pages: Show every community page - even from foreign servers (with caching) --- addon/pages/pages.php | 70 ++++++++++++++++++++++++++++++++++++-------- view/theme/diabook/style.css | 3 ++ 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/addon/pages/pages.php b/addon/pages/pages.php index 13e6c4b59..6b242be31 100755 --- a/addon/pages/pages.php +++ b/addon/pages/pages.php @@ -15,25 +15,71 @@ function pages_uninstall() { unregister_hook('page_end', 'addon/pages/pages.php', 'pages_page_end'); } +function pages_iscommunity($url, &$pagelist) { + // check every week for the status - should be enough + if ($pagelist[$url]["checked"]') != 0); + + $pagelist[$url] = array("community" => $iscommunity, "checked" => time()); + } else // Fetch from cache + $iscommunity = $pagelist[$url]["community"]; + return($iscommunity); +} + +function pages_getpages($uid) { + + // Fetch cached pagelist from configuration + $pagelist = get_pconfig($uid,'pages','pagelist'); + + if (sizeof($pagelist) == 0) + $pagelist = array(); + + $contacts = q("SELECT `id`, `url`, `Name` FROM `contact` + WHERE `network`= 'dfrn' AND `uid` = %d", + intval($uid)); + + $pages = array(); + + // Look if the profile is a community page + foreach($contacts as $contact) { + if (pages_iscommunity($contact["url"], $pagelist)) + $pages[] = array("url"=>$contact["url"], "Name"=>$contact["Name"]); + } + + // Write back cached pagelist + set_pconfig($uid,'pages','pagelist', $pagelist); + return($pages); +} + function pages_page_end($a,&$b) { + // Only move on if if it's the "network" module and there is a logged on user if (($a->module != "network") OR ($a->user['uid'] == 0)) return; - $pages = '

'.t("Community").'

    '; - $contacts = q("SELECT `contact`.`id`, `contact`.`url`, `contact`.`Name` FROM `contact`, `user` - WHERE `network`= 'dfrn' AND `duplex` - AND `contact`.`nick`=`user`.`nickname` - AND `user`.`page-flags`= %d - AND `contact`.`uid` = %d", - intval(PAGE_COMMUNITY), - intval($a->user['uid'])); + $pages = '
    +
    +

    '.t("Community").'

    +
"; if (sizeof($contacts) > 0) $a->page['aside'] = $pages.$a->page['aside']; - } - ?> diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index 0504ce96a..ce3307645 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -484,6 +484,9 @@ code { #sidebar-group-list .tool:hover { background: #EEE; } +#sidebar-pages-list .tool:hover { + background: #EEE; +} .tool .label { float: left; } -- cgit v1.2.3 From 9f76d96d46356b18325ca49c383f94a1958fefd3 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 11 Mar 2012 19:11:25 +0100 Subject: Cache: item cache now has an autodelete of old files. The pages plugin now sets a link via redirection. So posting works. --- addon/pages/pages.php | 5 +++-- include/poller.php | 13 +++++++++++++ include/text.php | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/addon/pages/pages.php b/addon/pages/pages.php index 6b242be31..9e90cc24d 100755 --- a/addon/pages/pages.php +++ b/addon/pages/pages.php @@ -55,7 +55,7 @@ function pages_getpages($uid) { // Look if the profile is a community page foreach($contacts as $contact) { if (pages_iscommunity($contact["url"], $pagelist)) - $pages[] = array("url"=>$contact["url"], "Name"=>$contact["Name"]); + $pages[] = array("url"=>$contact["url"], "Name"=>$contact["Name"], "id"=>$contact["id"]); } // Write back cached pagelist @@ -76,7 +76,8 @@ function pages_page_end($a,&$b) { $contacts = pages_getpages($a->user['uid']); foreach($contacts as $contact) { - $pages .= '
  • '.$contact["Name"]."
  • "; + $pages .= '
  • '. + $contact["Name"]."
  • "; } $pages .= ""; if (sizeof($contacts) > 0) diff --git a/include/poller.php b/include/poller.php index f165ad590..65fafda4c 100755 --- a/include/poller.php +++ b/include/poller.php @@ -69,6 +69,19 @@ function poller_run($argv, $argc){ // clear old cache Cache::clear(); + // clear item cache files if they are older than one day + $cache = get_config('system','itemcache'); + if (($cache != '') and is_dir($cache)) { + if ($dh = opendir($cache)) { + while (($file = readdir($dh)) !== false) { + $fullpath = $cache."/".$file; + if ((filetype($fullpath) == "file") and filectime($fullpath) < (time() - 1800)) + unlink($fullpath); + } + closedir($dh); + } + } + $manual_id = 0; $generation = 0; $hub_update = false; diff --git a/include/text.php b/include/text.php index 5bf815105..08c5a5424 100644 --- a/include/text.php +++ b/include/text.php @@ -879,7 +879,7 @@ function prepare_body($item,$attach = false) { $cache = get_config('system','itemcache'); if (($cache != '')) { - $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".$attach."-".hash("crc32", $item['body']); + $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".hash("crc32", $item['body']); if (file_exists($cachefile)) $s = file_get_contents($cachefile); -- cgit v1.2.3 From 739309abd0cb103fe5a4d5081a7252b5698ab787 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 11 Mar 2012 19:41:29 +0100 Subject: Corrected some git problems --- addon/pages/README | 3 -- addon/pages/pages.php | 86 --------------------------------------------------- 2 files changed, 89 deletions(-) delete mode 100755 addon/pages/README delete mode 100755 addon/pages/pages.php diff --git a/addon/pages/README b/addon/pages/README deleted file mode 100755 index 6ec314b70..000000000 --- a/addon/pages/README +++ /dev/null @@ -1,3 +0,0 @@ -Pages - -Shows lists of community pages diff --git a/addon/pages/pages.php b/addon/pages/pages.php deleted file mode 100755 index 9e90cc24d..000000000 --- a/addon/pages/pages.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - */ - -function pages_install() { - register_hook('page_end', 'addon/pages/pages.php', 'pages_page_end'); -} - -function pages_uninstall() { - unregister_hook('page_end', 'addon/pages/pages.php', 'pages_page_end'); -} - -function pages_iscommunity($url, &$pagelist) { - // check every week for the status - should be enough - if ($pagelist[$url]["checked"]') != 0); - - $pagelist[$url] = array("community" => $iscommunity, "checked" => time()); - } else // Fetch from cache - $iscommunity = $pagelist[$url]["community"]; - return($iscommunity); -} - -function pages_getpages($uid) { - - // Fetch cached pagelist from configuration - $pagelist = get_pconfig($uid,'pages','pagelist'); - - if (sizeof($pagelist) == 0) - $pagelist = array(); - - $contacts = q("SELECT `id`, `url`, `Name` FROM `contact` - WHERE `network`= 'dfrn' AND `uid` = %d", - intval($uid)); - - $pages = array(); - - // Look if the profile is a community page - foreach($contacts as $contact) { - if (pages_iscommunity($contact["url"], $pagelist)) - $pages[] = array("url"=>$contact["url"], "Name"=>$contact["Name"], "id"=>$contact["id"]); - } - - // Write back cached pagelist - set_pconfig($uid,'pages','pagelist', $pagelist); - return($pages); -} - -function pages_page_end($a,&$b) { - // Only move on if if it's the "network" module and there is a logged on user - if (($a->module != "network") OR ($a->user['uid'] == 0)) - return; - - $pages = '
    -
    -

    '.t("Community").'

    -
    "; - if (sizeof($contacts) > 0) - $a->page['aside'] = $pages.$a->page['aside']; -} -?> -- cgit v1.2.3 From 9ca5de8c281fa0a7b2323f33765bca25b64bc29d Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 11 Mar 2012 19:45:28 +0100 Subject: Item cache now is one day. --- include/poller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/poller.php b/include/poller.php index 65fafda4c..3bc98e36f 100755 --- a/include/poller.php +++ b/include/poller.php @@ -75,7 +75,7 @@ function poller_run($argv, $argc){ if ($dh = opendir($cache)) { while (($file = readdir($dh)) !== false) { $fullpath = $cache."/".$file; - if ((filetype($fullpath) == "file") and filectime($fullpath) < (time() - 1800)) + if ((filetype($fullpath) == "file") and filectime($fullpath) < (time() - 86400)) unlink($fullpath); } closedir($dh); -- cgit v1.2.3 From ebdf4842184cc8d0576abe99b29650c6b6512167 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 11 Mar 2012 19:50:51 +0100 Subject: Added config options for the item cache and the ostatus priority --- htconfig.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htconfig.php b/htconfig.php index f52aed2b1..9d9c8a2c7 100755 --- a/htconfig.php +++ b/htconfig.php @@ -79,3 +79,9 @@ $a->config['system']['theme'] = 'duepuntozero'; // By default allow pseudonyms $a->config['system']['no_regfullname'] = true; + +// If set to true the priority settings of ostatus contacts are used +$a->config['system']['ostatus_use_priority'] = false; + +// If enabled all items are cached in the given directory +$a->config['system']['itemcache'] = ""; -- cgit v1.2.3 From 7235d5466a4f54cd80d1b661b142ec99230afbf2 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 11 Mar 2012 20:24:55 +0100 Subject: Removed changes --- view/theme/diabook/wall_item.tpl | 14 +++++--------- view/theme/diabook/wallwall_item.tpl | 16 ++++++---------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/view/theme/diabook/wall_item.tpl b/view/theme/diabook/wall_item.tpl index 6cbab0a71..321bbbe9e 100644 --- a/view/theme/diabook/wall_item.tpl +++ b/view/theme/diabook/wall_item.tpl @@ -13,7 +13,8 @@ $item.name - menu + menu @@ -21,7 +22,8 @@
    - $item.name + $item.name - {{ if $item.plink }}$item.ago{{ else }} $item.ago {{ endif }} {{ if $item.lock }} - $item.lock {{ endif }} @@ -46,10 +48,7 @@
    -<<<<<<< HEAD:view/theme/diabook/wall_item.tpl -======= ->>>>>>> upstream/master:view/theme/diabook/wall_item.tpl
    @@ -85,11 +84,7 @@ {{ endif }}
    -<<<<<<< HEAD:view/theme/diabook/wall_item.tpl -
    $item.location 
    -=======
    $item.location 
    ->>>>>>> upstream/master:view/theme/diabook/wall_item.tpl
    @@ -102,3 +97,4 @@
    $item.comment
    + diff --git a/view/theme/diabook/wallwall_item.tpl b/view/theme/diabook/wallwall_item.tpl index 4f0a2e25f..05ed4cc82 100644 --- a/view/theme/diabook/wallwall_item.tpl +++ b/view/theme/diabook/wallwall_item.tpl @@ -18,7 +18,8 @@ $item.name - menu + menu @@ -26,8 +27,10 @@
    - $item.name - $item.to $item.owner_name + $item.name + $item.to $item.owner_name $item.vwall -   {{ if $item.plink }}$item.ago{{ else }} $item.ago {{ endif }} {{ if $item.lock }} - $item.lock {{ endif }} @@ -52,10 +55,7 @@
    -<<<<<<< HEAD:view/theme/diabook/wallwall_item.tpl -======= ->>>>>>> upstream/master:view/theme/diabook/wallwall_item.tpl
    @@ -92,10 +92,6 @@ {{ endif }}
    $item.location 
    -<<<<<<< HEAD:view/theme/diabook/wallwall_item.tpl - -======= ->>>>>>> upstream/master:view/theme/diabook/wallwall_item.tpl
    -- cgit v1.2.3 From 905ba5ba1d5d8e2d0caa5c0208357672ee527b7d Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 11 Mar 2012 22:39:40 +0100 Subject: Missing field in database.sql --- database.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/database.sql b/database.sql index 35c257f02..2add8bd85 100755 --- a/database.sql +++ b/database.sql @@ -636,6 +636,7 @@ CREATE TABLE IF NOT EXISTS `mailacct` ( `mailbox` CHAR( 255 ) NOT NULL, `user` CHAR( 255 ) NOT NULL , `pass` TEXT NOT NULL , +`reply_to` CHAR( 255 ) NOT NULL , `action` INT NOT NULL , `movetofolder` CHAR(255) NOT NULL , `pubmail` TINYINT(1) NOT NULL DEFAULT '0', -- cgit v1.2.3 From 2ed6b3531eb1a9b778dfd87614fd824480a135e2 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 11 Mar 2012 23:29:59 +0100 Subject: Removing test exports --- include/delivery.php | 4 ++-- include/notifier.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/delivery.php b/include/delivery.php index c1ff07bd5..41869988d 100755 --- a/include/delivery.php +++ b/include/delivery.php @@ -435,8 +435,8 @@ function delivery_run($argv, $argc){ $headers .= 'Reply-to: ' . $reply_to . "\n"; // for testing purposes: Collect exported mails - $file = tempnam("/tmp/friendica/", "mail-out-"); - file_put_contents($file, json_encode($it)); + // $file = tempnam("/tmp/friendica/", "mail-out-"); + // file_put_contents($file, json_encode($it)); $headers .= 'Message-Id: <' . iri2msgid($it['uri']). '>' . "\n"; diff --git a/include/notifier.php b/include/notifier.php index 5b23406fc..c0a98c8eb 100755 --- a/include/notifier.php +++ b/include/notifier.php @@ -648,8 +648,8 @@ function notifier_run($argv, $argc){ $headers .= 'Reply-to: ' . $reply_to . "\n"; // for testing purposes: Collect exported mails - $file = tempnam("/tmp/friendica/", "mail-out2-"); - file_put_contents($file, json_encode($it)); + //$file = tempnam("/tmp/friendica/", "mail-out2-"); + //file_put_contents($file, json_encode($it)); $headers .= 'Message-Id: <' . iri2msgid($it['uri']) . '>' . "\n"; -- cgit v1.2.3 From 6e7a190e9197bcf4d00accc5d85ccca4a080bec8 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 12 Mar 2012 00:22:12 +0100 Subject: Mail: Subject are now with working "Re:" --- include/delivery.php | 28 +++++++--------------------- include/notifier.php | 29 +++++++---------------------- 2 files changed, 14 insertions(+), 43 deletions(-) diff --git a/include/delivery.php b/include/delivery.php index 41869988d..44a482ca2 100755 --- a/include/delivery.php +++ b/include/delivery.php @@ -446,30 +446,16 @@ function delivery_run($argv, $argc){ if($it['uri'] !== $it['parent-uri']) { $headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n"; - if(! strlen($it['title'])) { + if(!strlen($it['title'])) { $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' LIMIT 1", - dbesc($it['parent-uri']) - ); - if(count($r)) { - $subtitle = $r[0]['title']; - if($subtitle) { - if(strncasecmp($subtitle,'RE:',3)) - $subject = $subtitle; - else - $subject = 'Re: ' . $subtitle; - } - } + dbesc($it['parent-uri'])); + + if(count($r) AND ($r[0]['title'] != '')) + $subject = $r[0]['title']; } + if(strncasecmp($subject,'RE:',3)) + $subject = 'Re: '.$subject; } - /*$headers .= 'MIME-Version: 1.0' . "\n"; - //$headers .= 'Content-Type: text/html; charset=UTF-8' . "\n"; - $headers .= 'Content-Type: text/plain; charset=UTF-8' . "\n"; - $headers .= 'Content-Transfer-Encoding: 8bit' . "\n\n"; - $html = prepare_body($it); - //$message = '' . $html . ''; - $message = html2plain($html); - logger('notifier: email delivery to ' . $addr); - mail($addr, $subject, $message, $headers);*/ email_send($addr, $subject, $headers, $it); } break; diff --git a/include/notifier.php b/include/notifier.php index c0a98c8eb..07edc7046 100755 --- a/include/notifier.php +++ b/include/notifier.php @@ -655,31 +655,16 @@ function notifier_run($argv, $argc){ if($it['uri'] !== $it['parent-uri']) { $headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n"; - if(! strlen($it['title'])) { + if(!strlen($it['title'])) { $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' LIMIT 1", - dbesc($it['parent-uri']) - ); - if(count($r)) { - $subtitle = $r[0]['title']; - if($subtitle) { - if(strncasecmp($subtitle,'RE:',3)) - $subject = $subtitle; - else - $subject = 'Re: ' . $subtitle; - } - } + dbesc($it['parent-uri'])); + + if(count($r) AND ($r[0]['title'] != '')) + $subject = $r[0]['title']; } + if(strncasecmp($subject,'RE:',3)) + $subject = 'Re: '.$subject; } - - /*$headers .= 'MIME-Version: 1.0' . "\n"; - //$headers .= 'Content-Type: text/html; charset=UTF-8' . "\n"; - $headers .= 'Content-Type: text/plain; charset=UTF-8' . "\n"; - $headers .= 'Content-Transfer-Encoding: 8bit' . "\n\n"; - $html = prepare_body($it); - //$message = '' . $html . ''; - $message = html2plain($html); - logger('notifier: email delivery to ' . $addr); - mail($addr, $subject, $message, $headers);*/ email_send($addr, $subject, $headers, $it); } break; -- cgit v1.2.3 From bce3bfff38ad6f540dca39f6ed5b1d8cae19edb1 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Mon, 12 Mar 2012 13:59:00 +0100 Subject: get tags test improved --- mod/item.php | 79 ++++++++++++++++++++++++++++++++++--------------- tests/get_tags_test.php | 40 +++++++++++++++++++++++-- 2 files changed, 92 insertions(+), 27 deletions(-) diff --git a/mod/item.php b/mod/item.php index a9edf0da6..0ff7f6a7c 100755 --- a/mod/item.php +++ b/mod/item.php @@ -820,33 +820,54 @@ function item_content(&$a) { } } +/** + * This function removes the tag $tag from the text $body and replaces it with + * the appropiate link. + * + * @param unknown_type $body the text to replace the tag in + * @param unknown_type $inform a comma-seperated string containing everybody to inform + * @param unknown_type $str_tags string to add the tag to + * @param unknown_type $profile_uid + * @param unknown_type $tag the tag to replace + */ function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) { - $profile=null; - if(isset($profile)) - unset($profile); + //is it a hash tag? if(strpos($tag,'#') === 0) { - if(strpos($tag,'[url=')) - continue; + //if the tag is replaced... + if(strpos($tag,'[url=')) + //...do nothing + continue; + //base tag has the tags name only $basetag = str_replace('_',' ',substr($tag,1)); - $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); - - $newtag = '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]'; + //create text for link + $newtag = '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]'; + //replace tag by the link + $body = str_replace($tag, $newtag, $body); + + //is the link already in str_tags? if(! stristr($str_tags,$newtag)) { + //append or set str_tags if(strlen($str_tags)) $str_tags .= ','; $str_tags .= $newtag; } continue; - } + } + //is it a person tag? if(strpos($tag,'@') === 0) { + //is it already replaced? if(strpos($tag,'[url=')) continue; $stat = false; - $name = substr($tag,1); + //get the person's name + $name = substr($tag,1); + //is it a link or a full dfrn address? if((strpos($name,'@')) || (strpos($name,'http://'))) { $newname = $name; + //get the profile links $links = @lrdd($name); if(count($links)) { + //for all links, collect how is to inform and how's profile is to link foreach($links as $link) { if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') $profile = $link['@attributes']['href']; @@ -857,38 +878,44 @@ function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) { } } } - } - else { + } else { //if it is a name rather than an address $newname = $name; $alias = ''; - $tagcid = 0; + $tagcid = 0; + //is it some generated name? if(strrpos($newname,'+')) { + //get the id $tagcid = intval(substr($newname,strrpos($newname,'+') + 1)); + //remove the next word from tag's name if(strpos($name,' ')) $name = substr($name,0,strpos($name,' ')); - } - if($tagcid) { + } + if($tagcid) { //if there was an id + //select contact with that id from the logged in user's contact list $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($tagcid), intval($profile_uid) ); - } - elseif(strstr($name,'_') || strstr($name,' ')) { + } elseif(strstr($name,'_') || strstr($name,' ')) { //no id + //get the real name $newname = str_replace('_',' ',$name); + //select someone from this user's contacts by name $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1", dbesc($newname), intval($profile_uid) ); - } - else { + } else { + //select someone by attag or nick and the name passed in $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1", dbesc($name), dbesc($name), intval($profile_uid) ); - } + } + //$r is set, if someone could be selected if(count($r)) { - $profile = $r[0]['url']; + $profile = $r[0]['url']; + //set newname to nick, find alias if($r[0]['network'] === 'stat') { $newname = $r[0]['nick']; $stat = true; @@ -897,15 +924,19 @@ function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) { } else $newname = $r[0]['name']; + //add person's id to $inform if(strlen($inform)) $inform .= ','; $inform .= 'cid:' . $r[0]['id']; } - } - if($profile) { - $body = str_replace('@' . $name, '@' . '[url=' . $profile . ']' . $newname . '[/url]', $body); + } + //if there is an url for this persons profile + if(isset($profile)) { + //create profile link $profile = str_replace(',','%2c',$profile); $newtag = '@[url=' . $profile . ']' . $newname . '[/url]'; + $body = str_replace('@' . $name, $newtag, $body); + //append tag to str_tags if(! stristr($str_tags,$newtag)) { if(strlen($str_tags)) $str_tags .= ','; diff --git a/tests/get_tags_test.php b/tests/get_tags_test.php index a458f0fbc..ee2daced1 100644 --- a/tests/get_tags_test.php +++ b/tests/get_tags_test.php @@ -8,11 +8,45 @@ require_once 'include/text.php'; require_once 'mod/item.php'; function q($sql) { - return array(array('id'=>15, 'network'=>'stat', 'alias'=>'Mike', 'nick'=>'Mike', 'url'=>"http://justatest.de")); + + $result=array(array('id'=>15, + 'attag'=>'', 'network'=>'dfrn', + 'name'=>'Mike Lastname', 'alias'=>'Mike', + 'nick'=>'Mike', 'url'=>"http://justatest.de")); + + $args=func_get_args(); + $str=""; + foreach($args as $arg) { + $str.=", ".$arg; + } + + //last parameter is always (in this test) uid, so, it should be 11 + if($args[count($args)-1]!=11) { + throw new Exception("q from get_tags_test was used and uid was not 11. "); + } + + if(2==count($args)) { + //first call in handle_body, id only + if($result[0]['id']===$args[1]) { + return $result; + } + throw new Exception($str); + //second call in handle_body, name + if($result[0]['name']===$args[1]) { + return $result; + } + } + throw new Exception($str); + //third call in handle_body, nick or attag + if($result[0]['nick']===$args[2] || $result[0]['attag']===$args[1]) { + return $result; + } +// throw new Exception("Nothing fitted: ".$args[1].", ".$args[2]); } + function dbesc($str) { - echo $str; + return $str; } class GetTagsTest extends PHPUnit_Framework_TestCase { @@ -39,7 +73,7 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { handle_body($text, $inform, $str_tags, 11, $tags[0]); $this->assertEquals("@Mike", $tags[0]); - $this->assertEquals($text, "hi @[url=http://justatest.de]Mike[/url]"); + $this->assertEquals("hi @[url=http://justatest.de]Mike Lastname[/url]", $text); } /** -- cgit v1.2.3 From 943617574699efe41ef1bfb2527cada847497495 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Mon, 12 Mar 2012 21:09:16 +0100 Subject: add lightbox, fixex in css --- view/theme/diabook-blue/experimental | 0 view/theme/diabook-blue/icons/isstar.png | Bin 1277 -> 0 bytes view/theme/diabook-blue/icons/next.png | Bin 0 -> 300 bytes view/theme/diabook-blue/icons/notifications.png | Bin 727 -> 795 bytes view/theme/diabook-blue/icons/prev.png | Bin 0 -> 336 bytes view/theme/diabook-blue/icons/unglobe.png | Bin 798 -> 0 bytes .../lightbox/css/jquery.lightbox-0.5.css | 101 +++++ .../lightbox/images/lightbox-blank.gif | Bin 0 -> 43 bytes .../lightbox/images/lightbox-btn-close.gif | Bin 0 -> 700 bytes .../lightbox/images/lightbox-btn-next.gif | Bin 0 -> 812 bytes .../lightbox/images/lightbox-btn-prev.gif | Bin 0 -> 832 bytes .../lightbox/images/lightbox-ico-loading.gif | Bin 0 -> 3990 bytes view/theme/diabook-blue/lightbox/index.htm | 78 ++++ view/theme/diabook-blue/lightbox/js/jquery.js | 32 ++ .../lightbox/js/jquery.lightbox-0.5.js | 472 +++++++++++++++++++++ .../lightbox/js/jquery.lightbox-0.5.min.js | 42 ++ .../lightbox/js/jquery.lightbox-0.5.pack.js | 14 + view/theme/diabook-blue/lightbox/photos/image1.jpg | Bin 0 -> 19983 bytes view/theme/diabook-blue/lightbox/photos/image2.jpg | Bin 0 -> 45539 bytes view/theme/diabook-blue/lightbox/photos/image3.jpg | Bin 0 -> 39361 bytes view/theme/diabook-blue/lightbox/photos/image4.jpg | Bin 0 -> 18746 bytes view/theme/diabook-blue/lightbox/photos/image5.jpg | Bin 0 -> 30903 bytes .../diabook-blue/lightbox/photos/thumb_image1.jpg | Bin 0 -> 2092 bytes .../diabook-blue/lightbox/photos/thumb_image2.jpg | Bin 0 -> 2541 bytes .../diabook-blue/lightbox/photos/thumb_image3.jpg | Bin 0 -> 2237 bytes .../diabook-blue/lightbox/photos/thumb_image4.jpg | Bin 0 -> 1993 bytes .../diabook-blue/lightbox/photos/thumb_image5.jpg | Bin 0 -> 2045 bytes view/theme/diabook-blue/photo_view.tpl | 27 ++ view/theme/diabook-blue/style.css | 62 ++- view/theme/diabook-blue/theme.php | 24 +- view/theme/diabook/experimental | 0 view/theme/diabook/icons/isstar.png | Bin 1277 -> 0 bytes view/theme/diabook/icons/next.png | Bin 0 -> 300 bytes view/theme/diabook/icons/prev.png | Bin 0 -> 336 bytes view/theme/diabook/icons/unglobe.png | Bin 798 -> 0 bytes .../diabook/lightbox/css/jquery.lightbox-0.5.css | 101 +++++ .../diabook/lightbox/images/lightbox-blank.gif | Bin 0 -> 43 bytes .../diabook/lightbox/images/lightbox-btn-close.gif | Bin 0 -> 700 bytes .../diabook/lightbox/images/lightbox-btn-next.gif | Bin 0 -> 812 bytes .../diabook/lightbox/images/lightbox-btn-prev.gif | Bin 0 -> 832 bytes .../lightbox/images/lightbox-ico-loading.gif | Bin 0 -> 3990 bytes view/theme/diabook/lightbox/index.htm | 78 ++++ view/theme/diabook/lightbox/js/jquery.js | 32 ++ .../diabook/lightbox/js/jquery.lightbox-0.5.js | 472 +++++++++++++++++++++ .../diabook/lightbox/js/jquery.lightbox-0.5.min.js | 42 ++ .../lightbox/js/jquery.lightbox-0.5.pack.js | 14 + view/theme/diabook/lightbox/photos/image1.jpg | Bin 0 -> 19983 bytes view/theme/diabook/lightbox/photos/image2.jpg | Bin 0 -> 45539 bytes view/theme/diabook/lightbox/photos/image3.jpg | Bin 0 -> 39361 bytes view/theme/diabook/lightbox/photos/image4.jpg | Bin 0 -> 18746 bytes view/theme/diabook/lightbox/photos/image5.jpg | Bin 0 -> 30903 bytes .../theme/diabook/lightbox/photos/thumb_image1.jpg | Bin 0 -> 2092 bytes .../theme/diabook/lightbox/photos/thumb_image2.jpg | Bin 0 -> 2541 bytes .../theme/diabook/lightbox/photos/thumb_image3.jpg | Bin 0 -> 2237 bytes .../theme/diabook/lightbox/photos/thumb_image4.jpg | Bin 0 -> 1993 bytes .../theme/diabook/lightbox/photos/thumb_image5.jpg | Bin 0 -> 2045 bytes view/theme/diabook/photo_view.tpl | 27 ++ view/theme/diabook/style.css | 71 +++- view/theme/diabook/theme.php | 23 +- 59 files changed, 1667 insertions(+), 45 deletions(-) delete mode 100755 view/theme/diabook-blue/experimental delete mode 100644 view/theme/diabook-blue/icons/isstar.png create mode 100755 view/theme/diabook-blue/icons/next.png create mode 100755 view/theme/diabook-blue/icons/prev.png delete mode 100755 view/theme/diabook-blue/icons/unglobe.png create mode 100644 view/theme/diabook-blue/lightbox/css/jquery.lightbox-0.5.css create mode 100644 view/theme/diabook-blue/lightbox/images/lightbox-blank.gif create mode 100644 view/theme/diabook-blue/lightbox/images/lightbox-btn-close.gif create mode 100644 view/theme/diabook-blue/lightbox/images/lightbox-btn-next.gif create mode 100644 view/theme/diabook-blue/lightbox/images/lightbox-btn-prev.gif create mode 100644 view/theme/diabook-blue/lightbox/images/lightbox-ico-loading.gif create mode 100644 view/theme/diabook-blue/lightbox/index.htm create mode 100644 view/theme/diabook-blue/lightbox/js/jquery.js create mode 100644 view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.js create mode 100644 view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.min.js create mode 100644 view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.pack.js create mode 100644 view/theme/diabook-blue/lightbox/photos/image1.jpg create mode 100644 view/theme/diabook-blue/lightbox/photos/image2.jpg create mode 100644 view/theme/diabook-blue/lightbox/photos/image3.jpg create mode 100644 view/theme/diabook-blue/lightbox/photos/image4.jpg create mode 100644 view/theme/diabook-blue/lightbox/photos/image5.jpg create mode 100644 view/theme/diabook-blue/lightbox/photos/thumb_image1.jpg create mode 100644 view/theme/diabook-blue/lightbox/photos/thumb_image2.jpg create mode 100644 view/theme/diabook-blue/lightbox/photos/thumb_image3.jpg create mode 100644 view/theme/diabook-blue/lightbox/photos/thumb_image4.jpg create mode 100644 view/theme/diabook-blue/lightbox/photos/thumb_image5.jpg create mode 100755 view/theme/diabook-blue/photo_view.tpl delete mode 100755 view/theme/diabook/experimental delete mode 100644 view/theme/diabook/icons/isstar.png create mode 100755 view/theme/diabook/icons/next.png create mode 100755 view/theme/diabook/icons/prev.png delete mode 100755 view/theme/diabook/icons/unglobe.png create mode 100644 view/theme/diabook/lightbox/css/jquery.lightbox-0.5.css create mode 100644 view/theme/diabook/lightbox/images/lightbox-blank.gif create mode 100644 view/theme/diabook/lightbox/images/lightbox-btn-close.gif create mode 100644 view/theme/diabook/lightbox/images/lightbox-btn-next.gif create mode 100644 view/theme/diabook/lightbox/images/lightbox-btn-prev.gif create mode 100644 view/theme/diabook/lightbox/images/lightbox-ico-loading.gif create mode 100644 view/theme/diabook/lightbox/index.htm create mode 100644 view/theme/diabook/lightbox/js/jquery.js create mode 100644 view/theme/diabook/lightbox/js/jquery.lightbox-0.5.js create mode 100644 view/theme/diabook/lightbox/js/jquery.lightbox-0.5.min.js create mode 100644 view/theme/diabook/lightbox/js/jquery.lightbox-0.5.pack.js create mode 100644 view/theme/diabook/lightbox/photos/image1.jpg create mode 100644 view/theme/diabook/lightbox/photos/image2.jpg create mode 100644 view/theme/diabook/lightbox/photos/image3.jpg create mode 100644 view/theme/diabook/lightbox/photos/image4.jpg create mode 100644 view/theme/diabook/lightbox/photos/image5.jpg create mode 100644 view/theme/diabook/lightbox/photos/thumb_image1.jpg create mode 100644 view/theme/diabook/lightbox/photos/thumb_image2.jpg create mode 100644 view/theme/diabook/lightbox/photos/thumb_image3.jpg create mode 100644 view/theme/diabook/lightbox/photos/thumb_image4.jpg create mode 100644 view/theme/diabook/lightbox/photos/thumb_image5.jpg create mode 100755 view/theme/diabook/photo_view.tpl diff --git a/view/theme/diabook-blue/experimental b/view/theme/diabook-blue/experimental deleted file mode 100755 index e69de29bb..000000000 diff --git a/view/theme/diabook-blue/icons/isstar.png b/view/theme/diabook-blue/icons/isstar.png deleted file mode 100644 index c955b25b5..000000000 Binary files a/view/theme/diabook-blue/icons/isstar.png and /dev/null differ diff --git a/view/theme/diabook-blue/icons/next.png b/view/theme/diabook-blue/icons/next.png new file mode 100755 index 000000000..7b5e25b90 Binary files /dev/null and b/view/theme/diabook-blue/icons/next.png differ diff --git a/view/theme/diabook-blue/icons/notifications.png b/view/theme/diabook-blue/icons/notifications.png index c23673dbd..33ae95c6a 100755 Binary files a/view/theme/diabook-blue/icons/notifications.png and b/view/theme/diabook-blue/icons/notifications.png differ diff --git a/view/theme/diabook-blue/icons/prev.png b/view/theme/diabook-blue/icons/prev.png new file mode 100755 index 000000000..55c1464ba Binary files /dev/null and b/view/theme/diabook-blue/icons/prev.png differ diff --git a/view/theme/diabook-blue/icons/unglobe.png b/view/theme/diabook-blue/icons/unglobe.png deleted file mode 100755 index aa9b0e189..000000000 Binary files a/view/theme/diabook-blue/icons/unglobe.png and /dev/null differ diff --git a/view/theme/diabook-blue/lightbox/css/jquery.lightbox-0.5.css b/view/theme/diabook-blue/lightbox/css/jquery.lightbox-0.5.css new file mode 100644 index 000000000..c7c3d1cb1 --- /dev/null +++ b/view/theme/diabook-blue/lightbox/css/jquery.lightbox-0.5.css @@ -0,0 +1,101 @@ +/** + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.5.css + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.5 + * @date April 11, 2008 + * @category jQuery plugin + * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) + * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin + */ +#jquery-overlay { + position: absolute; + top: 0; + left: 0; + z-index: 90; + width: 100%; + height: 500px; +} +#jquery-lightbox { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 100; + text-align: center; + line-height: 0; +} +#jquery-lightbox a img { border: none; } +#lightbox-container-image-box { + position: relative; + background-color: #fff; + width: 250px; + height: 250px; + margin: 0 auto; +} +#lightbox-container-image { padding: 10px; } +#lightbox-loading { + position: absolute; + top: 40%; + left: 0%; + height: 25%; + width: 100%; + text-align: center; + line-height: 0; +} +#lightbox-nav { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: 10; +} +#lightbox-container-image-box > #lightbox-nav { left: 0; } +#lightbox-nav a { outline: none;} +#lightbox-nav-btnPrev, #lightbox-nav-btnNext { + width: 49%; + height: 100%; + zoom: 1; + display: block; +} +#lightbox-nav-btnPrev { + left: 0; + float: left; +} +#lightbox-nav-btnNext { + right: 0; + float: right; +} +#lightbox-container-image-data-box { + font: 10px Verdana, Helvetica, sans-serif; + background-color: #fff; + margin: 0 auto; + line-height: 1.4em; + overflow: auto; + width: 100%; + padding: 0 10px 0; +} +#lightbox-container-image-data { + padding: 0 10px; + color: #666; +} +#lightbox-container-image-data #lightbox-image-details { + width: 70%; + float: left; + text-align: left; +} +#lightbox-image-details-caption { font-weight: bold; } +#lightbox-image-details-currentNumber { + display: block; + clear: left; + padding-bottom: 1.0em; +} +#lightbox-secNav-btnClose { + width: 66px; + float: right; + padding-bottom: 0.7em; +} \ No newline at end of file diff --git a/view/theme/diabook-blue/lightbox/images/lightbox-blank.gif b/view/theme/diabook-blue/lightbox/images/lightbox-blank.gif new file mode 100644 index 000000000..1d11fa9ad Binary files /dev/null and b/view/theme/diabook-blue/lightbox/images/lightbox-blank.gif differ diff --git a/view/theme/diabook-blue/lightbox/images/lightbox-btn-close.gif b/view/theme/diabook-blue/lightbox/images/lightbox-btn-close.gif new file mode 100644 index 000000000..33bcf517a Binary files /dev/null and b/view/theme/diabook-blue/lightbox/images/lightbox-btn-close.gif differ diff --git a/view/theme/diabook-blue/lightbox/images/lightbox-btn-next.gif b/view/theme/diabook-blue/lightbox/images/lightbox-btn-next.gif new file mode 100644 index 000000000..a0d4fcf84 Binary files /dev/null and b/view/theme/diabook-blue/lightbox/images/lightbox-btn-next.gif differ diff --git a/view/theme/diabook-blue/lightbox/images/lightbox-btn-prev.gif b/view/theme/diabook-blue/lightbox/images/lightbox-btn-prev.gif new file mode 100644 index 000000000..040ee5992 Binary files /dev/null and b/view/theme/diabook-blue/lightbox/images/lightbox-btn-prev.gif differ diff --git a/view/theme/diabook-blue/lightbox/images/lightbox-ico-loading.gif b/view/theme/diabook-blue/lightbox/images/lightbox-ico-loading.gif new file mode 100644 index 000000000..4f1429c06 Binary files /dev/null and b/view/theme/diabook-blue/lightbox/images/lightbox-ico-loading.gif differ diff --git a/view/theme/diabook-blue/lightbox/index.htm b/view/theme/diabook-blue/lightbox/index.htm new file mode 100644 index 000000000..5daa72a0f --- /dev/null +++ b/view/theme/diabook-blue/lightbox/index.htm @@ -0,0 +1,78 @@ + + + + + jQuery lightBox plugin + + + + + + + + + + + + + + + + +

    Example

    +

    Click in the image and see the jQuery lightBox plugin in action.

    + + + + \ No newline at end of file diff --git a/view/theme/diabook-blue/lightbox/js/jquery.js b/view/theme/diabook-blue/lightbox/js/jquery.js new file mode 100644 index 000000000..3747929d8 --- /dev/null +++ b/view/theme/diabook-blue/lightbox/js/jquery.js @@ -0,0 +1,32 @@ +/* + * jQuery 1.2.3 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $ + * $Rev: 4663 $ + */ +(function(){if(window.jQuery)var _jQuery=window.jQuery;var jQuery=window.jQuery=function(selector,context){return new jQuery.prototype.init(selector,context);};if(window.$)var _$=window.$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;var isSimple=/^.[^:#\[\.]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}else if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem)if(elem.id!=match[3])return jQuery().find(selector);else{this[0]=elem;this.length=1;return this;}else +selector=[];}}else +return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.3",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;this.each(function(i){if(this==elem)ret=i;});return ret;},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],name)||undefined;else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else +selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return!selector?this:this.pushStack(jQuery.merge(this.get(),selector.constructor==String?jQuery(selector).get():selector.length!=undefined&&(!selector.nodeName||jQuery.nodeName(selector,"form"))?selector:[selector]));},is:function(selector){return selector?jQuery.multiFilter(selector,this).length>0:false;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=value.constructor==Array?value:[value];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else +this.value=value;});},html:function(value){return value==undefined?(this.length?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value==null){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data==undefined&&this.length)data=jQuery.data(this[0],key);return data==null&&parts[1]?this.data(parts[0]):data;}else +return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);}else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.prototype.init.prototype=jQuery.prototype;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==1){target=this;i=0;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret;function color(elem){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=elem.style.outline;elem.style.outline="0 solid black";elem.style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&elem.style&&elem.style[name])ret=elem.style[name];else if(document.defaultView&&document.defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var getComputedStyle=document.defaultView.getComputedStyle(elem,null);if(getComputedStyle&&!color(elem))ret=getComputedStyle.getPropertyValue(name);else{var swap=[],stack=[];for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(var i=0;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
    ","
    "]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else +ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,""+value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(typeof array!="array")for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval!=undefined)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(arguments.callee.elem,arguments);return val;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else +for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data||[]);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event)data.unshift(this.fix({type:type,target:elem}));data[0].type=type;if(exclusive)data[0].exclusive=true;if(jQuery.isFunction(jQuery.data(elem,"handle")))val=jQuery.data(elem,"handle").apply(elem,data);if(!fn&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var handlers=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in handlers){var handler=handlers[j];args[0].handler=handler;args[0].data=handler.data;if(!parts[1]&&!event.exclusive||handler.type==parts[1]){var ret=handler.apply(this,args);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);return undefined;},toggle:function(){var args=arguments;return this.click(function(event){this.lastToggle=0==this.lastToggle?1:0;event.preventDefault();return args[this.lastToggle].apply(this,arguments)||false;});},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else +jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
    ").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){var jsonp,jsre=/=\?(&|$)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get"){var ts=(new Date()).getTime();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if((!s.url.indexOf("http")||!s.url.indexOf("//"))&&s.dataType=="script"&&s.type.toLowerCase()=="get"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async,s.username,s.password);try{if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");xml.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else +jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xml;},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||r.status==1223||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else +for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else +s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else +e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(!elem)return undefined;type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),fixed=jQuery.css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&jQuery.css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||jQuery.css(offsetChild,"position")=="absolute"))||(mozilla&&jQuery.css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}return results;};})(); \ No newline at end of file diff --git a/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.js b/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.js new file mode 100644 index 000000000..eef6425e0 --- /dev/null +++ b/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.js @@ -0,0 +1,472 @@ +/** + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.5.js + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.5 + * @date April 11, 2008 + * @category jQuery plugin + * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) + * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin + */ + +// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias +(function($) { + /** + * $ is an alias to jQuery object + * + */ + $.fn.lightBox = function(settings) { + // Settings to configure the jQuery lightBox plugin how you like + settings = jQuery.extend({ + // Configuration related to overlay + overlayBgColor: '#000', // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color. + overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9 + // Configuration related to navigation + fixedNavigation: false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface. + // Configuration related to images + imageLoading: 'images/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon + imageBtnPrev: 'images/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image + imageBtnNext: 'images/lightbox-btn-next.gif', // (string) Path and the name of the next button image + imageBtnClose: 'images/lightbox-btn-close.gif', // (string) Path and the name of the close btn + imageBlank: 'images/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel) + // Configuration related to container image box + containerBorderSize: 10, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value + containerResizeSpeed: 400, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default. + // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts. + txtImage: 'Image', // (string) Specify text "Image" + txtOf: 'of', // (string) Specify text "of" + // Configuration related to keyboard navigation + keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to. + keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image + keyToNext: 'n', // (string) (n = next) Letter to show the next image. + // Don´t alter these variables in any way + imageArray: [], + activeImage: 0 + },settings); + // Caching the jQuery object with all elements matched + var jQueryMatchedObj = this; // This, in this context, refer to jQuery object + /** + * Initializing the plugin calling the start function + * + * @return boolean false + */ + function _initialize() { + _start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked + return false; // Avoid the browser following the link + } + /** + * Start the jQuery lightBox plugin + * + * @param object objClicked The object (link) whick the user have clicked + * @param object jQueryMatchedObj The jQuery object with all elements matched + */ + function _start(objClicked,jQueryMatchedObj) { + // Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay. + $('embed, object, select').css({ 'visibility' : 'hidden' }); + // Call the function to create the markup structure; style some elements; assign events in some elements. + _set_interface(); + // Unset total images in imageArray + settings.imageArray.length = 0; + // Unset image active information + settings.activeImage = 0; + // We have an image set? Or just an image? Let´s see it. + if ( jQueryMatchedObj.length == 1 ) { + settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title'))); + } else { + // Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references + for ( var i = 0; i < jQueryMatchedObj.length; i++ ) { + settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title'))); + } + } + while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) { + settings.activeImage++; + } + // Call the function that prepares image exibition + _set_image_to_view(); + } + /** + * Create the jQuery lightBox plugin interface + * + * The HTML markup will be like that: +
    +
    + + +
    + * + */ + function _set_interface() { + // Apply the HTML markup into body tag + $('body').append('
    '); + // Get page sizes + var arrPageSizes = ___getPageSize(); + // Style overlay and show it + $('#jquery-overlay').css({ + backgroundColor: settings.overlayBgColor, + opacity: settings.overlayOpacity, + width: arrPageSizes[0], + height: arrPageSizes[1] + }).fadeIn(); + // Get page scroll + var arrPageScroll = ___getPageScroll(); + // Calculate top and left offset for the jquery-lightbox div object and show it + $('#jquery-lightbox').css({ + top: arrPageScroll[1] + (arrPageSizes[3] / 10), + left: arrPageScroll[0] + }).show(); + // Assigning click events in elements to close overlay + $('#jquery-overlay,#jquery-lightbox').click(function() { + _finish(); + }); + // Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects + $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() { + _finish(); + return false; + }); + // If window was resized, calculate the new overlay dimensions + $(window).resize(function() { + // Get page sizes + var arrPageSizes = ___getPageSize(); + // Style overlay and show it + $('#jquery-overlay').css({ + width: arrPageSizes[0], + height: arrPageSizes[1] + }); + // Get page scroll + var arrPageScroll = ___getPageScroll(); + // Calculate top and left offset for the jquery-lightbox div object and show it + $('#jquery-lightbox').css({ + top: arrPageScroll[1] + (arrPageSizes[3] / 10), + left: arrPageScroll[0] + }); + }); + } + /** + * Prepares image exibition; doing a image´s preloader to calculate it´s size + * + */ + function _set_image_to_view() { // show the loading + // Show the loading + $('#lightbox-loading').show(); + if ( settings.fixedNavigation ) { + $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide(); + } else { + // Hide some elements + $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide(); + } + // Image preload process + var objImagePreloader = new Image(); + objImagePreloader.onload = function() { + $('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]); + // Perfomance an effect in the image container resizing it + _resize_container_image_box(objImagePreloader.width,objImagePreloader.height); + // clear onLoad, IE behaves irratically with animated gifs otherwise + objImagePreloader.onload=function(){}; + }; + objImagePreloader.src = settings.imageArray[settings.activeImage][0]; + }; + /** + * Perfomance an effect in the image container resizing it + * + * @param integer intImageWidth The image´s width that will be showed + * @param integer intImageHeight The image´s height that will be showed + */ + function _resize_container_image_box(intImageWidth,intImageHeight) { + // Get current width and height + var intCurrentWidth = $('#lightbox-container-image-box').width(); + var intCurrentHeight = $('#lightbox-container-image-box').height(); + // Get the width and height of the selected image plus the padding + var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value + var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value + // Diferences + var intDiffW = intCurrentWidth - intWidth; + var intDiffH = intCurrentHeight - intHeight; + // Perfomance the effect + $('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); }); + if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) { + if ( $.browser.msie ) { + ___pause(250); + } else { + ___pause(100); + } + } + $('#lightbox-container-image-data-box').css({ width: intImageWidth }); + $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) }); + }; + /** + * Show the prepared image + * + */ + function _show_image() { + $('#lightbox-loading').hide(); + $('#lightbox-image').fadeIn(function() { + _show_image_data(); + _set_navigation(); + }); + _preload_neighbor_images(); + }; + /** + * Show the image information + * + */ + function _show_image_data() { + $('#lightbox-container-image-data-box').slideDown('fast'); + $('#lightbox-image-details-caption').hide(); + if ( settings.imageArray[settings.activeImage][1] ) { + $('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show(); + } + // If we have a image set, display 'Image X of X' + if ( settings.imageArray.length > 1 ) { + $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show(); + } + } + /** + * Display the button navigations + * + */ + function _set_navigation() { + $('#lightbox-nav').show(); + + // Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just. + $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); + + // Show the prev button, if not the first image in set + if ( settings.activeImage != 0 ) { + if ( settings.fixedNavigation ) { + $('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' }) + .unbind() + .bind('click',function() { + settings.activeImage = settings.activeImage - 1; + _set_image_to_view(); + return false; + }); + } else { + // Show the images button for Next buttons + $('#lightbox-nav-btnPrev').unbind().hover(function() { + $(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' }); + },function() { + $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); + }).show().bind('click',function() { + settings.activeImage = settings.activeImage - 1; + _set_image_to_view(); + return false; + }); + } + } + + // Show the next button, if not the last image in set + if ( settings.activeImage != ( settings.imageArray.length -1 ) ) { + if ( settings.fixedNavigation ) { + $('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' }) + .unbind() + .bind('click',function() { + settings.activeImage = settings.activeImage + 1; + _set_image_to_view(); + return false; + }); + } else { + // Show the images button for Next buttons + $('#lightbox-nav-btnNext').unbind().hover(function() { + $(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' }); + },function() { + $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); + }).show().bind('click',function() { + settings.activeImage = settings.activeImage + 1; + _set_image_to_view(); + return false; + }); + } + } + // Enable keyboard navigation + _enable_keyboard_navigation(); + } + /** + * Enable a support to keyboard navigation + * + */ + function _enable_keyboard_navigation() { + $(document).keydown(function(objEvent) { + _keyboard_action(objEvent); + }); + } + /** + * Disable the support to keyboard navigation + * + */ + function _disable_keyboard_navigation() { + $(document).unbind(); + } + /** + * Perform the keyboard actions + * + */ + function _keyboard_action(objEvent) { + // To ie + if ( objEvent == null ) { + keycode = event.keyCode; + escapeKey = 27; + // To Mozilla + } else { + keycode = objEvent.keyCode; + escapeKey = objEvent.DOM_VK_ESCAPE; + } + // Get the key in lower case form + key = String.fromCharCode(keycode).toLowerCase(); + // Verify the keys to close the ligthBox + if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) { + _finish(); + } + // Verify the key to show the previous image + if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) { + // If we´re not showing the first image, call the previous + if ( settings.activeImage != 0 ) { + settings.activeImage = settings.activeImage - 1; + _set_image_to_view(); + _disable_keyboard_navigation(); + } + } + // Verify the key to show the next image + if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) { + // If we´re not showing the last image, call the next + if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) { + settings.activeImage = settings.activeImage + 1; + _set_image_to_view(); + _disable_keyboard_navigation(); + } + } + } + /** + * Preload prev and next images being showed + * + */ + function _preload_neighbor_images() { + if ( (settings.imageArray.length -1) > settings.activeImage ) { + objNext = new Image(); + objNext.src = settings.imageArray[settings.activeImage + 1][0]; + } + if ( settings.activeImage > 0 ) { + objPrev = new Image(); + objPrev.src = settings.imageArray[settings.activeImage -1][0]; + } + } + /** + * Remove jQuery lightBox plugin HTML markup + * + */ + function _finish() { + $('#jquery-lightbox').remove(); + $('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); }); + // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay. + $('embed, object, select').css({ 'visibility' : 'visible' }); + } + /** + / THIRD FUNCTION + * getPageSize() by quirksmode.com + * + * @return Array Return an array with page width, height and window width, height + */ + function ___getPageSize() { + var xScroll, yScroll; + if (window.innerHeight && window.scrollMaxY) { + xScroll = window.innerWidth + window.scrollMaxX; + yScroll = window.innerHeight + window.scrollMaxY; + } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac + xScroll = document.body.scrollWidth; + yScroll = document.body.scrollHeight; + } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari + xScroll = document.body.offsetWidth; + yScroll = document.body.offsetHeight; + } + var windowWidth, windowHeight; + if (self.innerHeight) { // all except Explorer + if(document.documentElement.clientWidth){ + windowWidth = document.documentElement.clientWidth; + } else { + windowWidth = self.innerWidth; + } + windowHeight = self.innerHeight; + } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode + windowWidth = document.documentElement.clientWidth; + windowHeight = document.documentElement.clientHeight; + } else if (document.body) { // other Explorers + windowWidth = document.body.clientWidth; + windowHeight = document.body.clientHeight; + } + // for small pages with total height less then height of the viewport + if(yScroll < windowHeight){ + pageHeight = windowHeight; + } else { + pageHeight = yScroll; + } + // for small pages with total width less then width of the viewport + if(xScroll < windowWidth){ + pageWidth = xScroll; + } else { + pageWidth = windowWidth; + } + arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); + return arrayPageSize; + }; + /** + / THIRD FUNCTION + * getPageScroll() by quirksmode.com + * + * @return Array Return an array with x,y page scroll values. + */ + function ___getPageScroll() { + var xScroll, yScroll; + if (self.pageYOffset) { + yScroll = self.pageYOffset; + xScroll = self.pageXOffset; + } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict + yScroll = document.documentElement.scrollTop; + xScroll = document.documentElement.scrollLeft; + } else if (document.body) {// all other Explorers + yScroll = document.body.scrollTop; + xScroll = document.body.scrollLeft; + } + arrayPageScroll = new Array(xScroll,yScroll); + return arrayPageScroll; + }; + /** + * Stop the code execution from a escified time in milisecond + * + */ + function ___pause(ms) { + var date = new Date(); + curDate = null; + do { var curDate = new Date(); } + while ( curDate - date < ms); + }; + // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once + return this.unbind('click').click(_initialize); + }; +})(jQuery); // Call and execute the function immediately passing the jQuery object \ No newline at end of file diff --git a/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.min.js b/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.min.js new file mode 100644 index 000000000..5f13b0bf6 --- /dev/null +++ b/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.min.js @@ -0,0 +1,42 @@ +/** + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.5.js + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.5 + * @date April 11, 2008 + * @category jQuery plugin + * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) + * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin + */ +(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'images/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',imageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;} +function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i
    ');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});} +function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();} +var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}} +$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();} +if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}} +function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}} +if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}} +_enable_keyboard_navigation();} +function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});} +function _disable_keyboard_navigation(){$(document).unbind();} +function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;} +key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();} +if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}} +if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}} +function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];} +if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}} +function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});} +function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;} +var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;} +windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;} +if(yScroll35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.2N.3g=6(4){4=23.2H({2B:\'#34\',2g:0.8,1d:F,1M:\'18/5-33-Y.16\',1v:\'18/5-1u-2Q.16\',1E:\'18/5-1u-2L.16\',1W:\'18/5-1u-2I.16\',19:\'18/5-2F.16\',1f:10,2A:3d,2s:\'1j\',2o:\'32\',2j:\'c\',2f:\'p\',2d:\'n\',h:[],9:0},4);f I=N;6 20(){1X(N,I);u F}6 1X(1e,I){$(\'1U, 1S, 1R\').l({\'1Q\':\'2E\'});1O();4.h.B=0;4.9=0;7(I.B==1){4.h.1J(v 1m(1e.17(\'J\'),1e.17(\'2v\')))}j{36(f i=0;i<1w g="5-b"><1w W="\'+4.1M+\'"><1i g="5-b-A-1t"><1i g="5-b-A-1g"><1w W="\'+4.1W+\'">\');f z=1D();$(\'#q-13\').l({2K:4.2B,2J:4.2g,S:z[0],P:z[1]}).1V();f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]}).E();$(\'#q-13,#q-5\').C(6(){1a()});$(\'#5-Y-29,#5-1s-22\').C(6(){1a();u F});$(G).2G(6(){f z=1D();$(\'#q-13\').l({S:z[0],P:z[1]});f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]})})}6 D(){$(\'#5-Y\').E();7(4.1d){$(\'#5-b,#5-s-b-T-w,#5-b-A-1g\').1b()}j{$(\'#5-b,#5-k,#5-k-V,#5-k-X,#5-s-b-T-w,#5-b-A-1g\').1b()}f Q=v 1j();Q.1P=6(){$(\'#5-b\').2D(\'W\',4.h[4.9][0]);1N(Q.S,Q.P);Q.1P=6(){}};Q.W=4.h[4.9][0]};6 1N(1o,1r){f 1L=$(\'#5-s-b-w\').S();f 1K=$(\'#5-s-b-w\').P();f 1n=(1o+(4.1f*2));f 1y=(1r+(4.1f*2));f 1I=1L-1n;f 2z=1K-1y;$(\'#5-s-b-w\').3f({S:1n,P:1y},4.2A,6(){2y()});7((1I==0)&&(2z==0)){7($.3e.3c){1H(3b)}j{1H(3a)}}$(\'#5-s-b-T-w\').l({S:1o});$(\'#5-k-V,#5-k-X\').l({P:1r+(4.1f*2)})};6 2y(){$(\'#5-Y\').1b();$(\'#5-b\').1V(6(){2u();2t()});2r()};6 2u(){$(\'#5-s-b-T-w\').38(\'35\');$(\'#5-b-A-1t\').1b();7(4.h[4.9][1]){$(\'#5-b-A-1t\').2p(4.h[4.9][1]).E()}7(4.h.B>1){$(\'#5-b-A-1g\').2p(4.2s+\' \'+(4.9+1)+\' \'+4.2o+\' \'+4.h.B).E()}}6 2t(){$(\'#5-k\').E();$(\'#5-k-V,#5-k-X\').l({\'K\':\'1C M(\'+4.19+\') L-O\'});7(4.9!=0){7(4.1d){$(\'#5-k-V\').l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9-1;D();u F})}j{$(\'#5-k-V\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9-1;D();u F})}}7(4.9!=(4.h.B-1)){7(4.1d){$(\'#5-k-X\').l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9+1;D();u F})}j{$(\'#5-k-X\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9+1;D();u F})}}2k()}6 2k(){$(d).30(6(12){2i(12)})}6 1G(){$(d).11()}6 2i(12){7(12==2h){U=2Z.2e;1x=27}j{U=12.2e;1x=12.2Y}14=2X.2W(U).2U();7((14==4.2j)||(14==\'x\')||(U==1x)){1a()}7((14==4.2f)||(U==37)){7(4.9!=0){4.9=4.9-1;D();1G()}}7((14==4.2d)||(U==39)){7(4.9!=(4.h.B-1)){4.9=4.9+1;D();1G()}}}6 2r(){7((4.h.B-1)>4.9){2c=v 1j();2c.W=4.h[4.9+1][0]}7(4.9>0){2b=v 1j();2b.W=4.h[4.9-1][0]}}6 1a(){$(\'#q-5\').2a();$(\'#q-13\').2T(6(){$(\'#q-13\').2a()});$(\'1U, 1S, 1R\').l({\'1Q\':\'2S\'})}6 1D(){f o,r;7(G.1h&&G.28){o=G.26+G.2R;r=G.1h+G.28}j 7(d.m.25>d.m.24){o=d.m.2P;r=d.m.25}j{o=d.m.2O;r=d.m.24}f y,H;7(Z.1h){7(d.t.1l){y=d.t.1l}j{y=Z.26}H=Z.1h}j 7(d.t&&d.t.1A){y=d.t.1l;H=d.t.1A}j 7(d.m){y=d.m.1l;H=d.m.1A}7(r
    +

    $album.1

    + + + +
    + {{ if $prevlink }}{{ endif }} + + {{ if $nextlink }}{{ endif }} +
    + +
    +
    $desc
    +{{ if $tags }} +
    $tags.0
    +
    $tags.1
    +{{ endif }} +{{ if $tags.2 }}{{ endif }} + +{{ if $edit }}$edit{{ endif }} \ No newline at end of file diff --git a/view/theme/diabook-blue/style.css b/view/theme/diabook-blue/style.css index 51b173f2a..81c056bf3 100644 --- a/view/theme/diabook-blue/style.css +++ b/view/theme/diabook-blue/style.css @@ -247,7 +247,7 @@ background-image: url("../../../images/icons/10/edit.png"); } .icon.s10.star { - background-image: url("../../../images/icons/10/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s10.menu { background-image: url("../../../images/icons/10/menu.png"); @@ -285,7 +285,7 @@ background-image: url("../../../images/icons/16/edit.png"); }*/ .icon.s16.star { - background-image: url("../../../images/icons/16/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s16.menu { background-image: url("../../../images/icons/16/menu.png"); @@ -323,7 +323,7 @@ background-image: url("../../../images/icons/22/edit.png"); } .icon.s22.star { - background-image: url("../../../images/icons/22/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s22.menu { background-image: url("../../../images/icons/22/menu.png"); @@ -361,7 +361,7 @@ background-image: url("../../../images/icons/48/edit.png"); } .icon.s48.star { - background-image: url("../../../images/icons/48/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s48.menu { background-image: url("../../../images/icons/48/menu.png"); @@ -438,7 +438,7 @@ a:hover { clear: both; } .fakelink { - color: #3465A4; + color: #1872A2; /* color: #3e3e8c; */ text-decoration: none; cursor: pointer; @@ -647,7 +647,7 @@ nav .nav-menu-icon { position: relative; height: 22px; padding: 5px; - margin: 0px 7px; + margin: 0px 5px; -moz-border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; @@ -657,7 +657,7 @@ nav .nav-menu-icon:hover { position: relative; height: 22px; padding: 5px; - margin: 0px 7px; + margin: 0px 5px; -moz-border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; @@ -716,21 +716,17 @@ nav #nav-user-linkmenu nav #nav-user-linkmenu{ margin-right: 0px; } -nav #nav-home-link{ +nav #nav-home-link, #nav-directory-link, #nav-apps-link{ margin-left: 0px; + margin-right: 0px; font-weight: bold; + margin: 3px 5px; } nav #nav-directory-link{ - margin-left: 0px; - margin-right: 0px; - font-weight: bold; - margin: 3px 15px; + margin-right: 0px; } -nav #nav-apps-link{ - margin-left: 0px; - margin-right: 0px; - font-weight: bold; - margin: 3px 15px; +nav #nav-home-link{ + margin-left: 0px; } nav #nav-help-link .menu-popup, nav #nav-search-link .menu-popup, @@ -1048,6 +1044,12 @@ section { width: 800px; padding: 0px 0px 0px 12px; } +body .pageheader{ + text-align: center; + margin-top: 25px; + font-size: 0px; + } + #id_username { width: 173px; } @@ -1306,14 +1308,14 @@ section { } .tag { /*background: url("../../../images/tag_b.png") repeat-x center left;*/ - color: #3465A4; + color: #999; padding-left: 3px; font-size: 12px; } .tag a { padding-right: 5px; /*background: url("../../../images/tag.png") no-repeat center right;*/ - color: #3465A4; + color: #999; } .wwto { position: absolute !important; @@ -1988,10 +1990,24 @@ box-shadow: 1px 1px 5px 0; } #prvmail-submit { - float: left; + float: right; margin-top: 10px; - margin-right: 30px; } + +#prvmail-subject +{ +background: none repeat scroll 0 0 #FFFFFF; +border: 1px solid #CCCCCC; +border-radius: 5px 5px 5px 5px; +font-weight: bold; +height: 20px; +margin: 0 0 5px; +vertical-align: middle; +} +#prvmail-form{ + width: 597px; + } + #prvmail-upload-wrapper, #prvmail-link-wrapper, #prvmail-rotator-wrapper { @@ -2179,7 +2195,9 @@ a.mail-list-link { padding: 10px; float: left; } - +.lightbox{ + float: left; + } #photo-photo { float: left; } diff --git a/view/theme/diabook-blue/theme.php b/view/theme/diabook-blue/theme.php index 0a20c9fbc..1617dd7f0 100755 --- a/view/theme/diabook-blue/theme.php +++ b/view/theme/diabook-blue/theme.php @@ -12,7 +12,14 @@ $a->theme_info = array( ); $a->page['htmlhead'] .= <<< EOT + + + + + + + //appsmenu + $('html').click(function() { + $('#nav-apps-link').removeClass('selected'); + document.getElementById( "nav-apps-menu" ).style.display = "none"; + }); + + $('#nav-apps-link').click(function(event){ + event.stopPropagation(); + }); + + $(function() { + $('a.lightbox').lightBox(); // Select all links with lightbox class +}); + + + EOT; diff --git a/view/theme/diabook/experimental b/view/theme/diabook/experimental deleted file mode 100755 index e69de29bb..000000000 diff --git a/view/theme/diabook/icons/isstar.png b/view/theme/diabook/icons/isstar.png deleted file mode 100644 index c955b25b5..000000000 Binary files a/view/theme/diabook/icons/isstar.png and /dev/null differ diff --git a/view/theme/diabook/icons/next.png b/view/theme/diabook/icons/next.png new file mode 100755 index 000000000..7b5e25b90 Binary files /dev/null and b/view/theme/diabook/icons/next.png differ diff --git a/view/theme/diabook/icons/prev.png b/view/theme/diabook/icons/prev.png new file mode 100755 index 000000000..55c1464ba Binary files /dev/null and b/view/theme/diabook/icons/prev.png differ diff --git a/view/theme/diabook/icons/unglobe.png b/view/theme/diabook/icons/unglobe.png deleted file mode 100755 index aa9b0e189..000000000 Binary files a/view/theme/diabook/icons/unglobe.png and /dev/null differ diff --git a/view/theme/diabook/lightbox/css/jquery.lightbox-0.5.css b/view/theme/diabook/lightbox/css/jquery.lightbox-0.5.css new file mode 100644 index 000000000..c7c3d1cb1 --- /dev/null +++ b/view/theme/diabook/lightbox/css/jquery.lightbox-0.5.css @@ -0,0 +1,101 @@ +/** + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.5.css + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.5 + * @date April 11, 2008 + * @category jQuery plugin + * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) + * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin + */ +#jquery-overlay { + position: absolute; + top: 0; + left: 0; + z-index: 90; + width: 100%; + height: 500px; +} +#jquery-lightbox { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 100; + text-align: center; + line-height: 0; +} +#jquery-lightbox a img { border: none; } +#lightbox-container-image-box { + position: relative; + background-color: #fff; + width: 250px; + height: 250px; + margin: 0 auto; +} +#lightbox-container-image { padding: 10px; } +#lightbox-loading { + position: absolute; + top: 40%; + left: 0%; + height: 25%; + width: 100%; + text-align: center; + line-height: 0; +} +#lightbox-nav { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: 10; +} +#lightbox-container-image-box > #lightbox-nav { left: 0; } +#lightbox-nav a { outline: none;} +#lightbox-nav-btnPrev, #lightbox-nav-btnNext { + width: 49%; + height: 100%; + zoom: 1; + display: block; +} +#lightbox-nav-btnPrev { + left: 0; + float: left; +} +#lightbox-nav-btnNext { + right: 0; + float: right; +} +#lightbox-container-image-data-box { + font: 10px Verdana, Helvetica, sans-serif; + background-color: #fff; + margin: 0 auto; + line-height: 1.4em; + overflow: auto; + width: 100%; + padding: 0 10px 0; +} +#lightbox-container-image-data { + padding: 0 10px; + color: #666; +} +#lightbox-container-image-data #lightbox-image-details { + width: 70%; + float: left; + text-align: left; +} +#lightbox-image-details-caption { font-weight: bold; } +#lightbox-image-details-currentNumber { + display: block; + clear: left; + padding-bottom: 1.0em; +} +#lightbox-secNav-btnClose { + width: 66px; + float: right; + padding-bottom: 0.7em; +} \ No newline at end of file diff --git a/view/theme/diabook/lightbox/images/lightbox-blank.gif b/view/theme/diabook/lightbox/images/lightbox-blank.gif new file mode 100644 index 000000000..1d11fa9ad Binary files /dev/null and b/view/theme/diabook/lightbox/images/lightbox-blank.gif differ diff --git a/view/theme/diabook/lightbox/images/lightbox-btn-close.gif b/view/theme/diabook/lightbox/images/lightbox-btn-close.gif new file mode 100644 index 000000000..33bcf517a Binary files /dev/null and b/view/theme/diabook/lightbox/images/lightbox-btn-close.gif differ diff --git a/view/theme/diabook/lightbox/images/lightbox-btn-next.gif b/view/theme/diabook/lightbox/images/lightbox-btn-next.gif new file mode 100644 index 000000000..a0d4fcf84 Binary files /dev/null and b/view/theme/diabook/lightbox/images/lightbox-btn-next.gif differ diff --git a/view/theme/diabook/lightbox/images/lightbox-btn-prev.gif b/view/theme/diabook/lightbox/images/lightbox-btn-prev.gif new file mode 100644 index 000000000..040ee5992 Binary files /dev/null and b/view/theme/diabook/lightbox/images/lightbox-btn-prev.gif differ diff --git a/view/theme/diabook/lightbox/images/lightbox-ico-loading.gif b/view/theme/diabook/lightbox/images/lightbox-ico-loading.gif new file mode 100644 index 000000000..4f1429c06 Binary files /dev/null and b/view/theme/diabook/lightbox/images/lightbox-ico-loading.gif differ diff --git a/view/theme/diabook/lightbox/index.htm b/view/theme/diabook/lightbox/index.htm new file mode 100644 index 000000000..5daa72a0f --- /dev/null +++ b/view/theme/diabook/lightbox/index.htm @@ -0,0 +1,78 @@ + + + + + jQuery lightBox plugin + + + + + + + + + + + + + + + + +

    Example

    +

    Click in the image and see the jQuery lightBox plugin in action.

    + + + + \ No newline at end of file diff --git a/view/theme/diabook/lightbox/js/jquery.js b/view/theme/diabook/lightbox/js/jquery.js new file mode 100644 index 000000000..3747929d8 --- /dev/null +++ b/view/theme/diabook/lightbox/js/jquery.js @@ -0,0 +1,32 @@ +/* + * jQuery 1.2.3 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $ + * $Rev: 4663 $ + */ +(function(){if(window.jQuery)var _jQuery=window.jQuery;var jQuery=window.jQuery=function(selector,context){return new jQuery.prototype.init(selector,context);};if(window.$)var _$=window.$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;var isSimple=/^.[^:#\[\.]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}else if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem)if(elem.id!=match[3])return jQuery().find(selector);else{this[0]=elem;this.length=1;return this;}else +selector=[];}}else +return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.3",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;this.each(function(i){if(this==elem)ret=i;});return ret;},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],name)||undefined;else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else +selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return!selector?this:this.pushStack(jQuery.merge(this.get(),selector.constructor==String?jQuery(selector).get():selector.length!=undefined&&(!selector.nodeName||jQuery.nodeName(selector,"form"))?selector:[selector]));},is:function(selector){return selector?jQuery.multiFilter(selector,this).length>0:false;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=value.constructor==Array?value:[value];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else +this.value=value;});},html:function(value){return value==undefined?(this.length?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value==null){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data==undefined&&this.length)data=jQuery.data(this[0],key);return data==null&&parts[1]?this.data(parts[0]):data;}else +return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);}else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.prototype.init.prototype=jQuery.prototype;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==1){target=this;i=0;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret;function color(elem){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=elem.style.outline;elem.style.outline="0 solid black";elem.style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&elem.style&&elem.style[name])ret=elem.style[name];else if(document.defaultView&&document.defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var getComputedStyle=document.defaultView.getComputedStyle(elem,null);if(getComputedStyle&&!color(elem))ret=getComputedStyle.getPropertyValue(name);else{var swap=[],stack=[];for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(var i=0;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
    ","
    "]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else +ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,""+value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(typeof array!="array")for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval!=undefined)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(arguments.callee.elem,arguments);return val;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else +for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data||[]);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event)data.unshift(this.fix({type:type,target:elem}));data[0].type=type;if(exclusive)data[0].exclusive=true;if(jQuery.isFunction(jQuery.data(elem,"handle")))val=jQuery.data(elem,"handle").apply(elem,data);if(!fn&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var handlers=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in handlers){var handler=handlers[j];args[0].handler=handler;args[0].data=handler.data;if(!parts[1]&&!event.exclusive||handler.type==parts[1]){var ret=handler.apply(this,args);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);return undefined;},toggle:function(){var args=arguments;return this.click(function(event){this.lastToggle=0==this.lastToggle?1:0;event.preventDefault();return args[this.lastToggle].apply(this,arguments)||false;});},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else +jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
    ").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){var jsonp,jsre=/=\?(&|$)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get"){var ts=(new Date()).getTime();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if((!s.url.indexOf("http")||!s.url.indexOf("//"))&&s.dataType=="script"&&s.type.toLowerCase()=="get"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async,s.username,s.password);try{if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");xml.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else +jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xml;},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||r.status==1223||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else +for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else +s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else +e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(!elem)return undefined;type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),fixed=jQuery.css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&jQuery.css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||jQuery.css(offsetChild,"position")=="absolute"))||(mozilla&&jQuery.css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}return results;};})(); \ No newline at end of file diff --git a/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.js b/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.js new file mode 100644 index 000000000..eef6425e0 --- /dev/null +++ b/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.js @@ -0,0 +1,472 @@ +/** + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.5.js + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.5 + * @date April 11, 2008 + * @category jQuery plugin + * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) + * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin + */ + +// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias +(function($) { + /** + * $ is an alias to jQuery object + * + */ + $.fn.lightBox = function(settings) { + // Settings to configure the jQuery lightBox plugin how you like + settings = jQuery.extend({ + // Configuration related to overlay + overlayBgColor: '#000', // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color. + overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9 + // Configuration related to navigation + fixedNavigation: false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface. + // Configuration related to images + imageLoading: 'images/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon + imageBtnPrev: 'images/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image + imageBtnNext: 'images/lightbox-btn-next.gif', // (string) Path and the name of the next button image + imageBtnClose: 'images/lightbox-btn-close.gif', // (string) Path and the name of the close btn + imageBlank: 'images/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel) + // Configuration related to container image box + containerBorderSize: 10, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value + containerResizeSpeed: 400, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default. + // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts. + txtImage: 'Image', // (string) Specify text "Image" + txtOf: 'of', // (string) Specify text "of" + // Configuration related to keyboard navigation + keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to. + keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image + keyToNext: 'n', // (string) (n = next) Letter to show the next image. + // Don´t alter these variables in any way + imageArray: [], + activeImage: 0 + },settings); + // Caching the jQuery object with all elements matched + var jQueryMatchedObj = this; // This, in this context, refer to jQuery object + /** + * Initializing the plugin calling the start function + * + * @return boolean false + */ + function _initialize() { + _start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked + return false; // Avoid the browser following the link + } + /** + * Start the jQuery lightBox plugin + * + * @param object objClicked The object (link) whick the user have clicked + * @param object jQueryMatchedObj The jQuery object with all elements matched + */ + function _start(objClicked,jQueryMatchedObj) { + // Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay. + $('embed, object, select').css({ 'visibility' : 'hidden' }); + // Call the function to create the markup structure; style some elements; assign events in some elements. + _set_interface(); + // Unset total images in imageArray + settings.imageArray.length = 0; + // Unset image active information + settings.activeImage = 0; + // We have an image set? Or just an image? Let´s see it. + if ( jQueryMatchedObj.length == 1 ) { + settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title'))); + } else { + // Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references + for ( var i = 0; i < jQueryMatchedObj.length; i++ ) { + settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title'))); + } + } + while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) { + settings.activeImage++; + } + // Call the function that prepares image exibition + _set_image_to_view(); + } + /** + * Create the jQuery lightBox plugin interface + * + * The HTML markup will be like that: +
    +
    + + +
    + * + */ + function _set_interface() { + // Apply the HTML markup into body tag + $('body').append('
    '); + // Get page sizes + var arrPageSizes = ___getPageSize(); + // Style overlay and show it + $('#jquery-overlay').css({ + backgroundColor: settings.overlayBgColor, + opacity: settings.overlayOpacity, + width: arrPageSizes[0], + height: arrPageSizes[1] + }).fadeIn(); + // Get page scroll + var arrPageScroll = ___getPageScroll(); + // Calculate top and left offset for the jquery-lightbox div object and show it + $('#jquery-lightbox').css({ + top: arrPageScroll[1] + (arrPageSizes[3] / 10), + left: arrPageScroll[0] + }).show(); + // Assigning click events in elements to close overlay + $('#jquery-overlay,#jquery-lightbox').click(function() { + _finish(); + }); + // Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects + $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() { + _finish(); + return false; + }); + // If window was resized, calculate the new overlay dimensions + $(window).resize(function() { + // Get page sizes + var arrPageSizes = ___getPageSize(); + // Style overlay and show it + $('#jquery-overlay').css({ + width: arrPageSizes[0], + height: arrPageSizes[1] + }); + // Get page scroll + var arrPageScroll = ___getPageScroll(); + // Calculate top and left offset for the jquery-lightbox div object and show it + $('#jquery-lightbox').css({ + top: arrPageScroll[1] + (arrPageSizes[3] / 10), + left: arrPageScroll[0] + }); + }); + } + /** + * Prepares image exibition; doing a image´s preloader to calculate it´s size + * + */ + function _set_image_to_view() { // show the loading + // Show the loading + $('#lightbox-loading').show(); + if ( settings.fixedNavigation ) { + $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide(); + } else { + // Hide some elements + $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide(); + } + // Image preload process + var objImagePreloader = new Image(); + objImagePreloader.onload = function() { + $('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]); + // Perfomance an effect in the image container resizing it + _resize_container_image_box(objImagePreloader.width,objImagePreloader.height); + // clear onLoad, IE behaves irratically with animated gifs otherwise + objImagePreloader.onload=function(){}; + }; + objImagePreloader.src = settings.imageArray[settings.activeImage][0]; + }; + /** + * Perfomance an effect in the image container resizing it + * + * @param integer intImageWidth The image´s width that will be showed + * @param integer intImageHeight The image´s height that will be showed + */ + function _resize_container_image_box(intImageWidth,intImageHeight) { + // Get current width and height + var intCurrentWidth = $('#lightbox-container-image-box').width(); + var intCurrentHeight = $('#lightbox-container-image-box').height(); + // Get the width and height of the selected image plus the padding + var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value + var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value + // Diferences + var intDiffW = intCurrentWidth - intWidth; + var intDiffH = intCurrentHeight - intHeight; + // Perfomance the effect + $('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); }); + if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) { + if ( $.browser.msie ) { + ___pause(250); + } else { + ___pause(100); + } + } + $('#lightbox-container-image-data-box').css({ width: intImageWidth }); + $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) }); + }; + /** + * Show the prepared image + * + */ + function _show_image() { + $('#lightbox-loading').hide(); + $('#lightbox-image').fadeIn(function() { + _show_image_data(); + _set_navigation(); + }); + _preload_neighbor_images(); + }; + /** + * Show the image information + * + */ + function _show_image_data() { + $('#lightbox-container-image-data-box').slideDown('fast'); + $('#lightbox-image-details-caption').hide(); + if ( settings.imageArray[settings.activeImage][1] ) { + $('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show(); + } + // If we have a image set, display 'Image X of X' + if ( settings.imageArray.length > 1 ) { + $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show(); + } + } + /** + * Display the button navigations + * + */ + function _set_navigation() { + $('#lightbox-nav').show(); + + // Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just. + $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); + + // Show the prev button, if not the first image in set + if ( settings.activeImage != 0 ) { + if ( settings.fixedNavigation ) { + $('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' }) + .unbind() + .bind('click',function() { + settings.activeImage = settings.activeImage - 1; + _set_image_to_view(); + return false; + }); + } else { + // Show the images button for Next buttons + $('#lightbox-nav-btnPrev').unbind().hover(function() { + $(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' }); + },function() { + $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); + }).show().bind('click',function() { + settings.activeImage = settings.activeImage - 1; + _set_image_to_view(); + return false; + }); + } + } + + // Show the next button, if not the last image in set + if ( settings.activeImage != ( settings.imageArray.length -1 ) ) { + if ( settings.fixedNavigation ) { + $('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' }) + .unbind() + .bind('click',function() { + settings.activeImage = settings.activeImage + 1; + _set_image_to_view(); + return false; + }); + } else { + // Show the images button for Next buttons + $('#lightbox-nav-btnNext').unbind().hover(function() { + $(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' }); + },function() { + $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); + }).show().bind('click',function() { + settings.activeImage = settings.activeImage + 1; + _set_image_to_view(); + return false; + }); + } + } + // Enable keyboard navigation + _enable_keyboard_navigation(); + } + /** + * Enable a support to keyboard navigation + * + */ + function _enable_keyboard_navigation() { + $(document).keydown(function(objEvent) { + _keyboard_action(objEvent); + }); + } + /** + * Disable the support to keyboard navigation + * + */ + function _disable_keyboard_navigation() { + $(document).unbind(); + } + /** + * Perform the keyboard actions + * + */ + function _keyboard_action(objEvent) { + // To ie + if ( objEvent == null ) { + keycode = event.keyCode; + escapeKey = 27; + // To Mozilla + } else { + keycode = objEvent.keyCode; + escapeKey = objEvent.DOM_VK_ESCAPE; + } + // Get the key in lower case form + key = String.fromCharCode(keycode).toLowerCase(); + // Verify the keys to close the ligthBox + if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) { + _finish(); + } + // Verify the key to show the previous image + if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) { + // If we´re not showing the first image, call the previous + if ( settings.activeImage != 0 ) { + settings.activeImage = settings.activeImage - 1; + _set_image_to_view(); + _disable_keyboard_navigation(); + } + } + // Verify the key to show the next image + if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) { + // If we´re not showing the last image, call the next + if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) { + settings.activeImage = settings.activeImage + 1; + _set_image_to_view(); + _disable_keyboard_navigation(); + } + } + } + /** + * Preload prev and next images being showed + * + */ + function _preload_neighbor_images() { + if ( (settings.imageArray.length -1) > settings.activeImage ) { + objNext = new Image(); + objNext.src = settings.imageArray[settings.activeImage + 1][0]; + } + if ( settings.activeImage > 0 ) { + objPrev = new Image(); + objPrev.src = settings.imageArray[settings.activeImage -1][0]; + } + } + /** + * Remove jQuery lightBox plugin HTML markup + * + */ + function _finish() { + $('#jquery-lightbox').remove(); + $('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); }); + // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay. + $('embed, object, select').css({ 'visibility' : 'visible' }); + } + /** + / THIRD FUNCTION + * getPageSize() by quirksmode.com + * + * @return Array Return an array with page width, height and window width, height + */ + function ___getPageSize() { + var xScroll, yScroll; + if (window.innerHeight && window.scrollMaxY) { + xScroll = window.innerWidth + window.scrollMaxX; + yScroll = window.innerHeight + window.scrollMaxY; + } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac + xScroll = document.body.scrollWidth; + yScroll = document.body.scrollHeight; + } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari + xScroll = document.body.offsetWidth; + yScroll = document.body.offsetHeight; + } + var windowWidth, windowHeight; + if (self.innerHeight) { // all except Explorer + if(document.documentElement.clientWidth){ + windowWidth = document.documentElement.clientWidth; + } else { + windowWidth = self.innerWidth; + } + windowHeight = self.innerHeight; + } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode + windowWidth = document.documentElement.clientWidth; + windowHeight = document.documentElement.clientHeight; + } else if (document.body) { // other Explorers + windowWidth = document.body.clientWidth; + windowHeight = document.body.clientHeight; + } + // for small pages with total height less then height of the viewport + if(yScroll < windowHeight){ + pageHeight = windowHeight; + } else { + pageHeight = yScroll; + } + // for small pages with total width less then width of the viewport + if(xScroll < windowWidth){ + pageWidth = xScroll; + } else { + pageWidth = windowWidth; + } + arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); + return arrayPageSize; + }; + /** + / THIRD FUNCTION + * getPageScroll() by quirksmode.com + * + * @return Array Return an array with x,y page scroll values. + */ + function ___getPageScroll() { + var xScroll, yScroll; + if (self.pageYOffset) { + yScroll = self.pageYOffset; + xScroll = self.pageXOffset; + } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict + yScroll = document.documentElement.scrollTop; + xScroll = document.documentElement.scrollLeft; + } else if (document.body) {// all other Explorers + yScroll = document.body.scrollTop; + xScroll = document.body.scrollLeft; + } + arrayPageScroll = new Array(xScroll,yScroll); + return arrayPageScroll; + }; + /** + * Stop the code execution from a escified time in milisecond + * + */ + function ___pause(ms) { + var date = new Date(); + curDate = null; + do { var curDate = new Date(); } + while ( curDate - date < ms); + }; + // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once + return this.unbind('click').click(_initialize); + }; +})(jQuery); // Call and execute the function immediately passing the jQuery object \ No newline at end of file diff --git a/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.min.js b/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.min.js new file mode 100644 index 000000000..5f13b0bf6 --- /dev/null +++ b/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.min.js @@ -0,0 +1,42 @@ +/** + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.5.js + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.5 + * @date April 11, 2008 + * @category jQuery plugin + * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) + * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin + */ +(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'images/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',imageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;} +function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i
    ');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});} +function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();} +var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}} +$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();} +if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}} +function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}} +if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}} +_enable_keyboard_navigation();} +function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});} +function _disable_keyboard_navigation(){$(document).unbind();} +function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;} +key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();} +if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}} +if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}} +function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];} +if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}} +function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});} +function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;} +var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;} +windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;} +if(yScroll35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.2N.3g=6(4){4=23.2H({2B:\'#34\',2g:0.8,1d:F,1M:\'18/5-33-Y.16\',1v:\'18/5-1u-2Q.16\',1E:\'18/5-1u-2L.16\',1W:\'18/5-1u-2I.16\',19:\'18/5-2F.16\',1f:10,2A:3d,2s:\'1j\',2o:\'32\',2j:\'c\',2f:\'p\',2d:\'n\',h:[],9:0},4);f I=N;6 20(){1X(N,I);u F}6 1X(1e,I){$(\'1U, 1S, 1R\').l({\'1Q\':\'2E\'});1O();4.h.B=0;4.9=0;7(I.B==1){4.h.1J(v 1m(1e.17(\'J\'),1e.17(\'2v\')))}j{36(f i=0;i<1w g="5-b"><1w W="\'+4.1M+\'"><1i g="5-b-A-1t"><1i g="5-b-A-1g"><1w W="\'+4.1W+\'">\');f z=1D();$(\'#q-13\').l({2K:4.2B,2J:4.2g,S:z[0],P:z[1]}).1V();f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]}).E();$(\'#q-13,#q-5\').C(6(){1a()});$(\'#5-Y-29,#5-1s-22\').C(6(){1a();u F});$(G).2G(6(){f z=1D();$(\'#q-13\').l({S:z[0],P:z[1]});f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]})})}6 D(){$(\'#5-Y\').E();7(4.1d){$(\'#5-b,#5-s-b-T-w,#5-b-A-1g\').1b()}j{$(\'#5-b,#5-k,#5-k-V,#5-k-X,#5-s-b-T-w,#5-b-A-1g\').1b()}f Q=v 1j();Q.1P=6(){$(\'#5-b\').2D(\'W\',4.h[4.9][0]);1N(Q.S,Q.P);Q.1P=6(){}};Q.W=4.h[4.9][0]};6 1N(1o,1r){f 1L=$(\'#5-s-b-w\').S();f 1K=$(\'#5-s-b-w\').P();f 1n=(1o+(4.1f*2));f 1y=(1r+(4.1f*2));f 1I=1L-1n;f 2z=1K-1y;$(\'#5-s-b-w\').3f({S:1n,P:1y},4.2A,6(){2y()});7((1I==0)&&(2z==0)){7($.3e.3c){1H(3b)}j{1H(3a)}}$(\'#5-s-b-T-w\').l({S:1o});$(\'#5-k-V,#5-k-X\').l({P:1r+(4.1f*2)})};6 2y(){$(\'#5-Y\').1b();$(\'#5-b\').1V(6(){2u();2t()});2r()};6 2u(){$(\'#5-s-b-T-w\').38(\'35\');$(\'#5-b-A-1t\').1b();7(4.h[4.9][1]){$(\'#5-b-A-1t\').2p(4.h[4.9][1]).E()}7(4.h.B>1){$(\'#5-b-A-1g\').2p(4.2s+\' \'+(4.9+1)+\' \'+4.2o+\' \'+4.h.B).E()}}6 2t(){$(\'#5-k\').E();$(\'#5-k-V,#5-k-X\').l({\'K\':\'1C M(\'+4.19+\') L-O\'});7(4.9!=0){7(4.1d){$(\'#5-k-V\').l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9-1;D();u F})}j{$(\'#5-k-V\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9-1;D();u F})}}7(4.9!=(4.h.B-1)){7(4.1d){$(\'#5-k-X\').l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9+1;D();u F})}j{$(\'#5-k-X\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9+1;D();u F})}}2k()}6 2k(){$(d).30(6(12){2i(12)})}6 1G(){$(d).11()}6 2i(12){7(12==2h){U=2Z.2e;1x=27}j{U=12.2e;1x=12.2Y}14=2X.2W(U).2U();7((14==4.2j)||(14==\'x\')||(U==1x)){1a()}7((14==4.2f)||(U==37)){7(4.9!=0){4.9=4.9-1;D();1G()}}7((14==4.2d)||(U==39)){7(4.9!=(4.h.B-1)){4.9=4.9+1;D();1G()}}}6 2r(){7((4.h.B-1)>4.9){2c=v 1j();2c.W=4.h[4.9+1][0]}7(4.9>0){2b=v 1j();2b.W=4.h[4.9-1][0]}}6 1a(){$(\'#q-5\').2a();$(\'#q-13\').2T(6(){$(\'#q-13\').2a()});$(\'1U, 1S, 1R\').l({\'1Q\':\'2S\'})}6 1D(){f o,r;7(G.1h&&G.28){o=G.26+G.2R;r=G.1h+G.28}j 7(d.m.25>d.m.24){o=d.m.2P;r=d.m.25}j{o=d.m.2O;r=d.m.24}f y,H;7(Z.1h){7(d.t.1l){y=d.t.1l}j{y=Z.26}H=Z.1h}j 7(d.t&&d.t.1A){y=d.t.1l;H=d.t.1A}j 7(d.m){y=d.m.1l;H=d.m.1A}7(r +

    $album.1

    + + + +
    + {{ if $prevlink }}{{ endif }} + + {{ if $nextlink }}{{ endif }} +
    + +
    +
    $desc
    +{{ if $tags }} +
    $tags.0
    +
    $tags.1
    +{{ endif }} +{{ if $tags.2 }}{{ endif }} + +{{ if $edit }}$edit{{ endif }} \ No newline at end of file diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index ad7119c2a..badedb02f 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -177,8 +177,8 @@ .icon.on { background-image: url("../../../view/theme/diabook/icons/toogle_on.png"); background-repeat: no-repeat;} .icon.off { background-image: url("../../../view/theme/diabook/icons/toogle_off.png"); background-repeat: no-repeat;} -.prev { background-position: -90px -60px;} -.next { background-position: -110px -60px;} +.icon.prev { background-image: url("../../../view/theme/diabook/icons/prev.png"); background-repeat: no-repeat;} +.icon.next { background-image: url("../../../view/theme/diabook/icons/next.png"); background-repeat: no-repeat;} /*.tagged { background-position: -130px -60px;}*/ .attachtype { @@ -247,7 +247,7 @@ background-image: url("../../../images/icons/10/edit.png"); } .icon.s10.star { - background-image: url("../../../images/icons/10/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s10.menu { background-image: url("../../../images/icons/10/menu.png"); @@ -285,7 +285,7 @@ background-image: url("../../../images/icons/16/edit.png"); }*/ .icon.s16.star { - background-image: url("../../../images/icons/16/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s16.menu { background-image: url("../../../images/icons/16/menu.png"); @@ -323,7 +323,7 @@ background-image: url("../../../images/icons/22/edit.png"); } .icon.s22.star { - background-image: url("../../../images/icons/22/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s22.menu { background-image: url("../../../images/icons/22/menu.png"); @@ -361,7 +361,7 @@ background-image: url("../../../images/icons/48/edit.png"); } .icon.s48.star { - background-image: url("../../../images/icons/48/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s48.menu { background-image: url("../../../images/icons/48/menu.png"); @@ -400,6 +400,7 @@ body { margin: 50px auto auto; display: table; } + h4 { font-size: 1.1em; } @@ -704,21 +705,17 @@ nav #nav-user-linkmenu nav #nav-user-linkmenu{ margin-right: 0px; } -nav #nav-home-link{ +nav #nav-home-link, #nav-directory-link, #nav-apps-link{ margin-left: 0px; + margin-right: 0px; font-weight: bold; + margin: 3px 5px; } nav #nav-directory-link{ - margin-left: 0px; - margin-right: 0px; - font-weight: bold; - margin: 3px 15px; + margin-right: 0px; } -nav #nav-apps-link{ - margin-left: 0px; - margin-right: 0px; - font-weight: bold; - margin: 3px 15px; +nav #nav-home-link{ + margin-left: 0px; } nav #nav-help-link .menu-popup, nav #nav-search-link .menu-popup, @@ -866,6 +863,8 @@ ul.menu-popup .empty { padding: 7px 7px 0px 0px; } + + /* aside */ aside { display: table-cell; @@ -876,6 +875,7 @@ aside { float: left; /* background: #F1F1F1; */ } + aside .vcard .fn { font-size: 18px; font-weight: bold; @@ -1036,6 +1036,13 @@ section { width: 800px; padding: 0px 0px 0px 12px; } + +body .pageheader{ + text-align: center; + margin-top: 25px; + font-size: 0px; + } + #id_username { width: 173px; } @@ -1046,7 +1053,6 @@ section { width: 173px; } #contact-edit-end { - } .pager { padding: 10px; @@ -1972,10 +1978,22 @@ box-shadow: 1px 1px 5px 0; } #prvmail-submit { - float: left; + float: right; margin-top: 10px; - margin-right: 30px; } +#prvmail-subject +{ +background: none repeat scroll 0 0 #FFFFFF; +border: 1px solid #CCCCCC; +border-radius: 5px 5px 5px 5px; +font-weight: bold; +height: 20px; +margin: 0 0 5px; +vertical-align: middle; +} +#prvmail-form{ + width: 597px; + } #prvmail-upload-wrapper, #prvmail-link-wrapper, #prvmail-rotator-wrapper { @@ -2163,14 +2181,25 @@ a.mail-list-link { padding: 10px; float: left; } +.lightbox{ + float: left; + } #photo-photo { float: left; } #photo-like-div .wall-item-like-buttons { - float: left; - margin-right: 10px; + float: left; + margin-right: 5px; + margin-top: 30px; } +.comment-edit-text-empty { + margin: 10px 0 0; + width: 85%; +} +.comment-edit-photo { + margin: 10px 0 0; +} .wall-item-like-buttons .icon.like { float: left; } diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index 5a1828ad7..1617dd7f0 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -12,6 +12,12 @@ $a->theme_info = array( ); $a->page['htmlhead'] .= <<< EOT + + + + + + + //appsmenu + $('html').click(function() { + $('#nav-apps-link').removeClass('selected'); + document.getElementById( "nav-apps-menu" ).style.display = "none"; + }); + + $('#nav-apps-link').click(function(event){ + event.stopPropagation(); + }); + + $(function() { + $('a.lightbox').lightBox(); // Select all links with lightbox class +}); + + + EOT; -- cgit v1.2.3 From 59766b944c9ea3a45b1d7e8593f7bb5d4a0b8445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Mon, 12 Mar 2012 20:17:37 +0000 Subject: Some security against XSRF-attacks --- include/security.php | 46 +++++++++++++++++++++++++++++++ mod/profile_photo.php | 18 ++++++++---- mod/profiles.php | 26 ++++++++++++++---- mod/settings.php | 61 ++++++++++++++++++++++++++--------------- view/cropbody.tpl | 1 + view/profile_edit.tpl | 5 ++-- view/profile_listing_header.tpl | 2 +- view/profile_photo.tpl | 1 + view/settings.tpl | 2 +- view/settings_addons.tpl | 1 + view/settings_connectors.tpl | 1 + view/settings_oauth.tpl | 5 ++-- view/settings_oauth_edit.tpl | 2 ++ 13 files changed, 132 insertions(+), 39 deletions(-) diff --git a/include/security.php b/include/security.php index 8c536b656..6ea515bff 100755 --- a/include/security.php +++ b/include/security.php @@ -288,3 +288,49 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null) } +/* + * Functions used to protect against Cross-Site Request Forgery + * The security token has to base on at least one value that an attacker can't know - here it's the session ID and the private key. + * In this implementation, a security token is reusable (if the user submits a form, goes back and resubmits the form, maybe with small changes; + * or if the security token is used for ajax-calls that happen several times), but only valid for a certain amout of time (3hours). + * The "typename" seperates the security tokens of different types of forms. This could be relevant in the following case: + * A security token is used to protekt a link from CSRF (e.g. the "delete this profile"-link). + * If the new page contains by any chance external elements, then the used security token is exposed by the referrer. + * Actually, important actions should not be triggered by Links / GET-Requests at all, but somethimes they still are, + * so this mechanism brings in some damage control (the attacker would be able to forge a request to a form of this type, but not to forms of other types). + */ +function get_form_security_token($typename = "") { + $a = get_app(); + + $timestamp = time(); + $sec_hash = hash('whirlpool', $a->user["guid"] . $a->user["prvkey"] . session_id() . $timestamp . $typename); + + return $timestamp . "." . $sec_hash; +} + +function check_form_security_token($typename = "", $formname = 'form_security_token') { + if (!x($_REQUEST, $formname)) return false; + $hash = $_REQUEST[$formname]; + + $max_livetime = 10800; // 3 hours + + $a = get_app(); + + $x = explode(".", $hash); + if (time() > (IntVal($x[0]) + $max_livetime)) return false; + + $sec_hash = hash('whirlpool', $a->user["guid"] . $a->user["prvkey"] . session_id() . $x[0] . $typename); + + return ($sec_hash == $x[1]); +} + +function check_form_security_std_err_msg() { + return t('The form security token was not correct. This probably happened because the form has been opened for too long (>3 hours) before subitting it.') . EOL; +} +function check_form_security_token_redirectOnErr($err_redirect, $typename = "", $formname = 'form_security_token') { + if (!check_form_security_token($typename, $formname)) { + $a = get_app(); + notice( check_form_security_std_err_msg() ); + goaway($a->get_baseurl() . $err_redirect ); + } +} diff --git a/mod/profile_photo.php b/mod/profile_photo.php index e3dbdaf39..d1fd08eba 100755 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -15,11 +15,13 @@ function profile_photo_init(&$a) { function profile_photo_post(&$a) { - if(! local_user()) { - notice ( t('Permission denied.') . EOL ); - return; - } - + if(! local_user()) { + notice ( t('Permission denied.') . EOL ); + return; + } + + check_form_security_token_redirectOnErr('/profile_photo', 'profile_photo'); + if((x($_POST,'cropfinal')) && ($_POST['cropfinal'] == 1)) { // phase 2 - we have finished cropping @@ -148,7 +150,9 @@ function profile_photo_content(&$a) { notice( t('Permission denied.') . EOL ); return; }; - + + check_form_security_token_redirectOnErr('/profile_photo', 'profile_photo'); + $resource_id = $a->argv[2]; //die(":".local_user()); $r=q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' ORDER BY `scale` ASC", @@ -203,6 +207,7 @@ function profile_photo_content(&$a) { '$lbl_upfile' => t('Upload File:'), '$title' => t('Upload Profile Photo'), '$submit' => t('Upload'), + '$form_security_token' => get_form_security_token("profile_photo"), '$select' => sprintf('%s %s', t('or'), ($newuser) ? '' . t('skip this step') . '' : '' . t('select a photo from your photo albums') . '') )); @@ -218,6 +223,7 @@ function profile_photo_content(&$a) { '$image_url' => $a->get_baseurl() . '/photo/' . $filename, '$title' => t('Crop Image'), '$desc' => t('Please adjust the image cropping for optimum viewing.'), + '$form_security_token' => get_form_security_token("profile_photo"), '$done' => t('Done Editing') )); return $o; diff --git a/mod/profiles.php b/mod/profiles.php index ccd7d5474..b307a2d43 100755 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -21,6 +21,9 @@ function profiles_post(&$a) { notice( t('Profile not found.') . EOL); return; } + + check_form_security_token_redirectOnErr('/profiles', 'profile_edit'); + $is_default = (($orig[0]['is-default']) ? 1 : 0); $profile_name = notags(trim($_POST['profile_name'])); @@ -240,6 +243,8 @@ function profiles_content(&$a) { goaway($a->get_baseurl() . '/profiles'); return; // NOTREACHED } + + check_form_security_token_redirectOnErr('/profiles', 'profile_drop', 't'); // move every contact using this profile as their default to the user default @@ -264,6 +269,8 @@ function profiles_content(&$a) { if(($a->argc > 1) && ($a->argv[1] === 'new')) { + + check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't'); $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d", intval(local_user())); @@ -291,10 +298,13 @@ function profiles_content(&$a) { info( t('New profile created.') . EOL); if(count($r3) == 1) goaway($a->get_baseurl() . '/profiles/' . $r3[0]['id']); + goaway($a->get_baseurl() . '/profiles'); - } + } if(($a->argc > 2) && ($a->argv[1] === 'clone')) { + + check_form_security_token_redirectOnErr('/profiles', 'profile_clone', 't'); $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d", intval(local_user())); @@ -330,9 +340,11 @@ function profiles_content(&$a) { info( t('New profile created.') . EOL); if(count($r3) == 1) goaway($a->get_baseurl() . '/profiles/' . $r3[0]['id']); - goaway($a->get_baseurl() . '/profiles'); - return; // NOTREACHED - } + + goaway($a->get_baseurl() . '/profiles'); + + return; // NOTREACHED + } if(($a->argc > 1) && (intval($a->argv[1]))) { @@ -371,6 +383,9 @@ function profiles_content(&$a) { $is_default = (($r[0]['is-default']) ? 1 : 0); $tpl = get_markup_template("profile_edit.tpl"); $o .= replace_macros($tpl,array( + '$form_security_token' => get_form_security_token("profile_edit"), + '$profile_clone_link' => 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone"), + '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"), '$banner' => t('Edit Profile Details'), '$submit' => t('Submit'), '$viewprof' => t('View this profile'), @@ -460,7 +475,8 @@ function profiles_content(&$a) { $o .= replace_macros($tpl_header,array( '$header' => t('Edit/Manage Profiles'), '$chg_photo' => t('Change profile photo'), - '$cr_new' => t('Create New Profile') + '$cr_new' => t('Create New Profile'), + '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new") )); diff --git a/mod/settings.php b/mod/settings.php index 2ef582fdf..f42fdb397 100755 --- a/mod/settings.php +++ b/mod/settings.php @@ -53,6 +53,8 @@ function settings_post(&$a) { $old_page_flags = $a->user['page-flags']; if(($a->argc > 1) && ($a->argv[1] === 'oauth') && x($_POST,'remove')){ + check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth'); + $key = $_POST['remove']; q("DELETE FROM tokens WHERE id='%s' AND uid=%d", dbesc($key), @@ -63,6 +65,8 @@ function settings_post(&$a) { if(($a->argc > 2) && ($a->argv[1] === 'oauth') && ($a->argv[2] === 'edit'||($a->argv[2] === 'add')) && x($_POST,'submit')) { + check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth'); + $name = ((x($_POST,'name')) ? $_POST['name'] : ''); $key = ((x($_POST,'key')) ? $_POST['key'] : ''); $secret = ((x($_POST,'secret')) ? $_POST['secret'] : ''); @@ -105,13 +109,18 @@ function settings_post(&$a) { } if(($a->argc > 1) && ($a->argv[1] == 'addon')) { + check_form_security_token_redirectOnErr('/settings/addon', 'settings_addon'); + call_hooks('plugin_settings_post', $_POST); return; } if(($a->argc > 1) && ($a->argv[1] == 'connectors')) { - - if(x($_POST['imap-submit'])) { + + check_form_security_token_redirectOnErr('/settings/connectors', 'settings_connectors'); + + if(x($_POST, 'imap-submit')) { + $mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : ''); $mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : ''); $mail_ssl = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : ''); @@ -185,7 +194,8 @@ function settings_post(&$a) { return; } - + check_form_security_token_redirectOnErr('/settings', 'settings'); + call_hooks('settings_post', $_POST); if((x($_POST,'npassword')) || (x($_POST,'confirm'))) { @@ -460,6 +470,7 @@ function settings_content(&$a) { if(($a->argc > 2) && ($a->argv[2] === 'add')) { $tpl = get_markup_template("settings_oauth_edit.tpl"); $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("settings_oauth"), '$tabs' => $tabs, '$title' => t('Add application'), '$submit' => t('Submit'), @@ -486,6 +497,7 @@ function settings_content(&$a) { $tpl = get_markup_template("settings_oauth_edit.tpl"); $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("settings_oauth"), '$tabs' => $tabs, '$title' => t('Add application'), '$submit' => t('Update'), @@ -500,6 +512,8 @@ function settings_content(&$a) { } if(($a->argc > 3) && ($a->argv[2] === 'delete')) { + check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth', 't'); + $r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d", dbesc($a->argv[3]), local_user()); @@ -518,6 +532,7 @@ function settings_content(&$a) { $tpl = get_markup_template("settings_oauth.tpl"); $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("settings_oauth"), '$baseurl' => $a->get_baseurl(), '$title' => t('Connected Apps'), '$add' => t('Add application'), @@ -544,6 +559,7 @@ function settings_content(&$a) { $tpl = get_markup_template("settings_addons.tpl"); $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("settings_addons"), '$title' => t('Plugin Settings'), '$tabs' => $tabs, '$settings_addons' => $settings_addons @@ -586,28 +602,28 @@ function settings_content(&$a) { $tpl = get_markup_template("settings_connectors.tpl"); $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("settings_connectors"), + '$title' => t('Connector Settings'), '$tabs' => $tabs, - '$diasp_enabled' => $diasp_enabled, - '$ostat_enabled' => $ostat_enabled, - - '$h_imap' => t('Email/Mailbox Setup'), - '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."), - '$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk,''), - '$mail_disabled' => (($mail_disabled) ? t('Email access is disabled on this site.') : ''), - '$mail_server' => array('mail_server', t('IMAP server name:'), $mail_server, ''), - '$mail_port' => array('mail_port', t('IMAP port:'), $mail_port, ''), - '$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( ''=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')), - '$mail_user' => array('mail_user', t('Email login name:'), $mail_user, ''), - '$mail_pass' => array('mail_pass', t('Email password:'), '', ''), - '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'), - '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''), - '$mail_action' => array('mail_action', t('Action after import:'), $mail_action, '', array(0=>t('None'), 1=>t('Delete'), 2=>t('Mark as seen'), 3=>t('Move to folder'))), - '$mail_movetofolder' => array('mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''), - '$submit' => t('Submit'), - - + '$diasp_enabled' => $diasp_enabled, + '$ostat_enabled' => $ostat_enabled, + + '$h_imap' => t('Email/Mailbox Setup'), + '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."), + '$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk,''), + '$mail_disabled' => (($mail_disabled) ? t('Email access is disabled on this site.') : ''), + '$mail_server' => array('mail_server', t('IMAP server name:'), $mail_server, ''), + '$mail_port' => array('mail_port', t('IMAP port:'), $mail_port, ''), + '$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( ''=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')), + '$mail_user' => array('mail_user', t('Email login name:'), $mail_user, ''), + '$mail_pass' => array('mail_pass', t('Email password:'), '', ''), + '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'), + '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''), + '$mail_action' => array('mail_action', t('Action after import:'), $mail_action, '', array(0=>t('None'), 1=>t('Delete'), 2=>t('Mark as seen'), 3=>t('Move to folder'))), + '$mail_movetofolder' => array('mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''), + '$submit' => t('Submit'), '$settings_connectors' => $settings_connectors )); @@ -805,6 +821,7 @@ function settings_content(&$a) { '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(), '$uid' => local_user(), + '$form_security_token' => get_form_security_token("settings"), '$nickname_block' => $prof_addr, diff --git a/view/cropbody.tpl b/view/cropbody.tpl index c9c0f84de..b484d15bf 100755 --- a/view/cropbody.tpl +++ b/view/cropbody.tpl @@ -40,6 +40,7 @@ $desc
    + diff --git a/view/profile_edit.tpl b/view/profile_edit.tpl index 8dab72649..e5c7162d0 100755 --- a/view/profile_edit.tpl +++ b/view/profile_edit.tpl @@ -5,9 +5,9 @@ $default @@ -17,6 +17,7 @@ $default
    +
    diff --git a/view/profile_listing_header.tpl b/view/profile_listing_header.tpl index 09e4fc9b2..61a273792 100755 --- a/view/profile_listing_header.tpl +++ b/view/profile_listing_header.tpl @@ -3,6 +3,6 @@ $chg_photo

    diff --git a/view/profile_photo.tpl b/view/profile_photo.tpl index f258b5b86..0b3a1cac1 100755 --- a/view/profile_photo.tpl +++ b/view/profile_photo.tpl @@ -1,6 +1,7 @@

    $title

    +
    diff --git a/view/settings.tpl b/view/settings.tpl index 46c737b23..25479b5bf 100755 --- a/view/settings.tpl +++ b/view/settings.tpl @@ -5,7 +5,7 @@ $tabs $nickname_block - +

    $h_pass

    diff --git a/view/settings_addons.tpl b/view/settings_addons.tpl index 2cbfd17e9..28fca5362 100755 --- a/view/settings_addons.tpl +++ b/view/settings_addons.tpl @@ -4,6 +4,7 @@ $tabs + $settings_addons diff --git a/view/settings_connectors.tpl b/view/settings_connectors.tpl index 9493c8bf7..43c0346bb 100755 --- a/view/settings_connectors.tpl +++ b/view/settings_connectors.tpl @@ -6,6 +6,7 @@ $tabs
    $ostat_enabled
    + $settings_connectors diff --git a/view/settings_oauth.tpl b/view/settings_oauth.tpl index 0de0dbe98..da1398ab9 100755 --- a/view/settings_oauth.tpl +++ b/view/settings_oauth.tpl @@ -4,7 +4,8 @@ $tabs - + + {{ endfor }} diff --git a/view/settings_oauth_edit.tpl b/view/settings_oauth_edit.tpl index 98b7457aa..d29341386 100755 --- a/view/settings_oauth_edit.tpl +++ b/view/settings_oauth_edit.tpl @@ -3,6 +3,8 @@ $tabs

    $title

    + + {{ inc field_input.tpl with $field=$name }}{{ endinc }} {{ inc field_input.tpl with $field=$key }}{{ endinc }} {{ inc field_input.tpl with $field=$secret }}{{ endinc }} -- cgit v1.2.3 -- cgit v1.2.3 From caffb217c1e7227137ac1575af369b34d10519fe Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Mon, 12 Mar 2012 23:31:54 +0100 Subject: fixes --- view/theme/diabook-blue/group_side.tpl | 29 ++++++++++++++++++++++++ view/theme/diabook-blue/icons/notifications.png | Bin 795 -> 727 bytes view/theme/diabook-blue/style.css | 7 +++++- view/theme/diabook-blue/theme.php | 4 ++-- view/theme/diabook/group_side.tpl | 29 ++++++++++++++++++++++++ view/theme/diabook/style.css | 7 +++++- 6 files changed, 72 insertions(+), 4 deletions(-) create mode 100755 view/theme/diabook-blue/group_side.tpl create mode 100755 view/theme/diabook/group_side.tpl diff --git a/view/theme/diabook-blue/group_side.tpl b/view/theme/diabook-blue/group_side.tpl new file mode 100755 index 000000000..af183d04d --- /dev/null +++ b/view/theme/diabook-blue/group_side.tpl @@ -0,0 +1,29 @@ +
    +
    +

    $title

    + +
    + + +
    + diff --git a/view/theme/diabook-blue/icons/notifications.png b/view/theme/diabook-blue/icons/notifications.png index 33ae95c6a..c23673dbd 100755 Binary files a/view/theme/diabook-blue/icons/notifications.png and b/view/theme/diabook-blue/icons/notifications.png differ diff --git a/view/theme/diabook-blue/style.css b/view/theme/diabook-blue/style.css index 81c056bf3..67ee11769 100644 --- a/view/theme/diabook-blue/style.css +++ b/view/theme/diabook-blue/style.css @@ -970,6 +970,10 @@ aside #side-peoplefind-url { widht: 55px; height: 55px; } +#lost-password-link { + float: left; + margin-right: 20px; + } /* widget */ .widget { margin-bottom: 2em; @@ -1065,7 +1069,8 @@ body .pageheader{ padding: 10px; text-align: center; font-size: 1.0em; - margin-top: 140%; + clear: both; + display: block; } .tabs { diff --git a/view/theme/diabook-blue/theme.php b/view/theme/diabook-blue/theme.php index 1617dd7f0..38a282d3b 100755 --- a/view/theme/diabook-blue/theme.php +++ b/view/theme/diabook-blue/theme.php @@ -1,8 +1,8 @@ +
    +

    $title

    + +
    + + +
    + diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index badedb02f..9edd989b0 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -962,6 +962,10 @@ aside #side-peoplefind-url { widht: 55px; height: 55px; } +#lost-password-link { + float: left; + margin-right: 20px; + } /* widget */ .widget { margin-bottom: 2em; @@ -1058,7 +1062,8 @@ body .pageheader{ padding: 10px; text-align: center; font-size: 1.0em; - margin-top: 140%; + clear: both; + display: block; } .tabs { -- cgit v1.2.3 From 27bc8052d06c516fec2b6f1df09c0c46c4bad906 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Tue, 13 Mar 2012 00:04:19 +0100 Subject: use fancybox instead of lightbox --- .../lightbox/css/jquery.lightbox-0.5.css | 101 ----- .../lightbox/images/lightbox-blank.gif | Bin 43 -> 0 bytes .../lightbox/images/lightbox-btn-close.gif | Bin 700 -> 0 bytes .../lightbox/images/lightbox-btn-next.gif | Bin 812 -> 0 bytes .../lightbox/images/lightbox-btn-prev.gif | Bin 832 -> 0 bytes .../lightbox/images/lightbox-ico-loading.gif | Bin 3990 -> 0 bytes view/theme/diabook-blue/lightbox/index.htm | 78 ---- view/theme/diabook-blue/lightbox/js/jquery.js | 32 -- .../lightbox/js/jquery.lightbox-0.5.js | 472 --------------------- .../lightbox/js/jquery.lightbox-0.5.min.js | 42 -- .../lightbox/js/jquery.lightbox-0.5.pack.js | 14 - view/theme/diabook-blue/lightbox/photos/image1.jpg | Bin 19983 -> 0 bytes view/theme/diabook-blue/lightbox/photos/image2.jpg | Bin 45539 -> 0 bytes view/theme/diabook-blue/lightbox/photos/image3.jpg | Bin 39361 -> 0 bytes view/theme/diabook-blue/lightbox/photos/image4.jpg | Bin 18746 -> 0 bytes view/theme/diabook-blue/lightbox/photos/image5.jpg | Bin 30903 -> 0 bytes .../diabook-blue/lightbox/photos/thumb_image1.jpg | Bin 2092 -> 0 bytes .../diabook-blue/lightbox/photos/thumb_image2.jpg | Bin 2541 -> 0 bytes .../diabook-blue/lightbox/photos/thumb_image3.jpg | Bin 2237 -> 0 bytes .../diabook-blue/lightbox/photos/thumb_image4.jpg | Bin 1993 -> 0 bytes .../diabook-blue/lightbox/photos/thumb_image5.jpg | Bin 2045 -> 0 bytes view/theme/diabook-blue/theme.php | 7 +- .../diabook/lightbox/css/jquery.lightbox-0.5.css | 101 ----- .../diabook/lightbox/images/lightbox-blank.gif | Bin 43 -> 0 bytes .../diabook/lightbox/images/lightbox-btn-close.gif | Bin 700 -> 0 bytes .../diabook/lightbox/images/lightbox-btn-next.gif | Bin 812 -> 0 bytes .../diabook/lightbox/images/lightbox-btn-prev.gif | Bin 832 -> 0 bytes .../lightbox/images/lightbox-ico-loading.gif | Bin 3990 -> 0 bytes view/theme/diabook/lightbox/index.htm | 78 ---- view/theme/diabook/lightbox/js/jquery.js | 32 -- .../diabook/lightbox/js/jquery.lightbox-0.5.js | 472 --------------------- .../diabook/lightbox/js/jquery.lightbox-0.5.min.js | 42 -- .../lightbox/js/jquery.lightbox-0.5.pack.js | 14 - view/theme/diabook/lightbox/photos/image1.jpg | Bin 19983 -> 0 bytes view/theme/diabook/lightbox/photos/image2.jpg | Bin 45539 -> 0 bytes view/theme/diabook/lightbox/photos/image3.jpg | Bin 39361 -> 0 bytes view/theme/diabook/lightbox/photos/image4.jpg | Bin 18746 -> 0 bytes view/theme/diabook/lightbox/photos/image5.jpg | Bin 30903 -> 0 bytes .../theme/diabook/lightbox/photos/thumb_image1.jpg | Bin 2092 -> 0 bytes .../theme/diabook/lightbox/photos/thumb_image2.jpg | Bin 2541 -> 0 bytes .../theme/diabook/lightbox/photos/thumb_image3.jpg | Bin 2237 -> 0 bytes .../theme/diabook/lightbox/photos/thumb_image4.jpg | Bin 1993 -> 0 bytes .../theme/diabook/lightbox/photos/thumb_image5.jpg | Bin 2045 -> 0 bytes view/theme/diabook/theme.php | 7 +- 44 files changed, 2 insertions(+), 1490 deletions(-) delete mode 100644 view/theme/diabook-blue/lightbox/css/jquery.lightbox-0.5.css delete mode 100644 view/theme/diabook-blue/lightbox/images/lightbox-blank.gif delete mode 100644 view/theme/diabook-blue/lightbox/images/lightbox-btn-close.gif delete mode 100644 view/theme/diabook-blue/lightbox/images/lightbox-btn-next.gif delete mode 100644 view/theme/diabook-blue/lightbox/images/lightbox-btn-prev.gif delete mode 100644 view/theme/diabook-blue/lightbox/images/lightbox-ico-loading.gif delete mode 100644 view/theme/diabook-blue/lightbox/index.htm delete mode 100644 view/theme/diabook-blue/lightbox/js/jquery.js delete mode 100644 view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.js delete mode 100644 view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.min.js delete mode 100644 view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.pack.js delete mode 100644 view/theme/diabook-blue/lightbox/photos/image1.jpg delete mode 100644 view/theme/diabook-blue/lightbox/photos/image2.jpg delete mode 100644 view/theme/diabook-blue/lightbox/photos/image3.jpg delete mode 100644 view/theme/diabook-blue/lightbox/photos/image4.jpg delete mode 100644 view/theme/diabook-blue/lightbox/photos/image5.jpg delete mode 100644 view/theme/diabook-blue/lightbox/photos/thumb_image1.jpg delete mode 100644 view/theme/diabook-blue/lightbox/photos/thumb_image2.jpg delete mode 100644 view/theme/diabook-blue/lightbox/photos/thumb_image3.jpg delete mode 100644 view/theme/diabook-blue/lightbox/photos/thumb_image4.jpg delete mode 100644 view/theme/diabook-blue/lightbox/photos/thumb_image5.jpg delete mode 100644 view/theme/diabook/lightbox/css/jquery.lightbox-0.5.css delete mode 100644 view/theme/diabook/lightbox/images/lightbox-blank.gif delete mode 100644 view/theme/diabook/lightbox/images/lightbox-btn-close.gif delete mode 100644 view/theme/diabook/lightbox/images/lightbox-btn-next.gif delete mode 100644 view/theme/diabook/lightbox/images/lightbox-btn-prev.gif delete mode 100644 view/theme/diabook/lightbox/images/lightbox-ico-loading.gif delete mode 100644 view/theme/diabook/lightbox/index.htm delete mode 100644 view/theme/diabook/lightbox/js/jquery.js delete mode 100644 view/theme/diabook/lightbox/js/jquery.lightbox-0.5.js delete mode 100644 view/theme/diabook/lightbox/js/jquery.lightbox-0.5.min.js delete mode 100644 view/theme/diabook/lightbox/js/jquery.lightbox-0.5.pack.js delete mode 100644 view/theme/diabook/lightbox/photos/image1.jpg delete mode 100644 view/theme/diabook/lightbox/photos/image2.jpg delete mode 100644 view/theme/diabook/lightbox/photos/image3.jpg delete mode 100644 view/theme/diabook/lightbox/photos/image4.jpg delete mode 100644 view/theme/diabook/lightbox/photos/image5.jpg delete mode 100644 view/theme/diabook/lightbox/photos/thumb_image1.jpg delete mode 100644 view/theme/diabook/lightbox/photos/thumb_image2.jpg delete mode 100644 view/theme/diabook/lightbox/photos/thumb_image3.jpg delete mode 100644 view/theme/diabook/lightbox/photos/thumb_image4.jpg delete mode 100644 view/theme/diabook/lightbox/photos/thumb_image5.jpg diff --git a/view/theme/diabook-blue/lightbox/css/jquery.lightbox-0.5.css b/view/theme/diabook-blue/lightbox/css/jquery.lightbox-0.5.css deleted file mode 100644 index c7c3d1cb1..000000000 --- a/view/theme/diabook-blue/lightbox/css/jquery.lightbox-0.5.css +++ /dev/null @@ -1,101 +0,0 @@ -/** - * jQuery lightBox plugin - * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) - * and adapted to me for use like a plugin from jQuery. - * @name jquery-lightbox-0.5.css - * @author Leandro Vieira Pinho - http://leandrovieira.com - * @version 0.5 - * @date April 11, 2008 - * @category jQuery plugin - * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) - * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US - * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin - */ -#jquery-overlay { - position: absolute; - top: 0; - left: 0; - z-index: 90; - width: 100%; - height: 500px; -} -#jquery-lightbox { - position: absolute; - top: 0; - left: 0; - width: 100%; - z-index: 100; - text-align: center; - line-height: 0; -} -#jquery-lightbox a img { border: none; } -#lightbox-container-image-box { - position: relative; - background-color: #fff; - width: 250px; - height: 250px; - margin: 0 auto; -} -#lightbox-container-image { padding: 10px; } -#lightbox-loading { - position: absolute; - top: 40%; - left: 0%; - height: 25%; - width: 100%; - text-align: center; - line-height: 0; -} -#lightbox-nav { - position: absolute; - top: 0; - left: 0; - height: 100%; - width: 100%; - z-index: 10; -} -#lightbox-container-image-box > #lightbox-nav { left: 0; } -#lightbox-nav a { outline: none;} -#lightbox-nav-btnPrev, #lightbox-nav-btnNext { - width: 49%; - height: 100%; - zoom: 1; - display: block; -} -#lightbox-nav-btnPrev { - left: 0; - float: left; -} -#lightbox-nav-btnNext { - right: 0; - float: right; -} -#lightbox-container-image-data-box { - font: 10px Verdana, Helvetica, sans-serif; - background-color: #fff; - margin: 0 auto; - line-height: 1.4em; - overflow: auto; - width: 100%; - padding: 0 10px 0; -} -#lightbox-container-image-data { - padding: 0 10px; - color: #666; -} -#lightbox-container-image-data #lightbox-image-details { - width: 70%; - float: left; - text-align: left; -} -#lightbox-image-details-caption { font-weight: bold; } -#lightbox-image-details-currentNumber { - display: block; - clear: left; - padding-bottom: 1.0em; -} -#lightbox-secNav-btnClose { - width: 66px; - float: right; - padding-bottom: 0.7em; -} \ No newline at end of file diff --git a/view/theme/diabook-blue/lightbox/images/lightbox-blank.gif b/view/theme/diabook-blue/lightbox/images/lightbox-blank.gif deleted file mode 100644 index 1d11fa9ad..000000000 Binary files a/view/theme/diabook-blue/lightbox/images/lightbox-blank.gif and /dev/null differ diff --git a/view/theme/diabook-blue/lightbox/images/lightbox-btn-close.gif b/view/theme/diabook-blue/lightbox/images/lightbox-btn-close.gif deleted file mode 100644 index 33bcf517a..000000000 Binary files a/view/theme/diabook-blue/lightbox/images/lightbox-btn-close.gif and /dev/null differ diff --git a/view/theme/diabook-blue/lightbox/images/lightbox-btn-next.gif b/view/theme/diabook-blue/lightbox/images/lightbox-btn-next.gif deleted file mode 100644 index a0d4fcf84..000000000 Binary files a/view/theme/diabook-blue/lightbox/images/lightbox-btn-next.gif and /dev/null differ diff --git a/view/theme/diabook-blue/lightbox/images/lightbox-btn-prev.gif b/view/theme/diabook-blue/lightbox/images/lightbox-btn-prev.gif deleted file mode 100644 index 040ee5992..000000000 Binary files a/view/theme/diabook-blue/lightbox/images/lightbox-btn-prev.gif and /dev/null differ diff --git a/view/theme/diabook-blue/lightbox/images/lightbox-ico-loading.gif b/view/theme/diabook-blue/lightbox/images/lightbox-ico-loading.gif deleted file mode 100644 index 4f1429c06..000000000 Binary files a/view/theme/diabook-blue/lightbox/images/lightbox-ico-loading.gif and /dev/null differ diff --git a/view/theme/diabook-blue/lightbox/index.htm b/view/theme/diabook-blue/lightbox/index.htm deleted file mode 100644 index 5daa72a0f..000000000 --- a/view/theme/diabook-blue/lightbox/index.htm +++ /dev/null @@ -1,78 +0,0 @@ - - - - - jQuery lightBox plugin - - - - - - - - - - - - - - - - -

    Example

    -

    Click in the image and see the jQuery lightBox plugin in action.

    - - - - \ No newline at end of file diff --git a/view/theme/diabook-blue/lightbox/js/jquery.js b/view/theme/diabook-blue/lightbox/js/jquery.js deleted file mode 100644 index 3747929d8..000000000 --- a/view/theme/diabook-blue/lightbox/js/jquery.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * jQuery 1.2.3 - New Wave Javascript - * - * Copyright (c) 2008 John Resig (jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $ - * $Rev: 4663 $ - */ -(function(){if(window.jQuery)var _jQuery=window.jQuery;var jQuery=window.jQuery=function(selector,context){return new jQuery.prototype.init(selector,context);};if(window.$)var _$=window.$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;var isSimple=/^.[^:#\[\.]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}else if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem)if(elem.id!=match[3])return jQuery().find(selector);else{this[0]=elem;this.length=1;return this;}else -selector=[];}}else -return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.3",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;this.each(function(i){if(this==elem)ret=i;});return ret;},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],name)||undefined;else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else -return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else -selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return!selector?this:this.pushStack(jQuery.merge(this.get(),selector.constructor==String?jQuery(selector).get():selector.length!=undefined&&(!selector.nodeName||jQuery.nodeName(selector,"form"))?selector:[selector]));},is:function(selector){return selector?jQuery.multiFilter(selector,this).length>0:false;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=value.constructor==Array?value:[value];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else -this.value=value;});},html:function(value){return value==undefined?(this.length?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value==null){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data==undefined&&this.length)data=jQuery.data(this[0],key);return data==null&&parts[1]?this.data(parts[0]):data;}else -return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);}else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.prototype.init.prototype=jQuery.prototype;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else -jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==1){target=this;i=0;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else -jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret;function color(elem){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=elem.style.outline;elem.style.outline="0 solid black";elem.style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&elem.style&&elem.style[name])ret=elem.style[name];else if(document.defaultView&&document.defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var getComputedStyle=document.defaultView.getComputedStyle(elem,null);if(getComputedStyle&&!color(elem))ret=getComputedStyle.getPropertyValue(name);else{var swap=[],stack=[];for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(var i=0;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
    ","
    "]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else -ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,""+value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(typeof array!="array")for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval!=undefined)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(arguments.callee.elem,arguments);return val;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else -for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data||[]);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event)data.unshift(this.fix({type:type,target:elem}));data[0].type=type;if(exclusive)data[0].exclusive=true;if(jQuery.isFunction(jQuery.data(elem,"handle")))val=jQuery.data(elem,"handle").apply(elem,data);if(!fn&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var handlers=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in handlers){var handler=handlers[j];args[0].handler=handler;args[0].data=handler.data;if(!parts[1]&&!event.exclusive||handler.type==parts[1]){var ret=handler.apply(this,args);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);return undefined;},toggle:function(){var args=arguments;return this.click(function(event){this.lastToggle=0==this.lastToggle?1:0;event.preventDefault();return args[this.lastToggle].apply(this,arguments)||false;});},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else -jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
    ").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){var jsonp,jsre=/=\?(&|$)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get"){var ts=(new Date()).getTime();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if((!s.url.indexOf("http")||!s.url.indexOf("//"))&&s.dataType=="script"&&s.type.toLowerCase()=="get"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async,s.username,s.password);try{if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");xml.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else -jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xml;},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||r.status==1223||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else -for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else -s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else -e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(!elem)return undefined;type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),fixed=jQuery.css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&jQuery.css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||jQuery.css(offsetChild,"position")=="absolute"))||(mozilla&&jQuery.css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}return results;};})(); \ No newline at end of file diff --git a/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.js b/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.js deleted file mode 100644 index eef6425e0..000000000 --- a/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.js +++ /dev/null @@ -1,472 +0,0 @@ -/** - * jQuery lightBox plugin - * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) - * and adapted to me for use like a plugin from jQuery. - * @name jquery-lightbox-0.5.js - * @author Leandro Vieira Pinho - http://leandrovieira.com - * @version 0.5 - * @date April 11, 2008 - * @category jQuery plugin - * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) - * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US - * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin - */ - -// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias -(function($) { - /** - * $ is an alias to jQuery object - * - */ - $.fn.lightBox = function(settings) { - // Settings to configure the jQuery lightBox plugin how you like - settings = jQuery.extend({ - // Configuration related to overlay - overlayBgColor: '#000', // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color. - overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9 - // Configuration related to navigation - fixedNavigation: false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface. - // Configuration related to images - imageLoading: 'images/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon - imageBtnPrev: 'images/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image - imageBtnNext: 'images/lightbox-btn-next.gif', // (string) Path and the name of the next button image - imageBtnClose: 'images/lightbox-btn-close.gif', // (string) Path and the name of the close btn - imageBlank: 'images/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel) - // Configuration related to container image box - containerBorderSize: 10, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value - containerResizeSpeed: 400, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default. - // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts. - txtImage: 'Image', // (string) Specify text "Image" - txtOf: 'of', // (string) Specify text "of" - // Configuration related to keyboard navigation - keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to. - keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image - keyToNext: 'n', // (string) (n = next) Letter to show the next image. - // Don´t alter these variables in any way - imageArray: [], - activeImage: 0 - },settings); - // Caching the jQuery object with all elements matched - var jQueryMatchedObj = this; // This, in this context, refer to jQuery object - /** - * Initializing the plugin calling the start function - * - * @return boolean false - */ - function _initialize() { - _start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked - return false; // Avoid the browser following the link - } - /** - * Start the jQuery lightBox plugin - * - * @param object objClicked The object (link) whick the user have clicked - * @param object jQueryMatchedObj The jQuery object with all elements matched - */ - function _start(objClicked,jQueryMatchedObj) { - // Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay. - $('embed, object, select').css({ 'visibility' : 'hidden' }); - // Call the function to create the markup structure; style some elements; assign events in some elements. - _set_interface(); - // Unset total images in imageArray - settings.imageArray.length = 0; - // Unset image active information - settings.activeImage = 0; - // We have an image set? Or just an image? Let´s see it. - if ( jQueryMatchedObj.length == 1 ) { - settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title'))); - } else { - // Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references - for ( var i = 0; i < jQueryMatchedObj.length; i++ ) { - settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title'))); - } - } - while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) { - settings.activeImage++; - } - // Call the function that prepares image exibition - _set_image_to_view(); - } - /** - * Create the jQuery lightBox plugin interface - * - * The HTML markup will be like that: -
    -
    - - -
    - * - */ - function _set_interface() { - // Apply the HTML markup into body tag - $('body').append('
    '); - // Get page sizes - var arrPageSizes = ___getPageSize(); - // Style overlay and show it - $('#jquery-overlay').css({ - backgroundColor: settings.overlayBgColor, - opacity: settings.overlayOpacity, - width: arrPageSizes[0], - height: arrPageSizes[1] - }).fadeIn(); - // Get page scroll - var arrPageScroll = ___getPageScroll(); - // Calculate top and left offset for the jquery-lightbox div object and show it - $('#jquery-lightbox').css({ - top: arrPageScroll[1] + (arrPageSizes[3] / 10), - left: arrPageScroll[0] - }).show(); - // Assigning click events in elements to close overlay - $('#jquery-overlay,#jquery-lightbox').click(function() { - _finish(); - }); - // Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects - $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() { - _finish(); - return false; - }); - // If window was resized, calculate the new overlay dimensions - $(window).resize(function() { - // Get page sizes - var arrPageSizes = ___getPageSize(); - // Style overlay and show it - $('#jquery-overlay').css({ - width: arrPageSizes[0], - height: arrPageSizes[1] - }); - // Get page scroll - var arrPageScroll = ___getPageScroll(); - // Calculate top and left offset for the jquery-lightbox div object and show it - $('#jquery-lightbox').css({ - top: arrPageScroll[1] + (arrPageSizes[3] / 10), - left: arrPageScroll[0] - }); - }); - } - /** - * Prepares image exibition; doing a image´s preloader to calculate it´s size - * - */ - function _set_image_to_view() { // show the loading - // Show the loading - $('#lightbox-loading').show(); - if ( settings.fixedNavigation ) { - $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide(); - } else { - // Hide some elements - $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide(); - } - // Image preload process - var objImagePreloader = new Image(); - objImagePreloader.onload = function() { - $('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]); - // Perfomance an effect in the image container resizing it - _resize_container_image_box(objImagePreloader.width,objImagePreloader.height); - // clear onLoad, IE behaves irratically with animated gifs otherwise - objImagePreloader.onload=function(){}; - }; - objImagePreloader.src = settings.imageArray[settings.activeImage][0]; - }; - /** - * Perfomance an effect in the image container resizing it - * - * @param integer intImageWidth The image´s width that will be showed - * @param integer intImageHeight The image´s height that will be showed - */ - function _resize_container_image_box(intImageWidth,intImageHeight) { - // Get current width and height - var intCurrentWidth = $('#lightbox-container-image-box').width(); - var intCurrentHeight = $('#lightbox-container-image-box').height(); - // Get the width and height of the selected image plus the padding - var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value - var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value - // Diferences - var intDiffW = intCurrentWidth - intWidth; - var intDiffH = intCurrentHeight - intHeight; - // Perfomance the effect - $('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); }); - if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) { - if ( $.browser.msie ) { - ___pause(250); - } else { - ___pause(100); - } - } - $('#lightbox-container-image-data-box').css({ width: intImageWidth }); - $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) }); - }; - /** - * Show the prepared image - * - */ - function _show_image() { - $('#lightbox-loading').hide(); - $('#lightbox-image').fadeIn(function() { - _show_image_data(); - _set_navigation(); - }); - _preload_neighbor_images(); - }; - /** - * Show the image information - * - */ - function _show_image_data() { - $('#lightbox-container-image-data-box').slideDown('fast'); - $('#lightbox-image-details-caption').hide(); - if ( settings.imageArray[settings.activeImage][1] ) { - $('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show(); - } - // If we have a image set, display 'Image X of X' - if ( settings.imageArray.length > 1 ) { - $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show(); - } - } - /** - * Display the button navigations - * - */ - function _set_navigation() { - $('#lightbox-nav').show(); - - // Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just. - $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); - - // Show the prev button, if not the first image in set - if ( settings.activeImage != 0 ) { - if ( settings.fixedNavigation ) { - $('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' }) - .unbind() - .bind('click',function() { - settings.activeImage = settings.activeImage - 1; - _set_image_to_view(); - return false; - }); - } else { - // Show the images button for Next buttons - $('#lightbox-nav-btnPrev').unbind().hover(function() { - $(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' }); - },function() { - $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); - }).show().bind('click',function() { - settings.activeImage = settings.activeImage - 1; - _set_image_to_view(); - return false; - }); - } - } - - // Show the next button, if not the last image in set - if ( settings.activeImage != ( settings.imageArray.length -1 ) ) { - if ( settings.fixedNavigation ) { - $('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' }) - .unbind() - .bind('click',function() { - settings.activeImage = settings.activeImage + 1; - _set_image_to_view(); - return false; - }); - } else { - // Show the images button for Next buttons - $('#lightbox-nav-btnNext').unbind().hover(function() { - $(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' }); - },function() { - $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); - }).show().bind('click',function() { - settings.activeImage = settings.activeImage + 1; - _set_image_to_view(); - return false; - }); - } - } - // Enable keyboard navigation - _enable_keyboard_navigation(); - } - /** - * Enable a support to keyboard navigation - * - */ - function _enable_keyboard_navigation() { - $(document).keydown(function(objEvent) { - _keyboard_action(objEvent); - }); - } - /** - * Disable the support to keyboard navigation - * - */ - function _disable_keyboard_navigation() { - $(document).unbind(); - } - /** - * Perform the keyboard actions - * - */ - function _keyboard_action(objEvent) { - // To ie - if ( objEvent == null ) { - keycode = event.keyCode; - escapeKey = 27; - // To Mozilla - } else { - keycode = objEvent.keyCode; - escapeKey = objEvent.DOM_VK_ESCAPE; - } - // Get the key in lower case form - key = String.fromCharCode(keycode).toLowerCase(); - // Verify the keys to close the ligthBox - if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) { - _finish(); - } - // Verify the key to show the previous image - if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) { - // If we´re not showing the first image, call the previous - if ( settings.activeImage != 0 ) { - settings.activeImage = settings.activeImage - 1; - _set_image_to_view(); - _disable_keyboard_navigation(); - } - } - // Verify the key to show the next image - if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) { - // If we´re not showing the last image, call the next - if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) { - settings.activeImage = settings.activeImage + 1; - _set_image_to_view(); - _disable_keyboard_navigation(); - } - } - } - /** - * Preload prev and next images being showed - * - */ - function _preload_neighbor_images() { - if ( (settings.imageArray.length -1) > settings.activeImage ) { - objNext = new Image(); - objNext.src = settings.imageArray[settings.activeImage + 1][0]; - } - if ( settings.activeImage > 0 ) { - objPrev = new Image(); - objPrev.src = settings.imageArray[settings.activeImage -1][0]; - } - } - /** - * Remove jQuery lightBox plugin HTML markup - * - */ - function _finish() { - $('#jquery-lightbox').remove(); - $('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); }); - // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay. - $('embed, object, select').css({ 'visibility' : 'visible' }); - } - /** - / THIRD FUNCTION - * getPageSize() by quirksmode.com - * - * @return Array Return an array with page width, height and window width, height - */ - function ___getPageSize() { - var xScroll, yScroll; - if (window.innerHeight && window.scrollMaxY) { - xScroll = window.innerWidth + window.scrollMaxX; - yScroll = window.innerHeight + window.scrollMaxY; - } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac - xScroll = document.body.scrollWidth; - yScroll = document.body.scrollHeight; - } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari - xScroll = document.body.offsetWidth; - yScroll = document.body.offsetHeight; - } - var windowWidth, windowHeight; - if (self.innerHeight) { // all except Explorer - if(document.documentElement.clientWidth){ - windowWidth = document.documentElement.clientWidth; - } else { - windowWidth = self.innerWidth; - } - windowHeight = self.innerHeight; - } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode - windowWidth = document.documentElement.clientWidth; - windowHeight = document.documentElement.clientHeight; - } else if (document.body) { // other Explorers - windowWidth = document.body.clientWidth; - windowHeight = document.body.clientHeight; - } - // for small pages with total height less then height of the viewport - if(yScroll < windowHeight){ - pageHeight = windowHeight; - } else { - pageHeight = yScroll; - } - // for small pages with total width less then width of the viewport - if(xScroll < windowWidth){ - pageWidth = xScroll; - } else { - pageWidth = windowWidth; - } - arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); - return arrayPageSize; - }; - /** - / THIRD FUNCTION - * getPageScroll() by quirksmode.com - * - * @return Array Return an array with x,y page scroll values. - */ - function ___getPageScroll() { - var xScroll, yScroll; - if (self.pageYOffset) { - yScroll = self.pageYOffset; - xScroll = self.pageXOffset; - } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict - yScroll = document.documentElement.scrollTop; - xScroll = document.documentElement.scrollLeft; - } else if (document.body) {// all other Explorers - yScroll = document.body.scrollTop; - xScroll = document.body.scrollLeft; - } - arrayPageScroll = new Array(xScroll,yScroll); - return arrayPageScroll; - }; - /** - * Stop the code execution from a escified time in milisecond - * - */ - function ___pause(ms) { - var date = new Date(); - curDate = null; - do { var curDate = new Date(); } - while ( curDate - date < ms); - }; - // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once - return this.unbind('click').click(_initialize); - }; -})(jQuery); // Call and execute the function immediately passing the jQuery object \ No newline at end of file diff --git a/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.min.js b/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.min.js deleted file mode 100644 index 5f13b0bf6..000000000 --- a/view/theme/diabook-blue/lightbox/js/jquery.lightbox-0.5.min.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * jQuery lightBox plugin - * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) - * and adapted to me for use like a plugin from jQuery. - * @name jquery-lightbox-0.5.js - * @author Leandro Vieira Pinho - http://leandrovieira.com - * @version 0.5 - * @date April 11, 2008 - * @category jQuery plugin - * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) - * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US - * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin - */ -(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'images/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',imageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;} -function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i
    ');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});} -function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();} -var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}} -$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();} -if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}} -function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}} -if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}} -_enable_keyboard_navigation();} -function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});} -function _disable_keyboard_navigation(){$(document).unbind();} -function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;} -key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();} -if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}} -if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}} -function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];} -if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}} -function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});} -function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;} -var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;} -windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;} -if(yScroll35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.2N.3g=6(4){4=23.2H({2B:\'#34\',2g:0.8,1d:F,1M:\'18/5-33-Y.16\',1v:\'18/5-1u-2Q.16\',1E:\'18/5-1u-2L.16\',1W:\'18/5-1u-2I.16\',19:\'18/5-2F.16\',1f:10,2A:3d,2s:\'1j\',2o:\'32\',2j:\'c\',2f:\'p\',2d:\'n\',h:[],9:0},4);f I=N;6 20(){1X(N,I);u F}6 1X(1e,I){$(\'1U, 1S, 1R\').l({\'1Q\':\'2E\'});1O();4.h.B=0;4.9=0;7(I.B==1){4.h.1J(v 1m(1e.17(\'J\'),1e.17(\'2v\')))}j{36(f i=0;i<1w g="5-b"><1w W="\'+4.1M+\'"><1i g="5-b-A-1t"><1i g="5-b-A-1g"><1w W="\'+4.1W+\'">\');f z=1D();$(\'#q-13\').l({2K:4.2B,2J:4.2g,S:z[0],P:z[1]}).1V();f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]}).E();$(\'#q-13,#q-5\').C(6(){1a()});$(\'#5-Y-29,#5-1s-22\').C(6(){1a();u F});$(G).2G(6(){f z=1D();$(\'#q-13\').l({S:z[0],P:z[1]});f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]})})}6 D(){$(\'#5-Y\').E();7(4.1d){$(\'#5-b,#5-s-b-T-w,#5-b-A-1g\').1b()}j{$(\'#5-b,#5-k,#5-k-V,#5-k-X,#5-s-b-T-w,#5-b-A-1g\').1b()}f Q=v 1j();Q.1P=6(){$(\'#5-b\').2D(\'W\',4.h[4.9][0]);1N(Q.S,Q.P);Q.1P=6(){}};Q.W=4.h[4.9][0]};6 1N(1o,1r){f 1L=$(\'#5-s-b-w\').S();f 1K=$(\'#5-s-b-w\').P();f 1n=(1o+(4.1f*2));f 1y=(1r+(4.1f*2));f 1I=1L-1n;f 2z=1K-1y;$(\'#5-s-b-w\').3f({S:1n,P:1y},4.2A,6(){2y()});7((1I==0)&&(2z==0)){7($.3e.3c){1H(3b)}j{1H(3a)}}$(\'#5-s-b-T-w\').l({S:1o});$(\'#5-k-V,#5-k-X\').l({P:1r+(4.1f*2)})};6 2y(){$(\'#5-Y\').1b();$(\'#5-b\').1V(6(){2u();2t()});2r()};6 2u(){$(\'#5-s-b-T-w\').38(\'35\');$(\'#5-b-A-1t\').1b();7(4.h[4.9][1]){$(\'#5-b-A-1t\').2p(4.h[4.9][1]).E()}7(4.h.B>1){$(\'#5-b-A-1g\').2p(4.2s+\' \'+(4.9+1)+\' \'+4.2o+\' \'+4.h.B).E()}}6 2t(){$(\'#5-k\').E();$(\'#5-k-V,#5-k-X\').l({\'K\':\'1C M(\'+4.19+\') L-O\'});7(4.9!=0){7(4.1d){$(\'#5-k-V\').l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9-1;D();u F})}j{$(\'#5-k-V\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9-1;D();u F})}}7(4.9!=(4.h.B-1)){7(4.1d){$(\'#5-k-X\').l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9+1;D();u F})}j{$(\'#5-k-X\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9+1;D();u F})}}2k()}6 2k(){$(d).30(6(12){2i(12)})}6 1G(){$(d).11()}6 2i(12){7(12==2h){U=2Z.2e;1x=27}j{U=12.2e;1x=12.2Y}14=2X.2W(U).2U();7((14==4.2j)||(14==\'x\')||(U==1x)){1a()}7((14==4.2f)||(U==37)){7(4.9!=0){4.9=4.9-1;D();1G()}}7((14==4.2d)||(U==39)){7(4.9!=(4.h.B-1)){4.9=4.9+1;D();1G()}}}6 2r(){7((4.h.B-1)>4.9){2c=v 1j();2c.W=4.h[4.9+1][0]}7(4.9>0){2b=v 1j();2b.W=4.h[4.9-1][0]}}6 1a(){$(\'#q-5\').2a();$(\'#q-13\').2T(6(){$(\'#q-13\').2a()});$(\'1U, 1S, 1R\').l({\'1Q\':\'2S\'})}6 1D(){f o,r;7(G.1h&&G.28){o=G.26+G.2R;r=G.1h+G.28}j 7(d.m.25>d.m.24){o=d.m.2P;r=d.m.25}j{o=d.m.2O;r=d.m.24}f y,H;7(Z.1h){7(d.t.1l){y=d.t.1l}j{y=Z.26}H=Z.1h}j 7(d.t&&d.t.1A){y=d.t.1l;H=d.t.1A}j 7(d.m){y=d.m.1l;H=d.m.1A}7(rtheme_info = array( $a->page['htmlhead'] .= <<< EOT - - - - - - - - - - - - - - - - -

    Example

    -

    Click in the image and see the jQuery lightBox plugin in action.

    - - - - \ No newline at end of file diff --git a/view/theme/diabook/lightbox/js/jquery.js b/view/theme/diabook/lightbox/js/jquery.js deleted file mode 100644 index 3747929d8..000000000 --- a/view/theme/diabook/lightbox/js/jquery.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * jQuery 1.2.3 - New Wave Javascript - * - * Copyright (c) 2008 John Resig (jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $ - * $Rev: 4663 $ - */ -(function(){if(window.jQuery)var _jQuery=window.jQuery;var jQuery=window.jQuery=function(selector,context){return new jQuery.prototype.init(selector,context);};if(window.$)var _$=window.$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;var isSimple=/^.[^:#\[\.]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}else if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem)if(elem.id!=match[3])return jQuery().find(selector);else{this[0]=elem;this.length=1;return this;}else -selector=[];}}else -return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.3",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;this.each(function(i){if(this==elem)ret=i;});return ret;},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],name)||undefined;else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else -return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else -selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return!selector?this:this.pushStack(jQuery.merge(this.get(),selector.constructor==String?jQuery(selector).get():selector.length!=undefined&&(!selector.nodeName||jQuery.nodeName(selector,"form"))?selector:[selector]));},is:function(selector){return selector?jQuery.multiFilter(selector,this).length>0:false;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=value.constructor==Array?value:[value];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else -this.value=value;});},html:function(value){return value==undefined?(this.length?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value==null){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data==undefined&&this.length)data=jQuery.data(this[0],key);return data==null&&parts[1]?this.data(parts[0]):data;}else -return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);}else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.prototype.init.prototype=jQuery.prototype;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else -jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==1){target=this;i=0;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else -jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret;function color(elem){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=elem.style.outline;elem.style.outline="0 solid black";elem.style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&elem.style&&elem.style[name])ret=elem.style[name];else if(document.defaultView&&document.defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var getComputedStyle=document.defaultView.getComputedStyle(elem,null);if(getComputedStyle&&!color(elem))ret=getComputedStyle.getPropertyValue(name);else{var swap=[],stack=[];for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(var i=0;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
    ","
    "]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else -ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,""+value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(typeof array!="array")for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval!=undefined)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(arguments.callee.elem,arguments);return val;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else -for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data||[]);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event)data.unshift(this.fix({type:type,target:elem}));data[0].type=type;if(exclusive)data[0].exclusive=true;if(jQuery.isFunction(jQuery.data(elem,"handle")))val=jQuery.data(elem,"handle").apply(elem,data);if(!fn&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var handlers=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in handlers){var handler=handlers[j];args[0].handler=handler;args[0].data=handler.data;if(!parts[1]&&!event.exclusive||handler.type==parts[1]){var ret=handler.apply(this,args);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=originalEvent.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);return undefined;},toggle:function(){var args=arguments;return this.click(function(event){this.lastToggle=0==this.lastToggle?1:0;event.preventDefault();return args[this.lastToggle].apply(this,arguments)||false;});},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else -jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
    ").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){var jsonp,jsre=/=\?(&|$)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get"){var ts=(new Date()).getTime();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if((!s.url.indexOf("http")||!s.url.indexOf("//"))&&s.dataType=="script"&&s.type.toLowerCase()=="get"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async,s.username,s.password);try{if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");xml.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else -jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xml;},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||r.status==1223||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else -for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else -s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else -e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(!elem)return undefined;type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),fixed=jQuery.css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&jQuery.css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||jQuery.css(offsetChild,"position")=="absolute"))||(mozilla&&jQuery.css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}return results;};})(); \ No newline at end of file diff --git a/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.js b/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.js deleted file mode 100644 index eef6425e0..000000000 --- a/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.js +++ /dev/null @@ -1,472 +0,0 @@ -/** - * jQuery lightBox plugin - * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) - * and adapted to me for use like a plugin from jQuery. - * @name jquery-lightbox-0.5.js - * @author Leandro Vieira Pinho - http://leandrovieira.com - * @version 0.5 - * @date April 11, 2008 - * @category jQuery plugin - * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) - * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US - * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin - */ - -// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias -(function($) { - /** - * $ is an alias to jQuery object - * - */ - $.fn.lightBox = function(settings) { - // Settings to configure the jQuery lightBox plugin how you like - settings = jQuery.extend({ - // Configuration related to overlay - overlayBgColor: '#000', // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color. - overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9 - // Configuration related to navigation - fixedNavigation: false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface. - // Configuration related to images - imageLoading: 'images/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon - imageBtnPrev: 'images/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image - imageBtnNext: 'images/lightbox-btn-next.gif', // (string) Path and the name of the next button image - imageBtnClose: 'images/lightbox-btn-close.gif', // (string) Path and the name of the close btn - imageBlank: 'images/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel) - // Configuration related to container image box - containerBorderSize: 10, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value - containerResizeSpeed: 400, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default. - // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts. - txtImage: 'Image', // (string) Specify text "Image" - txtOf: 'of', // (string) Specify text "of" - // Configuration related to keyboard navigation - keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to. - keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image - keyToNext: 'n', // (string) (n = next) Letter to show the next image. - // Don´t alter these variables in any way - imageArray: [], - activeImage: 0 - },settings); - // Caching the jQuery object with all elements matched - var jQueryMatchedObj = this; // This, in this context, refer to jQuery object - /** - * Initializing the plugin calling the start function - * - * @return boolean false - */ - function _initialize() { - _start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked - return false; // Avoid the browser following the link - } - /** - * Start the jQuery lightBox plugin - * - * @param object objClicked The object (link) whick the user have clicked - * @param object jQueryMatchedObj The jQuery object with all elements matched - */ - function _start(objClicked,jQueryMatchedObj) { - // Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay. - $('embed, object, select').css({ 'visibility' : 'hidden' }); - // Call the function to create the markup structure; style some elements; assign events in some elements. - _set_interface(); - // Unset total images in imageArray - settings.imageArray.length = 0; - // Unset image active information - settings.activeImage = 0; - // We have an image set? Or just an image? Let´s see it. - if ( jQueryMatchedObj.length == 1 ) { - settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title'))); - } else { - // Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references - for ( var i = 0; i < jQueryMatchedObj.length; i++ ) { - settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title'))); - } - } - while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) { - settings.activeImage++; - } - // Call the function that prepares image exibition - _set_image_to_view(); - } - /** - * Create the jQuery lightBox plugin interface - * - * The HTML markup will be like that: -
    -
    - - -
    - * - */ - function _set_interface() { - // Apply the HTML markup into body tag - $('body').append('
    '); - // Get page sizes - var arrPageSizes = ___getPageSize(); - // Style overlay and show it - $('#jquery-overlay').css({ - backgroundColor: settings.overlayBgColor, - opacity: settings.overlayOpacity, - width: arrPageSizes[0], - height: arrPageSizes[1] - }).fadeIn(); - // Get page scroll - var arrPageScroll = ___getPageScroll(); - // Calculate top and left offset for the jquery-lightbox div object and show it - $('#jquery-lightbox').css({ - top: arrPageScroll[1] + (arrPageSizes[3] / 10), - left: arrPageScroll[0] - }).show(); - // Assigning click events in elements to close overlay - $('#jquery-overlay,#jquery-lightbox').click(function() { - _finish(); - }); - // Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects - $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() { - _finish(); - return false; - }); - // If window was resized, calculate the new overlay dimensions - $(window).resize(function() { - // Get page sizes - var arrPageSizes = ___getPageSize(); - // Style overlay and show it - $('#jquery-overlay').css({ - width: arrPageSizes[0], - height: arrPageSizes[1] - }); - // Get page scroll - var arrPageScroll = ___getPageScroll(); - // Calculate top and left offset for the jquery-lightbox div object and show it - $('#jquery-lightbox').css({ - top: arrPageScroll[1] + (arrPageSizes[3] / 10), - left: arrPageScroll[0] - }); - }); - } - /** - * Prepares image exibition; doing a image´s preloader to calculate it´s size - * - */ - function _set_image_to_view() { // show the loading - // Show the loading - $('#lightbox-loading').show(); - if ( settings.fixedNavigation ) { - $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide(); - } else { - // Hide some elements - $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide(); - } - // Image preload process - var objImagePreloader = new Image(); - objImagePreloader.onload = function() { - $('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]); - // Perfomance an effect in the image container resizing it - _resize_container_image_box(objImagePreloader.width,objImagePreloader.height); - // clear onLoad, IE behaves irratically with animated gifs otherwise - objImagePreloader.onload=function(){}; - }; - objImagePreloader.src = settings.imageArray[settings.activeImage][0]; - }; - /** - * Perfomance an effect in the image container resizing it - * - * @param integer intImageWidth The image´s width that will be showed - * @param integer intImageHeight The image´s height that will be showed - */ - function _resize_container_image_box(intImageWidth,intImageHeight) { - // Get current width and height - var intCurrentWidth = $('#lightbox-container-image-box').width(); - var intCurrentHeight = $('#lightbox-container-image-box').height(); - // Get the width and height of the selected image plus the padding - var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value - var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value - // Diferences - var intDiffW = intCurrentWidth - intWidth; - var intDiffH = intCurrentHeight - intHeight; - // Perfomance the effect - $('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); }); - if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) { - if ( $.browser.msie ) { - ___pause(250); - } else { - ___pause(100); - } - } - $('#lightbox-container-image-data-box').css({ width: intImageWidth }); - $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) }); - }; - /** - * Show the prepared image - * - */ - function _show_image() { - $('#lightbox-loading').hide(); - $('#lightbox-image').fadeIn(function() { - _show_image_data(); - _set_navigation(); - }); - _preload_neighbor_images(); - }; - /** - * Show the image information - * - */ - function _show_image_data() { - $('#lightbox-container-image-data-box').slideDown('fast'); - $('#lightbox-image-details-caption').hide(); - if ( settings.imageArray[settings.activeImage][1] ) { - $('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show(); - } - // If we have a image set, display 'Image X of X' - if ( settings.imageArray.length > 1 ) { - $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show(); - } - } - /** - * Display the button navigations - * - */ - function _set_navigation() { - $('#lightbox-nav').show(); - - // Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just. - $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); - - // Show the prev button, if not the first image in set - if ( settings.activeImage != 0 ) { - if ( settings.fixedNavigation ) { - $('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' }) - .unbind() - .bind('click',function() { - settings.activeImage = settings.activeImage - 1; - _set_image_to_view(); - return false; - }); - } else { - // Show the images button for Next buttons - $('#lightbox-nav-btnPrev').unbind().hover(function() { - $(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' }); - },function() { - $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); - }).show().bind('click',function() { - settings.activeImage = settings.activeImage - 1; - _set_image_to_view(); - return false; - }); - } - } - - // Show the next button, if not the last image in set - if ( settings.activeImage != ( settings.imageArray.length -1 ) ) { - if ( settings.fixedNavigation ) { - $('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' }) - .unbind() - .bind('click',function() { - settings.activeImage = settings.activeImage + 1; - _set_image_to_view(); - return false; - }); - } else { - // Show the images button for Next buttons - $('#lightbox-nav-btnNext').unbind().hover(function() { - $(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' }); - },function() { - $(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' }); - }).show().bind('click',function() { - settings.activeImage = settings.activeImage + 1; - _set_image_to_view(); - return false; - }); - } - } - // Enable keyboard navigation - _enable_keyboard_navigation(); - } - /** - * Enable a support to keyboard navigation - * - */ - function _enable_keyboard_navigation() { - $(document).keydown(function(objEvent) { - _keyboard_action(objEvent); - }); - } - /** - * Disable the support to keyboard navigation - * - */ - function _disable_keyboard_navigation() { - $(document).unbind(); - } - /** - * Perform the keyboard actions - * - */ - function _keyboard_action(objEvent) { - // To ie - if ( objEvent == null ) { - keycode = event.keyCode; - escapeKey = 27; - // To Mozilla - } else { - keycode = objEvent.keyCode; - escapeKey = objEvent.DOM_VK_ESCAPE; - } - // Get the key in lower case form - key = String.fromCharCode(keycode).toLowerCase(); - // Verify the keys to close the ligthBox - if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) { - _finish(); - } - // Verify the key to show the previous image - if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) { - // If we´re not showing the first image, call the previous - if ( settings.activeImage != 0 ) { - settings.activeImage = settings.activeImage - 1; - _set_image_to_view(); - _disable_keyboard_navigation(); - } - } - // Verify the key to show the next image - if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) { - // If we´re not showing the last image, call the next - if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) { - settings.activeImage = settings.activeImage + 1; - _set_image_to_view(); - _disable_keyboard_navigation(); - } - } - } - /** - * Preload prev and next images being showed - * - */ - function _preload_neighbor_images() { - if ( (settings.imageArray.length -1) > settings.activeImage ) { - objNext = new Image(); - objNext.src = settings.imageArray[settings.activeImage + 1][0]; - } - if ( settings.activeImage > 0 ) { - objPrev = new Image(); - objPrev.src = settings.imageArray[settings.activeImage -1][0]; - } - } - /** - * Remove jQuery lightBox plugin HTML markup - * - */ - function _finish() { - $('#jquery-lightbox').remove(); - $('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); }); - // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay. - $('embed, object, select').css({ 'visibility' : 'visible' }); - } - /** - / THIRD FUNCTION - * getPageSize() by quirksmode.com - * - * @return Array Return an array with page width, height and window width, height - */ - function ___getPageSize() { - var xScroll, yScroll; - if (window.innerHeight && window.scrollMaxY) { - xScroll = window.innerWidth + window.scrollMaxX; - yScroll = window.innerHeight + window.scrollMaxY; - } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac - xScroll = document.body.scrollWidth; - yScroll = document.body.scrollHeight; - } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari - xScroll = document.body.offsetWidth; - yScroll = document.body.offsetHeight; - } - var windowWidth, windowHeight; - if (self.innerHeight) { // all except Explorer - if(document.documentElement.clientWidth){ - windowWidth = document.documentElement.clientWidth; - } else { - windowWidth = self.innerWidth; - } - windowHeight = self.innerHeight; - } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode - windowWidth = document.documentElement.clientWidth; - windowHeight = document.documentElement.clientHeight; - } else if (document.body) { // other Explorers - windowWidth = document.body.clientWidth; - windowHeight = document.body.clientHeight; - } - // for small pages with total height less then height of the viewport - if(yScroll < windowHeight){ - pageHeight = windowHeight; - } else { - pageHeight = yScroll; - } - // for small pages with total width less then width of the viewport - if(xScroll < windowWidth){ - pageWidth = xScroll; - } else { - pageWidth = windowWidth; - } - arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); - return arrayPageSize; - }; - /** - / THIRD FUNCTION - * getPageScroll() by quirksmode.com - * - * @return Array Return an array with x,y page scroll values. - */ - function ___getPageScroll() { - var xScroll, yScroll; - if (self.pageYOffset) { - yScroll = self.pageYOffset; - xScroll = self.pageXOffset; - } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict - yScroll = document.documentElement.scrollTop; - xScroll = document.documentElement.scrollLeft; - } else if (document.body) {// all other Explorers - yScroll = document.body.scrollTop; - xScroll = document.body.scrollLeft; - } - arrayPageScroll = new Array(xScroll,yScroll); - return arrayPageScroll; - }; - /** - * Stop the code execution from a escified time in milisecond - * - */ - function ___pause(ms) { - var date = new Date(); - curDate = null; - do { var curDate = new Date(); } - while ( curDate - date < ms); - }; - // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once - return this.unbind('click').click(_initialize); - }; -})(jQuery); // Call and execute the function immediately passing the jQuery object \ No newline at end of file diff --git a/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.min.js b/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.min.js deleted file mode 100644 index 5f13b0bf6..000000000 --- a/view/theme/diabook/lightbox/js/jquery.lightbox-0.5.min.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * jQuery lightBox plugin - * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) - * and adapted to me for use like a plugin from jQuery. - * @name jquery-lightbox-0.5.js - * @author Leandro Vieira Pinho - http://leandrovieira.com - * @version 0.5 - * @date April 11, 2008 - * @category jQuery plugin - * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) - * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US - * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin - */ -(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'images/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',imageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;} -function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i
    ');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});} -function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();} -var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}} -$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();} -if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}} -function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}} -if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}} -_enable_keyboard_navigation();} -function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});} -function _disable_keyboard_navigation(){$(document).unbind();} -function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;} -key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();} -if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}} -if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}} -function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];} -if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}} -function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});} -function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;} -var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;} -windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;} -if(yScroll35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.2N.3g=6(4){4=23.2H({2B:\'#34\',2g:0.8,1d:F,1M:\'18/5-33-Y.16\',1v:\'18/5-1u-2Q.16\',1E:\'18/5-1u-2L.16\',1W:\'18/5-1u-2I.16\',19:\'18/5-2F.16\',1f:10,2A:3d,2s:\'1j\',2o:\'32\',2j:\'c\',2f:\'p\',2d:\'n\',h:[],9:0},4);f I=N;6 20(){1X(N,I);u F}6 1X(1e,I){$(\'1U, 1S, 1R\').l({\'1Q\':\'2E\'});1O();4.h.B=0;4.9=0;7(I.B==1){4.h.1J(v 1m(1e.17(\'J\'),1e.17(\'2v\')))}j{36(f i=0;i<1w g="5-b"><1w W="\'+4.1M+\'"><1i g="5-b-A-1t"><1i g="5-b-A-1g"><1w W="\'+4.1W+\'">\');f z=1D();$(\'#q-13\').l({2K:4.2B,2J:4.2g,S:z[0],P:z[1]}).1V();f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]}).E();$(\'#q-13,#q-5\').C(6(){1a()});$(\'#5-Y-29,#5-1s-22\').C(6(){1a();u F});$(G).2G(6(){f z=1D();$(\'#q-13\').l({S:z[0],P:z[1]});f R=1p();$(\'#q-5\').l({1T:R[1]+(z[3]/10),1c:R[0]})})}6 D(){$(\'#5-Y\').E();7(4.1d){$(\'#5-b,#5-s-b-T-w,#5-b-A-1g\').1b()}j{$(\'#5-b,#5-k,#5-k-V,#5-k-X,#5-s-b-T-w,#5-b-A-1g\').1b()}f Q=v 1j();Q.1P=6(){$(\'#5-b\').2D(\'W\',4.h[4.9][0]);1N(Q.S,Q.P);Q.1P=6(){}};Q.W=4.h[4.9][0]};6 1N(1o,1r){f 1L=$(\'#5-s-b-w\').S();f 1K=$(\'#5-s-b-w\').P();f 1n=(1o+(4.1f*2));f 1y=(1r+(4.1f*2));f 1I=1L-1n;f 2z=1K-1y;$(\'#5-s-b-w\').3f({S:1n,P:1y},4.2A,6(){2y()});7((1I==0)&&(2z==0)){7($.3e.3c){1H(3b)}j{1H(3a)}}$(\'#5-s-b-T-w\').l({S:1o});$(\'#5-k-V,#5-k-X\').l({P:1r+(4.1f*2)})};6 2y(){$(\'#5-Y\').1b();$(\'#5-b\').1V(6(){2u();2t()});2r()};6 2u(){$(\'#5-s-b-T-w\').38(\'35\');$(\'#5-b-A-1t\').1b();7(4.h[4.9][1]){$(\'#5-b-A-1t\').2p(4.h[4.9][1]).E()}7(4.h.B>1){$(\'#5-b-A-1g\').2p(4.2s+\' \'+(4.9+1)+\' \'+4.2o+\' \'+4.h.B).E()}}6 2t(){$(\'#5-k\').E();$(\'#5-k-V,#5-k-X\').l({\'K\':\'1C M(\'+4.19+\') L-O\'});7(4.9!=0){7(4.1d){$(\'#5-k-V\').l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9-1;D();u F})}j{$(\'#5-k-V\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1v+\') 1c 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9-1;D();u F})}}7(4.9!=(4.h.B-1)){7(4.1d){$(\'#5-k-X\').l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'}).11().1k(\'C\',6(){4.9=4.9+1;D();u F})}j{$(\'#5-k-X\').11().2m(6(){$(N).l({\'K\':\'M(\'+4.1E+\') 2l 15% L-O\'})},6(){$(N).l({\'K\':\'1C M(\'+4.19+\') L-O\'})}).E().1k(\'C\',6(){4.9=4.9+1;D();u F})}}2k()}6 2k(){$(d).30(6(12){2i(12)})}6 1G(){$(d).11()}6 2i(12){7(12==2h){U=2Z.2e;1x=27}j{U=12.2e;1x=12.2Y}14=2X.2W(U).2U();7((14==4.2j)||(14==\'x\')||(U==1x)){1a()}7((14==4.2f)||(U==37)){7(4.9!=0){4.9=4.9-1;D();1G()}}7((14==4.2d)||(U==39)){7(4.9!=(4.h.B-1)){4.9=4.9+1;D();1G()}}}6 2r(){7((4.h.B-1)>4.9){2c=v 1j();2c.W=4.h[4.9+1][0]}7(4.9>0){2b=v 1j();2b.W=4.h[4.9-1][0]}}6 1a(){$(\'#q-5\').2a();$(\'#q-13\').2T(6(){$(\'#q-13\').2a()});$(\'1U, 1S, 1R\').l({\'1Q\':\'2S\'})}6 1D(){f o,r;7(G.1h&&G.28){o=G.26+G.2R;r=G.1h+G.28}j 7(d.m.25>d.m.24){o=d.m.2P;r=d.m.25}j{o=d.m.2O;r=d.m.24}f y,H;7(Z.1h){7(d.t.1l){y=d.t.1l}j{y=Z.26}H=Z.1h}j 7(d.t&&d.t.1A){y=d.t.1l;H=d.t.1A}j 7(d.m){y=d.m.1l;H=d.m.1A}7(rtheme_info = array( $a->page['htmlhead'] .= <<< EOT - - - - - +EOT; diff --git a/view/theme/darkzero-NS/theme.php b/view/theme/darkzero-NS/theme.php index 521b1859e..2d3e4fd56 100755 --- a/view/theme/darkzero-NS/theme.php +++ b/view/theme/darkzero-NS/theme.php @@ -15,6 +15,8 @@ $a->page['htmlhead'] .= <<< EOT +EOT; -- cgit v1.2.3 From 5a4167646553e589cf9647c0e0d0446e3f5fd672 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 13 Mar 2012 04:04:26 -0700 Subject: initial tag display for categories and save-to-file - suitable for testing but needs cleanup, links to delete term, and theming. --- include/text.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/text.php b/include/text.php index 011006b76..2663bdeba 100644 --- a/include/text.php +++ b/include/text.php @@ -913,6 +913,33 @@ function prepare_body($item,$attach = false) { } $s .= '
    '; } + $matches = false; + $cnt = preg_match_all('/<(.*?)>/',$item['file'],$matches,PREG_SET_ORDER); + if($cnt) { + logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG); + foreach($matches as $mtch) { + if(strlen($x)) + $x .= ','; + $x .= file_tag_decode($mtch[1]); + } + if(strlen($x)) + $s .= '
    ' . t('Categories:') . ' ' . $x . '
    '; + + + } + $matches = false; + $x = ''; + $cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER); + if($cnt) { + logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG); + foreach($matches as $mtch) { + if(strlen($x)) + $x .= ','; + $x .= file_tag_decode($mtch[1]); + } + if(strlen($x) && (local_user() == $item['uid'])) + $s .= '
    ' . t('Filed under:') . ' ' . $x . '
    '; + } $prep_arr = array('item' => $item, 'html' => $s); -- cgit v1.2.3 From 7868e3897b0f282611f1ccb1715a30a93404ddc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Tue, 13 Mar 2012 21:46:57 +0000 Subject: In HTML2BBCode: fetch the URL of [EMBED] using JavaScript instead of an ajax-call to a php-script. Once there actually is embedded Code in the HTML, this function is called after every single keypress. Not only is making an ajax-call every keypress bandith intensive - it also made typing hard / slow. Making a lot of JavaScript-RegExp-Computation every keypress isn't exactly great either, but still performs better. --- .../tiny_mce/plugins/bbcode/editor_plugin_src.js | 262 +++++++++++---------- 1 file changed, 140 insertions(+), 122 deletions(-) diff --git a/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js index 44d1473a9..183f2bc68 100755 --- a/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -44,61 +44,79 @@ _dfrn_html2bbcode : function(s) { s = tinymce.trim(s); - function rep(re, str) { - - //modify code to keep stuff intact within [code][/code] blocks - //Waitman Gobble NO WARRANTY - - - var o = new Array(); - var x = s.split("[code]"); - var i = 0; - - var si = ""; - si = x.shift(); - si = si.replace(re,str); - o.push(si); - - for (i = 0; i < x.length; i++) { - var no = new Array(); - var j = x.shift(); - var g = j.split("[/code]"); - no.push(g.shift()); - si = g.shift(); - si = si.replace(re,str); - no.push(si); - o.push(no.join("[/code]")); - } - - s = o.join("[code]"); - - }; - - - - - /* oembed */ - function _h2b_cb(match) { - function s_h2b(data) { - match = data; + function rep(re, str) { + + //modify code to keep stuff intact within [code][/code] blocks + //Waitman Gobble NO WARRANTY + + + var o = new Array(); + var x = s.split("[code]"); + var i = 0; + + var si = ""; + si = x.shift(); + si = si.replace(re,str); + o.push(si); + + for (i = 0; i < x.length; i++) { + var no = new Array(); + var j = x.shift(); + var g = j.split("[/code]"); + no.push(g.shift()); + si = g.shift(); + si = si.replace(re,str); + no.push(si); + o.push(no.join("[/code]")); + } + + s = o.join("[code]"); + + }; + + + + + /* oembed */ + function _h2b_cb(match) { + /* + function s_h2b(data) { + match = data; } $.ajax({ - type:"POST", + type:"POST", url: 'oembed/h2b', - data: {text: match}, - async: false, - success: s_h2b, - dataType: 'html' - }); - return match; - } + data: {text: match}, + async: false, + success: s_h2b, + dataType: 'html' + }); + */ + + var f, g, tof = [], tor = []; + var find_spanc = /]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:]*>(.*?)<\/span *>)*.*?)<\/span *>/ig; + while (f = find_spanc.exec(match)) { + var find_a = /]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig; + if (g = find_a.exec(f[1])) { + var find_href = /href=[\"']([^\"']*)[\"']/ig; + var m2 = find_href.exec(g[1]); + if (m2[1]) { + tof.push(f[0]); + tor.push("[EMBED]" + m2[1] + "[/EMBED]"); + } + } + } + for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]); + + return match; + } if (s.indexOf('class="oembed')>=0){ //alert("request oembed html2bbcode"); s = _h2b_cb(s); } - - /* /oembed */ - + + /* /oembed */ + // example: to [b] rep(/(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]"); @@ -111,16 +129,16 @@ rep(//gi,"[img=$3x$2]$1[/img]"); rep(//gi,"[img=$2x$3]$1[/img]"); rep(//gi,"[img]$1[/img]"); - - rep(/
      (.*?)<\/ul>/gi,"[list]$1[/list]"); - rep(/
        (.*?)<\/ul>/gi,"[list=]$1[/list]"); - rep(/
          (.*?)<\/ul>/gi,"[list=1]$1[/list]"); - rep(/
            (.*?)<\/ul>/gi,"[list=i]$1[/list]"); - rep(/
              (.*?)<\/ul>/gi,"[list=I]$1[/list]"); - rep(/
                (.*?)<\/ul>/gi,"[list=a]$1[/list]"); - rep(/
                  (.*?)<\/ul>/gi,"[list=A]$1[/list]"); - rep(/
                • (.*?)<\/li>/gi,'[li]$1[/li]'); - + + rep(/
                    (.*?)<\/ul>/gi,"[list]$1[/list]"); + rep(/
                      (.*?)<\/ul>/gi,"[list=]$1[/list]"); + rep(/
                        (.*?)<\/ul>/gi,"[list=1]$1[/list]"); + rep(/
                          (.*?)<\/ul>/gi,"[list=i]$1[/list]"); + rep(/
                            (.*?)<\/ul>/gi,"[list=I]$1[/list]"); + rep(/ +$invite_desc +

                            +

                            $desc

                            -- cgit v1.2.3 From db80ffa0ff0cf796eddede0ab439ffbd0c4e66a3 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 13 Mar 2012 16:02:20 -0700 Subject: don't count self in number of contatcs --- mod/contacts.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mod/contacts.php b/mod/contacts.php index 001bf12af..38ca570dd 100755 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -445,7 +445,7 @@ function contacts_content(&$a) { $r = q("SELECT COUNT(*) AS `total` FROM `contact` - WHERE `uid` = %d AND `pending` = 0 $sql_extra $sql_extra2 ", + WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ", intval($_SESSION['uid'])); if(count($r)) { $a->set_pager_total($r[0]['total']); @@ -454,7 +454,7 @@ function contacts_content(&$a) { - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `pending` = 0 $sql_extra $sql_extra2 ORDER BY `name` ASC LIMIT %d , %d ", + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ORDER BY `name` ASC LIMIT %d , %d ", intval($_SESSION['uid']), intval($a->pager['start']), intval($a->pager['itemspage']) @@ -465,8 +465,6 @@ function contacts_content(&$a) { if(count($r)) { foreach($r as $rr) { - if($rr['self']) - continue; switch($rr['rel']) { case CONTACT_IS_FRIEND: -- cgit v1.2.3 From be48fff1570aa1d04e049a6fd1665f4fc9634a62 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 13 Mar 2012 18:13:03 -0700 Subject: file as widget and basic filing implementation for duepuntozero,slackr much more work needed - this is just for test/evaluation currently --- include/contact_widgets.php | 29 +++++++++++++++++++++++++++++ include/conversation.php | 2 ++ include/text.php | 2 +- mod/filer.php | 23 +++++++++++++++++++++++ mod/network.php | 1 + view/fileas_widget.tpl | 12 ++++++++++++ view/jot-header.tpl | 12 ++++++++++++ view/theme/duepuntozero/file.gif | Bin 0 -> 615 bytes view/theme/duepuntozero/style.css | 23 ++++++++++++++++++++--- view/theme/duepuntozero/wall_item.tpl | 1 + view/theme/greenzero/file.gif | Bin 0 -> 614 bytes 11 files changed, 101 insertions(+), 4 deletions(-) create mode 100755 mod/filer.php create mode 100755 view/fileas_widget.tpl create mode 100644 view/theme/duepuntozero/file.gif create mode 100644 view/theme/greenzero/file.gif diff --git a/include/contact_widgets.php b/include/contact_widgets.php index caa0572d2..605a3eb78 100755 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -75,4 +75,33 @@ function networks_widget($baseurl,$selected = '') { )); } +function fileas_widget($baseurl,$selected = '') { + $a = get_app(); + if(! local_user()) + return ''; + + $saved = get_pconfig(local_user(),'system','filetags'); + if(! strlen($saved)) + return; + + $matches = false; + $terms = array(); + $cnt = preg_match_all('/\[(.*?)\]/',$saved,$matches,PREG_SET_ORDER); + if($cnt) { + foreach($matches as $mtch) { + $unescaped = file_tag_decode($mtch[1]); + $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : '')); + } + } + + return replace_macros(get_markup_template('fileas_widget.tpl'),array( + '$title' => t('File Selections'), + '$desc' => '', + '$sel_all' => (($selected == '') ? 'selected' : ''), + '$all' => t('Everything'), + '$terms' => $terms, + '$base' => $baseurl, + + )); +} diff --git a/include/conversation.php b/include/conversation.php index 4b2ca316b..a420e9923 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -572,6 +572,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { 'classundo' => (($item['starred']) ? "" : "hidden"), 'starred' => t('starred'), 'tagger' => t("add tag"), + 'filer' => t("file as"), 'classtagger' => "", ); } @@ -874,6 +875,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { '$vidurl' => t("Please enter a video link/URL:"), '$audurl' => t("Please enter an audio link/URL:"), '$term' => t('Tag term:'), + '$fileas' => t('File as:'), '$whereareu' => t('Where are you right now?'), '$title' => t('Enter a title for this item') )); diff --git a/include/text.php b/include/text.php index 2663bdeba..c44b4d178 100644 --- a/include/text.php +++ b/include/text.php @@ -1294,7 +1294,7 @@ function file_tag_save_file($uid,$item,$file) { if(count($r)) { if(! stristr($r[0]['file'],'[' . file_tag_encode($file) . ']')) q("update item set file = '%s' where id = %d and uid = %d limit 1", - dbesc($r[0]['file'] . '[' . $file_tag_encode($file) . ']'), + dbesc($r[0]['file'] . '[' . file_tag_encode($file) . ']'), intval($item), intval($uid) ); diff --git a/mod/filer.php b/mod/filer.php new file mode 100755 index 000000000..a9e213536 --- /dev/null +++ b/mod/filer.php @@ -0,0 +1,23 @@ +argc > 1) ? notags(trim($a->argv[1])) : 0); + + logger('filer: tag ' . $term . ' item ' . $item_id); + + if($item_id && strlen($term)) + file_tag_save_file(local_user(),$item_id,$term); + + killme(); +} diff --git a/mod/network.php b/mod/network.php index 7e7a95841..4f58fc4fb 100755 --- a/mod/network.php +++ b/mod/network.php @@ -46,6 +46,7 @@ function network_init(&$a) { $a->page['aside'] .= group_side('network','network',true,$group_id); $a->page['aside'] .= networks_widget($a->get_baseurl() . '/network',(x($_GET, 'nets') ? $_GET['nets'] : '')); $a->page['aside'] .= saved_searches($search); + $a->page['aside'] .= fileas_widget($a->get_baseurl() . '/network',(x($_GET, 'file') ? $_GET['file'] : '')); } diff --git a/view/fileas_widget.tpl b/view/fileas_widget.tpl new file mode 100755 index 000000000..54fba7435 --- /dev/null +++ b/view/fileas_widget.tpl @@ -0,0 +1,12 @@ +
                            +

                            $title

                            +
                            $desc
                            + + + +
                            diff --git a/view/jot-header.tpl b/view/jot-header.tpl index d6b172b6a..88df73494 100755 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -262,6 +262,18 @@ function enableOnUser(){ } } + function itemFiler(id) { + reply = prompt("$fileas"); + if(reply && reply.length) { + commentBusy = true; + $('body').css('cursor', 'wait'); + $.get('filer/' + id + '?term=' + reply); + if(timer) clearTimeout(timer); + timer = setTimeout(NavUpdate,3000); + liking = 1; + } + } + function jotClearLocation() { $('#jot-coord').val(''); $('#profile-nolocation-wrapper').hide(); diff --git a/view/theme/duepuntozero/file.gif b/view/theme/duepuntozero/file.gif new file mode 100644 index 000000000..7885b998d Binary files /dev/null and b/view/theme/duepuntozero/file.gif differ diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index acd97eb94..10ddb0090 100755 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -309,7 +309,7 @@ div.wall-item-content-wrapper.shiny { margin-bottom: 10px; } -.group-selected, .nets-selected { +.group-selected, .nets-selected, .fileas-selected { padding: 3px; -moz-border-radius: 3px; border-radius: 3px; @@ -1024,6 +1024,10 @@ input#dfrn-url { float: left; } +.filer-item { + margin-left: 10px; + float: left; +} .wall-item-links-wrapper { float: left; @@ -1864,11 +1868,11 @@ a.mail-list-link { margin-top: 10px; } -.nets-ul { +.nets-ul, .fileas-ul { list-style-type: none; } -.nets-ul li { +.nets-ul li, .fileas-ul li { margin-top: 10px; } @@ -1879,6 +1883,14 @@ a.mail-list-link { margin-left: 42px; } +.fileas-link { + margin-left: 24px; +} + +.fileas-all { + margin-left: 0px; +} + #search-save { margin-left: 5px; } @@ -2902,6 +2914,11 @@ aside input[type='text'] { .tagged { background-position: -48px -48px; } +.filer-icon { + display: block; width: 16px; height: 16px; + background-image: url('file.gif'); +} + .icon.dim { opacity: 0.3;filter:alpha(opacity=30); } .attachtype { diff --git a/view/theme/duepuntozero/wall_item.tpl b/view/theme/duepuntozero/wall_item.tpl index 51e36b6f4..2c88fc598 100755 --- a/view/theme/duepuntozero/wall_item.tpl +++ b/view/theme/duepuntozero/wall_item.tpl @@ -56,6 +56,7 @@ {{ if $item.star }} + {{ endif }}
                            diff --git a/view/theme/greenzero/file.gif b/view/theme/greenzero/file.gif new file mode 100644 index 000000000..e388a13c0 Binary files /dev/null and b/view/theme/greenzero/file.gif differ -- cgit v1.2.3 From de017d1ed76500c01fd11c8e1d36cf4ebd70172d Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 13 Mar 2012 19:27:52 -0700 Subject: sort inbox by recently replied conversations first --- mod/message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/message.php b/mod/message.php index 37f92e8d9..65f692f3d 100755 --- a/mod/message.php +++ b/mod/message.php @@ -194,7 +194,7 @@ function message_content(&$a) { $r = q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`, `mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` , `contact`.`network` FROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id` - WHERE `mail`.`uid` = %d AND `from-url` $eq '%s' GROUP BY `parent-uri` ORDER BY `created` DESC LIMIT %d , %d ", + WHERE `mail`.`uid` = %d AND `from-url` $eq '%s' GROUP BY `parent-uri` ORDER BY `mailcreated` DESC LIMIT %d , %d ", intval(local_user()), dbesc($myprofile), intval($a->pager['start']), -- cgit v1.2.3 From 1ae740535d8a5b455395d51c01adef74e9dbb1ae Mon Sep 17 00:00:00 2001 From: Tony Baldwin Date: Tue, 13 Mar 2012 23:05:04 -0400 Subject: added slack-NS, non-scrolly, slackr-based theme. --- view/theme/slack-NS/style.css | 51 +++++++++++++++++++++++++++++++++++++++++++ view/theme/slack-NS/theme.php | 51 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100755 view/theme/slack-NS/style.css create mode 100755 view/theme/slack-NS/theme.php diff --git a/view/theme/slack-NS/style.css b/view/theme/slack-NS/style.css new file mode 100755 index 000000000..82bceeac8 --- /dev/null +++ b/view/theme/slack-NS/style.css @@ -0,0 +1,51 @@ +@import url('../duepuntozero/style.css'); + +.wall-item-content-wrapper { + border: none; +} + +.wall-item-content-wrapper.comment { + background: #ffffff !important; + border-left: 1px solid #EEE; +} + +.wall-item-tools { + background: none; +} + +.wall-item-content { + max-height: 20000px; + overflow: none; +} + +.comment-edit-text-empty, .comment-edit-text-full { + border: none; + border-left: 1px solid #EEE; + background: #EEEEEE; +} + +.comment-edit-wrapper, .comment-wwedit-wrapper { + background: #ffffff !important; +} + +section { + margin: 0px 32px; +} + +aside { + margin-left: 32px; +} +nav { + margin-left: 32px; + margin-right: 32px; +} + +nav #site-location { + top: 80px; + right: 36px; +} + +.wall-item-photo, .photo, .contact-block-img, .my-comment-photo { + border-radius: 3px; + -moz-border-radius: 3px; +} diff --git a/view/theme/slack-NS/theme.php b/view/theme/slack-NS/theme.php new file mode 100755 index 000000000..ceec4dd97 --- /dev/null +++ b/view/theme/slack-NS/theme.php @@ -0,0 +1,51 @@ +theme_info = array( + 'extends' => 'duepuntozero', +); + +$a->page['htmlhead'] .= <<< EOT + +EOT; -- cgit v1.2.3 From 4972d7ef6ee740f6eb09d8c7efa9a76ee40973c1 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 13 Mar 2012 20:46:37 -0700 Subject: more work on filer, comment level and file tag removal --- include/conversation.php | 34 +++++++++++++++++-------------- include/oembed.php | 5 ++++- include/text.php | 9 ++++---- mod/filerm.php | 21 +++++++++++++++++++ view/theme/duepuntozero/style.css | 4 ++-- view/theme/duepuntozero/wall_item.tpl | 6 ++++-- view/theme/duepuntozero/wallwall_item.tpl | 3 +++ 7 files changed, 58 insertions(+), 24 deletions(-) create mode 100644 mod/filerm.php diff --git a/include/conversation.php b/include/conversation.php index a420e9923..117127a28 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -560,25 +560,28 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { ); $star = false; + $filer = false; + $isstarred = "unstarred"; - if ($profile_owner == local_user() && $toplevelpost) { - $isstarred = (($item['starred']) ? "starred" : "unstarred"); - - $star = array( - 'do' => t("add star"), - 'undo' => t("remove star"), - 'toggle' => t("toggle star status"), - 'classdo' => (($item['starred']) ? "hidden" : ""), - 'classundo' => (($item['starred']) ? "" : "hidden"), - 'starred' => t('starred'), - 'tagger' => t("add tag"), - 'filer' => t("file as"), - 'classtagger' => "", - ); + if ($profile_owner == local_user()) { + if($toplevelpost) { + $isstarred = (($item['starred']) ? "starred" : "unstarred"); + + $star = array( + 'do' => t("add star"), + 'undo' => t("remove star"), + 'toggle' => t("toggle star status"), + 'classdo' => (($item['starred']) ? "hidden" : ""), + 'classundo' => (($item['starred']) ? "" : "hidden"), + 'starred' => t('starred'), + 'tagger' => t("add tag"), + 'classtagger' => "", + ); + } + $filer = t("file as"); } - $photo = $item['photo']; $thumb = $item['thumb']; @@ -672,6 +675,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { 'edpost' => $edpost, 'isstarred' => $isstarred, 'star' => $star, + 'filer' => $filer, 'drop' => $drop, 'vote' => $likebuttons, 'like' => $like, diff --git a/include/oembed.php b/include/oembed.php index 52068efc7..cc71f9757 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -1,6 +1,6 @@ /',$item['file'],$matches,PREG_SET_ORDER); if($cnt) { - logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG); +// logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG); foreach($matches as $mtch) { if(strlen($x)) $x .= ','; @@ -931,11 +932,11 @@ function prepare_body($item,$attach = false) { $x = ''; $cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER); if($cnt) { - logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG); +// logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG); foreach($matches as $mtch) { if(strlen($x)) - $x .= ','; - $x .= file_tag_decode($mtch[1]); + $x .= '   '; + $x .= file_tag_decode($mtch[1]). ' ' . t('[remove]') . ''; } if(strlen($x) && (local_user() == $item['uid'])) $s .= '
                            ' . t('Filed under:') . ' ' . $x . '
                            '; diff --git a/mod/filerm.php b/mod/filerm.php new file mode 100644 index 000000000..66b684dc9 --- /dev/null +++ b/mod/filerm.php @@ -0,0 +1,21 @@ +argc > 1) ? notags(trim($a->argv[1])) : 0); + + logger('filerm: tag ' . $term . ' item ' . $item_id); + + if($item_id && strlen($term)) + file_tag_unsave_file(local_user(),$item_id,$term); + + if(x($_SESSION,'return_url')) + goaway($a->get_baseurl() . '/' . $_SESSION['return_url']); + + killme(); +} diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 10ddb0090..b79b00ef4 100755 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -2615,12 +2615,12 @@ aside input[type='text'] { margin-top: 10px; } -.body-tag { +.body-tag, .filesavetags { opacity: 0.5; filter:alpha(opacity=50); } -.body-tag:hover { +.body-tag:hover, .filesavetags:hover { opacity: 1.0 !important; filter:alpha(opacity=100) !important; } diff --git a/view/theme/duepuntozero/wall_item.tpl b/view/theme/duepuntozero/wall_item.tpl index 2c88fc598..6cb018b7b 100755 --- a/view/theme/duepuntozero/wall_item.tpl +++ b/view/theme/duepuntozero/wall_item.tpl @@ -56,9 +56,11 @@ {{ if $item.star }} - {{ endif }} - + {{ if $item.filer }} + + {{ endif }} +
                            {{ if $item.drop.dropping }}{{ endif }}
                            diff --git a/view/theme/duepuntozero/wallwall_item.tpl b/view/theme/duepuntozero/wallwall_item.tpl index 211906c93..c37bcb4a2 100755 --- a/view/theme/duepuntozero/wallwall_item.tpl +++ b/view/theme/duepuntozero/wallwall_item.tpl @@ -61,6 +61,9 @@ {{ endif }} + {{ if $item.filer }} + + {{ endif }}
                            {{ if $item.drop.dropping }}{{ endif }} -- cgit v1.2.3 From 975781d3e23e6beb2ac86b191c7c12b7347c1705 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Wed, 14 Mar 2012 01:05:08 -0400 Subject: massive work done to both dispys, mostly -dark Signed-off-by: Simon L'nu --- view/theme/dispy-dark/icons.png | Bin 19513 -> 29024 bytes view/theme/dispy-dark/icons.svg | 50 ++++---- view/theme/dispy-dark/nav.tpl | 16 +-- view/theme/dispy-dark/photo_view.tpl | 2 +- view/theme/dispy-dark/profile_vcard.tpl | 10 +- view/theme/dispy-dark/style.css | 207 +++++++++++++++++++------------- view/theme/dispy-dark/theme.php | 46 ++++++- view/theme/dispy/style.css | 3 +- view/theme/dispy/theme.php | 41 ++++++- 9 files changed, 247 insertions(+), 128 deletions(-) diff --git a/view/theme/dispy-dark/icons.png b/view/theme/dispy-dark/icons.png index eb84b8d8e..648811373 100644 Binary files a/view/theme/dispy-dark/icons.png and b/view/theme/dispy-dark/icons.png differ diff --git a/view/theme/dispy-dark/icons.svg b/view/theme/dispy-dark/icons.svg index 05a00d93c..10f8cc667 100644 --- a/view/theme/dispy-dark/icons.svg +++ b/view/theme/dispy-dark/icons.svg @@ -51,9 +51,9 @@ borderopacity="1.0" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:zoom="1.9403009" - inkscape:cx="100.08061" - inkscape:cy="113.21269" + inkscape:zoom="1.3859292" + inkscape:cx="105.02551" + inkscape:cy="107.90767" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -107,7 +107,7 @@ image/svg+xml - + @@ -572,7 +572,7 @@ inkscape:connector-curvature="0" id="rect4428-4" d="m 118.03127,895.15627 0,0.3125 c 0,1.2601 -0.0643,3.4345 -0.35937,5.75 l -1.5625,1e-4 c -0.80183,0.011 -1.64766,4.0737 -1.60938,8.0625 l 8.25,0 c -0.057,-5.5479 1.56902,-11.5211 1.75,-5.6563 0.21453,6.9525 1.74237,-5.1823 1.75,-8.4687 z" - style="fill:none;stroke:#1a1a1a;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> + style="fill:none;stroke:#e6e6e6;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> {{ endif }} -{{ if $userinfo }} - -{{ endif }} - {{ if $nav.contacts }}
                          • $nav.contacts.1
                          • {{ endif }} @@ -94,6 +86,14 @@ works -->
    +{{ if $userinfo }} + +{{ endif }} +
    {{ if $nav.home }} diff --git a/view/theme/dispy-dark/photo_view.tpl b/view/theme/dispy-dark/photo_view.tpl index 4582751c6..f1209ec58 100644 --- a/view/theme/dispy-dark/photo_view.tpl +++ b/view/theme/dispy-dark/photo_view.tpl @@ -17,7 +17,7 @@
    -
    $desc
    +
    $desc
    {{ if $tags }}
    $tags.0
    $tags.1
    diff --git a/view/theme/dispy-dark/profile_vcard.tpl b/view/theme/dispy-dark/profile_vcard.tpl index 0c289d982..5cb567f5a 100644 --- a/view/theme/dispy-dark/profile_vcard.tpl +++ b/view/theme/dispy-dark/profile_vcard.tpl @@ -6,13 +6,17 @@
    $profile.pdesc
    {{ endif }}
    - $profile.name + $profile.name +
    + +
    +
    {{ if $location }}
    $location -
    +
    {{ if $profile.address }}
    $profile.address
    {{ endif }} $profile.zip @@ -20,7 +24,7 @@ $profile.region $profile.postal-code {{ if $profile.country-name }}$profile.country-name{{ endif }} -
    +
    {{ endif }} diff --git a/view/theme/dispy-dark/style.css b/view/theme/dispy-dark/style.css index 7a57628b9..c590042f1 100644 --- a/view/theme/dispy-dark/style.css +++ b/view/theme/dispy-dark/style.css @@ -520,11 +520,13 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify, nav #nav-notifications-link position: fixed; left: 28px; bottom: 6px; + z-index: 10; } #language-selector { position: fixed; bottom: 2px; left: 52px; + z-index: 10; } .menu-popup { position: absolute; @@ -810,6 +812,9 @@ aside #viewcontacts { border-bottom: 0; padding: 5px; } +#profile-jot-net { + margin: 5px 0; +} #jot-preview-link { margin: 0 0 0 10px; border: 0; @@ -831,12 +836,12 @@ aside #viewcontacts { background-color: #555753; height: 22px; width: 20px; - -webkit-border-radius: 5px 0px 0px 5px; - -moz-border-radius: 5px 0px 0px 5px; - border-radius: 5px 0px 0px 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; overflow: hidden; border: 0px; - margin: 0 -4px 0 10px; + margin: 0 10px 0 10px; } #profile-jot-plugin-wrapper { width: 1px; @@ -854,23 +859,21 @@ aside #viewcontacts { height: 22px; background-color: #555753; color: #eeeeec; - -webkit-border-radius: 0 5px 5px 0; - -moz-border-radius: 0 5px 5px 0; - border-radius: 0 5px 5px 0; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; border: 0; margin: 0; float: right; } -#jot-perms-icons { - background-color: #555753; +#jot-perms-icon { height: 22px; width: 20px; - -webkit-border-radius: 0 5px 5px 0; - -moz-border-radius: 0 5px 5px 0; - border-radius: 0 5px 5px 0; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; overflow: hidden; border: 0; - margin: 0 0 0 94.4%; } #profile-jot-acl-wrapper { margin: 0 10px; @@ -916,7 +919,8 @@ aside #viewcontacts { color: #cccccc; } #profile-jot-desc { - color: #a00; + color: #ff2000; + margin: 5px 0; } #jot-title-wrapper { margin-bottom: 5px; @@ -1503,20 +1507,26 @@ div[id$="wrapper"] br { } .mail-list-sender-name { display: inline; + font-size: 1.1em; } .mail-list-date { display: inline; - font-size: 0.8em; + font-size: 0.9em; padding-left: 10px; } +.mail-list-sender-name, .mail-list-date { + font-style: italic; +} .mail-list-subject { - font-size: 1.5em; + font-size: 1.2em; + font-weight: bold; } .mail-list-delete-wrapper { float: right; } .mail-list-outside-wrapper-end { clear: both; + border-bottom: 1px #eec dotted; } .mail-conv-sender { float: left; @@ -1734,11 +1744,21 @@ div[id$="wrapper"] br { margin: 30px 0px; } .profile-edit-side-div { - margin: 5px 2px 0 0; + background: #2e2f2e; + border-radius: 5px 5px 0 0; + width: 175px; + height: 20px; + position: relative; + margin: -25px -30px 0px 0px; + display: none; +} +.profile-edit-side-div:hover { + /*margin: 0px 0px 0px 0px;*/ + display: inline; } .profile-edit-side-link { - margin: 0 20px -18px 0; - float: right; + margin: 0 0px 0px 155px; + /*float: right;*/ } .profile-listing { float: left; @@ -1749,6 +1769,9 @@ div[id$="wrapper"] br { padding: 0; list-style: none; } +.marital { + margin-top: 5px; +} #register-sitename { display: inline; font-weight: bold; @@ -1970,6 +1993,9 @@ div[id$="wrapper"] br { background: #88a9d2; font-weight: bold; } +.group-selected:hover, .nets-selected:hover { + color: #2e2f2e; +} .groupsideedit { margin-right: 10px; } @@ -2115,11 +2141,16 @@ div[id$="wrapper"] br { width: 16px; height: 16px; } #adminpage table tr:hover { - background-color:#bbc7d7; + color: #2e2f2e; + background-color: #eec; } #adminpage .selectall { text-align: right; } +#adminpage #users a { + color: #2e2f2e; + text-decoration: underline; +} /** * Form fields @@ -2397,7 +2428,7 @@ div[id$="wrapper"] br { background-position: -70px -40px; } .unlock { - background-position: -90px -40px; + background-position: -88px -40px; } .video { background-position: -110px -40px; @@ -2481,8 +2512,8 @@ footer { } #profile-jot-text { height: 20px; - color: #666; - border: 1px solid #ccc; + color: #eec; + border: 1px solid #eec; border-radius: 5px; width: 99.5%; } @@ -2493,113 +2524,117 @@ footer { #photos-upload-permissions-wrapper, #profile-jot-acl-wrapper { display: block !important; + background: #2e2f2e; + color: #eec; } #acl-wrapper { - width: 690px; - float: left; + width: 660px; + margin: 0 auto; } #acl-search { float: right; background: #fff url("../../../images/search_18.png") no-repeat right center; padding-right: 20px; + margin: 6px; } #acl-showall { - float:left; - display:block; - width:auto; - height:18px; - background-color:#CCC; - background-image:url("../../../images/show_all_off.png"); - background-position:7px 7px; - background-repeat:no-repeat; - padding:7px 10px 7px 30px; - -webkit-border-radius:5px; - -moz-border-radius:5px; - border-radius:5px; - color:#999; + float: left; + display: block; + width: auto; + height: 18px; + background: #eec url("../../../images/show_all_off.png") 8px 8px no-repeat; + padding: 7px 10px 7px 30px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + color: #999; + margin: 5px 0; } #acl-showall.selected { - color:#000; - background-color:#F90; - background-image:url(../../../images/show_all_on.png); + color: #000; + background: #f90 url(../../../images/show_all_on.png) 8px 8px no-repeat; } #acl-list { - height:210px; - border:1px solid #ccc; - clear:both; - margin-top:30px; - overflow:auto; -} -#acl-list-content { + height: 210px; + border: 1px solid #ccc; + clear: both; + margin-top: 30px; + overflow: auto; } +/*#acl-list-content {*/ +/*}*/ .acl-list-item { - display:block; - width:150px; - height:30px; - border:1px solid #ccc; - margin:5px; - float:left; + border: 1px solid #eec; + display: block; + float: left; + height: 110px; + margin: 3px 0 5px 5px; + width: 120px; } .acl-list-item img { - width:22px; - height:22px; - float:left; - margin:4px; + width: 22px; + height: 22px; + float: left; + margin: 5px 5px 20px; } .acl-list-item p { height: 12px; font-size: 10px; - margin: 0; + margin: 0 0 22px; padding: 2px 0 1px; } .acl-list-item a { - font-size:8px; - display:block; - width:40px; - height:10px; - float:left; - color:#999; - background-color:#CCC; - background-position:3px 3px; - background-repeat:no-repeat; - margin-right:5px; - -webkit-border-radius:2px; - -moz-border-radius:2px; - border-radius:2px; - padding-left:15px; + background: #eec 3px 3px no-repeat; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + clear: both; + font-size: 10px; + display: block; + width: 55px; + height: 20px; + color: #2e2f2e; + margin: 5px auto 0; + padding: 0 3px; + text-align: center; + vertical-align: middle; } #acl-wrapper a:hover { - text-decoration:none; - color:#000; + text-decoration: none; + color: #2e2f2e; + border: 0; } .acl-button-show { - background-image:url('../../../images/show_off.png'); + background-image: url('../../../images/show_off.png'); + margin: 0 auto; } .acl-button-hide { - background-image:url('../../../images/hide_off.png'); + background-image: url('../../../images/hide_off.png'); + margin: 0 auto; } .acl-button-show.selected { - color:#000; - background-color:#9ade00; - background-image:url(../../../images/show_on.png); + color: #2e2f2e; + background-color: #9ade00; + background-image: url(../../../images/show_on.png); } .acl-button-hide.selected { - color:#000; - background-color:#ff4141; - background-image:url(../../../images/hide_on.png); + color: #2e2f2e; + background-color: #ff4141; + background-image: url(../../../images/hide_on.png); } .acl-list-item.groupshow { - border-color:#9ade00; + border-color: #9ade00; } .acl-list-item.grouphide { - border-color:#ff4141; + border-color: #ff4141; } /** /acl **/ /* autocomplete popup */ .acpopup { - max-height: 150px; + max-height: 175px; + max-width: 42%; background-color: #555753; color: #fff; overflow: auto; diff --git a/view/theme/dispy-dark/theme.php b/view/theme/dispy-dark/theme.php index a7aec1c1a..6f8243058 100644 --- a/view/theme/dispy-dark/theme.php +++ b/view/theme/dispy-dark/theme.php @@ -1,5 +1,17 @@ theme_info = array(); + +/* + * Name: Dispy Dark + * Description: Dispy Dark, Friendica theme + * Version: 0.9 + * Author: Simon + * Maintainer: Simon + */ + + +$a->theme_info = array( + 'extends' => 'dispy-dark' +); $a->page['htmlhead'] .= <<< EOT EOT; -$a->page['footer'] .= <<theme_info = array(); + +/* + * Name: Dispy + * Description: Dispy, Friendica theme + * Version: 0.9 + * Author: unknown + * Maintainer: Simon + */ + + +$a->theme_info = array( + 'extends' => 'dispy' +); $a->page['htmlhead'] .= <<< EOT + EOT; $a->page['footer'] .= << Date: Tue, 13 Mar 2012 23:52:13 -0700 Subject: addon settings form error --- mod/network.php | 2 +- mod/settings.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/network.php b/mod/network.php index 4f58fc4fb..e9f3913ff 100755 --- a/mod/network.php +++ b/mod/network.php @@ -192,7 +192,7 @@ function network_content(&$a, $update = 0) { 'sel'=>$starred_active, ), array( - 'label' => t('Bookmarks'), + 'label' => t('Shared Links'), 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&bmark=1', 'sel'=>$bookmarked_active, ), diff --git a/mod/settings.php b/mod/settings.php index f42fdb397..15fd0c352 100755 --- a/mod/settings.php +++ b/mod/settings.php @@ -559,7 +559,7 @@ function settings_content(&$a) { $tpl = get_markup_template("settings_addons.tpl"); $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_addons"), + '$form_security_token' => get_form_security_token("settings_addon"), '$title' => t('Plugin Settings'), '$tabs' => $tabs, '$settings_addons' => $settings_addons -- cgit v1.2.3 From 509532d168bf716eb24e030ab59476a88ab91571 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Wed, 14 Mar 2012 12:30:52 +0100 Subject: get_tags tests corrected. They test for the right things now. --- mod/item.php | 13 +-- tests/get_tags_test.php | 243 +++++++++++++++++++++++++++++++++++++----------- 2 files changed, 195 insertions(+), 61 deletions(-) diff --git a/mod/item.php b/mod/item.php index 0ff7f6a7c..e4336b974 100755 --- a/mod/item.php +++ b/mod/item.php @@ -425,7 +425,7 @@ function item_post(&$a) { if(count($tags)) { foreach($tags as $tag) { - handle_tag($body, $inform, $str_tags, $profile_uid, $tag); + handle_tag($a, $body, $inform, $str_tags, $profile_uid, $tag); } } @@ -830,7 +830,7 @@ function item_content(&$a) { * @param unknown_type $profile_uid * @param unknown_type $tag the tag to replace */ -function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) { +function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { //is it a hash tag? if(strpos($tag,'#') === 0) { //if the tag is replaced... @@ -851,7 +851,7 @@ function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) { $str_tags .= ','; $str_tags .= $newtag; } - continue; + return; } //is it a person tag? if(strpos($tag,'@') === 0) { @@ -887,14 +887,15 @@ function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) { //get the id $tagcid = intval(substr($newname,strrpos($newname,'+') + 1)); //remove the next word from tag's name - if(strpos($name,' ')) - $name = substr($name,0,strpos($name,' ')); + if(strpos($name,' ')) { + $name = substr($name,0,strpos($name,' ')); + } } if($tagcid) { //if there was an id //select contact with that id from the logged in user's contact list $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($tagcid), - intval($profile_uid) + intval($profile_uid) ); } elseif(strstr($name,'_') || strstr($name,' ')) { //no id //get the real name diff --git a/tests/get_tags_test.php b/tests/get_tags_test.php index ee2daced1..bde2db7d0 100644 --- a/tests/get_tags_test.php +++ b/tests/get_tags_test.php @@ -1,14 +1,41 @@ 15, 'attag'=>'', 'network'=>'dfrn', 'name'=>'Mike Lastname', 'alias'=>'Mike', @@ -16,48 +43,59 @@ function q($sql) { $args=func_get_args(); - $str=""; - foreach($args as $arg) { - $str.=", ".$arg; - } - //last parameter is always (in this test) uid, so, it should be 11 if($args[count($args)-1]!=11) { - throw new Exception("q from get_tags_test was used and uid was not 11. "); + return; } - if(2==count($args)) { + + if(3==count($args)) { //first call in handle_body, id only - if($result[0]['id']===$args[1]) { + if($result[0]['id']==$args[1]) { return $result; } - throw new Exception($str); //second call in handle_body, name if($result[0]['name']===$args[1]) { return $result; } } - throw new Exception($str); //third call in handle_body, nick or attag if($result[0]['nick']===$args[2] || $result[0]['attag']===$args[1]) { return $result; } -// throw new Exception("Nothing fitted: ".$args[1].", ".$args[2]); } +/** + * replacement for dbesc. + * I don't want to test dbesc here, so + * I just return the input. It won't be a problem, because + * the test does not use a real database. + * + * DON'T USE HAT FUNCTION OUTSIDE A TEST! + * + * @param string $str + * @return input + */ function dbesc($str) { return $str; } -class GetTagsTest extends PHPUnit_Framework_TestCase { - +/** + * TestCase for tag handling. + * + * @author alexander + * @package test.util + */ +class GetTagsTest extends PHPUnit_Framework_TestCase { + /** the mock to use as app */ + private $a; + + /** + * initialize the test. That's a phpUnit function, + * don't change its name. + */ public function setUp() { - set_include_path( - get_include_path() . PATH_SEPARATOR - . 'include' . PATH_SEPARATOR - . 'library' . PATH_SEPARATOR - . 'library/phpsec' . PATH_SEPARATOR - . '.' ); + $this->a=new MockApp(); } /** @@ -70,10 +108,54 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { $inform=''; $str_tags=''; - handle_body($text, $inform, $str_tags, 11, $tags[0]); - - $this->assertEquals("@Mike", $tags[0]); + foreach($tags as $tag) { + handle_tag($this->a, $text, $inform, $str_tags, 11, $tag); + } + + //correct tags found? + $this->assertEquals(1, count($tags)); + $this->assertTrue(in_array("@Mike", $tags)); + + //correct output from handle_tag? + $this->assertEquals("cid:15", $inform); + $this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url]", $str_tags); $this->assertEquals("hi @[url=http://justatest.de]Mike Lastname[/url]", $text); + } + + /** + * test with one Person tag. + * There's a minor spelling mistake... + */ + public function testGetTagsShortPersonSpelling() { + $text="hi @Mike.because"; + + $tags=get_tags($text); + + //correct tags found? + $this->assertEquals(1, count($tags)); + $this->assertTrue(in_array("@Mike.because", $tags)); + + $inform=''; + $str_tags=''; + handle_tag($this->a, $text, $inform, $str_tags, 11, $tags[0]); + + $this->assertEquals("cid:15", $inform); + $this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url]", $str_tags); + $this->assertEquals("hi @[url=http://justatest.de]Mike Lastname[/url].because", $text); + } + + /** + * test with two Person tags. + * There's a minor spelling mistake... + */ + public function testGetTagsPerson2Spelling() { + $text="hi @Mike@campino@friendica.eu"; + + $tags=get_tags($text); + + $this->assertEquals(2, count($tags)); + $this->assertTrue(in_array("@Mike", $tags)); + $this->assertTrue(in_array("@campino@friendica.eu", $tags)); } /** @@ -83,8 +165,9 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { $text="This is a #test_case"; $tags=get_tags($text); - - $this->assertEquals("#test_case", $tags[0]); + + $this->assertEquals(1, count($tags)); + $this->assertTrue(in_array("#test_case", $tags)); } /** @@ -95,13 +178,21 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { $tags=get_tags($text); - $inform=''; - $str_tags=''; - handle_body($text, $inform, $str_tags, 11, $tags[0]); - - $this->assertEquals("hi @[url=http://justatest.de]Mike[/url] This is a #test_case", $text); - $this->assertEquals("@Mike", $tags[0]); - $this->assertEquals("#test_case", $tags[1]); + $this->assertEquals(3, count($tags)); + $this->assertTrue(in_array("@Mike", $tags)); + $this->assertTrue(in_array("@Mike This", $tags)); + $this->assertTrue(in_array("#test_case", $tags)); + + $inform=''; + $str_tags=''; + foreach($tags as $tag) { + handle_tag($this->a, $text, $inform, $str_tags, 11, $tag); + } + + $this->assertEquals("cid:15", $inform); + $this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url],#[url=baseurl/search?search=test%20case]test case[/url]", $str_tags); + $this->assertEquals("hi @[url=http://justatest.de]Mike Lastname[/url] This is a #[url=baseurl/search?search=test%20case]test case[/url]", $text); + } /** @@ -112,8 +203,9 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { $tags=get_tags($text); - $this->assertEquals("@Mike", $tags[0]); - $this->assertEquals("#test_case", $tags[1]); + $this->assertEquals(2, count($tags)); + $this->assertTrue(in_array("@Mike", $tags)); + $this->assertTrue(in_array("#test_case", $tags)); } /** @@ -123,10 +215,45 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { $text="@Test I saw the Theme Dev group was created."; $tags=get_tags($text); - - $this->assertEquals("@Test", $tags[0]); + + $this->assertEquals(2, count($tags)); + $this->assertTrue(in_array("@Test I", $tags)); + $this->assertTrue(in_array("@Test", $tags)); } + /** + * this test demonstrates strange behaviour by intval. + * It makes the next test fail. + */ + public function testIntval() { + $this->assertEquals(15, intval("15 it")); + } + + /** + * test a tag with an id in it + */ + public function testIdTag() { + $text="Test with @mike+15 id tag"; + + $tags=get_tags($text); + + $this->assertEquals(2, count($tags)); + $this->assertTrue(in_array("@mike+15", $tags)); + + //happens right now, but it shouldn't be necessary + $this->assertTrue(in_array("@mike+15 id", $tags)); + + $inform=''; + $str_tags=''; + foreach($tags as $tag) { + handle_tag($this->a, $text, $inform, $str_tags, 11, $tag); + } + + $this->assertEquals("Test with @[url=http://justatest.de]Mike Lastname[/url] id tag", $text); + $this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url]", $str_tags); + $this->assertEquals("cid:15", $inform); + } + /** * test with two persons and one special tag. */ @@ -135,11 +262,13 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { ." so @somebody@friendica.com may change #things."; $tags=get_tags($text); - - $this->assertEquals("@Mike", $tags[0]); - $this->assertEquals("#test_cases", $tags[1]); - $this->assertEquals("@somebody@friendica.com", $tags[2]); - $this->assertEquals("#things", $tags[3]); + + $this->assertEquals(5, count($tags)); + $this->assertTrue(in_array("@Mike", $tags)); + $this->assertTrue(in_array("#test_cases", $tags)); + $this->assertTrue(in_array("@somebody@friendica.com", $tags)); + $this->assertTrue(in_array("@somebody@friendica.com may", $tags)); + $this->assertTrue(in_array("#things", $tags)); } /** @@ -156,19 +285,23 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { $tags=get_tags($text); - $this->assertEquals("@Mike", $tags[0]); - $this->assertEquals("#test_cases", $tags[1]); - $this->assertEquals("@somebody@friendica.com", $tags[2]); - $this->assertEquals("#things", $tags[3]); - $this->assertEquals("#pitfalls", $tags[4]); - $this->assertEquals("#tags", $tags[5]); - $this->assertEquals("@comment", $tags[6]); - $this->assertEquals("@fullstops", $tags[7]); - $this->assertEquals("#things", $tags[8]); - $this->assertEquals("@Mike", $tags[9]); - $this->assertEquals("@campino@friendica.eu", $tags[10]); - $this->assertEquals("#nice", $tags[11]); - $this->assertEquals("@first_last", $tags[12]); + $this->assertTrue(in_array("@Mike", $tags)); + $this->assertTrue(in_array("#test_cases", $tags)); + $this->assertTrue(in_array("@somebody@friendica.com", $tags)); + $this->assertTrue(in_array("#things", $tags)); + $this->assertTrue(in_array("#pitfalls", $tags)); + $this->assertTrue(in_array("#tags", $tags)); + $this->assertTrue(in_array("@comment", $tags)); + $this->assertTrue(in_array("@fullstops.because", $tags)); + $this->assertTrue(in_array("#things", $tags)); + $this->assertTrue(in_array("@Mike", $tags)); + $this->assertTrue(in_array("#nice", $tags)); + $this->assertTrue(in_array("@first_last", $tags)); + + //right now, none of the is matched + $this->assertFalse(in_array("@Mike@campino@friendica.eu", $tags)); + $this->assertTrue(in_array("@campino@friendica.eu", $tags)); + $this->assertTrue(in_array("@campino@friendica.eu is", $tags)); } /** -- cgit v1.2.3 From c0c98206ef322b3d175d5348d37e8d0b5fca140b Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Wed, 14 Mar 2012 12:31:25 +0100 Subject: removed done TODO --- tests/get_tags_test.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/get_tags_test.php b/tests/get_tags_test.php index bde2db7d0..9051923be 100644 --- a/tests/get_tags_test.php +++ b/tests/get_tags_test.php @@ -281,8 +281,7 @@ class GetTagsTest extends PHPUnit_Framework_TestCase { ."@comment. I hope noone forgets about @fullstops.because that might" ." break #things. @Mike@campino@friendica.eu is also #nice, isn't it? " ."Now, add a @first_last tag. "; - //TODO check whether this are all variants (no, auto-stuff is missing). - + $tags=get_tags($text); $this->assertTrue(in_array("@Mike", $tags)); -- cgit v1.2.3 From 42462cc1f00cd0d2e637ff3ddb62b30ae4a645c6 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Wed, 14 Mar 2012 12:50:11 +0100 Subject: add links to home, profile, photos, events, notes to aside in network-stream --- view/theme/diabook-blue/profile_side.tpl | 19 +++++++++++++++ view/theme/diabook-blue/style.css | 41 ++++++++++++++++++++++++++++++++ view/theme/diabook-blue/theme.php | 36 ++++++++++++++++++++++++++++ view/theme/diabook/profile_side.tpl | 19 +++++++++++++++ view/theme/diabook/style.css | 40 ++++++++++++++++++++++++++++--- view/theme/diabook/theme.php | 37 ++++++++++++++++++++++++++++ 6 files changed, 189 insertions(+), 3 deletions(-) create mode 100644 view/theme/diabook-blue/profile_side.tpl create mode 100644 view/theme/diabook/profile_side.tpl diff --git a/view/theme/diabook-blue/profile_side.tpl b/view/theme/diabook-blue/profile_side.tpl new file mode 100644 index 000000000..595684bf5 --- /dev/null +++ b/view/theme/diabook-blue/profile_side.tpl @@ -0,0 +1,19 @@ + + + \ No newline at end of file diff --git a/view/theme/diabook-blue/style.css b/view/theme/diabook-blue/style.css index 93307153f..514314049 100644 --- a/view/theme/diabook-blue/style.css +++ b/view/theme/diabook-blue/style.css @@ -874,6 +874,41 @@ ul.menu-popup .empty { padding: 7px 7px 0px 0px; } +/*profile_side*/ +#profile_side { + margin-bottom: 30px; +} +#ps-usericon{ + height: 25px + } +#ps-username{ + font-size: 1.17em; + font-weight: bold; + vertical-align: top; + position: absolute; + padding-top: 4px; + padding-left: 5px; + } +#ps-username:hover{ + text-decoration: none; + } +.menu-profile-side{ + list-style: none; + padding-left: 16px; + min-height: 16px; + } +.menu-profile-list{ + height: auto; + overflow: auto; + padding-top: 3px; + padding-bottom: 3px; + } +.menu-profile-list:hover{ + background: #EEE; + } +.menu-profile-list-item:hover{ + text-decoration: none; + } /* aside */ aside { display: table-cell; @@ -1879,6 +1914,12 @@ ul.tabs li .active { float: left; } /* photo */ +.photo { +box-shadow: 2px 2px 5px 0px #000000; +margin: 2px 5px 2px 5px; +max-height: 85%; +max-width: 85%; +} .lframe { float: left; margin: 0px 10px 10px 0px; diff --git a/view/theme/diabook-blue/theme.php b/view/theme/diabook-blue/theme.php index e5aa710c7..75abb2fdf 100755 --- a/view/theme/diabook-blue/theme.php +++ b/view/theme/diabook-blue/theme.php @@ -11,6 +11,42 @@ $a->theme_info = array( 'extends' => 'diabook', ); +//profile_side + + + +$nav['usermenu']=array(); +$userinfo = null; + +if(local_user()) { + + + +$r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid'])); + +$userinfo = array( + 'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl()."/images/default-profile-mm.jpg"), + 'name' => $a->user['username'], + ); + +$ps['usermenu'][status] = Array('profile/' . $a->user['nickname'], t('Home'), "", t('Your posts and conversations')); +$ps['usermenu'][profile] = Array('profile/' . $a->user['nickname']. '?tab=profile', t('Profile'), "", t('Your profile page')); +$ps['usermenu'][photos] = Array('photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')); +$ps['usermenu'][events] = Array('events/', t('Events'), "", t('Your events')); +$ps['usermenu'][notes] = Array('notes/', t('Personal notes'), "", t('Your personal photos')); + + +if($is_url = preg_match ("/\bnetwork\b/i", $_SERVER['REQUEST_URI'])) { +$tpl = get_markup_template('profile_side.tpl'); + +$a->page['aside'] .= replace_macros($tpl, array( + '$userinfo' => $userinfo, + '$ps' => $ps, + )); +} +} + +//js scripts $a->page['htmlhead'] .= <<< EOT "; $f = get_config('system','birthday_input_format'); @@ -425,7 +425,7 @@ function profiles_content(&$a) { '$lbl_work' => t('Work/employment'), '$lbl_school' => t('School/education'), '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''), - '$baseurl' => $a->get_baseurl(), + '$baseurl' => $a->get_baseurl(true), '$profile_id' => $r[0]['id'], '$profile_name' => $r[0]['profile-name'], '$default' => (($is_default) ? '

    ' . t('This is your public profile.
    It may be visible to anybody using the internet.') . '

    ' : ""), @@ -489,7 +489,7 @@ function profiles_content(&$a) { '$alt' => t('Profile Image'), '$profile_name' => $rr['profile-name'], '$visible' => (($rr['is-default']) ? '' . t('visible to everybody') . '' - : '' . t('Edit visibility') . '') + : '' . t('Edit visibility') . '') )); } } diff --git a/mod/settings.php b/mod/settings.php index 15fd0c352..f694b5840 100755 --- a/mod/settings.php +++ b/mod/settings.php @@ -59,7 +59,7 @@ function settings_post(&$a) { q("DELETE FROM tokens WHERE id='%s' AND uid=%d", dbesc($key), local_user()); - goaway($a->get_baseurl()."/settings/oauth/"); + goaway($a->get_baseurl(true)."/settings/oauth/"); return; } @@ -104,7 +104,7 @@ function settings_post(&$a) { local_user()); } } - goaway($a->get_baseurl()."/settings/oauth/"); + goaway($a->get_baseurl(true)."/settings/oauth/"); return; } @@ -411,7 +411,7 @@ function settings_post(&$a) { } - goaway($a->get_baseurl() . '/settings' ); + goaway($a->get_baseurl(true) . '/settings' ); return; // NOTREACHED } @@ -435,27 +435,27 @@ function settings_content(&$a) { $tabs = array( array( 'label' => t('Account settings'), - 'url' => $a->get_baseurl().'/settings', + 'url' => $a->get_baseurl(true).'/settings', 'sel' => (($a->argc == 1)?'active':''), ), array( 'label' => t('Connector settings'), - 'url' => $a->get_baseurl().'/settings/connectors', + 'url' => $a->get_baseurl(true).'/settings/connectors', 'sel' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''), ), array( 'label' => t('Plugin settings'), - 'url' => $a->get_baseurl().'/settings/addon', + 'url' => $a->get_baseurl(true).'/settings/addon', 'sel' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''), ), array( 'label' => t('Connections'), - 'url' => $a->get_baseurl() . '/settings/oauth', + 'url' => $a->get_baseurl(true) . '/settings/oauth', 'sel' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''), ), array( 'label' => t('Export personal data'), - 'url' => $a->get_baseurl() . '/uexport', + 'url' => $a->get_baseurl(true) . '/uexport', 'sel' => '' ) ); @@ -517,7 +517,7 @@ function settings_content(&$a) { $r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d", dbesc($a->argv[3]), local_user()); - goaway($a->get_baseurl()."/settings/oauth/"); + goaway($a->get_baseurl(true)."/settings/oauth/"); return; } @@ -533,7 +533,7 @@ function settings_content(&$a) { $tpl = get_markup_template("settings_oauth.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_oauth"), - '$baseurl' => $a->get_baseurl(), + '$baseurl' => $a->get_baseurl(true), '$title' => t('Connected Apps'), '$add' => t('Add application'), '$edit' => t('Edit'), @@ -789,7 +789,7 @@ function settings_content(&$a) { $theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']); - $subdir = ((strlen($a->get_path())) ? '
    ' . t('or') . ' ' . $a->get_baseurl() . '/profile/' . $nickname : ''); + $subdir = ((strlen($a->get_path())) ? '
    ' . t('or') . ' ' . $a->get_baseurl(true) . '/profile/' . $nickname : ''); $tpl_addr = get_markup_template("settings_nick_set.tpl"); @@ -819,7 +819,7 @@ function settings_content(&$a) { '$ptitle' => t('Account Settings'), '$submit' => t('Submit'), - '$baseurl' => $a->get_baseurl(), + '$baseurl' => $a->get_baseurl(true), '$uid' => local_user(), '$form_security_token' => get_form_security_token("settings"), -- cgit v1.2.3 From 93a8907f435e1b6ca55fa816ffb81b47a018db03 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 14 Mar 2012 21:29:44 -0700 Subject: force login to ssl on SSL_POLICY_SELFSIGN --- boot.php | 18 +++++++++++------- view/login.tpl | 2 +- view/logout.tpl | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/boot.php b/boot.php index 22a4e39be..c4cfbe5bf 100755 --- a/boot.php +++ b/boot.php @@ -696,6 +696,7 @@ function get_guid($size=16) { if(! function_exists('login')) { function login($register = false, $hiddens=false) { + $a = get_app(); $o = ""; $reg = false; if ($register) { @@ -715,23 +716,26 @@ function login($register = false, $hiddens=false) { } + $dest_url = $a->get_baseurl(true) . '/' . $a->query_string; $o .= replace_macros($tpl,array( - '$logout' => t('Logout'), - '$login' => t('Login'), + + '$dest_url' => $dest_url, + '$logout' => t('Logout'), + '$login' => t('Login'), '$lname' => array('username', t('Nickname or Email address: ') , '', ''), '$lpassword' => array('password', t('Password: '), '', ''), '$openid' => !$noid, - '$lopenid' => array('openid_url', t('Or login using OpenID: '),'',''), + '$lopenid' => array('openid_url', t('Or login using OpenID: '),'',''), - '$hiddens' => $hiddens, + '$hiddens' => $hiddens, - '$register' => $reg, + '$register' => $reg, - '$lostpass' => t('Forgot your password?'), - '$lostlink' => t('Password Reset'), + '$lostpass' => t('Forgot your password?'), + '$lostlink' => t('Password Reset'), )); call_hooks('login_hook',$o); diff --git a/view/login.tpl b/view/login.tpl index 5349fa3d8..4cbbb1624 100755 --- a/view/login.tpl +++ b/view/login.tpl @@ -1,5 +1,5 @@ - +
    diff --git a/view/logout.tpl b/view/logout.tpl index 6a84a5bbc..efc971df8 100755 --- a/view/logout.tpl +++ b/view/logout.tpl @@ -1,4 +1,4 @@ - +
    -- cgit v1.2.3 From b44533e9fb685bb4b38073a90003d61911e1e24e Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 14 Mar 2012 21:40:36 -0700 Subject: roll protocol version due to ssl_policy settings --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index c4cfbe5bf..04f36093b 100755 --- a/boot.php +++ b/boot.php @@ -10,7 +10,7 @@ require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_VERSION', '2.3.1281' ); -define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); +define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1131 ); define ( 'EOL', "
    \r\n" ); -- cgit v1.2.3 From b06c5983a4dae26dd24aecd7473bad98558cd6fc Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 14 Mar 2012 21:58:54 -0700 Subject: don't allow multiple friends with http/https same person, don't show mail2 coming soon unless person is allowed to have email contacts --- mod/dfrn_request.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 4acb5c9bb..c2d37dac7 100755 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -77,9 +77,10 @@ function dfrn_request_post(&$a) { * Lookup the contact based on their URL (which is the only unique thing we have at the moment) */ - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `self` = 0 LIMIT 1", + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND (`url` = '%s' OR `nurl` = '%s') AND `self` = 0 LIMIT 1", intval(local_user()), - dbesc($dfrn_url) + dbesc($dfrn_url), + dbesc(normalise_link($dfrn_url)) ); if(count($r)) { @@ -668,7 +669,21 @@ function dfrn_request_content(&$a) { $page_desc .= t("Please enter your 'Identity Address' from one of the following supported communications networks:"); - $emailnet = t("Connect as an email follower \x28Coming soon\x29"); + // see if we are allowed to have NETWORK_MAIL2 contacts + + $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); + if(get_config('system','dfrn_only')) + $mail_disabled = 1; + + if(! $mail_disabled) { + $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1", + intval($a->profile['uid']) + ); + if(! count($r)) + $mail_disabled = 1; + } + + $emailnet = (($mail_disabled) ? '' : t("Connect as an email follower \x28Coming soon\x29")); $invite_desc = t('If you are not yet a member of the free social web, follow this link to find a public Friendica site and join us today.'); -- cgit v1.2.3 From 6dbee45d92450131bad7a8381a0339a880dacfd9 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Thu, 15 Mar 2012 08:29:39 +0100 Subject: add links to wall, photos, events, etc to aside on networkpage, fixes in css --- view/theme/diabook-blue/icons/toogle_off.png | Bin 391 -> 834 bytes view/theme/diabook-blue/icons/toogle_on.png | Bin 429 -> 715 bytes view/theme/diabook-blue/profile_side.tpl | 3 +- view/theme/diabook-blue/style.css | 40 ++++++++++++++++++++++----- view/theme/diabook-blue/theme.php | 2 +- view/theme/diabook/icons/toogle_off.png | Bin 391 -> 834 bytes view/theme/diabook/icons/toogle_on.png | Bin 429 -> 715 bytes view/theme/diabook/profile_side.tpl | 3 +- view/theme/diabook/style.css | 38 +++++++++++++++++++++---- view/theme/diabook/theme.php | 9 +++--- 10 files changed, 74 insertions(+), 21 deletions(-) mode change 100755 => 100644 view/theme/diabook-blue/icons/toogle_off.png mode change 100755 => 100644 view/theme/diabook-blue/icons/toogle_on.png mode change 100755 => 100644 view/theme/diabook/icons/toogle_off.png mode change 100755 => 100644 view/theme/diabook/icons/toogle_on.png diff --git a/view/theme/diabook-blue/icons/toogle_off.png b/view/theme/diabook-blue/icons/toogle_off.png old mode 100755 new mode 100644 index 99490bcd9..0fcce4d5a Binary files a/view/theme/diabook-blue/icons/toogle_off.png and b/view/theme/diabook-blue/icons/toogle_off.png differ diff --git a/view/theme/diabook-blue/icons/toogle_on.png b/view/theme/diabook-blue/icons/toogle_on.png old mode 100755 new mode 100644 index 81e8f9120..79ce07f0e Binary files a/view/theme/diabook-blue/icons/toogle_on.png and b/view/theme/diabook-blue/icons/toogle_on.png differ diff --git a/view/theme/diabook-blue/profile_side.tpl b/view/theme/diabook-blue/profile_side.tpl index 595684bf5..01da55ce1 100644 --- a/view/theme/diabook-blue/profile_side.tpl +++ b/view/theme/diabook-blue/profile_side.tpl @@ -8,10 +8,11 @@
    diff --git a/view/theme/diabook-blue/style.css b/view/theme/diabook-blue/style.css index 514314049..bdc79a350 100644 --- a/view/theme/diabook-blue/style.css +++ b/view/theme/diabook-blue/style.css @@ -461,7 +461,7 @@ code { } #panel { position: absolute; - width: 10em; + width: 12em; background: #ffffff; color: #2d2d2d; margin: 0px; @@ -780,8 +780,6 @@ ul.menu-popup { margin: 0px; padding: 0px; list-style: none; - border: 1px solid #364e59; - border-top-color: transparent; z-index: 100000; -webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); -moz-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); @@ -1922,7 +1920,7 @@ max-width: 85%; } .lframe { float: left; - margin: 0px 10px 10px 0px; + /*margin: 0px 10px 10px 0px;*/ } /* profile match wrapper */ .profile-match-wrapper { @@ -2362,8 +2360,36 @@ float: left; .contact-details { color: #999999; } - -.photo-top-image-wrapper { +#side-bar-photos-albums{ + margin-top: 15px; + } +.photo-top-photo, .photo-album-photo { + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; +} +.photo-album-image-wrapper, .photo-top-image-wrapper { + float: left; + -moz-box-shadow: 0 0 5px #888; + -webkit-box-shadow: 0 0 5px #888; + box-shadow: 0 0 5px #888; + background-color: #EEE; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding-bottom: 20px; + position: relative; + margin: 0 10px 10px 0; +} +.photo-top-album-name { + position: absolute; + bottom: 0; + padding: 0 5px; +} +.photo-top-album-link{ + color: #1872A2; + } +/*.photo-top-image-wrapper { position: relative; float: left; margin-top: 15px; @@ -2379,7 +2405,7 @@ float: left; padding: 0px 3px; padding-top: 0.5em; background-color: rgb(255, 255, 255); -} +}*/ #photo-top-end { clear: both; } diff --git a/view/theme/diabook-blue/theme.php b/view/theme/diabook-blue/theme.php index 75abb2fdf..9093ac2ca 100755 --- a/view/theme/diabook-blue/theme.php +++ b/view/theme/diabook-blue/theme.php @@ -34,7 +34,7 @@ $ps['usermenu'][profile] = Array('profile/' . $a->user['nickname']. '?tab=profil $ps['usermenu'][photos] = Array('photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')); $ps['usermenu'][events] = Array('events/', t('Events'), "", t('Your events')); $ps['usermenu'][notes] = Array('notes/', t('Personal notes'), "", t('Your personal photos')); - +$ps['usermenu'][community] = Array('community/', t('Community'), "", ""); if($is_url = preg_match ("/\bnetwork\b/i", $_SERVER['REQUEST_URI'])) { $tpl = get_markup_template('profile_side.tpl'); diff --git a/view/theme/diabook/icons/toogle_off.png b/view/theme/diabook/icons/toogle_off.png old mode 100755 new mode 100644 index 99490bcd9..0fcce4d5a Binary files a/view/theme/diabook/icons/toogle_off.png and b/view/theme/diabook/icons/toogle_off.png differ diff --git a/view/theme/diabook/icons/toogle_on.png b/view/theme/diabook/icons/toogle_on.png old mode 100755 new mode 100644 index 81e8f9120..79ce07f0e Binary files a/view/theme/diabook/icons/toogle_on.png and b/view/theme/diabook/icons/toogle_on.png differ diff --git a/view/theme/diabook/profile_side.tpl b/view/theme/diabook/profile_side.tpl index 595684bf5..01da55ce1 100644 --- a/view/theme/diabook/profile_side.tpl +++ b/view/theme/diabook/profile_side.tpl @@ -8,10 +8,11 @@
    diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index df692cbc6..437f323fa 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -462,7 +462,7 @@ code { } #panel { position: absolute; - width: 10em; + width: 12em; background: #ffffff; color: #2d2d2d; margin: 0px; @@ -769,8 +769,6 @@ ul.menu-popup { margin: 0px; padding: 0px; list-style: none; - border: 1px solid #364e59; - border-top-color: transparent; z-index: 100000; -webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); -moz-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); @@ -1904,7 +1902,6 @@ ul.tabs li .active { /* photo */ .lframe { float: left; - margin: 0px 10px 10px 0px; } /* profile match wrapper */ .profile-match-wrapper { @@ -2352,7 +2349,36 @@ float: left; color: #999999; } -.photo-top-image-wrapper { +#side-bar-photos-albums{ + margin-top: 15px; + } +.photo-top-photo, .photo-album-photo { + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; +} +.photo-album-image-wrapper, .photo-top-image-wrapper { + float: left; + -moz-box-shadow: 0 0 5px #888; + -webkit-box-shadow: 0 0 5px #888; + box-shadow: 0 0 5px #888; + background-color: #EEE; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding-bottom: 20px; + position: relative; + margin: 0 10px 10px 0; +} +.photo-top-album-name { + position: absolute; + bottom: 0; + padding: 0 5px; +} +.photo-top-album-link{ + color: #1872A2; + } +/*.photo-top-image-wrapper { position: relative; float: left; margin-top: 15px; @@ -2368,7 +2394,7 @@ float: left; padding: 0px 3px; padding-top: 0.5em; background-color: rgb(255, 255, 255); -} +}*/ #photo-top-end { clear: both; } diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index 9b3ed30b0..9093ac2ca 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -1,8 +1,8 @@ user['nickname']. '?tab=profil $ps['usermenu'][photos] = Array('photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')); $ps['usermenu'][events] = Array('events/', t('Events'), "", t('Your events')); $ps['usermenu'][notes] = Array('notes/', t('Personal notes'), "", t('Your personal photos')); - +$ps['usermenu'][community] = Array('community/', t('Community'), "", ""); if($is_url = preg_match ("/\bnetwork\b/i", $_SERVER['REQUEST_URI'])) { $tpl = get_markup_template('profile_side.tpl'); @@ -46,8 +46,7 @@ $a->page['aside'] .= replace_macros($tpl, array( } } -//js script - +//js scripts $a->page['htmlhead'] .= <<< EOT diff --git a/view/theme/dispy-dark/jot-header.tpl b/view/theme/dispy-dark/jot-header.tpl index 43dcdbb84..4c8f59d79 100644 --- a/view/theme/dispy-dark/jot-header.tpl +++ b/view/theme/dispy-dark/jot-header.tpl @@ -114,6 +114,7 @@ function enableOnUser(){ $(this).val(""); initEditor(); } + EOT; diff --git a/view/theme/dispy-dark/wall_item.tpl b/view/theme/dispy-dark/wall_item.tpl index b013cfeef..c67a88635 100644 --- a/view/theme/dispy-dark/wall_item.tpl +++ b/view/theme/dispy-dark/wall_item.tpl @@ -26,11 +26,14 @@ {{ endif }} + {{ if $item.vote }} {{ endif }} diff --git a/view/theme/dispy-dark/wallwall_item.tpl b/view/theme/dispy-dark/wallwall_item.tpl index 86453fad2..f251d7352 100644 --- a/view/theme/dispy-dark/wallwall_item.tpl +++ b/view/theme/dispy-dark/wallwall_item.tpl @@ -31,11 +31,15 @@ {{ endif }} + {{ if $item.vote }} {{ endif }} @@ -63,6 +67,7 @@ {{ endfor }} +
    $item.name diff --git a/view/theme/dispy/theme.php b/view/theme/dispy/theme.php index 75297290c..cbfcb09e6 100644 --- a/view/theme/dispy/theme.php +++ b/view/theme/dispy/theme.php @@ -111,6 +111,3 @@ $(document).ready(function() { }); EOT; - -$a->page['footer'] .= << + {{ endif }} - {{ if $item.filer }} - - {{ endif }} - +
    {{ if $item.drop.dropping }}{{ endif }}
    diff --git a/view/theme/duepuntozero/wallwall_item.tpl b/view/theme/duepuntozero/wallwall_item.tpl index c37bcb4a2..211906c93 100755 --- a/view/theme/duepuntozero/wallwall_item.tpl +++ b/view/theme/duepuntozero/wallwall_item.tpl @@ -61,9 +61,6 @@ {{ endif }} - {{ if $item.filer }} - - {{ endif }}
    {{ if $item.drop.dropping }}{{ endif }} -- cgit v1.2.3 From b5120888cf6e3aac29aa2a8d80bddcab73822e1e Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 15 Mar 2012 21:17:51 +0100 Subject: html2bbcode: Disabled size conversion --- include/html2bbcode.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/html2bbcode.php b/include/html2bbcode.php index 0dafecc71..69ccf41b7 100755 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -142,14 +142,14 @@ function html2bbcode($message) node2bbcode($doc, 'span', array('style'=>'font-style: italic;'), '[i]', '[/i]'); node2bbcode($doc, 'span', array('style'=>'font-weight: bold;'), '[b]', '[/b]'); - node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/', 'size'=>'/(\d+)/', 'color'=>'/(.+)/'), '[font=$1][size=$2][color=$3]', '[/color][/size][/font]'); + /*node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/', 'size'=>'/(\d+)/', 'color'=>'/(.+)/'), '[font=$1][size=$2][color=$3]', '[/color][/size][/font]'); node2bbcode($doc, 'font', array('size'=>'/(\d+)/', 'color'=>'/(.+)/'), '[size=$1][color=$2]', '[/color][/size]'); node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/', 'size'=>'/(.+)/'), '[font=$1][size=$2]', '[/size][/font]'); node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/', 'color'=>'/(.+)/'), '[font=$1][color=$3]', '[/color][/font]'); node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/'), '[font=$1]', '[/font]'); node2bbcode($doc, 'font', array('size'=>'/(\d+)/'), '[size=$1]', '[/size]'); node2bbcode($doc, 'font', array('color'=>'/(.+)/'), '[color=$1]', '[/color]'); - +*/ // Untested //node2bbcode($doc, 'span', array('style'=>'/.*font-size:\s*(.+?)[,;].*font-family:\s*(.+?)[,;].*color:\s*(.+?)[,;].*/'), '[size=$1][font=$2][color=$3]', '[/color][/font][/size]'); //node2bbcode($doc, 'span', array('style'=>'/.*font-size:\s*(\d+)[,;].*/'), '[size=$1]', '[/size]'); @@ -191,13 +191,13 @@ function html2bbcode($message) node2bbcode($doc, 'hr', array(), "[hr]", ""); - //node2bbcode($doc, 'table', array(), "", ""); - //node2bbcode($doc, 'tr', array(), "\n", ""); - //node2bbcode($doc, 'td', array(), "\t", ""); - node2bbcode($doc, 'table', array(), "[table]", "[/table]"); - node2bbcode($doc, 'th', array(), "[th]", "[/th]"); - node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]"); - node2bbcode($doc, 'td', array(), "[td]", "[/td]"); + node2bbcode($doc, 'table', array(), "", ""); + node2bbcode($doc, 'tr', array(), "\n", ""); + node2bbcode($doc, 'td', array(), "\t", ""); + //node2bbcode($doc, 'table', array(), "[table]", "[/table]"); + //node2bbcode($doc, 'th', array(), "[th]", "[/th]"); + //node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]"); + //node2bbcode($doc, 'td', array(), "[td]", "[/td]"); node2bbcode($doc, 'h1', array(), "\n\n[size=xx-large][b]", "[/b][/size]\n"); node2bbcode($doc, 'h2', array(), "\n\n[size=x-large][b]", "[/b][/size]\n"); -- cgit v1.2.3 -- cgit v1.2.3 From 5c75d40c0b6bee04d8c58a6f88ecbbe34684874a Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Thu, 15 Mar 2012 17:27:06 -0400 Subject: fixed the sidebar edit thingy. haven't synced dispy yet. Signed-off-by: Simon L'nu --- view/theme/dispy-dark/profile_vcard.tpl | 35 ++++++++++++++++----------------- view/theme/dispy-dark/style.css | 16 +++++++++------ 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/view/theme/dispy-dark/profile_vcard.tpl b/view/theme/dispy-dark/profile_vcard.tpl index 6228e4f28..350a6ce4a 100644 --- a/view/theme/dispy-dark/profile_vcard.tpl +++ b/view/theme/dispy-dark/profile_vcard.tpl @@ -1,24 +1,23 @@
    -
    $profile.name
    - - {{ if $profile.edit }} -
    - - $profile.edit.1 - -
    - {{ endif }} + {{ if $profile.edit }} +
    + + $profile.edit.1 +
    + {{ endif }} + +
    $profile.name
    {{ if $pdesc }}
    $profile.pdesc
    diff --git a/view/theme/dispy-dark/style.css b/view/theme/dispy-dark/style.css index 2dc21817a..6ab0c7921 100644 --- a/view/theme/dispy-dark/style.css +++ b/view/theme/dispy-dark/style.css @@ -694,7 +694,7 @@ aside #viewcontacts { margin: 30px 0px; } .ttright { - margin: 0px 0px 0px 5px; + margin: 0px 0px 0px 0px; } /** @@ -835,6 +835,7 @@ aside #viewcontacts { border: 0; text-decoration: none; float: right; + cursor: pointer; } #profile-jot-perms { float: right; @@ -1702,7 +1703,6 @@ div[id$="wrapper"] br { } - /** * register, settings & profile forms */ @@ -1767,21 +1767,25 @@ div[id$="wrapper"] br { /*margin: 3px 0px 0px 70px;*/ /*}*/ #profiles-menu-trigger { - width: 100px; + margin: 0px 0px 0px 25px; } .profile-listing { float: left; margin: 20px 20px 0px 0px; } .icon-profile-edit { - background: url("icons.png") no-repeat scroll -150px 0px transparent; - border: 0 none; + background: url("icons.png") -150px 0px no-repeat; + border: 0; + cursor: pointer; display: block; float: right; + width: 20px; height: 20px; margin: 0 0 -18px; + position: absolute; text-decoration: none; - cursor: pointer; + top: 18px; + right: 226px; } #profile-edit-links ul { margin: 20px 0; -- cgit v1.2.3 From 7684f63ecdfce560f24475630144f6058df15ca9 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 15 Mar 2012 16:38:26 -0700 Subject: track whether contact is a community page or not --- boot.php | 4 ++-- database.sql | 2 ++ include/items.php | 5 +++++ mod/dfrn_confirm.php | 6 ++++++ mod/dfrn_notify.php | 12 ++++++++---- update.php | 7 ++++++- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/boot.php b/boot.php index 04f36093b..86da3cd2e 100755 --- a/boot.php +++ b/boot.php @@ -9,9 +9,9 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1281' ); +define ( 'FRIENDICA_VERSION', '2.3.1282' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1131 ); +define ( 'DB_UPDATE_VERSION', 1132 ); define ( 'EOL', "
    \r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 35c257f02..5f69a1d00 100755 --- a/database.sql +++ b/database.sql @@ -92,6 +92,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( `blocked` tinyint(1) NOT NULL DEFAULT '1', `readonly` tinyint(1) NOT NULL DEFAULT '0', `writable` tinyint(1) NOT NULL DEFAULT '0', + `forum` tinyint(1) NOT NULL DEFAULT '0', `hidden` tinyint(1) NOT NULL DEFAULT '0', `pending` tinyint(1) NOT NULL DEFAULT '1', `rating` tinyint(1) NOT NULL DEFAULT '0', @@ -116,6 +117,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( KEY `dfrn-id` (`dfrn-id`), KEY `blocked` (`blocked`), KEY `readonly` (`readonly`), + KEY `forum` (`forum`), KEY `hidden` (`hidden`), KEY `pending` (`pending`), KEY `closeness` (`closeness`) diff --git a/include/items.php b/include/items.php index 4b1523ff6..68acb45f9 100755 --- a/include/items.php +++ b/include/items.php @@ -1048,6 +1048,7 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { $ssl_val = intval(get_config('system','ssl_policy')); $ssl_policy = ''; + switch($ssl_val){ case SSL_POLICY_FULL: $ssl_policy = 'full'; @@ -1092,6 +1093,7 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { $challenge = hex2bin((string) $res->challenge); $dfrn_version = (float) (($res->dfrn_version) ? $res->dfrn_version : 2.0); $rino_allowed = ((intval($res->rino) === 1) ? 1 : 0); + $page = (($owner['page-flags'] == PAGE_COMMUNITY) ? 1 : 0); $final_dfrn_id = ''; @@ -1135,6 +1137,9 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { $postvars['ssl_policy'] = $ssl_policy; + if($page) + $postvars['page'] = '1'; + if($rino && $rino_allowed && (! $dissolve)) { $key = substr(random_string(),0,16); $data = bin2hex(aes_encrypt($postvars['data'],$key)); diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 0bc3ea7df..2f4fb7045 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -207,6 +207,9 @@ function dfrn_confirm_post(&$a,$handsfree = null) { if($duplex == 1) $params['duplex'] = 1; + if($user['page-flags'] == PAGE_COMMUNITY) + $params['page'] = 1; + logger('dfrn_confirm: Confirm: posting data to ' . $dfrn_confirm . ': ' . print_r($params,true), LOGGER_DATA); /** @@ -522,6 +525,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { $source_url = ((x($_POST,'source_url')) ? hex2bin($_POST['source_url']) : ''); $aes_key = ((x($_POST,'aes_key')) ? $_POST['aes_key'] : ''); $duplex = ((x($_POST,'duplex')) ? intval($_POST['duplex']) : 0 ); + $page = ((x($_POST,'page')) ? intval($_POST['page']) : 0 ); $version_id = ((x($_POST,'dfrn_version')) ? (float) $_POST['dfrn_version'] : 2.0); logger('dfrn_confirm: requestee contacted: ' . $node); @@ -677,6 +681,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { `blocked` = 0, `pending` = 0, `duplex` = %d, + `forum` = %d, `network` = '%s' WHERE `id` = %d LIMIT 1 ", dbesc($photos[0]), @@ -687,6 +692,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { dbesc(datetime_convert()), dbesc(datetime_convert()), intval($duplex), + intval($page), dbesc(NETWORK_DFRN), intval($dfrn_record) ); diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 3dbdc5b32..71860ac3b 100755 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -15,6 +15,7 @@ function dfrn_notify_post(&$a) { $dissolve = ((x($_POST,'dissolve')) ? intval($_POST['dissolve']) : 0); $perm = ((x($_POST,'perm')) ? notags(trim($_POST['perm'])) : 'r'); $ssl_policy = ((x($_POST,'ssl_policy')) ? notags(trim($_POST['ssl_policy'])): 'none'); + $page = ((x($_POST,'page')) ? intval($_POST['page']) : 0); $writable = (-1); if($dfrn_version >= 2.21) { @@ -87,12 +88,15 @@ function dfrn_notify_post(&$a) { $importer = $r[0]; - if(($writable != (-1)) && ($writable != $importer['writable'])) { - q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d LIMIT 1", - intval($writable), + if((($writable != (-1)) && ($writable != $importer['writable'])) || ($importer['forum'] != $page)) { + q("UPDATE `contact` SET `writable` = %d, forum = %d WHERE `id` = %d LIMIT 1", + intval(($writable == (-1)) ? $importer['writable'] : $writable), + intval($page), intval($importer['id']) ); - $importer['writable'] = $writable; + if($writable != (-1)) + $importer['writable'] = $writable; + $importer['forum'] = $page; } // if contact's ssl policy changed, update our links diff --git a/update.php b/update.php index c29394b48..6a685a6ff 100755 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ Date: Fri, 16 Mar 2012 03:49:43 +0100 Subject: added icons to profile_side, fixes in css --- view/theme/diabook-blue/icons/com_side.png | Bin 0 -> 680 bytes view/theme/diabook-blue/icons/events.png | Bin 0 -> 663 bytes view/theme/diabook-blue/icons/home.png | Bin 0 -> 722 bytes view/theme/diabook-blue/icons/mess_side.png | Bin 0 -> 664 bytes view/theme/diabook-blue/icons/notes.png | Bin 0 -> 739 bytes view/theme/diabook-blue/icons/pubgroups.png | Bin 0 -> 710 bytes view/theme/diabook-blue/photo_album.tpl | 7 ++++ view/theme/diabook-blue/photo_top.tpl | 7 ++++ view/theme/diabook-blue/photo_view.tpl | 2 +- view/theme/diabook-blue/profile_side.tpl | 12 +++---- view/theme/diabook-blue/style.css | 52 +++++++++++++++++++++++++--- view/theme/diabook-blue/theme.php | 13 ++++--- view/theme/diabook/style.css | 7 ++-- view/theme/diabook/wall_item.tpl | 7 ++-- view/theme/diabook/wallwall_item.tpl | 11 +++--- 15 files changed, 86 insertions(+), 32 deletions(-) create mode 100644 view/theme/diabook-blue/icons/com_side.png create mode 100644 view/theme/diabook-blue/icons/events.png create mode 100644 view/theme/diabook-blue/icons/home.png create mode 100644 view/theme/diabook-blue/icons/mess_side.png create mode 100644 view/theme/diabook-blue/icons/notes.png create mode 100644 view/theme/diabook-blue/icons/pubgroups.png create mode 100755 view/theme/diabook-blue/photo_album.tpl create mode 100755 view/theme/diabook-blue/photo_top.tpl diff --git a/view/theme/diabook-blue/icons/com_side.png b/view/theme/diabook-blue/icons/com_side.png new file mode 100644 index 000000000..bc5969ef1 Binary files /dev/null and b/view/theme/diabook-blue/icons/com_side.png differ diff --git a/view/theme/diabook-blue/icons/events.png b/view/theme/diabook-blue/icons/events.png new file mode 100644 index 000000000..4a0b3f3f1 Binary files /dev/null and b/view/theme/diabook-blue/icons/events.png differ diff --git a/view/theme/diabook-blue/icons/home.png b/view/theme/diabook-blue/icons/home.png new file mode 100644 index 000000000..be47a48fc Binary files /dev/null and b/view/theme/diabook-blue/icons/home.png differ diff --git a/view/theme/diabook-blue/icons/mess_side.png b/view/theme/diabook-blue/icons/mess_side.png new file mode 100644 index 000000000..49ef896bc Binary files /dev/null and b/view/theme/diabook-blue/icons/mess_side.png differ diff --git a/view/theme/diabook-blue/icons/notes.png b/view/theme/diabook-blue/icons/notes.png new file mode 100644 index 000000000..7d4afca90 Binary files /dev/null and b/view/theme/diabook-blue/icons/notes.png differ diff --git a/view/theme/diabook-blue/icons/pubgroups.png b/view/theme/diabook-blue/icons/pubgroups.png new file mode 100644 index 000000000..acf857f32 Binary files /dev/null and b/view/theme/diabook-blue/icons/pubgroups.png differ diff --git a/view/theme/diabook-blue/photo_album.tpl b/view/theme/diabook-blue/photo_album.tpl new file mode 100755 index 000000000..7e6c2f666 --- /dev/null +++ b/view/theme/diabook-blue/photo_album.tpl @@ -0,0 +1,7 @@ + +
    diff --git a/view/theme/diabook-blue/photo_top.tpl b/view/theme/diabook-blue/photo_top.tpl new file mode 100755 index 000000000..98ac9c457 --- /dev/null +++ b/view/theme/diabook-blue/photo_top.tpl @@ -0,0 +1,7 @@ + + diff --git a/view/theme/diabook-blue/photo_view.tpl b/view/theme/diabook-blue/photo_view.tpl index 511fc73ac..902c2a0ed 100755 --- a/view/theme/diabook-blue/photo_view.tpl +++ b/view/theme/diabook-blue/photo_view.tpl @@ -12,7 +12,7 @@
    {{ if $prevlink }}{{ endif }} - + {{ if $nextlink }}{{ endif }}
    diff --git a/view/theme/diabook-blue/profile_side.tpl b/view/theme/diabook-blue/profile_side.tpl index 01da55ce1..a65677696 100644 --- a/view/theme/diabook-blue/profile_side.tpl +++ b/view/theme/diabook-blue/profile_side.tpl @@ -7,12 +7,12 @@
    diff --git a/view/theme/diabook-blue/style.css b/view/theme/diabook-blue/style.css index bdc79a350..738dde0e5 100644 --- a/view/theme/diabook-blue/style.css +++ b/view/theme/diabook-blue/style.css @@ -891,22 +891,47 @@ ul.menu-popup .empty { text-decoration: none; } .menu-profile-side{ - list-style: none; - padding-left: 16px; - min-height: 16px; + list-style: none; + padding-left: 0px; + min-height: 0px; } .menu-profile-list{ height: auto; overflow: auto; padding-top: 3px; padding-bottom: 3px; + padding-left: 16px; + min-height: 16px; + list-style: none; } .menu-profile-list:hover{ background: #EEE; } +.menu-profile-list-item{ + padding-left: 5px; + } .menu-profile-list-item:hover{ - text-decoration: none; + text-decoration: none; } +/*http://prothemedesign.com/circular-icons/*/ +.menu-profile-list.home{ + background: url("../../../view/theme/diabook-blue/icons/home.png") no-repeat; + } +.menu-profile-list.photos{ + background: url("../../../view/theme/diabook-blue/icons/mess_side.png") no-repeat; + } +.menu-profile-list.events{ + background: url("../../../view/theme/diabook-blue/icons/events.png") no-repeat; + } +.menu-profile-list.notes{ + background: url("../../../view/theme/diabook-blue/icons/notes.png") no-repeat; + } +.menu-profile-list.foren{ + background: url("../../../view/theme/diabook-blue/icons/pubgroups.png") no-repeat; + } +.menu-profile-list.com_side{ + background: url("../../../view/theme/diabook-blue/icons/com_side.png") no-repeat; + } /* aside */ aside { display: table-cell; @@ -1066,6 +1091,16 @@ aside #side-peoplefind-url { min-height: 16px; list-style: none; } +#side-bar-photos-albums li{ +list-style-type: disc; +} +#side-bar-photos-albums ul li{ + margin-left: 30px; + padding-left: 0px; + } +#side-bar-photos-albums ul li a{ + color: #1872A2; +} .widget .tool.selected { background: url("../../../view/theme/diabook-blue/icons/selected.png") no-repeat left center; } @@ -2207,6 +2242,9 @@ a.mail-list-link { .calendar { font-family: Courier, monospace; } +.calendar.eventcal a { + color: #1872A2; + } .today { font-weight: bold; color: #FF0000; @@ -2380,6 +2418,9 @@ float: left; padding-bottom: 20px; position: relative; margin: 0 10px 10px 0; + overflow: hidden; + float: left; + position: relative; } .photo-top-album-name { position: absolute; @@ -2388,6 +2429,9 @@ float: left; } .photo-top-album-link{ color: #1872A2; + } +.photo-top-album-img{ + } /*.photo-top-image-wrapper { position: relative; diff --git a/view/theme/diabook-blue/theme.php b/view/theme/diabook-blue/theme.php index 9093ac2ca..f9128ea1f 100755 --- a/view/theme/diabook-blue/theme.php +++ b/view/theme/diabook-blue/theme.php @@ -11,9 +11,9 @@ $a->theme_info = array( 'extends' => 'diabook', ); -//profile_side - +//fancybox: provide $photo.href to photo_top.tpl to img in org. scale +//profile_side $nav['usermenu']=array(); $userinfo = null; @@ -110,10 +110,15 @@ $('html').click(function() { event.stopPropagation(); }); - $(function() { - $('a.lightbox').fancybox(); // Select all links with lightbox class + + + $(document).ready(function() { + $("a.fancy-photo").fancybox(); // Select all links with lightbox class + $("a.fancy-album").fancybox(); }); + + EOT; diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index b7568631f..437f323fa 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -485,9 +485,6 @@ code { #sidebar-group-list .tool:hover { background: #EEE; } -#sidebar-pages-list .tool:hover { - background: #EEE; -} .tool .label { float: left; } @@ -1337,14 +1334,14 @@ body .pageheader{ } .tag { /*background: url("../../../images/tag_b.png") repeat-x center left;*/ - color: #999; + color: #3465A4; padding-left: 3px; font-size: 12px; } .tag a { padding-right: 5px; /*background: url("../../../images/tag.png") no-repeat center right;*/ - color: #999; + color: #3465A4; } .wwto { position: absolute !important; diff --git a/view/theme/diabook/wall_item.tpl b/view/theme/diabook/wall_item.tpl index 321bbbe9e..ebe40fd4e 100644 --- a/view/theme/diabook/wall_item.tpl +++ b/view/theme/diabook/wall_item.tpl @@ -13,8 +13,7 @@ $item.name - menu + menu @@ -22,8 +21,7 @@ id="wall-item-photo-menu-button-$item.id">menu
    - $item.name + $item.name - {{ if $item.plink }}$item.ago{{ else }} $item.ago {{ endif }} {{ if $item.lock }} - $item.lock {{ endif }} @@ -97,4 +95,3 @@ class="wall-item-name$item.sparkle">$item.name
    $item.comment
    - diff --git a/view/theme/diabook/wallwall_item.tpl b/view/theme/diabook/wallwall_item.tpl index 05ed4cc82..e02e5a8be 100644 --- a/view/theme/diabook/wallwall_item.tpl +++ b/view/theme/diabook/wallwall_item.tpl @@ -18,8 +18,7 @@ $item.name - menu + menu @@ -27,10 +26,8 @@ id="wall-item-photo-menu-button-$item.id">menu
    - $item.name - $item.to $item.owner_name + $item.name + $item.to $item.owner_name $item.vwall -   {{ if $item.plink }}$item.ago{{ else }} $item.ago {{ endif }} {{ if $item.lock }} - $item.lock {{ endif }} @@ -103,4 +100,4 @@ id="wall-item-ownername-$item.id">$item.owner_name
    $item.comment -
    +
    \ No newline at end of file -- cgit v1.2.3 From 5a12383b78980d873f54ccbac2733d7267f7da36 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 15 Mar 2012 19:55:58 -0700 Subject: undo git stuffup --- view/theme/duepuntozero/style.css | 4 ++-- view/theme/duepuntozero/wall_item.tpl | 5 +++-- view/theme/duepuntozero/wallwall_item.tpl | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 10ddb0090..b79b00ef4 100755 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -2615,12 +2615,12 @@ aside input[type='text'] { margin-top: 10px; } -.body-tag { +.body-tag, .filesavetags { opacity: 0.5; filter:alpha(opacity=50); } -.body-tag:hover { +.body-tag:hover, .filesavetags:hover { opacity: 1.0 !important; filter:alpha(opacity=100) !important; } diff --git a/view/theme/duepuntozero/wall_item.tpl b/view/theme/duepuntozero/wall_item.tpl index 2c88fc598..e2db70a14 100755 --- a/view/theme/duepuntozero/wall_item.tpl +++ b/view/theme/duepuntozero/wall_item.tpl @@ -56,9 +56,10 @@ {{ if $item.star }} - {{ endif }} - + {{ if $item.filer }} + + {{ endif }}
    {{ if $item.drop.dropping }}{{ endif }}
    diff --git a/view/theme/duepuntozero/wallwall_item.tpl b/view/theme/duepuntozero/wallwall_item.tpl index 211906c93..420c0e08b 100755 --- a/view/theme/duepuntozero/wallwall_item.tpl +++ b/view/theme/duepuntozero/wallwall_item.tpl @@ -61,6 +61,9 @@ {{ endif }} + {{ if $item.filer }} + + {{ endif }}
    {{ if $item.drop.dropping }}{{ endif }} -- cgit v1.2.3 From be4e4dfb0d552857c683ee7f7bf5cf0a4bdfb686 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 15 Mar 2012 20:07:30 -0700 Subject: turn indexes back off (this is from an errant checkin a year or more ago) --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 5f9531a7e..28ac3dd80 100755 --- a/.htaccess +++ b/.htaccess @@ -1,4 +1,4 @@ -#Options -Indexes +Options -Indexes AddType application/x-java-archive .jar AddType audio/ogg .oga -- cgit v1.2.3 -- cgit v1.2.3 From 6bdb71f01c93c691a43caaf9686ce5ac0b687701 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 16 Mar 2012 01:55:34 -0400 Subject: more changes in dispy-dark Signed-off-by: Simon L'nu --- view/theme/dispy-dark/style.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/view/theme/dispy-dark/style.css b/view/theme/dispy-dark/style.css index 6ab0c7921..d1ec4efd7 100644 --- a/view/theme/dispy-dark/style.css +++ b/view/theme/dispy-dark/style.css @@ -1490,6 +1490,8 @@ div[id$="wrapper"] br { } #prvmail-subject { width: 100%; + color: #2e2f2e; + background: #eec; } #prvmail-submit-wrapper { margin-top: 10px; @@ -1803,6 +1805,10 @@ div[id$="wrapper"] br { background: #2e2f2e; color: #eec; } +#id_ssl_policy { + width: 374px; +} + /** * contacts selector -- cgit v1.2.3 From d965f73ef149e6baaf058987c146901e3cc16fa0 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 16 Mar 2012 01:57:27 -0400 Subject: missing close double quote in mail_list.tpl Signed-off-by: Simon L'nu --- view/mail_list.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 view/mail_list.tpl diff --git a/view/mail_list.tpl b/view/mail_list.tpl old mode 100755 new mode 100644 index b284ffb0e..22e35dec8 --- a/view/mail_list.tpl +++ b/view/mail_list.tpl @@ -1,6 +1,6 @@
    - $from_name + $from_name
    $from_name
    -- cgit v1.2.3 From be1bd9ff4e725f7e60b05acd415aee892e97f956 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 16 Mar 2012 05:19:29 -0700 Subject: notification for disapora comments --- include/diaspora.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/include/diaspora.php b/include/diaspora.php index dca857a19..19bba5216 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1159,6 +1159,48 @@ function diaspora_comment($importer,$xml,$msg) { proc_run('php','include/notifier.php','comment',$message_id); } + + $myconv = q("SELECT `author-link`, `author-avatar`, `parent` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `parent` != 0 ", + dbesc($parent_item['uri']), + intval($importer['uid']) + ); + + if(count($myconv)) { + $importer_url = $a->get_baseurl() . '/profile/' . $importer['nickname']; + + foreach($myconv as $conv) { + + // now if we find a match, it means we're in this conversation + + if(! link_compare($conv['author-link'],$importer_url)) + continue; + + require_once('include/enotify.php'); + + $conv_parent = $conv['parent']; + + notification(array( + 'type' => NOTIFY_COMMENT, + 'notify_flags' => $importer['notify-flags'], + 'language' => $importer['language'], + 'to_name' => $importer['username'], + 'to_email' => $importer['email'], + 'uid' => $importer['uid'], + 'item' => $datarray, + 'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, + 'source_name' => $datarray['author-name'], + 'source_link' => $datarray['author-link'], + 'source_photo' => $datarray['author-avatar'], + 'verb' => ACTIVITY_POST, + 'otype' => 'item', + 'parent' => $conv_parent, + + )); + + // only send one notification + break; + } + } return; } -- cgit v1.2.3 From 805087af678f922ad75535fa8dbe0fc86d9cd566 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 16 Mar 2012 05:41:29 -0700 Subject: whitespace --- include/items.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/items.php b/include/items.php index 68acb45f9..5e1fec557 100755 --- a/include/items.php +++ b/include/items.php @@ -2026,6 +2026,7 @@ function local_delivery($importer,$data) { if(($item['verb'] === ACTIVITY_TAG) && ($item['object-type'] === ACTVITY_OBJ_TAGTERM)) { $xo = parse_xml_string($item['object'],false); $xt = parse_xml_string($item['target'],false); + if($xt->type === ACTIVITY_OBJ_NOTE) { $i = q("select * from `item` where uri = '%s' and uid = %d limit 1", dbesc($xt->id), -- cgit v1.2.3 From 224dfa848bf2659ba038b6e519692d3755eb7bed Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 16 Mar 2012 05:51:04 -0700 Subject: bug #335 network search broken after new ssl policy settings --- include/text.php | 2 +- mod/network.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/text.php b/include/text.php index d34fd7fbe..cdf82ca87 100644 --- a/include/text.php +++ b/include/text.php @@ -638,7 +638,7 @@ if(! function_exists('search')) { function search($s,$id='search-box',$url='/search',$save = false) { $a = get_app(); $o = '
    '; - $o .= ''; + $o .= ''; $o .= ''; $o .= ''; if($save) diff --git a/mod/network.php b/mod/network.php index d0f1733f4..9ec8c23b5 100755 --- a/mod/network.php +++ b/mod/network.php @@ -90,7 +90,7 @@ function saved_searches($search) { $o = replace_macros($tpl, array( '$title' => t('Saved Searches'), '$add' => t('add'), - '$searchbox' => search($search,'netsearch-box',$a->get_baseurl(true) . $srchurl,true), + '$searchbox' => search($search,'netsearch-box',$srchurl,true), '$saved' => $saved, )); -- cgit v1.2.3 From 28f941193d75ca12f4cb2a38a1c60e60ad10f2a6 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 16 Mar 2012 06:02:26 -0700 Subject: syntax error from pasted text, remove ^M's --- mod/item.php | 192 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/mod/item.php b/mod/item.php index 98cfb4338..07b4bfef7 100755 --- a/mod/item.php +++ b/mod/item.php @@ -832,129 +832,129 @@ function item_content(&$a) { */ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { //is it a hash tag? - if(strpos($tag,'#') === 0) { + if(strpos($tag,'#') === 0) { //if the tag is replaced... if(strpos($tag,'[url=')) - //...do nothing - continue; - //base tag has the tags name only - $basetag = str_replace('_',' ',substr($tag,1)); + //...do nothing + return; + //base tag has the tags name only + $basetag = str_replace('_',' ',substr($tag,1)); //create text for link $newtag = '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]'; - //replace tag by the link - $body = str_replace($tag, $newtag, $body); + //replace tag by the link + $body = str_replace($tag, $newtag, $body); - //is the link already in str_tags? - if(! stristr($str_tags,$newtag)) { + //is the link already in str_tags? + if(! stristr($str_tags,$newtag)) { //append or set str_tags - if(strlen($str_tags)) - $str_tags .= ','; - $str_tags .= $newtag; - } - return; + if(strlen($str_tags)) + $str_tags .= ','; + $str_tags .= $newtag; + } + return; } - //is it a person tag? - if(strpos($tag,'@') === 0) { + //is it a person tag? + if(strpos($tag,'@') === 0) { //is it already replaced? - if(strpos($tag,'[url=')) - continue; - $stat = false; + if(strpos($tag,'[url=')) + continue; + $stat = false; //get the person's name $name = substr($tag,1); - //is it a link or a full dfrn address? - if((strpos($name,'@')) || (strpos($name,'http://'))) { - $newname = $name; + //is it a link or a full dfrn address? + if((strpos($name,'@')) || (strpos($name,'http://'))) { + $newname = $name; //get the profile links - $links = @lrdd($name); - if(count($links)) { + $links = @lrdd($name); + if(count($links)) { //for all links, collect how is to inform and how's profile is to link - foreach($links as $link) { - if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') - $profile = $link['@attributes']['href']; - if($link['@attributes']['rel'] === 'salmon') { - if(strlen($inform)) - $inform .= ','; - $inform .= 'url:' . str_replace(',','%2c',$link['@attributes']['href']); - } - } - } - } else { //if it is a name rather than an address - $newname = $name; - $alias = ''; + foreach($links as $link) { + if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') + $profile = $link['@attributes']['href']; + if($link['@attributes']['rel'] === 'salmon') { + if(strlen($inform)) + $inform .= ','; + $inform .= 'url:' . str_replace(',','%2c',$link['@attributes']['href']); + } + } + } + } else { //if it is a name rather than an address + $newname = $name; + $alias = ''; $tagcid = 0; - //is it some generated name? - if(strrpos($newname,'+')) { + //is it some generated name? + if(strrpos($newname,'+')) { //get the id - $tagcid = intval(substr($newname,strrpos($newname,'+') + 1)); + $tagcid = intval(substr($newname,strrpos($newname,'+') + 1)); //remove the next word from tag's name - if(strpos($name,' ')) { + if(strpos($name,' ')) { $name = substr($name,0,strpos($name,' ')); - } + } } if($tagcid) { //if there was an id - //select contact with that id from the logged in user's contact list - $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval($tagcid), + //select contact with that id from the logged in user's contact list + $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($tagcid), intval($profile_uid) - ); + ); } elseif(strstr($name,'_') || strstr($name,' ')) { //no id - //get the real name - $newname = str_replace('_',' ',$name); + //get the real name + $newname = str_replace('_',' ',$name); //select someone from this user's contacts by name - $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1", - dbesc($newname), - intval($profile_uid) - ); + $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1", + dbesc($newname), + intval($profile_uid) + ); } else { - //select someone by attag or nick and the name passed in - $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1", - dbesc($name), - dbesc($name), - intval($profile_uid) - ); + //select someone by attag or nick and the name passed in + $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1", + dbesc($name), + dbesc($name), + intval($profile_uid) + ); } - //$r is set, if someone could be selected - if(count($r)) { + //$r is set, if someone could be selected + if(count($r)) { $profile = $r[0]['url']; - //set newname to nick, find alias - if($r[0]['network'] === 'stat') { - $newname = $r[0]['nick']; - $stat = true; - if($r[0]['alias']) - $alias = $r[0]['alias']; - } - else - $newname = $r[0]['name']; + //set newname to nick, find alias + if($r[0]['network'] === 'stat') { + $newname = $r[0]['nick']; + $stat = true; + if($r[0]['alias']) + $alias = $r[0]['alias']; + } + else + $newname = $r[0]['name']; //add person's id to $inform - if(strlen($inform)) - $inform .= ','; - $inform .= 'cid:' . $r[0]['id']; - } + if(strlen($inform)) + $inform .= ','; + $inform .= 'cid:' . $r[0]['id']; + } } - //if there is an url for this persons profile - if(isset($profile)) { + //if there is an url for this persons profile + if(isset($profile)) { //create profile link - $profile = str_replace(',','%2c',$profile); - $newtag = '@[url=' . $profile . ']' . $newname . '[/url]'; - $body = str_replace('@' . $name, $newtag, $body); + $profile = str_replace(',','%2c',$profile); + $newtag = '@[url=' . $profile . ']' . $newname . '[/url]'; + $body = str_replace('@' . $name, $newtag, $body); //append tag to str_tags - if(! stristr($str_tags,$newtag)) { - if(strlen($str_tags)) - $str_tags .= ','; - $str_tags .= $newtag; - } - - // Status.Net seems to require the numeric ID URL in a mention if the person isn't - // subscribed to you. But the nickname URL is OK if they are. Grrr. We'll tag both. - - if(strlen($alias)) { - $newtag = '@[url=' . $alias . ']' . $newname . '[/url]'; - if(! stristr($str_tags,$newtag)) { - if(strlen($str_tags)) - $str_tags .= ','; - $str_tags .= $newtag; - } - } - } + if(! stristr($str_tags,$newtag)) { + if(strlen($str_tags)) + $str_tags .= ','; + $str_tags .= $newtag; + } + + // Status.Net seems to require the numeric ID URL in a mention if the person isn't + // subscribed to you. But the nickname URL is OK if they are. Grrr. We'll tag both. + + if(strlen($alias)) { + $newtag = '@[url=' . $alias . ']' . $newname . '[/url]'; + if(! stristr($str_tags,$newtag)) { + if(strlen($str_tags)) + $str_tags .= ','; + $str_tags .= $newtag; + } + } + } } } -- cgit v1.2.3 From 7b15f27ba48f5a1b0e24290379e2524796776803 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 16 Mar 2012 13:31:59 -0400 Subject: weee, dispys get another update Signed-off-by: Simon L'nu --- view/theme/dispy-dark/style.css | 53 +++--- view/theme/dispy-dark/theme.php | 8 +- view/theme/dispy/contact_template.tpl | 2 + view/theme/dispy/group_side.tpl | 6 +- view/theme/dispy/head.tpl | 19 -- view/theme/dispy/jot-header.tpl | 14 ++ view/theme/dispy/nav.tpl | 16 +- view/theme/dispy/nets.tpl | 2 +- view/theme/dispy/photo_view.tpl | 2 +- view/theme/dispy/profile_vcard.tpl | 30 +++- view/theme/dispy/saved_searches_aside.tpl | 2 +- view/theme/dispy/style.css | 282 ++++++++++++++++++------------ view/theme/dispy/theme.php | 41 +++-- view/theme/dispy/wall_item.tpl | 5 +- view/theme/dispy/wallwall_item.tpl | 7 +- 15 files changed, 294 insertions(+), 195 deletions(-) mode change 100755 => 100644 view/theme/dispy/nets.tpl mode change 100755 => 100644 view/theme/dispy/photo_view.tpl mode change 100755 => 100644 view/theme/dispy/saved_searches_aside.tpl diff --git a/view/theme/dispy-dark/style.css b/view/theme/dispy-dark/style.css index d1ec4efd7..b4aefbbf2 100644 --- a/view/theme/dispy-dark/style.css +++ b/view/theme/dispy-dark/style.css @@ -123,9 +123,6 @@ a { text-decoration: none; margin-bottom: 1px; } -/*a:hover { */ -/* text-decoration: none;*/ -/*}*/ a:hover img { text-decoration: none; } @@ -778,6 +775,15 @@ aside #viewcontacts { #profile-jot-text_ifr { width:99.900002% !important; } +[id$="jot-text_ifr"] { + width: 99.900002% !important; + color: #2e2f2e; + background: #eec; +} +[id$="jot-text_ifr"] .mceContentBody { + color: #2e2f2e; + background: #eec; +} #profile-attach-wrapper, #profile-audio-wrapper, #profile-link-wrapper, @@ -1527,7 +1533,6 @@ div[id$="wrapper"] br { } .mail-list-subject { font-size: 1.2em; - font-weight: bold; } .mail-list-delete-wrapper { float: right; @@ -1751,23 +1756,23 @@ div[id$="wrapper"] br { margin: 30px 0px; } .profile-edit-side-div { - /*background: #111;*/ - /*border-radius: 5px 5px 0px 0px;*/ - /*margin: 0px 0px 0px 0px;*/ - /*width: 100px;*/ - /*height: 25px;*/ - /*position: absolute;*/ + /*background: #111; + border-radius: 5px 5px 0px 0px; + margin: 0px 0px 0px 0px; + width: 100px; + height: 25px; + position: absolute;*/ display: none; - /*left: 35%;*/ - /*top: 41%;*/ - /*cursor: pointer;*/ -} -/*.profile-edit-side-div:hover {*/ - /*display: block;*/ -/*}*/ -/*.profile-edit-side-link {*/ - /*margin: 3px 0px 0px 70px;*/ -/*}*/ + /*left: 35%; + top: 41%; + cursor: pointer;*/ +} +/*.profile-edit-side-div:hover { + display: block; +} +.profile-edit-side-link { + margin: 3px 0px 0px 70px; +}*/ #profiles-menu-trigger { margin: 0px 0px 0px 25px; } @@ -2123,12 +2128,12 @@ div[id$="wrapper"] br { border-bottom: 1px solid #000; } #adminpage dt { - width: 200px; + width: 250px; float: left; font-weight: bold; } #adminpage dd { - margin-left: 200px; + margin-left: 250px; } #adminpage h3 { border-bottom:1px solid #ccc; @@ -2590,8 +2595,8 @@ footer { margin-top: 30px; overflow: auto; } -/*#acl-list-content {*/ -/*}*/ +/*#acl-list-content { +}*/ .acl-list-item { border: 1px solid #eec; display: block; diff --git a/view/theme/dispy-dark/theme.php b/view/theme/dispy-dark/theme.php index c0611ce83..0134b1f91 100644 --- a/view/theme/dispy-dark/theme.php +++ b/view/theme/dispy-dark/theme.php @@ -64,7 +64,7 @@ $(document).ready(function() { $('#drop-' + id).addClass('iconspacer'); } ); - // notifications + // click outside notifications menu closes it $('html').click(function() { $('#nav-notifications-linkmenu').removeClass('selected'); document.getElementById("nav-notifications-menu").style.display = "none"; @@ -74,6 +74,7 @@ $(document).ready(function() { event.stopPropagation(); }); + // main function in toolbar functioning function toggleToolbar() { if ( $('#nav-floater').is(':visible') ) { $('#nav-floater').slideUp('fast'); @@ -87,15 +88,20 @@ $(document).ready(function() { }); } }; + // our trigger for the toolbar button $('.floaterflip').click(function() { toggleToolbar(); return false; }); + // (attempt) to change the text colour in a top post $('#profile-jot-text').focusin(function() { $(this).css({color: '#eec'}); }); + // make auto-complete work in more places + $(".wall-item-comment-wrapper textarea").contact_autocomplete(baseurl+"/acl"); + /* $('#profile-photo-wrapper').mouseover(function() { $('.profile-edit-side-div').css({display: 'block'}); }).mouseout(function() { diff --git a/view/theme/dispy/contact_template.tpl b/view/theme/dispy/contact_template.tpl index fbf354b47..04968bd07 100644 --- a/view/theme/dispy/contact_template.tpl +++ b/view/theme/dispy/contact_template.tpl @@ -20,9 +20,11 @@
    $contact.name
    +{{ if $contact.alt_text }}
    $contact.alt_text
    {{ endif }}
    Profile URL
    $contact.network
    + diff --git a/view/theme/dispy/group_side.tpl b/view/theme/dispy/group_side.tpl index 516d70d5b..10ecec2e8 100644 --- a/view/theme/dispy/group_side.tpl +++ b/view/theme/dispy/group_side.tpl @@ -1,5 +1,5 @@ -
    -

    $title

    +
    +

    $title

    +
    $item.name -- cgit v1.2.3 From 75823c23539fd009a6575dc125258afa7ce2bbc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Fri, 16 Mar 2012 17:45:07 +0000 Subject: Use tabindex to enable easy navigation in the dialog to write private mails; Recipient -> Subject -> Text field (tabindex has to be set to the IFRAME element after TinyMCE started) -> Send button --- include/acl_selectors.php | 14 ++++++++------ mod/message.php | 2 +- view/msg-header.tpl | 9 ++++++++- view/prv_message.tpl | 6 +++--- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 67d8cebde..a5f5aff53 100755 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -113,11 +113,13 @@ function contact_selector($selname, $selclass, $preselected = false, $options) { $str_nets = implode(',',$x['networks']); $sql_extra .= " AND `network` IN ( $str_nets ) "; } + + $tabindex = (x($options, 'tabindex') ? "tabindex=\"" . $options["tabindex"] . "\"" : ""); if($x['single']) - $o .= "\r\n"; else - $o .= "\r\n"; $r = q("SELECT `id`, `name`, `url`, `network` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != '' @@ -156,7 +158,7 @@ function contact_selector($selname, $selclass, $preselected = false, $options) { -function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false) { +function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false, $tabindex = null) { $a = get_app(); @@ -178,12 +180,12 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p $sql_extra .= " AND `network` IN ( 'dfrn', 'mail', 'face', 'dspr' ) "; } - + $tabindex = ($tabindex > 0 ? "tabindex=\"$tabindex\"" : ""); if($privmail) - $o .= "\r\n"; else - $o .= "\r\n"; $r = q("SELECT `id`, `name`, `url`, `network` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != '' diff --git a/mod/message.php b/mod/message.php index 55e313776..0907abd77 100755 --- a/mod/message.php +++ b/mod/message.php @@ -154,7 +154,7 @@ function message_content(&$a) { $preselect = (isset($a->argv[2])?array($a->argv[2]):false); - $select = contact_select('messageto','message-to-select', $preselect, 4, true); + $select = contact_select('messageto','message-to-select', $preselect, 4, true, false, false, 10); $tpl = get_markup_template('prv_message.tpl'); $o .= replace_macros($tpl,array( '$header' => t('Send Private Message'), diff --git a/view/msg-header.tpl b/view/msg-header.tpl index b5c78345a..1f8650bfe 100755 --- a/view/msg-header.tpl +++ b/view/msg-header.tpl @@ -30,8 +30,15 @@ if(plaintext != 'none') { setup : function(ed) { ed.onInit.add(function(ed) { ed.pasteAsPlainText = true; + var editorId = ed.editorId; + var textarea = $('#'+editorId); + console.log(textarea); + if (typeof(textarea.attr('tabindex')) != "undefined") { + $('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex')); + textarea.attr('tabindex', null); + } }); - } + }, }); } diff --git a/view/prv_message.tpl b/view/prv_message.tpl index 4b904cbcd..2ce07ce6f 100755 --- a/view/prv_message.tpl +++ b/view/prv_message.tpl @@ -10,14 +10,14 @@ $parent $select
    $subject
    - +
    $yourmessage
    - +
    - +
    -- cgit v1.2.3 From 27054964feba44e82589fb6b8c464c59b9420feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Fri, 16 Mar 2012 17:46:26 +0000 Subject: Forgot to remove a debug line --- view/msg-header.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/view/msg-header.tpl b/view/msg-header.tpl index 1f8650bfe..b1fcefd24 100755 --- a/view/msg-header.tpl +++ b/view/msg-header.tpl @@ -32,7 +32,6 @@ if(plaintext != 'none') { ed.pasteAsPlainText = true; var editorId = ed.editorId; var textarea = $('#'+editorId); - console.log(textarea); if (typeof(textarea.attr('tabindex')) != "undefined") { $('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex')); textarea.attr('tabindex', null); -- cgit v1.2.3 From 90bb32ab7393687d46e198f94d181c830f881def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Fri, 16 Mar 2012 17:47:40 +0000 Subject: Bugfix of old IEs --- view/msg-header.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/msg-header.tpl b/view/msg-header.tpl index b1fcefd24..098333893 100755 --- a/view/msg-header.tpl +++ b/view/msg-header.tpl @@ -37,7 +37,7 @@ if(plaintext != 'none') { textarea.attr('tabindex', null); } }); - }, + } }); } -- cgit v1.2.3 -- cgit v1.2.3 From 91fee866b7f870b66d770c7c4e6db0afd874de33 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 16 Mar 2012 16:43:34 -0400 Subject: make profiles-menu disappear when clicked outside it Signed-off-by: Simon L'nu --- view/theme/dispy-dark/theme.php | 9 +++++++++ view/theme/dispy/theme.php | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/view/theme/dispy-dark/theme.php b/view/theme/dispy-dark/theme.php index 0134b1f91..b57971db9 100644 --- a/view/theme/dispy-dark/theme.php +++ b/view/theme/dispy-dark/theme.php @@ -73,6 +73,15 @@ $(document).ready(function() { $('#nav-notifications-linkmenu').click(function(event) { event.stopPropagation(); }); + // click outside profiles menu closes it + $('html').click(function() { + $('#profiles-menu-trigger').removeClass('selected'); + document.getElementById("profiles-menu").style.display = "none"; + }); + + $('#profiles-menu').click(function(event) { + event.stopPropagation(); + }); // main function in toolbar functioning function toggleToolbar() { diff --git a/view/theme/dispy/theme.php b/view/theme/dispy/theme.php index ac97948a3..9f0fcba82 100644 --- a/view/theme/dispy/theme.php +++ b/view/theme/dispy/theme.php @@ -73,6 +73,15 @@ $(document).ready(function() { $('#nav-notifications-linkmenu').click(function(event) { event.stopPropagation(); }); + // click outside profiles menu closes it + $('html').click(function() { + $('#profiles-menu-trigger').removeClass('selected'); + document.getElementById("profiles-menu").style.display = "none"; + }); + + $('#profiles-menu').click(function(event) { + event.stopPropagation(); + }); // main function in toolbar functioning function toggleToolbar() { -- cgit v1.2.3 From 58940175e173c04c9bfa3498af40c65f6514a9ce Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 16 Mar 2012 15:07:45 -0700 Subject: wrong link in d* comment notifications --- boot.php | 2 +- include/diaspora.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index 86da3cd2e..322340e5d 100755 --- a/boot.php +++ b/boot.php @@ -9,7 +9,7 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1282' ); +define ( 'FRIENDICA_VERSION', '2.3.1283' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1132 ); diff --git a/include/diaspora.php b/include/diaspora.php index 19bba5216..1b5af42cd 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1187,7 +1187,7 @@ function diaspora_comment($importer,$xml,$msg) { 'to_email' => $importer['email'], 'uid' => $importer['uid'], 'item' => $datarray, - 'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, + 'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id, 'source_name' => $datarray['author-name'], 'source_link' => $datarray['author-link'], 'source_photo' => $datarray['author-avatar'], -- cgit v1.2.3 From 949c6d47b5b9a3e796cdf6dff79d6d532f4a3159 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 16 Mar 2012 15:19:38 -0700 Subject: add "send pm" link to photo dropdown for Diaspora contacts --- include/conversation.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/conversation.php b/include/conversation.php index 88ecf502b..8ca484c9e 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -779,6 +779,17 @@ function item_photo_menu($item){ if(($cid) && (! $item['self'])) { $contact_url = $a->get_baseurl($ssl_state) . '/contacts/' . $cid; $posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $cid; + + $clean_url = normalise_link($item['author-link']); + + if((local_user()) && (local_user() == $item['uid'])) { + if(isset($a->contacts) && x($a->contacts,$clean_url)) { + if($a->contacts[$clean_url]['network'] === NETWORK_DIASPORA) { + $pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid; + } + } + } + } $menu = Array( -- cgit v1.2.3 -- cgit v1.2.3 From 82f2bfea5bbf7c35450eb8fe9ee119e0b00d3d61 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 16 Mar 2012 16:05:16 -0700 Subject: convert boolean or int settings to strings to work around issues with template processing --- mod/settings.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mod/settings.php b/mod/settings.php index f694b5840..3a8ad29d2 100755 --- a/mod/settings.php +++ b/mod/settings.php @@ -652,20 +652,20 @@ function settings_content(&$a) { $blocktags = $a->user['blocktags']; $expire_items = get_pconfig(local_user(), 'expire','items'); - $expire_items = (($expire_items===false)?1:$expire_items); // default if not set: 1 + $expire_items = (($expire_items===false)? '1' : $expire_items); // default if not set: 1 $expire_notes = get_pconfig(local_user(), 'expire','notes'); - $expire_notes = (($expire_notes===false)?1:$expire_notes); // default if not set: 1 + $expire_notes = (($expire_notes===false)? '1' : $expire_notes); // default if not set: 1 $expire_starred = get_pconfig(local_user(), 'expire','starred'); - $expire_starred = (($expire_starred===false)?1:$expire_starred); // default if not set: 1 + $expire_starred = (($expire_starred===false)? '1' : $expire_starred); // default if not set: 1 $expire_photos = get_pconfig(local_user(), 'expire','photos'); - $expire_photos = (($expire_photos===false)?0:$expire_photos); // default if not set: 0 + $expire_photos = (($expire_photos===false)? '0' : $expire_photos); // default if not set: 0 $suggestme = get_pconfig(local_user(), 'system','suggestme'); - $suggestme = (($suggestme===false)?0:$suggestme); // default if not set: 0 + $suggestme = (($suggestme===false)? '0': $suggestme); // default if not set: 0 $browser_update = intval(get_pconfig(local_user(), 'system','update_interval')); $browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds @@ -736,13 +736,13 @@ function settings_content(&$a) { )); $blockwall = replace_macros($opt_tpl,array( - '$field' => array('blockwall', t('Allow friends to post to your profile page?'), ! $a->user['blockwall'], '', array(t('No'),t('Yes'))), + '$field' => array('blockwall', t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), '', array(t('No'),t('Yes'))), )); $blocktags = replace_macros($opt_tpl,array( - '$field' => array('blocktags', t('Allow friends to tag your posts?'), ! $a->user['blocktags'], '', array(t('No'),t('Yes'))), + '$field' => array('blocktags', t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), '', array(t('No'),t('Yes'))), )); -- cgit v1.2.3 From 368d93625dc7ac206b3dbb85af15dc90f593fcd7 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 16 Mar 2012 20:29:02 -0400 Subject: make auto-complete in darkzero-NS. other themes can use this easily. might need to edit the id it hooks into Signed-off-by: Simon L'nu --- view/theme/darkzero-NS/theme.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/view/theme/darkzero-NS/theme.php b/view/theme/darkzero-NS/theme.php index 2d3e4fd56..3598e34f2 100755 --- a/view/theme/darkzero-NS/theme.php +++ b/view/theme/darkzero-NS/theme.php @@ -52,6 +52,9 @@ $('.savedsearchterm').hover( $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');} ); + // make auto-complete work in more places + $(".wall-item-comment-wrapper textarea").contact_autocomplete(baseurl+"/acl"); + }); -- cgit v1.2.3 -- cgit v1.2.3 From 49540fb958376d067f44a9274f8edeb80f10da3a Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 16 Mar 2012 21:20:23 -0400 Subject: make auto-complete work in more places Signed-off-by: Simon L'nu --- mod/display.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mod/display.php b/mod/display.php index f428149e8..81ed174ac 100755 --- a/mod/display.php +++ b/mod/display.php @@ -16,7 +16,15 @@ function display_content(&$a) { $o = '
    ' . "\r\n"; - $a->page['htmlhead'] .= ''; + $a->page['htmlhead'] .= << +$(document).ready(function() { + $(".comment-edit-wrapper textarea").contact_autocomplete(baseurl+"/acl"); + // make auto-complete work in more places + $(".wall-item-comment-wrapper textarea").contact_autocomplete(baseurl+"/acl"); +}); + +EOT; $nick = (($a->argc > 1) ? $a->argv[1] : ''); -- cgit v1.2.3 From 75883b196ed222b9972c87ce00b8e7c2ab29c05e Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 16 Mar 2012 21:23:24 -0400 Subject: remove auto-complete from darkzero-NS, dispys, since the comment one is now global Signed-off-by: Simon L'nu --- view/theme/darkzero-NS/theme.php | 3 --- view/theme/dispy/theme.php | 3 --- 2 files changed, 6 deletions(-) diff --git a/view/theme/darkzero-NS/theme.php b/view/theme/darkzero-NS/theme.php index 3598e34f2..2d3e4fd56 100755 --- a/view/theme/darkzero-NS/theme.php +++ b/view/theme/darkzero-NS/theme.php @@ -52,9 +52,6 @@ $('.savedsearchterm').hover( $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');} ); - // make auto-complete work in more places - $(".wall-item-comment-wrapper textarea").contact_autocomplete(baseurl+"/acl"); - }); diff --git a/view/theme/dispy/theme.php b/view/theme/dispy/theme.php index 9f0fcba82..26e07b1f7 100644 --- a/view/theme/dispy/theme.php +++ b/view/theme/dispy/theme.php @@ -108,9 +108,6 @@ $(document).ready(function() { $(this).css({color: '#eec'}); }); - // make auto-complete work in more places - $(".wall-item-comment-wrapper textarea").contact_autocomplete(baseurl+"/acl"); - /* $('#profile-photo-wrapper').mouseover(function() { $('.profile-edit-side-div').css({display: 'block'}); }).mouseout(function() { -- cgit v1.2.3 -- cgit v1.2.3 From 87fdae2dd8bdb9e01ce3d98f6ea94d83664cb4c2 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Sat, 17 Mar 2012 01:55:40 -0400 Subject: [fix] whitespace in photo_view and like_noshare. dispy-dark clean up Signed-off-by: Simon L'nu --- view/like_noshare.tpl | 8 ++++---- view/photo_view.tpl | 2 +- view/theme/dispy-dark/photo_view.tpl | 13 +++++-------- view/theme/dispy-dark/theme.php | 3 --- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/view/like_noshare.tpl b/view/like_noshare.tpl index 2c467c3c2..2651ea1f8 100755 --- a/view/like_noshare.tpl +++ b/view/like_noshare.tpl @@ -1,5 +1,5 @@ + + + +
    diff --git a/view/photo_view.tpl b/view/photo_view.tpl index 5dbcabadf..732caf690 100755 --- a/view/photo_view.tpl +++ b/view/photo_view.tpl @@ -14,7 +14,7 @@
    {{ if $nextlink }}{{ endif }}
    -
    $desc
    +
    $desc
    {{ if $tags }}
    $tags.0
    $tags.1
    diff --git a/view/theme/dispy-dark/photo_view.tpl b/view/theme/dispy-dark/photo_view.tpl index f1209ec58..732caf690 100644 --- a/view/theme/dispy-dark/photo_view.tpl +++ b/view/theme/dispy-dark/photo_view.tpl @@ -4,18 +4,15 @@ - -
    - {{ if $prevlink }}{{ endif }} - - {{ if $nextlink }}{{ endif }} +{{ if $lock }} | $lock {{ endif }}
    +{{ if $prevlink }}{{ endif }} +
    +{{ if $nextlink }}{{ endif }}
    $desc
    {{ if $tags }} diff --git a/view/theme/dispy-dark/theme.php b/view/theme/dispy-dark/theme.php index b57971db9..700136173 100644 --- a/view/theme/dispy-dark/theme.php +++ b/view/theme/dispy-dark/theme.php @@ -108,9 +108,6 @@ $(document).ready(function() { $(this).css({color: '#eec'}); }); - // make auto-complete work in more places - $(".wall-item-comment-wrapper textarea").contact_autocomplete(baseurl+"/acl"); - /* $('#profile-photo-wrapper').mouseover(function() { $('.profile-edit-side-div').css({display: 'block'}); }).mouseout(function() { -- cgit v1.2.3 From 511d8a30a05f76a08582f2d7a9ccd78dbd744c57 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 16 Mar 2012 23:51:49 -0700 Subject: scheme checking for webservers without $_SERVER['HTTPS'] --- boot.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 322340e5d..836900fc4 100755 --- a/boot.php +++ b/boot.php @@ -286,7 +286,12 @@ class App { startup(); - $this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'])) ? 'https' : 'http' ); + $this->scheme = 'http'; + if(x($_SERVER,'HTTPS') && $_SERVER['HTTPS']) + $this->scheme = 'https'; + elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443)) + $this->scheme = 'https'; + if(x($_SERVER,'SERVER_NAME')) { $this->hostname = $_SERVER['SERVER_NAME']; -- cgit v1.2.3 From 057a142b8cd01cd8ab6212e9d958989c82dfccc3 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 17 Mar 2012 00:08:52 -0700 Subject: cut/paste error --- mod/item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/item.php b/mod/item.php index 07b4bfef7..fe570075f 100755 --- a/mod/item.php +++ b/mod/item.php @@ -857,7 +857,7 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { if(strpos($tag,'@') === 0) { //is it already replaced? if(strpos($tag,'[url=')) - continue; + return; $stat = false; //get the person's name $name = substr($tag,1); -- cgit v1.2.3 -- cgit v1.2.3 From e0e008fb8d894c7fe56fbb88fa96224c0796ea75 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 17 Mar 2012 02:26:52 -0700 Subject: template processor broken with foreach k=>v and k is integer 0 --- include/template_processor.php | 2 +- mod/admin.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/template_processor.php b/include/template_processor.php index 7f7b0b55b..93bf391c5 100755 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -96,7 +96,7 @@ $this->_push_stack(); $r = $this->r; $r[$varname] = $v; - if ($keyname!='') $r[$keyname] = $k; + if ($keyname!='') $r[$keyname] = (($k === 0) ? '0' : $k); $ret .= $this->replace($args[3], $r); $this->_pop_stack(); } diff --git a/mod/admin.php b/mod/admin.php index 88ccad6d3..a64b26903 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -308,7 +308,7 @@ function admin_page_site(&$a) { SSL_POLICY_FULL => t("Force all links to use SSL"), SSL_POLICY_SELFSIGN => t("Self-signed certificate, use SSL for local links only (discouraged)") ); - + $t = get_markup_template("admin_site.tpl"); return replace_macros($t, array( '$title' => t('Administration'), @@ -325,7 +325,7 @@ function admin_page_site(&$a) { '$banner' => array('banner', t("Banner/Logo"), $banner, ""), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles"), $theme_choices), - '$ssl_policy' => array('ssl_policy', t("SSL link policy"), get_config('system','ssl_policy'), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), + '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$register_policy' => array('register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices), -- cgit v1.2.3 From 26258bca77aa3385dacf36874f7f5603eaef9a6b Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 17 Mar 2012 02:36:59 -0700 Subject: compare ssl_policy precisely in case somebody was bitten by template processor bug --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 836900fc4..b0a631170 100755 --- a/boot.php +++ b/boot.php @@ -385,7 +385,7 @@ class App { $scheme = $this->scheme; if((x($this->config,'system')) && (x($this->config['system'],'ssl_policy'))) { - if($this->config['system']['ssl_policy'] == SSL_POLICY_FULL) + if(intval($this->config['system']['ssl_policy']) === intval(SSL_POLICY_FULL)) $scheme = 'https'; // We need to populate the $ssl flag across the entire program before turning this on. -- cgit v1.2.3 From 94fac6d76725042fc176aaebd2af721ab1540ff7 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 17 Mar 2012 03:43:02 -0700 Subject: queue optimisation - back off delivery attempts to once per hour after the first 12 hours. --- include/queue.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/queue.php b/include/queue.php index d312b50f5..7e92705be 100755 --- a/include/queue.php +++ b/include/queue.php @@ -61,13 +61,18 @@ function queue_run($argv, $argc){ q("DELETE FROM `queue` WHERE `created` < UTC_TIMESTAMP() - INTERVAL 3 DAY"); } - if($queue_id) + if($queue_id) { $r = q("SELECT `id` FROM `queue` WHERE `id` = %d LIMIT 1", intval($queue_id) ); - else - $r = q("SELECT `id` FROM `queue` WHERE `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE "); + } + else { + // For the first 12 hours we'll try to deliver every 15 minutes + // After that, we'll only attempt delivery once per hour. + + $r = q("SELECT `id` FROM `queue` WHERE (( `created` > UTC_TIMESTAMP() - INTERVAL 12 HOUR && `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ) OR ( `last` < UTC_TIMESTAMP() - INTERVAL 1 HOUR ))"); + } if(! count($r)){ return; } -- cgit v1.2.3 From 67fd539f53756723d844dd204639146587f5bb76 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 17 Mar 2012 18:15:36 -0700 Subject: bug #337, call template_unescape() only at the end of template processing --- boot.php | 2 +- include/network.php | 4 ++-- include/template_processor.php | 2 +- include/text.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/boot.php b/boot.php index b0a631170..b3c79079a 100755 --- a/boot.php +++ b/boot.php @@ -9,7 +9,7 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1283' ); +define ( 'FRIENDICA_VERSION', '2.3.1284' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1132 ); diff --git a/include/network.php b/include/network.php index c72919dd8..22157ff18 100755 --- a/include/network.php +++ b/include/network.php @@ -303,7 +303,7 @@ function webfinger_dfrn($s,&$hcard) { if(! function_exists('webfinger')) { -function webfinger($s) { +function webfinger($s, $debug = false) { $host = ''; if(strstr($s,'@')) { $host = substr($s,strpos($s,'@') + 1); @@ -328,7 +328,7 @@ function webfinger($s) { }} if(! function_exists('lrdd')) { -function lrdd($uri) { +function lrdd($uri, $debug = false) { $a = get_app(); diff --git a/include/template_processor.php b/include/template_processor.php index 93bf391c5..4c317efe1 100755 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -203,7 +203,7 @@ $os=$s; $count++; $s = $this->var_replace($s); } - return template_unescape($s); + return $s; } } diff --git a/include/text.php b/include/text.php index cdf82ca87..89acbf9fa 100644 --- a/include/text.php +++ b/include/text.php @@ -20,7 +20,7 @@ function replace_macros($s,$r) { //$a = get_app(); //$a->page['debug'] .= "$tt
    \n"; - return $r; + return template_unescape($r); }} -- cgit v1.2.3 From 9e731506c2ccc05cf1eab98868d5c1bdbd0967ba Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 17 Mar 2012 22:14:17 -0700 Subject: remove admin view of local directory --- .../tiny_mce/plugins/bbcode/editor_plugin_src.js | 197 +++++++-------------- mod/directory.php | 17 +- 2 files changed, 63 insertions(+), 151 deletions(-) diff --git a/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js index 183f2bc68..e5f716b29 100755 --- a/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -45,78 +45,34 @@ s = tinymce.trim(s); function rep(re, str) { - - //modify code to keep stuff intact within [code][/code] blocks - //Waitman Gobble NO WARRANTY - - - var o = new Array(); - var x = s.split("[code]"); - var i = 0; - - var si = ""; - si = x.shift(); - si = si.replace(re,str); - o.push(si); - - for (i = 0; i < x.length; i++) { - var no = new Array(); - var j = x.shift(); - var g = j.split("[/code]"); - no.push(g.shift()); - si = g.shift(); - si = si.replace(re,str); - no.push(si); - o.push(no.join("[/code]")); - } - - s = o.join("[code]"); - + s = s.replace(re, str); }; - - - - - /* oembed */ - function _h2b_cb(match) { - /* - function s_h2b(data) { - match = data; + + + + + /* oembed */ + function _h2b_cb(match) { + function s_h2b(data) { + match = data; } $.ajax({ - type:"POST", + type:"POST", url: 'oembed/h2b', - data: {text: match}, - async: false, - success: s_h2b, - dataType: 'html' - }); - */ - - var f, g, tof = [], tor = []; - var find_spanc = /]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:]*>(.*?)<\/span *>)*.*?)<\/span *>/ig; - while (f = find_spanc.exec(match)) { - var find_a = /]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig; - if (g = find_a.exec(f[1])) { - var find_href = /href=[\"']([^\"']*)[\"']/ig; - var m2 = find_href.exec(g[1]); - if (m2[1]) { - tof.push(f[0]); - tor.push("[EMBED]" + m2[1] + "[/EMBED]"); - } - } - } - for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]); - - return match; - } + data: {text: match}, + async: false, + success: s_h2b, + dataType: 'html' + }); + return match; + } if (s.indexOf('class="oembed')>=0){ //alert("request oembed html2bbcode"); s = _h2b_cb(s); } - - /* /oembed */ - + + /* /oembed */ + // example: to [b] rep(/(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]"); @@ -129,16 +85,16 @@ rep(//gi,"[img=$3x$2]$1[/img]"); rep(//gi,"[img=$2x$3]$1[/img]"); rep(//gi,"[img]$1[/img]"); - - rep(/