code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Start work</title> <meta http-equiv="content-type" content="text/javascript;charset=UTF-8" /> <link type="text/css" rel="stylesheet" href="css/grid.css"/> <link type="text/css" rel="stylesheet" href="css/frontend.styles.css"/> <link type="text/css" rel="stylesheet" href="css/typography.css"/> </head> <body> <div class="head"> <div class="first"> <div class="h-36 p-b-4 gcontain l-50-pc reprefix-12"> <div id="hotline" class="hotline p-t-8 p-b-8 p-l-32 l-h-20 grid_x p-r-8"> HOTLINE : <strong>0909 199 199 - (08) 6 2872 931</strong> </div> <div id="auth" class="auth p-t-8 p-l-32 p-b-8 p-r-8 l-h-20 grid_x f-r"> <a href="">Đăng ký</a> | <a href="">Đăng nhập</a> </div> </div> </div> <div class="second gcontain h-g-4 l-50-pc reprefix-12"> <div id="logo" class="grid_8 h-g-4"> <a href="start_home.html"> <img src="images/logo.png" alt=""/> </a> </div> <div id="nav" class="nav"> <ul> <li><a class="active" href="start_home.html">TRANG CHỦ</a></li> <li><a href="about.html">GIỚI THIỆU</a></li> <li><a href="service.html">DỊCH VỤ</a></li> <li><a href="project.html">DỰ ÁN</a></li> <li><a href="contact.html">LIÊN LẠC</a></li> </ul> </div> </div> </div> <!-- <div id="slider" class="slider b-g-c-ccc p-r"> <div class="gcontain h-g-10 l-50-pc reprefix-12 "> <img src='images/slider1.png' width="960" height="400" alt=""/> </div> <div class="nav t-a-c"> <a class="active">1</a> <a>1</a> <a>1</a> <a>1</a> </div> </div>--> <!-- <div id="banner" class="banner b-g-c-blue"> </div>--> <div class="service-banner"> <div class="gcontain l-50-pc reprefix-12 "> <div class="title">Service - What can we do for you?</div> </div> </div> <div class="main"> <div class="gcontain l-50-pc reprefix-12"> <div class="p-t-40"> <div class="grid_7"> <div class="nav_bar"> <div class="title">EVENT & MARKETING</div> <ul> <li class="active"><a href="">Activities</a></li> <li><a href="">Coffee marketing chanel</a></li> <li><a href="">Digital marketing</a></li> <li><a href="">Leaflet, Brodurce</a></li> </ul> <div class="back m-t-32">BACK TO SERVICES</div> </div> </div> <div class="grid_17"> <div class="intro prefix_1"> <div class="title"> <h2>Activities</h2> </div> <div class="t-a-j p-b-40 p-t-40"> <img src='images/image0.png' alt=""/><br/><br/><br/> Giá xăng giảm 410-420 đồng một lít<br/> Mức giảm giá xăng dầu các doanh nghiệp áp dụng chỉ nhỉnh hơn vài đồng so với yêu cầu tối thiểu mà Liên bộ Tài chính - Công Thương đưa ra chiều 18/4.<br/> > Chủ tịch Petrolimex: 'Nhiều cơ hội giảm giá xăng dầu'<br/> > Lời hứa minh bạch sau cú sốc giá xăng dầu<br/> Giá xăng giảm lần thứ hai trong tháng tư. Nhưng tính cả hai lần giảm vẫn chưa bằng lần tăng cuối tháng 3. Ảnh: Hoàng Hà Bộ Tài chính phát đi thông cáo báo chí vào cuối chiều 18/4, một ngày trước kỳ nghỉ lễ Giỗ Tổ Hùng Vương 10/3 âm lịch. Theo đó, cùng với việc tăng thuế nhập khẩu, Liên Bộ Tài chính Công Thương yêu cầu các doanh nghiệp xăng dầu phải giảm giá bán lẻ không muộn hơn 19h ngày<br/> Quy đổi theo tỷ giá đôla Mỹ của Vietcombank chiều 18/4, một lít xăng RON92 nhập khẩu có giá 15.091 đồng, chưa bao gồm các loại thuế, phí. Nếu tính thuế nhập khẩu (14%), thuế tiêu thụ đặc biệt (10%) và VAT (10%), giá lên đến gần 20.820 đồng một lít. Trong công thức tính giá bán lẻ xăng dầu, các doanh nghiệp còn tính thêm lợi nhuận định mức, phí xăng dầu, trích quỹ bình ổn.<br/> Bộ cho biết giá xăng dầu thế giới kể từ sau ngày giảm giá bán lẻ trong nước gần nhất (ngày 9/4) tiếp tục biến động theo xu hướng giảm. Bình quân 30 ngày tính đến ngày 18/4, giá xăng RON 92 là 114,67 USD một thùng; dầu diezen 0,05S có giá 119,42 USD; dầu hỏa 118,90 USD một thùng và dầu mazut 180 cst: 625,18 USD một tấn.<br/> Trước diễn biến này, Bộ Tài chính quyết định khôi phục một bước thuế suất thuế nhập khẩu xăng, dầu sau khi duy trì từ suốt 11/9/2012 đến nay. Theo đó thuế nhập khẩu các mặt hàng đồng loạt tăng thêm 2%, trong đó xăng lên 14%; dầu diezen lên 10%, dầu hỏa 12%, dầu mazut 12%.<br/> Theo lý giải của Bộ Tài chính, thuế suất thuế nhập khẩu nhiên liệu đều thấp hơn barem quy định nhằm giúp bình ổn kinh tế vĩ mô, bình ổn giá xăng dầu khi thế giới lên cao. Barem thuế với xăng là 20%, diezen 15%, dầu hỏa 20% và mazut là 15%.<br/> Biểu giá bán lẻ xăng của Petrolimex trước khi điều chỉnh:<br/> </div> <div class="title"> <h2>Activities</h2> </div> <div class="t-a-j"> Giá xăng giảm 410-420 đồng một lít<br/> Mức giảm giá xăng dầu các doanh nghiệp áp dụng chỉ nhỉnh hơn vài đồng so với yêu cầu tối thiểu mà Liên bộ Tài chính - Công Thương đưa ra chiều 18/4.<br/> > Chủ tịch Petrolimex: 'Nhiều cơ hội giảm giá xăng dầu'<br/> > Lời hứa minh bạch sau cú sốc giá xăng dầu<br/> Giá xăng giảm lần thứ hai trong tháng tư. Nhưng tính cả hai lần giảm vẫn chưa bằng lần tăng cuối tháng 3. Ảnh: Hoàng Hà Bộ Tài chính phát đi thông cáo báo chí vào cuối chiều 18/4, một ngày trước kỳ nghỉ lễ Giỗ Tổ Hùng Vương 10/3 âm lịch. Theo đó, cùng với việc tăng thuế nhập khẩu, Liên Bộ Tài chính Công Thương yêu cầu các doanh nghiệp xăng dầu phải giảm giá bán lẻ không muộn hơn 19h ngày<br/> Quy đổi theo tỷ giá đôla Mỹ của Vietcombank chiều 18/4, một lít xăng RON92 nhập khẩu có giá 15.091 đồng, chưa bao gồm các loại thuế, phí. Nếu tính thuế nhập khẩu (14%), thuế tiêu thụ đặc biệt (10%) và VAT (10%), giá lên đến gần 20.820 đồng một lít. Trong công thức tính giá bán lẻ xăng dầu, các doanh nghiệp còn tính thêm lợi nhuận định mức, phí xăng dầu, trích quỹ bình ổn.<br/> Bộ cho biết giá xăng dầu thế giới kể từ sau ngày giảm giá bán lẻ trong nước gần nhất (ngày 9/4) tiếp tục biến động theo xu hướng giảm. Bình quân 30 ngày tính đến ngày 18/4, giá xăng RON 92 là 114,67 USD một thùng; dầu diezen 0,05S có giá 119,42 USD; dầu hỏa 118,90 USD một thùng và dầu mazut 180 cst: 625,18 USD một tấn.<br/> Trước diễn biến này, Bộ Tài chính quyết định khôi phục một bước thuế suất thuế nhập khẩu xăng, dầu sau khi duy trì từ suốt 11/9/2012 đến nay. Theo đó thuế nhập khẩu các mặt hàng đồng loạt tăng thêm 2%, trong đó xăng lên 14%; dầu diezen lên 10%, dầu hỏa 12%, dầu mazut 12%.<br/> Theo lý giải của Bộ Tài chính, thuế suất thuế nhập khẩu nhiên liệu đều thấp hơn barem quy định nhằm giúp bình ổn kinh tế vĩ mô, bình ổn giá xăng dầu khi thế giới lên cao. Barem thuế với xăng là 20%, diezen 15%, dầu hỏa 20% và mazut là 15%.<br/> Biểu giá bán lẻ xăng của Petrolimex trước khi điều chỉnh:<br/> </div> </div> </div> </div> </div> </div> <div class="clear"></div> <div class="p-r"> <div class="gcontain l-50-pc reprefix-12 "> <div class="foot-line"></div> </div> </div> <div class="clear"></div> <div id="banner" class="footer"> </div>
0x6a
trunk/libraries/frontend/html/service_page.html
HTML
asf20
9,720
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Start work</title> <meta http-equiv="content-type" content="text/javascript;charset=UTF-8" /> <link type="text/css" rel="stylesheet" href="css/grid.css"/> <link type="text/css" rel="stylesheet" href="css/frontend.styles.css"/> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.js"></script> <script type="text/javascript" src="http://malsup.github.io/jquery.cycle.all.js"></script> <!-- <script type="text/javascript" src="http://code.jquery.com/jquery-migrate-1.0.0.js"></script>--> <script type="text/javascript"> $(document).ready(function(){ $('.cycleSlider').cycle({ timeout: 3000 , pager: '#cycleNav', activePagerClass:'active', pagerAnchorBuilder: function(idx, slide) { return '<a href="#">'+idx+'</a>'; } }); }); </script> </head> <body> <div class="head"> <div class="first"> <div class="h-36 p-b-4 gcontain l-50-pc reprefix-12"> <div id="hotline" class="hotline p-t-8 p-b-8 p-l-32 l-h-20 grid_x p-r-8"> Hotline : <strong>0909 199 199 - (08) 6 2872 931</strong> </div> <div id="auth" class="auth p-t-8 p-l-32 p-b-8 p-r-8 l-h-20 grid_x f-r"> <a href="">Đăng ký&nbsp; </a> | <a href="">&nbsp;Đăng nhập</a> </div> </div> </div> <div class="second gcontain h-g-4 l-50-pc reprefix-12"> <div id="logo" class="grid_8 h-g-4"> <a href="start_home.html"> <img src="images/logo.png" alt=""/> </a> </div> <div id="nav" class="nav"> <ul> <li><a class="active" href="start_home.html">TRANG CHỦ</a></li> <li><a href="about.html">GIỚI THIỆU</a></li> <li><a href="service.html">DỊCH VỤ</a></li> <li><a href="project.html">DỰ ÁN</a></li> <li><a href="contact.html">LIÊN LẠC</a></li> </ul> </div> </div> </div> <div id="slider" class="slider b-g-c-ccc p-r"> <div class="gcontain h-g-10 l-50-pc reprefix-12 cycleSlider"> <img src='images/slider1.jpg' width="960" height="400" alt=""/> <img src='images/slider2.jpg' width="960" height="400" alt=""/> </div> <div id="cycleNav" class="nav t-a-c"></div> </div> <div id="banner" class="banner"> </div> <div class="main"> <div class="gcontain l-50-pc reprefix-12"> <div class="services"> <a class="event">Events & Marketing</a> <a class="event2">Printing</a> <a class="event3">Design & Branding</a> <a class="event4">Production</a> </div> <div class="intro"> <div class="left grid_12"> <div class="p-r-20"> <div class="title"> <h2>Chúng tôi có</h2> </div> <ul> <li><a class="active" href="">Đội ngũ nhân viên tư vấn chuyên nghiệp</a></li> <li><a href="">GIỚI THIỆU</a></li> <li><a href="">DỊCH VỤ</a></li> <li><a href="">DỰ ÁN</a></li> <li><a href="">LIÊN LẠC</a></li> </ul> </div> </div> <div class="right grid_12"> <div class="p-l-20"> <div class="title"> <h2>Chúng tôi sẽ giúp bạn</h2> </div> <ul> <li><a class="active" href="">Đội ngũ nhân viên tư vấn chuyên nghiệp</a></li> <li><a href="">GIỚI THIỆU</a></li> <li><a href="">DỊCH VỤ</a></li> <li><a href="">DỰ ÁN</a></li> <li><a href="">LIÊN LẠC</a></li> </ul> </div> </div> <div class="clear"></div> <div class="projects p-t-32"> <div class="title"> <h2>Các dự án đã thực hiện <a href="" class="f-r">Xem thêm ››</a></h2> </div> <div class="list" style="height: 212px"> <div class="left"> <img src='images/product1.png' alt=""/> <h3>THis is the name of project</h3> </div> <div class="center"> <img src='images/pr2.png' alt=""/> <h3>THis is the name of project</h3> </div> <div class="right"> <img src='images/pr3.png' alt=""/> <h3>THis is the name of project</h3> </div> </div> </div> <div class="clear"></div> <div class="p-t-32"> <div class="title"> <h2>Khách hàng của chúng tôi</h2> </div> <div class="list p-t-20 p-b-20"> <div class="b-d-c-ddd p-t-16 p-b-16"> <div class="customer"><a href=""><img src="images/cus_logo.jpg" alt=""/></a></div> <div class="customer"><a href=""><img src="images/cus_logo.jpg" alt=""/></a></div> <div class="customer"><a href=""><img src="images/cus_logo.jpg" alt=""/></a></div> <div class="customer"><a href=""><img src="images/cus_logo.jpg" alt=""/></a></div> <div class="customer"><a href=""><img src="images/cus_logo.jpg" alt=""/></a></div> <div class="customer"><a href=""><img src="images/cus_logo.jpg" alt=""/></a></div> <div class="clear"></div> </div> </div> </div> <div class="clear"></div> </div> </div> </div> <div class="clear"></div> <div class="p-r"> <div class="gcontain l-50-pc reprefix-12 "> <div class="foot-line"></div> </div> </div> <div class="clear"></div> <div id="banner" class="footer"> </div>
0x6a
trunk/libraries/frontend/html/index.html
HTML
asf20
7,572
/* jshint forin:true, noarg:true, noempty:true, eqeqeq:true, boss:true, undef:true, curly:true, browser:true, jquery:true */ /* * jQuery MultiSelect UI Widget 1.14pre * Copyright (c) 2012 Eric Hynds * * http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ * * Depends: * - jQuery 1.4.2+ * - jQuery UI 1.8 widget factory * * Optional: * - jQuery UI effects * - jQuery UI position utility * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */ (function($, undefined) { var multiselectID = 0; var $doc = $(document); $.widget("ech.multiselect", { // default options options: { header: true, height: 175, minWidth: 224, //menuwidth: 224, classes: '', checkAllText: 'Check all', uncheckAllText: 'Uncheck all', noneSelectedText: 'Select options', selectedText: '# selected', selectedList: 0, show : null, hide : null, autoOpen : false, multiple : true, position : {}, style :{} }, _create: function() { var el = this.element.hide(); var o = this.options; this.speed = $.fx.speeds._default; // default speed for effects this._isOpen = false; // assume no // create a unique namespace for events that the widget // factory cannot unbind automatically. Use eventNamespace if on // jQuery UI 1.9+, and otherwise fallback to a custom string. this._namespaceID = this.eventNamespace || ('multiselect' + multiselectID); var button = (this.button = $('<div><span class="ui-icon ui-icon-triangle-1-s"></span></div>')) .addClass('ui-multiselect ui-widget ui-state-default ui-corner-all') .addClass(o.classes) .attr({ 'title':el.attr('title'), 'aria-haspopup':true, 'tabIndex':el.attr('tabIndex') }) .insertBefore(el), buttonlabel = (this.buttonlabel = $('<span />')) .html(o.noneSelectedText) .appendTo(button), menu = (this.menu = $('<div />')) .addClass('ui-multiselect-menu ui-widget ui-widget-content ui-corner-all') .addClass(o.classes) .appendTo(document.body), header = (this.header = $('<div />')) .addClass('ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix') .appendTo(menu), headerLinkContainer = (this.headerLinkContainer = $('<ul />')) .addClass('ui-helper-reset') .html(function() { if(o.header === true) { return '<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>' + o.checkAllText + '</span></a></li><li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>' + o.uncheckAllText + '</span></a></li>'; } else if(typeof o.header === "string") { return '<li>' + o.header + '</li>'; } else { return ''; } }) .append('<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="ui-icon ui-icon-circle-close"></span></a></li>') .appendTo(header), checkboxContainer = (this.checkboxContainer = $('<ul />')) .addClass('ui-multiselect-checkboxes ui-helper-reset') .appendTo(menu); if(o.biz) menu.addClass("m-w-a"); // perform event bindings this._bindEvents(); // build menu this.refresh(true); // some addl. logic for single selects if(!o.multiple) { menu.addClass('ui-multiselect-single'); } if(o.style) menu.css(o.style); // bump unique ID multiselectID++; }, _init: function() { if(this.options.header === false) { this.header.hide(); } if(!this.options.multiple) { this.headerLinkContainer.find('.ui-multiselect-all, .ui-multiselect-none').hide(); } if(this.options.autoOpen) { this.open(); } if(this.element.is(':disabled')) { this.disable(); } }, refresh: function(init) { var el = this.element; var o = this.options; var menu = this.menu; var checkboxContainer = this.checkboxContainer; var optgroups = []; var html = ""; var id = el.attr('id') || multiselectID++; // unique ID for the label & option tags // build items el.find('option').each(function(i) { var $this = $(this); var parent = this.parentNode; var title = this.innerHTML; var description = this.title; var value = this.value; var inputID = 'ui-multiselect-' + (this.id || id + '-option-' + i); var isDisabled = this.disabled; var isSelected = this.selected; var labelClasses = [ 'ui-corner-all' ]; var liClasses = (isDisabled ? 'ui-multiselect-disabled ' : ' ') + this.className; var optLabel; // is this an optgroup? if(parent.tagName === 'OPTGROUP') { optLabel = parent.getAttribute('label'); // has this optgroup been added already? if($.inArray(optLabel, optgroups) === -1) { html += '<li class="ui-multiselect-optgroup-label ' + parent.className + '"><a href="#">' + optLabel + '</a></li>'; optgroups.push(optLabel); } } if(isDisabled) { labelClasses.push('ui-state-disabled'); } // browsers automatically select the first option // by default with single selects if(isSelected && !o.multiple) { labelClasses.push('ui-state-active'); } html += '<li class="' + liClasses + '">'; // create the label html += '<label for="' + inputID + '" title="' + description + '" class="' + labelClasses.join(' ') + '">'; html += '<input id="' + inputID + '" name="multiselect_' + id + '" type="' + (o.multiple ? "checkbox" : "radio") + '" value="' + value + '" title="' + title + '"'; // pre-selected? if(isSelected) { html += ' checked="checked"'; html += ' aria-selected="true"'; } // disabled? if(isDisabled) { html += ' disabled="disabled"'; html += ' aria-disabled="true"'; } // add the title and close everything off html += ' /><span>' + title + '</span></label></li>'; }); // insert into the DOM checkboxContainer.html(html); // cache some moar useful elements this.labels = menu.find('label'); this.inputs = this.labels.children('input'); // set widths this._setButtonWidth(); this._setMenuWidth(); // remember default value this.button[0].defaultValue = this.update(); // broadcast refresh event; useful for widgets if(!init) { this._trigger('refresh'); } }, // updates the button text. call refresh() to rebuild update: function() { var o = this.options; var $inputs = this.inputs; var $checked = $inputs.filter(':checked'); var numChecked = $checked.length; var value; if(numChecked === 0) { value = o.noneSelectedText; } else { if($.isFunction(o.selectedText)) { value = o.selectedText.call(this, numChecked, $inputs.length, $checked.get()); } else if(/\d/.test(o.selectedList) && o.selectedList > 0 && numChecked <= o.selectedList) { value = $checked.map(function() { return $(this).next().html(); }).get().join(', '); } else { value = o.selectedText.replace('#', numChecked).replace('#', $inputs.length); } } this._setButtonValue(value); return value; }, // this exists as a separate method so that the developer // can easily override it. _setButtonValue: function(value) { this.buttonlabel.text(value); }, // binds events _bindEvents: function() { var self = this; var button = this.button; function clickHandler() { self[ self._isOpen ? 'close' : 'open' ](); return false; } // webkit doesn't like it when you click on the span :( button .find('span') .bind('click.multiselect', clickHandler); // button events button.bind({ click: clickHandler, keypress: function(e) { switch(e.which) { case 27: // esc case 38: // up case 37: // left self.close(); break; case 39: // right case 40: // down self.open(); break; } }, mouseenter: function() { if(!button.hasClass('ui-state-disabled')) { $(this).addClass('ui-state-hover'); } }, mouseleave: function() { $(this).removeClass('ui-state-hover'); }, focus: function() { if(!button.hasClass('ui-state-disabled')) { $(this).addClass('ui-state-focus'); } }, blur: function() { $(this).removeClass('ui-state-focus'); } }); // header links this.header.delegate('a', 'click.multiselect', function(e) { // close link if($(this).hasClass('ui-multiselect-close')) { self.close(); // check all / uncheck all } else { self[$(this).hasClass('ui-multiselect-all') ? 'checkAll' : 'uncheckAll'](); } e.preventDefault(); }); // optgroup label toggle support this.menu.delegate('li.ui-multiselect-optgroup-label a', 'click.multiselect', function(e) { e.preventDefault(); var $this = $(this); var $inputs = $this.parent().nextUntil('li.ui-multiselect-optgroup-label').find('input:visible:not(:disabled)'); var nodes = $inputs.get(); var label = $this.parent().text(); // trigger event and bail if the return is false if(self._trigger('beforeoptgrouptoggle', e, { inputs:nodes, label:label }) === false) { return; } // toggle inputs self._toggleChecked( $inputs.filter(':checked').length !== $inputs.length, $inputs ); self._trigger('optgrouptoggle', e, { inputs: nodes, label: label, checked: nodes[0].checked }); }) .delegate('label', 'mouseenter.multiselect', function() { if(!$(this).hasClass('ui-state-disabled')) { self.labels.removeClass('ui-state-hover'); $(this).addClass('ui-state-hover').find('input').focus(); } }) .delegate('label', 'keydown.multiselect', function(e) { e.preventDefault(); switch(e.which) { case 9: // tab case 27: // esc self.close(); break; case 38: // up case 40: // down case 37: // left case 39: // right self._traverse(e.which, this); break; case 13: // enter $(this).find('input')[0].click(); break; } }) .delegate('input[type="checkbox"], input[type="radio"]', 'click.multiselect', function(e) { var $this = $(this); var val = this.value; var checked = this.checked; var tags = self.element.find('option'); // bail if this input is disabled or the event is cancelled if(this.disabled || self._trigger('click', e, { value: val, text: this.title, checked: checked }) === false) { e.preventDefault(); return; } // make sure the input has focus. otherwise, the esc key // won't close the menu after clicking an item. $this.focus(); // toggle aria state $this.attr('aria-selected', checked); // change state on the original option tags tags.each(function() { if(this.value === val) { this.selected = checked; } else if(!self.options.multiple) { this.selected = false; } }); // some additional single select-specific logic if(!self.options.multiple) { self.labels.removeClass('ui-state-active'); $this.closest('label').toggleClass('ui-state-active', checked); // close menu self.close(); } // fire change on the select box self.element.trigger("change"); // setTimeout is to fix multiselect issue #14 and #47. caused by jQuery issue #3827 // http://bugs.jquery.com/ticket/3827 setTimeout($.proxy(self.update, self), 10); }); // close each widget when clicking on any other element/anywhere else on the page $doc.bind('mousedown.' + this._namespaceID, function(event) { var target = event.target; if(self._isOpen && !$.contains(self.menu[0], target) && !$.contains(self.button[0], target) && target !== self.button[0] && target !== self.menu[0]) { self.close(); } }); // deal with form resets. the problem here is that buttons aren't // restored to their defaultValue prop on form reset, and the reset // handler fires before the form is actually reset. delaying it a bit // gives the form inputs time to clear. $(this.element[0].form).bind('reset.multiselect', function() { setTimeout($.proxy(self.refresh, self), 10); }); }, // set button width _setButtonWidth: function() { var width = this.element.outerWidth(); var o = this.options; if(/\d/.test(o.minWidth) && width < o.minWidth) { width = o.minWidth; } // set widths this.button.outerWidth(width); }, // set menu width _setMenuWidth: function() { var w=this.button.outerWidth(); try{ if( this.options.menuwidth){ if( this.options.menuwidth == 'auto' ) if(this.menu.outerWidth()>w) w=this.options.menuwidth; else w=this.options.menuwidth; } }catch(e){ } var m = this.menu; m.outerWidth(w); }, // move up or down within the menu _traverse: function(which, start) { var $start = $(start); var moveToLast = which === 38 || which === 37; // select the first li that isn't an optgroup label / disabled $next = $start.parent()[moveToLast ? 'prevAll' : 'nextAll']('li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup-label)')[ moveToLast ? 'last' : 'first'](); // if at the first/last element if(!$next.length) { var $container = this.menu.find('ul').last(); // move to the first/last this.menu.find('label')[ moveToLast ? 'last' : 'first' ]().trigger('mouseover'); // set scroll position $container.scrollTop(moveToLast ? $container.height() : 0); } else { $next.find('label').trigger('mouseover'); } }, // This is an internal function to toggle the checked property and // other related attributes of a checkbox. // // The context of this function should be a checkbox; do not proxy it. _toggleState: function(prop, flag) { return function() { if(!this.disabled) { this[ prop ] = flag; } if(flag) { this.setAttribute('aria-selected', true); } else { this.removeAttribute('aria-selected'); } }; }, _toggleChecked: function(flag, group) { var $inputs = (group && group.length) ? group : this.inputs; var self = this; // toggle state on inputs $inputs.each(this._toggleState('checked', flag)); // give the first input focus $inputs.eq(0).focus(); // update button text this.update(); // gather an array of the values that actually changed var values = $inputs.map(function() { return this.value; }).get(); // toggle state on original option tags this.element .find('option') .each(function() { if(!this.disabled && $.inArray(this.value, values) > -1) { self._toggleState('selected', flag).call(this); } }); // trigger the change event on the select if($inputs.length) { this.element.trigger("change"); } }, _toggleDisabled: function(flag) { this.button.attr({ 'disabled':flag, 'aria-disabled':flag })[ flag ? 'addClass' : 'removeClass' ]('ui-state-disabled'); var inputs = this.menu.find('input'); var key = "ech-multiselect-disabled"; if(flag) { // remember which elements this widget disabled (not pre-disabled) // elements, so that they can be restored if the widget is re-enabled. inputs = inputs.filter(':enabled').data(key, true) } else { inputs = inputs.filter(function() { return $.data(this, key) === true; }).removeData(key); } inputs .attr({ 'disabled':flag, 'arial-disabled':flag }) .parent()[ flag ? 'addClass' : 'removeClass' ]('ui-state-disabled'); this.element.attr({ 'disabled':flag, 'aria-disabled':flag }); }, // open the menu open: function(e) { var self = this; var button = this.button; var menu = this.menu; var speed = this.speed; var o = this.options; var args = []; // bail if the multiselectopen event returns false, this widget is disabled, or is already open if(this._trigger('beforeopen') === false || button.hasClass('ui-state-disabled') || this._isOpen) { return; } var $container = menu.find('ul').last(); var effect = o.show; // figure out opening effects/speeds if($.isArray(o.show)) { effect = o.show[0]; speed = o.show[1] || self.speed; } // if there's an effect, assume jQuery UI is in use // build the arguments to pass to show() if(effect) { args = [ effect, speed ]; } // set the scroll of the checkbox container $container.scrollTop(0).height(o.height); // positon this.position(); // show the menu, maybe with a speed/effect combo $.fn.show.apply(menu, args); // select the first not disabled option // triggering both mouseover and mouseover because 1.4.2+ has a bug where triggering mouseover // will actually trigger mouseenter. the mouseenter trigger is there for when it's eventually fixed this.labels.filter(':not(.ui-state-disabled)').eq(0).trigger('mouseover').trigger('mouseenter').find('input').trigger('focus'); button.addClass('ui-state-active'); this._isOpen = true; this._trigger('open'); }, // close the menu close: function() { if(this._trigger('beforeclose') === false) { return; } var o = this.options; var effect = o.hide; var speed = this.speed; var args = []; // figure out opening effects/speeds if($.isArray(o.hide)) { effect = o.hide[0]; speed = o.hide[1] || this.speed; } if(effect) { args = [ effect, speed ]; } $.fn.hide.apply(this.menu, args); this.button.removeClass('ui-state-active').trigger('blur').trigger('mouseleave'); this._isOpen = false; this._trigger('close'); }, enable: function() { this._toggleDisabled(false); }, disable: function() { this._toggleDisabled(true); }, checkAll: function(e) { this._toggleChecked(true); this._trigger('checkAll'); }, uncheckAll: function() { this._toggleChecked(false); this._trigger('uncheckAll'); }, getChecked: function() { return this.menu.find('input').filter(':checked'); }, destroy: function() { // remove classes + data $.Widget.prototype.destroy.call(this); // unbind events $doc.unbind(this._namespaceID); this.button.remove(); this.menu.remove(); this.element.show(); return this; }, isOpen: function() { return this._isOpen; }, widget: function() { return this.menu; }, getButton: function() { return this.button; }, position: function() { var o = this.options; // use the position utility if it exists and options are specifified if($.ui.position && !$.isEmptyObject(o.position)) { o.position.of = o.position.of || this.button; this.menu .show() .position(o.position) .hide(); // otherwise fallback to custom positioning } else { var pos = this.button.offset(); this.menu.css({ top: pos.top + this.button.outerHeight(), left: pos.left }); } }, // react to option changes after initialization _setOption: function(key, value) { var menu = this.menu; switch(key) { case 'header': menu.find('div.ui-multiselect-header')[value ? 'show' : 'hide'](); break; case 'checkAllText': menu.find('a.ui-multiselect-all span').eq(-1).text(value); break; case 'uncheckAllText': menu.find('a.ui-multiselect-none span').eq(-1).text(value); break; case 'height': menu.find('ul').last().height(parseInt(value, 10)); break; case 'minWidth': this.options[key] = parseInt(value, 10); this._setButtonWidth(); this._setMenuWidth(); break; case 'selectedText': case 'selectedList': case 'noneSelectedText': this.options[key] = value; // these all needs to update immediately for the update() call this.update(); break; case 'classes': menu.add(this.button).removeClass(this.options.classes).addClass(value); break; case 'multiple': menu.toggleClass('ui-multiselect-single', !value); this.options.multiple = value; this.element[0].multiple = value; this.refresh(); break; case 'position': this.position(); break; } $.Widget.prototype._setOption.apply(this, arguments); } }); })(jQuery);
0x6a
trunk/libraries/ui-multiselect/jquery.multiselect.js
JavaScript
asf20
22,574
/* jshint forin:true, noarg:true, noempty:true, eqeqeq:true, boss:true, undef:true, curly:true, browser:true, jquery:true */ /* * jQuery MultiSelect UI Widget Filtering Plugin 1.5pre * Copyright (c) 2012 Eric Hynds * * http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ * * Depends: * - jQuery UI MultiSelect widget * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */ (function($) { var rEscape = /[\-\[\]{}()*+?.,\\\^$|#\s]/g; $.widget('ech.multiselectfilter', { options: { label: 'Filter:', width: null, /* override default width set in css file (px). null will inherit */ placeholder: 'Enter keywords', autoReset: false }, _create: function() { var opts = this.options; var elem = $(this.element); // get the multiselect instance var instance = (this.instance = (elem.data('echMultiselect') || elem.data("multiselect"))); // store header; add filter class so the close/check all/uncheck all links can be positioned correctly var header = (this.header = instance.menu.find('.ui-multiselect-header').addClass('ui-multiselect-hasfilter')); // wrapper elem var wrapper = (this.wrapper = $('<div class="ui-multiselect-filter">' + (opts.label.length ? opts.label : '') + '<input placeholder="'+opts.placeholder+'" type="search"' + (/\d/.test(opts.width) ? 'style="width:'+opts.width+'px"' : '') + ' /></div>').prependTo(this.header)); // reference to the actual inputs this.inputs = instance.menu.find('input[type="checkbox"], input[type="radio"]'); // build the input box this.input = wrapper.find('input').bind({ keydown: function(e) { // prevent the enter key from submitting the form / closing the widget if(e.which === 13) { e.preventDefault(); } }, keyup: $.proxy(this._handler, this), click: $.proxy(this._handler, this) }); // cache input values for searching this.updateCache(); // rewrite internal _toggleChecked fn so that when checkAll/uncheckAll is fired, // only the currently filtered elements are checked instance._toggleChecked = function(flag, group) { var $inputs = (group && group.length) ? group : this.labels.find('input'); var _self = this; // do not include hidden elems if the menu isn't open. var selector = instance._isOpen ? ':disabled, :hidden' : ':disabled'; $inputs = $inputs .not(selector) .each(this._toggleState('checked', flag)); // update text this.update(); // gather an array of the values that actually changed var values = $inputs.map(function() { return this.value; }).get(); // select option tags this.element.find('option').filter(function() { if(!this.disabled && $.inArray(this.value, values) > -1) { _self._toggleState('selected', flag).call(this); } }); // trigger the change event on the select if($inputs.length) { this.element.trigger('change'); } }; // rebuild cache when multiselect is updated var doc = $(document).bind('multiselectrefresh', $.proxy(function() { this.updateCache(); this._handler(); }, this)); // automatically reset the widget on close? if(this.options.autoReset) { doc.bind('multiselectclose', $.proxy(this._reset, this)); } }, // thx for the logic here ben alman _handler: function(e) { var term = $.trim(this.input[0].value.toLowerCase()), // speed up lookups rows = this.rows, inputs = this.inputs, cache = this.cache; if(!term) { rows.show(); } else { rows.hide(); var regex = new RegExp(term.replace(rEscape, "\\$&"), 'gi'); this._trigger("filter", e, $.map(cache, function(v, i) { if(v.search(regex) !== -1) { rows.eq(i).show(); return inputs.get(i); } return null; })); } // show/hide optgroups this.instance.menu.find(".ui-multiselect-optgroup-label").each(function() { var $this = $(this); var isVisible = $this.nextUntil('.ui-multiselect-optgroup-label').filter(function() { return $.css(this, "display") !== 'none'; }).length; $this[isVisible ? 'show' : 'hide'](); }); }, _reset: function() { this.input.val('').trigger('keyup'); }, updateCache: function() { // each list item this.rows = this.instance.menu.find(".ui-multiselect-checkboxes li:not(.ui-multiselect-optgroup-label)"); // cache this.cache = this.element.children().map(function() { var elem = $(this); // account for optgroups if(this.tagName.toLowerCase() === "optgroup") { elem = elem.children(); } return elem.map(function() { return this.innerHTML.toLowerCase(); }).get(); }).get(); }, widget: function() { return this.wrapper; }, destroy: function() { $.Widget.prototype.destroy.call(this); this.input.val('').trigger("keyup"); this.wrapper.remove(); } }); })(jQuery);
0x6a
trunk/libraries/ui-multiselect/jquery.multiselect.filter.js
JavaScript
asf20
5,435
.ui-multiselect-hasfilter ul { position:relative; top:2px } .ui-multiselect-filter { float:left; margin-right:10px; font-size:11px } .ui-multiselect-filter input { width:100px; font-size:10px; margin-left:5px; height:15px; padding:2px; border:1px solid #292929; -webkit-appearance:textfield; -webkit-box-sizing:content-box; }
0x6a
trunk/libraries/ui-multiselect/jquery.multiselect.filter.css
CSS
asf20
326
.ui-multiselect { padding:0 4px 0 8px; text-align:left; position: relative;height: 24px;} button.ui-multiselect{height:26px;} div.ui-multiselect{height:22px;} .ui-multiselect span.ui-icon { float:right } .ui-multiselect-single .ui-multiselect-checkboxes input { position:absolute !important; top: auto !important; left:-9999px; } .ui-multiselect-single .ui-multiselect-checkboxes label { padding:3px 4px !important } .ui-multiselect-header { margin-bottom:3px; padding:3px 0 3px 4px } .ui-multiselect-header ul { font-size:0.9em } .ui-multiselect-header ul li { float:left; padding:0 10px 0 0 } .ui-multiselect-header a { text-decoration:none } .ui-multiselect-header a:hover { text-decoration:underline } .ui-multiselect-header span.ui-icon { float:left } .ui-multiselect-header li.ui-multiselect-close { float:right; text-align:right; padding-right:0 } .ui-multiselect-menu { display:none; padding:3px; position:absolute; z-index:10000; text-align: left;margin-top:-1px;min-width: 196px} .ui-multiselect-menu.m-w-a{min-width: auto} .ui-multiselect-checkboxes { position:relative /* fixes bug in IE6/7 */; overflow-y:auto } .ui-multiselect-checkboxes label { cursor:default; display:block; border:1px solid transparent; padding:3px 1px } .ui-multiselect-checkboxes label input { position:relative; top:1px } .ui-multiselect-checkboxes li { clear:both; font-size:1em; padding-right:0px } .ui-multiselect-checkboxes li.ui-multiselect-optgroup-label { text-align:center; font-weight:bold; border-bottom:1px solid } .ui-multiselect-checkboxes li.ui-multiselect-optgroup-label a { display:block; padding:3px; margin:1px 0; text-decoration:none } /* remove label borders in IE6 because IE6 does not support transparency */ .ui-multiselect{max-width: 100%;} * html .ui-multiselect-checkboxes label { border:none } .ui-multiselect-checkboxes li label.ui-state-active{ border-color: #A8CBFF; background:#A8CBFF; color:#000; } .ui-multiselect-checkboxes li label.ui-state-hover{ border-color: #5197FF;; background:#5197FF; color:#fff; } .ui-multiselect.ui-state-active.erb, .ui-multiselect.ui-state-active.erb.ui-state-hover, .ui-multiselect.ui-state-active, .ui-multiselect.ui-state-active.ui-state-active, .ui-multiselect-menu{border: 1px solid #4d90fe;} .ui-multiselect,.ui-multiselect.ui-state-default, .ui-multiselect.ui-widget-content .ui-state-default, .ui-multiselect.ui-widget-header .ui-state-default { background:none; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; overflow:hidden; } .ui-multiselect.ui-state-hover{ border: 1px solid #A8D4FF;background:none; -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.1); -moz-box-shadow: 0 1px 1px rgba(0,0,0,.1); box-shadow: 0 1px 1px rgba(0,0,0,.1); } .ui-multiselect.erb,.ui-multiselect.ui-state-hover.erb{border-color:#dd4b39} /*.ui-multiselect-menu{width:auto !important}*/ .ui-multiselect-menu._mul{margin-top:-24px } .ui-multiselect-menu li label input[type=checkbox]{top:0px;position:relative;margin-right:4px} .ui-multiselect span{position:absolute;top:3px;left:8px;right:20px;line-height:16px;height:16px;overflow:hidden} .ui-multiselect span.ui-icon{padding:0;margin:0;position:absolute;top:4px;right:4px;float:none;left:auto;z-index:10} .ui-multiselect-menu .ui-widget-header .ui-helper-reset span{line-height:16px;font-weight:normal;font-size:11px} .ui-multiselect-menu .ui-icon.ui-icon-check{background:url('../images/ui-check-box.png') no-repeat center;} .ui-multiselect-menu .ui-icon.ui-icon-closethick{background:url('../images/ui-check-box-uncheck.png') no-repeat center;} .ui-multiselect-menu .ui-widget-header{position:relative} .ui-multiselect-menu .ui-widget-header li.ui-multiselect-close{height:16px;width:16px;position:absolute;top:50%;right:2px;float:none;margin-top:-8px;} .ui-multiselect-menu .ui-icon.ui-icon-circle-close{background:url('../images/close.png') no-repeat center;opacity:0.8} .ui-multiselect-menu .ui-icon.ui-icon-circle-close:hover{opacity:1} .ui-multiselect-menu .ui-widget-header .ui-multiselect-filter{padding-bottom:0px} .ui-multiselect-menu .ui-widget-header .ui-multiselect-filter input{padding:1px 4px 2px 4px;margin-left:4px;height: 18px}
0x6a
trunk/libraries/ui-multiselect/jquery.multiselect.css
CSS
asf20
4,206
<!DOCTYPE html> <html lang="en"> <head> <title>403 Request forbidden</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style type="text/css"> body{background: #ebebeb;font-family: dotum,tahoma} .error_contain{ padding: 0px; position:relative; } .error_contain div{ width:500px;margin:0 auto; } .error_contain h1{ padding: 40px 0; font-family: arial; text-align: center; margin: 0; font-size: 169px; line-height: normal; color: #ffffff; text-shadow: 0 0 10px #ffffff, 0 4px 3px #ffffff, 0 9px 3px #dddddd, 0 12px 1px #cccccc, 0 14px 5px rgba(0, 0, 0, 0.4), 0 20px 10px rgba(0, 0, 0, 0.1), 0 15px 80px rgba(0, 0, 100, 0.2); } .error_contain h3{color: #777;margin: 0;padding: 8px;padding-top: 20px} .error_contain p{margin: 0;padding: 8px;color: #777;text-align: justify;font-size: 13px} </style> </head> <body> <div class="error_contain"> <h1 style="">403</h1> <div> <h3>Oops! Request forbidden...<span style="float: right">٩(๏̯͡๏)۶</span></h3> <p> Sorry, it appears the page you were looking for is forbidden and not accessible. If the problem persists, please contact our support at example@domain.com. </p> </div> </div> </body> </html>
0x6a
trunk/libraries/ui-multiselect/index.html
HTML
asf20
1,319
/* Project : 48c6c450f1a4a0cc53d9585dc0fee742 Created on : Mar 16, 2013, 11:29:15 PM Author : Truong Khuong - khuongxuantruong@gmail.com Description : Purpose of the stylesheet follows. */ .clear {clear: both;display: block;overflow: hidden;visibility: hidden;width: 0;height: 0;} .mceContentBody{ text-align: justify; /* font-family: Tahoma,sans-serif; font-size: 11px;*/ } html, body, div, h1, h2, h3, h4, h5, h6, p, img, dl, dt, dd, ol, ul, li, table, tr, form, object, embed, article, aside, canvas, command, details, fieldset, figcaption, figure, footer, group, header, hgroup, legend, mark, menu, meter, nav, output, progress, section, summary, time, audio, video { margin: 0;padding: 0;border: 0; } .mceContentBody p,.mceContentBody h1,.mceContentBody h2,.mceContentBody h3,.mceContentBody h4,.mceContentBody h5,.mceContentBody h6{margin: 0} .mceContentBody h1,.mceContentBody h2,.mceContentBody h3,.mceContentBody h4, .mceContentBody h5,.mceContentBody h6{ clear: both; padding-top: 4px; padding-bottom: 4px; padding-left: 1em; font-family: inherit; } .mceContentBody h1,.mceContentBody h2{ padding-left: 0; } .mceContentBody h1{ padding-left: 20px; border-left: 4px solid #149ed9; color: #149ed9; } .mceContentBody h2{ padding-left: 30px; border-left: 4px solid #149ed9; color: #149ed9; } .mceContentBody h3{ padding-left: 40px; border-left: 4px solid #149ed9; color: #149ed9; /* background-image: url('icon/h3.png'); background-repeat: no-repeat; background-position: 0 3px;*/ } .mceContentBody h4{ padding-left: 50px;color: #149ed9;border-left: 4px solid #149ed9; /* background-image: url('icon/h4.png'); background-repeat: no-repeat; background-position: 0 10px;*/ } .mceContentBody h1,.mceContentBody h2,.mceContentBody h3,.mceContentBody h4{ /*color: #8F261B;*/ } /*.mceContentBody>p:not(.first-child),.mceContentBody>p:not(:first-child), .mceContentBody .indent{ text-indent: 20px; }*/ /*.mceContentBody>p.first-letter,.mceContentBody>p:first-child{ text-indent: 0; }*/ .mceContentBody>p,.mceContentBody>div.paragraph{ /* text-indent: 20px;*/ text-align: justify; padding-top: 4px; padding-bottom: 4px; clear: both; } .mceContentBody p[align='right']{text-align: right} .mceContentBody p,.mceContentBody div.paragraph,.mceContentBody li,.mceContentBody td,.mceContentBody th{ line-height:16px; } .mceContentBody>p.first-letter,.mceContentBody>div.paragraph.first-letter{ text-indent: 0px; } /*.mceContentBody>div.paragraph:first-child:first-letter, .mceContentBody>p:first-child:first-letter,*/ .mceContentBody>div.first-letter:first-letter, .mceContentBody>p.first-letter:first-letter, .mceContentBody span.first-letter{ text-indent: 0px; font-size: 32px; line-height: 30px; display: block; float: left; padding-right: 8px; padding-left: 20px; font-size: 34px; font-family:Time New Roman; font-weight:bold; color: #8F261B; } .mceContentBody span { font-family: inherit; padding: 0px 2px 1px 2px; border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; } .mceContentBody tt { font-family: inherit; padding: 0px 2px 1px 2px; background: #A8D4FF; border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; } .mceContentBody .highlight-yeallow{ font-family: inherit; padding: 0px 2px 1px 2px; background: #FFFCA8; border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; } .mceContentBody .highlight-red{ font-family: inherit; padding: 0px 2px 1px 2px; background: #FFA8AC; border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; } .mceContentBody .highlight-blue{ font-family: inherit; padding: 0px 2px 1px 2px; background: #A8D4FF; border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; } .mceContentBody .highlight-green{ font-family: inherit; padding: 0px 2px 1px 2px; background: #BAEDD3; border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; } .mceContentBody ol{ list-style: normal; min-width: 50%; display: block; list-style-type: decimal-leading-zero; /* border-top: 1px solid #fff;*/ /* border-left: 1px solid #fff;*/ /* outline: 1px solid #ccc;*/ padding-left: 88px; padding-top: 4px; padding-bottom: 4px; margin: 0; display: block; clear: both; } .mceContentBody ol li{ border-left: 1px solid rgb(211, 171, 12); /* padding: 4px 12px 4px 12px;*/ padding-left: 12px; line-height: 16px; } .mceContentBody ul{ list-style: normal; min-width: 50%; display: block; padding-left: 80px; padding-top: 4px; padding-bottom: 4px; margin: 0; clear: both; padding-left: 16px; } .mceContentBody ul li{ list-style-type: square; padding-left: 20px; } .mceContentBody a{ color:#9A350E; } .mceContentBody a:hover{ text-decoration: underline; } .mceContentBody blockquote{ overflow: hidden; margin: 4px 24px; padding: 1.2em 1.25em 0.2em 24px; background: #f3f3f0 url(icon/bg_blockquote2.gif) top left no-repeat; color: #543; } .mceContentBody span.step { background: #FFBA51; border-radius: 0.8em; -moz-border-radius: 0.8em; -webkit-border-radius: 0.8em; color: #ffffff; display: inline-block; line-height: 1.6em; margin-right: 5px; text-align: center; padding: 0 0.5em; } .mceContentBody hr{margin: 0 auto;padding: 0 0 2px 0;height: 0px;border: none;border-top:1px solid #ccc;display: block;} .mceContentBody table{display: table;border-collapse: collapse;margin: 0 auto} .mceContentBody th,.mceContentBody td{border: 1px solid rgb(167, 125, 123);display: table-cell; padding: 4px} .mceContentBody tr{display: table-row} .mceContentBody th>p,.mceContentBody td>p{ padding: 0 } /*body.mceContentBody table.mceItemTable{border: 1px dashed rgb(167, 125, 123);;border-collapse: inherit;} body.mceContentBody table.mceItemTable th,body.mceContentBody table.mceItemTable td{border: 1px dashed rgb(167, 125, 123);;border-collapse: inherit;}*/ .mceContentBody pre { white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ } .mceContentBody .etabs{ padding: 8px 0 0 0px } .mceContentBody .etabs .tab-tit{ border-bottom: 1px solid #ccc; } .mceContentBody .etabs>ul.tab-nav{ /* display: block;float: left;*/ list-style: none; height: 25px;padding: 0 20px;margin: 0 } .mceContentBody .etabs>ul.tab-nav>li{ list-style: none; float: left; cursor: pointer; text-align: center; position: relative; margin: 0 3px 0 0; padding: 0 12px; height: 24px; line-height: 24px; color: #676568; border: 1px solid #bea787; min-width: 60px; } .mceContentBody .etabs>ul.tab-nav>li.newtab, .mceContentBody .etabs>ul.tab-nav>li.newtab:hover, .mceContentBody .etabs>ul.tab-nav>li.hover.newtab:hover{ border: 0px solid #bea787;width: 24px;min-width: 24px; background:url('../images/16/addg.png') no-repeat center; } .mceContentBody .etabs>ul.tab-nav>li.newtab a{background: #ccc;border-radius: 4px;} .mceContentBody .etabs>ul.tab-nav>li a{text-decoration: none} .mceContentBody .etabs>ul.tab-nav>li.hover, .mceContentBody .etabs>ul.tab-nav>li:hover{ font-weight: bold; color: #920000; background: #fff; border: 1px solid #bea787; border-bottom: none; height: 25px; line-height: 25px; } .mceContentBody .tab{padding: 8px} body.mceContentBody .mceNonEditable:hover,.mceContentBody .mceNonEditable { background-color: #F7F5AF !important; } /*body.mceContentBody .tab{border: 2px dotted #BAEDD3}*/ body.mceContentBody .mceEditable { background: white; border: 1px dotted #FFBA51; } .mceContentBody img{max-width: 100%} .fontend_album.classic_album{text-align: center;margin: 0 auto} .fontend_album.classic_album img{height: 74px;padding: 2px;border:1px solid #ccc;margin: 0 4px 4px 0} .pluginbutton{display: none} .backendplugin .pluginbutton{display: block}
0x6a
trunk/libraries/typography/typography.css
CSS
asf20
8,370
<!DOCTYPE html> <html lang="en"> <head> <title>403 Request forbidden</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style type="text/css"> body{background: #ebebeb;font-family: dotum,tahoma} .error_contain{ padding: 0px; position:relative; } .error_contain div{ width:500px;margin:0 auto; } .error_contain h1{ padding: 40px 0; font-family: arial; text-align: center; margin: 0; font-size: 169px; line-height: normal; color: #ffffff; text-shadow: 0 0 10px #ffffff, 0 4px 3px #ffffff, 0 9px 3px #dddddd, 0 12px 1px #cccccc, 0 14px 5px rgba(0, 0, 0, 0.4), 0 20px 10px rgba(0, 0, 0, 0.1), 0 15px 80px rgba(0, 0, 100, 0.2); } .error_contain h3{color: #777;margin: 0;padding: 8px;padding-top: 20px} .error_contain p{margin: 0;padding: 8px;color: #777;text-align: justify;font-size: 13px} </style> </head> <body> <div class="error_contain"> <h1 style="">403</h1> <div> <h3>Oops! Request forbidden...<span style="float: right">٩(๏̯͡๏)۶</span></h3> <p> Sorry, it appears the page you were looking for is forbidden and not accessible. If the problem persists, please contact our support at example@domain.com. </p> </div> </div> </body> </html>
0x6a
trunk/libraries/typography/index.html
HTML
asf20
1,319
<?php /* This file is a wrapper, for use in PHP environments, which serves PIE.htc using the correct content-type, so that IE will recognize it as a behavior. Simply specify the behavior property to fetch this .php file instead of the .htc directly: .myElement { [ ...css3 properties... ] behavior: url(PIE.php); } This is only necessary when the web server is not configured to serve .htc files with the text/x-component content-type, and cannot easily be configured to do so (as is the case with some shared hosting providers). */ header( 'Content-type: text/x-component' ); include( 'PIE.htc' ); ?>
0x6a
trunk/libraries/css/pie-1.0/PIE.php
PHP
asf20
613
/* PIE: CSS3 rendering for IE Version 1.0.0 http://css3pie.com Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2. */ (function(){ var doc = document;var PIE = window['PIE']; if( !PIE ) { PIE = window['PIE'] = { CSS_PREFIX: '-pie-', STYLE_PREFIX: 'Pie', CLASS_PREFIX: 'pie_', tableCellTags: { 'TD': 1, 'TH': 1 }, /** * Lookup table of elements which cannot take custom children. */ childlessElements: { 'TABLE':1, 'THEAD':1, 'TBODY':1, 'TFOOT':1, 'TR':1, 'INPUT':1, 'TEXTAREA':1, 'SELECT':1, 'OPTION':1, 'IMG':1, 'HR':1 }, /** * Elements that can receive user focus */ focusableElements: { 'A':1, 'INPUT':1, 'TEXTAREA':1, 'SELECT':1, 'BUTTON':1 }, /** * Values of the type attribute for input elements displayed as buttons */ inputButtonTypes: { 'submit':1, 'button':1, 'reset':1 }, emptyFn: function() {} }; // Force the background cache to be used. No reason it shouldn't be. try { doc.execCommand( 'BackgroundImageCache', false, true ); } catch(e) {} (function() { /* * IE version detection approach by James Padolsey, with modifications -- from * http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/ */ var ieVersion = 4, div = doc.createElement('div'), all = div.getElementsByTagName('i'), shape; while ( div.innerHTML = '<!--[if gt IE ' + (++ieVersion) + ']><i></i><![endif]-->', all[0] ) {} PIE.ieVersion = ieVersion; // Detect IE6 if( ieVersion === 6 ) { // IE6 can't access properties with leading dash, but can without it. PIE.CSS_PREFIX = PIE.CSS_PREFIX.replace( /^-/, '' ); } PIE.ieDocMode = doc.documentMode || PIE.ieVersion; // Detect VML support (a small number of IE installs don't have a working VML engine) div.innerHTML = '<v:shape adj="1"/>'; shape = div.firstChild; shape.style['behavior'] = 'url(#default#VML)'; PIE.supportsVML = (typeof shape['adj'] === "object"); }()); /** * Utility functions */ (function() { var vmlCreatorDoc, idNum = 0, imageSizes = {}; PIE.Util = { /** * To create a VML element, it must be created by a Document which has the VML * namespace set. Unfortunately, if you try to add the namespace programatically * into the main document, you will get an "Unspecified error" when trying to * access document.namespaces before the document is finished loading. To get * around this, we create a DocumentFragment, which in IE land is apparently a * full-fledged Document. It allows adding namespaces immediately, so we add the * namespace there and then have it create the VML element. * @param {string} tag The tag name for the VML element * @return {Element} The new VML element */ createVmlElement: function( tag ) { var vmlPrefix = 'css3vml'; if( !vmlCreatorDoc ) { vmlCreatorDoc = doc.createDocumentFragment(); vmlCreatorDoc.namespaces.add( vmlPrefix, 'urn:schemas-microsoft-com:vml' ); } return vmlCreatorDoc.createElement( vmlPrefix + ':' + tag ); }, /** * Generate and return a unique ID for a given object. The generated ID is stored * as a property of the object for future reuse. * @param {Object} obj */ getUID: function( obj ) { return obj && obj[ '_pieId' ] || ( obj[ '_pieId' ] = '_' + ++idNum ); }, /** * Simple utility for merging objects * @param {Object} obj1 The main object into which all others will be merged * @param {...Object} var_args Other objects which will be merged into the first, in order */ merge: function( obj1 ) { var i, len, p, objN, args = arguments; for( i = 1, len = args.length; i < len; i++ ) { objN = args[i]; for( p in objN ) { if( objN.hasOwnProperty( p ) ) { obj1[ p ] = objN[ p ]; } } } return obj1; }, /** * Execute a callback function, passing it the dimensions of a given image once * they are known. * @param {string} src The source URL of the image * @param {function({w:number, h:number})} func The callback function to be called once the image dimensions are known * @param {Object} ctx A context object which will be used as the 'this' value within the executed callback function */ withImageSize: function( src, func, ctx ) { var size = imageSizes[ src ], img, queue; if( size ) { // If we have a queue, add to it if( Object.prototype.toString.call( size ) === '[object Array]' ) { size.push( [ func, ctx ] ); } // Already have the size cached, call func right away else { func.call( ctx, size ); } } else { queue = imageSizes[ src ] = [ [ func, ctx ] ]; //create queue img = new Image(); img.onload = function() { size = imageSizes[ src ] = { w: img.width, h: img.height }; for( var i = 0, len = queue.length; i < len; i++ ) { queue[ i ][ 0 ].call( queue[ i ][ 1 ], size ); } img.onload = null; }; img.src = src; } } }; })();/** * Utility functions for handling gradients */ PIE.GradientUtil = { getGradientMetrics: function( el, width, height, gradientInfo ) { var angle = gradientInfo.angle, startPos = gradientInfo.gradientStart, startX, startY, endX, endY, startCornerX, startCornerY, endCornerX, endCornerY, deltaX, deltaY, p, UNDEF; // Find the "start" and "end" corners; these are the corners furthest along the gradient line. // This is used below to find the start/end positions of the CSS3 gradient-line, and also in finding // the total length of the VML rendered gradient-line corner to corner. function findCorners() { startCornerX = ( angle >= 90 && angle < 270 ) ? width : 0; startCornerY = angle < 180 ? height : 0; endCornerX = width - startCornerX; endCornerY = height - startCornerY; } // Normalize the angle to a value between [0, 360) function normalizeAngle() { while( angle < 0 ) { angle += 360; } angle = angle % 360; } // Find the start and end points of the gradient if( startPos ) { startPos = startPos.coords( el, width, height ); startX = startPos.x; startY = startPos.y; } if( angle ) { angle = angle.degrees(); normalizeAngle(); findCorners(); // If no start position was specified, then choose a corner as the starting point. if( !startPos ) { startX = startCornerX; startY = startCornerY; } // Find the end position by extending a perpendicular line from the gradient-line which // intersects the corner opposite from the starting corner. p = PIE.GradientUtil.perpendicularIntersect( startX, startY, angle, endCornerX, endCornerY ); endX = p[0]; endY = p[1]; } else if( startPos ) { // Start position but no angle specified: find the end point by rotating 180deg around the center endX = width - startX; endY = height - startY; } else { // Neither position nor angle specified; create vertical gradient from top to bottom startX = startY = endX = 0; endY = height; } deltaX = endX - startX; deltaY = endY - startY; if( angle === UNDEF ) { // Get the angle based on the change in x/y from start to end point. Checks first for horizontal // or vertical angles so they get exact whole numbers rather than what atan2 gives. angle = ( !deltaX ? ( deltaY < 0 ? 90 : 270 ) : ( !deltaY ? ( deltaX < 0 ? 180 : 0 ) : -Math.atan2( deltaY, deltaX ) / Math.PI * 180 ) ); normalizeAngle(); findCorners(); } return { angle: angle, startX: startX, startY: startY, endX: endX, endY: endY, startCornerX: startCornerX, startCornerY: startCornerY, endCornerX: endCornerX, endCornerY: endCornerY, deltaX: deltaX, deltaY: deltaY, lineLength: PIE.GradientUtil.distance( startX, startY, endX, endY ) } }, /** * Find the point along a given line (defined by a starting point and an angle), at which * that line is intersected by a perpendicular line extending through another point. * @param x1 - x coord of the starting point * @param y1 - y coord of the starting point * @param angle - angle of the line extending from the starting point (in degrees) * @param x2 - x coord of point along the perpendicular line * @param y2 - y coord of point along the perpendicular line * @return [ x, y ] */ perpendicularIntersect: function( x1, y1, angle, x2, y2 ) { // Handle straight vertical and horizontal angles, for performance and to avoid // divide-by-zero errors. if( angle === 0 || angle === 180 ) { return [ x2, y1 ]; } else if( angle === 90 || angle === 270 ) { return [ x1, y2 ]; } else { // General approach: determine the Ax+By=C formula for each line (the slope of the second // line is the negative inverse of the first) and then solve for where both formulas have // the same x/y values. var a1 = Math.tan( -angle * Math.PI / 180 ), c1 = a1 * x1 - y1, a2 = -1 / a1, c2 = a2 * x2 - y2, d = a2 - a1, endX = ( c2 - c1 ) / d, endY = ( a1 * c2 - a2 * c1 ) / d; return [ endX, endY ]; } }, /** * Find the distance between two points * @param {Number} p1x * @param {Number} p1y * @param {Number} p2x * @param {Number} p2y * @return {Number} the distance */ distance: function( p1x, p1y, p2x, p2y ) { var dx = p2x - p1x, dy = p2y - p1y; return Math.abs( dx === 0 ? dy : dy === 0 ? dx : Math.sqrt( dx * dx + dy * dy ) ); } };/** * */ PIE.Observable = function() { /** * List of registered observer functions */ this.observers = []; /** * Hash of function ids to their position in the observers list, for fast lookup */ this.indexes = {}; }; PIE.Observable.prototype = { observe: function( fn ) { var id = PIE.Util.getUID( fn ), indexes = this.indexes, observers = this.observers; if( !( id in indexes ) ) { indexes[ id ] = observers.length; observers.push( fn ); } }, unobserve: function( fn ) { var id = PIE.Util.getUID( fn ), indexes = this.indexes; if( id && id in indexes ) { delete this.observers[ indexes[ id ] ]; delete indexes[ id ]; } }, fire: function() { var o = this.observers, i = o.length; while( i-- ) { o[ i ] && o[ i ](); } } };/* * Simple heartbeat timer - this is a brute-force workaround for syncing issues caused by IE not * always firing the onmove and onresize events when elements are moved or resized. We check a few * times every second to make sure the elements have the correct position and size. See Element.js * which adds heartbeat listeners based on the custom -pie-poll flag, which defaults to true in IE8-9 * and false elsewhere. */ PIE.Heartbeat = new PIE.Observable(); PIE.Heartbeat.run = function() { var me = this, interval; if( !me.running ) { interval = doc.documentElement.currentStyle.getAttribute( PIE.CSS_PREFIX + 'poll-interval' ) || 250; (function beat() { me.fire(); setTimeout(beat, interval); })(); me.running = 1; } }; /** * Create an observable listener for the onunload event */ (function() { PIE.OnUnload = new PIE.Observable(); function handleUnload() { PIE.OnUnload.fire(); window.detachEvent( 'onunload', handleUnload ); window[ 'PIE' ] = null; } window.attachEvent( 'onunload', handleUnload ); /** * Attach an event which automatically gets detached onunload */ PIE.OnUnload.attachManagedEvent = function( target, name, handler ) { target.attachEvent( name, handler ); this.observe( function() { target.detachEvent( name, handler ); } ); }; })()/** * Create a single observable listener for window resize events. */ PIE.OnResize = new PIE.Observable(); PIE.OnUnload.attachManagedEvent( window, 'onresize', function() { PIE.OnResize.fire(); } ); /** * Create a single observable listener for scroll events. Used for lazy loading based * on the viewport, and for fixed position backgrounds. */ (function() { PIE.OnScroll = new PIE.Observable(); function scrolled() { PIE.OnScroll.fire(); } PIE.OnUnload.attachManagedEvent( window, 'onscroll', scrolled ); PIE.OnResize.observe( scrolled ); })(); /** * Listen for printing events, destroy all active PIE instances when printing, and * restore them afterward. */ (function() { var elements; function beforePrint() { elements = PIE.Element.destroyAll(); } function afterPrint() { if( elements ) { for( var i = 0, len = elements.length; i < len; i++ ) { PIE[ 'attach' ]( elements[i] ); } elements = 0; } } if( PIE.ieDocMode < 9 ) { PIE.OnUnload.attachManagedEvent( window, 'onbeforeprint', beforePrint ); PIE.OnUnload.attachManagedEvent( window, 'onafterprint', afterPrint ); } })();/** * Create a single observable listener for document mouseup events. */ PIE.OnMouseup = new PIE.Observable(); PIE.OnUnload.attachManagedEvent( doc, 'onmouseup', function() { PIE.OnMouseup.fire(); } ); /** * Wrapper for length and percentage style values. The value is immutable. A singleton instance per unique * value is returned from PIE.getLength() - always use that instead of instantiating directly. * @constructor * @param {string} val The CSS string representing the length. It is assumed that this will already have * been validated as a valid length or percentage syntax. */ PIE.Length = (function() { var lengthCalcEl = doc.createElement( 'length-calc' ), parent = doc.body || doc.documentElement, s = lengthCalcEl.style, conversions = {}, units = [ 'mm', 'cm', 'in', 'pt', 'pc' ], i = units.length, instances = {}; s.position = 'absolute'; s.top = s.left = '-9999px'; parent.appendChild( lengthCalcEl ); while( i-- ) { s.width = '100' + units[i]; conversions[ units[i] ] = lengthCalcEl.offsetWidth / 100; } parent.removeChild( lengthCalcEl ); // All calcs from here on will use 1em s.width = '1em'; function Length( val ) { this.val = val; } Length.prototype = { /** * Regular expression for matching the length unit * @private */ unitRE: /(px|em|ex|mm|cm|in|pt|pc|%)$/, /** * Get the numeric value of the length * @return {number} The value */ getNumber: function() { var num = this.num, UNDEF; if( num === UNDEF ) { num = this.num = parseFloat( this.val ); } return num; }, /** * Get the unit of the length * @return {string} The unit */ getUnit: function() { var unit = this.unit, m; if( !unit ) { m = this.val.match( this.unitRE ); unit = this.unit = ( m && m[0] ) || 'px'; } return unit; }, /** * Determine whether this is a percentage length value * @return {boolean} */ isPercentage: function() { return this.getUnit() === '%'; }, /** * Resolve this length into a number of pixels. * @param {Element} el - the context element, used to resolve font-relative values * @param {(function():number|number)=} pct100 - the number of pixels that equal a 100% percentage. This can be either a number or a * function which will be called to return the number. */ pixels: function( el, pct100 ) { var num = this.getNumber(), unit = this.getUnit(); switch( unit ) { case "px": return num; case "%": return num * ( typeof pct100 === 'function' ? pct100() : pct100 ) / 100; case "em": return num * this.getEmPixels( el ); case "ex": return num * this.getEmPixels( el ) / 2; default: return num * conversions[ unit ]; } }, /** * The em and ex units are relative to the font-size of the current element, * however if the font-size is set using non-pixel units then we get that value * rather than a pixel conversion. To get around this, we keep a floating element * with width:1em which we insert into the target element and then read its offsetWidth. * For elements that won't accept a child we insert into the parent node and perform * additional calculation. If the font-size *is* specified in pixels, then we use that * directly to avoid the expensive DOM manipulation. * @param {Element} el * @return {number} */ getEmPixels: function( el ) { var fs = el.currentStyle.fontSize, px, parent, me; if( fs.indexOf( 'px' ) > 0 ) { return parseFloat( fs ); } else if( el.tagName in PIE.childlessElements ) { me = this; parent = el.parentNode; return PIE.getLength( fs ).pixels( parent, function() { return me.getEmPixels( parent ); } ); } else { el.appendChild( lengthCalcEl ); px = lengthCalcEl.offsetWidth; if( lengthCalcEl.parentNode === el ) { //not sure how this could be false but it sometimes is el.removeChild( lengthCalcEl ); } return px; } } }; /** * Retrieve a PIE.Length instance for the given value. A shared singleton instance is returned for each unique value. * @param {string} val The CSS string representing the length. It is assumed that this will already have * been validated as a valid length or percentage syntax. */ PIE.getLength = function( val ) { return instances[ val ] || ( instances[ val ] = new Length( val ) ); }; return Length; })(); /** * Wrapper for a CSS3 bg-position value. Takes up to 2 position keywords and 2 lengths/percentages. * @constructor * @param {Array.<PIE.Tokenizer.Token>} tokens The tokens making up the background position value. */ PIE.BgPosition = (function() { var length_fifty = PIE.getLength( '50%' ), vert_idents = { 'top': 1, 'center': 1, 'bottom': 1 }, horiz_idents = { 'left': 1, 'center': 1, 'right': 1 }; function BgPosition( tokens ) { this.tokens = tokens; } BgPosition.prototype = { /** * Normalize the values into the form: * [ xOffsetSide, xOffsetLength, yOffsetSide, yOffsetLength ] * where: xOffsetSide is either 'left' or 'right', * yOffsetSide is either 'top' or 'bottom', * and x/yOffsetLength are both PIE.Length objects. * @return {Array} */ getValues: function() { if( !this._values ) { var tokens = this.tokens, len = tokens.length, Tokenizer = PIE.Tokenizer, identType = Tokenizer.Type, length_zero = PIE.getLength( '0' ), type_ident = identType.IDENT, type_length = identType.LENGTH, type_percent = identType.PERCENT, type, value, vals = [ 'left', length_zero, 'top', length_zero ]; // If only one value, the second is assumed to be 'center' if( len === 1 ) { tokens.push( new Tokenizer.Token( type_ident, 'center' ) ); len++; } // Two values - CSS2 if( len === 2 ) { // If both idents, they can appear in either order, so switch them if needed if( type_ident & ( tokens[0].tokenType | tokens[1].tokenType ) && tokens[0].tokenValue in vert_idents && tokens[1].tokenValue in horiz_idents ) { tokens.push( tokens.shift() ); } if( tokens[0].tokenType & type_ident ) { if( tokens[0].tokenValue === 'center' ) { vals[1] = length_fifty; } else { vals[0] = tokens[0].tokenValue; } } else if( tokens[0].isLengthOrPercent() ) { vals[1] = PIE.getLength( tokens[0].tokenValue ); } if( tokens[1].tokenType & type_ident ) { if( tokens[1].tokenValue === 'center' ) { vals[3] = length_fifty; } else { vals[2] = tokens[1].tokenValue; } } else if( tokens[1].isLengthOrPercent() ) { vals[3] = PIE.getLength( tokens[1].tokenValue ); } } // Three or four values - CSS3 else { // TODO } this._values = vals; } return this._values; }, /** * Find the coordinates of the background image from the upper-left corner of the background area. * Note that these coordinate values are not rounded. * @param {Element} el * @param {number} width - the width for percentages (background area width minus image width) * @param {number} height - the height for percentages (background area height minus image height) * @return {Object} { x: Number, y: Number } */ coords: function( el, width, height ) { var vals = this.getValues(), pxX = vals[1].pixels( el, width ), pxY = vals[3].pixels( el, height ); return { x: vals[0] === 'right' ? width - pxX : pxX, y: vals[2] === 'bottom' ? height - pxY : pxY }; } }; return BgPosition; })(); /** * Wrapper for a CSS3 background-size value. * @constructor * @param {String|PIE.Length} w The width parameter * @param {String|PIE.Length} h The height parameter, if any */ PIE.BgSize = (function() { var CONTAIN = 'contain', COVER = 'cover', AUTO = 'auto'; function BgSize( w, h ) { this.w = w; this.h = h; } BgSize.prototype = { pixels: function( el, areaW, areaH, imgW, imgH ) { var me = this, w = me.w, h = me.h, areaRatio = areaW / areaH, imgRatio = imgW / imgH; if ( w === CONTAIN ) { w = imgRatio > areaRatio ? areaW : areaH * imgRatio; h = imgRatio > areaRatio ? areaW / imgRatio : areaH; } else if ( w === COVER ) { w = imgRatio < areaRatio ? areaW : areaH * imgRatio; h = imgRatio < areaRatio ? areaW / imgRatio : areaH; } else if ( w === AUTO ) { h = ( h === AUTO ? imgH : h.pixels( el, areaH ) ); w = h * imgRatio; } else { w = w.pixels( el, areaW ); h = ( h === AUTO ? w / imgRatio : h.pixels( el, areaH ) ); } return { w: w, h: h }; } }; BgSize.DEFAULT = new BgSize( AUTO, AUTO ); return BgSize; })(); /** * Wrapper for angle values; handles conversion to degrees from all allowed angle units * @constructor * @param {string} val The raw CSS value for the angle. It is assumed it has been pre-validated. */ PIE.Angle = (function() { function Angle( val ) { this.val = val; } Angle.prototype = { unitRE: /[a-z]+$/i, /** * @return {string} The unit of the angle value */ getUnit: function() { return this._unit || ( this._unit = this.val.match( this.unitRE )[0].toLowerCase() ); }, /** * Get the numeric value of the angle in degrees. * @return {number} The degrees value */ degrees: function() { var deg = this._deg, u, n; if( deg === undefined ) { u = this.getUnit(); n = parseFloat( this.val, 10 ); deg = this._deg = ( u === 'deg' ? n : u === 'rad' ? n / Math.PI * 180 : u === 'grad' ? n / 400 * 360 : u === 'turn' ? n * 360 : 0 ); } return deg; } }; return Angle; })();/** * Abstraction for colors values. Allows detection of rgba values. A singleton instance per unique * value is returned from PIE.getColor() - always use that instead of instantiating directly. * @constructor * @param {string} val The raw CSS string value for the color */ PIE.Color = (function() { var instances = {}; function Color( val ) { this.val = val; } /** * Regular expression for matching rgba colors and extracting their components * @type {RegExp} */ Color.rgbaRE = /\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/; Color.names = { "aliceblue":"F0F8FF", "antiquewhite":"FAEBD7", "aqua":"0FF", "aquamarine":"7FFFD4", "azure":"F0FFFF", "beige":"F5F5DC", "bisque":"FFE4C4", "black":"000", "blanchedalmond":"FFEBCD", "blue":"00F", "blueviolet":"8A2BE2", "brown":"A52A2A", "burlywood":"DEB887", "cadetblue":"5F9EA0", "chartreuse":"7FFF00", "chocolate":"D2691E", "coral":"FF7F50", "cornflowerblue":"6495ED", "cornsilk":"FFF8DC", "crimson":"DC143C", "cyan":"0FF", "darkblue":"00008B", "darkcyan":"008B8B", "darkgoldenrod":"B8860B", "darkgray":"A9A9A9", "darkgreen":"006400", "darkkhaki":"BDB76B", "darkmagenta":"8B008B", "darkolivegreen":"556B2F", "darkorange":"FF8C00", "darkorchid":"9932CC", "darkred":"8B0000", "darksalmon":"E9967A", "darkseagreen":"8FBC8F", "darkslateblue":"483D8B", "darkslategray":"2F4F4F", "darkturquoise":"00CED1", "darkviolet":"9400D3", "deeppink":"FF1493", "deepskyblue":"00BFFF", "dimgray":"696969", "dodgerblue":"1E90FF", "firebrick":"B22222", "floralwhite":"FFFAF0", "forestgreen":"228B22", "fuchsia":"F0F", "gainsboro":"DCDCDC", "ghostwhite":"F8F8FF", "gold":"FFD700", "goldenrod":"DAA520", "gray":"808080", "green":"008000", "greenyellow":"ADFF2F", "honeydew":"F0FFF0", "hotpink":"FF69B4", "indianred":"CD5C5C", "indigo":"4B0082", "ivory":"FFFFF0", "khaki":"F0E68C", "lavender":"E6E6FA", "lavenderblush":"FFF0F5", "lawngreen":"7CFC00", "lemonchiffon":"FFFACD", "lightblue":"ADD8E6", "lightcoral":"F08080", "lightcyan":"E0FFFF", "lightgoldenrodyellow":"FAFAD2", "lightgreen":"90EE90", "lightgrey":"D3D3D3", "lightpink":"FFB6C1", "lightsalmon":"FFA07A", "lightseagreen":"20B2AA", "lightskyblue":"87CEFA", "lightslategray":"789", "lightsteelblue":"B0C4DE", "lightyellow":"FFFFE0", "lime":"0F0", "limegreen":"32CD32", "linen":"FAF0E6", "magenta":"F0F", "maroon":"800000", "mediumauqamarine":"66CDAA", "mediumblue":"0000CD", "mediumorchid":"BA55D3", "mediumpurple":"9370D8", "mediumseagreen":"3CB371", "mediumslateblue":"7B68EE", "mediumspringgreen":"00FA9A", "mediumturquoise":"48D1CC", "mediumvioletred":"C71585", "midnightblue":"191970", "mintcream":"F5FFFA", "mistyrose":"FFE4E1", "moccasin":"FFE4B5", "navajowhite":"FFDEAD", "navy":"000080", "oldlace":"FDF5E6", "olive":"808000", "olivedrab":"688E23", "orange":"FFA500", "orangered":"FF4500", "orchid":"DA70D6", "palegoldenrod":"EEE8AA", "palegreen":"98FB98", "paleturquoise":"AFEEEE", "palevioletred":"D87093", "papayawhip":"FFEFD5", "peachpuff":"FFDAB9", "peru":"CD853F", "pink":"FFC0CB", "plum":"DDA0DD", "powderblue":"B0E0E6", "purple":"800080", "red":"F00", "rosybrown":"BC8F8F", "royalblue":"4169E1", "saddlebrown":"8B4513", "salmon":"FA8072", "sandybrown":"F4A460", "seagreen":"2E8B57", "seashell":"FFF5EE", "sienna":"A0522D", "silver":"C0C0C0", "skyblue":"87CEEB", "slateblue":"6A5ACD", "slategray":"708090", "snow":"FFFAFA", "springgreen":"00FF7F", "steelblue":"4682B4", "tan":"D2B48C", "teal":"008080", "thistle":"D8BFD8", "tomato":"FF6347", "turquoise":"40E0D0", "violet":"EE82EE", "wheat":"F5DEB3", "white":"FFF", "whitesmoke":"F5F5F5", "yellow":"FF0", "yellowgreen":"9ACD32" }; Color.prototype = { /** * @private */ parse: function() { if( !this._color ) { var me = this, v = me.val, vLower, m = v.match( Color.rgbaRE ); if( m ) { me._color = 'rgb(' + m[1] + ',' + m[2] + ',' + m[3] + ')'; me._alpha = parseFloat( m[4] ); } else { if( ( vLower = v.toLowerCase() ) in Color.names ) { v = '#' + Color.names[vLower]; } me._color = v; me._alpha = ( v === 'transparent' ? 0 : 1 ); } } }, /** * Retrieve the value of the color in a format usable by IE natively. This will be the same as * the raw input value, except for rgba values which will be converted to an rgb value. * @param {Element} el The context element, used to get 'currentColor' keyword value. * @return {string} Color value */ colorValue: function( el ) { this.parse(); return this._color === 'currentColor' ? el.currentStyle.color : this._color; }, /** * Retrieve the alpha value of the color. Will be 1 for all values except for rgba values * with an alpha component. * @return {number} The alpha value, from 0 to 1. */ alpha: function() { this.parse(); return this._alpha; } }; /** * Retrieve a PIE.Color instance for the given value. A shared singleton instance is returned for each unique value. * @param {string} val The CSS string representing the color. It is assumed that this will already have * been validated as a valid color syntax. */ PIE.getColor = function(val) { return instances[ val ] || ( instances[ val ] = new Color( val ) ); }; return Color; })();/** * A tokenizer for CSS value strings. * @constructor * @param {string} css The CSS value string */ PIE.Tokenizer = (function() { function Tokenizer( css ) { this.css = css; this.ch = 0; this.tokens = []; this.tokenIndex = 0; } /** * Enumeration of token type constants. * @enum {number} */ var Type = Tokenizer.Type = { ANGLE: 1, CHARACTER: 2, COLOR: 4, DIMEN: 8, FUNCTION: 16, IDENT: 32, LENGTH: 64, NUMBER: 128, OPERATOR: 256, PERCENT: 512, STRING: 1024, URL: 2048 }; /** * A single token * @constructor * @param {number} type The type of the token - see PIE.Tokenizer.Type * @param {string} value The value of the token */ Tokenizer.Token = function( type, value ) { this.tokenType = type; this.tokenValue = value; }; Tokenizer.Token.prototype = { isLength: function() { return this.tokenType & Type.LENGTH || ( this.tokenType & Type.NUMBER && this.tokenValue === '0' ); }, isLengthOrPercent: function() { return this.isLength() || this.tokenType & Type.PERCENT; } }; Tokenizer.prototype = { whitespace: /\s/, number: /^[\+\-]?(\d*\.)?\d+/, url: /^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i, ident: /^\-?[_a-z][\w-]*/i, string: /^("([^"]*)"|'([^']*)')/, operator: /^[\/,]/, hash: /^#[\w]+/, hashColor: /^#([\da-f]{6}|[\da-f]{3})/i, unitTypes: { 'px': Type.LENGTH, 'em': Type.LENGTH, 'ex': Type.LENGTH, 'mm': Type.LENGTH, 'cm': Type.LENGTH, 'in': Type.LENGTH, 'pt': Type.LENGTH, 'pc': Type.LENGTH, 'deg': Type.ANGLE, 'rad': Type.ANGLE, 'grad': Type.ANGLE }, colorFunctions: { 'rgb': 1, 'rgba': 1, 'hsl': 1, 'hsla': 1 }, /** * Advance to and return the next token in the CSS string. If the end of the CSS string has * been reached, null will be returned. * @param {boolean} forget - if true, the token will not be stored for the purposes of backtracking with prev(). * @return {PIE.Tokenizer.Token} */ next: function( forget ) { var css, ch, firstChar, match, val, me = this; function newToken( type, value ) { var tok = new Tokenizer.Token( type, value ); if( !forget ) { me.tokens.push( tok ); me.tokenIndex++; } return tok; } function failure() { me.tokenIndex++; return null; } // In case we previously backed up, return the stored token in the next slot if( this.tokenIndex < this.tokens.length ) { return this.tokens[ this.tokenIndex++ ]; } // Move past leading whitespace characters while( this.whitespace.test( this.css.charAt( this.ch ) ) ) { this.ch++; } if( this.ch >= this.css.length ) { return failure(); } ch = this.ch; css = this.css.substring( this.ch ); firstChar = css.charAt( 0 ); switch( firstChar ) { case '#': if( match = css.match( this.hashColor ) ) { this.ch += match[0].length; return newToken( Type.COLOR, match[0] ); } break; case '"': case "'": if( match = css.match( this.string ) ) { this.ch += match[0].length; return newToken( Type.STRING, match[2] || match[3] || '' ); } break; case "/": case ",": this.ch++; return newToken( Type.OPERATOR, firstChar ); case 'u': if( match = css.match( this.url ) ) { this.ch += match[0].length; return newToken( Type.URL, match[2] || match[3] || match[4] || '' ); } } // Numbers and values starting with numbers if( match = css.match( this.number ) ) { val = match[0]; this.ch += val.length; // Check if it is followed by a unit if( css.charAt( val.length ) === '%' ) { this.ch++; return newToken( Type.PERCENT, val + '%' ); } if( match = css.substring( val.length ).match( this.ident ) ) { val += match[0]; this.ch += match[0].length; return newToken( this.unitTypes[ match[0].toLowerCase() ] || Type.DIMEN, val ); } // Plain ol' number return newToken( Type.NUMBER, val ); } // Identifiers if( match = css.match( this.ident ) ) { val = match[0]; this.ch += val.length; // Named colors if( val.toLowerCase() in PIE.Color.names || val === 'currentColor' || val === 'transparent' ) { return newToken( Type.COLOR, val ); } // Functions if( css.charAt( val.length ) === '(' ) { this.ch++; // Color values in function format: rgb, rgba, hsl, hsla if( val.toLowerCase() in this.colorFunctions ) { function isNum( tok ) { return tok && tok.tokenType & Type.NUMBER; } function isNumOrPct( tok ) { return tok && ( tok.tokenType & ( Type.NUMBER | Type.PERCENT ) ); } function isValue( tok, val ) { return tok && tok.tokenValue === val; } function next() { return me.next( 1 ); } if( ( val.charAt(0) === 'r' ? isNumOrPct( next() ) : isNum( next() ) ) && isValue( next(), ',' ) && isNumOrPct( next() ) && isValue( next(), ',' ) && isNumOrPct( next() ) && ( val === 'rgb' || val === 'hsa' || ( isValue( next(), ',' ) && isNum( next() ) ) ) && isValue( next(), ')' ) ) { return newToken( Type.COLOR, this.css.substring( ch, this.ch ) ); } return failure(); } return newToken( Type.FUNCTION, val ); } // Other identifier return newToken( Type.IDENT, val ); } // Standalone character this.ch++; return newToken( Type.CHARACTER, firstChar ); }, /** * Determine whether there is another token * @return {boolean} */ hasNext: function() { var next = this.next(); this.prev(); return !!next; }, /** * Back up and return the previous token * @return {PIE.Tokenizer.Token} */ prev: function() { return this.tokens[ this.tokenIndex-- - 2 ]; }, /** * Retrieve all the tokens in the CSS string * @return {Array.<PIE.Tokenizer.Token>} */ all: function() { while( this.next() ) {} return this.tokens; }, /** * Return a list of tokens from the current position until the given function returns * true. The final token will not be included in the list. * @param {function():boolean} func - test function * @param {boolean} require - if true, then if the end of the CSS string is reached * before the test function returns true, null will be returned instead of the * tokens that have been found so far. * @return {Array.<PIE.Tokenizer.Token>} */ until: function( func, require ) { var list = [], t, hit; while( t = this.next() ) { if( func( t ) ) { hit = true; this.prev(); break; } list.push( t ); } return require && !hit ? null : list; } }; return Tokenizer; })();/** * Handles calculating, caching, and detecting changes to size and position of the element. * @constructor * @param {Element} el the target element */ PIE.BoundsInfo = function( el ) { this.targetElement = el; }; PIE.BoundsInfo.prototype = { _locked: 0, positionChanged: function() { var last = this._lastBounds, bounds; return !last || ( ( bounds = this.getBounds() ) && ( last.x !== bounds.x || last.y !== bounds.y ) ); }, sizeChanged: function() { var last = this._lastBounds, bounds; return !last || ( ( bounds = this.getBounds() ) && ( last.w !== bounds.w || last.h !== bounds.h ) ); }, getLiveBounds: function() { var el = this.targetElement, rect = el.getBoundingClientRect(), isIE9 = PIE.ieDocMode === 9, isIE7 = PIE.ieVersion === 7, width = rect.right - rect.left; return { x: rect.left, y: rect.top, // In some cases scrolling the page will cause IE9 to report incorrect dimensions // in the rect returned by getBoundingClientRect, so we must query offsetWidth/Height // instead. Also IE7 is inconsistent in using logical vs. device pixels in measurements // so we must calculate the ratio and use it in certain places as a position adjustment. w: isIE9 || isIE7 ? el.offsetWidth : width, h: isIE9 || isIE7 ? el.offsetHeight : rect.bottom - rect.top, logicalZoomRatio: ( isIE7 && width ) ? el.offsetWidth / width : 1 }; }, getBounds: function() { return this._locked ? ( this._lockedBounds || ( this._lockedBounds = this.getLiveBounds() ) ) : this.getLiveBounds(); }, hasBeenQueried: function() { return !!this._lastBounds; }, lock: function() { ++this._locked; }, unlock: function() { if( !--this._locked ) { if( this._lockedBounds ) this._lastBounds = this._lockedBounds; this._lockedBounds = null; } } }; (function() { function cacheWhenLocked( fn ) { var uid = PIE.Util.getUID( fn ); return function() { if( this._locked ) { var cache = this._lockedValues || ( this._lockedValues = {} ); return ( uid in cache ) ? cache[ uid ] : ( cache[ uid ] = fn.call( this ) ); } else { return fn.call( this ); } } } PIE.StyleInfoBase = { _locked: 0, /** * Create a new StyleInfo class, with the standard constructor, and augmented by * the StyleInfoBase's members. * @param proto */ newStyleInfo: function( proto ) { function StyleInfo( el ) { this.targetElement = el; this._lastCss = this.getCss(); } PIE.Util.merge( StyleInfo.prototype, PIE.StyleInfoBase, proto ); StyleInfo._propsCache = {}; return StyleInfo; }, /** * Get an object representation of the target CSS style, caching it for each unique * CSS value string. * @return {Object} */ getProps: function() { var css = this.getCss(), cache = this.constructor._propsCache; return css ? ( css in cache ? cache[ css ] : ( cache[ css ] = this.parseCss( css ) ) ) : null; }, /** * Get the raw CSS value for the target style * @return {string} */ getCss: cacheWhenLocked( function() { var el = this.targetElement, ctor = this.constructor, s = el.style, cs = el.currentStyle, cssProp = this.cssProperty, styleProp = this.styleProperty, prefixedCssProp = ctor._prefixedCssProp || ( ctor._prefixedCssProp = PIE.CSS_PREFIX + cssProp ), prefixedStyleProp = ctor._prefixedStyleProp || ( ctor._prefixedStyleProp = PIE.STYLE_PREFIX + styleProp.charAt(0).toUpperCase() + styleProp.substring(1) ); return s[ prefixedStyleProp ] || cs.getAttribute( prefixedCssProp ) || s[ styleProp ] || cs.getAttribute( cssProp ); } ), /** * Determine whether the target CSS style is active. * @return {boolean} */ isActive: cacheWhenLocked( function() { return !!this.getProps(); } ), /** * Determine whether the target CSS style has changed since the last time it was used. * @return {boolean} */ changed: cacheWhenLocked( function() { var currentCss = this.getCss(), changed = currentCss !== this._lastCss; this._lastCss = currentCss; return changed; } ), cacheWhenLocked: cacheWhenLocked, lock: function() { ++this._locked; }, unlock: function() { if( !--this._locked ) { delete this._lockedValues; } } }; })();/** * Handles parsing, caching, and detecting changes to background (and -pie-background) CSS * @constructor * @param {Element} el the target element */ PIE.BackgroundStyleInfo = PIE.StyleInfoBase.newStyleInfo( { cssProperty: PIE.CSS_PREFIX + 'background', styleProperty: PIE.STYLE_PREFIX + 'Background', attachIdents: { 'scroll':1, 'fixed':1, 'local':1 }, repeatIdents: { 'repeat-x':1, 'repeat-y':1, 'repeat':1, 'no-repeat':1 }, originAndClipIdents: { 'padding-box':1, 'border-box':1, 'content-box':1 }, positionIdents: { 'top':1, 'right':1, 'bottom':1, 'left':1, 'center':1 }, sizeIdents: { 'contain':1, 'cover':1 }, propertyNames: { CLIP: 'backgroundClip', COLOR: 'backgroundColor', IMAGE: 'backgroundImage', ORIGIN: 'backgroundOrigin', POSITION: 'backgroundPosition', REPEAT: 'backgroundRepeat', SIZE: 'backgroundSize' }, /** * For background styles, we support the -pie-background property but fall back to the standard * backround* properties. The reason we have to use the prefixed version is that IE natively * parses the standard properties and if it sees something it doesn't know how to parse, for example * multiple values or gradient definitions, it will throw that away and not make it available through * currentStyle. * * Format of return object: * { * color: <PIE.Color>, * bgImages: [ * { * imgType: 'image', * imgUrl: 'image.png', * imgRepeat: <'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'>, * bgPosition: <PIE.BgPosition>, * bgAttachment: <'scroll' | 'fixed' | 'local'>, * bgOrigin: <'border-box' | 'padding-box' | 'content-box'>, * bgClip: <'border-box' | 'padding-box'>, * bgSize: <PIE.BgSize>, * origString: 'url(img.png) no-repeat top left' * }, * { * imgType: 'linear-gradient', * gradientStart: <PIE.BgPosition>, * angle: <PIE.Angle>, * stops: [ * { color: <PIE.Color>, offset: <PIE.Length> }, * { color: <PIE.Color>, offset: <PIE.Length> }, ... * ] * } * ] * } * @param {String} css * @override */ parseCss: function( css ) { var el = this.targetElement, cs = el.currentStyle, tokenizer, token, image, tok_type = PIE.Tokenizer.Type, type_operator = tok_type.OPERATOR, type_ident = tok_type.IDENT, type_color = tok_type.COLOR, tokType, tokVal, beginCharIndex = 0, positionIdents = this.positionIdents, gradient, stop, width, height, props = { bgImages: [] }; function isBgPosToken( token ) { return token && token.isLengthOrPercent() || ( token.tokenType & type_ident && token.tokenValue in positionIdents ); } function sizeToken( token ) { return token && ( ( token.isLengthOrPercent() && PIE.getLength( token.tokenValue ) ) || ( token.tokenValue === 'auto' && 'auto' ) ); } // If the CSS3-specific -pie-background property is present, parse it if( this.getCss3() ) { tokenizer = new PIE.Tokenizer( css ); image = {}; while( token = tokenizer.next() ) { tokType = token.tokenType; tokVal = token.tokenValue; if( !image.imgType && tokType & tok_type.FUNCTION && tokVal === 'linear-gradient' ) { gradient = { stops: [], imgType: tokVal }; stop = {}; while( token = tokenizer.next() ) { tokType = token.tokenType; tokVal = token.tokenValue; // If we reached the end of the function and had at least 2 stops, flush the info if( tokType & tok_type.CHARACTER && tokVal === ')' ) { if( stop.color ) { gradient.stops.push( stop ); } if( gradient.stops.length > 1 ) { PIE.Util.merge( image, gradient ); } break; } // Color stop - must start with color if( tokType & type_color ) { // if we already have an angle/position, make sure that the previous token was a comma if( gradient.angle || gradient.gradientStart ) { token = tokenizer.prev(); if( token.tokenType !== type_operator ) { break; //fail } tokenizer.next(); } stop = { color: PIE.getColor( tokVal ) }; // check for offset following color token = tokenizer.next(); if( token.isLengthOrPercent() ) { stop.offset = PIE.getLength( token.tokenValue ); } else { tokenizer.prev(); } } // Angle - can only appear in first spot else if( tokType & tok_type.ANGLE && !gradient.angle && !stop.color && !gradient.stops.length ) { gradient.angle = new PIE.Angle( token.tokenValue ); } else if( isBgPosToken( token ) && !gradient.gradientStart && !stop.color && !gradient.stops.length ) { tokenizer.prev(); gradient.gradientStart = new PIE.BgPosition( tokenizer.until( function( t ) { return !isBgPosToken( t ); }, false ) ); } else if( tokType & type_operator && tokVal === ',' ) { if( stop.color ) { gradient.stops.push( stop ); stop = {}; } } else { // Found something we didn't recognize; fail without adding image break; } } } else if( !image.imgType && tokType & tok_type.URL ) { image.imgUrl = tokVal; image.imgType = 'image'; } else if( isBgPosToken( token ) && !image.bgPosition ) { tokenizer.prev(); image.bgPosition = new PIE.BgPosition( tokenizer.until( function( t ) { return !isBgPosToken( t ); }, false ) ); } else if( tokType & type_ident ) { if( tokVal in this.repeatIdents && !image.imgRepeat ) { image.imgRepeat = tokVal; } else if( tokVal in this.originAndClipIdents && !image.bgOrigin ) { image.bgOrigin = tokVal; if( ( token = tokenizer.next() ) && ( token.tokenType & type_ident ) && token.tokenValue in this.originAndClipIdents ) { image.bgClip = token.tokenValue; } else { image.bgClip = tokVal; tokenizer.prev(); } } else if( tokVal in this.attachIdents && !image.bgAttachment ) { image.bgAttachment = tokVal; } else { return null; } } else if( tokType & type_color && !props.color ) { props.color = PIE.getColor( tokVal ); } else if( tokType & type_operator && tokVal === '/' && !image.bgSize && image.bgPosition ) { // background size token = tokenizer.next(); if( token.tokenType & type_ident && token.tokenValue in this.sizeIdents ) { image.bgSize = new PIE.BgSize( token.tokenValue ); } else if( width = sizeToken( token ) ) { height = sizeToken( tokenizer.next() ); if ( !height ) { height = width; tokenizer.prev(); } image.bgSize = new PIE.BgSize( width, height ); } else { return null; } } // new layer else if( tokType & type_operator && tokVal === ',' && image.imgType ) { image.origString = css.substring( beginCharIndex, tokenizer.ch - 1 ); beginCharIndex = tokenizer.ch; props.bgImages.push( image ); image = {}; } else { // Found something unrecognized; chuck everything return null; } } // leftovers if( image.imgType ) { image.origString = css.substring( beginCharIndex ); props.bgImages.push( image ); } } // Otherwise, use the standard background properties; let IE give us the values rather than parsing them else { this.withActualBg( PIE.ieDocMode < 9 ? function() { var propNames = this.propertyNames, posX = cs[propNames.POSITION + 'X'], posY = cs[propNames.POSITION + 'Y'], img = cs[propNames.IMAGE], color = cs[propNames.COLOR]; if( color !== 'transparent' ) { props.color = PIE.getColor( color ) } if( img !== 'none' ) { props.bgImages = [ { imgType: 'image', imgUrl: new PIE.Tokenizer( img ).next().tokenValue, imgRepeat: cs[propNames.REPEAT], bgPosition: new PIE.BgPosition( new PIE.Tokenizer( posX + ' ' + posY ).all() ) } ]; } } : function() { var propNames = this.propertyNames, splitter = /\s*,\s*/, images = cs[propNames.IMAGE].split( splitter ), color = cs[propNames.COLOR], repeats, positions, origins, clips, sizes, i, len, image, sizeParts; if( color !== 'transparent' ) { props.color = PIE.getColor( color ) } len = images.length; if( len && images[0] !== 'none' ) { repeats = cs[propNames.REPEAT].split( splitter ); positions = cs[propNames.POSITION].split( splitter ); origins = cs[propNames.ORIGIN].split( splitter ); clips = cs[propNames.CLIP].split( splitter ); sizes = cs[propNames.SIZE].split( splitter ); props.bgImages = []; for( i = 0; i < len; i++ ) { image = images[ i ]; if( image && image !== 'none' ) { sizeParts = sizes[i].split( ' ' ); props.bgImages.push( { origString: image + ' ' + repeats[ i ] + ' ' + positions[ i ] + ' / ' + sizes[ i ] + ' ' + origins[ i ] + ' ' + clips[ i ], imgType: 'image', imgUrl: new PIE.Tokenizer( image ).next().tokenValue, imgRepeat: repeats[ i ], bgPosition: new PIE.BgPosition( new PIE.Tokenizer( positions[ i ] ).all() ), bgOrigin: origins[ i ], bgClip: clips[ i ], bgSize: new PIE.BgSize( sizeParts[ 0 ], sizeParts[ 1 ] ) } ); } } } } ); } return ( props.color || props.bgImages[0] ) ? props : null; }, /** * Execute a function with the actual background styles (not overridden with runtimeStyle * properties set by the renderers) available via currentStyle. * @param fn */ withActualBg: function( fn ) { var isIE9 = PIE.ieDocMode > 8, propNames = this.propertyNames, rs = this.targetElement.runtimeStyle, rsImage = rs[propNames.IMAGE], rsColor = rs[propNames.COLOR], rsRepeat = rs[propNames.REPEAT], rsClip, rsOrigin, rsSize, rsPosition, ret; if( rsImage ) rs[propNames.IMAGE] = ''; if( rsColor ) rs[propNames.COLOR] = ''; if( rsRepeat ) rs[propNames.REPEAT] = ''; if( isIE9 ) { rsClip = rs[propNames.CLIP]; rsOrigin = rs[propNames.ORIGIN]; rsPosition = rs[propNames.POSITION]; rsSize = rs[propNames.SIZE]; if( rsClip ) rs[propNames.CLIP] = ''; if( rsOrigin ) rs[propNames.ORIGIN] = ''; if( rsPosition ) rs[propNames.POSITION] = ''; if( rsSize ) rs[propNames.SIZE] = ''; } ret = fn.call( this ); if( rsImage ) rs[propNames.IMAGE] = rsImage; if( rsColor ) rs[propNames.COLOR] = rsColor; if( rsRepeat ) rs[propNames.REPEAT] = rsRepeat; if( isIE9 ) { if( rsClip ) rs[propNames.CLIP] = rsClip; if( rsOrigin ) rs[propNames.ORIGIN] = rsOrigin; if( rsPosition ) rs[propNames.POSITION] = rsPosition; if( rsSize ) rs[propNames.SIZE] = rsSize; } return ret; }, getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { return this.getCss3() || this.withActualBg( function() { var cs = this.targetElement.currentStyle, propNames = this.propertyNames; return cs[propNames.COLOR] + ' ' + cs[propNames.IMAGE] + ' ' + cs[propNames.REPEAT] + ' ' + cs[propNames.POSITION + 'X'] + ' ' + cs[propNames.POSITION + 'Y']; } ); } ), getCss3: PIE.StyleInfoBase.cacheWhenLocked( function() { var el = this.targetElement; return el.style[ this.styleProperty ] || el.currentStyle.getAttribute( this.cssProperty ); } ), /** * Tests if style.PiePngFix or the -pie-png-fix property is set to true in IE6. */ isPngFix: function() { var val = 0, el; if( PIE.ieVersion < 7 ) { el = this.targetElement; val = ( '' + ( el.style[ PIE.STYLE_PREFIX + 'PngFix' ] || el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'png-fix' ) ) === 'true' ); } return val; }, /** * The isActive logic is slightly different, because getProps() always returns an object * even if it is just falling back to the native background properties. But we only want * to report is as being "active" if either the -pie-background override property is present * and parses successfully or '-pie-png-fix' is set to true in IE6. */ isActive: PIE.StyleInfoBase.cacheWhenLocked( function() { return (this.getCss3() || this.isPngFix()) && !!this.getProps(); } ) } );/** * Handles parsing, caching, and detecting changes to border CSS * @constructor * @param {Element} el the target element */ PIE.BorderStyleInfo = PIE.StyleInfoBase.newStyleInfo( { sides: [ 'Top', 'Right', 'Bottom', 'Left' ], namedWidths: { 'thin': '1px', 'medium': '3px', 'thick': '5px' }, parseCss: function( css ) { var w = {}, s = {}, c = {}, active = false, colorsSame = true, stylesSame = true, widthsSame = true; this.withActualBorder( function() { var el = this.targetElement, cs = el.currentStyle, i = 0, style, color, width, lastStyle, lastColor, lastWidth, side, ltr; for( ; i < 4; i++ ) { side = this.sides[ i ]; ltr = side.charAt(0).toLowerCase(); style = s[ ltr ] = cs[ 'border' + side + 'Style' ]; color = cs[ 'border' + side + 'Color' ]; width = cs[ 'border' + side + 'Width' ]; if( i > 0 ) { if( style !== lastStyle ) { stylesSame = false; } if( color !== lastColor ) { colorsSame = false; } if( width !== lastWidth ) { widthsSame = false; } } lastStyle = style; lastColor = color; lastWidth = width; c[ ltr ] = PIE.getColor( color ); width = w[ ltr ] = PIE.getLength( s[ ltr ] === 'none' ? '0' : ( this.namedWidths[ width ] || width ) ); if( width.pixels( this.targetElement ) > 0 ) { active = true; } } } ); return active ? { widths: w, styles: s, colors: c, widthsSame: widthsSame, colorsSame: colorsSame, stylesSame: stylesSame } : null; }, getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { var el = this.targetElement, cs = el.currentStyle, css; // Don't redraw or hide borders for cells in border-collapse:collapse tables if( !( el.tagName in PIE.tableCellTags && el.offsetParent.currentStyle.borderCollapse === 'collapse' ) ) { this.withActualBorder( function() { css = cs.borderWidth + '|' + cs.borderStyle + '|' + cs.borderColor; } ); } return css; } ), /** * Execute a function with the actual border styles (not overridden with runtimeStyle * properties set by the renderers) available via currentStyle. * @param fn */ withActualBorder: function( fn ) { var rs = this.targetElement.runtimeStyle, rsWidth = rs.borderWidth, rsColor = rs.borderColor, ret; if( rsWidth ) rs.borderWidth = ''; if( rsColor ) rs.borderColor = ''; ret = fn.call( this ); if( rsWidth ) rs.borderWidth = rsWidth; if( rsColor ) rs.borderColor = rsColor; return ret; } } ); /** * Handles parsing, caching, and detecting changes to border-radius CSS * @constructor * @param {Element} el the target element */ (function() { PIE.BorderRadiusStyleInfo = PIE.StyleInfoBase.newStyleInfo( { cssProperty: 'border-radius', styleProperty: 'borderRadius', parseCss: function( css ) { var p = null, x, y, tokenizer, token, length, hasNonZero = false; if( css ) { tokenizer = new PIE.Tokenizer( css ); function collectLengths() { var arr = [], num; while( ( token = tokenizer.next() ) && token.isLengthOrPercent() ) { length = PIE.getLength( token.tokenValue ); num = length.getNumber(); if( num < 0 ) { return null; } if( num > 0 ) { hasNonZero = true; } arr.push( length ); } return arr.length > 0 && arr.length < 5 ? { 'tl': arr[0], 'tr': arr[1] || arr[0], 'br': arr[2] || arr[0], 'bl': arr[3] || arr[1] || arr[0] } : null; } // Grab the initial sequence of lengths if( x = collectLengths() ) { // See if there is a slash followed by more lengths, for the y-axis radii if( token ) { if( token.tokenType & PIE.Tokenizer.Type.OPERATOR && token.tokenValue === '/' ) { y = collectLengths(); } } else { y = x; } // Treat all-zero values the same as no value if( hasNonZero && x && y ) { p = { x: x, y : y }; } } } return p; } } ); var zero = PIE.getLength( '0' ), zeros = { 'tl': zero, 'tr': zero, 'br': zero, 'bl': zero }; PIE.BorderRadiusStyleInfo.ALL_ZERO = { x: zeros, y: zeros }; })();/** * Handles parsing, caching, and detecting changes to border-image CSS * @constructor * @param {Element} el the target element */ PIE.BorderImageStyleInfo = PIE.StyleInfoBase.newStyleInfo( { cssProperty: 'border-image', styleProperty: 'borderImage', repeatIdents: { 'stretch':1, 'round':1, 'repeat':1, 'space':1 }, parseCss: function( css ) { var p = null, tokenizer, token, type, value, slices, widths, outsets, slashCount = 0, Type = PIE.Tokenizer.Type, IDENT = Type.IDENT, NUMBER = Type.NUMBER, PERCENT = Type.PERCENT; if( css ) { tokenizer = new PIE.Tokenizer( css ); p = {}; function isSlash( token ) { return token && ( token.tokenType & Type.OPERATOR ) && ( token.tokenValue === '/' ); } function isFillIdent( token ) { return token && ( token.tokenType & IDENT ) && ( token.tokenValue === 'fill' ); } function collectSlicesEtc() { slices = tokenizer.until( function( tok ) { return !( tok.tokenType & ( NUMBER | PERCENT ) ); } ); if( isFillIdent( tokenizer.next() ) && !p.fill ) { p.fill = true; } else { tokenizer.prev(); } if( isSlash( tokenizer.next() ) ) { slashCount++; widths = tokenizer.until( function( token ) { return !token.isLengthOrPercent() && !( ( token.tokenType & IDENT ) && token.tokenValue === 'auto' ); } ); if( isSlash( tokenizer.next() ) ) { slashCount++; outsets = tokenizer.until( function( token ) { return !token.isLength(); } ); } } else { tokenizer.prev(); } } while( token = tokenizer.next() ) { type = token.tokenType; value = token.tokenValue; // Numbers and/or 'fill' keyword: slice values. May be followed optionally by width values, followed optionally by outset values if( type & ( NUMBER | PERCENT ) && !slices ) { tokenizer.prev(); collectSlicesEtc(); } else if( isFillIdent( token ) && !p.fill ) { p.fill = true; collectSlicesEtc(); } // Idents: one or values for 'repeat' else if( ( type & IDENT ) && this.repeatIdents[value] && !p.repeat ) { p.repeat = { h: value }; if( token = tokenizer.next() ) { if( ( token.tokenType & IDENT ) && this.repeatIdents[token.tokenValue] ) { p.repeat.v = token.tokenValue; } else { tokenizer.prev(); } } } // URL of the image else if( ( type & Type.URL ) && !p.src ) { p.src = value; } // Found something unrecognized; exit. else { return null; } } // Validate what we collected if( !p.src || !slices || slices.length < 1 || slices.length > 4 || ( widths && widths.length > 4 ) || ( slashCount === 1 && widths.length < 1 ) || ( outsets && outsets.length > 4 ) || ( slashCount === 2 && outsets.length < 1 ) ) { return null; } // Fill in missing values if( !p.repeat ) { p.repeat = { h: 'stretch' }; } if( !p.repeat.v ) { p.repeat.v = p.repeat.h; } function distributeSides( tokens, convertFn ) { return { 't': convertFn( tokens[0] ), 'r': convertFn( tokens[1] || tokens[0] ), 'b': convertFn( tokens[2] || tokens[0] ), 'l': convertFn( tokens[3] || tokens[1] || tokens[0] ) }; } p.slice = distributeSides( slices, function( tok ) { return PIE.getLength( ( tok.tokenType & NUMBER ) ? tok.tokenValue + 'px' : tok.tokenValue ); } ); if( widths && widths[0] ) { p.widths = distributeSides( widths, function( tok ) { return tok.isLengthOrPercent() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue; } ); } if( outsets && outsets[0] ) { p.outset = distributeSides( outsets, function( tok ) { return tok.isLength() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue; } ); } } return p; } } );/** * Handles parsing, caching, and detecting changes to box-shadow CSS * @constructor * @param {Element} el the target element */ PIE.BoxShadowStyleInfo = PIE.StyleInfoBase.newStyleInfo( { cssProperty: 'box-shadow', styleProperty: 'boxShadow', parseCss: function( css ) { var props, getLength = PIE.getLength, Type = PIE.Tokenizer.Type, tokenizer; if( css ) { tokenizer = new PIE.Tokenizer( css ); props = { outset: [], inset: [] }; function parseItem() { var token, type, value, color, lengths, inset, len; while( token = tokenizer.next() ) { value = token.tokenValue; type = token.tokenType; if( type & Type.OPERATOR && value === ',' ) { break; } else if( token.isLength() && !lengths ) { tokenizer.prev(); lengths = tokenizer.until( function( token ) { return !token.isLength(); } ); } else if( type & Type.COLOR && !color ) { color = value; } else if( type & Type.IDENT && value === 'inset' && !inset ) { inset = true; } else { //encountered an unrecognized token; fail. return false; } } len = lengths && lengths.length; if( len > 1 && len < 5 ) { ( inset ? props.inset : props.outset ).push( { xOffset: getLength( lengths[0].tokenValue ), yOffset: getLength( lengths[1].tokenValue ), blur: getLength( lengths[2] ? lengths[2].tokenValue : '0' ), spread: getLength( lengths[3] ? lengths[3].tokenValue : '0' ), color: PIE.getColor( color || 'currentColor' ) } ); return true; } return false; } while( parseItem() ) {} } return props && ( props.inset.length || props.outset.length ) ? props : null; } } ); /** * Retrieves the state of the element's visibility and display * @constructor * @param {Element} el the target element */ PIE.VisibilityStyleInfo = PIE.StyleInfoBase.newStyleInfo( { getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { var cs = this.targetElement.currentStyle; return cs.visibility + '|' + cs.display; } ), parseCss: function() { var el = this.targetElement, rs = el.runtimeStyle, cs = el.currentStyle, rsVis = rs.visibility, csVis; rs.visibility = ''; csVis = cs.visibility; rs.visibility = rsVis; return { visible: csVis !== 'hidden', displayed: cs.display !== 'none' } }, /** * Always return false for isActive, since this property alone will not trigger * a renderer to do anything. */ isActive: function() { return false; } } ); PIE.RendererBase = { /** * Create a new Renderer class, with the standard constructor, and augmented by * the RendererBase's members. * @param proto */ newRenderer: function( proto ) { function Renderer( el, boundsInfo, styleInfos, parent ) { this.targetElement = el; this.boundsInfo = boundsInfo; this.styleInfos = styleInfos; this.parent = parent; } PIE.Util.merge( Renderer.prototype, PIE.RendererBase, proto ); return Renderer; }, /** * Flag indicating the element has already been positioned at least once. * @type {boolean} */ isPositioned: false, /** * Determine if the renderer needs to be updated * @return {boolean} */ needsUpdate: function() { return false; }, /** * Run any preparation logic that would affect the main update logic of this * renderer or any of the other renderers, e.g. things that might affect the * element's size or style properties. */ prepareUpdate: PIE.emptyFn, /** * Tell the renderer to update based on modified properties */ updateProps: function() { this.destroy(); if( this.isActive() ) { this.draw(); } }, /** * Tell the renderer to update based on modified element position */ updatePos: function() { this.isPositioned = true; }, /** * Tell the renderer to update based on modified element dimensions */ updateSize: function() { if( this.isActive() ) { this.draw(); } else { this.destroy(); } }, /** * Add a layer element, with the given z-order index, to the renderer's main box element. We can't use * z-index because that breaks when the root rendering box's z-index is 'auto' in IE8+ standards mode. * So instead we make sure they are inserted into the DOM in the correct order. * @param {number} index * @param {Element} el */ addLayer: function( index, el ) { this.removeLayer( index ); for( var layers = this._layers || ( this._layers = [] ), i = index + 1, len = layers.length, layer; i < len; i++ ) { layer = layers[i]; if( layer ) { break; } } layers[index] = el; this.getBox().insertBefore( el, layer || null ); }, /** * Retrieve a layer element by its index, or null if not present * @param {number} index * @return {Element} */ getLayer: function( index ) { var layers = this._layers; return layers && layers[index] || null; }, /** * Remove a layer element by its index * @param {number} index */ removeLayer: function( index ) { var layer = this.getLayer( index ), box = this._box; if( layer && box ) { box.removeChild( layer ); this._layers[index] = null; } }, /** * Get a VML shape by name, creating it if necessary. * @param {string} name A name identifying the element * @param {string=} subElName If specified a subelement of the shape will be created with this tag name * @param {Element} parent The parent element for the shape; will be ignored if 'group' is specified * @param {number=} group If specified, an ordinal group for the shape. 1 or greater. Groups are rendered * using container elements in the correct order, to get correct z stacking without z-index. */ getShape: function( name, subElName, parent, group ) { var shapes = this._shapes || ( this._shapes = {} ), shape = shapes[ name ], s; if( !shape ) { shape = shapes[ name ] = PIE.Util.createVmlElement( 'shape' ); if( subElName ) { shape.appendChild( shape[ subElName ] = PIE.Util.createVmlElement( subElName ) ); } if( group ) { parent = this.getLayer( group ); if( !parent ) { this.addLayer( group, doc.createElement( 'group' + group ) ); parent = this.getLayer( group ); } } parent.appendChild( shape ); s = shape.style; s.position = 'absolute'; s.left = s.top = 0; s['behavior'] = 'url(#default#VML)'; } return shape; }, /** * Delete a named shape which was created by getShape(). Returns true if a shape with the * given name was found and deleted, or false if there was no shape of that name. * @param {string} name * @return {boolean} */ deleteShape: function( name ) { var shapes = this._shapes, shape = shapes && shapes[ name ]; if( shape ) { shape.parentNode.removeChild( shape ); delete shapes[ name ]; } return !!shape; }, /** * For a given set of border radius length/percentage values, convert them to concrete pixel * values based on the current size of the target element. * @param {Object} radii * @return {Object} */ getRadiiPixels: function( radii ) { var el = this.targetElement, bounds = this.boundsInfo.getBounds(), w = bounds.w, h = bounds.h, tlX, tlY, trX, trY, brX, brY, blX, blY, f; tlX = radii.x['tl'].pixels( el, w ); tlY = radii.y['tl'].pixels( el, h ); trX = radii.x['tr'].pixels( el, w ); trY = radii.y['tr'].pixels( el, h ); brX = radii.x['br'].pixels( el, w ); brY = radii.y['br'].pixels( el, h ); blX = radii.x['bl'].pixels( el, w ); blY = radii.y['bl'].pixels( el, h ); // If any corner ellipses overlap, reduce them all by the appropriate factor. This formula // is taken straight from the CSS3 Backgrounds and Borders spec. f = Math.min( w / ( tlX + trX ), h / ( trY + brY ), w / ( blX + brX ), h / ( tlY + blY ) ); if( f < 1 ) { tlX *= f; tlY *= f; trX *= f; trY *= f; brX *= f; brY *= f; blX *= f; blY *= f; } return { x: { 'tl': tlX, 'tr': trX, 'br': brX, 'bl': blX }, y: { 'tl': tlY, 'tr': trY, 'br': brY, 'bl': blY } } }, /** * Return the VML path string for the element's background box, with corners rounded. * @param {Object.<{t:number, r:number, b:number, l:number}>} shrink - if present, specifies number of * pixels to shrink the box path inward from the element's four sides. * @param {number=} mult If specified, all coordinates will be multiplied by this number * @param {Object=} radii If specified, this will be used for the corner radii instead of the properties * from this renderer's borderRadiusInfo object. * @return {string} the VML path */ getBoxPath: function( shrink, mult, radii ) { mult = mult || 1; var r, str, bounds = this.boundsInfo.getBounds(), w = bounds.w * mult, h = bounds.h * mult, radInfo = this.styleInfos.borderRadiusInfo, floor = Math.floor, ceil = Math.ceil, shrinkT = shrink ? shrink.t * mult : 0, shrinkR = shrink ? shrink.r * mult : 0, shrinkB = shrink ? shrink.b * mult : 0, shrinkL = shrink ? shrink.l * mult : 0, tlX, tlY, trX, trY, brX, brY, blX, blY; if( radii || radInfo.isActive() ) { r = this.getRadiiPixels( radii || radInfo.getProps() ); tlX = r.x['tl'] * mult; tlY = r.y['tl'] * mult; trX = r.x['tr'] * mult; trY = r.y['tr'] * mult; brX = r.x['br'] * mult; brY = r.y['br'] * mult; blX = r.x['bl'] * mult; blY = r.y['bl'] * mult; str = 'm' + floor( shrinkL ) + ',' + floor( tlY ) + 'qy' + floor( tlX ) + ',' + floor( shrinkT ) + 'l' + ceil( w - trX ) + ',' + floor( shrinkT ) + 'qx' + ceil( w - shrinkR ) + ',' + floor( trY ) + 'l' + ceil( w - shrinkR ) + ',' + ceil( h - brY ) + 'qy' + ceil( w - brX ) + ',' + ceil( h - shrinkB ) + 'l' + floor( blX ) + ',' + ceil( h - shrinkB ) + 'qx' + floor( shrinkL ) + ',' + ceil( h - blY ) + ' x e'; } else { // simplified path for non-rounded box str = 'm' + floor( shrinkL ) + ',' + floor( shrinkT ) + 'l' + ceil( w - shrinkR ) + ',' + floor( shrinkT ) + 'l' + ceil( w - shrinkR ) + ',' + ceil( h - shrinkB ) + 'l' + floor( shrinkL ) + ',' + ceil( h - shrinkB ) + 'xe'; } return str; }, /** * Get the container element for the shapes, creating it if necessary. */ getBox: function() { var box = this.parent.getLayer( this.boxZIndex ), s; if( !box ) { box = doc.createElement( this.boxName ); s = box.style; s.position = 'absolute'; s.top = s.left = 0; this.parent.addLayer( this.boxZIndex, box ); } return box; }, /** * Hide the actual border of the element. In IE7 and up we can just set its color to transparent; * however IE6 does not support transparent borders so we have to get tricky with it. Also, some elements * like form buttons require removing the border width altogether, so for those we increase the padding * by the border size. */ hideBorder: function() { var el = this.targetElement, cs = el.currentStyle, rs = el.runtimeStyle, tag = el.tagName, isIE6 = PIE.ieVersion === 6, sides, side, i; if( ( isIE6 && ( tag in PIE.childlessElements || tag === 'FIELDSET' ) ) || tag === 'BUTTON' || ( tag === 'INPUT' && el.type in PIE.inputButtonTypes ) ) { rs.borderWidth = ''; sides = this.styleInfos.borderInfo.sides; for( i = sides.length; i--; ) { side = sides[ i ]; rs[ 'padding' + side ] = ''; rs[ 'padding' + side ] = ( PIE.getLength( cs[ 'padding' + side ] ) ).pixels( el ) + ( PIE.getLength( cs[ 'border' + side + 'Width' ] ) ).pixels( el ) + ( PIE.ieVersion !== 8 && i % 2 ? 1 : 0 ); //needs an extra horizontal pixel to counteract the extra "inner border" going away } rs.borderWidth = 0; } else if( isIE6 ) { // Wrap all the element's children in a custom element, set the element to visiblity:hidden, // and set the wrapper element to visiblity:visible. This hides the outer element's decorations // (background and border) but displays all the contents. // TODO find a better way to do this that doesn't mess up the DOM parent-child relationship, // as this can interfere with other author scripts which add/modify/delete children. Also, this // won't work for elements which cannot take children, e.g. input/button/textarea/img/etc. Look into // using a compositor filter or some other filter which masks the border. if( el.childNodes.length !== 1 || el.firstChild.tagName !== 'ie6-mask' ) { var cont = doc.createElement( 'ie6-mask' ), s = cont.style, child; s.visibility = 'visible'; s.zoom = 1; while( child = el.firstChild ) { cont.appendChild( child ); } el.appendChild( cont ); rs.visibility = 'hidden'; } } else { rs.borderColor = 'transparent'; } }, unhideBorder: function() { }, /** * Destroy the rendered objects. This is a base implementation which handles common renderer * structures, but individual renderers may override as necessary. */ destroy: function() { this.parent.removeLayer( this.boxZIndex ); delete this._shapes; delete this._layers; } }; /** * Root renderer; creates the outermost container element and handles keeping it aligned * with the target element's size and position. * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects */ PIE.RootRenderer = PIE.RendererBase.newRenderer( { isActive: function() { var children = this.childRenderers; for( var i in children ) { if( children.hasOwnProperty( i ) && children[ i ].isActive() ) { return true; } } return false; }, needsUpdate: function() { return this.styleInfos.visibilityInfo.changed(); }, updatePos: function() { if( this.isActive() ) { var el = this.getPositioningElement(), par = el, docEl, parRect, tgtCS = el.currentStyle, tgtPos = tgtCS.position, boxPos, s = this.getBox().style, cs, x = 0, y = 0, elBounds = this.boundsInfo.getBounds(), logicalZoomRatio = elBounds.logicalZoomRatio; if( tgtPos === 'fixed' && PIE.ieVersion > 6 ) { x = elBounds.x * logicalZoomRatio; y = elBounds.y * logicalZoomRatio; boxPos = tgtPos; } else { // Get the element's offsets from its nearest positioned ancestor. Uses // getBoundingClientRect for accuracy and speed. do { par = par.offsetParent; } while( par && ( par.currentStyle.position === 'static' ) ); if( par ) { parRect = par.getBoundingClientRect(); cs = par.currentStyle; x = ( elBounds.x - parRect.left ) * logicalZoomRatio - ( parseFloat(cs.borderLeftWidth) || 0 ); y = ( elBounds.y - parRect.top ) * logicalZoomRatio - ( parseFloat(cs.borderTopWidth) || 0 ); } else { docEl = doc.documentElement; x = ( elBounds.x + docEl.scrollLeft - docEl.clientLeft ) * logicalZoomRatio; y = ( elBounds.y + docEl.scrollTop - docEl.clientTop ) * logicalZoomRatio; } boxPos = 'absolute'; } s.position = boxPos; s.left = x; s.top = y; s.zIndex = tgtPos === 'static' ? -1 : tgtCS.zIndex; this.isPositioned = true; } }, updateSize: PIE.emptyFn, updateVisibility: function() { var vis = this.styleInfos.visibilityInfo.getProps(); this.getBox().style.display = ( vis.visible && vis.displayed ) ? '' : 'none'; }, updateProps: function() { if( this.isActive() ) { this.updateVisibility(); } else { this.destroy(); } }, getPositioningElement: function() { var el = this.targetElement; return el.tagName in PIE.tableCellTags ? el.offsetParent : el; }, getBox: function() { var box = this._box, el; if( !box ) { el = this.getPositioningElement(); box = this._box = doc.createElement( 'css3-container' ); box.style['direction'] = 'ltr'; //fix positioning bug in rtl environments this.updateVisibility(); el.parentNode.insertBefore( box, el ); } return box; }, finishUpdate: PIE.emptyFn, destroy: function() { var box = this._box, par; if( box && ( par = box.parentNode ) ) { par.removeChild( box ); } delete this._box; delete this._layers; } } ); /** * Renderer for element backgrounds. * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.BackgroundRenderer = PIE.RendererBase.newRenderer( { boxZIndex: 2, boxName: 'background', needsUpdate: function() { var si = this.styleInfos; return si.backgroundInfo.changed() || si.borderRadiusInfo.changed(); }, isActive: function() { var si = this.styleInfos; return si.borderImageInfo.isActive() || si.borderRadiusInfo.isActive() || si.backgroundInfo.isActive() || ( si.boxShadowInfo.isActive() && si.boxShadowInfo.getProps().inset ); }, /** * Draw the shapes */ draw: function() { var bounds = this.boundsInfo.getBounds(); if( bounds.w && bounds.h ) { this.drawBgColor(); this.drawBgImages(); } }, /** * Draw the background color shape */ drawBgColor: function() { var props = this.styleInfos.backgroundInfo.getProps(), bounds = this.boundsInfo.getBounds(), el = this.targetElement, color = props && props.color, shape, w, h, s, alpha; if( color && color.alpha() > 0 ) { this.hideBackground(); shape = this.getShape( 'bgColor', 'fill', this.getBox(), 1 ); w = bounds.w; h = bounds.h; shape.stroked = false; shape.coordsize = w * 2 + ',' + h * 2; shape.coordorigin = '1,1'; shape.path = this.getBoxPath( null, 2 ); s = shape.style; s.width = w; s.height = h; shape.fill.color = color.colorValue( el ); alpha = color.alpha(); if( alpha < 1 ) { shape.fill.opacity = alpha; } } else { this.deleteShape( 'bgColor' ); } }, /** * Draw all the background image layers */ drawBgImages: function() { var props = this.styleInfos.backgroundInfo.getProps(), bounds = this.boundsInfo.getBounds(), images = props && props.bgImages, img, shape, w, h, s, i; if( images ) { this.hideBackground(); w = bounds.w; h = bounds.h; i = images.length; while( i-- ) { img = images[i]; shape = this.getShape( 'bgImage' + i, 'fill', this.getBox(), 2 ); shape.stroked = false; shape.fill.type = 'tile'; shape.fillcolor = 'none'; shape.coordsize = w * 2 + ',' + h * 2; shape.coordorigin = '1,1'; shape.path = this.getBoxPath( 0, 2 ); s = shape.style; s.width = w; s.height = h; if( img.imgType === 'linear-gradient' ) { this.addLinearGradient( shape, img ); } else { shape.fill.src = img.imgUrl; this.positionBgImage( shape, i ); } } } // Delete any bgImage shapes previously created which weren't used above i = images ? images.length : 0; while( this.deleteShape( 'bgImage' + i++ ) ) {} }, /** * Set the position and clipping of the background image for a layer * @param {Element} shape * @param {number} index */ positionBgImage: function( shape, index ) { var me = this; PIE.Util.withImageSize( shape.fill.src, function( size ) { var el = me.targetElement, bounds = me.boundsInfo.getBounds(), elW = bounds.w, elH = bounds.h; // It's possible that the element dimensions are zero now but weren't when the original // update executed, make sure that's not the case to avoid divide-by-zero error if( elW && elH ) { var fill = shape.fill, si = me.styleInfos, border = si.borderInfo.getProps(), bw = border && border.widths, bwT = bw ? bw['t'].pixels( el ) : 0, bwR = bw ? bw['r'].pixels( el ) : 0, bwB = bw ? bw['b'].pixels( el ) : 0, bwL = bw ? bw['l'].pixels( el ) : 0, bg = si.backgroundInfo.getProps().bgImages[ index ], bgPos = bg.bgPosition ? bg.bgPosition.coords( el, elW - size.w - bwL - bwR, elH - size.h - bwT - bwB ) : { x:0, y:0 }, repeat = bg.imgRepeat, pxX, pxY, clipT = 0, clipL = 0, clipR = elW + 1, clipB = elH + 1, //make sure the default clip region is not inside the box (by a subpixel) clipAdjust = PIE.ieVersion === 8 ? 0 : 1; //prior to IE8 requires 1 extra pixel in the image clip region // Positioning - find the pixel offset from the top/left and convert to a ratio // The position is shifted by half a pixel, to adjust for the half-pixel coordorigin shift which is // needed to fix antialiasing but makes the bg image fuzzy. pxX = Math.round( bgPos.x ) + bwL + 0.5; pxY = Math.round( bgPos.y ) + bwT + 0.5; fill.position = ( pxX / elW ) + ',' + ( pxY / elH ); // Set the size of the image. We have to actually set it to px values otherwise it will not honor // the user's browser zoom level and always display at its natural screen size. fill['size']['x'] = 1; //Can be any value, just has to be set to "prime" it so the next line works. Weird! fill['size'] = size.w + 'px,' + size.h + 'px'; // Repeating - clip the image shape if( repeat && repeat !== 'repeat' ) { if( repeat === 'repeat-x' || repeat === 'no-repeat' ) { clipT = pxY + 1; clipB = pxY + size.h + clipAdjust; } if( repeat === 'repeat-y' || repeat === 'no-repeat' ) { clipL = pxX + 1; clipR = pxX + size.w + clipAdjust; } shape.style.clip = 'rect(' + clipT + 'px,' + clipR + 'px,' + clipB + 'px,' + clipL + 'px)'; } } } ); }, /** * Draw the linear gradient for a gradient layer * @param {Element} shape * @param {Object} info The object holding the information about the gradient */ addLinearGradient: function( shape, info ) { var el = this.targetElement, bounds = this.boundsInfo.getBounds(), w = bounds.w, h = bounds.h, fill = shape.fill, stops = info.stops, stopCount = stops.length, PI = Math.PI, GradientUtil = PIE.GradientUtil, perpendicularIntersect = GradientUtil.perpendicularIntersect, distance = GradientUtil.distance, metrics = GradientUtil.getGradientMetrics( el, w, h, info ), angle = metrics.angle, startX = metrics.startX, startY = metrics.startY, startCornerX = metrics.startCornerX, startCornerY = metrics.startCornerY, endCornerX = metrics.endCornerX, endCornerY = metrics.endCornerY, deltaX = metrics.deltaX, deltaY = metrics.deltaY, lineLength = metrics.lineLength, vmlAngle, vmlGradientLength, vmlColors, stopPx, vmlOffsetPct, p, i, j, before, after; // In VML land, the angle of the rendered gradient depends on the aspect ratio of the shape's // bounding box; for example specifying a 45 deg angle actually results in a gradient // drawn diagonally from one corner to its opposite corner, which will only appear to the // viewer as 45 degrees if the shape is equilateral. We adjust for this by taking the x/y deltas // between the start and end points, multiply one of them by the shape's aspect ratio, // and get their arctangent, resulting in an appropriate VML angle. If the angle is perfectly // horizontal or vertical then we don't need to do this conversion. vmlAngle = ( angle % 90 ) ? Math.atan2( deltaX * w / h, deltaY ) / PI * 180 : ( angle + 90 ); // VML angles are 180 degrees offset from CSS angles vmlAngle += 180; vmlAngle = vmlAngle % 360; // Add all the stops to the VML 'colors' list, including the first and last stops. // For each, we find its pixel offset along the gradient-line; if the offset of a stop is less // than that of its predecessor we increase it to be equal. We then map that pixel offset to a // percentage along the VML gradient-line, which runs from shape corner to corner. p = perpendicularIntersect( startCornerX, startCornerY, angle, endCornerX, endCornerY ); vmlGradientLength = distance( startCornerX, startCornerY, p[0], p[1] ); vmlColors = []; p = perpendicularIntersect( startX, startY, angle, startCornerX, startCornerY ); vmlOffsetPct = distance( startX, startY, p[0], p[1] ) / vmlGradientLength * 100; // Find the pixel offsets along the CSS3 gradient-line for each stop. stopPx = []; for( i = 0; i < stopCount; i++ ) { stopPx.push( stops[i].offset ? stops[i].offset.pixels( el, lineLength ) : i === 0 ? 0 : i === stopCount - 1 ? lineLength : null ); } // Fill in gaps with evenly-spaced offsets for( i = 1; i < stopCount; i++ ) { if( stopPx[ i ] === null ) { before = stopPx[ i - 1 ]; j = i; do { after = stopPx[ ++j ]; } while( after === null ); stopPx[ i ] = before + ( after - before ) / ( j - i + 1 ); } // Make sure each stop's offset is no less than the one before it stopPx[ i ] = Math.max( stopPx[ i ], stopPx[ i - 1 ] ); } // Convert to percentage along the VML gradient line and add to the VML 'colors' value for( i = 0; i < stopCount; i++ ) { vmlColors.push( ( vmlOffsetPct + ( stopPx[ i ] / vmlGradientLength * 100 ) ) + '% ' + stops[i].color.colorValue( el ) ); } // Now, finally, we're ready to render the gradient fill. Set the start and end colors to // the first and last stop colors; this just sets outer bounds for the gradient. fill['angle'] = vmlAngle; fill['type'] = 'gradient'; fill['method'] = 'sigma'; fill['color'] = stops[0].color.colorValue( el ); fill['color2'] = stops[stopCount - 1].color.colorValue( el ); if( fill['colors'] ) { //sometimes the colors object isn't initialized so we have to assign it directly (?) fill['colors'].value = vmlColors.join( ',' ); } else { fill['colors'] = vmlColors.join( ',' ); } }, /** * Hide the actual background image and color of the element. */ hideBackground: function() { var rs = this.targetElement.runtimeStyle; rs.backgroundImage = 'url(about:blank)'; //ensures the background area reacts to mouse events rs.backgroundColor = 'transparent'; }, destroy: function() { PIE.RendererBase.destroy.call( this ); var rs = this.targetElement.runtimeStyle; rs.backgroundImage = rs.backgroundColor = ''; } } ); /** * Renderer for element borders. * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.BorderRenderer = PIE.RendererBase.newRenderer( { boxZIndex: 4, boxName: 'border', needsUpdate: function() { var si = this.styleInfos; return si.borderInfo.changed() || si.borderRadiusInfo.changed(); }, isActive: function() { var si = this.styleInfos; return si.borderRadiusInfo.isActive() && !si.borderImageInfo.isActive() && si.borderInfo.isActive(); //check BorderStyleInfo last because it's the most expensive }, /** * Draw the border shape(s) */ draw: function() { var el = this.targetElement, props = this.styleInfos.borderInfo.getProps(), bounds = this.boundsInfo.getBounds(), w = bounds.w, h = bounds.h, shape, stroke, s, segments, seg, i, len; if( props ) { this.hideBorder(); segments = this.getBorderSegments( 2 ); for( i = 0, len = segments.length; i < len; i++) { seg = segments[i]; shape = this.getShape( 'borderPiece' + i, seg.stroke ? 'stroke' : 'fill', this.getBox() ); shape.coordsize = w * 2 + ',' + h * 2; shape.coordorigin = '1,1'; shape.path = seg.path; s = shape.style; s.width = w; s.height = h; shape.filled = !!seg.fill; shape.stroked = !!seg.stroke; if( seg.stroke ) { stroke = shape.stroke; stroke['weight'] = seg.weight + 'px'; stroke.color = seg.color.colorValue( el ); stroke['dashstyle'] = seg.stroke === 'dashed' ? '2 2' : seg.stroke === 'dotted' ? '1 1' : 'solid'; stroke['linestyle'] = seg.stroke === 'double' && seg.weight > 2 ? 'ThinThin' : 'Single'; } else { shape.fill.color = seg.fill.colorValue( el ); } } // remove any previously-created border shapes which didn't get used above while( this.deleteShape( 'borderPiece' + i++ ) ) {} } }, /** * Get the VML path definitions for the border segment(s). * @param {number=} mult If specified, all coordinates will be multiplied by this number * @return {Array.<string>} */ getBorderSegments: function( mult ) { var el = this.targetElement, bounds, elW, elH, borderInfo = this.styleInfos.borderInfo, segments = [], floor, ceil, wT, wR, wB, wL, round = Math.round, borderProps, radiusInfo, radii, widths, styles, colors; if( borderInfo.isActive() ) { borderProps = borderInfo.getProps(); widths = borderProps.widths; styles = borderProps.styles; colors = borderProps.colors; if( borderProps.widthsSame && borderProps.stylesSame && borderProps.colorsSame ) { if( colors['t'].alpha() > 0 ) { // shortcut for identical border on all sides - only need 1 stroked shape wT = widths['t'].pixels( el ); //thickness wR = wT / 2; //shrink segments.push( { path: this.getBoxPath( { t: wR, r: wR, b: wR, l: wR }, mult ), stroke: styles['t'], color: colors['t'], weight: wT } ); } } else { mult = mult || 1; bounds = this.boundsInfo.getBounds(); elW = bounds.w; elH = bounds.h; wT = round( widths['t'].pixels( el ) ); wR = round( widths['r'].pixels( el ) ); wB = round( widths['b'].pixels( el ) ); wL = round( widths['l'].pixels( el ) ); var pxWidths = { 't': wT, 'r': wR, 'b': wB, 'l': wL }; radiusInfo = this.styleInfos.borderRadiusInfo; if( radiusInfo.isActive() ) { radii = this.getRadiiPixels( radiusInfo.getProps() ); } floor = Math.floor; ceil = Math.ceil; function radius( xy, corner ) { return radii ? radii[ xy ][ corner ] : 0; } function curve( corner, shrinkX, shrinkY, startAngle, ccw, doMove ) { var rx = radius( 'x', corner), ry = radius( 'y', corner), deg = 65535, isRight = corner.charAt( 1 ) === 'r', isBottom = corner.charAt( 0 ) === 'b'; return ( rx > 0 && ry > 0 ) ? ( doMove ? 'al' : 'ae' ) + ( isRight ? ceil( elW - rx ) : floor( rx ) ) * mult + ',' + // center x ( isBottom ? ceil( elH - ry ) : floor( ry ) ) * mult + ',' + // center y ( floor( rx ) - shrinkX ) * mult + ',' + // width ( floor( ry ) - shrinkY ) * mult + ',' + // height ( startAngle * deg ) + ',' + // start angle ( 45 * deg * ( ccw ? 1 : -1 ) // angle change ) : ( ( doMove ? 'm' : 'l' ) + ( isRight ? elW - shrinkX : shrinkX ) * mult + ',' + ( isBottom ? elH - shrinkY : shrinkY ) * mult ); } function line( side, shrink, ccw, doMove ) { var start = ( side === 't' ? floor( radius( 'x', 'tl') ) * mult + ',' + ceil( shrink ) * mult : side === 'r' ? ceil( elW - shrink ) * mult + ',' + floor( radius( 'y', 'tr') ) * mult : side === 'b' ? ceil( elW - radius( 'x', 'br') ) * mult + ',' + floor( elH - shrink ) * mult : // side === 'l' ? floor( shrink ) * mult + ',' + ceil( elH - radius( 'y', 'bl') ) * mult ), end = ( side === 't' ? ceil( elW - radius( 'x', 'tr') ) * mult + ',' + ceil( shrink ) * mult : side === 'r' ? ceil( elW - shrink ) * mult + ',' + ceil( elH - radius( 'y', 'br') ) * mult : side === 'b' ? floor( radius( 'x', 'bl') ) * mult + ',' + floor( elH - shrink ) * mult : // side === 'l' ? floor( shrink ) * mult + ',' + floor( radius( 'y', 'tl') ) * mult ); return ccw ? ( doMove ? 'm' + end : '' ) + 'l' + start : ( doMove ? 'm' + start : '' ) + 'l' + end; } function addSide( side, sideBefore, sideAfter, cornerBefore, cornerAfter, baseAngle ) { var vert = side === 'l' || side === 'r', sideW = pxWidths[ side ], beforeX, beforeY, afterX, afterY; if( sideW > 0 && styles[ side ] !== 'none' && colors[ side ].alpha() > 0 ) { beforeX = pxWidths[ vert ? side : sideBefore ]; beforeY = pxWidths[ vert ? sideBefore : side ]; afterX = pxWidths[ vert ? side : sideAfter ]; afterY = pxWidths[ vert ? sideAfter : side ]; if( styles[ side ] === 'dashed' || styles[ side ] === 'dotted' ) { segments.push( { path: curve( cornerBefore, beforeX, beforeY, baseAngle + 45, 0, 1 ) + curve( cornerBefore, 0, 0, baseAngle, 1, 0 ), fill: colors[ side ] } ); segments.push( { path: line( side, sideW / 2, 0, 1 ), stroke: styles[ side ], weight: sideW, color: colors[ side ] } ); segments.push( { path: curve( cornerAfter, afterX, afterY, baseAngle, 0, 1 ) + curve( cornerAfter, 0, 0, baseAngle - 45, 1, 0 ), fill: colors[ side ] } ); } else { segments.push( { path: curve( cornerBefore, beforeX, beforeY, baseAngle + 45, 0, 1 ) + line( side, sideW, 0, 0 ) + curve( cornerAfter, afterX, afterY, baseAngle, 0, 0 ) + ( styles[ side ] === 'double' && sideW > 2 ? curve( cornerAfter, afterX - floor( afterX / 3 ), afterY - floor( afterY / 3 ), baseAngle - 45, 1, 0 ) + line( side, ceil( sideW / 3 * 2 ), 1, 0 ) + curve( cornerBefore, beforeX - floor( beforeX / 3 ), beforeY - floor( beforeY / 3 ), baseAngle, 1, 0 ) + 'x ' + curve( cornerBefore, floor( beforeX / 3 ), floor( beforeY / 3 ), baseAngle + 45, 0, 1 ) + line( side, floor( sideW / 3 ), 1, 0 ) + curve( cornerAfter, floor( afterX / 3 ), floor( afterY / 3 ), baseAngle, 0, 0 ) : '' ) + curve( cornerAfter, 0, 0, baseAngle - 45, 1, 0 ) + line( side, 0, 1, 0 ) + curve( cornerBefore, 0, 0, baseAngle, 1, 0 ), fill: colors[ side ] } ); } } } addSide( 't', 'l', 'r', 'tl', 'tr', 90 ); addSide( 'r', 't', 'b', 'tr', 'br', 0 ); addSide( 'b', 'r', 'l', 'br', 'bl', -90 ); addSide( 'l', 'b', 't', 'bl', 'tl', -180 ); } } return segments; }, destroy: function() { var me = this; if (me.finalized || !me.styleInfos.borderImageInfo.isActive()) { me.targetElement.runtimeStyle.borderColor = ''; } PIE.RendererBase.destroy.call( me ); } } ); /** * Renderer for border-image * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.BorderImageRenderer = PIE.RendererBase.newRenderer( { boxZIndex: 5, pieceNames: [ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl', 'c' ], needsUpdate: function() { return this.styleInfos.borderImageInfo.changed(); }, isActive: function() { return this.styleInfos.borderImageInfo.isActive(); }, draw: function() { this.getBox(); //make sure pieces are created var props = this.styleInfos.borderImageInfo.getProps(), borderProps = this.styleInfos.borderInfo.getProps(), bounds = this.boundsInfo.getBounds(), el = this.targetElement, pieces = this.pieces; PIE.Util.withImageSize( props.src, function( imgSize ) { var elW = bounds.w, elH = bounds.h, zero = PIE.getLength( '0' ), widths = props.widths || ( borderProps ? borderProps.widths : { 't': zero, 'r': zero, 'b': zero, 'l': zero } ), widthT = widths['t'].pixels( el ), widthR = widths['r'].pixels( el ), widthB = widths['b'].pixels( el ), widthL = widths['l'].pixels( el ), slices = props.slice, sliceT = slices['t'].pixels( el ), sliceR = slices['r'].pixels( el ), sliceB = slices['b'].pixels( el ), sliceL = slices['l'].pixels( el ); // Piece positions and sizes function setSizeAndPos( piece, w, h, x, y ) { var s = pieces[piece].style, max = Math.max; s.width = max(w, 0); s.height = max(h, 0); s.left = x; s.top = y; } setSizeAndPos( 'tl', widthL, widthT, 0, 0 ); setSizeAndPos( 't', elW - widthL - widthR, widthT, widthL, 0 ); setSizeAndPos( 'tr', widthR, widthT, elW - widthR, 0 ); setSizeAndPos( 'r', widthR, elH - widthT - widthB, elW - widthR, widthT ); setSizeAndPos( 'br', widthR, widthB, elW - widthR, elH - widthB ); setSizeAndPos( 'b', elW - widthL - widthR, widthB, widthL, elH - widthB ); setSizeAndPos( 'bl', widthL, widthB, 0, elH - widthB ); setSizeAndPos( 'l', widthL, elH - widthT - widthB, 0, widthT ); setSizeAndPos( 'c', elW - widthL - widthR, elH - widthT - widthB, widthL, widthT ); // image croppings function setCrops( sides, crop, val ) { for( var i=0, len=sides.length; i < len; i++ ) { pieces[ sides[i] ]['imagedata'][ crop ] = val; } } // corners setCrops( [ 'tl', 't', 'tr' ], 'cropBottom', ( imgSize.h - sliceT ) / imgSize.h ); setCrops( [ 'tl', 'l', 'bl' ], 'cropRight', ( imgSize.w - sliceL ) / imgSize.w ); setCrops( [ 'bl', 'b', 'br' ], 'cropTop', ( imgSize.h - sliceB ) / imgSize.h ); setCrops( [ 'tr', 'r', 'br' ], 'cropLeft', ( imgSize.w - sliceR ) / imgSize.w ); // edges and center // TODO right now this treats everything like 'stretch', need to support other schemes //if( props.repeat.v === 'stretch' ) { setCrops( [ 'l', 'r', 'c' ], 'cropTop', sliceT / imgSize.h ); setCrops( [ 'l', 'r', 'c' ], 'cropBottom', sliceB / imgSize.h ); //} //if( props.repeat.h === 'stretch' ) { setCrops( [ 't', 'b', 'c' ], 'cropLeft', sliceL / imgSize.w ); setCrops( [ 't', 'b', 'c' ], 'cropRight', sliceR / imgSize.w ); //} // center fill pieces['c'].style.display = props.fill ? '' : 'none'; }, this ); }, getBox: function() { var box = this.parent.getLayer( this.boxZIndex ), s, piece, i, pieceNames = this.pieceNames, len = pieceNames.length; if( !box ) { box = doc.createElement( 'border-image' ); s = box.style; s.position = 'absolute'; this.pieces = {}; for( i = 0; i < len; i++ ) { piece = this.pieces[ pieceNames[i] ] = PIE.Util.createVmlElement( 'rect' ); piece.appendChild( PIE.Util.createVmlElement( 'imagedata' ) ); s = piece.style; s['behavior'] = 'url(#default#VML)'; s.position = "absolute"; s.top = s.left = 0; piece['imagedata'].src = this.styleInfos.borderImageInfo.getProps().src; piece.stroked = false; piece.filled = false; box.appendChild( piece ); } this.parent.addLayer( this.boxZIndex, box ); } return box; }, prepareUpdate: function() { if (this.isActive()) { var me = this, el = me.targetElement, rs = el.runtimeStyle, widths = me.styleInfos.borderImageInfo.getProps().widths; // Force border-style to solid so it doesn't collapse rs.borderStyle = 'solid'; // If widths specified in border-image shorthand, override border-width // NOTE px units needed here as this gets used by the IE9 renderer too if ( widths ) { rs.borderTopWidth = widths['t'].pixels( el ) + 'px'; rs.borderRightWidth = widths['r'].pixels( el ) + 'px'; rs.borderBottomWidth = widths['b'].pixels( el ) + 'px'; rs.borderLeftWidth = widths['l'].pixels( el ) + 'px'; } // Make the border transparent me.hideBorder(); } }, destroy: function() { var me = this, rs = me.targetElement.runtimeStyle; rs.borderStyle = ''; if (me.finalized || !me.styleInfos.borderInfo.isActive()) { rs.borderColor = rs.borderWidth = ''; } PIE.RendererBase.destroy.call( this ); } } ); /** * Renderer for outset box-shadows * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.BoxShadowOutsetRenderer = PIE.RendererBase.newRenderer( { boxZIndex: 1, boxName: 'outset-box-shadow', needsUpdate: function() { var si = this.styleInfos; return si.boxShadowInfo.changed() || si.borderRadiusInfo.changed(); }, isActive: function() { var boxShadowInfo = this.styleInfos.boxShadowInfo; return boxShadowInfo.isActive() && boxShadowInfo.getProps().outset[0]; }, draw: function() { var me = this, el = this.targetElement, box = this.getBox(), styleInfos = this.styleInfos, shadowInfos = styleInfos.boxShadowInfo.getProps().outset, radii = styleInfos.borderRadiusInfo.getProps(), len = shadowInfos.length, i = len, j, bounds = this.boundsInfo.getBounds(), w = bounds.w, h = bounds.h, clipAdjust = PIE.ieVersion === 8 ? 1 : 0, //workaround for IE8 bug where VML leaks out top/left of clip region by 1px corners = [ 'tl', 'tr', 'br', 'bl' ], corner, shadowInfo, shape, fill, ss, xOff, yOff, spread, blur, shrink, color, alpha, path, totalW, totalH, focusX, focusY, isBottom, isRight; function getShadowShape( index, corner, xOff, yOff, color, blur, path ) { var shape = me.getShape( 'shadow' + index + corner, 'fill', box, len - index ), fill = shape.fill; // Position and size shape['coordsize'] = w * 2 + ',' + h * 2; shape['coordorigin'] = '1,1'; // Color and opacity shape['stroked'] = false; shape['filled'] = true; fill.color = color.colorValue( el ); if( blur ) { fill['type'] = 'gradienttitle'; //makes the VML gradient follow the shape's outline - hooray for undocumented features?!?! fill['color2'] = fill.color; fill['opacity'] = 0; } // Path shape.path = path; // This needs to go last for some reason, to prevent rendering at incorrect size ss = shape.style; ss.left = xOff; ss.top = yOff; ss.width = w; ss.height = h; return shape; } while( i-- ) { shadowInfo = shadowInfos[ i ]; xOff = shadowInfo.xOffset.pixels( el ); yOff = shadowInfo.yOffset.pixels( el ); spread = shadowInfo.spread.pixels( el ); blur = shadowInfo.blur.pixels( el ); color = shadowInfo.color; // Shape path shrink = -spread - blur; if( !radii && blur ) { // If blurring, use a non-null border radius info object so that getBoxPath will // round the corners of the expanded shadow shape rather than squaring them off. radii = PIE.BorderRadiusStyleInfo.ALL_ZERO; } path = this.getBoxPath( { t: shrink, r: shrink, b: shrink, l: shrink }, 2, radii ); if( blur ) { totalW = ( spread + blur ) * 2 + w; totalH = ( spread + blur ) * 2 + h; focusX = totalW ? blur * 2 / totalW : 0; focusY = totalH ? blur * 2 / totalH : 0; if( blur - spread > w / 2 || blur - spread > h / 2 ) { // If the blur is larger than half the element's narrowest dimension, we cannot do // this with a single shape gradient, because its focussize would have to be less than // zero which results in ugly artifacts. Instead we create four shapes, each with its // gradient focus past center, and then clip them so each only shows the quadrant // opposite the focus. for( j = 4; j--; ) { corner = corners[j]; isBottom = corner.charAt( 0 ) === 'b'; isRight = corner.charAt( 1 ) === 'r'; shape = getShadowShape( i, corner, xOff, yOff, color, blur, path ); fill = shape.fill; fill['focusposition'] = ( isRight ? 1 - focusX : focusX ) + ',' + ( isBottom ? 1 - focusY : focusY ); fill['focussize'] = '0,0'; // Clip to show only the appropriate quadrant. Add 1px to the top/left clip values // in IE8 to prevent a bug where IE8 displays one pixel outside the clip region. shape.style.clip = 'rect(' + ( ( isBottom ? totalH / 2 : 0 ) + clipAdjust ) + 'px,' + ( isRight ? totalW : totalW / 2 ) + 'px,' + ( isBottom ? totalH : totalH / 2 ) + 'px,' + ( ( isRight ? totalW / 2 : 0 ) + clipAdjust ) + 'px)'; } } else { // TODO delete old quadrant shapes if resizing expands past the barrier shape = getShadowShape( i, '', xOff, yOff, color, blur, path ); fill = shape.fill; fill['focusposition'] = focusX + ',' + focusY; fill['focussize'] = ( 1 - focusX * 2 ) + ',' + ( 1 - focusY * 2 ); } } else { shape = getShadowShape( i, '', xOff, yOff, color, blur, path ); alpha = color.alpha(); if( alpha < 1 ) { // shape.style.filter = 'alpha(opacity=' + ( alpha * 100 ) + ')'; // ss.filter = 'progid:DXImageTransform.Microsoft.BasicImage(opacity=' + ( alpha ) + ')'; shape.fill.opacity = alpha; } } } } } ); /** * Renderer for re-rendering img elements using VML. Kicks in if the img has * a border-radius applied, or if the -pie-png-fix flag is set. * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.ImgRenderer = PIE.RendererBase.newRenderer( { boxZIndex: 6, boxName: 'imgEl', needsUpdate: function() { var si = this.styleInfos; return this.targetElement.src !== this._lastSrc || si.borderRadiusInfo.changed(); }, isActive: function() { var si = this.styleInfos; return si.borderRadiusInfo.isActive() || si.backgroundInfo.isPngFix(); }, draw: function() { this._lastSrc = src; this.hideActualImg(); var shape = this.getShape( 'img', 'fill', this.getBox() ), fill = shape.fill, bounds = this.boundsInfo.getBounds(), w = bounds.w, h = bounds.h, borderProps = this.styleInfos.borderInfo.getProps(), borderWidths = borderProps && borderProps.widths, el = this.targetElement, src = el.src, round = Math.round, cs = el.currentStyle, getLength = PIE.getLength, s, zero; // In IE6, the BorderRenderer will have hidden the border by moving the border-width to // the padding; therefore we want to pretend the borders have no width so they aren't doubled // when adding in the current padding value below. if( !borderWidths || PIE.ieVersion < 7 ) { zero = PIE.getLength( '0' ); borderWidths = { 't': zero, 'r': zero, 'b': zero, 'l': zero }; } shape.stroked = false; fill.type = 'frame'; fill.src = src; fill.position = (w ? 0.5 / w : 0) + ',' + (h ? 0.5 / h : 0); shape.coordsize = w * 2 + ',' + h * 2; shape.coordorigin = '1,1'; shape.path = this.getBoxPath( { t: round( borderWidths['t'].pixels( el ) + getLength( cs.paddingTop ).pixels( el ) ), r: round( borderWidths['r'].pixels( el ) + getLength( cs.paddingRight ).pixels( el ) ), b: round( borderWidths['b'].pixels( el ) + getLength( cs.paddingBottom ).pixels( el ) ), l: round( borderWidths['l'].pixels( el ) + getLength( cs.paddingLeft ).pixels( el ) ) }, 2 ); s = shape.style; s.width = w; s.height = h; }, hideActualImg: function() { this.targetElement.runtimeStyle.filter = 'alpha(opacity=0)'; }, destroy: function() { PIE.RendererBase.destroy.call( this ); this.targetElement.runtimeStyle.filter = ''; } } ); /** * Root renderer for IE9; manages the rendering layers in the element's background * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects */ PIE.IE9RootRenderer = PIE.RendererBase.newRenderer( { updatePos: PIE.emptyFn, updateSize: PIE.emptyFn, updateVisibility: PIE.emptyFn, updateProps: PIE.emptyFn, outerCommasRE: /^,+|,+$/g, innerCommasRE: /,+/g, setBackgroundLayer: function(zIndex, bg) { var me = this, bgLayers = me._bgLayers || ( me._bgLayers = [] ), undef; bgLayers[zIndex] = bg || undef; }, finishUpdate: function() { var me = this, bgLayers = me._bgLayers, bg; if( bgLayers && ( bg = bgLayers.join( ',' ).replace( me.outerCommasRE, '' ).replace( me.innerCommasRE, ',' ) ) !== me._lastBg ) { me._lastBg = me.targetElement.runtimeStyle.background = bg; } }, destroy: function() { this.targetElement.runtimeStyle.background = ''; delete this._bgLayers; } } ); /** * Renderer for element backgrounds, specific for IE9. Only handles translating CSS3 gradients * to an equivalent SVG data URI. * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects */ PIE.IE9BackgroundRenderer = PIE.RendererBase.newRenderer( { bgLayerZIndex: 1, needsUpdate: function() { var si = this.styleInfos; return si.backgroundInfo.changed(); }, isActive: function() { var si = this.styleInfos; return si.backgroundInfo.isActive() || si.borderImageInfo.isActive(); }, draw: function() { var me = this, props = me.styleInfos.backgroundInfo.getProps(), bg, images, i = 0, img, bgAreaSize, bgSize; if ( props ) { bg = []; images = props.bgImages; if ( images ) { while( img = images[ i++ ] ) { if (img.imgType === 'linear-gradient' ) { bgAreaSize = me.getBgAreaSize( img.bgOrigin ); bgSize = ( img.bgSize || PIE.BgSize.DEFAULT ).pixels( me.targetElement, bgAreaSize.w, bgAreaSize.h, bgAreaSize.w, bgAreaSize.h ), bg.push( 'url(data:image/svg+xml,' + escape( me.getGradientSvg( img, bgSize.w, bgSize.h ) ) + ') ' + me.bgPositionToString( img.bgPosition ) + ' / ' + bgSize.w + 'px ' + bgSize.h + 'px ' + ( img.bgAttachment || '' ) + ' ' + ( img.bgOrigin || '' ) + ' ' + ( img.bgClip || '' ) ); } else { bg.push( img.origString ); } } } if ( props.color ) { bg.push( props.color.val ); } me.parent.setBackgroundLayer(me.bgLayerZIndex, bg.join(',')); } }, bgPositionToString: function( bgPosition ) { return bgPosition ? bgPosition.tokens.map(function(token) { return token.tokenValue; }).join(' ') : '0 0'; }, getBgAreaSize: function( bgOrigin ) { var me = this, el = me.targetElement, bounds = me.boundsInfo.getBounds(), elW = bounds.w, elH = bounds.h, w = elW, h = elH, borders, getLength, cs; if( bgOrigin !== 'border-box' ) { borders = me.styleInfos.borderInfo.getProps(); if( borders && ( borders = borders.widths ) ) { w -= borders[ 'l' ].pixels( el ) + borders[ 'l' ].pixels( el ); h -= borders[ 't' ].pixels( el ) + borders[ 'b' ].pixels( el ); } } if ( bgOrigin === 'content-box' ) { getLength = PIE.getLength; cs = el.currentStyle; w -= getLength( cs.paddingLeft ).pixels( el ) + getLength( cs.paddingRight ).pixels( el ); h -= getLength( cs.paddingTop ).pixels( el ) + getLength( cs.paddingBottom ).pixels( el ); } return { w: w, h: h }; }, getGradientSvg: function( info, bgWidth, bgHeight ) { var el = this.targetElement, stopsInfo = info.stops, stopCount = stopsInfo.length, metrics = PIE.GradientUtil.getGradientMetrics( el, bgWidth, bgHeight, info ), startX = metrics.startX, startY = metrics.startY, endX = metrics.endX, endY = metrics.endY, lineLength = metrics.lineLength, stopPx, i, j, before, after, svg; // Find the pixel offsets along the CSS3 gradient-line for each stop. stopPx = []; for( i = 0; i < stopCount; i++ ) { stopPx.push( stopsInfo[i].offset ? stopsInfo[i].offset.pixels( el, lineLength ) : i === 0 ? 0 : i === stopCount - 1 ? lineLength : null ); } // Fill in gaps with evenly-spaced offsets for( i = 1; i < stopCount; i++ ) { if( stopPx[ i ] === null ) { before = stopPx[ i - 1 ]; j = i; do { after = stopPx[ ++j ]; } while( after === null ); stopPx[ i ] = before + ( after - before ) / ( j - i + 1 ); } } svg = [ '<svg width="' + bgWidth + '" height="' + bgHeight + '" xmlns="http://www.w3.org/2000/svg">' + '<defs>' + '<linearGradient id="g" gradientUnits="userSpaceOnUse"' + ' x1="' + ( startX / bgWidth * 100 ) + '%" y1="' + ( startY / bgHeight * 100 ) + '%" x2="' + ( endX / bgWidth * 100 ) + '%" y2="' + ( endY / bgHeight * 100 ) + '%">' ]; // Convert to percentage along the SVG gradient line and add to the stops list for( i = 0; i < stopCount; i++ ) { svg.push( '<stop offset="' + ( stopPx[ i ] / lineLength ) + '" stop-color="' + stopsInfo[i].color.colorValue( el ) + '" stop-opacity="' + stopsInfo[i].color.alpha() + '"/>' ); } svg.push( '</linearGradient>' + '</defs>' + '<rect width="100%" height="100%" fill="url(#g)"/>' + '</svg>' ); return svg.join( '' ); }, destroy: function() { this.parent.setBackgroundLayer( this.bgLayerZIndex ); } } ); /** * Renderer for border-image * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.IE9BorderImageRenderer = PIE.RendererBase.newRenderer( { REPEAT: 'repeat', STRETCH: 'stretch', ROUND: 'round', bgLayerZIndex: 0, needsUpdate: function() { return this.styleInfos.borderImageInfo.changed(); }, isActive: function() { return this.styleInfos.borderImageInfo.isActive(); }, draw: function() { var me = this, props = me.styleInfos.borderImageInfo.getProps(), borderProps = me.styleInfos.borderInfo.getProps(), bounds = me.boundsInfo.getBounds(), repeat = props.repeat, repeatH = repeat.h, repeatV = repeat.v, el = me.targetElement, isAsync = 0; PIE.Util.withImageSize( props.src, function( imgSize ) { var elW = bounds.w, elH = bounds.h, imgW = imgSize.w, imgH = imgSize.h, // The image cannot be referenced as a URL directly in the SVG because IE9 throws a strange // security exception (perhaps due to cross-origin policy within data URIs?) Therefore we // work around this by converting the image data into a data URI itself using a transient // canvas. This unfortunately requires the border-image src to be within the same domain, // which isn't a limitation in true border-image, so we need to try and find a better fix. imgSrc = me.imageToDataURI( props.src, imgW, imgH ), REPEAT = me.REPEAT, STRETCH = me.STRETCH, ROUND = me.ROUND, ceil = Math.ceil, zero = PIE.getLength( '0' ), widths = props.widths || ( borderProps ? borderProps.widths : { 't': zero, 'r': zero, 'b': zero, 'l': zero } ), widthT = widths['t'].pixels( el ), widthR = widths['r'].pixels( el ), widthB = widths['b'].pixels( el ), widthL = widths['l'].pixels( el ), slices = props.slice, sliceT = slices['t'].pixels( el ), sliceR = slices['r'].pixels( el ), sliceB = slices['b'].pixels( el ), sliceL = slices['l'].pixels( el ), centerW = elW - widthL - widthR, middleH = elH - widthT - widthB, imgCenterW = imgW - sliceL - sliceR, imgMiddleH = imgH - sliceT - sliceB, // Determine the size of each tile - 'round' is handled below tileSizeT = repeatH === STRETCH ? centerW : imgCenterW * widthT / sliceT, tileSizeR = repeatV === STRETCH ? middleH : imgMiddleH * widthR / sliceR, tileSizeB = repeatH === STRETCH ? centerW : imgCenterW * widthB / sliceB, tileSizeL = repeatV === STRETCH ? middleH : imgMiddleH * widthL / sliceL, svg, patterns = [], rects = [], i = 0; // For 'round', subtract from each tile's size enough so that they fill the space a whole number of times if (repeatH === ROUND) { tileSizeT -= (tileSizeT - (centerW % tileSizeT || tileSizeT)) / ceil(centerW / tileSizeT); tileSizeB -= (tileSizeB - (centerW % tileSizeB || tileSizeB)) / ceil(centerW / tileSizeB); } if (repeatV === ROUND) { tileSizeR -= (tileSizeR - (middleH % tileSizeR || tileSizeR)) / ceil(middleH / tileSizeR); tileSizeL -= (tileSizeL - (middleH % tileSizeL || tileSizeL)) / ceil(middleH / tileSizeL); } // Build the SVG for the border-image rendering. Add each piece as a pattern, which is then stretched // or repeated as the fill of a rect of appropriate size. svg = [ '<svg width="' + elW + '" height="' + elH + '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' ]; function addImage( x, y, w, h, cropX, cropY, cropW, cropH, tileW, tileH ) { patterns.push( '<pattern patternUnits="userSpaceOnUse" id="pattern' + i + '" ' + 'x="' + (repeatH === REPEAT ? x + w / 2 - tileW / 2 : x) + '" ' + 'y="' + (repeatV === REPEAT ? y + h / 2 - tileH / 2 : y) + '" ' + 'width="' + tileW + '" height="' + tileH + '">' + '<svg width="' + tileW + '" height="' + tileH + '" viewBox="' + cropX + ' ' + cropY + ' ' + cropW + ' ' + cropH + '" preserveAspectRatio="none">' + '<image xlink:href="' + imgSrc + '" x="0" y="0" width="' + imgW + '" height="' + imgH + '" />' + '</svg>' + '</pattern>' ); rects.push( '<rect x="' + x + '" y="' + y + '" width="' + w + '" height="' + h + '" fill="url(#pattern' + i + ')" />' ); i++; } addImage( 0, 0, widthL, widthT, 0, 0, sliceL, sliceT, widthL, widthT ); // top left addImage( widthL, 0, centerW, widthT, sliceL, 0, imgCenterW, sliceT, tileSizeT, widthT ); // top center addImage( elW - widthR, 0, widthR, widthT, imgW - sliceR, 0, sliceR, sliceT, widthR, widthT ); // top right addImage( 0, widthT, widthL, middleH, 0, sliceT, sliceL, imgMiddleH, widthL, tileSizeL ); // middle left if ( props.fill ) { // center fill addImage( widthL, widthT, centerW, middleH, sliceL, sliceT, imgCenterW, imgMiddleH, tileSizeT || tileSizeB || imgCenterW, tileSizeL || tileSizeR || imgMiddleH ); } addImage( elW - widthR, widthT, widthR, middleH, imgW - sliceR, sliceT, sliceR, imgMiddleH, widthR, tileSizeR ); // middle right addImage( 0, elH - widthB, widthL, widthB, 0, imgH - sliceB, sliceL, sliceB, widthL, widthB ); // bottom left addImage( widthL, elH - widthB, centerW, widthB, sliceL, imgH - sliceB, imgCenterW, sliceB, tileSizeB, widthB ); // bottom center addImage( elW - widthR, elH - widthB, widthR, widthB, imgW - sliceR, imgH - sliceB, sliceR, sliceB, widthR, widthB ); // bottom right svg.push( '<defs>' + patterns.join('\n') + '</defs>' + rects.join('\n') + '</svg>' ); me.parent.setBackgroundLayer( me.bgLayerZIndex, 'url(data:image/svg+xml,' + escape( svg.join( '' ) ) + ') no-repeat border-box border-box' ); // If the border-image's src wasn't immediately available, the SVG for its background layer // will have been created asynchronously after the main element's update has finished; we'll // therefore need to force the root renderer to sync to the final background once finished. if( isAsync ) { me.parent.finishUpdate(); } }, me ); isAsync = 1; }, /** * Convert a given image to a data URI */ imageToDataURI: (function() { var uris = {}; return function( src, width, height ) { var uri = uris[ src ], image, canvas; if ( !uri ) { image = new Image(); canvas = doc.createElement( 'canvas' ); image.src = src; canvas.width = width; canvas.height = height; canvas.getContext( '2d' ).drawImage( image, 0, 0 ); uri = uris[ src ] = canvas.toDataURL(); } return uri; } })(), prepareUpdate: PIE.BorderImageRenderer.prototype.prepareUpdate, destroy: function() { var me = this, rs = me.targetElement.runtimeStyle; me.parent.setBackgroundLayer( me.bgLayerZIndex ); rs.borderColor = rs.borderStyle = rs.borderWidth = ''; } } ); PIE.Element = (function() { var wrappers = {}, lazyInitCssProp = PIE.CSS_PREFIX + 'lazy-init', pollCssProp = PIE.CSS_PREFIX + 'poll', trackActiveCssProp = PIE.CSS_PREFIX + 'track-active', trackHoverCssProp = PIE.CSS_PREFIX + 'track-hover', hoverClass = PIE.CLASS_PREFIX + 'hover', activeClass = PIE.CLASS_PREFIX + 'active', focusClass = PIE.CLASS_PREFIX + 'focus', firstChildClass = PIE.CLASS_PREFIX + 'first-child', ignorePropertyNames = { 'background':1, 'bgColor':1, 'display': 1 }, classNameRegExes = {}, dummyArray = []; function addClass( el, className ) { el.className += ' ' + className; } function removeClass( el, className ) { var re = classNameRegExes[ className ] || ( classNameRegExes[ className ] = new RegExp( '\\b' + className + '\\b', 'g' ) ); el.className = el.className.replace( re, '' ); } function delayAddClass( el, className /*, className2*/ ) { var classes = dummyArray.slice.call( arguments, 1 ), i = classes.length; setTimeout( function() { if( el ) { while( i-- ) { addClass( el, classes[ i ] ); } } }, 0 ); } function delayRemoveClass( el, className /*, className2*/ ) { var classes = dummyArray.slice.call( arguments, 1 ), i = classes.length; setTimeout( function() { if( el ) { while( i-- ) { removeClass( el, classes[ i ] ); } } }, 0 ); } function Element( el ) { var renderers, rootRenderer, boundsInfo = new PIE.BoundsInfo( el ), styleInfos, styleInfosArr, initializing, initialized, eventsAttached, eventListeners = [], delayed, destroyed, poll; /** * Initialize PIE for this element. */ function init() { if( !initialized ) { var docEl, bounds, ieDocMode = PIE.ieDocMode, cs = el.currentStyle, lazy = cs.getAttribute( lazyInitCssProp ) === 'true', trackActive = cs.getAttribute( trackActiveCssProp ) !== 'false', trackHover = cs.getAttribute( trackHoverCssProp ) !== 'false', childRenderers; // Polling for size/position changes: default to on in IE8, off otherwise, overridable by -pie-poll poll = cs.getAttribute( pollCssProp ); poll = ieDocMode > 7 ? poll !== 'false' : poll === 'true'; // Force layout so move/resize events will fire. Set this as soon as possible to avoid layout changes // after load, but make sure it only gets called the first time through to avoid recursive calls to init(). if( !initializing ) { initializing = 1; el.runtimeStyle.zoom = 1; initFirstChildPseudoClass(); } boundsInfo.lock(); // If the -pie-lazy-init:true flag is set, check if the element is outside the viewport and if so, delay initialization if( lazy && ( bounds = boundsInfo.getBounds() ) && ( docEl = doc.documentElement || doc.body ) && ( bounds.y > docEl.clientHeight || bounds.x > docEl.clientWidth || bounds.y + bounds.h < 0 || bounds.x + bounds.w < 0 ) ) { if( !delayed ) { delayed = 1; PIE.OnScroll.observe( init ); } } else { initialized = 1; delayed = initializing = 0; PIE.OnScroll.unobserve( init ); // Create the style infos and renderers if ( ieDocMode === 9 ) { styleInfos = { backgroundInfo: new PIE.BackgroundStyleInfo( el ), borderImageInfo: new PIE.BorderImageStyleInfo( el ), borderInfo: new PIE.BorderStyleInfo( el ) }; styleInfosArr = [ styleInfos.backgroundInfo, styleInfos.borderImageInfo ]; rootRenderer = new PIE.IE9RootRenderer( el, boundsInfo, styleInfos ); childRenderers = [ new PIE.IE9BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.IE9BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer ) ]; } else { styleInfos = { backgroundInfo: new PIE.BackgroundStyleInfo( el ), borderInfo: new PIE.BorderStyleInfo( el ), borderImageInfo: new PIE.BorderImageStyleInfo( el ), borderRadiusInfo: new PIE.BorderRadiusStyleInfo( el ), boxShadowInfo: new PIE.BoxShadowStyleInfo( el ), visibilityInfo: new PIE.VisibilityStyleInfo( el ) }; styleInfosArr = [ styleInfos.backgroundInfo, styleInfos.borderInfo, styleInfos.borderImageInfo, styleInfos.borderRadiusInfo, styleInfos.boxShadowInfo, styleInfos.visibilityInfo ]; rootRenderer = new PIE.RootRenderer( el, boundsInfo, styleInfos ); childRenderers = [ new PIE.BoxShadowOutsetRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ), //new PIE.BoxShadowInsetRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.BorderRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer ) ]; if( el.tagName === 'IMG' ) { childRenderers.push( new PIE.ImgRenderer( el, boundsInfo, styleInfos, rootRenderer ) ); } rootRenderer.childRenderers = childRenderers; // circular reference, can't pass in constructor; TODO is there a cleaner way? } renderers = [ rootRenderer ].concat( childRenderers ); // Add property change listeners to ancestors if requested initAncestorEventListeners(); // Add to list of polled elements in IE8 if( poll ) { PIE.Heartbeat.observe( update ); PIE.Heartbeat.run(); } // Trigger rendering update( 1 ); } if( !eventsAttached ) { eventsAttached = 1; if( ieDocMode < 9 ) { addListener( el, 'onmove', handleMoveOrResize ); } addListener( el, 'onresize', handleMoveOrResize ); addListener( el, 'onpropertychange', propChanged ); if( trackHover ) { addListener( el, 'onmouseenter', mouseEntered ); } if( trackHover || trackActive ) { addListener( el, 'onmouseleave', mouseLeft ); } if( trackActive ) { addListener( el, 'onmousedown', mousePressed ); } if( el.tagName in PIE.focusableElements ) { addListener( el, 'onfocus', focused ); addListener( el, 'onblur', blurred ); } PIE.OnResize.observe( handleMoveOrResize ); PIE.OnUnload.observe( removeEventListeners ); } boundsInfo.unlock(); } } /** * Event handler for onmove and onresize events. Invokes update() only if the element's * bounds have previously been calculated, to prevent multiple runs during page load when * the element has no initial CSS3 properties. */ function handleMoveOrResize() { if( boundsInfo && boundsInfo.hasBeenQueried() ) { update(); } } /** * Update position and/or size as necessary. Both move and resize events call * this rather than the updatePos/Size functions because sometimes, particularly * during page load, one will fire but the other won't. */ function update( force ) { if( !destroyed ) { if( initialized ) { var i, len = renderers.length; lockAll(); for( i = 0; i < len; i++ ) { renderers[i].prepareUpdate(); } if( force || boundsInfo.positionChanged() ) { /* TODO just using getBoundingClientRect (used internally by BoundsInfo) for detecting position changes may not always be accurate; it's possible that an element will actually move relative to its positioning parent, but its position relative to the viewport will stay the same. Need to come up with a better way to track movement. The most accurate would be the same logic used in RootRenderer.updatePos() but that is a more expensive operation since it does some DOM walking, and we want this check to be as fast as possible. */ for( i = 0; i < len; i++ ) { renderers[i].updatePos(); } } if( force || boundsInfo.sizeChanged() ) { for( i = 0; i < len; i++ ) { renderers[i].updateSize(); } } rootRenderer.finishUpdate(); unlockAll(); } else if( !initializing ) { init(); } } } /** * Handle property changes to trigger update when appropriate. */ function propChanged() { var i, len = renderers.length, renderer, e = event; // Some elements like <table> fire onpropertychange events for old-school background properties // ('background', 'bgColor') when runtimeStyle background properties are changed, which // results in an infinite loop; therefore we filter out those property names. Also, 'display' // is ignored because size calculations don't work correctly immediately when its onpropertychange // event fires, and because it will trigger an onresize event anyway. if( !destroyed && !( e && e.propertyName in ignorePropertyNames ) ) { if( initialized ) { lockAll(); for( i = 0; i < len; i++ ) { renderers[i].prepareUpdate(); } for( i = 0; i < len; i++ ) { renderer = renderers[i]; // Make sure position is synced if the element hasn't already been rendered. // TODO this feels sloppy - look into merging propChanged and update functions if( !renderer.isPositioned ) { renderer.updatePos(); } if( renderer.needsUpdate() ) { renderer.updateProps(); } } rootRenderer.finishUpdate(); unlockAll(); } else if( !initializing ) { init(); } } } /** * Handle mouseenter events. Adds a custom class to the element to allow IE6 to add * hover styles to non-link elements, and to trigger a propertychange update. */ function mouseEntered() { //must delay this because the mouseenter event fires before the :hover styles are added. delayAddClass( el, hoverClass ); } /** * Handle mouseleave events */ function mouseLeft() { //must delay this because the mouseleave event fires before the :hover styles are removed. delayRemoveClass( el, hoverClass, activeClass ); } /** * Handle mousedown events. Adds a custom class to the element to allow IE6 to add * active styles to non-link elements, and to trigger a propertychange update. */ function mousePressed() { //must delay this because the mousedown event fires before the :active styles are added. delayAddClass( el, activeClass ); // listen for mouseups on the document; can't just be on the element because the user might // have dragged out of the element while the mouse button was held down PIE.OnMouseup.observe( mouseReleased ); } /** * Handle mouseup events */ function mouseReleased() { //must delay this because the mouseup event fires before the :active styles are removed. delayRemoveClass( el, activeClass ); PIE.OnMouseup.unobserve( mouseReleased ); } /** * Handle focus events. Adds a custom class to the element to trigger a propertychange update. */ function focused() { //must delay this because the focus event fires before the :focus styles are added. delayAddClass( el, focusClass ); } /** * Handle blur events */ function blurred() { //must delay this because the blur event fires before the :focus styles are removed. delayRemoveClass( el, focusClass ); } /** * Handle property changes on ancestors of the element; see initAncestorEventListeners() * which adds these listeners as requested with the -pie-watch-ancestors CSS property. */ function ancestorPropChanged() { var name = event.propertyName; if( name === 'className' || name === 'id' ) { propChanged(); } } function lockAll() { boundsInfo.lock(); for( var i = styleInfosArr.length; i--; ) { styleInfosArr[i].lock(); } } function unlockAll() { for( var i = styleInfosArr.length; i--; ) { styleInfosArr[i].unlock(); } boundsInfo.unlock(); } function addListener( targetEl, type, handler ) { targetEl.attachEvent( type, handler ); eventListeners.push( [ targetEl, type, handler ] ); } /** * Remove all event listeners from the element and any monitored ancestors. */ function removeEventListeners() { if (eventsAttached) { var i = eventListeners.length, listener; while( i-- ) { listener = eventListeners[ i ]; listener[ 0 ].detachEvent( listener[ 1 ], listener[ 2 ] ); } PIE.OnUnload.unobserve( removeEventListeners ); eventsAttached = 0; eventListeners = []; } } /** * Clean everything up when the behavior is removed from the element, or the element * is manually destroyed. */ function destroy() { if( !destroyed ) { var i, len; removeEventListeners(); destroyed = 1; // destroy any active renderers if( renderers ) { for( i = 0, len = renderers.length; i < len; i++ ) { renderers[i].finalized = 1; renderers[i].destroy(); } } // Remove from list of polled elements in IE8 if( poll ) { PIE.Heartbeat.unobserve( update ); } // Stop onresize listening PIE.OnResize.unobserve( update ); // Kill references renderers = boundsInfo = styleInfos = styleInfosArr = el = null; } } /** * If requested via the custom -pie-watch-ancestors CSS property, add onpropertychange and * other event listeners to ancestor(s) of the element so we can pick up style changes * based on CSS rules using descendant selectors. */ function initAncestorEventListeners() { var watch = el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'watch-ancestors' ), i, a; if( watch ) { watch = parseInt( watch, 10 ); i = 0; a = el.parentNode; while( a && ( watch === 'NaN' || i++ < watch ) ) { addListener( a, 'onpropertychange', ancestorPropChanged ); addListener( a, 'onmouseenter', mouseEntered ); addListener( a, 'onmouseleave', mouseLeft ); addListener( a, 'onmousedown', mousePressed ); if( a.tagName in PIE.focusableElements ) { addListener( a, 'onfocus', focused ); addListener( a, 'onblur', blurred ); } a = a.parentNode; } } } /** * If the target element is a first child, add a pie_first-child class to it. This allows using * the added class as a workaround for the fact that PIE's rendering element breaks the :first-child * pseudo-class selector. */ function initFirstChildPseudoClass() { var tmpEl = el, isFirst = 1; while( tmpEl = tmpEl.previousSibling ) { if( tmpEl.nodeType === 1 ) { isFirst = 0; break; } } if( isFirst ) { addClass( el, firstChildClass ); } } // These methods are all already bound to this instance so there's no need to wrap them // in a closure to maintain the 'this' scope object when calling them. this.init = init; this.update = update; this.destroy = destroy; this.el = el; } Element.getInstance = function( el ) { var id = PIE.Util.getUID( el ); return wrappers[ id ] || ( wrappers[ id ] = new Element( el ) ); }; Element.destroy = function( el ) { var id = PIE.Util.getUID( el ), wrapper = wrappers[ id ]; if( wrapper ) { wrapper.destroy(); delete wrappers[ id ]; } }; Element.destroyAll = function() { var els = [], wrapper; if( wrappers ) { for( var w in wrappers ) { if( wrappers.hasOwnProperty( w ) ) { wrapper = wrappers[ w ]; els.push( wrapper.el ); wrapper.destroy(); } } wrappers = {}; } return els; }; return Element; })(); /* * This file exposes the public API for invoking PIE. */ /** * @property supportsVML * True if the current IE browser environment has a functioning VML engine. Should be true * in most IEs, but in rare cases may be false. If false, PIE will exit immediately when * attached to an element; this property may be used for debugging or by external scripts * to perform some special action when VML support is absent. * @type {boolean} */ PIE[ 'supportsVML' ] = PIE.supportsVML; /** * Programatically attach PIE to a single element. * @param {Element} el */ PIE[ 'attach' ] = function( el ) { if (PIE.ieDocMode < 10 && PIE.supportsVML) { PIE.Element.getInstance( el ).init(); } }; /** * Programatically detach PIE from a single element. * @param {Element} el */ PIE[ 'detach' ] = function( el ) { PIE.Element.destroy( el ); }; } // if( !PIE ) })();
0x6a
trunk/libraries/css/pie-1.0/PIE_uncompressed.js
JavaScript
asf20
169,815
/* Project : 48c6c450f1a4a0cc53d9585dc0fee742 Created on : Mar 16, 2013, 11:29:15 PM Author : Truong Khuong - khuongxuantruong@gmail.com Description : Purpose of the stylesheet follows. */ body{background: url('../images/bg/body.png');} html, body, div, h1, h2, h3, h4, h5, h6, p, img, dl, dt, dd, ol, ul, li, table, form, object, embed, article, aside, canvas, command, details, fieldset, figcaption, figure, footer, group, header, hgroup, legend, mark, menu, meter, nav, output, progress, section, summary, time, audio, video { margin: 0;padding: 0;border: 0; } .input,input{padding: 0;margin: 0;border: 1px solid #ccc;outline: none;font-family:inherit;font-size:inherit;} .input,input[type='text'],input[type='password'],input[type='number'],input[type='search']{ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px; font-family: inherit; font-size: 11px; /*padding: 2px 4px 2px 4px;*/ } form input{ height: 24px; /*padding: 1px 4px 2px 4px;*/ } textarea.input{padding: 3px 8px 2px 8px;resize: vertical} .erb,.input[wd='error'],input[wd='error'],[wd='error']{border-color: #dd4b39} .erc{color: #dd4b39} .ersd{ -webkit-box-shadow: 0 0px 4px rgba(221,75,57,0.9); -moz-box-shadow: 0 0px 4px rgba(221,75,57,0.3); box-shadow: 0 0px 4px rgba(221,75,57,0.9); } input:hover,input:focus{} .wi{width: 100%;} input[type=checkbox], input[type=radio] { -webkit-appearance: none; /* -moz-appearance: none;*/ appearance: none; width: 14px; height: 14px; margin: 0; cursor: pointer; vertical-align: bottom; background: #fff; /* border: 1px solid #dcdcdc;*/ -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; } input[type=checkbox]:active, input[type=radio]:active { border-color: #c6c6c6; background: #ebebeb; } input[type=checkbox]:hover { /* border-color: #c6c6c6;*/ -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); } input[type=radio] { -webkit-border-radius: 1em; -moz-border-radius: 1em; border-radius: 1em; width: 15px; height: 15px; } input[type=checkbox]:checked, input[type=radio]:checked { background: #fff; } input[type=radio]:checked::after { content: ''; display: block; position: relative; top: 3px; left: 3px; width: 7px; height: 7px; background: #666; -webkit-border-radius: 1em; -moz-border-radius: 1em; border-radius: 1em; } input[type=checkbox]:focus { outline: none; border-color:#4d90fe; } input[type=checkbox]:checked::after { content: url('http://ssl.gstatic.com/ui/v1/menu/checkmark.png'); display: block; position: absolute; top: -5px; left: -5px; } .b-t-c{ -webkit-box-shadow: none; box-shadow: none; background-color: #f5f5f5; background-image: -webkit-linear-gradient(top,#f5f5f5,#f1f1f1); background-image: linear-gradient(top,#f5f5f5,#f1f1f1); color: #444; border: 1px solid #d3d3d3; /* border: 1px solid rgba(0,0,0,0.1);*/ -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; cursor: default; font-size: 11px; text-align: center; white-space: nowrap; height: 24px; line-height: 24px; min-width: 52px; outline: 0; padding: 0 12px; display: inline-block; position: relative; cursor: pointer; } button.b-t-c,input.b-t-c{padding: 0 16px;height: 26px;line-height: 24px;} .b-t-c:hover{ border: 1px solid #A8D4FF; -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.1); -moz-box-shadow: 0 1px 1px rgba(0,0,0,.1); box-shadow: 0 1px 1px rgba(0,0,0,.1); } .b-t-c:active{ top:1px; } .g-d-w{ background: #e8e8e8; background: -moz-linear-gradient(top,white 0%,#EFEFEF 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,white),color-stop(100%,#EFEFEF)); background: -webkit-linear-gradient(top,white 0%,#EFEFEF 100%); background: -o-linear-gradient(top,white 0%,#EFEFEF 100%); background: -ms-linear-gradient(top,white 0%,#EFEFEF 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff',endColorstr='#efefef',GradientType=0 ); background: linear-gradient(to bottom,white 0%,#EFEFEF 100%); } .g-d-w-u{ background: #e8e8e8; background: -moz-linear-gradient(top,#EFEFEF 0%,#ffffff 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#EFEFEF),color-stop(100%,#ffffff)); background: -webkit-linear-gradient(top,#EFEFEF 0%,#ffffff 100%); background: -o-linear-gradient(top,#EFEFEF 0%,#ffffff 100%); background: -ms-linear-gradient(top,#EFEFEF 0%,#ffffff 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#EFEFEF',endColorstr='#ffffff',GradientType=0 ); background: linear-gradient(to bottom,#EFEFEF 0%,#ffffff 100%); } .g-d-g{ background: #e8e8e8; background: -moz-linear-gradient(top,#f1f1f1 0%,#ccc 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#f1f1f1),color-stop(100%,#ccc)); background: -webkit-linear-gradient(top,#f1f1f1 0%,#ccc 100%); background: -o-linear-gradient(top,#f1f1f1 0%,#ccc 100%); background: -ms-linear-gradient(top,#f1f1f1 0%,#ccc 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f1f1',endColorstr='#ccc',GradientType=0 ); background: linear-gradient(to bottom,#f1f1f1 0%,#ccc 100%); } .g-d-{ background-color: #E8E8E8; background-image: -webkit-gradient(linear,0 0,0 100%,from(#FAFAFA),to(#DADADA)); background-image: -moz-linear-gradient(top,#FAFAFA,#DADADA); background-image: -o-linear-gradient(top,#FAFAFA,#DADADA); background: -webkit-linear-gradient(top,#FAFAFA 0%,#DADADA 100%); background: -ms-linear-gradient(top,#FAFAFA 0%,#DADADA 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FAFAFA',endColorstr='#DADADA',GradientType=0 ); background: linear-gradient(to bottom,#FAFAFA 0%,#DADADA 100%); } .g-d-i{ background: url('../images/bg/wbg.gif') repeat-x; } .crile-42{ width: 42px;height: 42px; background: no-repeat url('../images/gol/social.png') -56px -152px; } .crile-42:hover>div{ opacity: 1; } .yfm,.lev,.jtl,.e3c,.sol,.lnk,.lik,.sdn{ background: no-repeat url('../images/gol/social2.png') 0 0; height: 24px; margin: 9px auto; width: 24px; opacity: .6; /* filter: alpha(opacity = 60);*/ } .lev{background-position: 0 0;} .lik{background-position: -9px -50px} .e3c{background-position: -9px -96px} .lnk{background-position: -9px -121px} .yfm{background-position: -9px -146px;} .sol{background-position: -9px -171px} .jtl{background-position: -9px -350px} .sdn{background-position: 0px -372px} .a:hover,a:hover{text-decoration: underline;cursor: pointer;color: #35adce} .a.t-d-n:hover,a.t-d-n:hover{text-decoration: none;cursor: pointer;color: #35adce} select{ /* line-height: 20px;*/ padding: 2px 2px 2px 4px; height: 24px; border: 1px solid #ccc; font-size: inherit;font-family: inherit; outline: none; } select:hover{ border: 1px solid #A8D4FF; -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); } select:focus{ border: 1px solid #4d90fe; } tt { font-family: inherit; padding: 0px 2px 1px 2px; background: #A8D4FF; border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; } input.fill-input{ padding-left:4px;padding-right:4px; height:auto; position:absolute; border-width:0;top:0px;left:0px;bottom:0px;right:0px; } input.fill-input:hover{ border-width:1px;top:-1px;left:-1px;bottom:-1px;right:-1px; } input.fill-input:focus{ border-width:1px;top:-1px;left:-1px;bottom:-1px;right:-1px; } td input.fill-input{ } td input.fill-input:focus,td:hover input.fill-input{ display:block; } .a--1{ position:absolute;top:-1px;left:-1px;bottom:-1px;right:-1px; } .add {background: url('../images/16/add_1.png') no-repeat center left;} .delete {background: url('../images/16/delete.png') no-repeat center left;} .edit {background: url('../images/16/icon_edit.png') no-repeat center left;} .setting {background: url('../images/16/option.gif') no-repeat center left;} .search {background: url('../images/16/toolbar_find.png') no-repeat center left;} .detail {background: url('../images/16/text_list_bullets.png') no-repeat center left;} .refresh {background: url('../images/16/view_refresh.png') no-repeat center left;} .help {background: url('../images/16/gnome_help_faq.png') no-repeat center left;} .show {background: url('../images/16/stock_show_controls.png') no-repeat center left;} .show.hide {background: url('../images/16/stock_hidden_controls.png') no-repeat center left;} .restore {background: url('../images/16/restore.png') no-repeat center left;} .private{background: url('../images/16/lock_red.png') no-repeat center left;} .public{background: url('../images/16/unlock_green.png') no-repeat center left;} .back{background: url('../images/16/sprite_black.png') no-repeat center left;} .save{background: url('../images/16/save.png') no-repeat center left;} .btnseparator { float: left; height: 22px; border-left: 1px solid #ebebeb; border-right: 1px solid white; margin: 1px; } .events{ padding: 1px;float: left; display: block; cursor: pointer; } .events.f-r{float: right} .events:hover{ padding: 0px; border: 1px solid #ebebeb; } .events div{ float: left; padding: 1px 3px; } .events:hover div{ padding: 0px 3px 1px 2px; border-left: 1px solid white; border-top: 1px solid white; } .events span{ float: left; display: block; padding: 3px; padding-left: 20px; font-family: tahoma;font-size: 11px } .events:hover span{ } table tr .s-w-h{display: none;} table tr:hover .s-w-h{display: block;opacity: .6;} table tr:hover .s-w-h:hover{opacity: 1;} .more{background: url('../images/16/arrow_2_dots.png')} /*.ui-tabs .ui-tabs-nav .ui-tabs-active.ui-state-active{background: url('../images/bg/body.png')} .ui-tabs .ui-tabs-panel.ui-widget-content,.ui-tabs.ui-widget-content{background: none;}*/ #backend_menu{border-bottom: 1px solid #dd4b39;height: 32px;display: block;z-index: 1002;position: relative;} #backend_menu ul{list-style: none;display: block;float: left;padding-left: 32px;margin: 0;} #backend_menu ul li,#backend_menu ul:hover li.active{list-style: none;float: left;padding: 0 12px;margin: 0;border-bottom: none;border-bottom: 4px solid transparent;position: relative;transition: all .5s ease-in-out; -moz-transition: all .5s ease-in-out; -webkit-transition: all .5s ease-in-out;} #backend_menu ul li:hover,#backend_menu ul li.active,#backend_menu ul:hover li.active:hover{border-bottom: 4px solid #dd4b39} #backend_menu ul li a,#backend_menu ul li span{display: block;line-height: 30px;text-decoration: none;height: 28px;} #backend_menu ul li:hover a,#backend_menu ul li:hover span{color: #dd4b39} #backend_menu ul li.active a,#backend_menu ul li.active span{font-weight: bold;color: #dd4b39} #backend_menu ul li ul{margin: 0;padding: 0;position: absolute;top: 32px;left: -1px;min-width: 160px;z-index: 100;display: none;padding-top: 1px;} #backend_menu ul li:hover ul{display: block} #backend_menu ul li ul li,#backend_menu ul:hover li.active ul li{float: none;display: block;border-bottom: none;height: 26px;background: url('../images/menu/sectab_bg_right.png') no-repeat right top;padding: 0;transition: all .5s ease-in-out; -moz-transition: all .5s ease-in-out; -webkit-transition: all .5s ease-in-out;} #backend_menu ul li ul li:hover,#backend_menu ul li ul li:hover,#backend_menu ul:hover li ul li.active:hover,#backend_menu ul:hover li:hover ul li:hover{border-bottom: none;height: 26px;background:url('../images/menu/sectab_bg_right_sel.png') no-repeat right top;} #backend_menu ul:hover li ul li a,#backend_menu ul li.active ul li a,#backend_menu ul li ul li a{font-weight: normal;color: #666;line-height: 24px;background: url('../images/menu/sectab_bg_left.png') no-repeat left top;margin-left: -6px;padding-left: 31px;padding-right: 31px} #backend_menu ul:hover li ul li:hover a,#backend_menu ul li.active ul li:hover a,#backend_menu ul li ul li:hover a{color:#dd4b39} #backend_menu ul li ul li.last,#backend_menu ul:hover li ul li.last,#backend_menu ul:hover li ul li.last:hover,#backend_menu ul li ul li.last:hover{background: url('../images/menu/sectab_bg_right_last.png') no-repeat right top;} #backend_menu ul li ul li.last span{background: url('../images/menu/sectab_bg_left_last.png') no-repeat left top;height: 11px;} #backend_menu ul.f-r{float: right; padding-right: 20px} #backend_menu ul.f-r li ul{left: auto; right: -10px} #integration_asynchronous{position:absolute;width: 0;height: 0;border: none;padding: 0;margin: 0;} #backendload{background: url('../images/loading.gif') no-repeat center bottom;width: 60px;height: 22px;position: fixed;top: 20px;left: 50%;margin-left: -22px;text-align: center;border: 1px solid #dd4b39;background-color: #fff;z-index: 999;display: none;z-index: 10001} /*#backendload{background: url('../images/ajaxload/loading.gif') no-repeat center ;width: 112px;height: 24px;position: fixed;top: 20px;left: 50%;margin-left: -56px;text-align: center;border: 1px solid #dd4b39;background-color: #fff;z-index: 999;display: none}*/ #backend_menu #nav_menu{display: none} #backend_menu:hover #nav_menu{display: block}
0x6a
trunk/libraries/css/widgets.css
CSS
asf20
13,870
/* Document : icon Created on : May 25, 2013, 11:37:15 PM Author : Truong Description: Purpose of the stylesheet follows. */ .dotum{font-family: dotum} .tahoma{font-family: tahoma} .del-icon{background: url('../images/16/delete_black.png') no-repeat 0 0} .edit-icon{background: url('../images/16/edit_black.png') no-repeat 0 0} .del-icon:hover{background-image:url('../images/16/delete_white.png') } .edit-icon:hover{background-image:url('../images/16/edit_white.png')} .add-icon{background: url('../images/16/add.png') no-repeat 0 0} .setting-icon{background: url('../images/16/settings-3.png') no-repeat 0 0} .setting2-icon{background: url('../images/16/batch-master/settings.png') no-repeat 0 0} .user-icon{background: url('../images/16/batch-master/user4.png') no-repeat 0 0} .user-icon:hover{background: url('../images/16/batch-master/user_white.png') no-repeat 0 0} .menu-icon{background: url('../images/16/menu-2.png') no-repeat 0 0} .refresh-icon{background: url('../images/16/refresh_2.png') no-repeat 0 0} .tree-icon{background: url('../images/16/icon_sitemap.gif') no-repeat 0 0} .grid-icon{background: url('../images/16/batch-master/table.png') no-repeat 0 0} .save-icon{background: url('../images/16/7.png') no-repeat 0 0} .fileview-icon{background: url('../images/16/fileview_text.png') no-repeat 0 0} .expand-icon{background: url('../images/16/batch-master/expand.png') no-repeat 0 0} .fullscreen-icon{background: url('../images/16/fullscreen.png') no-repeat 0 0} .arrowexpand-icon{background: url('../images/16/arrow_expand.png') no-repeat 0 0} .b-ef,.h-b-ef:hover,.a-b-ef:active{background: #efefef} .b-0xff{background-color:#fff} .c-0xff{color:#fff} .h-c-0xff:hover{color:#fff} .d-0xdd{border-color:#ddd} .b-0x00{background-color:#fafafa;} .d-0x00{border-color:#ccc;border-width:1px;border-style:solid} .b-0x77,.h-b-0x77:hover,.a-b-0x77:active,.b-gray,.h-b-gray:hover{background-color:#777;} .b-0x01,.h-b-0x01:hover,.a-b-0x01:active,.b-blue,.h-b-blue:hover{background-color:#2672EC;} .b-0x02,.h-b-0x02:hover,.a-b-0x02:active,.b-skyblue,.h-b-skyblue:hover{background-color:#094AB2;} .b-0x03,.h-b-0x03:hover,.a-b-0x03:active,.b-orange,.h-b-orange:hover{background-color:#D24726;} .b-0x04,.h-b-0x04:hover,.a-b-0x04:active,.b-reda,.h-b-reda:hover{background-color:#AC193D;} .b-0x05,.h-b-0x05:hover,.a-b-0x05:active,.b-darkpurple,.h-b-darkpurple:hover{background-color:#5133AB;} .b-0x06,.h-b-0x06:hover,.a-b-0x06:active,.b-purple,.h-b-purple:hover{background-color:#8C0095;} .b-0x07,.h-b-0x07:hover,.a-b-0x07:active,.h-b-teal:hover,.b-teal{background-color:#008299;} .b-0x08,.h-b-0x08:hover,.a-b-0x08:active,.h-b-red:hover,.b-red{background-color:#B01E00;} .b-0x09,.h-b-0x09:hover,.a-b-0x09:active,.b-green,.h-b-green:hover{background-color:green;} .b-0x10,.h-b-0x10:hover,.a-b-0x10:active{background-color:#b81b6c;} .b-0x11,.h-b-0x11:hover,.a-b-0x11:active{background-color:#777;} .b-0x12,.h-b-0x12:hover,.a-b-0x12:active{background-color:orange;} .b-0x13,.h-b-0x13:hover,.a-b-0x13:active{background-color:red;} .b-0x14,.h-b-0x14:hover,.a-b-0x14:active{background-color:green;} .b-0x15,.h-b-0x15:hover,.a-b-0x15:active{background-color:blue;} .c-0x77,.h-c-0x77:hover,.a-c-0x77:active{color:#777;} .c-0x01,.h-c-0x01:hover,.a-c-0x01:active,.c-blue,.h-c-blue:hover{color:#2672EC;} .c-0x02,.h-c-0x02:hover,.a-c-0x02:active,.c-skyblue,.h-c-skyblue:hover{color:#094AB2;} .c-0x03,.h-c-0x03:hover,.a-c-0x03:active,.c-orange,.h-c-orange:hover{color:#D24726;} .c-0x04,.h-c-0x04:hover,.a-c-0x04:active,.c-reda,.h-c-reda:hover{color:#AC193D;} .c-0x05,.h-c-0x05:hover,.a-c-0x05:active,.c-darkpurple,.h-c-darkpurple:hover{color:#5133AB;} .c-0x06,.h-c-0x06:hover,.a-c-0x06:active,.c-purple,.h-c-purple:hover{color:#8C0095;} .c-0x07,.h-c-0x07:hover,.a-c-0x07:active,.h-c-teal:hover,.c-teal{color:#008299;} .c-0x08,.h-c-0x08:hover,.a-c-0x08:active,.h-c-red:hover,.c-red{color:#B01E00;} .c-0x09,.h-c-0x09:hover,.a-c-0x09:active,.c-green,.h-c-green:hover{color:green;} .c-0x10,.h-c-0x10:hover,.a-c-0x10:active{color:#b81b6c;} .c-0x11,.h-c-0x11:hover,.a-c-0x11:active{color:#777;} .c-0x12,.h-c-0x12:hover,.a-c-0x12:active{color:orange;} .c-0x13,.h-c-0x13:hover,.a-c-0x13:active{color:red;} .c-0x14,.h-c-0x14:hover,.a-c-0x14:active{color:green;} .c-0x15,.h-c-0x15:hover,.a-c-0x15:active{color:blue;} .d-0xdd,.h-d-0xdd:hover,.a-d-0xdd:active{border-color:#ddd;border-width:1px;border-style:solid} .d-0xcc,.h-d-0xcc:hover,.a-d-0xcc:active{border-color:#ccc;border-width:1px;border-style:solid} .d-0x77,.h-d-0x77:hover,.a-d-0x77:active{border-color:#777;border-width:1px;border-style:solid} .d-0x01,.h-d-0x01:hover,.a-d-0x01:active,.d-blue,.h-d-blue:hover{border-color:#2672EC;border-width:1px;border-style:solid} .d-0x02,.h-d-0x02:hover,.a-d-0x02:active,.d-skyblue,.h-d-skyblue:hover{border-color:#094AB2;border-width:1px;border-style:solid} .d-0x03,.h-d-0x03:hover,.a-d-0x03:active,.d-orange,.h-d-orange:hover{border-color:#D24726;border-width:1px;border-style:solid} .d-0x04,.h-d-0x04:hover,.a-d-0x04:active,.d-reda,.h-d-reda:hover{border-color:#AC193D;border-width:1px;border-style:solid} .d-0x05,.h-d-0x05:hover,.a-d-0x05:active,.d-darkpurple,.h-d-darkpurple:hover{border-color:#5133AB;border-width:1px;border-style:solid} .d-0x06,.h-d-0x06:hover,.a-d-0x06:active,.d-purple,.h-d-purple:hover{border-color:#8C0095;border-width:1px;border-style:solid} .d-0x07,.h-d-0x07:hover,.a-d-0x07:active,.h-d-teal:hover,.d-teal{border-color:#008299;border-width:1px;border-style:solid} .d-0x08,.h-d-0x08:hover,.a-d-0x08:active,.h-d-red:hover,.d-red{border-color:#B01E00;border-width:1px;border-style:solid} .d-0x09,.h-d-0x09:hover,.a-d-0x09:active,.d-green,.h-d-green:hover{border-color:green;border-width:1px;border-style:solid} .d-0x10,.h-d-0x10:hover,.a-d-0x10:active{border-color:#b81b6c;border-width:1px;border-style:solid} .d-0x11,.h-d-0x11:hover,.a-d-0x11:active{border-color:#777;border-width:1px;border-style:solid} .d-0x12,.h-d-0x12:hover,.a-d-0x12:active{border-color:orange;border-width:1px;border-style:solid} .d-0x13,.h-d-0x13:hover,.a-d-0x13:active{border-color:red;border-width:1px;border-style:solid} .d-0x14,.h-d-0x14:hover,.a-d-0x14:active{border-color:green;border-width:1px;border-style:solid} .d-0x15,.h-d-0x15:hover,.a-d-0x15:active{border-color:blue;border-width:1px;border-style:solid}
0x6a
trunk/libraries/css/icon.css
CSS
asf20
6,332
/* Project : 48c6c450f1a4a0cc53d9585dc0fee742 Created on : Mar 16, 2013, 11:29:15 PM Author : Truong Khuong - khuongxuantruong@gmail.com Description : Purpose of the stylesheet follows. */ .jfk-bubble .jfk-bubble-content{min-width: 240px} .jfk-bubble.jfk-bubble-promo {background-color: #F9EDBE;border: 1px solid #F0C36D;} .jfk-bubble-arrowup {top: -9px;} .jfk-bubble{-webkit-box-shadow:0 1px 8px rgba(0,0,0,.3);-moz-box-shadow:0 1px 8px rgba(0,0,0,.3);box-shadow:0 1px 8px rgba(0,0,0,.3);background-color:#fff;border:1px solid;border-color:#bbb #bbb #a8a8a8;padding:16px;position:absolute;-webkit-border-radius: 2px;-moz-border-radius: 2px;border-radius: 2px;} .jfk-bubble-closebtn{background:url("https://ssl.gstatic.com/ui/v1/icons/common/x_8px.png") no-repeat;height:21px;opacity:.4;outline:0;position:absolute;right:2px;top:2px;width:21px} .jfk-bubble-closebtn:focus,.jfk-bubble-closebtn:hover{opacity:1} .jfk-bubble .jfk-bubble-closebtn{display: none} .jfk-bubble:hover .jfk-bubble-closebtn{display: block} .jfk-bubble-arrow{position:absolute} .jfk-bubble-arrow .jfk-bubble-arrowimplbefore,.jfk-bubble-arrow .jfk-bubble-arrowimplafter{display:block;height:0;position:absolute;width:0} .jfk-bubble-arrow .jfk-bubble-arrowimplbefore{border:9px solid} .jfk-bubble-arrow .jfk-bubble-arrowimplafter{border:8px solid} .jfk-bubble-arrowdown{bottom:0} .jfk-bubble-arrowup{top:-9px} .jfk-bubble-arrowleft{left:-9px} .jfk-bubble-arrowright{right:0} .jfk-bubble-arrowdown .jfk-bubble-arrowimplbefore,.jfk-bubble-arrowup .jfk-bubble-arrowimplbefore{border-color:#bbb transparent;left:-9px} .jfk-bubble-arrowdown .jfk-bubble-arrowimplbefore{border-color:#a8a8a8 transparent} .jfk-bubble-arrowdown .jfk-bubble-arrowimplafter,.jfk-bubble-arrowup .jfk-bubble-arrowimplafter{border-color:#fff transparent;left:-8px} .jfk-bubble-arrowdown .jfk-bubble-arrowimplbefore{border-bottom-width:0} .jfk-bubble-arrowdown .jfk-bubble-arrowimplafter{border-bottom-width:0} .jfk-bubble-arrowup .jfk-bubble-arrowimplbefore{border-top-width:0} .jfk-bubble-arrowup .jfk-bubble-arrowimplafter{border-top-width:0;top:1px} .jfk-bubble-arrowleft .jfk-bubble-arrowimplbefore,.jfk-bubble-arrowright .jfk-bubble-arrowimplbefore{border-color:transparent #bbb;top:-9px} .jfk-bubble-arrowleft .jfk-bubble-arrowimplafter,.jfk-bubble-arrowright .jfk-bubble-arrowimplafter{border-color:transparent #fff;top:-8px} .jfk-bubble-arrowleft .jfk-bubble-arrowimplbefore{border-left-width:0} .jfk-bubble-arrowleft .jfk-bubble-arrowimplafter{border-left-width:0;left:1px} .jfk-bubble-arrowright .jfk-bubble-arrowimplbefore{border-right-width:0} .jfk-bubble-arrowright .jfk-bubble-arrowimplafter{border-right-width:0} .jfk-bubble.jfk-bubble-promo{background-color:#f9edbe;border:1px solid #f0c36d} .jfk-bubble-promo .jfk-bubble-arrowdown .jfk-bubble-arrowimplbefore,.jfk-bubble-promo .jfk-bubble-arrowup .jfk-bubble-arrowimplbefore{border-color:#f0c36d transparent} .jfk-bubble-promo .jfk-bubble-arrowdown .jfk-bubble-arrowimplafter,.jfk-bubble-promo .jfk-bubble-arrowup .jfk-bubble-arrowimplafter{border-color:#f9edbe transparent} .jfk-bubble-promo .jfk-bubble-arrowleft .jfk-bubble-arrowimplbefore,.jfk-bubble-promo .jfk-bubble-arrowright .jfk-bubble-arrowimplbefore{border-color:transparent #f0c36d} .jfk-bubble-promo .jfk-bubble-arrowleft .jfk-bubble-arrowimplafter,.jfk-bubble-promo .jfk-bubble-arrowright .jfk-bubble-arrowimplafter{border-color:transparent #f9edbe} .jfk-bubble.jfk-bubble-promo.gray {background-color: #Fafafa;border: 1px solid #ddd;} .jfk-bubble.jfk-bubble-promo.gray .jfk-bubble-arrowimplbefore{border-color:#ddd transparent} .jfk-bubble.jfk-bubble-promo.gray .jfk-bubble-arrowimplafter{border-color:#fafafa transparent} .jfk-bubble.jfk-bubble-promo.grayc {background-color: #FFF1A8;border: 1px solid #ccc;} .jfk-bubble.jfk-bubble-promo.grayc .jfk-bubble-arrowimplbefore{border-color:#ccc transparent} .jfk-bubble.jfk-bubble-promo.grayc .jfk-bubble-arrowimplafter{border-color:#FFF1A8 transparent} .jfk-bubble.jfk-bubble-promo.white {background-color: #fff;border: 1px solid #ddd;} .jfk-bubble.jfk-bubble-promo.white .jfk-bubble-arrowimplbefore{border-color:#ddd transparent} .jfk-bubble.jfk-bubble-promo.white .jfk-bubble-arrowimplafter{border-color:#fff transparent} .jfk-bubble.jfk-bubble-promo.blue {background-color: #A8EDFF;border: 1px solid #51DBFF;} .jfk-bubble.jfk-bubble-promo.blue .jfk-bubble-arrowimplbefore{border-color:#00CBFF transparent} .jfk-bubble.jfk-bubble-promo.blue .jfk-bubble-arrowimplafter{border-color:#A8EDFF transparent}
0x6a
trunk/libraries/css/bubble.css
CSS
asf20
4,566
/* Project : 48c6c450f1a4a0cc53d9585dc0fee742 Created on : Mar 16, 2013, 11:29:15 PM Author : Truong Khuong - khuongxuantruong@gmail.com Description : Purpose of the stylesheet follows. */ .input,input[type='text'],input[type='password']{padding-top: 4px;}
0x6a
trunk/libraries/css/ie8.css
CSS
asf20
292
/* Project : 48c6c450f1a4a0cc53d9585dc0fee742 Created on : Mar 16, 2013, 11:29:15 PM Author : Truong Khuong - khuongxuantruong@gmail.com Description : Purpose of the stylesheet follows. */ .input,input[type='text'],input[type='password'],input[type='number'],input[type='search']{ } .ui-multiselect-menu .ui-widget-header .ui-multiselect-filter input{height: 19px;line-height: 19px;padding: 0}
0x6a
trunk/libraries/css/ie7.css
CSS
asf20
429
/* Project : 48c6c450f1a4a0cc53d9585dc0fee742 Created on : Mar 16, 2013, 11:29:15 PM Author : Truong Khuong - khuongxuantruong@gmail.com Description : Purpose of the stylesheet follows. */
0x6a
trunk/libraries/css/ielt9.css
CSS
asf20
225
/* Project : 48c6c450f1a4a0cc53d9585dc0fee742 Created on : Mar 16, 2013, 11:29:15 PM Author : Truong Khuong - khuongxuantruong@gmail.com Description : Purpose of the stylesheet follows. */ .recaptcha-widget#recaptcha_widget { /* width: 310px;*/ background: #fff; border: 1px solid #e5e5e5; } .recaptcha-widget #recaptcha_image { width: auto !important; padding: 5px; height: 57px; text-align: center; border-bottom: 1px solid #e5e5e5; overflow: hidden; } .recaptcha-widget #recaptcha_image img{display: block;margin: 0 auto;width: 100%;} .recaptcha-widget #recaptcha_image a { line-height: 17px; } .recaptcha-widget .recaptcha-main { position: relative; padding: 13px;padding-bottom: 0; } .recaptcha-widget .recaptcha-main .errormsg { margin: 0 0 .5em; } .recaptcha-widget .recaptcha-main label strong { color: #222; display: block; margin: 0 0 .4em; } .recaptcha-widget .recaptcha-main label strong.erc { color: #dd4b39; } .recaptcha-widget .recaptcha-main input[type=text] { width: 200px; } .recaptcha-widget .recaptcha-buttons { position: absolute; bottom: 1px; right: 11px; } .recaptcha-widget .recaptcha-buttons a { display: inline-block; height: 21px; width: 21px; margin-left: 2px; background: #fff; background-position: center center; background-repeat: no-repeat; line-height: 0; opacity: .55; } .recaptcha-widget .recaptcha-buttons a:hover { opacity: .8; } .recaptcha-widget #recaptcha_reload_btn { background: url(https://ssl.gstatic.com/accounts/recaptcha-sprite.png) -63px; } .recaptcha-widget #recaptcha_switch_audio_btn { background: url(https://ssl.gstatic.com/accounts/recaptcha-sprite.png) -42px; } .recaptcha-widget #recaptcha_switch_img_btn { background: url(https://ssl.gstatic.com/accounts/recaptcha-sprite.png) -21px; } .recaptcha-widget #recaptcha_whatsthis_btn { background: url(https://ssl.gstatic.com/accounts/recaptcha-sprite.png); } .recaptcha-widget .recaptcha-buttons span { position: absolute; left: -99999em; } .recaptcha-widget.recaptcha_is_showing_audio .recaptcha_only_if_image, .recaptcha-widget.recaptcha_isnot_showing_audio .recaptcha_only_if_audio { display: none !important; }
0x6a
trunk/libraries/css/recaptcha.css
CSS
asf20
2,301
.jqx-grid-cell.jqx-grid-cell-classic div,.jqx-grid-cell.jqx-grid-cell-classic span{line-height:16px} .jqx-grid-cell.jqx-grid-cell-classic input.jqx-input{height: 24px !important;padding-left: 4px !important;}
0x6a
trunk/libraries/css/fix_widgets.css
CSS
asf20
209
<?php /* This file is a wrapper, for use in PHP environments, which serves PIE.htc using the correct content-type, so that IE will recognize it as a behavior. Simply specify the behavior property to fetch this .php file instead of the .htc directly: .myElement { [ ...css3 properties... ] behavior: url(PIE.php); } This is only necessary when the web server is not configured to serve .htc files with the text/x-component content-type, and cannot easily be configured to do so (as is the case with some shared hosting providers). */ header( 'Content-type: text/x-component' ); include( 'PIE.htc' ); ?>
0x6a
trunk/libraries/css/pie-2.0/PIE.php
PHP
asf20
613
/* PIE: CSS3 rendering for IE Version 2.0beta1 http://css3pie.com Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2. */ (function( win, doc ) { var PIE = win[ 'PIE' ] || ( win[ 'PIE' ] = {} ); /** * Simple utility for merging objects * @param {Object} obj1 The main object into which all others will be merged * @param {...Object} var_args Other objects which will be merged into the first, in order */ PIE.merge = function( obj1 ) { var i, len, p, objN, args = arguments; for( i = 1, len = args.length; i < len; i++ ) { objN = args[i]; for( p in objN ) { if( objN.hasOwnProperty( p ) ) { obj1[ p ] = objN[ p ]; } } } return obj1; }; PIE.merge(PIE, { // Constants CSS_PREFIX: '-pie-', STYLE_PREFIX: 'Pie', CLASS_PREFIX: 'pie_', tableCellTags: { 'TD': 1, 'TH': 1 }, /** * Lookup table of elements which cannot take custom children. */ childlessElements: { 'TABLE':1, 'THEAD':1, 'TBODY':1, 'TFOOT':1, 'TR':1, 'INPUT':1, 'TEXTAREA':1, 'SELECT':1, 'OPTION':1, 'IMG':1, 'HR':1 }, /** * Elements that can receive user focus */ focusableElements: { 'A':1, 'INPUT':1, 'TEXTAREA':1, 'SELECT':1, 'BUTTON':1 }, /** * Values of the type attribute for input elements displayed as buttons */ inputButtonTypes: { 'submit':1, 'button':1, 'reset':1 }, emptyFn: function() {} }); // Force the background cache to be used. No reason it shouldn't be. try { doc.execCommand( 'BackgroundImageCache', false, true ); } catch(e) {} (function() { /* * IE version detection approach by James Padolsey, with modifications -- from * http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/ */ var ieVersion = 4, div = doc.createElement('div'), all = div.getElementsByTagName('i'), shape; while ( div.innerHTML = '<!--[if gt IE ' + (++ieVersion) + ']><i></i><![endif]-->', all[0] ) {} PIE.ieVersion = ieVersion; // Detect IE6 if( ieVersion === 6 ) { // IE6 can't access properties with leading dash, but can without it. PIE.CSS_PREFIX = PIE.CSS_PREFIX.replace( /^-/, '' ); } PIE.ieDocMode = doc.documentMode || PIE.ieVersion; // Detect VML support (a small number of IE installs don't have a working VML engine) div.innerHTML = '<v:shape adj="1"/>'; shape = div.firstChild; shape.style['behavior'] = 'url(#default#VML)'; PIE.supportsVML = (typeof shape['adj'] === "object"); })(); /** * Utility functions */ (function() { var idNum = 0, imageSizes = {}; PIE.Util = { /** * Generate and return a unique ID for a given object. The generated ID is stored * as a property of the object for future reuse. For DOM Elements, don't use this * but use the IE-native uniqueID property instead. * @param {Object} obj */ getUID: function( obj ) { return obj && obj[ '_pieId' ] || ( obj[ '_pieId' ] = '_' + idNum++ ); }, /** * Execute a callback function, passing it the dimensions of a given image once * they are known. * @param {string} src The source URL of the image * @param {function({w:number, h:number})} func The callback function to be called once the image dimensions are known * @param {Object} ctx A context object which will be used as the 'this' value within the executed callback function */ withImageSize: function( src, func, ctx ) { var size = imageSizes[ src ], img, queue; if( size ) { // If we have a queue, add to it if( Object.prototype.toString.call( size ) === '[object Array]' ) { size.push( [ func, ctx ] ); } // Already have the size cached, call func right away else { func.call( ctx, size ); } } else { queue = imageSizes[ src ] = [ [ func, ctx ] ]; //create queue img = new Image(); img.onload = function() { size = imageSizes[ src ] = { w: img.width, h: img.height }; for( var i = 0, len = queue.length; i < len; i++ ) { queue[ i ][ 0 ].call( queue[ i ][ 1 ], size ); } img.onload = null; }; img.src = src; } } }; })();/** * Utility functions for handling gradients */ PIE.GradientUtil = { toSideAngles: { 'top': 0, 'right': 90, 'bottom': 180, 'left': 270 }, getGradientMetrics: function( el, width, height, gradientInfo ) { var angle = gradientInfo.angle, toPos = gradientInfo.gradientTo, dX, dY, endPoint, startX, startY, endX, endY; // If an angle was specified, just use it if (angle) { angle = angle.degrees(); } // If a to-position was specified, find the appropriate angle for it else if (toPos) { // To a corner; find the adjacent corners and use the angle perpendicular to them if (toPos[1]) { dX = ( toPos[0] == 'top' || toPos[1] == 'top' ) ? width : -width; dY = ( toPos[0] == 'left' || toPos[1] == 'left' ) ? -height : height; angle = Math.atan2(dY, dX) * 180 / Math.PI; } // To a side; map to a vertical/horizontal angle else { angle = this.toSideAngles[toPos[0]]; } } // Neither specified; default is top to bottom else { angle = 180; } // Normalize the angle to a value between [0, 360) while( angle < 0 ) { angle += 360; } angle = angle % 360; // Find the end point of the gradient line, extending the angle from the center point // to where it intersects the perpendicular line passing through the nearest corner. endPoint = PIE.GradientUtil.perpendicularIntersect(width / 2, height / 2, angle, ( angle >= 180 ? 0 : width ), ( angle < 90 || angle > 270 ? 0 : height ) ); endX = endPoint[0]; endY = endPoint[1]; startX = width - endX; startY = height - endY; return { angle: angle, endX: endX, endY: endY, startX: startX, startY: startY, lineLength: PIE.GradientUtil.distance( startX, startY, endX, endY ) }; }, /** * Find the point along a given line (defined by a starting point and an angle), at which * that line is intersected by a perpendicular line extending through another point. * @param x1 - x coord of the starting point * @param y1 - y coord of the starting point * @param angle - angle of the line extending from the starting point (in degrees) * @param x2 - x coord of point along the perpendicular line * @param y2 - y coord of point along the perpendicular line * @return [ x, y ] */ perpendicularIntersect: function( x1, y1, angle, x2, y2 ) { // Handle straight vertical and horizontal angles, for performance and to avoid // divide-by-zero errors. if( angle === 0 || angle === 180 ) { return [ x1, y2 ]; } else if( angle === 90 || angle === 270 ) { return [ x2, y1 ]; } else { // General approach: determine the Ax+By=C formula for each line (the slope of the second // line is the negative inverse of the first) and then solve for where both formulas have // the same x/y values. var a1 = Math.tan( ( angle - 90 ) * Math.PI / 180 ), c1 = a1 * x1 - y1, a2 = -1 / a1, c2 = a2 * x2 - y2, d = a2 - a1, endX = ( c2 - c1 ) / d, endY = ( a1 * c2 - a2 * c1 ) / d; return [ endX, endY ]; } }, /** * Find the distance between two points * @param {Number} p1x * @param {Number} p1y * @param {Number} p2x * @param {Number} p2y * @return {Number} the distance */ distance: function( p1x, p1y, p2x, p2y ) { var dx = p2x - p1x, dy = p2y - p1y; return Math.abs( dx === 0 ? dy : dy === 0 ? dx : Math.sqrt( dx * dx + dy * dy ) ); } };/** * */ PIE.Observable = function() { /** * List of registered observer functions */ this.observers = []; /** * Hash of function ids to their position in the observers list, for fast lookup */ this.indexes = {}; }; PIE.Observable.prototype = { observe: function( fn ) { var id = PIE.Util.getUID( fn ), indexes = this.indexes, observers = this.observers; if( !( id in indexes ) ) { indexes[ id ] = observers.length; observers.push( fn ); } }, unobserve: function( fn ) { var id = PIE.Util.getUID( fn ), indexes = this.indexes; if( id && id in indexes ) { delete this.observers[ indexes[ id ] ]; delete indexes[ id ]; } }, fire: function() { var o = this.observers, i = o.length; while( i-- ) { o[ i ] && o[ i ](); } } };/* * Simple heartbeat timer - this is a brute-force workaround for syncing issues caused by IE not * always firing the onmove and onresize events when elements are moved or resized. We check a few * times every second to make sure the elements have the correct position and size. See Element.js * which adds heartbeat listeners based on the custom -pie-poll flag, which defaults to true in IE8-9 * and false elsewhere. */ PIE.Heartbeat = new PIE.Observable(); PIE.Heartbeat.run = function() { var me = this, interval; if( !me.running ) { interval = doc.documentElement.currentStyle.getAttribute( PIE.CSS_PREFIX + 'poll-interval' ) || 250; (function beat() { me.fire(); setTimeout(beat, interval); })(); me.running = 1; } }; /** * Create an observable listener for the onunload event */ (function() { PIE.OnUnload = new PIE.Observable(); function handleUnload() { PIE.OnUnload.fire(); win.detachEvent( 'onunload', handleUnload ); win[ 'PIE' ] = null; } win.attachEvent( 'onunload', handleUnload ); /** * Attach an event which automatically gets detached onunload */ PIE.OnUnload.attachManagedEvent = function( target, name, handler ) { target.attachEvent( name, handler ); this.observe( function() { target.detachEvent( name, handler ); } ); }; })()/** * Create a single observable listener for window resize events. */ PIE.OnResize = new PIE.Observable(); PIE.OnUnload.attachManagedEvent( win, 'onresize', function() { PIE.OnResize.fire(); } ); /** * Create a single observable listener for scroll events. Used for lazy loading based * on the viewport, and for fixed position backgrounds. */ (function() { PIE.OnScroll = new PIE.Observable(); function scrolled() { PIE.OnScroll.fire(); } PIE.OnUnload.attachManagedEvent( win, 'onscroll', scrolled ); PIE.OnResize.observe( scrolled ); })(); /** * Create a single observable listener for document mouseup events. */ PIE.OnMouseup = new PIE.Observable(); PIE.OnUnload.attachManagedEvent( doc, 'onmouseup', function() { PIE.OnMouseup.fire(); } ); /** * Wrapper for length and percentage style values. The value is immutable. A singleton instance per unique * value is returned from PIE.getLength() - always use that instead of instantiating directly. * @constructor * @param {string} val The CSS string representing the length. It is assumed that this will already have * been validated as a valid length or percentage syntax. */ PIE.Length = (function() { var lengthCalcEl = doc.createElement( 'length-calc' ), parent = doc.body || doc.documentElement, s = lengthCalcEl.style, conversions = {}, units = [ 'mm', 'cm', 'in', 'pt', 'pc' ], i = units.length, instances = {}; s.position = 'absolute'; s.top = s.left = '-9999px'; parent.appendChild( lengthCalcEl ); while( i-- ) { s.width = '100' + units[i]; conversions[ units[i] ] = lengthCalcEl.offsetWidth / 100; } parent.removeChild( lengthCalcEl ); // All calcs from here on will use 1em s.width = '1em'; function Length( val ) { this.val = val; } Length.prototype = { /** * Regular expression for matching the length unit * @private */ unitRE: /(px|em|ex|mm|cm|in|pt|pc|%)$/, /** * Get the numeric value of the length * @return {number} The value */ getNumber: function() { var num = this.num, UNDEF; if( num === UNDEF ) { num = this.num = parseFloat( this.val ); } return num; }, /** * Get the unit of the length * @return {string} The unit */ getUnit: function() { var unit = this.unit, m; if( !unit ) { m = this.val.match( this.unitRE ); unit = this.unit = ( m && m[0] ) || 'px'; } return unit; }, /** * Determine whether this is a percentage length value * @return {boolean} */ isPercentage: function() { return this.getUnit() === '%'; }, /** * Resolve this length into a number of pixels. * @param {Element} el - the context element, used to resolve font-relative values * @param {(function():number|number)=} pct100 - the number of pixels that equal a 100% percentage. This can be either a number or a * function which will be called to return the number. */ pixels: function( el, pct100 ) { var num = this.getNumber(), unit = this.getUnit(); switch( unit ) { case "px": return num; case "%": return num * ( typeof pct100 === 'function' ? pct100() : pct100 ) / 100; case "em": return num * this.getEmPixels( el ); case "ex": return num * this.getEmPixels( el ) / 2; default: return num * conversions[ unit ]; } }, /** * The em and ex units are relative to the font-size of the current element, * however if the font-size is set using non-pixel units then we get that value * rather than a pixel conversion. To get around this, we keep a floating element * with width:1em which we insert into the target element and then read its offsetWidth. * For elements that won't accept a child we insert into the parent node and perform * additional calculation. If the font-size *is* specified in pixels, then we use that * directly to avoid the expensive DOM manipulation. * @param {Element} el * @return {number} */ getEmPixels: function( el ) { var fs = el.currentStyle.fontSize, px, parent, me; if( fs.indexOf( 'px' ) > 0 ) { return parseFloat( fs ); } else if( el.tagName in PIE.childlessElements ) { me = this; parent = el.parentNode; return PIE.getLength( fs ).pixels( parent, function() { return me.getEmPixels( parent ); } ); } else { el.appendChild( lengthCalcEl ); px = lengthCalcEl.offsetWidth; if( lengthCalcEl.parentNode === el ) { //not sure how this could be false but it sometimes is el.removeChild( lengthCalcEl ); } return px; } } }; /** * Convert a pixel length into a point length */ Length.pxToPt = function( px ) { return px / conversions[ 'pt' ]; }; /** * Retrieve a PIE.Length instance for the given value. A shared singleton instance is returned for each unique value. * @param {string} val The CSS string representing the length. It is assumed that this will already have * been validated as a valid length or percentage syntax. */ PIE.getLength = function( val ) { return instances[ val ] || ( instances[ val ] = new Length( val ) ); }; return Length; })(); /** * Wrapper for a CSS3 bg-position value. Takes up to 2 position keywords and 2 lengths/percentages. * @constructor * @param {Array.<PIE.Tokenizer.Token>} tokens The tokens making up the background position value. */ PIE.BgPosition = (function() { var length_fifty = PIE.getLength( '50%' ), vert_idents = { 'top': 1, 'center': 1, 'bottom': 1 }, horiz_idents = { 'left': 1, 'center': 1, 'right': 1 }; function BgPosition( tokens ) { this.tokens = tokens; } BgPosition.prototype = { /** * Normalize the values into the form: * [ xOffsetSide, xOffsetLength, yOffsetSide, yOffsetLength ] * where: xOffsetSide is either 'left' or 'right', * yOffsetSide is either 'top' or 'bottom', * and x/yOffsetLength are both PIE.Length objects. * @return {Array} */ getValues: function() { if( !this._values ) { var tokens = this.tokens, len = tokens.length, Tokenizer = PIE.Tokenizer, identType = Tokenizer.Type, length_zero = PIE.getLength( '0' ), type_ident = identType.IDENT, type_length = identType.LENGTH, type_percent = identType.PERCENT, type, value, vals = [ 'left', length_zero, 'top', length_zero ]; // If only one value, the second is assumed to be 'center' if( len === 1 ) { tokens.push( new Tokenizer.Token( type_ident, 'center' ) ); len++; } // Two values - CSS2 if( len === 2 ) { // If both idents, they can appear in either order, so switch them if needed if( type_ident & ( tokens[0].tokenType | tokens[1].tokenType ) && tokens[0].tokenValue in vert_idents && tokens[1].tokenValue in horiz_idents ) { tokens.push( tokens.shift() ); } if( tokens[0].tokenType & type_ident ) { if( tokens[0].tokenValue === 'center' ) { vals[1] = length_fifty; } else { vals[0] = tokens[0].tokenValue; } } else if( tokens[0].isLengthOrPercent() ) { vals[1] = PIE.getLength( tokens[0].tokenValue ); } if( tokens[1].tokenType & type_ident ) { if( tokens[1].tokenValue === 'center' ) { vals[3] = length_fifty; } else { vals[2] = tokens[1].tokenValue; } } else if( tokens[1].isLengthOrPercent() ) { vals[3] = PIE.getLength( tokens[1].tokenValue ); } } // Three or four values - CSS3 else { // TODO } this._values = vals; } return this._values; }, /** * Find the coordinates of the background image from the upper-left corner of the background area. * Note that these coordinate values are not rounded. * @param {Element} el * @param {number} width - the width for percentages (background area width minus image width) * @param {number} height - the height for percentages (background area height minus image height) * @return {Object} { x: Number, y: Number } */ coords: function( el, width, height ) { var vals = this.getValues(), pxX = vals[1].pixels( el, width ), pxY = vals[3].pixels( el, height ); return { x: vals[0] === 'right' ? width - pxX : pxX, y: vals[2] === 'bottom' ? height - pxY : pxY }; } }; return BgPosition; })(); /** * Wrapper for a CSS3 background-size value. * @constructor * @param {String|PIE.Length} w The width parameter * @param {String|PIE.Length} h The height parameter, if any */ PIE.BgSize = (function() { var CONTAIN = 'contain', COVER = 'cover', AUTO = 'auto'; function BgSize( w, h ) { this.w = w; this.h = h; } BgSize.prototype = { pixels: function( el, areaW, areaH, imgW, imgH ) { var me = this, w = me.w, h = me.h, areaRatio = areaW / areaH, imgRatio = imgW / imgH; if ( w === CONTAIN ) { w = imgRatio > areaRatio ? areaW : areaH * imgRatio; h = imgRatio > areaRatio ? areaW / imgRatio : areaH; } else if ( w === COVER ) { w = imgRatio < areaRatio ? areaW : areaH * imgRatio; h = imgRatio < areaRatio ? areaW / imgRatio : areaH; } else if ( w === AUTO ) { h = ( h === AUTO ? imgH : h.pixels( el, areaH ) ); w = h * imgRatio; } else { w = w.pixels( el, areaW ); h = ( h === AUTO ? w / imgRatio : h.pixels( el, areaH ) ); } return { w: w, h: h }; } }; BgSize.DEFAULT = new BgSize( AUTO, AUTO ); return BgSize; })(); /** * Wrapper for angle values; handles conversion to degrees from all allowed angle units * @constructor * @param {string} val The raw CSS value for the angle. It is assumed it has been pre-validated. */ PIE.Angle = (function() { function Angle( val ) { this.val = val; } Angle.prototype = { unitRE: /[a-z]+$/i, /** * @return {string} The unit of the angle value */ getUnit: function() { return this._unit || ( this._unit = this.val.match( this.unitRE )[0].toLowerCase() ); }, /** * Get the numeric value of the angle in degrees. * @return {number} The degrees value */ degrees: function() { var deg = this._deg, u, n; if( deg === undefined ) { u = this.getUnit(); n = parseFloat( this.val, 10 ); deg = this._deg = ( u === 'deg' ? n : u === 'rad' ? n / Math.PI * 180 : u === 'grad' ? n / 400 * 360 : u === 'turn' ? n * 360 : 0 ); } return deg; } }; return Angle; })();/** * Abstraction for colors values. Allows detection of rgba values. A singleton instance per unique * value is returned from PIE.getColor() - always use that instead of instantiating directly. * @constructor * @param {string} val The raw CSS string value for the color */ PIE.Color = (function() { /* * hsl2rgb from http://codingforums.com/showthread.php?t=11156 * code by Jason Karl Davis (http://www.jasonkarldavis.com) * swiped from cssSandpaper by Zoltan Hawryluk (http://www.useragentman.com/blog/csssandpaper-a-css3-javascript-library/) * modified for formatting and size optimizations */ function hsl2rgb( h, s, l ) { var m1, m2, r, g, b, round = Math.round; s /= 100; l /= 100; if ( !s ) { r = g = b = l * 255; } else { if ( l <= 0.5 ) { m2 = l * ( s + 1 ); } else { m2 = l + s - l * s; } m1 = l * 2 - m2; h = ( h % 360 ) / 360; r = hueToRgb( m1, m2, h + 1/3 ); g = hueToRgb( m1, m2, h ); b = hueToRgb( m1, m2, h - 1/3 ); } return { r: round( r ), g: round( g ), b: round( b ) }; } function hueToRgb( m1, m2, hue ) { var v; if ( hue < 0 ) { hue += 1; } else if ( hue > 1 ) { hue -= 1; } if ( 6 * hue < 1 ) { v = m1 + ( m2 - m1 ) * hue * 6; } else if ( 2 * hue < 1 ) { v = m2; } else if ( 3 * hue < 2 ) { v = m1 + ( m2 - m1 ) * ( 2/3 - hue ) * 6; } else { v = m1; } return 255 * v; } var instances = {}; function Color( val ) { this.val = val; } /** * Regular expression for matching rgba colors and extracting their components * @type {RegExp} */ Color.rgbOrRgbaRE = /\s*rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(\d+|\d*\.\d+))?\s*\)\s*/; Color.hslOrHslaRE = /\s*hsla?\(\s*(\d*\.?\d+)\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*(,\s*(\d+|\d*\.\d+))?\s*\)\s*/; /** * Hash of color keyword names to their corresponding hex values. Encoded for * small size and expanded into a hash on startup. */ Color.names = {}; var names = 'black|0|navy|3k|darkblue|b|mediumblue|1u|blue|1e|darkgreen|jk1|green|5j4|teal|3k|darkcyan|26j|deepskyblue|ad0|darkturquoise|2xe|mediumspringgreen|8nd|lime|va|springgreen|3j|aqua|3k|cyan|0|midnightblue|xunl|dodgerblue|7ogf|lightseagreen|2zsb|forestgreen|2lbs|seagreen|guut|darkslategray|12pk|limegreen|4wkj|mediumseagreen|dwlb|turquoise|5v8f|royalblue|r2p|steelblue|75qr|darkslateblue|2fh3|mediumturquoise|ta9|indigo|32d2|darkolivegreen|emr1|cadetblue|ebu9|cornflowerblue|6z4d|mediumaquamarine|3459|dimgray|3nwf|slateblue|1bok|olivedrab|1opi|slategray|6y5p|lightslategray|9vk9|mediumslateblue|5g0l|lawngreen|27ma|chartreuse|48ao|aquamarine|5w|maroon|18|purple|3k|olive|p6o|gray|3k|lightslateblue|5j7j|skyblue|4q98|lightskyblue|f|blueviolet|3bhk|darkred|15we|darkmagenta|3v|saddlebrown|djc|darkseagreen|69vg|lightgreen|1og1|mediumpurple|3ivc|darkviolet|sfv|palegreen|6zt1|darkorchid|awk|yellowgreen|292e|sienna|7r3v|brown|6sxp|darkgray|6bgf|lightblue|5vlp|greenyellow|7k9|paleturquoise|2pxb|lightsteelblue|169c|powderblue|5jc|firebrick|1rgc|darkgoldenrod|8z55|mediumorchid|2jm0|rosybrown|34jg|darkkhaki|1mfw|silver|49jp|mediumvioletred|8w5h|indianred|8tef|peru|82r|violetred|3ntd|feldspar|212d|chocolate|16eh|tan|ewe|lightgrey|1kqv|palevioletred|6h8g|metle|fnp|orchid|2dj2|goldenrod|abu|crimson|20ik|gainsboro|13mo|plum|12pt|burlywood|1j8q|lightcyan|3794|lavender|8agr|darksalmon|3rsw|violet|6wz8|palegoldenrod|k3g|lightcoral|28k6|khaki|k5o|aliceblue|3n7|honeydew|1dd|azure|f|sandybrown|5469|wheat|1q37|beige|4kp|whitesmoke|p|mintcream|1z9|ghostwhite|46bp|salmon|25bn|antiquewhite|l7p|linen|zz|lightgoldenrodyellow|1yk|oldlace|46qc|red|1gka|magenta|73|fuchsia|0|deeppink|3v8|orangered|9kd|tomato|5zb|hotpink|19p|coral|49o|darkorange|2i8|lightsalmon|41m|orange|w6|lightpink|3i9|pink|1ze|gold|4dx|peachpuff|qh|navajowhite|s4|moccasin|16w|bisque|f|mistyrose|t|blanchedalmond|1d8|papayawhip|so|lavenderblush|80|seashell|zd|cornsilk|ku|lemonchiffon|dt|floralwhite|z|snow|a|yellow|sm|lightyellow|68|ivory|g|white|f'.split('|'), i = 0, len = names.length, color = 0, hexColor; for(; i < len; i += 2) { color += parseInt(names[i + 1], 36); hexColor = color.toString(16); Color.names[names[i]] = '#000000'.slice(0, -hexColor.length) + hexColor; } Color.prototype = { /** * @private */ parse: function() { if( !this._color ) { var me = this, color = me.val, alpha, vLower, m, rgb; // RGB or RGBA colors if( m = color.match( Color.rgbOrRgbaRE ) ) { color = me.rgbToHex( +m[1], +m[2], +m[3] ); alpha = m[5] ? +m[5] : 1; } // HSL or HSLA colors else if( m = color.match( Color.hslOrHslaRE ) ) { rgb = hsl2rgb( m[1], m[2], m[3] ); color = me.rgbToHex( rgb.r, rgb.g, rgb.b ); alpha = m[5] ? +m[5] : 1; } else { if( Color.names.hasOwnProperty( vLower = color.toLowerCase() ) ) { color = Color.names[vLower]; } alpha = ( color === 'transparent' ? 0 : 1 ); } me._color = color; me._alpha = alpha; } }, /** * Converts RGB color channels to a hex value string */ rgbToHex: function( r, g, b ) { return '#' + ( r < 16 ? '0' : '' ) + r.toString( 16 ) + ( g < 16 ? '0' : '' ) + g.toString( 16 ) + ( b < 16 ? '0' : '' ) + b.toString( 16 ); }, /** * Retrieve the value of the color in a format usable by IE natively. This will be the same as * the raw input value, except for rgb(a) and hsl(a) values which will be converted to a hex value. * @param {Element} el The context element, used to get 'currentColor' keyword value. * @return {string} Color value */ colorValue: function( el ) { this.parse(); return this._color === 'currentColor' ? PIE.getColor( el.currentStyle.color ).colorValue( el ) : this._color; }, /** * Retrieve the value of the color in a normalized six-digit hex format. * @param el */ hexValue: function( el ) { var color = this.colorValue( el ); // At this point the color should be either a 3- or 6-digit hex value, or the string "transparent". function ch( i ) { return color.charAt( i ); } // Fudge transparent to black - should be ignored anyway since its alpha will be 0 if( color === 'transparent' ) { color = '#000'; } // Expand 3-digit to 6-digit hex if( ch(0) === '#' && color.length === 4 ) { color = '#' + ch(1) + ch(1) + ch(2) + ch(2) + ch(3) + ch(3); } return color; }, /** * Retrieve the alpha value of the color. Will be 1 for all values except for rgba values * with an alpha component. * @return {number} The alpha value, from 0 to 1. */ alpha: function() { this.parse(); return this._alpha; } }; /** * Retrieve a PIE.Color instance for the given value. A shared singleton instance is returned for each unique value. * @param {string} val The CSS string representing the color. It is assumed that this will already have * been validated as a valid color syntax. */ PIE.getColor = function(val) { return instances[ val ] || ( instances[ val ] = new Color( val ) ); }; return Color; })();/** * A tokenizer for CSS value strings. * @constructor * @param {string} css The CSS value string */ PIE.Tokenizer = (function() { function Tokenizer( css ) { this.css = css; this.ch = 0; this.tokens = []; this.tokenIndex = 0; } /** * Enumeration of token type constants. * @enum {number} */ var Type = Tokenizer.Type = { ANGLE: 1, CHARACTER: 2, COLOR: 4, DIMEN: 8, FUNCTION: 16, IDENT: 32, LENGTH: 64, NUMBER: 128, OPERATOR: 256, PERCENT: 512, STRING: 1024, URL: 2048 }; /** * A single token * @constructor * @param {number} type The type of the token - see PIE.Tokenizer.Type * @param {string} value The value of the token */ Tokenizer.Token = function( type, value ) { this.tokenType = type; this.tokenValue = value; }; Tokenizer.Token.prototype = { isLength: function() { return this.tokenType & Type.LENGTH || ( this.tokenType & Type.NUMBER && this.tokenValue === '0' ); }, isLengthOrPercent: function() { return this.isLength() || this.tokenType & Type.PERCENT; } }; Tokenizer.prototype = { whitespace: /\s/, number: /^[\+\-]?(\d*\.)?\d+/, url: /^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i, ident: /^\-?[_a-z][\w-]*/i, string: /^("([^"]*)"|'([^']*)')/, operator: /^[\/,]/, hash: /^#[\w]+/, hashColor: /^#([\da-f]{6}|[\da-f]{3})/i, unitTypes: { 'px': Type.LENGTH, 'em': Type.LENGTH, 'ex': Type.LENGTH, 'mm': Type.LENGTH, 'cm': Type.LENGTH, 'in': Type.LENGTH, 'pt': Type.LENGTH, 'pc': Type.LENGTH, 'deg': Type.ANGLE, 'rad': Type.ANGLE, 'grad': Type.ANGLE }, colorFunctions: { 'rgb': 1, 'rgba': 1, 'hsl': 1, 'hsla': 1 }, /** * Advance to and return the next token in the CSS string. If the end of the CSS string has * been reached, null will be returned. * @param {boolean} forget - if true, the token will not be stored for the purposes of backtracking with prev(). * @return {PIE.Tokenizer.Token} */ next: function( forget ) { var css, ch, firstChar, match, val, me = this; function newToken( type, value ) { var tok = new Tokenizer.Token( type, value ); if( !forget ) { me.tokens.push( tok ); me.tokenIndex++; } return tok; } function failure() { me.tokenIndex++; return null; } // In case we previously backed up, return the stored token in the next slot if( this.tokenIndex < this.tokens.length ) { return this.tokens[ this.tokenIndex++ ]; } // Move past leading whitespace characters while( this.whitespace.test( this.css.charAt( this.ch ) ) ) { this.ch++; } if( this.ch >= this.css.length ) { return failure(); } ch = this.ch; css = this.css.substring( this.ch ); firstChar = css.charAt( 0 ); switch( firstChar ) { case '#': if( match = css.match( this.hashColor ) ) { this.ch += match[0].length; return newToken( Type.COLOR, match[0] ); } break; case '"': case "'": if( match = css.match( this.string ) ) { this.ch += match[0].length; return newToken( Type.STRING, match[2] || match[3] || '' ); } break; case "/": case ",": this.ch++; return newToken( Type.OPERATOR, firstChar ); case 'u': if( match = css.match( this.url ) ) { this.ch += match[0].length; return newToken( Type.URL, match[2] || match[3] || match[4] || '' ); } } // Numbers and values starting with numbers if( match = css.match( this.number ) ) { val = match[0]; this.ch += val.length; // Check if it is followed by a unit if( css.charAt( val.length ) === '%' ) { this.ch++; return newToken( Type.PERCENT, val + '%' ); } if( match = css.substring( val.length ).match( this.ident ) ) { val += match[0]; this.ch += match[0].length; return newToken( this.unitTypes[ match[0].toLowerCase() ] || Type.DIMEN, val ); } // Plain ol' number return newToken( Type.NUMBER, val ); } // Identifiers if( match = css.match( this.ident ) ) { val = match[0]; this.ch += val.length; // Named colors if( val.toLowerCase() in PIE.Color.names || val === 'currentColor' || val === 'transparent' ) { return newToken( Type.COLOR, val ); } // Functions if( css.charAt( val.length ) === '(' ) { this.ch++; // Color values in function format: rgb, rgba, hsl, hsla if( val.toLowerCase() in this.colorFunctions ) { function isNum( tok ) { return tok && tok.tokenType & Type.NUMBER; } function isNumOrPct( tok ) { return tok && ( tok.tokenType & ( Type.NUMBER | Type.PERCENT ) ); } function isValue( tok, val ) { return tok && tok.tokenValue === val; } function next() { return me.next( 1 ); } if( ( val.charAt(0) === 'r' ? isNumOrPct( next() ) : isNum( next() ) ) && isValue( next(), ',' ) && isNumOrPct( next() ) && isValue( next(), ',' ) && isNumOrPct( next() ) && ( val === 'rgb' || val === 'hsa' || ( isValue( next(), ',' ) && isNum( next() ) ) ) && isValue( next(), ')' ) ) { return newToken( Type.COLOR, this.css.substring( ch, this.ch ) ); } return failure(); } return newToken( Type.FUNCTION, val ); } // Other identifier return newToken( Type.IDENT, val ); } // Standalone character this.ch++; return newToken( Type.CHARACTER, firstChar ); }, /** * Determine whether there is another token * @return {boolean} */ hasNext: function() { var next = this.next(); this.prev(); return !!next; }, /** * Back up and return the previous token * @return {PIE.Tokenizer.Token} */ prev: function() { return this.tokens[ this.tokenIndex-- - 2 ]; }, /** * Retrieve all the tokens in the CSS string * @return {Array.<PIE.Tokenizer.Token>} */ all: function() { while( this.next() ) {} return this.tokens; }, /** * Return a list of tokens from the current position until the given function returns * true. The final token will not be included in the list. * @param {function():boolean} func - test function * @param {boolean} require - if true, then if the end of the CSS string is reached * before the test function returns true, null will be returned instead of the * tokens that have been found so far. * @return {Array.<PIE.Tokenizer.Token>} */ until: function( func, require ) { var list = [], t, hit; while( t = this.next() ) { if( func( t ) ) { hit = true; this.prev(); break; } list.push( t ); } return require && !hit ? null : list; } }; return Tokenizer; })();/** * Handles calculating, caching, and detecting changes to size and position of the element. * @constructor * @param {Element} el the target element */ PIE.BoundsInfo = function( el ) { this.targetElement = el; }; PIE.BoundsInfo.prototype = { _locked: 0, /** * Determines if the element's position has changed since the last update. * TODO this does a simple getBoundingClientRect comparison for detecting the * changes in position, which may not always be accurate; it's possible that * an element will actually move relative to its positioning parent, but its position * relative to the viewport will stay the same. Need to come up with a better way to * track movement. The most accurate would be the same logic used in RootRenderer.updatePos() * but that is a more expensive operation since it performs DOM walking, and we want this * check to be as fast as possible. Perhaps introduce a -pie-* flag to trigger the slower * but more accurate method? */ positionChanged: function() { var last = this._lastBounds, bounds; return !last || ( ( bounds = this.getBounds() ) && ( last.x !== bounds.x || last.y !== bounds.y ) ); }, sizeChanged: function() { var last = this._lastBounds, bounds; return !last || ( ( bounds = this.getBounds() ) && ( last.w !== bounds.w || last.h !== bounds.h ) ); }, getLiveBounds: function() { var el = this.targetElement, rect = el.getBoundingClientRect(), isIE9 = PIE.ieDocMode === 9, isIE7 = PIE.ieVersion === 7, width = rect.right - rect.left; return { x: rect.left, y: rect.top, // In some cases scrolling the page will cause IE9 to report incorrect dimensions // in the rect returned by getBoundingClientRect, so we must query offsetWidth/Height // instead. Also IE7 is inconsistent in using logical vs. device pixels in measurements // so we must calculate the ratio and use it in certain places as a position adjustment. w: isIE9 || isIE7 ? el.offsetWidth : width, h: isIE9 || isIE7 ? el.offsetHeight : rect.bottom - rect.top, logicalZoomRatio: ( isIE7 && width ) ? el.offsetWidth / width : 1 }; }, getBounds: function() { return this._locked ? ( this._lockedBounds || ( this._lockedBounds = this.getLiveBounds() ) ) : this.getLiveBounds(); }, hasBeenQueried: function() { return !!this._lastBounds; }, lock: function() { ++this._locked; }, unlock: function() { if( !--this._locked ) { if( this._lockedBounds ) this._lastBounds = this._lockedBounds; this._lockedBounds = null; } } }; (function() { function cacheWhenLocked( fn ) { var uid = PIE.Util.getUID( fn ); return function() { if( this._locked ) { var cache = this._lockedValues || ( this._lockedValues = {} ); return ( uid in cache ) ? cache[ uid ] : ( cache[ uid ] = fn.call( this ) ); } else { return fn.call( this ); } } } PIE.StyleInfoBase = { _locked: 0, /** * Create a new StyleInfo class, with the standard constructor, and augmented by * the StyleInfoBase's members. * @param proto */ newStyleInfo: function( proto ) { function StyleInfo( el ) { this.targetElement = el; this._lastCss = this.getCss(); } PIE.merge( StyleInfo.prototype, PIE.StyleInfoBase, proto ); StyleInfo._propsCache = {}; return StyleInfo; }, /** * Get an object representation of the target CSS style, caching it for each unique * CSS value string. * @return {Object} */ getProps: function() { var css = this.getCss(), cache = this.constructor._propsCache; return css ? ( css in cache ? cache[ css ] : ( cache[ css ] = this.parseCss( css ) ) ) : null; }, /** * Get the raw CSS value for the target style * @return {string} */ getCss: cacheWhenLocked( function() { var el = this.targetElement, ctor = this.constructor, s = el.style, cs = el.currentStyle, cssProp = this.cssProperty, styleProp = this.styleProperty, prefixedCssProp = ctor._prefixedCssProp || ( ctor._prefixedCssProp = PIE.CSS_PREFIX + cssProp ), prefixedStyleProp = ctor._prefixedStyleProp || ( ctor._prefixedStyleProp = PIE.STYLE_PREFIX + styleProp.charAt(0).toUpperCase() + styleProp.substring(1) ); return s[ prefixedStyleProp ] || cs.getAttribute( prefixedCssProp ) || s[ styleProp ] || cs.getAttribute( cssProp ); } ), /** * Determine whether the target CSS style is active. * @return {boolean} */ isActive: cacheWhenLocked( function() { return !!this.getProps(); } ), /** * Determine whether the target CSS style has changed since the last time it was used. * @return {boolean} */ changed: cacheWhenLocked( function() { var currentCss = this.getCss(), changed = currentCss !== this._lastCss; this._lastCss = currentCss; return changed; } ), cacheWhenLocked: cacheWhenLocked, lock: function() { ++this._locked; }, unlock: function() { if( !--this._locked ) { delete this._lockedValues; } } }; })();/** * Handles parsing, caching, and detecting changes to background (and -pie-background) CSS * @constructor * @param {Element} el the target element */ PIE.BackgroundStyleInfo = PIE.StyleInfoBase.newStyleInfo( { cssProperty: PIE.CSS_PREFIX + 'background', styleProperty: PIE.STYLE_PREFIX + 'Background', attachIdents: { 'scroll':1, 'fixed':1, 'local':1 }, repeatIdents: { 'repeat-x':1, 'repeat-y':1, 'repeat':1, 'no-repeat':1 }, originAndClipIdents: { 'padding-box':1, 'border-box':1, 'content-box':1 }, positionIdents: { 'top':1, 'right':1, 'bottom':1, 'left':1, 'center':1 }, sizeIdents: { 'contain':1, 'cover':1 }, tbIdents: { 'top': 1, 'bottom': 1 }, lrIdents: { 'left': 1, 'right': 1 }, propertyNames: { CLIP: 'backgroundClip', COLOR: 'backgroundColor', IMAGE: 'backgroundImage', ORIGIN: 'backgroundOrigin', POSITION: 'backgroundPosition', REPEAT: 'backgroundRepeat', SIZE: 'backgroundSize' }, /** * For background styles, we support the -pie-background property but fall back to the standard * backround* properties. The reason we have to use the prefixed version is that IE natively * parses the standard properties and if it sees something it doesn't know how to parse, for example * multiple values or gradient definitions, it will throw that away and not make it available through * currentStyle. * * Format of return object: * { * color: <PIE.Color>, * colorClip: <'border-box' | 'padding-box'>, * bgImages: [ * { * imgType: 'image', * imgUrl: 'image.png', * imgRepeat: <'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'>, * bgPosition: <PIE.BgPosition>, * bgAttachment: <'scroll' | 'fixed' | 'local'>, * bgOrigin: <'border-box' | 'padding-box' | 'content-box'>, * bgClip: <'border-box' | 'padding-box'>, * bgSize: <PIE.BgSize>, * origString: 'url(img.png) no-repeat top left' * }, * { * imgType: 'linear-gradient', * gradientTo: [<'top' | 'bottom'>, <'left' | 'right'>?], * angle: <PIE.Angle>, * stops: [ * { color: <PIE.Color>, offset: <PIE.Length> }, * { color: <PIE.Color>, offset: <PIE.Length> }, ... * ] * } * ] * } * @param {String} css * @override */ parseCss: function( css ) { var el = this.targetElement, cs = el.currentStyle, tokenizer, token, image, tok_type = PIE.Tokenizer.Type, type_operator = tok_type.OPERATOR, type_ident = tok_type.IDENT, type_color = tok_type.COLOR, tokType, tokVal, beginCharIndex = 0, positionIdents = this.positionIdents, gradient, stop, width, height, gradientTo, len, tbIdents, lrIdents, props = { bgImages: [] }; function isBgPosToken( token ) { return token && token.isLengthOrPercent() || ( token.tokenType & type_ident && token.tokenValue in positionIdents ); } function sizeToken( token ) { return token && ( ( token.isLengthOrPercent() && PIE.getLength( token.tokenValue ) ) || ( token.tokenValue === 'auto' && 'auto' ) ); } // If the CSS3-specific -pie-background property is present, parse it if( this.getCss3() ) { tokenizer = new PIE.Tokenizer( css ); image = {}; while( token = tokenizer.next() ) { tokType = token.tokenType; tokVal = token.tokenValue; if( !image.imgType && tokType & tok_type.FUNCTION && tokVal === 'linear-gradient' ) { gradient = { stops: [], imgType: tokVal }; stop = {}; while( token = tokenizer.next() ) { tokType = token.tokenType; tokVal = token.tokenValue; // If we reached the end of the function and had at least 2 stops, flush the info if( tokType & tok_type.CHARACTER && tokVal === ')' ) { if( stop.color ) { gradient.stops.push( stop ); } if( gradient.stops.length > 1 ) { PIE.merge( image, gradient ); } break; } // Color stop - must start with color if( tokType & type_color ) { // if we already have an angle/position, make sure that the previous token was a comma if( gradient.angle || gradient.gradientTo ) { token = tokenizer.prev(); if( token.tokenType !== type_operator ) { break; //fail } tokenizer.next(); } stop = { color: PIE.getColor( tokVal ) }; // check for offset following color token = tokenizer.next(); if( token.isLengthOrPercent() ) { stop.offset = PIE.getLength( token.tokenValue ); } else { tokenizer.prev(); } } // Angle - can only appear in first spot else if( tokType & tok_type.ANGLE && !gradient.angle && !gradient.gradientTo && !stop.color && !gradient.stops.length ) { gradient.angle = new PIE.Angle( token.tokenValue ); } // "to <side-or-corner>" - can only appear in first spot else if( tokType & tok_type.IDENT && tokVal === 'to' && !gradient.gradientTo && !gradient.angle && !stop.color && !gradient.stops.length ) { tbIdents = this.tbIdents; lrIdents = this.lrIdents; gradientTo = tokenizer.until( function( t ) { return !(t && t.tokenType & tok_type.IDENT && ( t.tokenValue in tbIdents || t.tokenValue in lrIdents )); } ); len = gradientTo.length; gradientTo = [ gradientTo[0] && gradientTo[0].tokenValue, gradientTo[1] && gradientTo[1].tokenValue ]; // bail unless there are 1 or 2 values, or if the 2 values are from the same pair of sides if ( len < 1 || len > 2 || ( len > 1 && ( ( gradientTo[0] in tbIdents && gradientTo[1] in tbIdents ) || ( gradientTo[0] in lrIdents && gradientTo[1] in lrIdents ) ) ) ) { break; } gradient.gradientTo = gradientTo; } else if( tokType & type_operator && tokVal === ',' ) { if( stop.color ) { gradient.stops.push( stop ); stop = {}; } } else { // Found something we didn't recognize; fail without adding image break; } } } else if( !image.imgType && tokType & tok_type.URL ) { image.imgUrl = tokVal; image.imgType = 'image'; } else if( isBgPosToken( token ) && !image.bgPosition ) { tokenizer.prev(); image.bgPosition = new PIE.BgPosition( tokenizer.until( function( t ) { return !isBgPosToken( t ); }, false ) ); } else if( tokType & type_ident ) { if( tokVal in this.repeatIdents && !image.imgRepeat ) { image.imgRepeat = tokVal; } else if( tokVal in this.originAndClipIdents && !image.bgOrigin ) { image.bgOrigin = tokVal; if( ( token = tokenizer.next() ) && ( token.tokenType & type_ident ) && token.tokenValue in this.originAndClipIdents ) { image.bgClip = token.tokenValue; } else { image.bgClip = tokVal; tokenizer.prev(); } } else if( tokVal in this.attachIdents && !image.bgAttachment ) { image.bgAttachment = tokVal; } else { return null; } } else if( tokType & type_color && !props.color ) { props.color = PIE.getColor( tokVal ); } else if( tokType & type_operator && tokVal === '/' && !image.bgSize && image.bgPosition ) { // background size token = tokenizer.next(); if( token.tokenType & type_ident && token.tokenValue in this.sizeIdents ) { image.bgSize = new PIE.BgSize( token.tokenValue ); } else if( width = sizeToken( token ) ) { height = sizeToken( tokenizer.next() ); if ( !height ) { height = width; tokenizer.prev(); } image.bgSize = new PIE.BgSize( width, height ); } else { return null; } } // new layer else if( tokType & type_operator && tokVal === ',' && image.imgType ) { image.origString = css.substring( beginCharIndex, tokenizer.ch - 1 ); beginCharIndex = tokenizer.ch; props.bgImages.push( image ); image = {}; } else { // Found something unrecognized; chuck everything return null; } } // leftovers if( image.imgType ) { image.origString = css.substring( beginCharIndex ); props.bgImages.push( image ); } props.colorClip = image.bgClip; } // Otherwise, use the standard background properties; let IE give us the values rather than parsing them else { this.withActualBg( PIE.ieDocMode < 9 ? function() { var propNames = this.propertyNames, posX = cs[propNames.POSITION + 'X'], posY = cs[propNames.POSITION + 'Y'], img = cs[propNames.IMAGE], color = cs[propNames.COLOR]; if( color !== 'transparent' ) { props.color = PIE.getColor( color ) } if( img !== 'none' ) { props.bgImages = [ { imgType: 'image', imgUrl: new PIE.Tokenizer( img ).next().tokenValue, imgRepeat: cs[propNames.REPEAT], bgPosition: new PIE.BgPosition( new PIE.Tokenizer( posX + ' ' + posY ).all() ) } ]; } } : function() { var propNames = this.propertyNames, splitter = /\s*,\s*/, images = cs[propNames.IMAGE].split( splitter ), color = cs[propNames.COLOR], repeats, positions, origins, clips, sizes, i, len, image, sizeParts; if( color !== 'transparent' ) { props.color = PIE.getColor( color ) } len = images.length; if( len && images[0] !== 'none' ) { repeats = cs[propNames.REPEAT].split( splitter ); positions = cs[propNames.POSITION].split( splitter ); origins = cs[propNames.ORIGIN].split( splitter ); clips = cs[propNames.CLIP].split( splitter ); sizes = cs[propNames.SIZE].split( splitter ); props.bgImages = []; for( i = 0; i < len; i++ ) { image = images[ i ]; if( image && image !== 'none' ) { sizeParts = sizes[i].split( ' ' ); props.bgImages.push( { origString: image + ' ' + repeats[ i ] + ' ' + positions[ i ] + ' / ' + sizes[ i ] + ' ' + origins[ i ] + ' ' + clips[ i ], imgType: 'image', imgUrl: new PIE.Tokenizer( image ).next().tokenValue, imgRepeat: repeats[ i ], bgPosition: new PIE.BgPosition( new PIE.Tokenizer( positions[ i ] ).all() ), bgOrigin: origins[ i ], bgClip: clips[ i ], bgSize: new PIE.BgSize( sizeParts[ 0 ], sizeParts[ 1 ] ) } ); } } } } ); } return ( props.color || props.bgImages[0] ) ? props : null; }, /** * Execute a function with the actual background styles (not overridden with runtimeStyle * properties set by the renderers) available via currentStyle. * @param fn */ withActualBg: function( fn ) { var isIE9 = PIE.ieDocMode > 8, propNames = this.propertyNames, rs = this.targetElement.runtimeStyle, rsImage = rs[propNames.IMAGE], rsColor = rs[propNames.COLOR], rsRepeat = rs[propNames.REPEAT], rsClip, rsOrigin, rsSize, rsPosition, ret; if( rsImage ) rs[propNames.IMAGE] = ''; if( rsColor ) rs[propNames.COLOR] = ''; if( rsRepeat ) rs[propNames.REPEAT] = ''; if( isIE9 ) { rsClip = rs[propNames.CLIP]; rsOrigin = rs[propNames.ORIGIN]; rsPosition = rs[propNames.POSITION]; rsSize = rs[propNames.SIZE]; if( rsClip ) rs[propNames.CLIP] = ''; if( rsOrigin ) rs[propNames.ORIGIN] = ''; if( rsPosition ) rs[propNames.POSITION] = ''; if( rsSize ) rs[propNames.SIZE] = ''; } ret = fn.call( this ); if( rsImage ) rs[propNames.IMAGE] = rsImage; if( rsColor ) rs[propNames.COLOR] = rsColor; if( rsRepeat ) rs[propNames.REPEAT] = rsRepeat; if( isIE9 ) { if( rsClip ) rs[propNames.CLIP] = rsClip; if( rsOrigin ) rs[propNames.ORIGIN] = rsOrigin; if( rsPosition ) rs[propNames.POSITION] = rsPosition; if( rsSize ) rs[propNames.SIZE] = rsSize; } return ret; }, getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { return this.getCss3() || this.withActualBg( function() { var cs = this.targetElement.currentStyle, propNames = this.propertyNames; return cs[propNames.COLOR] + ' ' + cs[propNames.IMAGE] + ' ' + cs[propNames.REPEAT] + ' ' + cs[propNames.POSITION + 'X'] + ' ' + cs[propNames.POSITION + 'Y']; } ); } ), getCss3: PIE.StyleInfoBase.cacheWhenLocked( function() { var el = this.targetElement; return el.style[ this.styleProperty ] || el.currentStyle.getAttribute( this.cssProperty ); } ), /** * For a given background-origin value, return the dimensions of the background area. * @param {String} bgOrigin * @param {PIE.BoundsInfo} boundsInfo * @param {PIE.BorderStyleInfo} borderInfo */ getBgAreaSize: function( bgOrigin, boundsInfo, borderInfo, paddingInfo ) { var el = this.targetElement, bounds = boundsInfo.getBounds(), w = bounds.w, h = bounds.h, borders, paddings; if( bgOrigin !== 'border-box' ) { borders = borderInfo.getProps(); if( borders && ( borders = borders.widths ) ) { w -= borders[ 'l' ].pixels( el ) + borders[ 'l' ].pixels( el ); h -= borders[ 't' ].pixels( el ) + borders[ 'b' ].pixels( el ); } } if ( bgOrigin === 'content-box' ) { paddings = paddingInfo.getProps(); if ( paddings ) { w -= paddings[ 'l' ].pixels( el ) + paddings[ 'l' ].pixels( el ); h -= paddings[ 't' ].pixels( el ) + paddings[ 'b' ].pixels( el ); } } return { w: w, h: h }; }, /** * Tests if style.PiePngFix or the -pie-png-fix property is set to true in IE6. */ isPngFix: function() { var val = 0, el; if( PIE.ieVersion < 7 ) { el = this.targetElement; val = ( '' + ( el.style[ PIE.STYLE_PREFIX + 'PngFix' ] || el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'png-fix' ) ) === 'true' ); } return val; }, /** * The isActive logic is slightly different, because getProps() always returns an object * even if it is just falling back to the native background properties. But we only want * to report is as being "active" if either the -pie-background override property is present * and parses successfully or '-pie-png-fix' is set to true in IE6. */ isActive: PIE.StyleInfoBase.cacheWhenLocked( function() { return (this.getCss3() || this.isPngFix()) && !!this.getProps(); } ) } );/** * Handles parsing, caching, and detecting changes to border CSS * @constructor * @param {Element} el the target element */ PIE.BorderStyleInfo = PIE.StyleInfoBase.newStyleInfo( { sides: [ 'Top', 'Right', 'Bottom', 'Left' ], namedWidths: { 'thin': '1px', 'medium': '3px', 'thick': '5px' }, parseCss: function( css ) { var w = {}, s = {}, c = {}, active = false, colorsSame = true, stylesSame = true, widthsSame = true; this.withActualBorder( function() { var el = this.targetElement, cs = el.currentStyle, i = 0, style, color, width, lastStyle, lastColor, lastWidth, side, ltr; for( ; i < 4; i++ ) { side = this.sides[ i ]; ltr = side.charAt(0).toLowerCase(); style = s[ ltr ] = cs[ 'border' + side + 'Style' ]; color = cs[ 'border' + side + 'Color' ]; width = cs[ 'border' + side + 'Width' ]; if( i > 0 ) { if( style !== lastStyle ) { stylesSame = false; } if( color !== lastColor ) { colorsSame = false; } if( width !== lastWidth ) { widthsSame = false; } } lastStyle = style; lastColor = color; lastWidth = width; c[ ltr ] = PIE.getColor( color ); width = w[ ltr ] = PIE.getLength( s[ ltr ] === 'none' ? '0' : ( this.namedWidths[ width ] || width ) ); if( width.pixels( this.targetElement ) > 0 ) { active = true; } } } ); return active ? { widths: w, styles: s, colors: c, widthsSame: widthsSame, colorsSame: colorsSame, stylesSame: stylesSame } : null; }, getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { var el = this.targetElement, cs = el.currentStyle, css; // Don't redraw or hide borders for cells in border-collapse:collapse tables if( !( el.tagName in PIE.tableCellTags && el.offsetParent.currentStyle.borderCollapse === 'collapse' ) ) { this.withActualBorder( function() { css = cs.borderWidth + '|' + cs.borderStyle + '|' + cs.borderColor; } ); } return css; } ), /** * Execute a function with the actual border styles (not overridden with runtimeStyle * properties set by the renderers) available via currentStyle. * @param fn */ withActualBorder: function( fn ) { var rs = this.targetElement.runtimeStyle, rsWidth = rs.borderWidth, rsColor = rs.borderColor, ret; if( rsWidth ) rs.borderWidth = ''; if( rsColor ) rs.borderColor = ''; ret = fn.call( this ); if( rsWidth ) rs.borderWidth = rsWidth; if( rsColor ) rs.borderColor = rsColor; return ret; } } ); /** * Handles parsing, caching, and detecting changes to border-image CSS * @constructor * @param {Element} el the target element */ PIE.BorderImageStyleInfo = PIE.StyleInfoBase.newStyleInfo( { cssProperty: 'border-image', styleProperty: 'borderImage', repeatIdents: { 'stretch':1, 'round':1, 'repeat':1, 'space':1 }, parseCss: function( css ) { var p = null, tokenizer, token, type, value, slices, widths, outsets, slashCount = 0, Type = PIE.Tokenizer.Type, IDENT = Type.IDENT, NUMBER = Type.NUMBER, PERCENT = Type.PERCENT; if( css ) { tokenizer = new PIE.Tokenizer( css ); p = {}; function isSlash( token ) { return token && ( token.tokenType & Type.OPERATOR ) && ( token.tokenValue === '/' ); } function isFillIdent( token ) { return token && ( token.tokenType & IDENT ) && ( token.tokenValue === 'fill' ); } function collectSlicesEtc() { slices = tokenizer.until( function( tok ) { return !( tok.tokenType & ( NUMBER | PERCENT ) ); } ); if( isFillIdent( tokenizer.next() ) && !p.fill ) { p.fill = true; } else { tokenizer.prev(); } if( isSlash( tokenizer.next() ) ) { slashCount++; widths = tokenizer.until( function( token ) { return !token.isLengthOrPercent() && !( ( token.tokenType & IDENT ) && token.tokenValue === 'auto' ); } ); if( isSlash( tokenizer.next() ) ) { slashCount++; outsets = tokenizer.until( function( token ) { return !token.isLength(); } ); } } else { tokenizer.prev(); } } while( token = tokenizer.next() ) { type = token.tokenType; value = token.tokenValue; // Numbers and/or 'fill' keyword: slice values. May be followed optionally by width values, followed optionally by outset values if( type & ( NUMBER | PERCENT ) && !slices ) { tokenizer.prev(); collectSlicesEtc(); } else if( isFillIdent( token ) && !p.fill ) { p.fill = true; collectSlicesEtc(); } // Idents: one or values for 'repeat' else if( ( type & IDENT ) && this.repeatIdents[value] && !p.repeat ) { p.repeat = { h: value }; if( token = tokenizer.next() ) { if( ( token.tokenType & IDENT ) && this.repeatIdents[token.tokenValue] ) { p.repeat.v = token.tokenValue; } else { tokenizer.prev(); } } } // URL of the image else if( ( type & Type.URL ) && !p.src ) { p.src = value; } // Found something unrecognized; exit. else { return null; } } // Validate what we collected if( !p.src || !slices || slices.length < 1 || slices.length > 4 || ( widths && widths.length > 4 ) || ( slashCount === 1 && widths.length < 1 ) || ( outsets && outsets.length > 4 ) || ( slashCount === 2 && outsets.length < 1 ) ) { return null; } // Fill in missing values if( !p.repeat ) { p.repeat = { h: 'stretch' }; } if( !p.repeat.v ) { p.repeat.v = p.repeat.h; } function distributeSides( tokens, convertFn ) { return { 't': convertFn( tokens[0] ), 'r': convertFn( tokens[1] || tokens[0] ), 'b': convertFn( tokens[2] || tokens[0] ), 'l': convertFn( tokens[3] || tokens[1] || tokens[0] ) }; } p.slice = distributeSides( slices, function( tok ) { return PIE.getLength( ( tok.tokenType & NUMBER ) ? tok.tokenValue + 'px' : tok.tokenValue ); } ); if( widths && widths[0] ) { p.widths = distributeSides( widths, function( tok ) { return tok.isLengthOrPercent() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue; } ); } if( outsets && outsets[0] ) { p.outset = distributeSides( outsets, function( tok ) { return tok.isLength() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue; } ); } } return p; } } );/** * Handles parsing, caching, and detecting changes to padding CSS * @constructor * @param {Element} el the target element */ PIE.PaddingStyleInfo = PIE.StyleInfoBase.newStyleInfo( { parseCss: function( css ) { var tokenizer = new PIE.Tokenizer( css ), arr = [], token; while( ( token = tokenizer.next() ) && token.isLengthOrPercent() ) { arr.push( PIE.getLength( token.tokenValue ) ); } return arr.length > 0 && arr.length < 5 ? { 't': arr[0], 'r': arr[1] || arr[0], 'b': arr[2] || arr[0], 'l': arr[3] || arr[1] || arr[0] } : null; }, getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { var el = this.targetElement, rs = el.runtimeStyle, rsPadding = rs.padding, padding; if( rsPadding ) rs.padding = ''; padding = el.currentStyle.padding; if( rsPadding ) rs.padding = rsPadding; return padding; } ) } ); PIE.RendererBase = { /** * Create a new Renderer class, with the standard constructor, and augmented by * the RendererBase's members. * @param proto */ newRenderer: function( proto ) { function Renderer( el, boundsInfo, styleInfos, parent ) { this.targetElement = el; this.boundsInfo = boundsInfo; this.styleInfos = styleInfos; this.parent = parent; } PIE.merge( Renderer.prototype, PIE.RendererBase, proto ); return Renderer; }, /** * Determine if the renderer needs to be updated * @return {boolean} */ needsUpdate: function() { return false; }, /** * Run any preparation logic that would affect the main update logic of this * renderer or any of the other renderers, e.g. things that might affect the * element's size or style properties. */ prepareUpdate: PIE.emptyFn, /** * Tell the renderer to update based on modified properties or element dimensions */ updateRendering: function() { if( this.isActive() ) { this.draw(); } else { this.destroy(); } }, /** * Hide the target element's border */ hideBorder: function() { this.targetElement.runtimeStyle.borderColor = 'transparent'; }, /** * Destroy the rendered objects. This is a base implementation which handles common renderer * structures, but individual renderers may override as necessary. */ destroy: function() { } }; /** * Root renderer for IE9; manages the rendering layers in the element's background * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects */ PIE.IE9RootRenderer = PIE.RendererBase.newRenderer( { outerCommasRE: /^,+|,+$/g, innerCommasRE: /,+/g, setBackgroundLayer: function(zIndex, bg) { var me = this, bgLayers = me._bgLayers || ( me._bgLayers = [] ), undef; bgLayers[zIndex] = bg || undef; }, updateRendering: function() { var me = this, bgLayers = me._bgLayers, bg; if( bgLayers && ( bg = bgLayers.join( ',' ).replace( me.outerCommasRE, '' ).replace( me.innerCommasRE, ',' ) ) !== me._lastBg ) { me._lastBg = me.targetElement.runtimeStyle.background = bg; } }, destroy: function() { this.targetElement.runtimeStyle.background = ''; delete this._bgLayers; } } ); /** * Renderer for element backgrounds, specific for IE9. Only handles translating CSS3 gradients * to an equivalent SVG data URI. * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects */ PIE.IE9BackgroundRenderer = PIE.RendererBase.newRenderer( { drawingCanvas: doc.createElement( 'canvas' ), bgLayerZIndex: 1, needsUpdate: function() { var si = this.styleInfos; return si.backgroundInfo.changed(); }, isActive: function() { var si = this.styleInfos; return si.backgroundInfo.isActive() || si.borderImageInfo.isActive(); }, draw: function() { var me = this, styleInfos = me.styleInfos, bgInfo = styleInfos.backgroundInfo, props = bgInfo.getProps(), bg, images, i = 0, img, bgAreaSize, bgSize; if ( props ) { bg = []; images = props.bgImages; if ( images ) { while( img = images[ i++ ] ) { if (img.imgType === 'linear-gradient' ) { bgAreaSize = bgInfo.getBgAreaSize( bg.bgOrigin, me.boundsInfo, styleInfos.borderInfo, styleInfos.paddingInfo ); bgSize = ( img.bgSize || PIE.BgSize.DEFAULT ).pixels( me.targetElement, bgAreaSize.w, bgAreaSize.h, bgAreaSize.w, bgAreaSize.h ); bg.push( 'url(' + me.getGradientImgData( img, bgSize.w, bgSize.h ) + ') ' + me.bgPositionToString( img.bgPosition ) + ' / ' + bgSize.w + 'px ' + bgSize.h + 'px ' + ( img.bgAttachment || '' ) + ' ' + ( img.bgOrigin || '' ) + ' ' + ( img.bgClip || '' ) ); } else { bg.push( img.origString ); } } } if ( props.color ) { bg.push( props.color.val + ' ' + ( props.colorClip || '' ) ); } me.parent.setBackgroundLayer(me.bgLayerZIndex, bg.join(',')); } }, bgPositionToString: function( bgPosition ) { return bgPosition ? bgPosition.tokens.map(function(token) { return token.tokenValue; }).join(' ') : '0 0'; }, getGradientImgData: function( info, bgWidth, bgHeight ) { var me = this, el = me.targetElement, stopsInfo = info.stops, stopCount = stopsInfo.length, metrics = PIE.GradientUtil.getGradientMetrics( el, bgWidth, bgHeight, info ), lineLength = metrics.lineLength, canvas = me.drawingCanvas, context = canvas.getContext( '2d' ), gradient = context.createLinearGradient( metrics.startX, metrics.startY, metrics.endX, metrics.endY ), stopPx = [], i, j, before, after; // Find the pixel offsets along the CSS3 gradient-line for each stop. for( i = 0; i < stopCount; i++ ) { stopPx.push( stopsInfo[i].offset ? stopsInfo[i].offset.pixels( el, lineLength ) : i === 0 ? 0 : i === stopCount - 1 ? lineLength : null ); } // Fill in gaps with evenly-spaced offsets for( i = 1; i < stopCount; i++ ) { if( stopPx[ i ] === null ) { before = stopPx[ i - 1 ]; j = i; do { after = stopPx[ ++j ]; } while( after === null ); stopPx[ i ] = before + ( after - before ) / ( j - i + 1 ); } } // Convert stops to percentages along the gradient line and add a stop for each for( i = 0; i < stopCount; i++ ) { gradient.addColorStop( stopPx[ i ] / lineLength, stopsInfo[ i ].color.val ); } canvas.width = bgWidth; canvas.height = bgHeight; context.fillStyle = gradient; context.fillRect( 0, 0, bgWidth, bgHeight ); return canvas.toDataURL(); }, destroy: function() { this.parent.setBackgroundLayer( this.bgLayerZIndex ); } } ); /** * Renderer for border-image * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.IE9BorderImageRenderer = PIE.RendererBase.newRenderer( { REPEAT: 'repeat', STRETCH: 'stretch', ROUND: 'round', bgLayerZIndex: 0, needsUpdate: function() { return this.styleInfos.borderImageInfo.changed(); }, isActive: function() { return this.styleInfos.borderImageInfo.isActive(); }, draw: function() { var me = this, props = me.styleInfos.borderImageInfo.getProps(), borderProps = me.styleInfos.borderInfo.getProps(), bounds = me.boundsInfo.getBounds(), repeat = props.repeat, repeatH = repeat.h, repeatV = repeat.v, el = me.targetElement, isAsync = 0; PIE.Util.withImageSize( props.src, function( imgSize ) { var elW = bounds.w, elH = bounds.h, imgW = imgSize.w, imgH = imgSize.h, // The image cannot be referenced as a URL directly in the SVG because IE9 throws a strange // security exception (perhaps due to cross-origin policy within data URIs?) Therefore we // work around this by converting the image data into a data URI itself using a transient // canvas. This unfortunately requires the border-image src to be within the same domain, // which isn't a limitation in true border-image, so we need to try and find a better fix. imgSrc = me.imageToDataURI( props.src, imgW, imgH ), REPEAT = me.REPEAT, STRETCH = me.STRETCH, ROUND = me.ROUND, ceil = Math.ceil, zero = PIE.getLength( '0' ), widths = props.widths || ( borderProps ? borderProps.widths : { 't': zero, 'r': zero, 'b': zero, 'l': zero } ), widthT = widths['t'].pixels( el ), widthR = widths['r'].pixels( el ), widthB = widths['b'].pixels( el ), widthL = widths['l'].pixels( el ), slices = props.slice, sliceT = slices['t'].pixels( el ), sliceR = slices['r'].pixels( el ), sliceB = slices['b'].pixels( el ), sliceL = slices['l'].pixels( el ), centerW = elW - widthL - widthR, middleH = elH - widthT - widthB, imgCenterW = imgW - sliceL - sliceR, imgMiddleH = imgH - sliceT - sliceB, // Determine the size of each tile - 'round' is handled below tileSizeT = repeatH === STRETCH ? centerW : imgCenterW * widthT / sliceT, tileSizeR = repeatV === STRETCH ? middleH : imgMiddleH * widthR / sliceR, tileSizeB = repeatH === STRETCH ? centerW : imgCenterW * widthB / sliceB, tileSizeL = repeatV === STRETCH ? middleH : imgMiddleH * widthL / sliceL, svg, patterns = [], rects = [], i = 0; // For 'round', subtract from each tile's size enough so that they fill the space a whole number of times if (repeatH === ROUND) { tileSizeT -= (tileSizeT - (centerW % tileSizeT || tileSizeT)) / ceil(centerW / tileSizeT); tileSizeB -= (tileSizeB - (centerW % tileSizeB || tileSizeB)) / ceil(centerW / tileSizeB); } if (repeatV === ROUND) { tileSizeR -= (tileSizeR - (middleH % tileSizeR || tileSizeR)) / ceil(middleH / tileSizeR); tileSizeL -= (tileSizeL - (middleH % tileSizeL || tileSizeL)) / ceil(middleH / tileSizeL); } // Build the SVG for the border-image rendering. Add each piece as a pattern, which is then stretched // or repeated as the fill of a rect of appropriate size. svg = [ '<svg width="' + elW + '" height="' + elH + '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' ]; function addImage( x, y, w, h, cropX, cropY, cropW, cropH, tileW, tileH ) { patterns.push( '<pattern patternUnits="userSpaceOnUse" id="pattern' + i + '" ' + 'x="' + (repeatH === REPEAT ? x + w / 2 - tileW / 2 : x) + '" ' + 'y="' + (repeatV === REPEAT ? y + h / 2 - tileH / 2 : y) + '" ' + 'width="' + tileW + '" height="' + tileH + '">' + '<svg width="' + tileW + '" height="' + tileH + '" viewBox="' + cropX + ' ' + cropY + ' ' + cropW + ' ' + cropH + '" preserveAspectRatio="none">' + '<image xlink:href="' + imgSrc + '" x="0" y="0" width="' + imgW + '" height="' + imgH + '" />' + '</svg>' + '</pattern>' ); rects.push( '<rect x="' + x + '" y="' + y + '" width="' + w + '" height="' + h + '" fill="url(#pattern' + i + ')" />' ); i++; } addImage( 0, 0, widthL, widthT, 0, 0, sliceL, sliceT, widthL, widthT ); // top left addImage( widthL, 0, centerW, widthT, sliceL, 0, imgCenterW, sliceT, tileSizeT, widthT ); // top center addImage( elW - widthR, 0, widthR, widthT, imgW - sliceR, 0, sliceR, sliceT, widthR, widthT ); // top right addImage( 0, widthT, widthL, middleH, 0, sliceT, sliceL, imgMiddleH, widthL, tileSizeL ); // middle left if ( props.fill ) { // center fill addImage( widthL, widthT, centerW, middleH, sliceL, sliceT, imgCenterW, imgMiddleH, tileSizeT || tileSizeB || imgCenterW, tileSizeL || tileSizeR || imgMiddleH ); } addImage( elW - widthR, widthT, widthR, middleH, imgW - sliceR, sliceT, sliceR, imgMiddleH, widthR, tileSizeR ); // middle right addImage( 0, elH - widthB, widthL, widthB, 0, imgH - sliceB, sliceL, sliceB, widthL, widthB ); // bottom left addImage( widthL, elH - widthB, centerW, widthB, sliceL, imgH - sliceB, imgCenterW, sliceB, tileSizeB, widthB ); // bottom center addImage( elW - widthR, elH - widthB, widthR, widthB, imgW - sliceR, imgH - sliceB, sliceR, sliceB, widthR, widthB ); // bottom right svg.push( '<defs>' + patterns.join('\n') + '</defs>' + rects.join('\n') + '</svg>' ); me.parent.setBackgroundLayer( me.bgLayerZIndex, 'url(data:image/svg+xml,' + escape( svg.join( '' ) ) + ') no-repeat border-box border-box' ); // If the border-image's src wasn't immediately available, the SVG for its background layer // will have been created asynchronously after the main element's update has finished; we'll // therefore need to force the root renderer to sync to the final background once finished. if( isAsync ) { me.parent.updateRendering(); } }, me ); isAsync = 1; }, /** * Convert a given image to a data URI */ imageToDataURI: (function() { var uris = {}; return function( src, width, height ) { var uri = uris[ src ], image, canvas; if ( !uri ) { image = new Image(); canvas = doc.createElement( 'canvas' ); image.src = src; canvas.width = width; canvas.height = height; canvas.getContext( '2d' ).drawImage( image, 0, 0 ); uri = uris[ src ] = canvas.toDataURL(); } return uri; } })(), prepareUpdate: function() { if (this.isActive()) { var me = this, el = me.targetElement, rs = el.runtimeStyle, widths = me.styleInfos.borderImageInfo.getProps().widths; // Force border-style to solid so it doesn't collapse rs.borderStyle = 'solid'; // If widths specified in border-image shorthand, override border-width if ( widths ) { rs.borderTopWidth = widths['t'].pixels( el ) + 'px'; rs.borderRightWidth = widths['r'].pixels( el ) + 'px'; rs.borderBottomWidth = widths['b'].pixels( el ) + 'px'; rs.borderLeftWidth = widths['l'].pixels( el ) + 'px'; } // Make the border transparent me.hideBorder(); } }, destroy: function() { var me = this, rs = me.targetElement.runtimeStyle; me.parent.setBackgroundLayer( me.bgLayerZIndex ); rs.borderColor = rs.borderStyle = rs.borderWidth = ''; } } ); PIE.Element = (function() { var wrappers = {}, lazyInitCssProp = PIE.CSS_PREFIX + 'lazy-init', pollCssProp = PIE.CSS_PREFIX + 'poll', trackActiveCssProp = PIE.CSS_PREFIX + 'track-active', trackHoverCssProp = PIE.CSS_PREFIX + 'track-hover', hoverClass = PIE.CLASS_PREFIX + 'hover', activeClass = PIE.CLASS_PREFIX + 'active', focusClass = PIE.CLASS_PREFIX + 'focus', firstChildClass = PIE.CLASS_PREFIX + 'first-child', ignorePropertyNames = { 'background':1, 'bgColor':1, 'display': 1 }, classNameRegExes = {}, dummyArray = []; function addClass( el, className ) { el.className += ' ' + className; } function removeClass( el, className ) { var re = classNameRegExes[ className ] || ( classNameRegExes[ className ] = new RegExp( '\\b' + className + '\\b', 'g' ) ); el.className = el.className.replace( re, '' ); } function delayAddClass( el, className /*, className2*/ ) { var classes = dummyArray.slice.call( arguments, 1 ), i = classes.length; setTimeout( function() { if( el ) { while( i-- ) { addClass( el, classes[ i ] ); } } }, 0 ); } function delayRemoveClass( el, className /*, className2*/ ) { var classes = dummyArray.slice.call( arguments, 1 ), i = classes.length; setTimeout( function() { if( el ) { while( i-- ) { removeClass( el, classes[ i ] ); } } }, 0 ); } function Element( el ) { var me = this, childRenderers, rootRenderer, boundsInfo = new PIE.BoundsInfo( el ), styleInfos, styleInfosArr, initializing, initialized, eventsAttached, eventListeners = [], delayed, destroyed, poll; me.el = el; /** * Initialize PIE for this element. */ function init() { if( !initialized ) { var docEl, bounds, ieDocMode = PIE.ieDocMode, cs = el.currentStyle, lazy = cs.getAttribute( lazyInitCssProp ) === 'true', trackActive = cs.getAttribute( trackActiveCssProp ) !== 'false', trackHover = cs.getAttribute( trackHoverCssProp ) !== 'false'; // Polling for size/position changes: default to on in IE8, off otherwise, overridable by -pie-poll poll = cs.getAttribute( pollCssProp ); poll = ieDocMode > 7 ? poll !== 'false' : poll === 'true'; // Force layout so move/resize events will fire. Set this as soon as possible to avoid layout changes // after load, but make sure it only gets called the first time through to avoid recursive calls to init(). if( !initializing ) { initializing = 1; el.runtimeStyle.zoom = 1; initFirstChildPseudoClass(); } boundsInfo.lock(); // If the -pie-lazy-init:true flag is set, check if the element is outside the viewport and if so, delay initialization if( lazy && ( bounds = boundsInfo.getBounds() ) && ( docEl = doc.documentElement || doc.body ) && ( bounds.y > docEl.clientHeight || bounds.x > docEl.clientWidth || bounds.y + bounds.h < 0 || bounds.x + bounds.w < 0 ) ) { if( !delayed ) { delayed = 1; PIE.OnScroll.observe( init ); } } else { initialized = 1; delayed = initializing = 0; PIE.OnScroll.unobserve( init ); // Create the style infos and renderers if ( ieDocMode === 9 ) { styleInfos = { backgroundInfo: new PIE.BackgroundStyleInfo( el ), borderImageInfo: new PIE.BorderImageStyleInfo( el ), borderInfo: new PIE.BorderStyleInfo( el ), paddingInfo: new PIE.PaddingStyleInfo( el ) }; styleInfosArr = [ styleInfos.backgroundInfo, styleInfos.borderInfo, styleInfos.borderImageInfo, styleInfos.paddingInfo ]; rootRenderer = new PIE.IE9RootRenderer( el, boundsInfo, styleInfos ); childRenderers = [ new PIE.IE9BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.IE9BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer ) ]; } else { styleInfos = { backgroundInfo: new PIE.BackgroundStyleInfo( el ), borderInfo: new PIE.BorderStyleInfo( el ), borderImageInfo: new PIE.BorderImageStyleInfo( el ), borderRadiusInfo: new PIE.BorderRadiusStyleInfo( el ), boxShadowInfo: new PIE.BoxShadowStyleInfo( el ), paddingInfo: new PIE.PaddingStyleInfo( el ), visibilityInfo: new PIE.VisibilityStyleInfo( el ) }; styleInfosArr = [ styleInfos.backgroundInfo, styleInfos.borderInfo, styleInfos.borderImageInfo, styleInfos.borderRadiusInfo, styleInfos.boxShadowInfo, styleInfos.paddingInfo, styleInfos.visibilityInfo ]; rootRenderer = new PIE.RootRenderer( el, boundsInfo, styleInfos ); childRenderers = [ new PIE.BoxShadowOutsetRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ), //new PIE.BoxShadowInsetRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.BorderRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer ) ]; if( el.tagName === 'IMG' ) { childRenderers.push( new PIE.ImgRenderer( el, boundsInfo, styleInfos, rootRenderer ) ); } rootRenderer.childRenderers = childRenderers; // circular reference, can't pass in constructor; TODO is there a cleaner way? } // Add property change listeners to ancestors if requested initAncestorEventListeners(); // Add to list of polled elements when -pie-poll:true if( poll ) { PIE.Heartbeat.observe( update ); PIE.Heartbeat.run(); } // Trigger rendering update( 0, 1 ); } if( !eventsAttached ) { eventsAttached = 1; if( ieDocMode < 9 ) { addListener( el, 'onmove', handleMoveOrResize ); } addListener( el, 'onresize', handleMoveOrResize ); addListener( el, 'onpropertychange', propChanged ); if( trackHover ) { addListener( el, 'onmouseenter', mouseEntered ); } if( trackHover || trackActive ) { addListener( el, 'onmouseleave', mouseLeft ); } if( trackActive ) { addListener( el, 'onmousedown', mousePressed ); } if( el.tagName in PIE.focusableElements ) { addListener( el, 'onfocus', focused ); addListener( el, 'onblur', blurred ); } PIE.OnResize.observe( handleMoveOrResize ); PIE.OnUnload.observe( removeEventListeners ); } boundsInfo.unlock(); } } /** * Event handler for onmove and onresize events. Invokes update() only if the element's * bounds have previously been calculated, to prevent multiple runs during page load when * the element has no initial CSS3 properties. */ function handleMoveOrResize() { if( boundsInfo && boundsInfo.hasBeenQueried() ) { update(); } } /** * Update position and/or size as necessary. Both move and resize events call * this rather than the updatePos/Size functions because sometimes, particularly * during page load, one will fire but the other won't. */ function update( isPropChange, force ) { if( !destroyed ) { if( initialized ) { lockAll(); var i = 0, len = childRenderers.length, sizeChanged = boundsInfo.sizeChanged(); for( ; i < len; i++ ) { childRenderers[i].prepareUpdate(); } for( i = 0; i < len; i++ ) { if( force || sizeChanged || ( isPropChange && childRenderers[i].needsUpdate() ) ) { childRenderers[i].updateRendering(); } } if( force || sizeChanged || isPropChange || boundsInfo.positionChanged() ) { rootRenderer.updateRendering(); } unlockAll(); } else if( !initializing ) { init(); } } } /** * Handle property changes to trigger update when appropriate. */ function propChanged() { // Some elements like <table> fire onpropertychange events for old-school background properties // ('background', 'bgColor') when runtimeStyle background properties are changed, which // results in an infinite loop; therefore we filter out those property names. Also, 'display' // is ignored because size calculations don't work correctly immediately when its onpropertychange // event fires, and because it will trigger an onresize event anyway. if( initialized && !( event && event.propertyName in ignorePropertyNames ) ) { update( 1 ); } } /** * Handle mouseenter events. Adds a custom class to the element to allow IE6 to add * hover styles to non-link elements, and to trigger a propertychange update. */ function mouseEntered() { //must delay this because the mouseenter event fires before the :hover styles are added. delayAddClass( el, hoverClass ); } /** * Handle mouseleave events */ function mouseLeft() { //must delay this because the mouseleave event fires before the :hover styles are removed. delayRemoveClass( el, hoverClass, activeClass ); } /** * Handle mousedown events. Adds a custom class to the element to allow IE6 to add * active styles to non-link elements, and to trigger a propertychange update. */ function mousePressed() { //must delay this because the mousedown event fires before the :active styles are added. delayAddClass( el, activeClass ); // listen for mouseups on the document; can't just be on the element because the user might // have dragged out of the element while the mouse button was held down PIE.OnMouseup.observe( mouseReleased ); } /** * Handle mouseup events */ function mouseReleased() { //must delay this because the mouseup event fires before the :active styles are removed. delayRemoveClass( el, activeClass ); PIE.OnMouseup.unobserve( mouseReleased ); } /** * Handle focus events. Adds a custom class to the element to trigger a propertychange update. */ function focused() { //must delay this because the focus event fires before the :focus styles are added. delayAddClass( el, focusClass ); } /** * Handle blur events */ function blurred() { //must delay this because the blur event fires before the :focus styles are removed. delayRemoveClass( el, focusClass ); } /** * Handle property changes on ancestors of the element; see initAncestorEventListeners() * which adds these listeners as requested with the -pie-watch-ancestors CSS property. */ function ancestorPropChanged() { var name = event.propertyName; if( name === 'className' || name === 'id' || name.indexOf( 'style.' ) === 0 ) { propChanged(); } } function lockAll() { boundsInfo.lock(); for( var i = styleInfosArr.length; i--; ) { styleInfosArr[i].lock(); } } function unlockAll() { for( var i = styleInfosArr.length; i--; ) { styleInfosArr[i].unlock(); } boundsInfo.unlock(); } function addListener( targetEl, type, handler ) { targetEl.attachEvent( type, handler ); eventListeners.push( [ targetEl, type, handler ] ); } /** * Remove all event listeners from the element and any monitored ancestors. */ function removeEventListeners() { if (eventsAttached) { var i = eventListeners.length, listener; while( i-- ) { listener = eventListeners[ i ]; listener[ 0 ].detachEvent( listener[ 1 ], listener[ 2 ] ); } PIE.OnUnload.unobserve( removeEventListeners ); eventsAttached = 0; eventListeners = []; } } /** * Clean everything up when the behavior is removed from the element, or the element * is manually destroyed. */ function destroy() { if( !destroyed ) { var i, len; removeEventListeners(); destroyed = 1; // destroy any active renderers if( childRenderers ) { for( i = 0, len = childRenderers.length; i < len; i++ ) { childRenderers[i].finalized = 1; childRenderers[i].destroy(); } } rootRenderer.destroy(); // Remove from list of polled elements in IE8 if( poll ) { PIE.Heartbeat.unobserve( update ); } // Stop onresize listening PIE.OnResize.unobserve( update ); // Kill references childRenderers = rootRenderer = boundsInfo = styleInfos = styleInfosArr = el = null; me.el = me = 0; } } /** * If requested via the custom -pie-watch-ancestors CSS property, add onpropertychange and * other event listeners to ancestor(s) of the element so we can pick up style changes * based on CSS rules using descendant selectors. */ function initAncestorEventListeners() { var watch = el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'watch-ancestors' ), i, a; if( watch ) { watch = parseInt( watch, 10 ); i = 0; a = el.parentNode; while( a && ( watch === 'NaN' || i++ < watch ) ) { addListener( a, 'onpropertychange', ancestorPropChanged ); addListener( a, 'onmouseenter', mouseEntered ); addListener( a, 'onmouseleave', mouseLeft ); addListener( a, 'onmousedown', mousePressed ); if( a.tagName in PIE.focusableElements ) { addListener( a, 'onfocus', focused ); addListener( a, 'onblur', blurred ); } a = a.parentNode; } } } /** * If the target element is a first child, add a pie_first-child class to it. This allows using * the added class as a workaround for the fact that PIE's rendering element breaks the :first-child * pseudo-class selector. */ function initFirstChildPseudoClass() { var tmpEl = el, isFirst = 1; while( tmpEl = tmpEl.previousSibling ) { if( tmpEl.nodeType === 1 ) { isFirst = 0; break; } } if( isFirst ) { addClass( el, firstChildClass ); } } // These methods are all already bound to this instance so there's no need to wrap them // in a closure to maintain the 'this' scope object when calling them. me.init = init; me.destroy = destroy; } Element.getInstance = function( el ) { var id = el[ 'uniqueID' ]; return wrappers[ id ] || ( wrappers[ id ] = new Element( el ) ); }; Element.destroy = function( el ) { var id = el[ 'uniqueID' ], wrapper = wrappers[ id ]; if( wrapper ) { wrapper.destroy(); delete wrappers[ id ]; } }; Element.destroyAll = function() { var els = [], wrapper; if( wrappers ) { for( var w in wrappers ) { if( wrappers.hasOwnProperty( w ) ) { wrapper = wrappers[ w ]; els.push( wrapper.el ); wrapper.destroy(); } } wrappers = {}; } return els; }; return Element; })(); /* * This file exposes the public API for invoking PIE. */ /** * The version number of this PIE build. */ PIE[ 'version' ] = '2.0beta1'; /** * @property supportsVML * True if the current IE browser environment has a functioning VML engine. Should be true * in most IEs, but in rare cases may be false. If false, PIE will exit immediately when * attached to an element (for IE<9) to prevent errors; this property may also be used for * debugging or by external scripts to perform some special action when VML support is absent. * @type {boolean} */ PIE[ 'supportsVML' ] = PIE.supportsVML; /** * Programatically attach PIE to a single element. * @param {Element} el */ PIE[ 'attach' ] = function( el ) { if ( PIE.ieDocMode === 9 || ( PIE.ieDocMode < 9 && PIE.supportsVML ) ) { PIE.Element.getInstance( el ).init(); } }; /** * Programatically detach PIE from a single element. * @param {Element} el */ PIE[ 'detach' ] = function( el ) { PIE.Element.destroy( el ); }; })( window, document );
0x6a
trunk/libraries/css/pie-2.0/PIE_IE9_uncompressed.js
JavaScript
asf20
111,581
/* PIE: CSS3 rendering for IE Version 2.0beta1 http://css3pie.com Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2. */ (function( win, doc ) { var PIE = win[ 'PIE' ] || ( win[ 'PIE' ] = {} ); /** * Simple utility for merging objects * @param {Object} obj1 The main object into which all others will be merged * @param {...Object} var_args Other objects which will be merged into the first, in order */ PIE.merge = function( obj1 ) { var i, len, p, objN, args = arguments; for( i = 1, len = args.length; i < len; i++ ) { objN = args[i]; for( p in objN ) { if( objN.hasOwnProperty( p ) ) { obj1[ p ] = objN[ p ]; } } } return obj1; }; PIE.merge(PIE, { // Constants CSS_PREFIX: '-pie-', STYLE_PREFIX: 'Pie', CLASS_PREFIX: 'pie_', tableCellTags: { 'TD': 1, 'TH': 1 }, /** * Lookup table of elements which cannot take custom children. */ childlessElements: { 'TABLE':1, 'THEAD':1, 'TBODY':1, 'TFOOT':1, 'TR':1, 'INPUT':1, 'TEXTAREA':1, 'SELECT':1, 'OPTION':1, 'IMG':1, 'HR':1 }, /** * Elements that can receive user focus */ focusableElements: { 'A':1, 'INPUT':1, 'TEXTAREA':1, 'SELECT':1, 'BUTTON':1 }, /** * Values of the type attribute for input elements displayed as buttons */ inputButtonTypes: { 'submit':1, 'button':1, 'reset':1 }, emptyFn: function() {} }); // Force the background cache to be used. No reason it shouldn't be. try { doc.execCommand( 'BackgroundImageCache', false, true ); } catch(e) {} (function() { /* * IE version detection approach by James Padolsey, with modifications -- from * http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/ */ var ieVersion = 4, div = doc.createElement('div'), all = div.getElementsByTagName('i'), shape; while ( div.innerHTML = '<!--[if gt IE ' + (++ieVersion) + ']><i></i><![endif]-->', all[0] ) {} PIE.ieVersion = ieVersion; // Detect IE6 if( ieVersion === 6 ) { // IE6 can't access properties with leading dash, but can without it. PIE.CSS_PREFIX = PIE.CSS_PREFIX.replace( /^-/, '' ); } PIE.ieDocMode = doc.documentMode || PIE.ieVersion; // Detect VML support (a small number of IE installs don't have a working VML engine) div.innerHTML = '<v:shape adj="1"/>'; shape = div.firstChild; shape.style['behavior'] = 'url(#default#VML)'; PIE.supportsVML = (typeof shape['adj'] === "object"); })(); /** * Utility functions */ (function() { var idNum = 0, imageSizes = {}; PIE.Util = { /** * Generate and return a unique ID for a given object. The generated ID is stored * as a property of the object for future reuse. For DOM Elements, don't use this * but use the IE-native uniqueID property instead. * @param {Object} obj */ getUID: function( obj ) { return obj && obj[ '_pieId' ] || ( obj[ '_pieId' ] = '_' + idNum++ ); }, /** * Execute a callback function, passing it the dimensions of a given image once * they are known. * @param {string} src The source URL of the image * @param {function({w:number, h:number})} func The callback function to be called once the image dimensions are known * @param {Object} ctx A context object which will be used as the 'this' value within the executed callback function */ withImageSize: function( src, func, ctx ) { var size = imageSizes[ src ], img, queue; if( size ) { // If we have a queue, add to it if( Object.prototype.toString.call( size ) === '[object Array]' ) { size.push( [ func, ctx ] ); } // Already have the size cached, call func right away else { func.call( ctx, size ); } } else { queue = imageSizes[ src ] = [ [ func, ctx ] ]; //create queue img = new Image(); img.onload = function() { size = imageSizes[ src ] = { w: img.width, h: img.height }; for( var i = 0, len = queue.length; i < len; i++ ) { queue[ i ][ 0 ].call( queue[ i ][ 1 ], size ); } img.onload = null; }; img.src = src; } } }; })();/** * Utility functions for handling gradients */ PIE.GradientUtil = { toSideAngles: { 'top': 0, 'right': 90, 'bottom': 180, 'left': 270 }, getGradientMetrics: function( el, width, height, gradientInfo ) { var angle = gradientInfo.angle, toPos = gradientInfo.gradientTo, dX, dY, endPoint, startX, startY, endX, endY; // If an angle was specified, just use it if (angle) { angle = angle.degrees(); } // If a to-position was specified, find the appropriate angle for it else if (toPos) { // To a corner; find the adjacent corners and use the angle perpendicular to them if (toPos[1]) { dX = ( toPos[0] == 'top' || toPos[1] == 'top' ) ? width : -width; dY = ( toPos[0] == 'left' || toPos[1] == 'left' ) ? -height : height; angle = Math.atan2(dY, dX) * 180 / Math.PI; } // To a side; map to a vertical/horizontal angle else { angle = this.toSideAngles[toPos[0]]; } } // Neither specified; default is top to bottom else { angle = 180; } // Normalize the angle to a value between [0, 360) while( angle < 0 ) { angle += 360; } angle = angle % 360; // Find the end point of the gradient line, extending the angle from the center point // to where it intersects the perpendicular line passing through the nearest corner. endPoint = PIE.GradientUtil.perpendicularIntersect(width / 2, height / 2, angle, ( angle >= 180 ? 0 : width ), ( angle < 90 || angle > 270 ? 0 : height ) ); endX = endPoint[0]; endY = endPoint[1]; startX = width - endX; startY = height - endY; return { angle: angle, endX: endX, endY: endY, startX: startX, startY: startY, lineLength: PIE.GradientUtil.distance( startX, startY, endX, endY ) }; }, /** * Find the point along a given line (defined by a starting point and an angle), at which * that line is intersected by a perpendicular line extending through another point. * @param x1 - x coord of the starting point * @param y1 - y coord of the starting point * @param angle - angle of the line extending from the starting point (in degrees) * @param x2 - x coord of point along the perpendicular line * @param y2 - y coord of point along the perpendicular line * @return [ x, y ] */ perpendicularIntersect: function( x1, y1, angle, x2, y2 ) { // Handle straight vertical and horizontal angles, for performance and to avoid // divide-by-zero errors. if( angle === 0 || angle === 180 ) { return [ x1, y2 ]; } else if( angle === 90 || angle === 270 ) { return [ x2, y1 ]; } else { // General approach: determine the Ax+By=C formula for each line (the slope of the second // line is the negative inverse of the first) and then solve for where both formulas have // the same x/y values. var a1 = Math.tan( ( angle - 90 ) * Math.PI / 180 ), c1 = a1 * x1 - y1, a2 = -1 / a1, c2 = a2 * x2 - y2, d = a2 - a1, endX = ( c2 - c1 ) / d, endY = ( a1 * c2 - a2 * c1 ) / d; return [ endX, endY ]; } }, /** * Find the distance between two points * @param {Number} p1x * @param {Number} p1y * @param {Number} p2x * @param {Number} p2y * @return {Number} the distance */ distance: function( p1x, p1y, p2x, p2y ) { var dx = p2x - p1x, dy = p2y - p1y; return Math.abs( dx === 0 ? dy : dy === 0 ? dx : Math.sqrt( dx * dx + dy * dy ) ); } };/** * */ PIE.Observable = function() { /** * List of registered observer functions */ this.observers = []; /** * Hash of function ids to their position in the observers list, for fast lookup */ this.indexes = {}; }; PIE.Observable.prototype = { observe: function( fn ) { var id = PIE.Util.getUID( fn ), indexes = this.indexes, observers = this.observers; if( !( id in indexes ) ) { indexes[ id ] = observers.length; observers.push( fn ); } }, unobserve: function( fn ) { var id = PIE.Util.getUID( fn ), indexes = this.indexes; if( id && id in indexes ) { delete this.observers[ indexes[ id ] ]; delete indexes[ id ]; } }, fire: function() { var o = this.observers, i = o.length; while( i-- ) { o[ i ] && o[ i ](); } } };/* * Simple heartbeat timer - this is a brute-force workaround for syncing issues caused by IE not * always firing the onmove and onresize events when elements are moved or resized. We check a few * times every second to make sure the elements have the correct position and size. See Element.js * which adds heartbeat listeners based on the custom -pie-poll flag, which defaults to true in IE8-9 * and false elsewhere. */ PIE.Heartbeat = new PIE.Observable(); PIE.Heartbeat.run = function() { var me = this, interval; if( !me.running ) { interval = doc.documentElement.currentStyle.getAttribute( PIE.CSS_PREFIX + 'poll-interval' ) || 250; (function beat() { me.fire(); setTimeout(beat, interval); })(); me.running = 1; } }; /** * Create an observable listener for the onunload event */ (function() { PIE.OnUnload = new PIE.Observable(); function handleUnload() { PIE.OnUnload.fire(); win.detachEvent( 'onunload', handleUnload ); win[ 'PIE' ] = null; } win.attachEvent( 'onunload', handleUnload ); /** * Attach an event which automatically gets detached onunload */ PIE.OnUnload.attachManagedEvent = function( target, name, handler ) { target.attachEvent( name, handler ); this.observe( function() { target.detachEvent( name, handler ); } ); }; })()/** * Create a single observable listener for window resize events. */ PIE.OnResize = new PIE.Observable(); PIE.OnUnload.attachManagedEvent( win, 'onresize', function() { PIE.OnResize.fire(); } ); /** * Create a single observable listener for scroll events. Used for lazy loading based * on the viewport, and for fixed position backgrounds. */ (function() { PIE.OnScroll = new PIE.Observable(); function scrolled() { PIE.OnScroll.fire(); } PIE.OnUnload.attachManagedEvent( win, 'onscroll', scrolled ); PIE.OnResize.observe( scrolled ); })(); /** * Listen for printing events, destroy all active PIE instances when printing, and * restore them afterward. */ (function() { var elements; function beforePrint() { elements = PIE.Element.destroyAll(); } function afterPrint() { if( elements ) { for( var i = 0, len = elements.length; i < len; i++ ) { PIE[ 'attach' ]( elements[i] ); } elements = 0; } } PIE.OnUnload.attachManagedEvent( win, 'onbeforeprint', beforePrint ); PIE.OnUnload.attachManagedEvent( win, 'onafterprint', afterPrint ); })();/** * Create a single observable listener for document mouseup events. */ PIE.OnMouseup = new PIE.Observable(); PIE.OnUnload.attachManagedEvent( doc, 'onmouseup', function() { PIE.OnMouseup.fire(); } ); /** * Wrapper for length and percentage style values. The value is immutable. A singleton instance per unique * value is returned from PIE.getLength() - always use that instead of instantiating directly. * @constructor * @param {string} val The CSS string representing the length. It is assumed that this will already have * been validated as a valid length or percentage syntax. */ PIE.Length = (function() { var lengthCalcEl = doc.createElement( 'length-calc' ), parent = doc.body || doc.documentElement, s = lengthCalcEl.style, conversions = {}, units = [ 'mm', 'cm', 'in', 'pt', 'pc' ], i = units.length, instances = {}; s.position = 'absolute'; s.top = s.left = '-9999px'; parent.appendChild( lengthCalcEl ); while( i-- ) { s.width = '100' + units[i]; conversions[ units[i] ] = lengthCalcEl.offsetWidth / 100; } parent.removeChild( lengthCalcEl ); // All calcs from here on will use 1em s.width = '1em'; function Length( val ) { this.val = val; } Length.prototype = { /** * Regular expression for matching the length unit * @private */ unitRE: /(px|em|ex|mm|cm|in|pt|pc|%)$/, /** * Get the numeric value of the length * @return {number} The value */ getNumber: function() { var num = this.num, UNDEF; if( num === UNDEF ) { num = this.num = parseFloat( this.val ); } return num; }, /** * Get the unit of the length * @return {string} The unit */ getUnit: function() { var unit = this.unit, m; if( !unit ) { m = this.val.match( this.unitRE ); unit = this.unit = ( m && m[0] ) || 'px'; } return unit; }, /** * Determine whether this is a percentage length value * @return {boolean} */ isPercentage: function() { return this.getUnit() === '%'; }, /** * Resolve this length into a number of pixels. * @param {Element} el - the context element, used to resolve font-relative values * @param {(function():number|number)=} pct100 - the number of pixels that equal a 100% percentage. This can be either a number or a * function which will be called to return the number. */ pixels: function( el, pct100 ) { var num = this.getNumber(), unit = this.getUnit(); switch( unit ) { case "px": return num; case "%": return num * ( typeof pct100 === 'function' ? pct100() : pct100 ) / 100; case "em": return num * this.getEmPixels( el ); case "ex": return num * this.getEmPixels( el ) / 2; default: return num * conversions[ unit ]; } }, /** * The em and ex units are relative to the font-size of the current element, * however if the font-size is set using non-pixel units then we get that value * rather than a pixel conversion. To get around this, we keep a floating element * with width:1em which we insert into the target element and then read its offsetWidth. * For elements that won't accept a child we insert into the parent node and perform * additional calculation. If the font-size *is* specified in pixels, then we use that * directly to avoid the expensive DOM manipulation. * @param {Element} el * @return {number} */ getEmPixels: function( el ) { var fs = el.currentStyle.fontSize, px, parent, me; if( fs.indexOf( 'px' ) > 0 ) { return parseFloat( fs ); } else if( el.tagName in PIE.childlessElements ) { me = this; parent = el.parentNode; return PIE.getLength( fs ).pixels( parent, function() { return me.getEmPixels( parent ); } ); } else { el.appendChild( lengthCalcEl ); px = lengthCalcEl.offsetWidth; if( lengthCalcEl.parentNode === el ) { //not sure how this could be false but it sometimes is el.removeChild( lengthCalcEl ); } return px; } } }; /** * Convert a pixel length into a point length */ Length.pxToPt = function( px ) { return px / conversions[ 'pt' ]; }; /** * Retrieve a PIE.Length instance for the given value. A shared singleton instance is returned for each unique value. * @param {string} val The CSS string representing the length. It is assumed that this will already have * been validated as a valid length or percentage syntax. */ PIE.getLength = function( val ) { return instances[ val ] || ( instances[ val ] = new Length( val ) ); }; return Length; })(); /** * Wrapper for a CSS3 bg-position value. Takes up to 2 position keywords and 2 lengths/percentages. * @constructor * @param {Array.<PIE.Tokenizer.Token>} tokens The tokens making up the background position value. */ PIE.BgPosition = (function() { var length_fifty = PIE.getLength( '50%' ), vert_idents = { 'top': 1, 'center': 1, 'bottom': 1 }, horiz_idents = { 'left': 1, 'center': 1, 'right': 1 }; function BgPosition( tokens ) { this.tokens = tokens; } BgPosition.prototype = { /** * Normalize the values into the form: * [ xOffsetSide, xOffsetLength, yOffsetSide, yOffsetLength ] * where: xOffsetSide is either 'left' or 'right', * yOffsetSide is either 'top' or 'bottom', * and x/yOffsetLength are both PIE.Length objects. * @return {Array} */ getValues: function() { if( !this._values ) { var tokens = this.tokens, len = tokens.length, Tokenizer = PIE.Tokenizer, identType = Tokenizer.Type, length_zero = PIE.getLength( '0' ), type_ident = identType.IDENT, type_length = identType.LENGTH, type_percent = identType.PERCENT, type, value, vals = [ 'left', length_zero, 'top', length_zero ]; // If only one value, the second is assumed to be 'center' if( len === 1 ) { tokens.push( new Tokenizer.Token( type_ident, 'center' ) ); len++; } // Two values - CSS2 if( len === 2 ) { // If both idents, they can appear in either order, so switch them if needed if( type_ident & ( tokens[0].tokenType | tokens[1].tokenType ) && tokens[0].tokenValue in vert_idents && tokens[1].tokenValue in horiz_idents ) { tokens.push( tokens.shift() ); } if( tokens[0].tokenType & type_ident ) { if( tokens[0].tokenValue === 'center' ) { vals[1] = length_fifty; } else { vals[0] = tokens[0].tokenValue; } } else if( tokens[0].isLengthOrPercent() ) { vals[1] = PIE.getLength( tokens[0].tokenValue ); } if( tokens[1].tokenType & type_ident ) { if( tokens[1].tokenValue === 'center' ) { vals[3] = length_fifty; } else { vals[2] = tokens[1].tokenValue; } } else if( tokens[1].isLengthOrPercent() ) { vals[3] = PIE.getLength( tokens[1].tokenValue ); } } // Three or four values - CSS3 else { // TODO } this._values = vals; } return this._values; }, /** * Find the coordinates of the background image from the upper-left corner of the background area. * Note that these coordinate values are not rounded. * @param {Element} el * @param {number} width - the width for percentages (background area width minus image width) * @param {number} height - the height for percentages (background area height minus image height) * @return {Object} { x: Number, y: Number } */ coords: function( el, width, height ) { var vals = this.getValues(), pxX = vals[1].pixels( el, width ), pxY = vals[3].pixels( el, height ); return { x: vals[0] === 'right' ? width - pxX : pxX, y: vals[2] === 'bottom' ? height - pxY : pxY }; } }; return BgPosition; })(); /** * Wrapper for a CSS3 background-size value. * @constructor * @param {String|PIE.Length} w The width parameter * @param {String|PIE.Length} h The height parameter, if any */ PIE.BgSize = (function() { var CONTAIN = 'contain', COVER = 'cover', AUTO = 'auto'; function BgSize( w, h ) { this.w = w; this.h = h; } BgSize.prototype = { pixels: function( el, areaW, areaH, imgW, imgH ) { var me = this, w = me.w, h = me.h, areaRatio = areaW / areaH, imgRatio = imgW / imgH; if ( w === CONTAIN ) { w = imgRatio > areaRatio ? areaW : areaH * imgRatio; h = imgRatio > areaRatio ? areaW / imgRatio : areaH; } else if ( w === COVER ) { w = imgRatio < areaRatio ? areaW : areaH * imgRatio; h = imgRatio < areaRatio ? areaW / imgRatio : areaH; } else if ( w === AUTO ) { h = ( h === AUTO ? imgH : h.pixels( el, areaH ) ); w = h * imgRatio; } else { w = w.pixels( el, areaW ); h = ( h === AUTO ? w / imgRatio : h.pixels( el, areaH ) ); } return { w: w, h: h }; } }; BgSize.DEFAULT = new BgSize( AUTO, AUTO ); return BgSize; })(); /** * Wrapper for angle values; handles conversion to degrees from all allowed angle units * @constructor * @param {string} val The raw CSS value for the angle. It is assumed it has been pre-validated. */ PIE.Angle = (function() { function Angle( val ) { this.val = val; } Angle.prototype = { unitRE: /[a-z]+$/i, /** * @return {string} The unit of the angle value */ getUnit: function() { return this._unit || ( this._unit = this.val.match( this.unitRE )[0].toLowerCase() ); }, /** * Get the numeric value of the angle in degrees. * @return {number} The degrees value */ degrees: function() { var deg = this._deg, u, n; if( deg === undefined ) { u = this.getUnit(); n = parseFloat( this.val, 10 ); deg = this._deg = ( u === 'deg' ? n : u === 'rad' ? n / Math.PI * 180 : u === 'grad' ? n / 400 * 360 : u === 'turn' ? n * 360 : 0 ); } return deg; } }; return Angle; })();/** * Abstraction for colors values. Allows detection of rgba values. A singleton instance per unique * value is returned from PIE.getColor() - always use that instead of instantiating directly. * @constructor * @param {string} val The raw CSS string value for the color */ PIE.Color = (function() { /* * hsl2rgb from http://codingforums.com/showthread.php?t=11156 * code by Jason Karl Davis (http://www.jasonkarldavis.com) * swiped from cssSandpaper by Zoltan Hawryluk (http://www.useragentman.com/blog/csssandpaper-a-css3-javascript-library/) * modified for formatting and size optimizations */ function hsl2rgb( h, s, l ) { var m1, m2, r, g, b, round = Math.round; s /= 100; l /= 100; if ( !s ) { r = g = b = l * 255; } else { if ( l <= 0.5 ) { m2 = l * ( s + 1 ); } else { m2 = l + s - l * s; } m1 = l * 2 - m2; h = ( h % 360 ) / 360; r = hueToRgb( m1, m2, h + 1/3 ); g = hueToRgb( m1, m2, h ); b = hueToRgb( m1, m2, h - 1/3 ); } return { r: round( r ), g: round( g ), b: round( b ) }; } function hueToRgb( m1, m2, hue ) { var v; if ( hue < 0 ) { hue += 1; } else if ( hue > 1 ) { hue -= 1; } if ( 6 * hue < 1 ) { v = m1 + ( m2 - m1 ) * hue * 6; } else if ( 2 * hue < 1 ) { v = m2; } else if ( 3 * hue < 2 ) { v = m1 + ( m2 - m1 ) * ( 2/3 - hue ) * 6; } else { v = m1; } return 255 * v; } var instances = {}; function Color( val ) { this.val = val; } /** * Regular expression for matching rgba colors and extracting their components * @type {RegExp} */ Color.rgbOrRgbaRE = /\s*rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(\d+|\d*\.\d+))?\s*\)\s*/; Color.hslOrHslaRE = /\s*hsla?\(\s*(\d*\.?\d+)\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*(,\s*(\d+|\d*\.\d+))?\s*\)\s*/; /** * Hash of color keyword names to their corresponding hex values. Encoded for * small size and expanded into a hash on startup. */ Color.names = {}; var names = 'black|0|navy|3k|darkblue|b|mediumblue|1u|blue|1e|darkgreen|jk1|green|5j4|teal|3k|darkcyan|26j|deepskyblue|ad0|darkturquoise|2xe|mediumspringgreen|8nd|lime|va|springgreen|3j|aqua|3k|cyan|0|midnightblue|xunl|dodgerblue|7ogf|lightseagreen|2zsb|forestgreen|2lbs|seagreen|guut|darkslategray|12pk|limegreen|4wkj|mediumseagreen|dwlb|turquoise|5v8f|royalblue|r2p|steelblue|75qr|darkslateblue|2fh3|mediumturquoise|ta9|indigo|32d2|darkolivegreen|emr1|cadetblue|ebu9|cornflowerblue|6z4d|mediumaquamarine|3459|dimgray|3nwf|slateblue|1bok|olivedrab|1opi|slategray|6y5p|lightslategray|9vk9|mediumslateblue|5g0l|lawngreen|27ma|chartreuse|48ao|aquamarine|5w|maroon|18|purple|3k|olive|p6o|gray|3k|lightslateblue|5j7j|skyblue|4q98|lightskyblue|f|blueviolet|3bhk|darkred|15we|darkmagenta|3v|saddlebrown|djc|darkseagreen|69vg|lightgreen|1og1|mediumpurple|3ivc|darkviolet|sfv|palegreen|6zt1|darkorchid|awk|yellowgreen|292e|sienna|7r3v|brown|6sxp|darkgray|6bgf|lightblue|5vlp|greenyellow|7k9|paleturquoise|2pxb|lightsteelblue|169c|powderblue|5jc|firebrick|1rgc|darkgoldenrod|8z55|mediumorchid|2jm0|rosybrown|34jg|darkkhaki|1mfw|silver|49jp|mediumvioletred|8w5h|indianred|8tef|peru|82r|violetred|3ntd|feldspar|212d|chocolate|16eh|tan|ewe|lightgrey|1kqv|palevioletred|6h8g|metle|fnp|orchid|2dj2|goldenrod|abu|crimson|20ik|gainsboro|13mo|plum|12pt|burlywood|1j8q|lightcyan|3794|lavender|8agr|darksalmon|3rsw|violet|6wz8|palegoldenrod|k3g|lightcoral|28k6|khaki|k5o|aliceblue|3n7|honeydew|1dd|azure|f|sandybrown|5469|wheat|1q37|beige|4kp|whitesmoke|p|mintcream|1z9|ghostwhite|46bp|salmon|25bn|antiquewhite|l7p|linen|zz|lightgoldenrodyellow|1yk|oldlace|46qc|red|1gka|magenta|73|fuchsia|0|deeppink|3v8|orangered|9kd|tomato|5zb|hotpink|19p|coral|49o|darkorange|2i8|lightsalmon|41m|orange|w6|lightpink|3i9|pink|1ze|gold|4dx|peachpuff|qh|navajowhite|s4|moccasin|16w|bisque|f|mistyrose|t|blanchedalmond|1d8|papayawhip|so|lavenderblush|80|seashell|zd|cornsilk|ku|lemonchiffon|dt|floralwhite|z|snow|a|yellow|sm|lightyellow|68|ivory|g|white|f'.split('|'), i = 0, len = names.length, color = 0, hexColor; for(; i < len; i += 2) { color += parseInt(names[i + 1], 36); hexColor = color.toString(16); Color.names[names[i]] = '#000000'.slice(0, -hexColor.length) + hexColor; } Color.prototype = { /** * @private */ parse: function() { if( !this._color ) { var me = this, color = me.val, alpha, vLower, m, rgb; // RGB or RGBA colors if( m = color.match( Color.rgbOrRgbaRE ) ) { color = me.rgbToHex( +m[1], +m[2], +m[3] ); alpha = m[5] ? +m[5] : 1; } // HSL or HSLA colors else if( m = color.match( Color.hslOrHslaRE ) ) { rgb = hsl2rgb( m[1], m[2], m[3] ); color = me.rgbToHex( rgb.r, rgb.g, rgb.b ); alpha = m[5] ? +m[5] : 1; } else { if( Color.names.hasOwnProperty( vLower = color.toLowerCase() ) ) { color = Color.names[vLower]; } alpha = ( color === 'transparent' ? 0 : 1 ); } me._color = color; me._alpha = alpha; } }, /** * Converts RGB color channels to a hex value string */ rgbToHex: function( r, g, b ) { return '#' + ( r < 16 ? '0' : '' ) + r.toString( 16 ) + ( g < 16 ? '0' : '' ) + g.toString( 16 ) + ( b < 16 ? '0' : '' ) + b.toString( 16 ); }, /** * Retrieve the value of the color in a format usable by IE natively. This will be the same as * the raw input value, except for rgb(a) and hsl(a) values which will be converted to a hex value. * @param {Element} el The context element, used to get 'currentColor' keyword value. * @return {string} Color value */ colorValue: function( el ) { this.parse(); return this._color === 'currentColor' ? PIE.getColor( el.currentStyle.color ).colorValue( el ) : this._color; }, /** * Retrieve the value of the color in a normalized six-digit hex format. * @param el */ hexValue: function( el ) { var color = this.colorValue( el ); // At this point the color should be either a 3- or 6-digit hex value, or the string "transparent". function ch( i ) { return color.charAt( i ); } // Fudge transparent to black - should be ignored anyway since its alpha will be 0 if( color === 'transparent' ) { color = '#000'; } // Expand 3-digit to 6-digit hex if( ch(0) === '#' && color.length === 4 ) { color = '#' + ch(1) + ch(1) + ch(2) + ch(2) + ch(3) + ch(3); } return color; }, /** * Retrieve the alpha value of the color. Will be 1 for all values except for rgba values * with an alpha component. * @return {number} The alpha value, from 0 to 1. */ alpha: function() { this.parse(); return this._alpha; } }; /** * Retrieve a PIE.Color instance for the given value. A shared singleton instance is returned for each unique value. * @param {string} val The CSS string representing the color. It is assumed that this will already have * been validated as a valid color syntax. */ PIE.getColor = function(val) { return instances[ val ] || ( instances[ val ] = new Color( val ) ); }; return Color; })();/** * A tokenizer for CSS value strings. * @constructor * @param {string} css The CSS value string */ PIE.Tokenizer = (function() { function Tokenizer( css ) { this.css = css; this.ch = 0; this.tokens = []; this.tokenIndex = 0; } /** * Enumeration of token type constants. * @enum {number} */ var Type = Tokenizer.Type = { ANGLE: 1, CHARACTER: 2, COLOR: 4, DIMEN: 8, FUNCTION: 16, IDENT: 32, LENGTH: 64, NUMBER: 128, OPERATOR: 256, PERCENT: 512, STRING: 1024, URL: 2048 }; /** * A single token * @constructor * @param {number} type The type of the token - see PIE.Tokenizer.Type * @param {string} value The value of the token */ Tokenizer.Token = function( type, value ) { this.tokenType = type; this.tokenValue = value; }; Tokenizer.Token.prototype = { isLength: function() { return this.tokenType & Type.LENGTH || ( this.tokenType & Type.NUMBER && this.tokenValue === '0' ); }, isLengthOrPercent: function() { return this.isLength() || this.tokenType & Type.PERCENT; } }; Tokenizer.prototype = { whitespace: /\s/, number: /^[\+\-]?(\d*\.)?\d+/, url: /^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i, ident: /^\-?[_a-z][\w-]*/i, string: /^("([^"]*)"|'([^']*)')/, operator: /^[\/,]/, hash: /^#[\w]+/, hashColor: /^#([\da-f]{6}|[\da-f]{3})/i, unitTypes: { 'px': Type.LENGTH, 'em': Type.LENGTH, 'ex': Type.LENGTH, 'mm': Type.LENGTH, 'cm': Type.LENGTH, 'in': Type.LENGTH, 'pt': Type.LENGTH, 'pc': Type.LENGTH, 'deg': Type.ANGLE, 'rad': Type.ANGLE, 'grad': Type.ANGLE }, colorFunctions: { 'rgb': 1, 'rgba': 1, 'hsl': 1, 'hsla': 1 }, /** * Advance to and return the next token in the CSS string. If the end of the CSS string has * been reached, null will be returned. * @param {boolean} forget - if true, the token will not be stored for the purposes of backtracking with prev(). * @return {PIE.Tokenizer.Token} */ next: function( forget ) { var css, ch, firstChar, match, val, me = this; function newToken( type, value ) { var tok = new Tokenizer.Token( type, value ); if( !forget ) { me.tokens.push( tok ); me.tokenIndex++; } return tok; } function failure() { me.tokenIndex++; return null; } // In case we previously backed up, return the stored token in the next slot if( this.tokenIndex < this.tokens.length ) { return this.tokens[ this.tokenIndex++ ]; } // Move past leading whitespace characters while( this.whitespace.test( this.css.charAt( this.ch ) ) ) { this.ch++; } if( this.ch >= this.css.length ) { return failure(); } ch = this.ch; css = this.css.substring( this.ch ); firstChar = css.charAt( 0 ); switch( firstChar ) { case '#': if( match = css.match( this.hashColor ) ) { this.ch += match[0].length; return newToken( Type.COLOR, match[0] ); } break; case '"': case "'": if( match = css.match( this.string ) ) { this.ch += match[0].length; return newToken( Type.STRING, match[2] || match[3] || '' ); } break; case "/": case ",": this.ch++; return newToken( Type.OPERATOR, firstChar ); case 'u': if( match = css.match( this.url ) ) { this.ch += match[0].length; return newToken( Type.URL, match[2] || match[3] || match[4] || '' ); } } // Numbers and values starting with numbers if( match = css.match( this.number ) ) { val = match[0]; this.ch += val.length; // Check if it is followed by a unit if( css.charAt( val.length ) === '%' ) { this.ch++; return newToken( Type.PERCENT, val + '%' ); } if( match = css.substring( val.length ).match( this.ident ) ) { val += match[0]; this.ch += match[0].length; return newToken( this.unitTypes[ match[0].toLowerCase() ] || Type.DIMEN, val ); } // Plain ol' number return newToken( Type.NUMBER, val ); } // Identifiers if( match = css.match( this.ident ) ) { val = match[0]; this.ch += val.length; // Named colors if( val.toLowerCase() in PIE.Color.names || val === 'currentColor' || val === 'transparent' ) { return newToken( Type.COLOR, val ); } // Functions if( css.charAt( val.length ) === '(' ) { this.ch++; // Color values in function format: rgb, rgba, hsl, hsla if( val.toLowerCase() in this.colorFunctions ) { function isNum( tok ) { return tok && tok.tokenType & Type.NUMBER; } function isNumOrPct( tok ) { return tok && ( tok.tokenType & ( Type.NUMBER | Type.PERCENT ) ); } function isValue( tok, val ) { return tok && tok.tokenValue === val; } function next() { return me.next( 1 ); } if( ( val.charAt(0) === 'r' ? isNumOrPct( next() ) : isNum( next() ) ) && isValue( next(), ',' ) && isNumOrPct( next() ) && isValue( next(), ',' ) && isNumOrPct( next() ) && ( val === 'rgb' || val === 'hsa' || ( isValue( next(), ',' ) && isNum( next() ) ) ) && isValue( next(), ')' ) ) { return newToken( Type.COLOR, this.css.substring( ch, this.ch ) ); } return failure(); } return newToken( Type.FUNCTION, val ); } // Other identifier return newToken( Type.IDENT, val ); } // Standalone character this.ch++; return newToken( Type.CHARACTER, firstChar ); }, /** * Determine whether there is another token * @return {boolean} */ hasNext: function() { var next = this.next(); this.prev(); return !!next; }, /** * Back up and return the previous token * @return {PIE.Tokenizer.Token} */ prev: function() { return this.tokens[ this.tokenIndex-- - 2 ]; }, /** * Retrieve all the tokens in the CSS string * @return {Array.<PIE.Tokenizer.Token>} */ all: function() { while( this.next() ) {} return this.tokens; }, /** * Return a list of tokens from the current position until the given function returns * true. The final token will not be included in the list. * @param {function():boolean} func - test function * @param {boolean} require - if true, then if the end of the CSS string is reached * before the test function returns true, null will be returned instead of the * tokens that have been found so far. * @return {Array.<PIE.Tokenizer.Token>} */ until: function( func, require ) { var list = [], t, hit; while( t = this.next() ) { if( func( t ) ) { hit = true; this.prev(); break; } list.push( t ); } return require && !hit ? null : list; } }; return Tokenizer; })();/** * Handles calculating, caching, and detecting changes to size and position of the element. * @constructor * @param {Element} el the target element */ PIE.BoundsInfo = function( el ) { this.targetElement = el; }; PIE.BoundsInfo.prototype = { _locked: 0, /** * Determines if the element's position has changed since the last update. * TODO this does a simple getBoundingClientRect comparison for detecting the * changes in position, which may not always be accurate; it's possible that * an element will actually move relative to its positioning parent, but its position * relative to the viewport will stay the same. Need to come up with a better way to * track movement. The most accurate would be the same logic used in RootRenderer.updatePos() * but that is a more expensive operation since it performs DOM walking, and we want this * check to be as fast as possible. Perhaps introduce a -pie-* flag to trigger the slower * but more accurate method? */ positionChanged: function() { var last = this._lastBounds, bounds; return !last || ( ( bounds = this.getBounds() ) && ( last.x !== bounds.x || last.y !== bounds.y ) ); }, sizeChanged: function() { var last = this._lastBounds, bounds; return !last || ( ( bounds = this.getBounds() ) && ( last.w !== bounds.w || last.h !== bounds.h ) ); }, getLiveBounds: function() { var el = this.targetElement, rect = el.getBoundingClientRect(), isIE9 = PIE.ieDocMode === 9, isIE7 = PIE.ieVersion === 7, width = rect.right - rect.left; return { x: rect.left, y: rect.top, // In some cases scrolling the page will cause IE9 to report incorrect dimensions // in the rect returned by getBoundingClientRect, so we must query offsetWidth/Height // instead. Also IE7 is inconsistent in using logical vs. device pixels in measurements // so we must calculate the ratio and use it in certain places as a position adjustment. w: isIE9 || isIE7 ? el.offsetWidth : width, h: isIE9 || isIE7 ? el.offsetHeight : rect.bottom - rect.top, logicalZoomRatio: ( isIE7 && width ) ? el.offsetWidth / width : 1 }; }, getBounds: function() { return this._locked ? ( this._lockedBounds || ( this._lockedBounds = this.getLiveBounds() ) ) : this.getLiveBounds(); }, hasBeenQueried: function() { return !!this._lastBounds; }, lock: function() { ++this._locked; }, unlock: function() { if( !--this._locked ) { if( this._lockedBounds ) this._lastBounds = this._lockedBounds; this._lockedBounds = null; } } }; (function() { function cacheWhenLocked( fn ) { var uid = PIE.Util.getUID( fn ); return function() { if( this._locked ) { var cache = this._lockedValues || ( this._lockedValues = {} ); return ( uid in cache ) ? cache[ uid ] : ( cache[ uid ] = fn.call( this ) ); } else { return fn.call( this ); } } } PIE.StyleInfoBase = { _locked: 0, /** * Create a new StyleInfo class, with the standard constructor, and augmented by * the StyleInfoBase's members. * @param proto */ newStyleInfo: function( proto ) { function StyleInfo( el ) { this.targetElement = el; this._lastCss = this.getCss(); } PIE.merge( StyleInfo.prototype, PIE.StyleInfoBase, proto ); StyleInfo._propsCache = {}; return StyleInfo; }, /** * Get an object representation of the target CSS style, caching it for each unique * CSS value string. * @return {Object} */ getProps: function() { var css = this.getCss(), cache = this.constructor._propsCache; return css ? ( css in cache ? cache[ css ] : ( cache[ css ] = this.parseCss( css ) ) ) : null; }, /** * Get the raw CSS value for the target style * @return {string} */ getCss: cacheWhenLocked( function() { var el = this.targetElement, ctor = this.constructor, s = el.style, cs = el.currentStyle, cssProp = this.cssProperty, styleProp = this.styleProperty, prefixedCssProp = ctor._prefixedCssProp || ( ctor._prefixedCssProp = PIE.CSS_PREFIX + cssProp ), prefixedStyleProp = ctor._prefixedStyleProp || ( ctor._prefixedStyleProp = PIE.STYLE_PREFIX + styleProp.charAt(0).toUpperCase() + styleProp.substring(1) ); return s[ prefixedStyleProp ] || cs.getAttribute( prefixedCssProp ) || s[ styleProp ] || cs.getAttribute( cssProp ); } ), /** * Determine whether the target CSS style is active. * @return {boolean} */ isActive: cacheWhenLocked( function() { return !!this.getProps(); } ), /** * Determine whether the target CSS style has changed since the last time it was used. * @return {boolean} */ changed: cacheWhenLocked( function() { var currentCss = this.getCss(), changed = currentCss !== this._lastCss; this._lastCss = currentCss; return changed; } ), cacheWhenLocked: cacheWhenLocked, lock: function() { ++this._locked; }, unlock: function() { if( !--this._locked ) { delete this._lockedValues; } } }; })();/** * Handles parsing, caching, and detecting changes to background (and -pie-background) CSS * @constructor * @param {Element} el the target element */ PIE.BackgroundStyleInfo = PIE.StyleInfoBase.newStyleInfo( { cssProperty: PIE.CSS_PREFIX + 'background', styleProperty: PIE.STYLE_PREFIX + 'Background', attachIdents: { 'scroll':1, 'fixed':1, 'local':1 }, repeatIdents: { 'repeat-x':1, 'repeat-y':1, 'repeat':1, 'no-repeat':1 }, originAndClipIdents: { 'padding-box':1, 'border-box':1, 'content-box':1 }, positionIdents: { 'top':1, 'right':1, 'bottom':1, 'left':1, 'center':1 }, sizeIdents: { 'contain':1, 'cover':1 }, tbIdents: { 'top': 1, 'bottom': 1 }, lrIdents: { 'left': 1, 'right': 1 }, propertyNames: { CLIP: 'backgroundClip', COLOR: 'backgroundColor', IMAGE: 'backgroundImage', ORIGIN: 'backgroundOrigin', POSITION: 'backgroundPosition', REPEAT: 'backgroundRepeat', SIZE: 'backgroundSize' }, /** * For background styles, we support the -pie-background property but fall back to the standard * backround* properties. The reason we have to use the prefixed version is that IE natively * parses the standard properties and if it sees something it doesn't know how to parse, for example * multiple values or gradient definitions, it will throw that away and not make it available through * currentStyle. * * Format of return object: * { * color: <PIE.Color>, * colorClip: <'border-box' | 'padding-box'>, * bgImages: [ * { * imgType: 'image', * imgUrl: 'image.png', * imgRepeat: <'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'>, * bgPosition: <PIE.BgPosition>, * bgAttachment: <'scroll' | 'fixed' | 'local'>, * bgOrigin: <'border-box' | 'padding-box' | 'content-box'>, * bgClip: <'border-box' | 'padding-box'>, * bgSize: <PIE.BgSize>, * origString: 'url(img.png) no-repeat top left' * }, * { * imgType: 'linear-gradient', * gradientTo: [<'top' | 'bottom'>, <'left' | 'right'>?], * angle: <PIE.Angle>, * stops: [ * { color: <PIE.Color>, offset: <PIE.Length> }, * { color: <PIE.Color>, offset: <PIE.Length> }, ... * ] * } * ] * } * @param {String} css * @override */ parseCss: function( css ) { var el = this.targetElement, cs = el.currentStyle, tokenizer, token, image, tok_type = PIE.Tokenizer.Type, type_operator = tok_type.OPERATOR, type_ident = tok_type.IDENT, type_color = tok_type.COLOR, tokType, tokVal, beginCharIndex = 0, positionIdents = this.positionIdents, gradient, stop, width, height, gradientTo, len, tbIdents, lrIdents, props = { bgImages: [] }; function isBgPosToken( token ) { return token && token.isLengthOrPercent() || ( token.tokenType & type_ident && token.tokenValue in positionIdents ); } function sizeToken( token ) { return token && ( ( token.isLengthOrPercent() && PIE.getLength( token.tokenValue ) ) || ( token.tokenValue === 'auto' && 'auto' ) ); } // If the CSS3-specific -pie-background property is present, parse it if( this.getCss3() ) { tokenizer = new PIE.Tokenizer( css ); image = {}; while( token = tokenizer.next() ) { tokType = token.tokenType; tokVal = token.tokenValue; if( !image.imgType && tokType & tok_type.FUNCTION && tokVal === 'linear-gradient' ) { gradient = { stops: [], imgType: tokVal }; stop = {}; while( token = tokenizer.next() ) { tokType = token.tokenType; tokVal = token.tokenValue; // If we reached the end of the function and had at least 2 stops, flush the info if( tokType & tok_type.CHARACTER && tokVal === ')' ) { if( stop.color ) { gradient.stops.push( stop ); } if( gradient.stops.length > 1 ) { PIE.merge( image, gradient ); } break; } // Color stop - must start with color if( tokType & type_color ) { // if we already have an angle/position, make sure that the previous token was a comma if( gradient.angle || gradient.gradientTo ) { token = tokenizer.prev(); if( token.tokenType !== type_operator ) { break; //fail } tokenizer.next(); } stop = { color: PIE.getColor( tokVal ) }; // check for offset following color token = tokenizer.next(); if( token.isLengthOrPercent() ) { stop.offset = PIE.getLength( token.tokenValue ); } else { tokenizer.prev(); } } // Angle - can only appear in first spot else if( tokType & tok_type.ANGLE && !gradient.angle && !gradient.gradientTo && !stop.color && !gradient.stops.length ) { gradient.angle = new PIE.Angle( token.tokenValue ); } // "to <side-or-corner>" - can only appear in first spot else if( tokType & tok_type.IDENT && tokVal === 'to' && !gradient.gradientTo && !gradient.angle && !stop.color && !gradient.stops.length ) { tbIdents = this.tbIdents; lrIdents = this.lrIdents; gradientTo = tokenizer.until( function( t ) { return !(t && t.tokenType & tok_type.IDENT && ( t.tokenValue in tbIdents || t.tokenValue in lrIdents )); } ); len = gradientTo.length; gradientTo = [ gradientTo[0] && gradientTo[0].tokenValue, gradientTo[1] && gradientTo[1].tokenValue ]; // bail unless there are 1 or 2 values, or if the 2 values are from the same pair of sides if ( len < 1 || len > 2 || ( len > 1 && ( ( gradientTo[0] in tbIdents && gradientTo[1] in tbIdents ) || ( gradientTo[0] in lrIdents && gradientTo[1] in lrIdents ) ) ) ) { break; } gradient.gradientTo = gradientTo; } else if( tokType & type_operator && tokVal === ',' ) { if( stop.color ) { gradient.stops.push( stop ); stop = {}; } } else { // Found something we didn't recognize; fail without adding image break; } } } else if( !image.imgType && tokType & tok_type.URL ) { image.imgUrl = tokVal; image.imgType = 'image'; } else if( isBgPosToken( token ) && !image.bgPosition ) { tokenizer.prev(); image.bgPosition = new PIE.BgPosition( tokenizer.until( function( t ) { return !isBgPosToken( t ); }, false ) ); } else if( tokType & type_ident ) { if( tokVal in this.repeatIdents && !image.imgRepeat ) { image.imgRepeat = tokVal; } else if( tokVal in this.originAndClipIdents && !image.bgOrigin ) { image.bgOrigin = tokVal; if( ( token = tokenizer.next() ) && ( token.tokenType & type_ident ) && token.tokenValue in this.originAndClipIdents ) { image.bgClip = token.tokenValue; } else { image.bgClip = tokVal; tokenizer.prev(); } } else if( tokVal in this.attachIdents && !image.bgAttachment ) { image.bgAttachment = tokVal; } else { return null; } } else if( tokType & type_color && !props.color ) { props.color = PIE.getColor( tokVal ); } else if( tokType & type_operator && tokVal === '/' && !image.bgSize && image.bgPosition ) { // background size token = tokenizer.next(); if( token.tokenType & type_ident && token.tokenValue in this.sizeIdents ) { image.bgSize = new PIE.BgSize( token.tokenValue ); } else if( width = sizeToken( token ) ) { height = sizeToken( tokenizer.next() ); if ( !height ) { height = width; tokenizer.prev(); } image.bgSize = new PIE.BgSize( width, height ); } else { return null; } } // new layer else if( tokType & type_operator && tokVal === ',' && image.imgType ) { image.origString = css.substring( beginCharIndex, tokenizer.ch - 1 ); beginCharIndex = tokenizer.ch; props.bgImages.push( image ); image = {}; } else { // Found something unrecognized; chuck everything return null; } } // leftovers if( image.imgType ) { image.origString = css.substring( beginCharIndex ); props.bgImages.push( image ); } props.colorClip = image.bgClip; } // Otherwise, use the standard background properties; let IE give us the values rather than parsing them else { this.withActualBg( PIE.ieDocMode < 9 ? function() { var propNames = this.propertyNames, posX = cs[propNames.POSITION + 'X'], posY = cs[propNames.POSITION + 'Y'], img = cs[propNames.IMAGE], color = cs[propNames.COLOR]; if( color !== 'transparent' ) { props.color = PIE.getColor( color ) } if( img !== 'none' ) { props.bgImages = [ { imgType: 'image', imgUrl: new PIE.Tokenizer( img ).next().tokenValue, imgRepeat: cs[propNames.REPEAT], bgPosition: new PIE.BgPosition( new PIE.Tokenizer( posX + ' ' + posY ).all() ) } ]; } } : function() { var propNames = this.propertyNames, splitter = /\s*,\s*/, images = cs[propNames.IMAGE].split( splitter ), color = cs[propNames.COLOR], repeats, positions, origins, clips, sizes, i, len, image, sizeParts; if( color !== 'transparent' ) { props.color = PIE.getColor( color ) } len = images.length; if( len && images[0] !== 'none' ) { repeats = cs[propNames.REPEAT].split( splitter ); positions = cs[propNames.POSITION].split( splitter ); origins = cs[propNames.ORIGIN].split( splitter ); clips = cs[propNames.CLIP].split( splitter ); sizes = cs[propNames.SIZE].split( splitter ); props.bgImages = []; for( i = 0; i < len; i++ ) { image = images[ i ]; if( image && image !== 'none' ) { sizeParts = sizes[i].split( ' ' ); props.bgImages.push( { origString: image + ' ' + repeats[ i ] + ' ' + positions[ i ] + ' / ' + sizes[ i ] + ' ' + origins[ i ] + ' ' + clips[ i ], imgType: 'image', imgUrl: new PIE.Tokenizer( image ).next().tokenValue, imgRepeat: repeats[ i ], bgPosition: new PIE.BgPosition( new PIE.Tokenizer( positions[ i ] ).all() ), bgOrigin: origins[ i ], bgClip: clips[ i ], bgSize: new PIE.BgSize( sizeParts[ 0 ], sizeParts[ 1 ] ) } ); } } } } ); } return ( props.color || props.bgImages[0] ) ? props : null; }, /** * Execute a function with the actual background styles (not overridden with runtimeStyle * properties set by the renderers) available via currentStyle. * @param fn */ withActualBg: function( fn ) { var isIE9 = PIE.ieDocMode > 8, propNames = this.propertyNames, rs = this.targetElement.runtimeStyle, rsImage = rs[propNames.IMAGE], rsColor = rs[propNames.COLOR], rsRepeat = rs[propNames.REPEAT], rsClip, rsOrigin, rsSize, rsPosition, ret; if( rsImage ) rs[propNames.IMAGE] = ''; if( rsColor ) rs[propNames.COLOR] = ''; if( rsRepeat ) rs[propNames.REPEAT] = ''; if( isIE9 ) { rsClip = rs[propNames.CLIP]; rsOrigin = rs[propNames.ORIGIN]; rsPosition = rs[propNames.POSITION]; rsSize = rs[propNames.SIZE]; if( rsClip ) rs[propNames.CLIP] = ''; if( rsOrigin ) rs[propNames.ORIGIN] = ''; if( rsPosition ) rs[propNames.POSITION] = ''; if( rsSize ) rs[propNames.SIZE] = ''; } ret = fn.call( this ); if( rsImage ) rs[propNames.IMAGE] = rsImage; if( rsColor ) rs[propNames.COLOR] = rsColor; if( rsRepeat ) rs[propNames.REPEAT] = rsRepeat; if( isIE9 ) { if( rsClip ) rs[propNames.CLIP] = rsClip; if( rsOrigin ) rs[propNames.ORIGIN] = rsOrigin; if( rsPosition ) rs[propNames.POSITION] = rsPosition; if( rsSize ) rs[propNames.SIZE] = rsSize; } return ret; }, getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { return this.getCss3() || this.withActualBg( function() { var cs = this.targetElement.currentStyle, propNames = this.propertyNames; return cs[propNames.COLOR] + ' ' + cs[propNames.IMAGE] + ' ' + cs[propNames.REPEAT] + ' ' + cs[propNames.POSITION + 'X'] + ' ' + cs[propNames.POSITION + 'Y']; } ); } ), getCss3: PIE.StyleInfoBase.cacheWhenLocked( function() { var el = this.targetElement; return el.style[ this.styleProperty ] || el.currentStyle.getAttribute( this.cssProperty ); } ), /** * For a given background-origin value, return the dimensions of the background area. * @param {String} bgOrigin * @param {PIE.BoundsInfo} boundsInfo * @param {PIE.BorderStyleInfo} borderInfo */ getBgAreaSize: function( bgOrigin, boundsInfo, borderInfo, paddingInfo ) { var el = this.targetElement, bounds = boundsInfo.getBounds(), w = bounds.w, h = bounds.h, borders, paddings; if( bgOrigin !== 'border-box' ) { borders = borderInfo.getProps(); if( borders && ( borders = borders.widths ) ) { w -= borders[ 'l' ].pixels( el ) + borders[ 'l' ].pixels( el ); h -= borders[ 't' ].pixels( el ) + borders[ 'b' ].pixels( el ); } } if ( bgOrigin === 'content-box' ) { paddings = paddingInfo.getProps(); if ( paddings ) { w -= paddings[ 'l' ].pixels( el ) + paddings[ 'l' ].pixels( el ); h -= paddings[ 't' ].pixels( el ) + paddings[ 'b' ].pixels( el ); } } return { w: w, h: h }; }, /** * Tests if style.PiePngFix or the -pie-png-fix property is set to true in IE6. */ isPngFix: function() { var val = 0, el; if( PIE.ieVersion < 7 ) { el = this.targetElement; val = ( '' + ( el.style[ PIE.STYLE_PREFIX + 'PngFix' ] || el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'png-fix' ) ) === 'true' ); } return val; }, /** * The isActive logic is slightly different, because getProps() always returns an object * even if it is just falling back to the native background properties. But we only want * to report is as being "active" if either the -pie-background override property is present * and parses successfully or '-pie-png-fix' is set to true in IE6. */ isActive: PIE.StyleInfoBase.cacheWhenLocked( function() { return (this.getCss3() || this.isPngFix()) && !!this.getProps(); } ) } );/** * Handles parsing, caching, and detecting changes to border CSS * @constructor * @param {Element} el the target element */ PIE.BorderStyleInfo = PIE.StyleInfoBase.newStyleInfo( { sides: [ 'Top', 'Right', 'Bottom', 'Left' ], namedWidths: { 'thin': '1px', 'medium': '3px', 'thick': '5px' }, parseCss: function( css ) { var w = {}, s = {}, c = {}, active = false, colorsSame = true, stylesSame = true, widthsSame = true; this.withActualBorder( function() { var el = this.targetElement, cs = el.currentStyle, i = 0, style, color, width, lastStyle, lastColor, lastWidth, side, ltr; for( ; i < 4; i++ ) { side = this.sides[ i ]; ltr = side.charAt(0).toLowerCase(); style = s[ ltr ] = cs[ 'border' + side + 'Style' ]; color = cs[ 'border' + side + 'Color' ]; width = cs[ 'border' + side + 'Width' ]; if( i > 0 ) { if( style !== lastStyle ) { stylesSame = false; } if( color !== lastColor ) { colorsSame = false; } if( width !== lastWidth ) { widthsSame = false; } } lastStyle = style; lastColor = color; lastWidth = width; c[ ltr ] = PIE.getColor( color ); width = w[ ltr ] = PIE.getLength( s[ ltr ] === 'none' ? '0' : ( this.namedWidths[ width ] || width ) ); if( width.pixels( this.targetElement ) > 0 ) { active = true; } } } ); return active ? { widths: w, styles: s, colors: c, widthsSame: widthsSame, colorsSame: colorsSame, stylesSame: stylesSame } : null; }, getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { var el = this.targetElement, cs = el.currentStyle, css; // Don't redraw or hide borders for cells in border-collapse:collapse tables if( !( el.tagName in PIE.tableCellTags && el.offsetParent.currentStyle.borderCollapse === 'collapse' ) ) { this.withActualBorder( function() { css = cs.borderWidth + '|' + cs.borderStyle + '|' + cs.borderColor; } ); } return css; } ), /** * Execute a function with the actual border styles (not overridden with runtimeStyle * properties set by the renderers) available via currentStyle. * @param fn */ withActualBorder: function( fn ) { var rs = this.targetElement.runtimeStyle, rsWidth = rs.borderWidth, rsColor = rs.borderColor, ret; if( rsWidth ) rs.borderWidth = ''; if( rsColor ) rs.borderColor = ''; ret = fn.call( this ); if( rsWidth ) rs.borderWidth = rsWidth; if( rsColor ) rs.borderColor = rsColor; return ret; } } ); /** * Handles parsing, caching, and detecting changes to border-radius CSS * @constructor * @param {Element} el the target element */ (function() { PIE.BorderRadiusStyleInfo = PIE.StyleInfoBase.newStyleInfo( { cssProperty: 'border-radius', styleProperty: 'borderRadius', parseCss: function( css ) { var p = null, x, y, tokenizer, token, length, hasNonZero = false; if( css ) { tokenizer = new PIE.Tokenizer( css ); function collectLengths() { var arr = [], num; while( ( token = tokenizer.next() ) && token.isLengthOrPercent() ) { length = PIE.getLength( token.tokenValue ); num = length.getNumber(); if( num < 0 ) { return null; } if( num > 0 ) { hasNonZero = true; } arr.push( length ); } return arr.length > 0 && arr.length < 5 ? { 'tl': arr[0], 'tr': arr[1] || arr[0], 'br': arr[2] || arr[0], 'bl': arr[3] || arr[1] || arr[0] } : null; } // Grab the initial sequence of lengths if( x = collectLengths() ) { // See if there is a slash followed by more lengths, for the y-axis radii if( token ) { if( token.tokenType & PIE.Tokenizer.Type.OPERATOR && token.tokenValue === '/' ) { y = collectLengths(); } } else { y = x; } // Treat all-zero values the same as no value if( hasNonZero && x && y ) { p = { x: x, y : y }; } } } return p; } } ); var zero = PIE.getLength( '0' ), zeros = { 'tl': zero, 'tr': zero, 'br': zero, 'bl': zero }; PIE.BorderRadiusStyleInfo.ALL_ZERO = { x: zeros, y: zeros }; })();/** * Handles parsing, caching, and detecting changes to border-image CSS * @constructor * @param {Element} el the target element */ PIE.BorderImageStyleInfo = PIE.StyleInfoBase.newStyleInfo( { cssProperty: 'border-image', styleProperty: 'borderImage', repeatIdents: { 'stretch':1, 'round':1, 'repeat':1, 'space':1 }, parseCss: function( css ) { var p = null, tokenizer, token, type, value, slices, widths, outsets, slashCount = 0, Type = PIE.Tokenizer.Type, IDENT = Type.IDENT, NUMBER = Type.NUMBER, PERCENT = Type.PERCENT; if( css ) { tokenizer = new PIE.Tokenizer( css ); p = {}; function isSlash( token ) { return token && ( token.tokenType & Type.OPERATOR ) && ( token.tokenValue === '/' ); } function isFillIdent( token ) { return token && ( token.tokenType & IDENT ) && ( token.tokenValue === 'fill' ); } function collectSlicesEtc() { slices = tokenizer.until( function( tok ) { return !( tok.tokenType & ( NUMBER | PERCENT ) ); } ); if( isFillIdent( tokenizer.next() ) && !p.fill ) { p.fill = true; } else { tokenizer.prev(); } if( isSlash( tokenizer.next() ) ) { slashCount++; widths = tokenizer.until( function( token ) { return !token.isLengthOrPercent() && !( ( token.tokenType & IDENT ) && token.tokenValue === 'auto' ); } ); if( isSlash( tokenizer.next() ) ) { slashCount++; outsets = tokenizer.until( function( token ) { return !token.isLength(); } ); } } else { tokenizer.prev(); } } while( token = tokenizer.next() ) { type = token.tokenType; value = token.tokenValue; // Numbers and/or 'fill' keyword: slice values. May be followed optionally by width values, followed optionally by outset values if( type & ( NUMBER | PERCENT ) && !slices ) { tokenizer.prev(); collectSlicesEtc(); } else if( isFillIdent( token ) && !p.fill ) { p.fill = true; collectSlicesEtc(); } // Idents: one or values for 'repeat' else if( ( type & IDENT ) && this.repeatIdents[value] && !p.repeat ) { p.repeat = { h: value }; if( token = tokenizer.next() ) { if( ( token.tokenType & IDENT ) && this.repeatIdents[token.tokenValue] ) { p.repeat.v = token.tokenValue; } else { tokenizer.prev(); } } } // URL of the image else if( ( type & Type.URL ) && !p.src ) { p.src = value; } // Found something unrecognized; exit. else { return null; } } // Validate what we collected if( !p.src || !slices || slices.length < 1 || slices.length > 4 || ( widths && widths.length > 4 ) || ( slashCount === 1 && widths.length < 1 ) || ( outsets && outsets.length > 4 ) || ( slashCount === 2 && outsets.length < 1 ) ) { return null; } // Fill in missing values if( !p.repeat ) { p.repeat = { h: 'stretch' }; } if( !p.repeat.v ) { p.repeat.v = p.repeat.h; } function distributeSides( tokens, convertFn ) { return { 't': convertFn( tokens[0] ), 'r': convertFn( tokens[1] || tokens[0] ), 'b': convertFn( tokens[2] || tokens[0] ), 'l': convertFn( tokens[3] || tokens[1] || tokens[0] ) }; } p.slice = distributeSides( slices, function( tok ) { return PIE.getLength( ( tok.tokenType & NUMBER ) ? tok.tokenValue + 'px' : tok.tokenValue ); } ); if( widths && widths[0] ) { p.widths = distributeSides( widths, function( tok ) { return tok.isLengthOrPercent() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue; } ); } if( outsets && outsets[0] ) { p.outset = distributeSides( outsets, function( tok ) { return tok.isLength() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue; } ); } } return p; } } );/** * Handles parsing, caching, and detecting changes to box-shadow CSS * @constructor * @param {Element} el the target element */ PIE.BoxShadowStyleInfo = PIE.StyleInfoBase.newStyleInfo( { cssProperty: 'box-shadow', styleProperty: 'boxShadow', parseCss: function( css ) { var props, getLength = PIE.getLength, Type = PIE.Tokenizer.Type, tokenizer; if( css ) { tokenizer = new PIE.Tokenizer( css ); props = { outset: [], inset: [] }; function parseItem() { var token, type, value, color, lengths, inset, len; while( token = tokenizer.next() ) { value = token.tokenValue; type = token.tokenType; if( type & Type.OPERATOR && value === ',' ) { break; } else if( token.isLength() && !lengths ) { tokenizer.prev(); lengths = tokenizer.until( function( token ) { return !token.isLength(); } ); } else if( type & Type.COLOR && !color ) { color = value; } else if( type & Type.IDENT && value === 'inset' && !inset ) { inset = true; } else { //encountered an unrecognized token; fail. return false; } } len = lengths && lengths.length; if( len > 1 && len < 5 ) { ( inset ? props.inset : props.outset ).push( { xOffset: getLength( lengths[0].tokenValue ), yOffset: getLength( lengths[1].tokenValue ), blur: getLength( lengths[2] ? lengths[2].tokenValue : '0' ), spread: getLength( lengths[3] ? lengths[3].tokenValue : '0' ), color: PIE.getColor( color || 'currentColor' ) } ); return true; } return false; } while( parseItem() ) {} } return props && ( props.inset.length || props.outset.length ) ? props : null; } } ); /** * Handles parsing, caching, and detecting changes to padding CSS * @constructor * @param {Element} el the target element */ PIE.PaddingStyleInfo = PIE.StyleInfoBase.newStyleInfo( { parseCss: function( css ) { var tokenizer = new PIE.Tokenizer( css ), arr = [], token; while( ( token = tokenizer.next() ) && token.isLengthOrPercent() ) { arr.push( PIE.getLength( token.tokenValue ) ); } return arr.length > 0 && arr.length < 5 ? { 't': arr[0], 'r': arr[1] || arr[0], 'b': arr[2] || arr[0], 'l': arr[3] || arr[1] || arr[0] } : null; }, getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { var el = this.targetElement, rs = el.runtimeStyle, rsPadding = rs.padding, padding; if( rsPadding ) rs.padding = ''; padding = el.currentStyle.padding; if( rsPadding ) rs.padding = rsPadding; return padding; } ) } ); /** * Retrieves the state of the element's visibility and display * @constructor * @param {Element} el the target element */ PIE.VisibilityStyleInfo = PIE.StyleInfoBase.newStyleInfo( { getCss: PIE.StyleInfoBase.cacheWhenLocked( function() { var el = this.targetElement, rs = el.runtimeStyle, cs = el.currentStyle, rsVis = rs.visibility, ret; rs.visibility = ''; ret = cs.visibility + '|' + cs.display; rs.visibility = rsVis; return ret; } ), parseCss: function() { var info = this.getCss().split('|'); return { visible: info[0] !== 'hidden', displayed: info[1] !== 'none' }; }, /** * Always return false for isActive, since this property alone will not trigger * a renderer to do anything. */ isActive: function() { return false; } } ); /** * Abstraction for a VML shape element. Allows assembling a VML shape's properties in * a non-DOM structure, which can then both generate itself as a single HTML string, and/or * update itself incrementally if its DOM element already exists. */ PIE.VmlShape = (function() { var nsPrefix = 'pievml', attrsPrefix = '_attrs_', objectSetters = { 'colors': function( fill, name, value ) { if( fill[ name ] ) { //sometimes the colors object isn't initialized so we have to assign it directly (?) fill[ name ].value = value; } else { fill[ name ] = value; } }, 'size': function( fill, name, value ) { if ( !value ) { delete fill[ name ]; } else { fill[ name ][ 'x' ] = 1; //Can be any value, just has to be set to "prime" it so the next line works. Weird! fill[ name ] = value; } }, 'o:opacity2': function( fill, name, value ) { // The VML DOM does not allow dynamic setting of o:opacity2, so we must regenerate // the entire shape from markup instead. var me = this; if( value !== me.lastOpacity2 ) { me.getShape().insertAdjacentHTML( 'afterEnd', me.getMarkup() ); me.destroy(); me.lastOpacity2 = value; } } }; function createSetter( objName ) { return function() { var args = arguments, i, len = args.length, obj, name, setter; // Store the property locally obj = this[ attrsPrefix + objName ] || ( this[ attrsPrefix + objName ] = {} ); for( i = 0; i < len; i += 2 ) { obj[ args[ i ] ] = args[ i + 1 ]; } // If there is a rendered VML shape already, set the property directly via the VML DOM obj = this.getShape(); if( obj ) { if( objName ) { obj = obj[ objName ]; } for( i = 0; i < len; i += 2 ) { name = args[ i ]; setter = objectSetters[ name ]; //if there is a custom setter for this property, use it if ( setter ) { setter.call( this, obj, name, args[ i + 1 ]); } else { obj[ name ] = args[ i + 1 ]; } } } } } /** * The VML namespace has to be registered with the document, or the shapes will be invisible * on initial render sometimes. This results in the infamous "Unspecified error" if called * at certain times, so catch that and retry after a delay. */ (function addVmlNamespace() { try { doc.namespaces.add(nsPrefix, 'urn:schemas-microsoft-com:vml', '#default#VML'); } catch (e) { setTimeout(addVmlNamespace, 1); } })(); function VmlShape( idSeed, ordinalGroup ) { this.elId = '_pie_' + ( idSeed || 'shape' ) + PIE.Util.getUID(this); this.ordinalGroup = ordinalGroup || 0; } VmlShape.prototype = { behaviorStyle: 'behavior:url(#default#VML);', defaultStyles: 'position:absolute;top:0px;left:0px;', defaultAttrs: 'coordorigin="1,1" stroked="false" ', tagName: 'shape', mightBeRendered: 0, getShape: function() { return this.mightBeRendered ? ( this._shape || ( this._shape = doc.getElementById( this.elId ) ) ) : null; }, setAttrs: createSetter( '' ), setStyles: createSetter( 'style' ), setFillAttrs: createSetter( 'fill' ), setSize: function( w, h ) { this.setStyles( 'width', w + 'px', 'height', h + 'px' ); this.setAttrs( 'coordsize', w * 2 + ',' + h * 2 ); }, getStyleCssText: function() { var styles = this[ attrsPrefix + 'style' ] || {}, cssText = [], p; for( p in styles ) { if( styles.hasOwnProperty( p ) ) { cssText.push( p + ':' + styles[p] ); } } return this.behaviorStyle + this.defaultStyles + cssText.join( ';' ); }, getMarkup: function() { var m, me = this, tag = me.tagName, tagStart = '<' + nsPrefix + ':', subElEnd = ' style="' + me.behaviorStyle + '" />'; me.mightBeRendered = 1; function pushAttrs( keyVals ) { if( keyVals ) { for( var key in keyVals ) { if( keyVals.hasOwnProperty( key ) ) { m.push( ' ' + key + '="' + keyVals[key] + '"' ); } } } } function pushElement( name ) { var attrs = me[ attrsPrefix + name ]; if( attrs ) { m.push( tagStart + name ); pushAttrs( attrs ); m.push( subElEnd ); } } m = [ tagStart, tag, ' id="', me.elId, '" style="', me.getStyleCssText(), '" ', me.defaultAttrs ]; pushAttrs( me[ attrsPrefix ] ); m.push( '>' ); pushElement( 'fill' ); m.push( '</' + nsPrefix + ':' + tag + '>' ); return m.join( '' ); }, destroy: function() { var shape = this.getShape(), par = shape && shape.parentNode; if( par ) { par.removeChild(shape); delete this._shape; } } }; return VmlShape; })();PIE.RendererBase = { /** * Create a new Renderer class, with the standard constructor, and augmented by * the RendererBase's members. * @param proto */ newRenderer: function( proto ) { function Renderer( el, boundsInfo, styleInfos, parent ) { this.targetElement = el; this.boundsInfo = boundsInfo; this.styleInfos = styleInfos; this.parent = parent; } PIE.merge( Renderer.prototype, PIE.RendererBase, proto ); return Renderer; }, /** * Determine if the renderer needs to be updated * @return {boolean} */ needsUpdate: function() { return false; }, /** * Run any preparation logic that would affect the main update logic of this * renderer or any of the other renderers, e.g. things that might affect the * element's size or style properties. */ prepareUpdate: PIE.emptyFn, /** * Tell the renderer to update based on modified properties or element dimensions */ updateRendering: function() { if( this.isActive() ) { this.draw(); } else { this.destroy(); } }, /** * Hide the target element's border */ hideBorder: function() { this.targetElement.runtimeStyle.borderColor = 'transparent'; }, /** * Destroy the rendered objects. This is a base implementation which handles common renderer * structures, but individual renderers may override as necessary. */ destroy: function() { } }; PIE.merge(PIE.RendererBase, { /** * Get a VmlShape by name, creating it if necessary. * @param {string} name A name identifying the element * @param {number} zIndex Specifies the target z-index of the shape. This will be used when rendering * the shape to ensure it is inserted in the correct order with other shapes to give * correct stacking order without using actual CSS z-index. * @return {PIE.VmlShape} */ getShape: function( name, zIndex ) { var shapes = this._shapes || ( this._shapes = {} ), shape = shapes[ name ]; if( !shape ) { shape = shapes[ name ] = new PIE.VmlShape( name, zIndex ); this.parent.enqueueShapeForRender( shape ); } return shape; }, /** * Delete a named shape which was created by getShape(). Returns true if a shape with the * given name was found and deleted, or false if there was no shape of that name. * @param {string} name * @return {boolean} */ deleteShape: function( name ) { var shapes = this._shapes, shape = shapes && shapes[ name ]; if( shape ) { shape.destroy(); this.parent.removeShape( shape ); delete shapes[ name ]; } return !!shape; }, /** * For a given set of border radius length/percentage values, convert them to concrete pixel * values based on the current size of the target element. * @param {Object} radii * @return {Object} */ getRadiiPixels: function( radii ) { var el = this.targetElement, bounds = this.boundsInfo.getBounds(), w = bounds.w, h = bounds.h, tlX, tlY, trX, trY, brX, brY, blX, blY, f; tlX = radii.x['tl'].pixels( el, w ); tlY = radii.y['tl'].pixels( el, h ); trX = radii.x['tr'].pixels( el, w ); trY = radii.y['tr'].pixels( el, h ); brX = radii.x['br'].pixels( el, w ); brY = radii.y['br'].pixels( el, h ); blX = radii.x['bl'].pixels( el, w ); blY = radii.y['bl'].pixels( el, h ); // If any corner ellipses overlap, reduce them all by the appropriate factor. This formula // is taken straight from the CSS3 Backgrounds and Borders spec. f = Math.min( w / ( tlX + trX ), h / ( trY + brY ), w / ( blX + brX ), h / ( tlY + blY ) ); if( f < 1 ) { tlX *= f; tlY *= f; trX *= f; trY *= f; brX *= f; brY *= f; blX *= f; blY *= f; } return { x: { 'tl': tlX, 'tr': trX, 'br': brX, 'bl': blX }, y: { 'tl': tlY, 'tr': trY, 'br': brY, 'bl': blY } } }, /** * Return the VML path string for the element's background box, with corners rounded. * @param {number} shrinkT - number of pixels to shrink the box path inward from the element's top side. * @param {number} shrinkR - number of pixels to shrink the box path inward from the element's right side. * @param {number} shrinkB - number of pixels to shrink the box path inward from the element's bottom side. * @param {number} shrinkL - number of pixels to shrink the box path inward from the element's left side. * @param {number} mult All coordinates will be multiplied by this number * @param {Object=} radii If specified, this will be used for the corner radii instead of the properties * from this renderer's borderRadiusInfo object. * @return {string} the VML path */ getBoxPath: function( shrinkT, shrinkR, shrinkB, shrinkL, mult, radii ) { var coords = this.getBoxPathCoords( shrinkT, shrinkR, shrinkB, shrinkL, mult, radii ); return 'm' + coords[ 0 ] + ',' + coords[ 1 ] + 'qy' + coords[ 2 ] + ',' + coords[ 3 ] + 'l' + coords[ 4 ] + ',' + coords[ 5 ] + 'qx' + coords[ 6 ] + ',' + coords[ 7 ] + 'l' + coords[ 8 ] + ',' + coords[ 9 ] + 'qy' + coords[ 10 ] + ',' + coords[ 11 ] + 'l' + coords[ 12 ] + ',' + coords[ 13 ] + 'qx' + coords[ 14 ] + ',' + coords[ 15 ] + 'x'; }, /** * Return the VML coordinates for all the vertices in the rounded box path. * @param {number} shrinkT - number of pixels to shrink the box path inward from the element's top side. * @param {number} shrinkR - number of pixels to shrink the box path inward from the element's right side. * @param {number} shrinkB - number of pixels to shrink the box path inward from the element's bottom side. * @param {number} shrinkL - number of pixels to shrink the box path inward from the element's left side. * @param {number=} mult If specified, all coordinates will be multiplied by this number * @param {Object=} radii If specified, this will be used for the corner radii instead of the properties * from this renderer's borderRadiusInfo object. * @return {Array.<number>} all the coordinates going clockwise, starting with the top-left corner's lower vertex */ getBoxPathCoords: function( shrinkT, shrinkR, shrinkB, shrinkL, mult, radii ) { var bounds = this.boundsInfo.getBounds(), w = bounds.w * mult, h = bounds.h * mult, M = Math, floor = M.floor, ceil = M.ceil, max = M.max, min = M.min, coords; shrinkT *= mult; shrinkR *= mult; shrinkB *= mult; shrinkL *= mult; if ( !radii ) { radii = this.styleInfos.borderRadiusInfo.getProps(); } if ( radii ) { radii = this.getRadiiPixels( radii ); var tlRadiusX = radii.x['tl'] * mult, tlRadiusY = radii.y['tl'] * mult, trRadiusX = radii.x['tr'] * mult, trRadiusY = radii.y['tr'] * mult, brRadiusX = radii.x['br'] * mult, brRadiusY = radii.y['br'] * mult, blRadiusX = radii.x['bl'] * mult, blRadiusY = radii.y['bl'] * mult; coords = [ floor( shrinkL ), // top-left lower x floor( min( max( tlRadiusY, shrinkT ), h - shrinkB ) ), // top-left lower y floor( min( max( tlRadiusX, shrinkL ), w - shrinkR ) ), // top-left upper x floor( shrinkT ), // top-left upper y ceil( max( shrinkL, w - max( trRadiusX, shrinkR ) ) ), // top-right upper x floor( shrinkT ), // top-right upper y ceil( w - shrinkR ), // top-right lower x floor( min( max( trRadiusY, shrinkT ), h - shrinkB ) ), // top-right lower y ceil( w - shrinkR ), // bottom-right upper x ceil( max( shrinkT, h - max( brRadiusY, shrinkB ) ) ), // bottom-right upper y ceil( max( shrinkL, w - max( brRadiusX, shrinkR ) ) ), // bottom-right lower x ceil( h - shrinkB ), // bottom-right lower y floor( min( max( blRadiusX, shrinkL ), w - shrinkR ) ), // bottom-left lower x ceil( h - shrinkB ), // bottom-left lower y floor( shrinkL ), // bottom-left upper x ceil( max( shrinkT, h - max( blRadiusY, shrinkB ) ) ) // bottom-left upper y ]; } else { // Skip most of the heavy math for a simple non-rounded box var t = floor( shrinkT ), r = ceil( w - shrinkR ), b = ceil( h - shrinkB ), l = floor( shrinkL ); coords = [ l, t, l, t, r, t, r, t, r, b, r, b, l, b, l, b ]; } return coords; }, /** * Hide the actual border of the element. In IE7 and up we can just set its color to transparent; * however IE6 does not support transparent borders so we have to get tricky with it. Also, some elements * like form buttons require removing the border width altogether, so for those we increase the padding * by the border size. */ hideBorder: function() { var el = this.targetElement, cs = el.currentStyle, rs = el.runtimeStyle, tag = el.tagName, isIE6 = PIE.ieVersion === 6, sides, side, i; if( ( isIE6 && ( tag in PIE.childlessElements || tag === 'FIELDSET' ) ) || tag === 'BUTTON' || ( tag === 'INPUT' && el.type in PIE.inputButtonTypes ) ) { rs.borderWidth = ''; sides = this.styleInfos.borderInfo.sides; for( i = sides.length; i--; ) { side = sides[ i ]; rs[ 'padding' + side ] = ''; rs[ 'padding' + side ] = ( PIE.getLength( cs[ 'padding' + side ] ) ).pixels( el ) + ( PIE.getLength( cs[ 'border' + side + 'Width' ] ) ).pixels( el ) + ( PIE.ieVersion !== 8 && i % 2 ? 1 : 0 ); //needs an extra horizontal pixel to counteract the extra "inner border" going away } rs.borderWidth = 0; } else if( isIE6 ) { // Wrap all the element's children in a custom element, set the element to visiblity:hidden, // and set the wrapper element to visiblity:visible. This hides the outer element's decorations // (background and border) but displays all the contents. // TODO find a better way to do this that doesn't mess up the DOM parent-child relationship, // as this can interfere with other author scripts which add/modify/delete children. Also, this // won't work for elements which cannot take children, e.g. input/button/textarea/img/etc. Look into // using a compositor filter or some other filter which masks the border. if( el.childNodes.length !== 1 || el.firstChild.tagName !== 'ie6-mask' ) { var cont = doc.createElement( 'ie6-mask' ), s = cont.style, child; s.visibility = 'visible'; s.zoom = 1; while( child = el.firstChild ) { cont.appendChild( child ); } el.appendChild( cont ); rs.visibility = 'hidden'; } } else { rs.borderColor = 'transparent'; } }, unhideBorder: function() { }, /** * Destroy the rendered objects. This is a base implementation which handles common renderer * structures, but individual renderers may override as necessary. */ destroy: function() { var shapes = this._shapes, s; if ( shapes ) { for( s in shapes ) { if( shapes.hasOwnProperty( s ) ) { this.deleteShape( s ); } } } } }); /** * Root renderer; creates the outermost container element and handles keeping it aligned * with the target element's size and position. * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects */ PIE.RootRenderer = PIE.RendererBase.newRenderer( { isActive: function() { var children = this.childRenderers; for( var i in children ) { if( children.hasOwnProperty( i ) && children[ i ].isActive() ) { return true; } } return false; }, getBoxCssText: function() { var el = this.getPositioningElement(), par = el, docEl, parRect, tgtCS = el.currentStyle, tgtPos = tgtCS.position, boxPos, cs, x = 0, y = 0, elBounds = this.boundsInfo.getBounds(), vis = this.styleInfos.visibilityInfo.getProps(), logicalZoomRatio = elBounds.logicalZoomRatio; if( tgtPos === 'fixed' && PIE.ieVersion > 6 ) { x = elBounds.x * logicalZoomRatio; y = elBounds.y * logicalZoomRatio; boxPos = tgtPos; } else { // Get the element's offsets from its nearest positioned ancestor. Uses // getBoundingClientRect for accuracy and speed. do { par = par.offsetParent; } while( par && ( par.currentStyle.position === 'static' ) ); if( par ) { parRect = par.getBoundingClientRect(); cs = par.currentStyle; x = ( elBounds.x - parRect.left ) * logicalZoomRatio - ( parseFloat(cs.borderLeftWidth) || 0 ); y = ( elBounds.y - parRect.top ) * logicalZoomRatio - ( parseFloat(cs.borderTopWidth) || 0 ); } else { docEl = doc.documentElement; x = ( elBounds.x + docEl.scrollLeft - docEl.clientLeft ) * logicalZoomRatio; y = ( elBounds.y + docEl.scrollTop - docEl.clientTop ) * logicalZoomRatio; } boxPos = 'absolute'; } return 'direction:ltr;' + 'position:absolute;' + 'behavior:none !important;' + 'position:' + boxPos + ';' + 'left:' + x + 'px;' + 'top:' + y + 'px;' + 'z-index:' + ( tgtPos === 'static' ? -1 : tgtCS.zIndex ) + ';' + 'display:' + ( vis.visible && vis.displayed ? 'block' : 'none' ); }, updateBoxStyles: function() { var me = this, boxEl = me.getBoxEl(); if( boxEl && ( me.boundsInfo.positionChanged() || me.styleInfos.visibilityInfo.changed() ) ) { boxEl.style.cssText = me.getBoxCssText(); } }, getPositioningElement: function() { var el = this.targetElement; return el.tagName in PIE.tableCellTags ? el.offsetParent : el; }, /** * Get a reference to the css3pie container element that contains the VML shapes, * if it has been inserted. */ getBoxEl: function() { var box = this._box; if( !box ) { box = this._box = doc.getElementById( '_pie' + PIE.Util.getUID( this ) ); } return box; }, /** * Render any child rendrerer shapes which have not already been rendered into the DOM. */ updateRendering: function() { var me = this, queue = me._shapeRenderQueue, renderedShapes, markup, i, len, j, ref, pos, vis; if (me.isActive()) { if( queue ) { // We've already rendered something once, so do incremental insertion of new shapes renderedShapes = me._renderedShapes; if( renderedShapes ) { for( i = 0, len = queue.length; i < len; i++ ) { for( j = renderedShapes.length; j--; ) { if( renderedShapes[ j ].ordinalGroup < queue[ i ].ordinalGroup ) { break; } } if ( j < 0 ) { ref = me.getBoxEl(); pos = 'afterBegin'; } else { ref = renderedShapes[ j ].getShape(); pos = 'afterEnd'; } ref.insertAdjacentHTML( pos, queue[ i ].getMarkup() ); renderedShapes.splice( j < 0 ? 0 : j, 0, queue[ i ] ); } me._shapeRenderQueue = 0; me.updateBoxStyles(); } // This is the first render, so build up a single markup string and insert it all at once else { vis = me.styleInfos.visibilityInfo.getProps(); if( vis.visible && vis.displayed ) { queue.sort( me.shapeSorter ); markup = [ '<css3pie id="_pie' + PIE.Util.getUID( me ) + '" style="' + me.getBoxCssText() + '">' ]; for( i = 0, len = queue.length; i < len; i++ ) { markup.push( queue[ i ].getMarkup() ); } markup.push( '</css3pie>' ); me.getPositioningElement().insertAdjacentHTML( 'beforeBegin', markup.join( '' ) ); me._renderedShapes = queue; me._shapeRenderQueue = 0; } } } else { me.updateBoxStyles(); } } else { me.destroy(); } }, shapeSorter: function( shape1, shape2 ) { return shape1.ordinalGroup - shape2.ordinalGroup; }, /** * Add a VmlShape into the queue to get rendered in finishUpdate */ enqueueShapeForRender: function( shape ) { var me = this, queue = me._shapeRenderQueue || ( me._shapeRenderQueue = [] ); queue.push( shape ); }, /** * Remove a VmlShape from the DOM and also from the internal list of rendered shapes. */ removeShape: function( shape ) { var shapes = this._renderedShapes, i; if ( shapes ) { for( i = shapes.length; i--; ) { if( shapes[ i ] === shape ) { shapes.splice( i, 1 ); break; } } } }, destroy: function() { var box = this._box, par; if( box && ( par = box.parentNode ) ) { par.removeChild( box ); } delete this._box; delete this._renderedShapes; } } ); // Prime IE for recognizing the custom <css3pie> element doc.createElement( 'css3pie' ); /** * Renderer for element backgrounds. * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.BackgroundRenderer = PIE.RendererBase.newRenderer( { shapeZIndex: 2, needsUpdate: function() { var si = this.styleInfos; return si.backgroundInfo.changed() || si.borderRadiusInfo.changed(); }, isActive: function() { var si = this.styleInfos; return si.borderImageInfo.isActive() || si.borderRadiusInfo.isActive() || si.backgroundInfo.isActive() || ( si.boxShadowInfo.isActive() && si.boxShadowInfo.getProps().inset ); }, /** * Draw the shapes */ draw: function() { var bounds = this.boundsInfo.getBounds(); if( bounds.w && bounds.h ) { this.drawBgColor(); this.drawBgImages(); } }, /** * Draw the background color shape */ drawBgColor: function() { var props = this.styleInfos.backgroundInfo.getProps(), bounds = this.boundsInfo.getBounds(), el = this.targetElement, color = props && props.color, shape, alpha; if( color && color.alpha() > 0 ) { this.hideBackground(); shape = this.getShape( 'bgColor', this.shapeZIndex ); shape.setSize( bounds.w, bounds.h ); shape.setAttrs( 'path', this.getBgClipPath( bounds, props.colorClip ) ); shape.setFillAttrs( 'color', color.colorValue( el ) ); alpha = color.alpha(); if( alpha < 1 ) { shape.setFillAttrs( 'opacity', alpha ); } } else { this.deleteShape( 'bgColor' ); } }, /** * Draw all the background image layers */ drawBgImages: function() { var props = this.styleInfos.backgroundInfo.getProps(), bounds = this.boundsInfo.getBounds(), images = props && props.bgImages, img, shape, w, h, i; if( images ) { this.hideBackground(); w = bounds.w; h = bounds.h; i = images.length; while( i-- ) { img = images[i]; shape = this.getShape( 'bgImage' + i, this.shapeZIndex + ( .5 - i / 1000 ) ); shape.setAttrs( 'path', this.getBgClipPath( bounds, img.bgClip ) ); shape.setSize( w, h ); if( img.imgType === 'linear-gradient' ) { this.addLinearGradient( shape, img ); } else { shape.setFillAttrs( 'type', 'tile', 'color', 'none' ); this.positionBgImage( shape, img.imgUrl, i ); } } } // Delete any bgImage shapes previously created which weren't used above i = images ? images.length : 0; while( this.deleteShape( 'bgImage' + i++ ) ) {} }, /** * Set the position and clipping of the background image for a layer * @param {Element} shape * @param {String} src * @param {number} index */ positionBgImage: function( shape, src, index ) { PIE.Util.withImageSize( src, function( imgSize ) { var me = this, el = me.targetElement, bounds = me.boundsInfo.getBounds(), elW = bounds.w, elH = bounds.h; // It's possible that the element dimensions are zero now but weren't when the original // update executed, make sure that's not the case to avoid divide-by-zero error if( elW && elH ) { var styleInfos = me.styleInfos, bgInfo = styleInfos.backgroundInfo, bg = bgInfo.getProps().bgImages[ index ], bgAreaSize = bgInfo.getBgAreaSize( bg.bgOrigin, me.boundsInfo, styleInfos.borderInfo, styleInfos.paddingInfo ), adjustedImgSize = ( bg.bgSize || PIE.BgSize.DEFAULT ).pixels( me.targetElement, bgAreaSize.w, bgAreaSize.h, imgSize.w, imgSize.h ), bgOriginXY = me.getBgOriginXY( bg.bgOrigin ), bgPos = bg.bgPosition ? bg.bgPosition.coords( el, bgAreaSize.w - adjustedImgSize.w, bgAreaSize.h - adjustedImgSize.h ) : { x:0, y:0 }, repeat = bg.imgRepeat, pxX, pxY, clipT = 0, clipL = 0, clipR = elW + 1, clipB = elH + 1, //make sure the default clip region is not inside the box (by a subpixel) clipAdjust = PIE.ieVersion === 8 ? 0 : 1; //prior to IE8 requires 1 extra pixel in the image clip region // Positioning - find the pixel offset from the top/left and convert to a ratio // The position is shifted by half a pixel, to adjust for the half-pixel coordorigin shift which is // needed to fix antialiasing but makes the bg image fuzzy. pxX = Math.round( bgOriginXY.x + bgPos.x ) + 0.5; pxY = Math.round( bgOriginXY.y + bgPos.y ) + 0.5; shape.setFillAttrs( 'src', src, 'position', ( pxX / elW ) + ',' + ( pxY / elH ), // Set the size of the image. We only set it if the image is scaled via background-size or by // the user changing the browser zoom level, to avoid fuzzy images at normal size. For some reason // using px units doesn't work in VML markup so we must convert to pt. 'size', ( adjustedImgSize.w !== imgSize.w || adjustedImgSize.h !== imgSize.h || bounds.logicalZoomRatio !== 1 || screen['logicalXDPI'] / screen['deviceXDPI'] !== 1 ) ? PIE.Length.pxToPt( adjustedImgSize.w ) + 'pt,' + PIE.Length.pxToPt( adjustedImgSize.h ) + 'pt' : '' ); // Repeating - clip the image shape if( repeat && repeat !== 'repeat' ) { if( repeat === 'repeat-x' || repeat === 'no-repeat' ) { clipT = pxY + 1; clipB = pxY + adjustedImgSize.h + clipAdjust; } if( repeat === 'repeat-y' || repeat === 'no-repeat' ) { clipL = pxX + 1; clipR = pxX + adjustedImgSize.w + clipAdjust; } shape.setStyles( 'clip', 'rect(' + clipT + 'px,' + clipR + 'px,' + clipB + 'px,' + clipL + 'px)' ); } } }, this ); }, /** * For a given background-clip value, return the VML path for that clip area. * @param {Object} bounds * @param {String} bgClip */ getBgClipPath: function( bounds, bgClip ) { var me = this, shrinkT = 0, shrinkR = 0, shrinkB = 0, shrinkL = 0, el = me.targetElement, styleInfos = me.styleInfos, borders, paddings; if ( bgClip && bgClip !== 'border-box' ) { borders = styleInfos.borderInfo.getProps(); if ( borders && ( borders = borders.widths ) ) { shrinkT += borders[ 't' ].pixels( el ); shrinkR += borders[ 'r' ].pixels( el ); shrinkB += borders[ 'b' ].pixels( el ); shrinkL += borders[ 'l' ].pixels( el ); } } if ( bgClip === 'content-box' ) { paddings = styleInfos.paddingInfo.getProps(); if( paddings ) { shrinkT += paddings[ 't' ].pixels( el ); shrinkR += paddings[ 'r' ].pixels( el ); shrinkB += paddings[ 'b' ].pixels( el ); shrinkL += paddings[ 'l' ].pixels( el ); } } // Add points at 0,0 and w,h so that the image size/position will still be // based on the full element area. return 'm0,0r0,0m' + bounds.w * 2 + ',' + bounds.h * 2 + 'r0,0' + me.getBoxPath( shrinkT, shrinkR, shrinkB, shrinkL, 2 ); }, /** * For a given background-origin value, return the x/y position of the origin * from the top-left of the element bounds. * @param {String} bgOrigin */ getBgOriginXY: function( bgOrigin ) { var me = this, el = me.targetElement, styleInfos = me.styleInfos, x = 0, y = 0, borders, paddings; if( bgOrigin !== 'border-box' ) { borders = styleInfos.borderInfo.getProps(); if( borders && ( borders = borders.widths ) ) { x += borders[ 'l' ].pixels( el ); y += borders[ 't' ].pixels( el ); } } if ( bgOrigin === 'content-box' ) { paddings = styleInfos.paddingInfo.getProps(); if( paddings ) { x += paddings[ 'l' ].pixels( el ); y += paddings[ 't' ].pixels( el ); } } return { x: x, y: y }; }, /** * Draw the linear gradient for a gradient layer * @param {Element} shape * @param {Object} info The object holding the information about the gradient */ addLinearGradient: function( shape, info ) { var el = this.targetElement, bounds = this.boundsInfo.getBounds(), w = bounds.w, h = bounds.h, stops = info.stops, stopCount = stops.length, PI = Math.PI, metrics = PIE.GradientUtil.getGradientMetrics( el, w, h, info ), angle = metrics.angle, lineLength = metrics.lineLength, vmlAngle, vmlColors, stopPx, i, j, before, after; // In VML land, the angle of the rendered gradient depends on the aspect ratio of the shape's // bounding box; for example specifying a 45 deg angle actually results in a gradient // drawn diagonally from one corner to its opposite corner, which will only appear to the // viewer as 45 degrees if the shape is equilateral. We adjust for this by taking the x/y deltas // between the start and end points, multiply one of them by the shape's aspect ratio, // and get their arctangent, resulting in an appropriate VML angle. If the angle is perfectly // horizontal or vertical then we don't need to do this conversion. // VML angles go in the opposite direction from CSS angles. vmlAngle = ( angle % 90 ) ? Math.atan2( metrics.startY - metrics.endY, ( metrics.endX - metrics.startX ) * w / h ) / PI * 180 - 90 : -angle; while( vmlAngle < 0 ) { vmlAngle += 360; } vmlAngle = vmlAngle % 360; // Add all the stops to the VML 'colors' list, including the first and last stops. // For each, we find its pixel offset along the gradient-line; if the offset of a stop is less // than that of its predecessor we increase it to be equal. vmlColors = []; // Find the pixel offsets along the CSS3 gradient-line for each stop. stopPx = []; for( i = 0; i < stopCount; i++ ) { stopPx.push( stops[i].offset ? stops[i].offset.pixels( el, lineLength ) : i === 0 ? 0 : i === stopCount - 1 ? lineLength : null ); } // Fill in gaps with evenly-spaced offsets for( i = 1; i < stopCount; i++ ) { if( stopPx[ i ] === null ) { before = stopPx[ i - 1 ]; j = i; do { after = stopPx[ ++j ]; } while( after === null ); stopPx[ i ] = before + ( after - before ) / ( j - i + 1 ); } // Make sure each stop's offset is no less than the one before it stopPx[ i ] = Math.max( stopPx[ i ], stopPx[ i - 1 ] ); } // Convert to percentage along the gradient line and add to the VML 'colors' value for( i = 0; i < stopCount; i++ ) { vmlColors.push( ( stopPx[ i ] / lineLength * 100 ) + '% ' + stops[i].color.colorValue( el ) ); } // Now, finally, we're ready to render the gradient fill. Set the start and end colors to // the first and last stop colors; this just sets outer bounds for the gradient. shape.setFillAttrs( 'angle', vmlAngle, 'type', 'gradient', 'method', 'sigma', 'color', stops[0].color.colorValue( el ), 'color2', stops[stopCount - 1].color.colorValue( el ), 'colors', vmlColors.join( ',' ) ); // Set opacity; right now we only support this for two-stop gradients, multi-stop // opacity will require chopping up each segment into its own shape. // Note these seem backwards but they must be that way since VML strangely reverses // them when the 'colors' property is present. if ( stopCount === 2 ) { shape.setFillAttrs( 'opacity', stops[1].color.alpha(), 'o:opacity2', stops[0].color.alpha() ); } }, /** * Hide the actual background image and color of the element. */ hideBackground: function() { var rs = this.targetElement.runtimeStyle; rs.backgroundImage = 'url(about:blank)'; //ensures the background area reacts to mouse events rs.backgroundColor = 'transparent'; }, destroy: function() { PIE.RendererBase.destroy.call( this ); var rs = this.targetElement.runtimeStyle; rs.backgroundImage = rs.backgroundColor = ''; } } ); /** * Renderer for element borders. * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.BorderRenderer = PIE.RendererBase.newRenderer( { shapeZIndex: 4, /** * Single definition of arguments for use by the per-side creation loop in * getBorderSegmentsInfo. Arguments are, in order: * centerX1, centerY1, outerX1, outerY1, centerX2, centerY2, outerX2, outerY2, baseAngle */ sideArgs: { 't': [ 2, 1, 0, 3, 4, 7, 6, 5, 90 ], 'r': [ 4, 7, 6, 5, 10, 9, 8, 11, 0 ], 'b': [ 10, 9, 8, 11, 12, 15, 14, 13, 270 ], 'l': [ 12, 15, 14, 13, 2, 1, 0, 3, 180 ] }, dashedStyles: { 'dotted': 1, 'dashed': 1 }, colorManipStyles: { 'groove': 1, 'ridge': 1, 'inset': 1, 'outset': 1 }, doubleStyles: { 'groove': 1, 'ridge': 1, 'double': 1 }, needsUpdate: function() { var si = this.styleInfos; return si.borderInfo.changed() || si.borderRadiusInfo.changed(); }, isActive: function() { var si = this.styleInfos; return si.borderRadiusInfo.isActive() && !si.borderImageInfo.isActive() && si.borderInfo.isActive(); //check BorderStyleInfo last because it's the most expensive }, /** * Draw the border shape(s) */ draw: function() { var me = this, props = me.styleInfos.borderInfo.getProps(), bounds = me.boundsInfo.getBounds(), shape, segmentsInfo, i, j, len; if( props ) { me.hideBorder(); segmentsInfo = me.getBorderSegmentsInfo(); for( i = j = 0, len = segmentsInfo.length; i < len; i += 2) { shape = me.getShape( 'border' + j++, me.shapeZIndex ); shape.setSize( bounds.w, bounds.h ); shape.setAttrs( 'path', segmentsInfo[ i ] ); shape.setFillAttrs( 'color', segmentsInfo[ i + 1 ] ); } // remove any previously-created border shapes which didn't get used above while( me.deleteShape( 'border' + j++ ) ) {} } }, /** * Adds rectangular sub-paths at intervals along a given side which serve to "cut out" * those areas, forming the spaces in a dashed or dotted border. * @param {Array.<string>} path The path string array to which the extra sub-paths will be added * @param {number} startCoord The x or y coordinate at which the dashing starts * @param {number} endCoord The x or y coordinate at which the dashing ends * @param {number} sideWidth The width of the border on the target side * @param {number} shift A shift of the perpendicular coordinate * @param {boolean} isVertical True if this is a vertical border (left or right) * @param {string} style The border style, either 'dotted' or 'dashed' */ dashify: function( path, startCoord, endCoord, sideWidth, shift, isVertical, style ) { var dashLength = sideWidth * ( style === 'dashed' ? 3 : 1 ), shift2 = shift + sideWidth, dashEndCoord; // If dash is longer than the box edge, don't make any cutouts if( dashLength < endCoord - startCoord ) { // adjust the start to keep the dash pattern centered on the box edge, favoring full // spaces over full dashes, like WebKit does. startCoord += ( endCoord - startCoord - dashLength ) / 2 % dashLength; // add rectangular sub-paths to cut out each dash's space while( startCoord < endCoord ) { dashEndCoord = Math.min( startCoord + dashLength, endCoord ); path.push( isVertical ? ( 'm' + shift + ',' + startCoord + 'l' + shift + ',' + dashEndCoord + 'l' + shift2 + ',' + dashEndCoord + 'l' + shift2 + ',' + startCoord + 'x' ) : ( 'm' + startCoord + ',' + shift + 'l' + dashEndCoord + ',' + shift + 'l' + dashEndCoord + ',' + shift2 + 'l' + startCoord + ',' + shift2 + 'x' ) ); startCoord += dashLength * 2; } } }, /** * Get the VML path definitions for the border segment(s). * @return {Array.<string>} Pairs of segment info: 1st item in each pair is the path string, 2nd is the fill color */ getBorderSegmentsInfo: function() { var me = this, borderInfo = me.styleInfos.borderInfo, segmentsInfo = []; if( borderInfo.isActive() ) { var mult = 2, el = me.targetElement, bounds = me.boundsInfo.getBounds(), borderProps = borderInfo.getProps(), widths = borderProps.widths, styles = borderProps.styles, colors = borderProps.colors, M = Math, abs = M.abs, round = M.round, wT = round( widths['t'].pixels( el ) ), wR = round( widths['r'].pixels( el ) ), wB = round( widths['b'].pixels( el ) ), wL = round( widths['l'].pixels( el ) ), path = [], innerCoords, outerCoords, doubleOuterCoords, doubleInnerCoords, sideArgs = me.sideArgs, side, deg = 65535, dashedStyles = me.dashedStyles, style, color; // When the border has uniform color and style all the way around, we can get // away with a single VML path shape, otherwise we need four separate shapes. if ( borderProps.stylesSame && borderProps.colorsSame && !( styles[ 't' ] in me.colorManipStyles ) ) { if( colors['t'].alpha() > 0 ) { // Outer path path[ 0 ] = me.getBoxPath( 0, 0, 0, 0, mult ); // If double style, add the middle cutout sub-paths style = styles[ 't' ]; if( style === 'double' ) { path.push( me.getBoxPath( wT / 3, wR / 3, wB / 3, wL / 3, mult ) + me.getBoxPath( wT * 2 / 3, wR * 2 / 3, wB * 2 / 3, wL * 2 / 3, mult ) ); } // If dashed, add the dash cutout sub-paths else if( style in dashedStyles ) { innerCoords = me.getBoxPathCoords( wT, wR, wB, wL, mult ); me.dashify( path, innerCoords[ 2 ], innerCoords[ 4 ], wT * mult, 0, 0, styles[ 't' ] ); me.dashify( path, innerCoords[ 7 ], innerCoords[ 9 ], wR * mult, ( bounds.w - wR ) * mult, 1, styles[ 'r' ] ); me.dashify( path, innerCoords[ 12 ], innerCoords[ 10 ], wB * mult, ( bounds.h - wB ) * mult, 0, styles[ 'b' ] ); me.dashify( path, innerCoords[ 1 ], innerCoords[ 15 ], wL * mult, 0, 1, styles[ 'l' ] ); } // Inner path path.push( me.getBoxPath( wT, wR, wB, wL, mult ) ); segmentsInfo.push( path.join( '' ), colors['t'].colorValue( el ) ); } } else { outerCoords = me.getBoxPathCoords( 0, 0, 0, 0, mult ); innerCoords = me.getBoxPathCoords( wT, wR, wB, wL, mult ); // Build the segment for each side for( side in sideArgs ) { if ( sideArgs.hasOwnProperty( side ) && colors[ side ].alpha() > 0 ) { var args = sideArgs[ side ], centerX1 = args[ 0 ], centerY1 = args[ 1 ], outerX1 = args[ 2 ], outerY1 = args[ 3 ], centerX2 = args[ 4 ], centerY2 = args[ 5 ], outerX2 = args[ 6 ], outerY2 = args[ 7 ], baseAngle = args[ 8 ], isTopLeft = side === 't' || side === 'l'; style = styles[ side ]; // Outer edge path[ 0 ] = 'al' + outerCoords[ centerX1 ] + ',' + outerCoords[ centerY1 ] + ',' + abs( outerCoords[ outerX1 ] - outerCoords[ centerX1 ] ) + ',' + abs( outerCoords[ outerY1 ] - outerCoords[ centerY1 ] ) + ',' + ( baseAngle + 45 ) * deg + ',' + -45 * deg + 'ae' + outerCoords[ centerX2 ] + ',' + outerCoords[ centerY2 ] + ',' + abs( outerCoords[ outerX2 ] - outerCoords[ centerX2 ] ) + ',' + abs( outerCoords[ outerY2 ] - outerCoords[ centerY2 ] ) + ',' + baseAngle * deg + ',' + -45 * deg; // If double style, add the middle sub-paths if( style in me.doubleStyles ) { if( !doubleOuterCoords ) { if ( style === 'double' ) { doubleOuterCoords = me.getBoxPathCoords( wT / 3, wR / 3, wB / 3, wL / 3, mult ); doubleInnerCoords = me.getBoxPathCoords( wT * 2 / 3, wR * 2 / 3, wB * 2 / 3, wL * 2 / 3, mult ); } else { doubleOuterCoords = doubleInnerCoords = me.getBoxPathCoords( wT / 2, wR / 2, wB / 2, wL / 2, mult ); } } path.push( 'ae' + doubleOuterCoords[ centerX2 ] + ',' + doubleOuterCoords[ centerY2 ] + ',' + abs( doubleOuterCoords[ outerX2 ] - doubleOuterCoords[ centerX2 ] ) + ',' + abs( doubleOuterCoords[ outerY2 ] - doubleOuterCoords[ centerY2 ] ) + ',' + ( baseAngle - 45 ) * deg + ',' + 45 * deg + 'ae' + doubleOuterCoords[ centerX1 ] + ',' + doubleOuterCoords[ centerY1 ] + ',' + abs( doubleOuterCoords[ outerX1 ] - doubleOuterCoords[ centerX1 ] ) + ',' + abs( doubleOuterCoords[ outerY1 ] - doubleOuterCoords[ centerY1 ] ) + ',' + baseAngle * deg + ',' + 45 * deg + 'x' ); // Actual 'double' style with have both paths as a single shape, but 'ridge' and // 'groove' need separate shapes for the different colors if( style !== 'double' ) { color = colors[ side ].colorValue( el ) + ( ( style === 'groove' ? isTopLeft : !isTopLeft ) ? ' darken(128)' : ' lighten(128)' ); segmentsInfo.push( path.join( '' ), color ); path.length = 0; //reuse same array for next loop } path.push( 'al' + doubleInnerCoords[ centerX1 ] + ',' + doubleInnerCoords[ centerY1 ] + ',' + abs( doubleInnerCoords[ outerX1 ] - doubleInnerCoords[ centerX1 ] ) + ',' + abs( doubleInnerCoords[ outerY1 ] - doubleInnerCoords[ centerY1 ] ) + ',' + ( baseAngle + 45 ) * deg + ',' + -45 * deg + 'ae' + doubleInnerCoords[ centerX2 ] + ',' + doubleInnerCoords[ centerY2 ] + ',' + abs( doubleInnerCoords[ outerX2 ] - doubleInnerCoords[ centerX2 ] ) + ',' + abs( doubleInnerCoords[ outerY2 ] - doubleInnerCoords[ centerY2 ] ) + ',' + baseAngle * deg + ',' + -45 * deg ); } // Inner edge path.push( 'ae' + innerCoords[ centerX2 ] + ',' + innerCoords[ centerY2 ] + ',' + abs( innerCoords[ outerX2 ] - innerCoords[ centerX2 ] ) + ',' + abs( innerCoords[ outerY2 ] - innerCoords[ centerY2 ] ) + ',' + ( baseAngle - 45 ) * deg + ',' + 45 * deg + 'ae' + innerCoords[ centerX1 ] + ',' + innerCoords[ centerY1 ] + ',' + abs( innerCoords[ outerX1 ] - innerCoords[ centerX1 ] ) + ',' + abs( innerCoords[ outerY1 ] - innerCoords[ centerY1 ] ) + ',' + baseAngle * deg + ',' + 45 * deg + 'x' ); // For dashed/dotted styles, add the dash cutout sub-paths if ( style in dashedStyles ) { side === 't' ? me.dashify( path, innerCoords[ 2 ], innerCoords[ 4 ], wT * mult, 0, 0, style ) : side === 'r' ? me.dashify( path, innerCoords[ 7 ], innerCoords[ 9 ], wR * mult, ( bounds.w - wR ) * mult, 1, style ) : side === 'b' ? me.dashify( path, innerCoords[ 12 ], innerCoords[ 10 ], wB * mult, ( bounds.h - wB ) * mult, 0, style ) : //side === 'l' ? me.dashify( path, innerCoords[ 1 ], innerCoords[ 15 ], wL * mult, 0, 1, style ); } color = colors[ side ].colorValue( el ); if ( style in me.colorManipStyles ) { // lighten or darken as appropriate color += ( ( ( style === 'groove' || style === 'outset' ) ? isTopLeft : !isTopLeft ) ? ' lighten(128)' : ' darken(128)' ); } segmentsInfo.push( path.join( '' ), color ); path.length = 0; //reuse same array for next loop } } } } return segmentsInfo; }, destroy: function() { var me = this; if (me.finalized || !me.styleInfos.borderImageInfo.isActive()) { me.targetElement.runtimeStyle.borderColor = ''; } PIE.RendererBase.destroy.call( me ); } } ); /** * Renderer for border-image * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.BorderImageRenderer = PIE.RendererBase.newRenderer( { shapeZIndex: 5, needsUpdate: function() { return this.styleInfos.borderImageInfo.changed(); }, isActive: function() { return this.styleInfos.borderImageInfo.isActive(); }, draw: function() { var me = this, props = me.styleInfos.borderImageInfo.getProps(), borderProps = me.styleInfos.borderInfo.getProps(), bounds = me.boundsInfo.getBounds(), el = me.targetElement; PIE.Util.withImageSize( props.src, function( imgSize ) { var me = this, elW = bounds.w, elH = bounds.h, zero = PIE.getLength( '0' ), widths = props.widths || ( borderProps ? borderProps.widths : { 't': zero, 'r': zero, 'b': zero, 'l': zero } ), widthT = widths['t'].pixels( el ), widthR = widths['r'].pixels( el ), widthB = widths['b'].pixels( el ), widthL = widths['l'].pixels( el ), slices = props.slice, sliceT = slices['t'].pixels( el ), sliceR = slices['r'].pixels( el ), sliceB = slices['b'].pixels( el ), sliceL = slices['l'].pixels( el ), src = props.src, imgW = imgSize.w, imgH = imgSize.h; function setSizeAndPos( rect, rectX, rectY, rectW, rectH, sliceX, sliceY, sliceW, sliceH ) { // Hide the piece entirely if we have zero dimensions for the image, the rect, or the slice var max = Math.max; if ( !imgW || !imgH || !rectW || !rectH || !sliceW || !sliceH ) { rect.setStyles( 'display', 'none' ); } else { rectW = max( rectW, 0 ); rectH = max( rectH, 0 ); rect.setAttrs( 'path', 'm0,0l' + rectW * 2 + ',0l' + rectW * 2 + ',' + rectH * 2 + 'l0,' + rectH * 2 + 'x' ); rect.setFillAttrs( 'src', src, 'type', 'tile', 'position', '0,0', 'origin', ( ( sliceX - 0.5 ) / imgW ) + ',' + ( ( sliceY - 0.5 ) / imgH ), // For some reason using px units doesn't work in VML markup so we must convert to pt. 'size', PIE.Length.pxToPt( rectW * imgW / sliceW ) + 'pt,' + PIE.Length.pxToPt( rectH * imgH / sliceH ) + 'pt' ); rect.setSize( rectW, rectH ); rect.setStyles( 'left', rectX + 'px', 'top', rectY + 'px', 'display', '' ); } } // Piece positions and sizes // TODO right now this treats everything like 'stretch', need to support other schemes setSizeAndPos( me.getRect( 'tl' ), 0, 0, widthL, widthT, 0, 0, sliceL, sliceT ); setSizeAndPos( me.getRect( 't' ), widthL, 0, elW - widthL - widthR, widthT, sliceL, 0, imgW - sliceL - sliceR, sliceT ); setSizeAndPos( me.getRect( 'tr' ), elW - widthR, 0, widthR, widthT, imgW - sliceR, 0, sliceR, sliceT ); setSizeAndPos( me.getRect( 'r' ), elW - widthR, widthT, widthR, elH - widthT - widthB, imgW - sliceR, sliceT, sliceR, imgH - sliceT - sliceB ); setSizeAndPos( me.getRect( 'br' ), elW - widthR, elH - widthB, widthR, widthB, imgW - sliceR, imgH - sliceB, sliceR, sliceB ); setSizeAndPos( me.getRect( 'b' ), widthL, elH - widthB, elW - widthL - widthR, widthB, sliceL, imgH - sliceB, imgW - sliceL - sliceR, sliceB ); setSizeAndPos( me.getRect( 'bl' ), 0, elH - widthB, widthL, widthB, 0, imgH - sliceB, sliceL, sliceB ); setSizeAndPos( me.getRect( 'l' ), 0, widthT, widthL, elH - widthT - widthB, 0, sliceT, sliceL, imgH - sliceT - sliceB ); setSizeAndPos( me.getRect( 'c' ), widthL, widthT, elW - widthL - widthR, elH - widthT - widthB, sliceL, sliceT, props.fill ? imgW - sliceL - sliceR : 0, imgH - sliceT - sliceB ); }, me ); }, getRect: function( name ) { return this.getShape( 'borderImage_' + name, this.shapeZIndex ); }, prepareUpdate: function() { if (this.isActive()) { var me = this, el = me.targetElement, rs = el.runtimeStyle, widths = me.styleInfos.borderImageInfo.getProps().widths; // Force border-style to solid so it doesn't collapse rs.borderStyle = 'solid'; // If widths specified in border-image shorthand, override border-width if ( widths ) { rs.borderTopWidth = widths['t'].pixels( el ); rs.borderRightWidth = widths['r'].pixels( el ); rs.borderBottomWidth = widths['b'].pixels( el ); rs.borderLeftWidth = widths['l'].pixels( el ); } // Make the border transparent me.hideBorder(); } }, destroy: function() { var me = this, rs = me.targetElement.runtimeStyle; rs.borderStyle = ''; if (me.finalized || !me.styleInfos.borderInfo.isActive()) { rs.borderColor = rs.borderWidth = ''; } PIE.RendererBase.destroy.call( me ); } } ); /** * Renderer for outset box-shadows * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.BoxShadowOutsetRenderer = PIE.RendererBase.newRenderer( { shapeZIndex: 1, needsUpdate: function() { var si = this.styleInfos; return si.boxShadowInfo.changed() || si.borderRadiusInfo.changed(); }, isActive: function() { var boxShadowInfo = this.styleInfos.boxShadowInfo; return boxShadowInfo.isActive() && boxShadowInfo.getProps().outset[0]; }, draw: function() { var me = this, el = me.targetElement, styleInfos = me.styleInfos, shadowInfos = styleInfos.boxShadowInfo.getProps().outset, radii = styleInfos.borderRadiusInfo.getProps(), len = shadowInfos.length, i = len, bounds = me.boundsInfo.getBounds(), w = bounds.w, h = bounds.h, shadowInfo, shape, xOff, yOff, spread, blur, shrink, color, alpha, path, totalW, totalH, focusX, focusY, focusAdjustRatio; while( i-- ) { shadowInfo = shadowInfos[ i ]; xOff = shadowInfo.xOffset.pixels( el ); yOff = shadowInfo.yOffset.pixels( el ); spread = shadowInfo.spread.pixels( el ); blur = shadowInfo.blur.pixels( el ); color = shadowInfo.color; alpha = color.alpha(); color = color.colorValue( el ); // Shape path shrink = -spread - blur; if( !radii && blur ) { // If blurring, use a non-null border radius info object so that getBoxPath will // round the corners of the expanded shadow shape rather than squaring them off. radii = PIE.BorderRadiusStyleInfo.ALL_ZERO; } path = me.getBoxPath( shrink, shrink, shrink, shrink, 2, radii ); // Create the shape object shape = me.getShape( 'shadow' + i, me.shapeZIndex + ( .5 - i / 1000 ) ); if( blur ) { totalW = ( spread + blur ) * 2 + w; totalH = ( spread + blur ) * 2 + h; focusX = totalW ? blur * 2 / totalW : 0; focusY = totalH ? blur * 2 / totalH : 0; // If the blur is larger than half the element's narrowest dimension, then its focussize // will to be less than zero which results in ugly artifacts. To get around this, we adjust // the focus to keep it centered and then bump the center opacity down to match. if (focusX > 0.5 || focusY > 0.5) { focusAdjustRatio = 0.5 / Math.max(focusX, focusY); focusX *= focusAdjustRatio; focusY *= focusAdjustRatio; alpha *= focusAdjustRatio * focusAdjustRatio; //this is a rough eyeball-adjustment, could be refined } shape.setFillAttrs( 'type', 'gradienttitle', //makes the VML gradient follow the shape's outline - hooray for undocumented features?!?! 'color2', color, 'focusposition', focusX + ',' + focusY, 'focussize', ( 1 - focusX * 2 ) + ',' + ( 1 - focusY * 2 ), 'opacity', 0, 'o:opacity2', alpha ); } else { shape.setFillAttrs( 'type', 'solid', 'opacity', alpha ); } shape.setAttrs( 'path', path ); shape.setFillAttrs( 'color', color ); shape.setStyles( 'left', xOff + 'px', 'top', yOff + 'px' ); shape.setSize( w, h ); } // Delete any shadow shapes previously created which weren't reused above while( me.deleteShape( 'shadow' + len++ ) ) {} } } ); /** * Renderer for re-rendering img elements using VML. Kicks in if the img has * a border-radius applied, or if the -pie-png-fix flag is set. * @constructor * @param {Element} el The target element * @param {Object} styleInfos The StyleInfo objects * @param {PIE.RootRenderer} parent */ PIE.ImgRenderer = PIE.RendererBase.newRenderer( { shapeZIndex: 6, needsUpdate: function() { var si = this.styleInfos; return this.targetElement.src !== this._lastSrc || si.borderRadiusInfo.changed(); }, isActive: function() { var si = this.styleInfos; return si.borderRadiusInfo.isActive() || si.backgroundInfo.isPngFix(); }, draw: function() { this._lastSrc = src; this.hideActualImg(); var shape = this.getShape( 'img', this.shapeZIndex ), bounds = this.boundsInfo.getBounds(), w = bounds.w, h = bounds.h, borderProps = this.styleInfos.borderInfo.getProps(), borderWidths = borderProps && borderProps.widths, el = this.targetElement, src = el.src, round = Math.round, paddings = this.styleInfos.paddingInfo.getProps(), zero; // In IE6, the BorderRenderer will have hidden the border by moving the border-width to // the padding; therefore we want to pretend the borders have no width so they aren't doubled // when adding in the current padding value below. if( !borderWidths || PIE.ieVersion < 7 ) { zero = PIE.getLength( '0' ); borderWidths = { 't': zero, 'r': zero, 'b': zero, 'l': zero }; } shape.setAttrs( 'path', this.getBoxPath( round( borderWidths['t'].pixels( el ) + paddings[ 't' ].pixels( el ) ), round( borderWidths['r'].pixels( el ) + paddings[ 'r' ].pixels( el ) ), round( borderWidths['b'].pixels( el ) + paddings[ 'b' ].pixels( el ) ), round( borderWidths['l'].pixels( el ) + paddings[ 'l' ].pixels( el ) ), 2 ) ); shape.setFillAttrs( 'type', 'frame', 'src', src, 'position', (w ? 0.5 / w : 0) + ',' + (h ? 0.5 / h : 0) ); shape.setSize( w, h ); }, hideActualImg: function() { this.targetElement.runtimeStyle.filter = 'alpha(opacity=0)'; }, destroy: function() { PIE.RendererBase.destroy.call( this ); this.targetElement.runtimeStyle.filter = ''; } } ); PIE.Element = (function() { var wrappers = {}, lazyInitCssProp = PIE.CSS_PREFIX + 'lazy-init', pollCssProp = PIE.CSS_PREFIX + 'poll', trackActiveCssProp = PIE.CSS_PREFIX + 'track-active', trackHoverCssProp = PIE.CSS_PREFIX + 'track-hover', hoverClass = PIE.CLASS_PREFIX + 'hover', activeClass = PIE.CLASS_PREFIX + 'active', focusClass = PIE.CLASS_PREFIX + 'focus', firstChildClass = PIE.CLASS_PREFIX + 'first-child', ignorePropertyNames = { 'background':1, 'bgColor':1, 'display': 1 }, classNameRegExes = {}, dummyArray = []; function addClass( el, className ) { el.className += ' ' + className; } function removeClass( el, className ) { var re = classNameRegExes[ className ] || ( classNameRegExes[ className ] = new RegExp( '\\b' + className + '\\b', 'g' ) ); el.className = el.className.replace( re, '' ); } function delayAddClass( el, className /*, className2*/ ) { var classes = dummyArray.slice.call( arguments, 1 ), i = classes.length; setTimeout( function() { if( el ) { while( i-- ) { addClass( el, classes[ i ] ); } } }, 0 ); } function delayRemoveClass( el, className /*, className2*/ ) { var classes = dummyArray.slice.call( arguments, 1 ), i = classes.length; setTimeout( function() { if( el ) { while( i-- ) { removeClass( el, classes[ i ] ); } } }, 0 ); } function Element( el ) { var me = this, childRenderers, rootRenderer, boundsInfo = new PIE.BoundsInfo( el ), styleInfos, styleInfosArr, initializing, initialized, eventsAttached, eventListeners = [], delayed, destroyed, poll; me.el = el; /** * Initialize PIE for this element. */ function init() { if( !initialized ) { var docEl, bounds, ieDocMode = PIE.ieDocMode, cs = el.currentStyle, lazy = cs.getAttribute( lazyInitCssProp ) === 'true', trackActive = cs.getAttribute( trackActiveCssProp ) !== 'false', trackHover = cs.getAttribute( trackHoverCssProp ) !== 'false'; // Polling for size/position changes: default to on in IE8, off otherwise, overridable by -pie-poll poll = cs.getAttribute( pollCssProp ); poll = ieDocMode > 7 ? poll !== 'false' : poll === 'true'; // Force layout so move/resize events will fire. Set this as soon as possible to avoid layout changes // after load, but make sure it only gets called the first time through to avoid recursive calls to init(). if( !initializing ) { initializing = 1; el.runtimeStyle.zoom = 1; initFirstChildPseudoClass(); } boundsInfo.lock(); // If the -pie-lazy-init:true flag is set, check if the element is outside the viewport and if so, delay initialization if( lazy && ( bounds = boundsInfo.getBounds() ) && ( docEl = doc.documentElement || doc.body ) && ( bounds.y > docEl.clientHeight || bounds.x > docEl.clientWidth || bounds.y + bounds.h < 0 || bounds.x + bounds.w < 0 ) ) { if( !delayed ) { delayed = 1; PIE.OnScroll.observe( init ); } } else { initialized = 1; delayed = initializing = 0; PIE.OnScroll.unobserve( init ); // Create the style infos and renderers if ( ieDocMode === 9 ) { styleInfos = { backgroundInfo: new PIE.BackgroundStyleInfo( el ), borderImageInfo: new PIE.BorderImageStyleInfo( el ), borderInfo: new PIE.BorderStyleInfo( el ), paddingInfo: new PIE.PaddingStyleInfo( el ) }; styleInfosArr = [ styleInfos.backgroundInfo, styleInfos.borderInfo, styleInfos.borderImageInfo, styleInfos.paddingInfo ]; rootRenderer = new PIE.IE9RootRenderer( el, boundsInfo, styleInfos ); childRenderers = [ new PIE.IE9BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.IE9BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer ) ]; } else { styleInfos = { backgroundInfo: new PIE.BackgroundStyleInfo( el ), borderInfo: new PIE.BorderStyleInfo( el ), borderImageInfo: new PIE.BorderImageStyleInfo( el ), borderRadiusInfo: new PIE.BorderRadiusStyleInfo( el ), boxShadowInfo: new PIE.BoxShadowStyleInfo( el ), paddingInfo: new PIE.PaddingStyleInfo( el ), visibilityInfo: new PIE.VisibilityStyleInfo( el ) }; styleInfosArr = [ styleInfos.backgroundInfo, styleInfos.borderInfo, styleInfos.borderImageInfo, styleInfos.borderRadiusInfo, styleInfos.boxShadowInfo, styleInfos.paddingInfo, styleInfos.visibilityInfo ]; rootRenderer = new PIE.RootRenderer( el, boundsInfo, styleInfos ); childRenderers = [ new PIE.BoxShadowOutsetRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ), //new PIE.BoxShadowInsetRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.BorderRenderer( el, boundsInfo, styleInfos, rootRenderer ), new PIE.BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer ) ]; if( el.tagName === 'IMG' ) { childRenderers.push( new PIE.ImgRenderer( el, boundsInfo, styleInfos, rootRenderer ) ); } rootRenderer.childRenderers = childRenderers; // circular reference, can't pass in constructor; TODO is there a cleaner way? } // Add property change listeners to ancestors if requested initAncestorEventListeners(); // Add to list of polled elements when -pie-poll:true if( poll ) { PIE.Heartbeat.observe( update ); PIE.Heartbeat.run(); } // Trigger rendering update( 0, 1 ); } if( !eventsAttached ) { eventsAttached = 1; if( ieDocMode < 9 ) { addListener( el, 'onmove', handleMoveOrResize ); } addListener( el, 'onresize', handleMoveOrResize ); addListener( el, 'onpropertychange', propChanged ); if( trackHover ) { addListener( el, 'onmouseenter', mouseEntered ); } if( trackHover || trackActive ) { addListener( el, 'onmouseleave', mouseLeft ); } if( trackActive ) { addListener( el, 'onmousedown', mousePressed ); } if( el.tagName in PIE.focusableElements ) { addListener( el, 'onfocus', focused ); addListener( el, 'onblur', blurred ); } PIE.OnResize.observe( handleMoveOrResize ); PIE.OnUnload.observe( removeEventListeners ); } boundsInfo.unlock(); } } /** * Event handler for onmove and onresize events. Invokes update() only if the element's * bounds have previously been calculated, to prevent multiple runs during page load when * the element has no initial CSS3 properties. */ function handleMoveOrResize() { if( boundsInfo && boundsInfo.hasBeenQueried() ) { update(); } } /** * Update position and/or size as necessary. Both move and resize events call * this rather than the updatePos/Size functions because sometimes, particularly * during page load, one will fire but the other won't. */ function update( isPropChange, force ) { if( !destroyed ) { if( initialized ) { lockAll(); var i = 0, len = childRenderers.length, sizeChanged = boundsInfo.sizeChanged(); for( ; i < len; i++ ) { childRenderers[i].prepareUpdate(); } for( i = 0; i < len; i++ ) { if( force || sizeChanged || ( isPropChange && childRenderers[i].needsUpdate() ) ) { childRenderers[i].updateRendering(); } } if( force || sizeChanged || isPropChange || boundsInfo.positionChanged() ) { rootRenderer.updateRendering(); } unlockAll(); } else if( !initializing ) { init(); } } } /** * Handle property changes to trigger update when appropriate. */ function propChanged() { // Some elements like <table> fire onpropertychange events for old-school background properties // ('background', 'bgColor') when runtimeStyle background properties are changed, which // results in an infinite loop; therefore we filter out those property names. Also, 'display' // is ignored because size calculations don't work correctly immediately when its onpropertychange // event fires, and because it will trigger an onresize event anyway. if( initialized && !( event && event.propertyName in ignorePropertyNames ) ) { update( 1 ); } } /** * Handle mouseenter events. Adds a custom class to the element to allow IE6 to add * hover styles to non-link elements, and to trigger a propertychange update. */ function mouseEntered() { //must delay this because the mouseenter event fires before the :hover styles are added. delayAddClass( el, hoverClass ); } /** * Handle mouseleave events */ function mouseLeft() { //must delay this because the mouseleave event fires before the :hover styles are removed. delayRemoveClass( el, hoverClass, activeClass ); } /** * Handle mousedown events. Adds a custom class to the element to allow IE6 to add * active styles to non-link elements, and to trigger a propertychange update. */ function mousePressed() { //must delay this because the mousedown event fires before the :active styles are added. delayAddClass( el, activeClass ); // listen for mouseups on the document; can't just be on the element because the user might // have dragged out of the element while the mouse button was held down PIE.OnMouseup.observe( mouseReleased ); } /** * Handle mouseup events */ function mouseReleased() { //must delay this because the mouseup event fires before the :active styles are removed. delayRemoveClass( el, activeClass ); PIE.OnMouseup.unobserve( mouseReleased ); } /** * Handle focus events. Adds a custom class to the element to trigger a propertychange update. */ function focused() { //must delay this because the focus event fires before the :focus styles are added. delayAddClass( el, focusClass ); } /** * Handle blur events */ function blurred() { //must delay this because the blur event fires before the :focus styles are removed. delayRemoveClass( el, focusClass ); } /** * Handle property changes on ancestors of the element; see initAncestorEventListeners() * which adds these listeners as requested with the -pie-watch-ancestors CSS property. */ function ancestorPropChanged() { var name = event.propertyName; if( name === 'className' || name === 'id' || name.indexOf( 'style.' ) === 0 ) { propChanged(); } } function lockAll() { boundsInfo.lock(); for( var i = styleInfosArr.length; i--; ) { styleInfosArr[i].lock(); } } function unlockAll() { for( var i = styleInfosArr.length; i--; ) { styleInfosArr[i].unlock(); } boundsInfo.unlock(); } function addListener( targetEl, type, handler ) { targetEl.attachEvent( type, handler ); eventListeners.push( [ targetEl, type, handler ] ); } /** * Remove all event listeners from the element and any monitored ancestors. */ function removeEventListeners() { if (eventsAttached) { var i = eventListeners.length, listener; while( i-- ) { listener = eventListeners[ i ]; listener[ 0 ].detachEvent( listener[ 1 ], listener[ 2 ] ); } PIE.OnUnload.unobserve( removeEventListeners ); eventsAttached = 0; eventListeners = []; } } /** * Clean everything up when the behavior is removed from the element, or the element * is manually destroyed. */ function destroy() { if( !destroyed ) { var i, len; removeEventListeners(); destroyed = 1; // destroy any active renderers if( childRenderers ) { for( i = 0, len = childRenderers.length; i < len; i++ ) { childRenderers[i].finalized = 1; childRenderers[i].destroy(); } } rootRenderer.destroy(); // Remove from list of polled elements in IE8 if( poll ) { PIE.Heartbeat.unobserve( update ); } // Stop onresize listening PIE.OnResize.unobserve( update ); // Kill references childRenderers = rootRenderer = boundsInfo = styleInfos = styleInfosArr = el = null; me.el = me = 0; } } /** * If requested via the custom -pie-watch-ancestors CSS property, add onpropertychange and * other event listeners to ancestor(s) of the element so we can pick up style changes * based on CSS rules using descendant selectors. */ function initAncestorEventListeners() { var watch = el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'watch-ancestors' ), i, a; if( watch ) { watch = parseInt( watch, 10 ); i = 0; a = el.parentNode; while( a && ( watch === 'NaN' || i++ < watch ) ) { addListener( a, 'onpropertychange', ancestorPropChanged ); addListener( a, 'onmouseenter', mouseEntered ); addListener( a, 'onmouseleave', mouseLeft ); addListener( a, 'onmousedown', mousePressed ); if( a.tagName in PIE.focusableElements ) { addListener( a, 'onfocus', focused ); addListener( a, 'onblur', blurred ); } a = a.parentNode; } } } /** * If the target element is a first child, add a pie_first-child class to it. This allows using * the added class as a workaround for the fact that PIE's rendering element breaks the :first-child * pseudo-class selector. */ function initFirstChildPseudoClass() { var tmpEl = el, isFirst = 1; while( tmpEl = tmpEl.previousSibling ) { if( tmpEl.nodeType === 1 ) { isFirst = 0; break; } } if( isFirst ) { addClass( el, firstChildClass ); } } // These methods are all already bound to this instance so there's no need to wrap them // in a closure to maintain the 'this' scope object when calling them. me.init = init; me.destroy = destroy; } Element.getInstance = function( el ) { var id = el[ 'uniqueID' ]; return wrappers[ id ] || ( wrappers[ id ] = new Element( el ) ); }; Element.destroy = function( el ) { var id = el[ 'uniqueID' ], wrapper = wrappers[ id ]; if( wrapper ) { wrapper.destroy(); delete wrappers[ id ]; } }; Element.destroyAll = function() { var els = [], wrapper; if( wrappers ) { for( var w in wrappers ) { if( wrappers.hasOwnProperty( w ) ) { wrapper = wrappers[ w ]; els.push( wrapper.el ); wrapper.destroy(); } } wrappers = {}; } return els; }; return Element; })(); /* * This file exposes the public API for invoking PIE. */ /** * The version number of this PIE build. */ PIE[ 'version' ] = '2.0beta1'; /** * @property supportsVML * True if the current IE browser environment has a functioning VML engine. Should be true * in most IEs, but in rare cases may be false. If false, PIE will exit immediately when * attached to an element (for IE<9) to prevent errors; this property may also be used for * debugging or by external scripts to perform some special action when VML support is absent. * @type {boolean} */ PIE[ 'supportsVML' ] = PIE.supportsVML; /** * Programatically attach PIE to a single element. * @param {Element} el */ PIE[ 'attach' ] = function( el ) { if ( PIE.ieDocMode === 9 || ( PIE.ieDocMode < 9 && PIE.supportsVML ) ) { PIE.Element.getInstance( el ).init(); } }; /** * Programatically detach PIE from a single element. * @param {Element} el */ PIE[ 'detach' ] = function( el ) { PIE.Element.destroy( el ); }; })( window, document );
0x6a
trunk/libraries/css/pie-2.0/PIE_IE678_uncompressed.js
JavaScript
asf20
169,586
ul.cdsectabs,ul#cdtoptabs,ul#cdtoptabs li,form.cdfullsrchctrl{margin:0;padding:0;} div#cdtabarea{width:100%;background-image:url('../images/menu/tab_area_background.png?b=5603.4000');background-repeat:repeat-x;font-size:11px;} ul#cdtoptabs{list-style-type:none;margin:0 auto 0 auto;white-space:nowrap;height: 30px} ul#cdtoptabs li{height:30px;} ul#cdtoptabs li.cdclr{margin-top:-1.2em;} ul#cdtoptabs li.cdtopn{display:inline-block;float:left;margin:0 0 1px 0;padding:0;height:30px;width:auto;} ul#cdtoptabs li.cdtopn a,ul#cdtoptabs li.cdtopn span{ display:block; padding:0px 12px 0px 12px; color:#545454; outline:none;text-decoration:none; height: 26px;line-height: 24px } ul#cdtoptabs li.cdhzmore > a,ul#cdtoptabs li.cdhzmore > span{ display:block;padding:0px 5px 0px 12px;float:left;} ul#cdtoptabs li.cdtopn > img{display:block;float:left;padding:10px 12px 10px 0;} li.cdhzmore img{display:block;float:right;padding:8px 20px 10px 0;} ul#cdtoptabs li.cdtbhlder > a{cursor:default;} ul#cdtoptabs li.cdtopn:hover,ul#cdtoptabs li.cdtabfoc{background:url('../images/menu/tab_right_ul.png?b=5603.4000') no-repeat right top;margin:0;} ul#cdtoptabs li.cdtopn:hover a,ul#cdtoptabs li.cdtopn:hover > span,ul#cdtoptabs li.cdtabfoc a{background:url('../images/menu/tab_left_ul.png?b=5603.4000') no-repeat left top;color:#333;text-decoration:none;outline:none;} ul#cdtoptabs li.cdtopn.cdselected{background:url('../images/menu/tab_selected_right.png?b=5603.4000') no-repeat right top;margin:0;border-bottom:0px solid white;} ul#cdtoptabs li.cdtopn.cdselected a,ul#cdtoptabs li.cdtopn.cdselected span{background:url('../images/menu/tab_selected_left.png?b=5603.4000') no-repeat left top;color:#333;text-decoration:none;outline:none;} ul#cdtoptabs li.cdhzmore{position:relative;border-bottom-width:0;} ul#cdtoptabs li.cdtopn.fr{float: right} ul#cdtoptabs li.cdtopn.fr ul.cdsectabs{right: 0;left: auto} ul#cdtoptabs li.cdtopn.fr ul li.cdsecn{ border-left: 0px solid #D7D7D7;text-align: right; border-right: 1px solid #fff; background:url('../images/menu/sectab_bg_right.png') no-repeat left top; } ul#cdtoptabs li.cdtopn.fr ul li.cdsecn,ul#cdtoptabs li.cdtopn.fr ul li.cdsecn:hover{ /* border-right: 1px solid #D7D7D7;*/ } ul#cdtoptabs li.cdtopn.fr ul li.cdsecn a,ul#cdtoptabs li.cdtopn.fr ul li.cdsecn span{ /* border-right: 1px solid #fff;*/ } ul#cdtoptabs li.cdtopn.fr ul li.cdsecn:hover{ border-left: 0px solid #D7D7D7;text-align: right; background:url('../images/menu/sectab_bg_right_sel.png') no-repeat left top; border-right: 1px solid #fff; } ul#cdtoptabs li.cdtopn.fr ul li.cdsecn.cdsecnlast{border-right: 0px solid #fff;} ul#cdtoptabs li ul.cdsectabs{list-style-type:none;margin:0;padding-bottom:1px;min-width:160px;position:absolute;z-index:1000;top:30px;left:0;display:none;} ul#cdtoptabs li ul.cdsectabs ul.cdsectabs {list-style-type:none;margin:0;padding-bottom:1px;min-width:160px;position:absolute; z-index:1000;top:0px;left:241px;display:none;} ul#cdtoptabs li:hover ul.cdsectabs{display:block} ul#cdtoptabs li:hover ul.cdsectabs li ul.cdsectabs{display:none} ul#cdtoptabs li:hover ul.cdsectabs li:hover ul.cdsectabs{display:block} *+html ul#cdtoptabs li ul.cdsectabs{width:300px;} ul#cdtoptabs li ul.cdsectabs li.cdsecn{border-left: 0px solid #D7D7D7;float:none;background:url('../images/menu/sectab_bg_right.png?b=5603.4000') no-repeat right top;display:block;height:26px;} ul#cdtoptabs li ul.cdsectabs li.cdsecn a,ul#cdtoptabs li ul.cdsectabs li.cdsecn span{background:url('../images/menu/sectab_bg_left.png') no-repeat left top;display:block;height:11px;text-decoration:none;color:#545454;margin-left:-6px;padding-left:31px;height:26px;} ul#cdtoptabs li ul.cdsectabs li.cdsecn:hover,ul#cdtoptabs li ul.cdsectabs li.cdsecn.cdtabfoc{background:url('../images/menu/sectab_bg_right_sel.png?b=5603.4000') no-repeat right top;border-bottom:none;} ul#cdtoptabs li ul.cdsectabs li.cdsecn:hover a,ul#cdtoptabs li ul.cdsectabs li.cdtabfoc a{color:#333;outline:none;border-bottom:none;height: 26px;} ul#cdtoptabs li ul.cdsectabs li.cdsecn.cdsecnlast{border-left: 0px solid #D7D7D7;background:url('../images/menu/sectab_bg_right_last.png?b=5603.4000') no-repeat right top;} ul#cdtoptabs li ul.cdsectabs li.cdsecn.cdsecnlast span{background:url('../images/menu/sectab_bg_left_last.png?b=5603.4000') no-repeat left top;height:11px;} ul#cdtoptabs li ul.cdsectabs li.cdsecn.cdsecnlast:hover{background:url('../images/menu/sectab_bg_right_last.png?b=5603.4000') no-repeat right top;}
0x6a
trunk/libraries/css/menu.css
CSS
asf20
4,548
.animate0 { -webkit-animation-duration: .8s; -webkit-animation-delay: 0s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 0s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 0s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 0s; animation-timing-function: ease; animation-fill-mode: both; } .animate1{ -webkit-animation-duration: .8s; -webkit-animation-delay: .2s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: .2s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: .2s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: .2s; animation-timing-function: ease; animation-fill-mode: both; } .animate2{ -webkit-animation-duration: .8s; -webkit-animation-delay: .4s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: .4s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: .4s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: .4s; animation-timing-function: ease; animation-fill-mode: both; } .animate3{ -webkit-animation-duration: .8s; -webkit-animation-delay: .6s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: .6s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: .6s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: .6s; animation-timing-function: ease; animation-fill-mode: both; } .animate4{ -webkit-animation-duration: .8s; -webkit-animation-delay: .8s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: .8s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: .8s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: .8s; animation-timing-function: ease; animation-fill-mode: both; } .animate5{ -webkit-animation-duration: .8s; -webkit-animation-delay: 1s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 1s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 1s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 1s; animation-timing-function: ease; animation-fill-mode: both; } .animate6{ -webkit-animation-duration: .8s; -webkit-animation-delay: 1.2s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 1.2s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 1.2s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 1.2s; animation-timing-function: ease; animation-fill-mode: both; } .animate7{ -webkit-animation-duration: .8s; -webkit-animation-delay: 1.4s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 1.4s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 1.4s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 1.4s; animation-timing-function: ease; animation-fill-mode: both; } .animate8{ -webkit-animation-duration: .8s; -webkit-animation-delay: 1.8s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 1.8s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 1.8s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 1.8s; animation-timing-function: ease; animation-fill-mode: both; } .animate9{ -webkit-animation-duration: .8s; -webkit-animation-delay: 1.8s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 1.8s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 1.8s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 1.8s; animation-timing-function: ease; animation-fill-mode: both; } .animate10{ -webkit-animation-duration: .8s; -webkit-animation-delay: 2.0s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 2.0s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 2.0s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 2.0s; animation-timing-function: ease; animation-fill-mode: both; } .animate11{ -webkit-animation-duration: .8s; -webkit-animation-delay: 2.2s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 2.2s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 2.2s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 2.2s; animation-timing-function: ease; animation-fill-mode: both; } .animate12{ -webkit-animation-duration: .8s; -webkit-animation-delay: 2.4s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 2.4s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 2.4s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 2.4s; animation-timing-function: ease; animation-fill-mode: both; } .animate13{ -webkit-animation-duration: .8s; -webkit-animation-delay: 2.8s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 2.8s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 2.8s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 2.8s; animation-timing-function: ease; animation-fill-mode: both; } .animate14{ -webkit-animation-duration: .8s; -webkit-animation-delay: 2.8s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 2.8s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 2.8s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 2.8s; animation-timing-function: ease; animation-fill-mode: both; } .animate15{ -webkit-animation-duration: .8s; -webkit-animation-delay: 3.0s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 3.0s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 3.0s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 3.0s; animation-timing-function: ease; animation-fill-mode: both; } .animate16{ -webkit-animation-duration: .8s; -webkit-animation-delay: 3.2s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 3.2s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 3.2s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 3.2s; animation-timing-function: ease; animation-fill-mode: both; } .animate17{ -webkit-animation-duration: .8s; -webkit-animation-delay: 3.4s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 3.4s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 3.4s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 3.4s; animation-timing-function: ease; animation-fill-mode: both; } .animate18{ -webkit-animation-duration: .8s; -webkit-animation-delay: 3.6s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 3.6s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 3.6s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 3.6s; animation-timing-function: ease; animation-fill-mode: both; } .animate19{ -webkit-animation-duration: .8s; -webkit-animation-delay: 3.8s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 3.8s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 3.8s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 3.8s; animation-timing-function: ease; animation-fill-mode: both; } .animate20{ -webkit-animation-duration: .8s; -webkit-animation-delay: 4.0s; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: both; -moz-animation-duration: .8s; -moz-animation-delay: 4.0s; -moz-animation-timing-function: ease; -moz-animation-fill-mode: both; -ms-animation-duration: .8s; -ms-animation-delay: 4.0s; -ms-animation-timing-function: ease; -ms-animation-fill-mode: both; animation-duration: .8s; animation-delay: 4.0s; animation-timing-function: ease; animation-fill-mode: both; }
0x6a
trunk/libraries/css/animate.delay.css
CSS
asf20
11,428
<!DOCTYPE html> <html lang="en"> <head> <title>403 Request forbidden</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style type="text/css"> body{background: #ebebeb;font-family: dotum,tahoma} .error_contain{ padding: 0px; position:relative; } .error_contain div{ width:500px;margin:0 auto; } .error_contain h1{ padding: 40px 0; font-family: arial; text-align: center; margin: 0; font-size: 169px; line-height: normal; color: #ffffff; text-shadow: 0 0 10px #ffffff, 0 4px 3px #ffffff, 0 9px 3px #dddddd, 0 12px 1px #cccccc, 0 14px 5px rgba(0, 0, 0, 0.4), 0 20px 10px rgba(0, 0, 0, 0.1), 0 15px 80px rgba(0, 0, 100, 0.2); } .error_contain h3{color: #777;margin: 0;padding: 8px;padding-top: 20px} .error_contain p{margin: 0;padding: 8px;color: #777;text-align: justify;font-size: 13px} </style> </head> <body> <div class="error_contain"> <h1 style="">403</h1> <div> <h3>Oops! Request forbidden...<span style="float: right">٩(๏̯͡๏)۶</span></h3> <p> Sorry, it appears the page you were looking for is forbidden and not accessible. If the problem persists, please contact our support at example@domain.com. </p> </div> </div> </body> </html>
0x6a
trunk/libraries/css/index.html
HTML
asf20
1,319
/* Project : 48c6c450f1a4a0cc53d9585dc0fee742 Created on : Mar 16, 2013, 11:29:15 PM Author : Truong Khuong - khuongxuantruong@gmail.com Description : Purpose of the stylesheet follows. */ @import url("icon.css"); /*.jqx-widget{-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-o-user-select: none;user-select: none;-ms-user-select:none;-webkit-touch-callout:none;}*/ @-webkit-keyframes loaddingbar {0% {background-position: 0 0;} 100% {background-position: -20px 0;}} .loaddingbar{position: fixed;bottom: 1px;left: 0;right:0;border: 1px solid white;z-index: 9999;outline: 1px solid blue;display: none;} .loaddingbar div{height: 8px;background-repeat: repeat-x;background-size: 20px 10px;background-color: #ccc;background-attachment: scroll;background-image: -webkit-linear-gradient(315deg,transparent,transparent 33%,rgba(0,0,0,0.2) 33%,rgba(0,0,0,0.2) 66%,transparent 66%,transparent);background-image: -moz-linear-gradient(315deg,transparent,transparent 33%,rgba(0,0,0,0.2) 33%,rgba(0,0,0,0.2) 66%,transparent 66%,transparent);background-image: -o-linear-gradient(315deg,transparent,transparent 33%,rgba(0,0,0,0.2) 33%,rgba(0,0,0,0.2) 66%,transparent 66%,transparent);background-image: linear-gradient(315deg,transparent,transparent 33%,rgba(0,0,0,0.2) 33%,rgba(0,0,0,0.2) 66%,transparent 66%,transparent);-webkit-animation-duration: .8s;-webkit-animation-iteration-count: infinite;-webkit-animation-timing-function: linear;-moz-animation-duration: .8s;-moz-animation-iteration-count: infinite;-moz-animation-timing-function: linear;-webkit-animation-name: loaddingbar; -moz-animation-name: loaddingbar;} /* ::-webkit-scrollbar,::-webkit-scrollbar-thumb{overflow:visible;border:solid 1px #a6a6a6} ::-webkit-scrollbar{width:10px;height: 10px;background:-webkit-gradient(linear,left top,right top,color-stop(0%,rgba(202,202,202,0.07)),color-stop(100%,rgba(229,229,229,0.07)));background:-webkit-linear-gradient(left,rgba(202,202,202,0.07) 0%,rgba(229,229,229,0.07) 100%);-webkit-box-shadow:0 0 1px 0 rgba(0,0,0, .15) inset,0 1px 0 0 #fff;box-shadow:0 0 1px 0 rgba(0,0,0, .15) inset,0 1px 0 0 #fff;background-color:#e5e5e5} ::-webkit-scrollbar-thumb{background:-webkit-gradient(linear,left top,right top,color-stop(0%,rgba(233,233,233,0.05)),color-stop(100%,rgba(221,221,221,0.05)));background:-webkit-linear-gradient(left,rgba(233,233,233,0.05) 0%,rgba(221,221,221,0.05) 100%);-webkit-box-shadow:0 2px 1px 0 rgba(0,0,0, .05);box-shadow:0 2px 1px 0 rgba(0,0,0, .05);background-color:#e9e9e9} ::-webkit-scrollbar-thumb:hover{background:-webkit-gradient(linear,left top,right top,color-stop(0%,rgba(255,255,255,0.05)),color-stop(100%,rgba(0,0,0,0.05)));background:-webkit-linear-gradient(left,rgba(255,255,255,0.05) 0%,rgba(0,0,0,0.05) 100%);-webkit-box-shadow:0 2px 1px 0 rgba(0,0,0, .05);box-shadow:0 2px 1px 0 rgba(0,0,0, .05);background-color:#f5f5f5} ::-webkit-scrollbar-thumb:active{background:-webkit-gradient(linear,left top,right top,color-stop(0%,rgba(255,255,255,0.03)),color-stop(100%,rgba(0,0,0,0.03)));background:-webkit-linear-gradient(left,rgba(255,255,255,0.03) 0%,rgba(0,0,0,0.03) 100%);-webkit-box-shadow:0 2px 1px 0 rgba(0,0,0, .05);box-shadow:0 2px 1px 0 rgba(0,0,0, .05);background-color:#f5f5f5} ::-webkit-scrollbar-button{height:0;display:none;background-color:transparent} */ *{margin:0;padding:0} .t-a-j{text-align:justify} body {} .box-sizing-border-box{-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;} .b-g-ldg{background:url('../images/loading.gif') no-repeat center} .b-g-c-w{background-color:#fff} .b-g-c-i{background-color: initial;} .b-g-c-w-10{background-color:#fff;background-color: rgba(255,255,255,.10)} .b-g-c-w-20{background-color:#fff;background-color: rgba(255,255,255,.20)} .b-g-c-w-50{background-color:#fff;background-color: rgba(255,255,255,.50)} .b-g-c-w-80{background-color:#fff;background-color: rgba(255,255,255,.80)} .b-g-c-blue{background-color: #76a7fa;} a:link,a,a:active{text-decoration: none} .l-50-pc{left: 50%} .t-50-pc{top: 50%} .c-w{color:#fff} .a-i,.a-i:hover{color:inherit } .container_24 {margin-left: auto;margin-right: auto;width: 960px;} .container_24.uncontenter{width: auto;border-left:none;border-right: none} .grid_x, .grid_16px, .grid_20px, .grid_24px, .grid_32px, .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6, .grid_7, .grid_8, .grid_9, .grid_10, .grid_11, .grid_12, .grid_13, .grid_14, .grid_15, .grid_16, .grid_17, .grid_18, .grid_19, .grid_20, .grid_21, .grid_22, .grid_23, .grid_24 { display:inline-block;float: left;margin-left: 0px;margin-right: 0px; } .push_1, .pull_1, .push_2, .pull_2, .push_3, .pull_3, .push_4, .pull_4, .push_5, .pull_5, .push_6, .pull_6, .push_7, .pull_7, .push_8, .pull_8, .push_9, .pull_9, .push_10, .pull_10, .push_11, .pull_11, .push_12, .pull_12, .push_13, .pull_13, .push_14, .pull_14, .push_15, .pull_15, .push_16, .pull_16, .push_17, .pull_17, .push_18, .pull_18, .push_19, .pull_19, .push_20, .pull_20, .push_21, .pull_21, .push_22, .pull_22, .push_23, .pull_23, .push_24, .pull_24 { position:relative; } .colp_1,.colp_2,.colp_3,.colp_4,.colp_5,.colp_6,.colp_7,.colp_8,.colp_9,.colp_10, .colg_1,.colg_2,.colg_3,.colg_4,.colg_5,.colg_6,.colg_7,.colg_8,.colg_9,.colg_10,.colg_11, .colp_container,.colg_container { display:inline-block;float: left;margin-left: 0px;margin-right: 0px; } .p-1-1{padding-bottom: 100%}.m-1-1{padding-bottom: 100%} .p-4-3{padding-bottom: 75%}.m-4-3{padding-bottom: 75%} .p-16-9{padding-bottom: 56.25%}.m-16-9{padding-bottom: 56.25%} .p-21-9{padding-bottom: 42.857142857%}.m-21-9{padding-bottom: 42.857142857%} .colp_container{width: 100%} .colp_1{width: 10%} .colp_2{width: 20%} .colp_3{width: 30%} .colp_4{width: 40%} .colp_5{width: 50%} .colp_6{width: 60%} .colp_7{width: 70%} .colp_8{width: 80%} .colp_9{width: 90%} .colg_container{width: 100%} .colg_1{width: 8.333333333%} .colg_2{width: 16.666666%} .colg_3{width: 25%} .colg_4{width: 33.333333333%} .colg_5{width: 41.666666666%} .colg_6{width: 50%} .colg_7{width: 58.333333333%} .colg_8{width: 66.666666666%} .colg_9{width: 75%} .colg_10{width: 83.333333333%} .colg_11{width: 91.666666666%} .alpha {margin-left: 0;} .omega {margin-right: 0;} .grid_16px,.w-16 {width:16px;} .grid_20px,.w-20 {width:20px;} .grid_32px,.w-32 {width:32px;} .grid_24px,.w-24 {width:24px;} .grid_1 {width:40px;} .grid_2 {width:80px;} .grid_3 {width:120px;} .grid_4 {width:160px;} .grid_28px,.w-28 {width:28px;} .grid_5 {width:200px;} .grid_6 {width:240px;} .grid_7 {width:280px;} .grid_8 {width:320px;} .grid_9 {width:360px;} .grid_10 {width:400px;} .grid_11 {width:440px;} .grid_12 {width:480px;} .grid_13 {width:520px;} .grid_14 {width:560px;} .grid_15 {width:600px;} .grid_16 {width:640px;} .grid_17 {width:680px;} .grid_18 {width:720px;} .grid_19 {width:760px;} .grid_20 {width:800px;} .grid_21 {width:840px;} .grid_22 {width:880px;} .grid_23 {width:920px;} .grid_24 {width:960px;} .h-22 {height:22px;} .h-16 {height:16px;} .h-20 {height:20px;} .h-24 {height:24px;} .h-28 {height:28px;} .h-32 {height:32px;} .h-g-1 {height:40px;} .h-g-2 {height:80px;} .h-g-3 {height:120px;} .h-g-4 {height:160px;} .h-g-5 {height:200px;} .h-g-6 {height:240px;} .h-g-7 {height:280px;} .h-g-8 {height:320px;} .h-g-9 {height:360px;} .h-g-10 {height:400px;} .h-g-11 {height:440px;} .h-g-12 {height:480px;} .h-g-13 {height:520px;} .h-g-14 {height:560px;} .h-g-15 {height:600px;} .h-g-16 {height:640px;} .h-g-17 {height:680px;} .h-g-18 {height:720px;} .h-g-19 {height:760px;} .h-g-20 {height:800px;} .h-g-21 {height:840px;} .h-g-22 {height:880px;} .h-g-23 {height:920px;} .h-g-24 {height:960px;} .m-h-500{min-height: 500px} /* Prefix Extra Space << 24 Columns-----------------------------------------------------------------------------*/ .upfix-1 {margin-top:-40px;} .upfix-2 {margin-top:-80px;} .upfix-3 {margin-top:-120px;} .upfix-4 {margin-top:-160px;} .upfix-5 {margin-top:-200px;} .upfix-6 {margin-top:-240px;} .upfix-7 {margin-top:-280px;} .upfix-8 {margin-top:-320px;} .upfix-9 {margin-top:-360px;} .upfix-10 {margin-top:-400px;} .upfix-11 {margin-top:-440px;} .upfix-12 {margin-top:-480px;} /* Prefix Extra Space << 24 Columns-----------------------------------------------------------------------------*/ .reprefix-1 {margin-left:-40px;} .reprefix-2 {margin-left:-80px;} .reprefix-3 {margin-left:-120px;} .reprefix-4 {margin-left:-160px;} .reprefix-5 {margin-left:-200px;} .reprefix-6 {margin-left:-240px;} .reprefix-7 {margin-left:-280px;} .reprefix-8 {margin-left:-320px;} .reprefix-9 {margin-left:-360px;} .reprefix-10 {margin-left:-400px;} .reprefix-11 {margin-left:-440px;} .reprefix-12 {margin-left:-480px;} /* Prefix Extra Space >> 24 Columns-----------------------------------------------------------------------------*/ .prefix_1 {padding-left:40px;} .prefix_2 {padding-left:80px;} .prefix_3 {padding-left:120px;} .prefix_4 {padding-left:160px;} .prefix_5 {padding-left:200px;} .prefix_6 {padding-left:240px;} .prefix_7 {padding-left:280px;} .prefix_8 {padding-left:320px;} .prefix_9 {padding-left:360px;} .prefix_10 {padding-left:400px;} .prefix_11 {padding-left:440px;} .prefix_12 {padding-left:480px;} .prefix_13 {padding-left:520px;} .prefix_14 {padding-left:560px;} .prefix_15 {padding-left:600px;} .prefix_16 {padding-left:640px;} .prefix_17 {padding-left:680px;} .prefix_18 {padding-left:720px;} .prefix_19 {padding-left:760px;} .prefix_20 {padding-left:800px;} .prefix_21 {padding-left:840px;} .prefix_22 {padding-left:880px;} .prefix_23 {padding-left:920px;} /* Suffix Extra Space >> 24 Columns-----------------------------------------------------------------------------*/ .suffix_1 {padding-right:40px;} .suffix_2 {padding-right:80px;} .suffix_3 {padding-right:120px;} .suffix_4 {padding-right:160px;} .suffix_5 {padding-right:200px;} .suffix_6 {padding-right:240px;} .suffix_7 {padding-right:280px;} .suffix_8 {padding-right:320px;} .suffix_9 {padding-right:360px;} .suffix_10 {padding-right:400px;} .suffix_11 {padding-right:440px;} .suffix_12 {padding-right:480px;} .suffix_13 {padding-right:520px;} .suffix_14 {padding-right:560px;} .suffix_15 {padding-right:600px;} .suffix_16 {padding-right:640px;} .suffix_17 {padding-right:680px;} .suffix_18 {padding-right:720px;} .suffix_19 {padding-right:760px;} .suffix_20 {padding-right:800px;} .suffix_21 {padding-right:840px;} .suffix_22 {padding-right:880px;} .suffix_23 {padding-right:920px;} /* Push Space >> 24 Columns------------------------------------------------------------------------------------*/ .push_1 {left:40px;} .push_2 {left:80px;} .push_3 {left:120px;} .push_4 {left:160px;} .push_5 {left:200px;} .push_6 {left:240px;} .push_7 {left:280px;} .push_8 {left:320px;} .push_9 {left:360px;} .push_10 {left:400px;} .push_11 {left:440px;} .push_12 {left:480px;} .push_13 {left:520px;} .push_14 {left:560px;} .push_15 {left:600px;} .push_16 {left:640px;} .push_17 {left:680px;} .push_18 {left:720px;} .push_19 {left:760px;} .push_20 {left:800px;} .push_21 {left:840px;} .push_22 {left:880px;} .push_23 {left:920px;} /* Pull Space >> 24 Columns-----------------------------------------------------------------------------------*/ .pull_1 {left:-40px;} .pull_2 {left:-80px;} .pull_3 {left:-120px;} .pull_4 {left:-160px;} .pull_5 {left:-200px;} .pull_6 {left:-240px;} .pull_7 {left:-280px;} .pull_8 {left:-320px;} .pull_9 {left:-360px;} .pull_10 {left:-400px;} .pull_11 {left:-440px;} .pull_12 {left:-480px;} .pull_13 {left:-520px;} .pull_14 {left:-560px;} .pull_15 {left:-600px;} .pull_16 {left:-640px;} .pull_17 {left:-680px;} .pull_18 {left:-720px;} .pull_19 {left:-760px;} .pull_20 {left:-800px;} .pull_21 {left:-840px;} .pull_22 {left:-880px;} .pull_23 {left:-920px;} .clear {clear: both;display: block;overflow: hidden;visibility: hidden;width: 0;height: 0;} .clearfix:before, .clearfix:after {content: '\0020';display: block;overflow: hidden;visibility: hidden;width: 0;height: 0;} .clearfix:after {clear: both;} .clearfix {zoom: 1;} .f-l{float: left} .f-r{float: right} .f-n{float: none} .p-f{position: fixed} .lh16, .l-h-16{line-height: 16px} .lh20, .l-h-20{line-height: 20px} .l-h-22{line-height: 22px} .lh24, .l-h-24{line-height: 24px} .lh28, .l-h-28{line-height: 28px} .l-h-32{line-height: 32px} .l-h-36{line-height: 36px} .l-h-40{line-height: 40px} .l-h-44{line-height: 44px} .z-i-1{z-index: 1} .z-i-10{z-index: 10} .z-i-100{z-index: 100} .z-i-1000{z-index: 1000} .z-i-999{z-index: 999} .z-i-1001{z-index: 1001} .z-i-0{z-index: 0} .z-i-2{z-index: 2} .z-i-10k{z-index: 10000} .z-i-11k{z-index: 11000} .m-t--4{margin-top : -4px} .m-r--4{margin-right : -4px} .m-b--4{margin-bottom : -4px} .m-l--4{margin-left : -4px} .m-t--2{margin-top : -2px} .m-r--2{margin-right : -2px} .m-b--2{margin-bottom : -2px} .m-l--2{margin-left : -2px} .m-t--1{margin-top : -1px} .m-r--1{margin-right : -1px} .m-b--1{margin-bottom : -1px} .m-l--1{margin-left : -1px} .m-0{margin : 0} .p-0{padding: 0} .m-2{margin : 2px} .p-2{padding: 2px} .m-4{margin : 4px} .p-4{padding: 4px} .m-8{margin : 8px} .p-8{padding: 8px} .m-12{margin: 12px} .p-12{padding: 12px} .m-16{margin: 16px} .p-16{padding: 16px} .m-20{margin: 20px} .p-20{padding: 20px} .m-24{margin: 24px} .p-24{padding: 24px} .m-28{margin: 28px} .p-28{padding: 28px} .m-32{margin: 32px} .p-32{padding: 32px} .p-40{padding: 40px} .m-l-6{margin-left: 6px} .m-t-0{margin-top : 0px} .m-r-0{margin-right : 0px} .m-b-0{margin-bottom : 0px} .m-l-0{margin-left : 0px} .p-t-0{padding-top : 0px} .p-r-0{padding-right : 0px} .p-b-0{padding-bottom : 0px} .p-l-0{padding-left : 0px} .m-t-2{margin-top : 2px} .m-r-2{margin-right : 2px} .m-b-2{margin-bottom : 2px} .m-l-2{margin-left : 2px} .p-t-2{padding-top : 2px} .p-r-2{padding-right : 2px} .p-b-2{padding-bottom : 2px} .p-l-2{padding-left : 2px} .m-t-1{margin-top : 1px} .m-r-1{margin-right : 1px} .m-b-1{margin-bottom : 1px} .m-l-1{margin-left : 1px} .p-t-1{padding-top : 1px} .p-r-1{padding-right : 1px} .p-b-1{padding-bottom : 1px} .p-l-1{padding-left : 1px} .m-t-4{margin-top : 4px} .m-r-4{margin-right : 4px} .m-b-4{margin-bottom : 4px} .m-l-4{margin-left : 4px} .p-t-3{padding-top : 3px} .p-t-4{padding-top : 4px} .p-r-4{padding-right : 4px} .p-b-4{padding-bottom : 4px} .p-l-4{padding-left : 4px} .m-t-8{margin-top : 8px} .m-r-8{margin-right : 8px} .m-b-8{margin-bottom : 8px} .m-l-8{margin-left : 8px} .p-t-7{padding-top : 7px} .p-t-8{padding-top : 8px} .p-r-8{padding-right : 8px} .p-b-8{padding-bottom : 8px} .p-l-8{padding-left : 8px} .w-8{width : 8px} .m-t-12{margin-top : 12px} .m-r-12{margin-right : 12px} .m-b-12{margin-bottom : 12px} .m-l-12{margin-left : 12px} .p-t-11{padding-top : 11px} .p-t-12{padding-top : 12px} .p-r-12{padding-right : 12px} .p-b-12{padding-bottom : 12px} .p-l-12{padding-left : 12px} .w-12{width : 12px} .w-10{width : 10px} .w-14{width : 14px} .m-t-16{margin-top : 16px} .m-r-16{margin-right : 16px} .m-b-16{margin-bottom : 16px} .m-l-16{margin-left : 16px} .p-t-15{padding-top : 15px} .p-t-16{padding-top : 16px} .p-r-16{padding-right : 16px} .p-b-16{padding-bottom : 16px} .p-l-16{padding-left : 16px} .w-16{width : 16px} .m-t-20{margin-top : 20px} .m-r-20{margin-right : 20px} .m-b-20{margin-bottom : 20px} .m-l-20{margin-left : 20px} .p-t-20{padding-top : 20px} .p-r-20{padding-right : 20px} .p-b-20{padding-bottom : 20px} .p-l-20{padding-left : 20px} .w-20{width : 20px} .w-18{width : 18px} .m-t-24{margin-top : 24px} .m-r-24{margin-right : 24px} .m-b-24{margin-bottom : 24px} .m-l-24{margin-left : 24px} .p-t-24{padding-top : 24px} .p-r-24{padding-right : 24px} .p-b-24{padding-bottom : 24px} .p-l-24{padding-left : 24px} .w-24{width : 24px} .w-22{width : 22px} .m-t-28{margin-top : 28px} .m-r-28{margin-right : 28px} .m-b-28{margin-bottom : 28px} .m-l-28{margin-left : 28px} .p-t-28{padding-top : 28px} .p-r-28{padding-right : 28px} .p-b-28{padding-bottom : 28px} .p-l-28{padding-left : 28px} .w-28{width : 28px} .w-26{width : 26px} .m-t-32{margin-top : 32px} .m-r-32{margin-right : 32px} .m-b-32{margin-bottom : 32px} .m-l-32{margin-left : 32px} .p-t-32{padding-top : 32px} .p-r-32{padding-right : 32px} .p-b-32{padding-bottom : 32px} .p-l-32{padding-left : 32px} .w-32{width : 32px} .w-30{width : 30px} .m-t-40{margin-top : 40px} .m-r-40{margin-right : 40px} .m-b-40{margin-bottom : 40px} .m-l-40{margin-left : 40px} .p-t-40{padding-top : 40px} .p-r-40{padding-right : 40px} .p-b-40{padding-bottom : 40px} .p-l-40{padding-left : 40px} .w-40{width : 40px} .w-38{width : 38px} .m-t-60{margin-top : 60px} .m-r-60{margin-right : 60px} .m-b-60{margin-bottom : 60px} .m-l-60{margin-left : 60px} .p-t-60{padding-top : 60px} .p-r-60{padding-right : 60px} .p-b-60{padding-bottom : 60px} .p-l-60{padding-left : 60px} .w-60{width : 60px} .m-t-80{margin-top : 80px} .m-r-80{margin-right : 80px} .m-b-80{margin-bottom : 80px} .m-l-80{margin-left : 80px} .p-t-80{padding-top : 80px} .p-r-80{padding-right : 80px} .p-b-80{padding-bottom : 80px} .p-l-80{padding-left : 80px} .w-80{width : 80px} .m-t-100{margin-top : 100px} .m-r-100{margin-right : 100px} .m-b-100{margin-bottom : 100px} .m-l-100{margin-left : 100px} .p-t-100{padding-top : 100px} .p-r-100{padding-right : 100px} .p-b-100{padding-bottom : 100px} .p-l-100{padding-left : 100px} .w-100{width : 100px} .m-t-120{margin-top : 120px} .m-r-120{margin-right : 120px} .m-b-120{margin-bottom : 120px} .m-l-120{margin-left : 120px} .p-t-120{padding-top : 120px} .p-r-120{padding-right : 120px} .p-b-120{padding-bottom : 120px} .p-l-120{padding-left : 120px} .w-120{width : 120px} .m-t-140{margin-top : 140px} .m-r-140{margin-right : 140px} .m-b-140{margin-bottom : 140px} .m-l-140{margin-left : 140px} .p-t-140{padding-top : 140px} .p-r-140{padding-right : 140px} .p-b-140{padding-bottom : 140px} .p-l-140{padding-left : 140px} .w-140{width : 140px} .m-t-160{margin-top : 160px} .m-r-160{margin-right : 160px} .m-b-160{margin-bottom : 160px} .m-l-160{margin-left : 160px} .p-t-160{padding-top : 160px} .p-r-160{padding-right : 160px} .p-b-160{padding-bottom : 160px} .p-l-160{padding-left : 160px} .w-160{width : 160px} .m-t-180{margin-top : 180px} .m-r-180{margin-right : 180px} .m-b-180{margin-bottom : 180px} .m-l-180{margin-left : 180px} .p-t-180{padding-top : 180px} .p-r-180{padding-right : 180px} .p-b-180{padding-bottom : 180px} .p-l-180{padding-left : 180px} .w-180{width : 180px} .m-t-200{margin-top : 200px} .m-r-200{margin-right : 200px} .m-b-200{margin-bottom : 200px} .m-l-200{margin-left : 200px} .p-t-200{padding-top : 200px} .p-r-200{padding-right : 200px} .p-b-200{padding-bottom : 200px} .p-l-200{padding-left : 200px} .w-200{width : 200px} .m-t-220{margin-top : 220px} .m-r-220{margin-right : 220px} .m-b-220{margin-bottom : 220px} .m-l-220{margin-left : 220px} .p-t-220{padding-top : 220px} .p-r-220{padding-right : 220px} .p-b-220{padding-bottom : 220px} .p-l-220{padding-left : 220px} .w-220{width : 220px} .m-t-240{margin-top : 240px} .m-r-240{margin-right : 240px} .m-b-240{margin-bottom : 240px} .m-l-240{margin-left : 240px} .p-t-240{padding-top : 240px} .p-r-240{padding-right : 240px} .p-b-240{padding-bottom : 240px} .p-l-240{padding-left : 240px} .w-240{width : 240px} .w-260{width : 260px} .w-280{width : 280px} .w-300{width : 300px} .w-320{width : 320px} .w-340{width : 340px} .w-360{width : 360px} .w-380{width : 380px} .w-400{width : 400px} .w-440{width : 440px} .w-480{width : 480px} .w-520{width : 520px} .w-560{width : 560px} .w-600{width : 600px} .w-640{width : 640px} .w-680{width : 680px} .w-720{width : 720px} .w-760{width : 760px} .w-800{width : 800px} .w-840{width : 840px} .w-880{width : 880px} .w-920{width : 920px} .w-960{width : 960px} .w-50p{width: 50%;} .p-a{position: absolute} .p-r{position: relative}.t-a-c{text-align: center} .t-a-l{text-align: left} .t-a-r{text-align: right} .b-r-1{-webkit-border-radius: 1px;-moz-border-radius: 1px;border-radius: 1px;} .b-r-t-1{-webkit-border-radius: 1px 1px 0 0;-moz-border-radius: 1px 1px 0 0;border-radius: 1px 1px 0 0} .b-r-t-2{-webkit-border-radius: 2px 2px 0 0;-moz-border-radius: 2px 2px 0 0;border-radius: 2px 2px 0 0} .b-r-t-3{-webkit-border-radius: 3px 3px 0 0;-moz-border-radius: 3px 3px 0 0;border-radius: 3px 3px 0 0} .b-r-t-4{-webkit-border-radius: 4px 4px 0 0;-moz-border-radius: 4px 4px 0 0;border-radius: 4px 4px 0 0} .b-r-t-5{-webkit-border-radius: 5px 5px 0 0;-moz-border-radius: 5px 5px 0 0;border-radius: 5px 5px 0 0} .b-r-t-6{-webkit-border-radius: 6px 6px 0 0;-moz-border-radius: 6px 6px 0 0;border-radius: 6px 6px 0 0} .b-r-t-7{-webkit-border-radius: 7px 7px 0 0;-moz-border-radius: 7px 7px 0 0;border-radius: 7px 7px 0 0} .b-r-t-8{-webkit-border-radius: 8px 8px 0 0;-moz-border-radius: 8px 8px 0 0;border-radius: 8px 8px 0 0} .b-r-t-9{-webkit-border-radius: 9px 9px 0 0;-moz-border-radius: 9px 9px 0 0;border-radius: 9px 9px 0 0} .b-r-t-10{-webkit-border-radius: 10px 10px 0 0;-moz-border-radius: 10px 10px 0 0;border-radius: 10px 10px 0 0} .b-r-b-1{-webkit-border-radius: 0 0 1px 1px;-moz-border-radius: 0 0 1px 1px;border-radius: 0 0 1px 1px} .b-r-b-2{-webkit-border-radius: 0 0 2px 2px;-moz-border-radius: 0 0 2px 2px;border-radius: 0 0 2px 2px} .b-r-b-3{-webkit-border-radius: 0 0 3px 3px;-moz-border-radius: 0 0 3px 3px;border-radius: 0 0 3px 3px} .b-r-b-4{-webkit-border-radius: 0 0 4px 4px;-moz-border-radius: 0 0 4px 4px;border-radius: 0 0 4px 4px} .b-r-b-5{-webkit-border-radius: 0 0 5px 5px;-moz-border-radius: 0 0 5px 5px;border-radius: 0 0 5px 5px} .b-r-b-6{-webkit-border-radius: 0 0 6px 6px;-moz-border-radius: 0 0 6px 6px;border-radius: 0 0 6px 6px} .b-r-b-7{-webkit-border-radius: 0 0 7px 7px;-moz-border-radius: 0 0 7px 7px;border-radius: 0 0 7px 7px} .b-r-b-8{-webkit-border-radius: 0 0 8px 8px;-moz-border-radius: 0 0 8px 8px;border-radius: 0 0 8px 8px} .b-r-b-9{-webkit-border-radius: 0 0 9px 9px;-moz-border-radius: 0 0 9px 9px;border-radius: 0 0 9px 9px} .b-r-b-10{-webkit-border-radius: 0 0 10px 10px;-moz-border-radius: 0 0 10px 10px;border-radius: 0 0 10px 10px} .b-t-r-r-1{-webkit-border-top-right-radius: 1px;-moz-border-radius-topright: 1px;border-top-right-radius: 1px;} .b-b-r-r-1{-webkit-border-bottom-right-radius: 1px;-moz-border-radius-bottomright: 1px;border-bottom-right-radius: 1px;} .b-b-l-r-1{-webkit-border-bottom-left-radius: 1px;-moz-border-radius-bottomleft: 1px;border-bottom-left-radius: 1px;} .b-t-l-r-1{-webkit-border-top-left-radius: 1px;-moz-border-radius-topleft: 1px;border-top-left-radius: 1px;} .b-r-2{-webkit-border-radius: 2px;-moz-border-radius: 2px;border-radius: 2px;} .b-t-r-r-2{-webkit-border-top-right-radius: 2px;-moz-border-radius-topright: 2px;border-top-right-radius: 2px;} .b-b-r-r-2{-webkit-border-bottom-right-radius: 2px;-moz-border-radius-bottomright: 2px;border-bottom-right-radius: 2px;} .b-b-l-r-2{-webkit-border-bottom-left-radius: 2px;-moz-border-radius-bottomleft: 2px;border-bottom-left-radius: 2px;} .b-t-l-r-2{-webkit-border-top-left-radius: 2px;-moz-border-radius-topleft: 2px;border-top-left-radius: 2px;} .b-r-3{-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;} .b-t-r-r-3{-webkit-border-top-right-radius: 3px;-moz-border-radius-topright: 3px;border-top-right-radius: 3px;} .b-b-r-r-3{-webkit-border-bottom-right-radius: 3px;-moz-border-radius-bottomright: 3px;border-bottom-right-radius: 3px;} .b-b-l-r-3{-webkit-border-bottom-left-radius: 3px;-moz-border-radius-bottomleft: 3px;border-bottom-left-radius: 3px;} .b-t-l-r-3{-webkit-border-top-left-radius: 3px;-moz-border-radius-topleft: 3px;border-top-left-radius: 3px;} .b-r-4{-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;} .b-t-r-r-4{-webkit-border-top-right-radius: 4px;-moz-border-radius-topright: 4px;border-top-right-radius: 4px;} .b-b-r-r-4{-webkit-border-bottom-right-radius: 4px;-moz-border-radius-bottomright: 4px;border-bottom-right-radius: 4px;} .b-b-l-r-4{-webkit-border-bottom-left-radius: 4px;-moz-border-radius-bottomleft: 4px;border-bottom-left-radius: 4px;} .b-t-l-r-4{-webkit-border-top-left-radius: 4px;-moz-border-radius-topleft: 4px;border-top-left-radius: 4px;} .b-r-5{-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;} .b-t-r-r-5{-webkit-border-top-right-radius: 5px;-moz-border-radius-topright: 5px;border-top-right-radius: 5px;} .b-b-r-r-5{-webkit-border-bottom-right-radius: 5px;-moz-border-radius-bottomright: 5px;border-bottom-right-radius: 5px;} .b-b-l-r-5{-webkit-border-bottom-left-radius: 5px;-moz-border-radius-bottomleft: 5px;border-bottom-left-radius: 5px;} .b-t-l-r-5{-webkit-border-top-left-radius: 5px;-moz-border-radius-topleft: 5px;border-top-left-radius: 5px;} .b-r-6{-webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px;} .b-t-r-r-6{-webkit-border-top-right-radius: 6px;-moz-border-radius-topright: 6px;border-top-right-radius: 6px;} .b-b-r-r-6{-webkit-border-bottom-right-radius: 6px;-moz-border-radius-bottomright: 6px;border-bottom-right-radius: 6px;} .b-b-l-r-6{-webkit-border-bottom-left-radius: 6px;-moz-border-radius-bottomleft: 6px;border-bottom-left-radius: 6px;} .b-t-l-r-6{-webkit-border-top-left-radius: 6px;-moz-border-radius-topleft: 6px;border-top-left-radius: 6px;} .b-r-7{-webkit-border-radius: 7px;-moz-border-radius: 7px;border-radius: 7px;} .b-t-r-r-7{-webkit-border-top-right-radius: 7px;-moz-border-radius-topright: 7px;border-top-right-radius: 7px;} .b-b-r-r-7{-webkit-border-bottom-right-radius: 7px;-moz-border-radius-bottomright: 7px;border-bottom-right-radius: 7px;} .b-b-l-r-7{-webkit-border-bottom-left-radius: 7px;-moz-border-radius-bottomleft: 7px;border-bottom-left-radius: 7px;} .b-t-l-r-7{-webkit-border-top-left-radius: 7px;-moz-border-radius-topleft: 7px;border-top-left-radius: 7px;} .b-r-8{-webkit-border-radius: 8px;-moz-border-radius: 8px;border-radius: 8px;} .b-t-r-r-8{-webkit-border-top-right-radius: 8px;-moz-border-radius-topright: 8px;border-top-right-radius: 8px;} .b-b-r-r-8{-webkit-border-bottom-right-radius: 8px;-moz-border-radius-bottomright: 8px;border-bottom-right-radius: 8px;} .b-b-l-r-8{-webkit-border-bottom-left-radius: 8px;-moz-border-radius-bottomleft: 8px;border-bottom-left-radius: 8px;} .b-t-l-r-8{-webkit-border-top-left-radius: 8px;-moz-border-radius-topleft: 8px;border-top-left-radius: 8px;} .b-r-9{-webkit-border-radius: 9px;-moz-border-radius: 9px;border-radius: 9px;} .b-t-r-r-9{-webkit-border-top-right-radius: 9px;-moz-border-radius-topright: 9px;border-top-right-radius: 9px;} .b-b-r-r-9{-webkit-border-bottom-right-radius: 9px;-moz-border-radius-bottomright: 9px;border-bottom-right-radius: 9px;} .b-b-l-r-9{-webkit-border-bottom-left-radius: 9px;-moz-border-radius-bottomleft: 9px;border-bottom-left-radius: 9px;} .b-t-l-r-9{-webkit-border-top-left-radius: 9px;-moz-border-radius-topleft: 9px;border-top-left-radius: 9px;} .b-r-10{-webkit-border-radius: 10px;-moz-border-radius: 10px;border-radius: 10px;} .b-t-r-r-10{-webkit-border-top-right-radius: 10px;-moz-border-radius-topright: 10px;border-top-right-radius: 10px;} .b-b-r-r-10{-webkit-border-bottom-right-radius: 10px;-moz-border-radius-bottomright: 10px;border-bottom-right-radius: 10px;} .b-b-l-r-10{-webkit-border-bottom-left-radius: 10px;-moz-border-radius-bottomleft: 10px;border-bottom-left-radius: 10px;} .b-t-l-r-10{-webkit-border-top-left-radius: 10px;-moz-border-radius-topleft: 10px;border-top-left-radius: 10px;} .b-d-t-n{border-top:none} .b-d-r-n{border-right:none} .b-d-b-n{border-bottom:none} .b-d-l-n{border-left:none} .o-v-f-h{overflow: hidden} .o-v-f-a{overflow: auto} .o-v-f-x-a{overflow-x: auto} .o-v-f-y-a{overflow-y: auto} .o-l-ccc{outline: 1px solid #ccc} .b-g-c-ccc{background-color: #ccc} .b-g-c-ddd{background-color: #ddd} .b-g-c-eee{background-color: #eee} .b-g-c-fa{background-color: #fafafa} .l--1{left : -1px} .t--1{top : -1px} .r--1{right : -1px} .b--1{bottom : -1px} .l-0{left : 0px} .t-0{top : 0px} .r-0{right : 0px} .b-0{bottom : 0px} .l-1{left : 1px} .t-1{top : 1px} .r-1{right : 1px} .b-1{bottom : 1px} .l-2{left : 2px} .t-2{top : 2px} .r-2{right : 2px} .b-2{bottom : 2px} .l-4{left : 4px} .t-4{top : 4px} .r-4{right : 4px} .b-4{bottom : 4px} .l-8{left : 8px} .t-8{top : 8px} .r-8{right : 8px} .b-8{bottom : 8px} .l-12{left : 12px} .t-12{top : 12px} .r-12{right : 12px} .b-12{bottom : 12px} .l-16{left : 16px} .t-16{top : 16px} .r-16{right : 16px} .b-16{bottom : 16px} .l-20{left : 20px} .t-20{top : 20px} .r-20{right : 20px} .b-20{bottom : 20px} .l-24{left : 24px} .t-24{top : 24px} .r-24{right : 24px} .b-24{bottom : 24px} .l-28{left : 28px} .t-28{top : 28px} .r-28{right : 28px} .b-28{bottom : 28px} .l-32{left : 32px} .t-32{top : 32px} .r-32{right : 32px} .b-32{bottom : 32px} .tranf-0{background: inherit !important} .tranf-b-10{background: url(../images/bg/10.png) repeat;} .tranf-b-20{background: url(../images/bg/20.png) repeat;} .tranf-b-30{background: url(../images/bg/30.png) repeat;} .tranf-b-40{background: url(../images/bg/40.png) repeat;} .tranf-b-50{background: url(../images/bg/50.png) repeat;} .tranf-b-60{background: url(../images/bg/60.png) repeat;} .tranf-b-70{background: url(../images/bg/70.png) repeat;} .tranf-b-80{background: url(../images/bg/80.png) repeat;} .tranf-b-90{background: url(../images/bg/90.png) repeat;} .tranf-w-10{background: url(../images/bg/w-10.png) repeat;} .tranf-w-20{background: url(../images/bg/w-20.png) repeat;} .tranf-w-30{background: url(../images/bg/w-30.png) repeat;} .tranf-w-40{background: url(../images/bg/w-40.png) repeat;} .tranf-w-50{background: url(../images/bg/w-50.png) repeat;} .tranf-w-60{background: url(../images/bg/w-60.png) repeat;} .tranf-w-70{background: url(../images/bg/w-70.png) repeat;} .tranf-w-80{background: url(../images/bg/w-80.png) repeat;} .tranf-w-90{background: url(../images/bg/w-90.png) repeat;} .b-d-c-ccc{border: 1px solid #ccc} .b-d-t-c-ccc{border-top:1px solid #ccc} .b-d-b-c-ccc{border-bottom:1px solid #ccc} .b-d-r-c-ccc{border-right:1px solid #ccc} .b-d-l-c-ccc{border-left:1px solid #ccc} .b-d-c-ddd{border: 1px solid #ddd} .b-d-t-c-ddd{border-top:1px solid #ddd} .b-d-b-c-ddd{border-bottom:1px solid #ddd} .b-d-r-c-ddd{border-right:1px solid #ddd} .b-d-l-c-ddd{border-left:1px solid #ddd} .b-c-ccc{border-color: #ccc} .b-c-ddd{border-color: #ddd} .b-d-t-n{border-top: none} .b-d-b-n{border-bottom: none} .b-d-l-n{border-left: none} .b-d-b-n{border-bottom: none} .b-d-n{border:none} .b-d{border:1px solid} .b-d-t{border-top:1px solid } .b-d-l{border-left:1px solid } .b-d-b{border-bottom:1px solid } .b-d-r{border-right:1px solid }.b-d-c-gb{border-color: #01C9A9} .b-s-d{-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .1);-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .1);box-shadow: 0 1px 1px rgba(0, 0, 0, .1);} .b-s-d-big{-webkit-box-shadow: 0 4px 16px #cccccc;-moz-box-shadow: 0 4px 16px #cccccc;box-shadow: 0 4px 16px #cccccc;} .b-s-d-vbig{-webkit-box-shadow: 0 0px 16px #aaa;-moz-box-shadow: 0 0px 16px #aaa;box-shadow: 0 0px 16px #aaa;} .b-s-d-24{-webkit-box-shadow: 0 0px 24px #aaa;-moz-box-shadow: 0 0px 24px #aaa;box-shadow: 0 0px 24px #aaa;} .b-s-d-32{-webkit-box-shadow: 0 0px 32px #aaa;-moz-box-shadow: 0 0px 32px #aaa;box-shadow: 0 0px 32px #aaa;} .r-s-v{resize: vertical} .v-a-t{vertical-align: top} .v-a-m{vertical-align: middle} .d-p-n{display: none} .d-p-b{display: block} .d-p-i-b{display: inline-block}.w-i{width: 100%} .h-i{height: 100%} .f-s-i{font-style: italic} .f-w-b{font-weight: bold} .f-w-n{font-weight: normal}.f-z-i{font-size: inherit}.c-s-p{cursor: pointer} .gadiend-white{background: #e8e8e8;background: -moz-linear-gradient(top,white 0%,#EFEFEF 100%);background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,white),color-stop(100%,#EFEFEF));background: -webkit-linear-gradient(top,white 0%,#EFEFEF 100%);background: -o-linear-gradient(top,white 0%,#EFEFEF 100%);background: -ms-linear-gradient(top,white 0%,#EFEFEF 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff',endColorstr='#efefef',GradientType=0 );background: linear-gradient(to bottom,white 0%,#EFEFEF 100%);} .gadiend-gray{background: #e8e8e8;background: -moz-linear-gradient(top,#f1f1f1 0%,#ccc 100%);background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#f1f1f1),color-stop(100%,#ccc));background: -webkit-linear-gradient(top,#f1f1f1 0%,#ccc 100%);background: -o-linear-gradient(top,#f1f1f1 0%,#ccc 100%);background: -ms-linear-gradient(top,#f1f1f1 0%,#ccc 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f1f1',endColorstr='#ccc',GradientType=0 );background: linear-gradient(to bottom,#f1f1f1 0%,#ccc 100%);} .gadiend-classic{background-color: #E8E8E8;background-image: -webkit-gradient(linear,0 0,0 100%,from(#FAFAFA),to(#DADADA));background-image: -moz-linear-gradient(top,#FAFAFA,#DADADA);background-image: -o-linear-gradient(top,#FAFAFA,#DADADA);background: -webkit-linear-gradient(top,#FAFAFA 0%,#DADADA 100%);background: -ms-linear-gradient(top,#FAFAFA 0%,#DADADA 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FAFAFA',endColorstr='#DADADA',GradientType=0 );background: linear-gradient(to bottom,#FAFAFA 0%,#DADADA 100%);} .gadiend-img{background: url('../sysimages/bg/wbg.gif') repeat-x;} .clear {clear: both;display: block;overflow: hidden;visibility: hidden;width: 0;height: 0;} .input:hover,input:hover,textarea:hover{border: 1px solid #A8D4FF;-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);} input.classic-input:focus,input:focus,.input:focus,textarea:focus{border: 1px solid #4d90fe;outline: none;-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);} pre , tt , legend,textarea {font-family: inherit} .classic-select {padding: 2px 2px 2px 4px;border: 1px solid #DDD;line-height: 16px;height: 24px;margin: 0;font-size: 11px;} .classic-button{ min-width: 52px;position: relative;padding: 2px 12px;border: 1px solid #ccc;line-height: 16px;height: 24px;font-size: 11px;margin: 0;outline: none;/* background-color: #E8E8E8;*/background-image: -webkit-gradient(linear,0 0,0 100%,from(#FAFAFA),to(#DADADA));background-image: -moz-linear-gradient(top,#FAFAFA,#DADADA);background-image: -o-linear-gradient(top,#FAFAFA,#DADADA);color: #777} .classic-button:focus, .classic-button:hover{border: 1px solid #aaa;/* background-color: #DADADA;*/background-image: -webkit-gradient(linear,0 0,0 100%,from(#DADADA),to(#FAFAFA));background-image: -moz-linear-gradient(top,#DADADA,#FAFAFA);background-image: -o-linear-gradient(top,#DADADA,#FAFAFA);-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.1);-moz-box-shadow: 0 1px 1px rgba(0,0,0,.1);box-shadow: 0 1px 1px rgba(0,0,0,.1);} .classic-button:active{background: #ccc;top:1px;} .classic-button.icon{padding: 2px 20px 2px 36px;} .classic-input{padding: 3px 4px 4px 4px;border: 1px solid #ddd;line-height: 16px;font-size: 11px;margin: 0;/*background: #F8F7F6;-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);*/} .classic-input:hover{background-color: white;}.classic-input:focus{border-color: #888;}.classic-lable{line-height: 24px} .green-button{color: white;background-color: #98BF21;border: 1px solid white;outline: 1px solid #98BF21;text-decoration: none;padding-top: 3px; padding-bottom: 4px;padding-left: 12px;padding-right: 12px;font-size: 11px;position: relative;} .green-button:hover{background-color:#7A991A;opacity: 1;}.green-button:active{top: 1px} .blue-button{color: white;background-color: #057DB9;border: 1px solid white;outline: 1px solid #3B5999;text-decoration: none;padding-top: 3px; padding-bottom: 4px;padding-left: 12px;padding-right: 12px;font-size: 11px;position: relative;opacity: .8;} .blue-button:hover{opacity: 1;}.blue-button:active{top: 1px} .gray-button{color: white;background-color: #cacaca;border: 1px solid white;outline: 1px solid #ccc;text-decoration: none;padding-top: 3px; padding-bottom: 4px;padding-left: 12px;padding-right: 12px;font-size: 11px;position: relative;} .gray-button:hover{background-color: #ababab}.gray-button:active{top: 1px} .orange-button{color: white;background-color: #F1B55F;border: 1px solid white;outline: 1px solid #F1D15F;text-decoration: none;padding-top: 3px; padding-bottom: 4px;padding-left: 12px;padding-right: 12px;font-size: 11px;position: relative;} .orange-button:hover{background-color: #FFB851}.orange-button:active{top: 1px} button,.button{height: 24px;display: inline-block;line-height: 22px;border: 0px;color: #fff;font-size: inherit;padding: 0 12px;} input,textarea,button,select{box-sizing: border-box;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;} input[type='button'],input[type='submit']{height: 24px;display: inline-block;line-height: 22px;border: 0px;color: #fff;font-size: inherit;padding: 0 12px;} select{padding:2px 2px 2px 0px;box-sizing: border-box;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;} .button{line-height: 24px;} pre,button,textArea,textarea,label{font-family: inherit} tt {font-family: inherit;padding: 0px 2px 1px 2px;background: #A8D4FF;border-radius: 2px;-moz-border-radius: 2px;-webkit-border-radius: 2px;} .f-z-11{font-size: 11px;}.f-z-12{font-size: 12px} .f-z-13{font-size: 13px} .f-z-14{font-size: 14px} .f-z-16{font-size: 16px} .f-f-helvetica{font-family: helvetica}.t-d-n{text-decoration: none} .tr-half-s{transition: all .5s ease-in-out; -moz-transition: all .5s ease-in-out; -webkit-transition: all .5s ease-in-out;} .tr-one-s{transition: all 1s ease-in-out; -moz-transition: all 1s ease-in-out; -webkit-transition: all 1s ease-in-out;} table{border-collapse: collapse;}th,td{display: table-cell;padding: 2px 4px} table.cell-padding-0 td,table.cell-padding-0 th{padding:0} table.cell-padding-2 td,table.cell-padding-2 th{padding:2px} tr{display: table-row} table.cell-padding-0 td,table.cell-padding-0 th{padding:0} table.classic-table th,table.classic-table td{border-bottom: 1px solid #e9e9e9;padding: 0px 0px;} table.classic-table tr:nth-child(even) td{background-color:#f9f9f9} table.classic-table tr:not(:first-child):hover td{background:url('../images/bg/10.png')}.m-0-a{margin:0 auto} table.classic-table tr{border-left: 2px solid transparent;} table.classic-table tr:not(:first-child):hover{border-left: 2px solid #4d90f0;} table.classic-table th{color:#dd4b39} pre{white-space: pre-wrap;white-space: -moz-pre-wrap;white-space: -pre-wrap;white-space: -o-pre-wrap;word-wrap: break-word;padding: 0;margin: 0;} textarea{padding: 0;margin: 0;resize: vertical;font-family: inherit;font-size: inherit} .icon-16{width: 16px;height: 16px;display: block;} .b-g-i{background-image: -webkit-linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0)); background-image: -moz-linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0)); background-image: -ms-linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0)); background-image: -o-linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0)); background-image: linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0));} .arrow_space {background-image: url('../images/breadcrumb-arrow.png');background-repeat: no-repeat;background-position: center;border-color: transparent;display: inline-block;vertical-align: top;-webkit-transition: all 0.2s ease;-moz-transition: all 0.2s ease;-ms-transition: all 0.2s ease;-o-transition: all 0.2s ease;transition: all 0.2s ease;width: 16px;height: 32px;} .defaultSkin .addtabs .mceIcon{background: url('../images/16/tab_new_1.png') no-repeat center} .defaultSkin .addalbum .mceIcon{background: url('../images/16/album_add.png') no-repeat center} .defaultSkin .addgalleries .mceIcon{background: url('../images/16/application_view_gallery.png') no-repeat center} .defaultSkin .otherplugin .mceIcon{background: url('../images/16/grid_small_dot.png') no-repeat center} .hover-50{opacity: .5;transition: all .5s ease-in-out; -moz-transition: all .5s ease-in-out; -webkit-transition: all .5s ease-in-out;} .hover-50:hover{opacity: 1} .system_message *{font-family: monospace;font-size: 11px;} #notications{position: fixed;bottom: 4px;right: 4px;width: 322px;z-index: 10001} #notications .centerscreen{position: fixed;bottom: 50%;right: 50%;margin: 0 -160px 0px 0} .notice-box{background: #fff;background: rgba(255, 255, 255, .9);border: 1px solid #ccc;padding: 12px;z-index: 1001;position: relative} .notice-box-close-btn{position: absolute;right: 7px;top: 8px;width: 9px;height: 9px;overflow: hidden;display: block; background: url(data:image/gif;base64,R0lGODlhCQASAJEAAKWlpf///8zMzAAAACH5BAEHAAEALAAAAAAJABIAAAIgVI5hlqzozkqQytfqzRECG3xfMoZIeYggeppkm1KqBRQAOw==) no-repeat 0 -9px;}
0x6a
trunk/libraries/css/grid.css
CSS
asf20
40,861
/* Project : 48c6c450f1a4a0cc53d9585dc0fee742 Created on : Mar 16, 2013, 11:29:15 PM Author : Truong Khuong - khuongxuantruong@gmail.com Description : Purpose of the stylesheet follows. */
0x6a
trunk/libraries/css/notie.css
CSS
asf20
225
<?php /** This file is part of KCFinder project * * @desc CMS integration code: Drupal * @package KCFinder * @version 2.51 * @author Dany Alejandro Cabrera <otello2040@gmail.com> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ // gets a valid drupal_path function get_drupal_path() { if (!empty($_SERVER['SCRIPT_FILENAME'])) { $drupal_path = dirname(dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])))); if (!file_exists($drupal_path . '/includes/bootstrap.inc')) { $drupal_path = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))); $depth = 2; do { $drupal_path = dirname($drupal_path); $depth++; } while (!($bootstrap_file_found = file_exists($drupal_path . '/includes/bootstrap.inc')) && $depth < 10); } } if (!isset($bootstrap_file_found) || !$bootstrap_file_found) { $drupal_path = '../../../../..'; if (!file_exists($drupal_path . '/includes/bootstrap.inc')) { $drupal_path = '../..'; do { $drupal_path .= '/..'; $depth = substr_count($drupal_path, '..'); } while (!($bootstrap_file_found = file_exists($drupal_path . '/includes/bootstrap.inc')) && $depth < 10); } } return $drupal_path; } function CheckAuthentication($drupal_path) { static $authenticated; if (!isset($authenticated)) { if (!isset($bootstrap_file_found) || $bootstrap_file_found) { $current_cwd = getcwd(); if (!defined('DRUPAL_ROOT')){ define('DRUPAL_ROOT', $drupal_path); } // Simulate being in the drupal root folder so we can share the session chdir(DRUPAL_ROOT); global $base_url; $base_root = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; $base_url = $base_root .= '://'. preg_replace('/[^a-z0-9-:._]/i', '', $_SERVER['HTTP_HOST']); if ($dir = trim(dirname($_SERVER['SCRIPT_NAME']), '\,/')) { $base_path = "/$dir"; $base_url .= $base_path; } // correct base_url so it points to Drupal root $pos = strpos($base_url, '/sites/'); $base_url = substr($base_url, 0, $pos); // drupal root absolute url // If we aren't in a Drupal installation, or if Drupal path hasn't been properly found, die if(!file_exists(DRUPAL_ROOT . '/includes/bootstrap.inc')) { die("The CMS integration service for -drupal- requires KCFinder to be properly placed inside your Drupal installation."); } // bootstrap require_once(DRUPAL_ROOT . '/includes/bootstrap.inc'); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); // if user has access permission... if (user_access('access kcfinder')) { if (!isset($_SESSION['KCFINDER'])) { $_SESSION['KCFINDER'] = array(); $_SESSION['KCFINDER']['disabled'] = false; } // User has permission, so make sure KCFinder is not disabled! if(!isset($_SESSION['KCFINDER']['disabled'])) { $_SESSION['KCFINDER']['disabled'] = false; } global $user; $_SESSION['KCFINDER']['uploadURL'] = strtr(variable_get('kcfinder_upload_url', 'sites/default/files/kcfinder'), array('%u' => $user->uid, '%n' => $user->name)); $_SESSION['KCFINDER']['uploadDir'] = strtr(variable_get('kcfinder_upload_dir', ''), array('%u' => $user->uid, '%n' => $user->name)); $_SESSION['KCFINDER']['theme'] = variable_get('kcfinder_theme', 'oxygen'); //echo '<br />uploadURL: ' . $_SESSION['KCFINDER']['uploadURL']<br />; //echo '<br />uploadDir: ' . $_SESSION['KCFINDER']['uploadDir']<br />; chdir($current_cwd); return true; } chdir($current_cwd); return false; } } } CheckAuthentication(get_drupal_path()); spl_autoload_register('__autoload'); ?>
0x6a
trunk/libraries/kcfinder/integration/drupal.php
PHP
asf20
4,415
<?php /** This file is part of KCFinder project * * @desc Upload calling script * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ error_reporting(0); require "core/autoload.php"; $uploader = new uploader(); $uploader->upload(); ?>
0x6a
trunk/libraries/kcfinder/upload.php
PHP
asf20
525
<?php /** This file is part of KCFinder project * * @desc Folder related functionality * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> browser.initFolders = function() { $('#folders').scroll(function() { browser.hideDialog(); }); $('div.folder > a').unbind(); $('div.folder > a').bind('click', function() { browser.hideDialog(); return false; }); $('div.folder > a > span.brace').unbind(); $('div.folder > a > span.brace').click(function() { if ($(this).hasClass('opened') || $(this).hasClass('closed')) browser.expandDir($(this).parent()); }); $('div.folder > a > span.folder').unbind(); $('div.folder > a > span.folder').click(function() { browser.changeDir($(this).parent()); }); $('div.folder > a > span.folder').rightClick(function(e) { _.unselect(); browser.menuDir($(this).parent(), e); }); if ($.browser.msie && $.browser.version && (parseInt($.browser.version.substr(0, 1)) < 8) ) { var fls = $('div.folder').get(); var body = $('body').get(0); var div; $.each(fls, function(i, folder) { div = document.createElement('div'); div.style.display = 'inline'; div.style.margin = div.style.border = div.style.padding = '0'; div.innerHTML='<table style="border-collapse:collapse;border:0;margin:0;width:0"><tr><td nowrap="nowrap" style="white-space:nowrap;padding:0;border:0">' + $(folder).html() + "</td></tr></table>"; body.appendChild(div); $(folder).css('width', $(div).innerWidth() + 'px'); body.removeChild(div); }); } }; browser.setTreeData = function(data, path) { if (!path) path = ''; else if (path.length && (path.substr(path.length - 1, 1) != '/')) path += '/'; path += data.name; var selector = '#folders a[href="kcdir:/' + _.escapeDirs(path) + '"]'; $(selector).data({ name: data.name, path: path, readable: data.readable, writable: data.writable, removable: data.removable, hasDirs: data.hasDirs }); $(selector + ' span.folder').addClass(data.current ? 'current' : 'regular'); if (data.dirs && data.dirs.length) { $(selector + ' span.brace').addClass('opened'); $.each(data.dirs, function(i, cdir) { browser.setTreeData(cdir, path + '/'); }); } else if (data.hasDirs) $(selector + ' span.brace').addClass('closed'); }; browser.buildTree = function(root, path) { if (!path) path = ""; path += root.name; var html = '<div class="folder"><a href="kcdir:/' + _.escapeDirs(path) + '"><span class="brace">&nbsp;</span><span class="folder">' + _.htmlData(root.name) + '</span></a>'; if (root.dirs) { html += '<div class="folders">'; for (var i = 0; i < root.dirs.length; i++) { cdir = root.dirs[i]; html += browser.buildTree(cdir, path + '/'); } html += '</div>'; } html += '</div>'; return html; }; browser.expandDir = function(dir) { var path = dir.data('path'); if (dir.children('.brace').hasClass('opened')) { dir.parent().children('.folders').hide(500, function() { if (path == browser.dir.substr(0, path.length)) browser.changeDir(dir); }); dir.children('.brace').removeClass('opened'); dir.children('.brace').addClass('closed'); } else { if (dir.parent().children('.folders').get(0)) { dir.parent().children('.folders').show(500); dir.children('.brace').removeClass('closed'); dir.children('.brace').addClass('opened'); } else if (!$('#loadingDirs').get(0)) { dir.parent().append('<div id="loadingDirs">' + this.label("Loading folders...") + '</div>'); $('#loadingDirs').css('display', 'none'); $('#loadingDirs').show(200, function() { $.ajax({ type: 'POST', dataType: 'json', url: browser.baseGetData('expand'), data: {dir:path}, async: false, success: function(data) { $('#loadingDirs').hide(200, function() { $('#loadingDirs').detach(); }); if (browser.check4errors(data)) return; var html = ''; $.each(data.dirs, function(i, cdir) { html += '<div class="folder"><a href="kcdir:/' + _.escapeDirs(path + '/' + cdir.name) + '"><span class="brace">&nbsp;</span><span class="folder">' + _.htmlData(cdir.name) + '</span></a></div>'; }); if (html.length) { dir.parent().append('<div class="folders">' + html + '</div>'); var folders = $(dir.parent().children('.folders').first()); folders.css('display', 'none'); $(folders).show(500); $.each(data.dirs, function(i, cdir) { browser.setTreeData(cdir, path); }); } if (data.dirs.length) { dir.children('.brace').removeClass('closed'); dir.children('.brace').addClass('opened'); } else { dir.children('.brace').removeClass('opened'); dir.children('.brace').removeClass('closed'); } browser.initFolders(); browser.initDropUpload(); }, error: function() { $('#loadingDirs').detach(); browser.alert(browser.label("Unknown error.")); } }); }); } } }; browser.changeDir = function(dir) { if (dir.children('span.folder').hasClass('regular')) { $('div.folder > a > span.folder').removeClass('current'); $('div.folder > a > span.folder').removeClass('regular'); $('div.folder > a > span.folder').addClass('regular'); dir.children('span.folder').removeClass('regular'); dir.children('span.folder').addClass('current'); $('#files').html(browser.label("Loading files...")); $.ajax({ type: 'POST', dataType: 'json', url: browser.baseGetData('chDir'), data: {dir:dir.data('path')}, async: false, success: function(data) { if (browser.check4errors(data)) return; browser.files = data.files; browser.orderFiles(); browser.dir = dir.data('path'); browser.dirWritable = data.dirWritable; var title = "KCFinder: /" + browser.dir; document.title = title; if (browser.opener.TinyMCE) tinyMCEPopup.editor.windowManager.setTitle(window, title); browser.statusDir(); }, error: function() { $('#files').html(browser.label("Unknown error.")); } }); } }; browser.statusDir = function() { for (var i = 0, size = 0; i < this.files.length; i++) size += parseInt(this.files[i].size); size = this.humanSize(size); $('#fileinfo').html(this.files.length + ' ' + this.label("files") + ' (' + size + ')'); }; browser.menuDir = function(dir, e) { var data = dir.data(); var html = '<div class="menu">'; if (this.clipboard && this.clipboard.length) { if (this.access.files.copy) html += '<a href="kcact:cpcbd"' + (!data.writable ? ' class="denied"' : '') + '>' + this.label("Copy {count} files", {count: this.clipboard.length}) + '</a>'; if (this.access.files.move) html += '<a href="kcact:mvcbd"' + (!data.writable ? ' class="denied"' : '') + '>' + this.label("Move {count} files", {count: this.clipboard.length}) + '</a>'; if (this.access.files.copy || this.access.files.move) html += '<div class="delimiter"></div>'; } html += '<a href="kcact:refresh">' + this.label("Refresh") + '</a>'; if (this.support.zip) html+= '<div class="delimiter"></div>' + '<a href="kcact:download">' + this.label("Download") + '</a>'; if (this.access.dirs.create || this.access.dirs.rename || this.access.dirs['delete']) html += '<div class="delimiter"></div>'; if (this.access.dirs.create) html += '<a href="kcact:mkdir"' + (!data.writable ? ' class="denied"' : '') + '>' + this.label("New Subfolder...") + '</a>'; if (this.access.dirs.rename) html += '<a href="kcact:mvdir"' + (!data.removable ? ' class="denied"' : '') + '>' + this.label("Rename...") + '</a>'; if (this.access.dirs['delete']) html += '<a href="kcact:rmdir"' + (!data.removable ? ' class="denied"' : '') + '>' + this.label("Delete") + '</a>'; html += '</div>'; $('#dialog').html(html); this.showMenu(e); $('div.folder > a > span.folder').removeClass('context'); if (dir.children('span.folder').hasClass('regular')) dir.children('span.folder').addClass('context'); if (this.clipboard && this.clipboard.length && data.writable) { $('.menu a[href="kcact:cpcbd"]').click(function() { browser.hideDialog(); browser.copyClipboard(data.path); return false; }); $('.menu a[href="kcact:mvcbd"]').click(function() { browser.hideDialog(); browser.moveClipboard(data.path); return false; }); } $('.menu a[href="kcact:refresh"]').click(function() { browser.hideDialog(); browser.refreshDir(dir); return false; }); $('.menu a[href="kcact:download"]').click(function() { browser.hideDialog(); browser.post(browser.baseGetData('downloadDir'), {dir:data.path}); return false; }); $('.menu a[href="kcact:mkdir"]').click(function(e) { if (!data.writable) return false; browser.hideDialog(); browser.fileNameDialog( e, {dir: data.path}, 'newDir', '', browser.baseGetData('newDir'), { title: "New folder name:", errEmpty: "Please enter new folder name.", errSlash: "Unallowable characters in folder name.", errDot: "Folder name shouldn't begins with '.'" }, function() { browser.refreshDir(dir); browser.initDropUpload(); if (!data.hasDirs) { dir.data('hasDirs', true); dir.children('span.brace').addClass('closed'); } } ); return false; }); $('.menu a[href="kcact:mvdir"]').click(function(e) { if (!data.removable) return false; browser.hideDialog(); browser.fileNameDialog( e, {dir: data.path}, 'newName', data.name, browser.baseGetData('renameDir'), { title: "New folder name:", errEmpty: "Please enter new folder name.", errSlash: "Unallowable characters in folder name.", errDot: "Folder name shouldn't begins with '.'" }, function(dt) { if (!dt.name) { browser.alert(browser.label("Unknown error.")); return; } var currentDir = (data.path == browser.dir); dir.children('span.folder').html(_.htmlData(dt.name)); dir.data('name', dt.name); dir.data('path', _.dirname(data.path) + '/' + dt.name); if (currentDir) browser.dir = dir.data('path'); browser.initDropUpload(); }, true ); return false; }); $('.menu a[href="kcact:rmdir"]').click(function() { if (!data.removable) return false; browser.hideDialog(); browser.confirm( "Are you sure you want to delete this folder and all its content?", function(callBack) { $.ajax({ type: 'POST', dataType: 'json', url: browser.baseGetData('deleteDir'), data: {dir: data.path}, async: false, success: function(data) { if (callBack) callBack(); if (browser.check4errors(data)) return; dir.parent().hide(500, function() { var folders = dir.parent().parent(); var pDir = folders.parent().children('a').first(); dir.parent().detach(); if (!folders.children('div.folder').get(0)) { pDir.children('span.brace').first().removeClass('opened'); pDir.children('span.brace').first().removeClass('closed'); pDir.parent().children('.folders').detach(); pDir.data('hasDirs', false); } if (pDir.data('path') == browser.dir.substr(0, pDir.data('path').length)) browser.changeDir(pDir); browser.initDropUpload(); }); }, error: function() { if (callBack) callBack(); browser.alert(browser.label("Unknown error.")); } }); } ); return false; }); }; browser.refreshDir = function(dir) { var path = dir.data('path'); if (dir.children('.brace').hasClass('opened') || dir.children('.brace').hasClass('closed')) { dir.children('.brace').removeClass('opened'); dir.children('.brace').addClass('closed'); } dir.parent().children('.folders').first().detach(); if (path == browser.dir.substr(0, path.length)) browser.changeDir(dir); browser.expandDir(dir); return true; };
0x6a
trunk/libraries/kcfinder/js/browser/folders.js
JavaScript
asf20
15,031
<?php /** This file is part of KCFinder project * * @desc File related functionality * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> browser.initFiles = function() { $(document).unbind('keydown'); $(document).keydown(function(e) { return !browser.selectAll(e); }); $('#files').unbind(); $('#files').scroll(function() { browser.hideDialog(); }); $('.file').unbind(); $('.file').click(function(e) { _.unselect(); browser.selectFile($(this), e); }); $('.file').rightClick(function(e) { _.unselect(); browser.menuFile($(this), e); }); $('.file').dblclick(function() { _.unselect(); browser.returnFile($(this)); }); $('.file').mouseup(function() { _.unselect(); }); $('.file').mouseout(function() { _.unselect(); }); $.each(this.shows, function(i, val) { var display = (_.kuki.get('show' + val) == 'off') ? 'none' : 'block'; $('#files .file div.' + val).css('display', display); }); this.statusDir(); }; browser.showFiles = function(callBack, selected) { this.fadeFiles(); setTimeout(function() { var html = ''; $.each(browser.files, function(i, file) { var stamp = []; $.each(file, function(key, val) { stamp[stamp.length] = key + "|" + val; }); stamp = _.md5(stamp.join('|')); if (_.kuki.get('view') == 'list') { if (!i) html += '<table summary="list">'; var icon = _.getFileExtension(file.name); if (file.thumb) icon = '.image'; else if (!icon.length || !file.smallIcon) icon = '.'; icon = 'themes/' + browser.theme + '/img/files/small/' + icon + '.png'; html += '<tr class="file">' + '<td class="name" style="background-image:url(' + icon + ')">' + _.htmlData(file.name) + '</td>' + '<td class="time">' + file.date + '</td>' + '<td class="size">' + browser.humanSize(file.size) + '</td>' + '</tr>'; if (i == browser.files.length - 1) html += '</table>'; } else { if (file.thumb) var icon = browser.baseGetData('thumb') + '&file=' + encodeURIComponent(file.name) + '&dir=' + encodeURIComponent(browser.dir) + '&stamp=' + stamp; else if (file.smallThumb) { var icon = browser.uploadURL + '/' + browser.dir + '/' + file.name; icon = _.escapeDirs(icon).replace(/\'/g, "%27"); } else { var icon = file.bigIcon ? _.getFileExtension(file.name) : '.'; if (!icon.length) icon = '.'; icon = 'themes/' + browser.theme + '/img/files/big/' + icon + '.png'; } html += '<div class="file">' + '<div class="thumb" style="background-image:url(\'' + icon + '\')" ></div>' + '<div class="name">' + _.htmlData(file.name) + '</div>' + '<div class="time">' + file.date + '</div>' + '<div class="size">' + browser.humanSize(file.size) + '</div>' + '</div>'; } }); $('#files').html('<div>' + html + '<div>'); $.each(browser.files, function(i, file) { var item = $('#files .file').get(i); $(item).data(file); if (_.inArray(file.name, selected) || ((typeof selected != 'undefined') && !selected.push && (file.name == selected)) ) $(item).addClass('selected'); }); $('#files > div').css({opacity:'', filter:''}); if (callBack) callBack(); browser.initFiles(); }, 200); }; browser.selectFile = function(file, e) { if (e.ctrlKey || e.metaKey) { if (file.hasClass('selected')) file.removeClass('selected'); else file.addClass('selected'); var files = $('.file.selected').get(); var size = 0; if (!files.length) this.statusDir(); else { $.each(files, function(i, cfile) { size += parseInt($(cfile).data('size')); }); size = this.humanSize(size); if (files.length > 1) $('#fileinfo').html(files.length + ' ' + this.label("selected files") + ' (' + size + ')'); else { var data = $(files[0]).data(); $('#fileinfo').html(data.name + ' (' + this.humanSize(data.size) + ', ' + data.date + ')'); } } } else { var data = file.data(); $('.file').removeClass('selected'); file.addClass('selected'); $('#fileinfo').html(data.name + ' (' + this.humanSize(data.size) + ', ' + data.date + ')'); } }; browser.selectAll = function(e) { if ((!e.ctrlKey && !e.metaKey) || ((e.keyCode != 65) && (e.keyCode != 97))) return false; var files = $('.file').get(); if (files.length) { var size = 0; $.each(files, function(i, file) { if (!$(file).hasClass('selected')) $(file).addClass('selected'); size += parseInt($(file).data('size')); }); size = this.humanSize(size); $('#fileinfo').html(files.length + ' ' + this.label("selected files") + ' (' + size + ')'); } return true; }; browser.returnFile = function(file) { var fileURL = file.substr ? file : browser.uploadURL + '/' + browser.dir + '/' + file.data('name'); fileURL = _.escapeDirs(fileURL); if (this.opener.CKEditor) { this.opener.CKEditor.object.tools.callFunction(this.opener.CKEditor.funcNum, fileURL, ''); window.close(); } else if (this.opener.FCKeditor) { window.opener.SetUrl(fileURL) ; window.close() ; } else if (this.opener.TinyMCE) { var win = tinyMCEPopup.getWindowArg('window'); win.document.getElementById(tinyMCEPopup.getWindowArg('input')).value = fileURL; if (win.getImageData) win.getImageData(); if (typeof(win.ImageDialog) != "undefined") { if (win.ImageDialog.getImageData) win.ImageDialog.getImageData(); if (win.ImageDialog.showPreviewImage) win.ImageDialog.showPreviewImage(fileURL); } tinyMCEPopup.close(); } else if (this.opener.callBack) { if (window.opener && window.opener.KCFinder) { this.opener.callBack(fileURL); window.close(); } if (window.parent && window.parent.KCFinder) { var button = $('#toolbar a[href="kcact:maximize"]'); if (button.hasClass('selected')) this.maximize(button); this.opener.callBack(fileURL); } } else if (this.opener.callBackMultiple) { if (window.opener && window.opener.KCFinder) { this.opener.callBackMultiple([fileURL]); window.close(); } if (window.parent && window.parent.KCFinder) { var button = $('#toolbar a[href="kcact:maximize"]'); if (button.hasClass('selected')) this.maximize(button); this.opener.callBackMultiple([fileURL]); } } }; browser.returnFiles = function(files) { if (this.opener.callBackMultiple && files.length) { var rfiles = []; $.each(files, function(i, file) { rfiles[i] = browser.uploadURL + '/' + browser.dir + '/' + $(file).data('name'); rfiles[i] = _.escapeDirs(rfiles[i]); }); this.opener.callBackMultiple(rfiles); if (window.opener) window.close() } }; browser.returnThumbnails = function(files) { if (this.opener.callBackMultiple) { var rfiles = []; var j = 0; $.each(files, function(i, file) { if ($(file).data('thumb')) { rfiles[j] = browser.thumbsURL + '/' + browser.dir + '/' + $(file).data('name'); rfiles[j] = _.escapeDirs(rfiles[j++]); } }); this.opener.callBackMultiple(rfiles); if (window.opener) window.close() } }; browser.menuFile = function(file, e) { var data = file.data(); var path = this.dir + '/' + data.name; var files = $('.file.selected').get(); var html = ''; if (file.hasClass('selected') && files.length && (files.length > 1)) { var thumb = false; var notWritable = 0; var cdata; $.each(files, function(i, cfile) { cdata = $(cfile).data(); if (cdata.thumb) thumb = true; if (!data.writable) notWritable++; }); if (this.opener.callBackMultiple) { html += '<a href="kcact:pick">' + this.label("Select") + '</a>'; if (thumb) html += '<a href="kcact:pick_thumb">' + this.label("Select Thumbnails") + '</a>'; } if (data.thumb || data.smallThumb || this.support.zip) { html += (html.length ? '<div class="delimiter"></div>' : ''); if (data.thumb || data.smallThumb) html +='<a href="kcact:view">' + this.label("View") + '</a>'; if (this.support.zip) html += (html.length ? '<div class="delimiter"></div>' : '') + '<a href="kcact:download">' + this.label("Download") + '</a>'; } if (this.access.files.copy || this.access.files.move) html += (html.length ? '<div class="delimiter"></div>' : '') + '<a href="kcact:clpbrdadd">' + this.label("Add to Clipboard") + '</a>'; if (this.access.files['delete']) html += (html.length ? '<div class="delimiter"></div>' : '') + '<a href="kcact:rm"' + ((notWritable == files.length) ? ' class="denied"' : '') + '>' + this.label("Delete") + '</a>'; if (html.length) { html = '<div class="menu">' + html + '</div>'; $('#dialog').html(html); this.showMenu(e); } else return; $('.menu a[href="kcact:pick"]').click(function() { browser.returnFiles(files); browser.hideDialog(); return false; }); $('.menu a[href="kcact:pick_thumb"]').click(function() { browser.returnThumbnails(files); browser.hideDialog(); return false; }); $('.menu a[href="kcact:download"]').click(function() { browser.hideDialog(); var pfiles = []; $.each(files, function(i, cfile) { pfiles[i] = $(cfile).data('name'); }); browser.post(browser.baseGetData('downloadSelected'), {dir:browser.dir, files:pfiles}); return false; }); $('.menu a[href="kcact:clpbrdadd"]').click(function() { browser.hideDialog(); var msg = ''; $.each(files, function(i, cfile) { var cdata = $(cfile).data(); var failed = false; for (i = 0; i < browser.clipboard.length; i++) if ((browser.clipboard[i].name == cdata.name) && (browser.clipboard[i].dir == browser.dir) ) { failed = true msg += cdata.name + ": " + browser.label("This file is already added to the Clipboard.") + "\n"; break; } if (!failed) { cdata.dir = browser.dir; browser.clipboard[browser.clipboard.length] = cdata; } }); browser.initClipboard(); if (msg.length) browser.alert(msg.substr(0, msg.length - 1)); return false; }); $('.menu a[href="kcact:rm"]').click(function() { if ($(this).hasClass('denied')) return false; browser.hideDialog(); var failed = 0; var dfiles = []; $.each(files, function(i, cfile) { var cdata = $(cfile).data(); if (!cdata.writable) failed++; else dfiles[dfiles.length] = browser.dir + "/" + cdata.name; }); if (failed == files.length) { browser.alert(browser.label("The selected files are not removable.")); return false; } var go = function(callBack) { browser.fadeFiles(); $.ajax({ type: 'POST', dataType: 'json', url: browser.baseGetData('rm_cbd'), data: {files:dfiles}, async: false, success: function(data) { if (callBack) callBack(); browser.check4errors(data); browser.refresh(); }, error: function() { if (callBack) callBack(); $('#files > div').css({ opacity: '', filter: '' }); browser.alert(browser.label("Unknown error.")); } }); }; if (failed) browser.confirm( browser.label("{count} selected files are not removable. Do you want to delete the rest?", {count:failed}), go ) else browser.confirm( browser.label("Are you sure you want to delete all selected files?"), go ); return false; }); } else { html += '<div class="menu">'; $('.file').removeClass('selected'); file.addClass('selected'); $('#fileinfo').html(data.name + ' (' + this.humanSize(data.size) + ', ' + data.date + ')'); if (this.opener.callBack || this.opener.callBackMultiple) { html += '<a href="kcact:pick">' + this.label("Select") + '</a>'; if (data.thumb) html += '<a href="kcact:pick_thumb">' + this.label("Select Thumbnail") + '</a>'; html += '<div class="delimiter"></div>'; } if (data.thumb || data.smallThumb) html +='<a href="kcact:view">' + this.label("View") + '</a>'; html += '<a href="kcact:download">' + this.label("Download") + '</a>'; if (this.access.files.copy || this.access.files.move) html += '<div class="delimiter"></div>' + '<a href="kcact:clpbrdadd">' + this.label("Add to Clipboard") + '</a>'; if (this.access.files.rename || this.access.files['delete']) html += '<div class="delimiter"></div>'; if (this.access.files.rename) html += '<a href="kcact:mv"' + (!data.writable ? ' class="denied"' : '') + '>' + this.label("Rename...") + '</a>'; if (this.access.files['delete']) html += '<a href="kcact:rm"' + (!data.writable ? ' class="denied"' : '') + '>' + this.label("Delete") + '</a>'; html += '</div>'; $('#dialog').html(html); this.showMenu(e); $('.menu a[href="kcact:pick"]').click(function() { browser.returnFile(file); browser.hideDialog(); return false; }); $('.menu a[href="kcact:pick_thumb"]').click(function() { var path = browser.thumbsURL + '/' + browser.dir + '/' + data.name; browser.returnFile(path); browser.hideDialog(); return false; }); $('.menu a[href="kcact:download"]').click(function() { var html = '<form id="downloadForm" method="post" action="' + browser.baseGetData('download') + '">' + '<input type="hidden" name="dir" />' + '<input type="hidden" name="file" />' + '</form>'; $('#dialog').html(html); $('#downloadForm input').get(0).value = browser.dir; $('#downloadForm input').get(1).value = data.name; $('#downloadForm').submit(); return false; }); $('.menu a[href="kcact:clpbrdadd"]').click(function() { for (i = 0; i < browser.clipboard.length; i++) if ((browser.clipboard[i].name == data.name) && (browser.clipboard[i].dir == browser.dir) ) { browser.hideDialog(); browser.alert(browser.label("This file is already added to the Clipboard.")); return false; } var cdata = data; cdata.dir = browser.dir; browser.clipboard[browser.clipboard.length] = cdata; browser.initClipboard(); browser.hideDialog(); return false; }); $('.menu a[href="kcact:mv"]').click(function(e) { if (!data.writable) return false; browser.fileNameDialog( e, {dir: browser.dir, file: data.name}, 'newName', data.name, browser.baseGetData('rename'), { title: "New file name:", errEmpty: "Please enter new file name.", errSlash: "Unallowable characters in file name.", errDot: "File name shouldn't begins with '.'" }, function() { browser.refresh(); } ); return false; }); $('.menu a[href="kcact:rm"]').click(function() { if (!data.writable) return false; browser.hideDialog(); browser.confirm(browser.label("Are you sure you want to delete this file?"), function(callBack) { $.ajax({ type: 'POST', dataType: 'json', url: browser.baseGetData('delete'), data: {dir:browser.dir, file:data.name}, async: false, success: function(data) { if (callBack) callBack(); browser.clearClipboard(); if (browser.check4errors(data)) return; browser.refresh(); }, error: function() { if (callBack) callBack(); browser.alert(browser.label("Unknown error.")); } }); } ); return false; }); } $('.menu a[href="kcact:view"]').click(function() { browser.hideDialog(); var ts = new Date().getTime(); var showImage = function(data) { url = _.escapeDirs(browser.uploadURL + '/' + browser.dir + '/' + data.name) + '?ts=' + ts, $('#loading').html(browser.label("Loading image...")); $('#loading').css('display', 'inline'); var img = new Image(); img.src = url; img.onerror = function() { browser.lock = false; $('#loading').css('display', 'none'); browser.alert(browser.label("Unknown error.")); $(document).unbind('keydown'); $(document).keydown(function(e) { return !browser.selectAll(e); }); browser.refresh(); }; var onImgLoad = function() { browser.lock = false; $('#files .file').each(function() { if ($(this).data('name') == data.name) browser.ssImage = this; }); $('#loading').css('display', 'none'); $('#dialog').html('<div class="slideshow"><img /></div>'); $('#dialog img').attr({ src: url, title: data.name }).fadeIn('fast', function() { var o_w = $('#dialog').outerWidth(); var o_h = $('#dialog').outerHeight(); var f_w = $(window).width() - 30; var f_h = $(window).height() - 30; if ((o_w > f_w) || (o_h > f_h)) { if ((f_w / f_h) > (o_w / o_h)) f_w = parseInt((o_w * f_h) / o_h); else if ((f_w / f_h) < (o_w / o_h)) f_h = parseInt((o_h * f_w) / o_w); $('#dialog img').attr({ width: f_w, height: f_h }); } $('#dialog').unbind('click'); $('#dialog').click(function(e) { browser.hideDialog(); $(document).unbind('keydown'); $(document).keydown(function(e) { return !browser.selectAll(e); }); if (browser.ssImage) { browser.selectFile($(browser.ssImage), e); } }); browser.showDialog(); var images = []; $.each(browser.files, function(i, file) { if (file.thumb || file.smallThumb) images[images.length] = file; }); if (images.length) $.each(images, function(i, image) { if (image.name == data.name) { $(document).unbind('keydown'); $(document).keydown(function(e) { if (images.length > 1) { if (!browser.lock && (e.keyCode == 37)) { var nimg = i ? images[i - 1] : images[images.length - 1]; browser.lock = true; showImage(nimg); } if (!browser.lock && (e.keyCode == 39)) { var nimg = (i >= images.length - 1) ? images[0] : images[i + 1]; browser.lock = true; showImage(nimg); } } if (e.keyCode == 27) { browser.hideDialog(); $(document).unbind('keydown'); $(document).keydown(function(e) { return !browser.selectAll(e); }); } }); } }); }); }; if (img.complete) onImgLoad(); else img.onload = onImgLoad; }; showImage(data); return false; }); };
0x6a
trunk/libraries/kcfinder/js/browser/files.js
JavaScript
asf20
24,309
<?php /** This file is part of KCFinder project * * @desc Toolbar functionality * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> browser.initToolbar = function() { $('#toolbar a').click(function() { browser.hideDialog(); }); if (!_.kuki.isSet('displaySettings')) _.kuki.set('displaySettings', 'off'); if (_.kuki.get('displaySettings') == 'on') { $('#toolbar a[href="kcact:settings"]').addClass('selected'); $('#settings').css('display', 'block'); browser.resize(); } $('#toolbar a[href="kcact:settings"]').click(function () { if ($('#settings').css('display') == 'none') { $(this).addClass('selected'); _.kuki.set('displaySettings', 'on'); $('#settings').css('display', 'block'); browser.fixFilesHeight(); } else { $(this).removeClass('selected'); _.kuki.set('displaySettings', 'off'); $('#settings').css('display', 'none'); browser.fixFilesHeight(); } return false; }); $('#toolbar a[href="kcact:refresh"]').click(function() { browser.refresh(); return false; }); if (window.opener || this.opener.TinyMCE || $('iframe', window.parent.document).get(0)) $('#toolbar a[href="kcact:maximize"]').click(function() { browser.maximize(this); return false; }); else $('#toolbar a[href="kcact:maximize"]').css('display', 'none'); $('#toolbar a[href="kcact:about"]').click(function() { var html = '<div class="box about">' + '<div class="head"><a href="http://kcfinder.sunhater.com" target="_blank">KCFinder</a> ' + browser.version + '</div>'; if (browser.support.check4Update) html += '<div id="checkver"><span class="loading"><span>' + browser.label("Checking for new version...") + '</span></span></div>'; html += '<div>' + browser.label("Licenses:") + ' GPLv2 & LGPLv2</div>' + '<div>Copyright &copy;2010, 2011 Pavel Tzonkov</div>' + '<button>' + browser.label("OK") + '</button>' + '</div>'; $('#dialog').html(html); $('#dialog').data('title', browser.label("About")); browser.showDialog(); var close = function() { browser.hideDialog(); browser.unshadow(); } $('#dialog button').click(close); var span = $('#checkver > span'); setTimeout(function() { $.ajax({ dataType: 'json', url: browser.baseGetData('check4Update'), async: true, success: function(data) { if (!$('#dialog').html().length) return; span.removeClass('loading'); if (!data.version) { span.html(browser.label("Unable to connect!")); browser.showDialog(); return; } if (browser.version < data.version) span.html('<a href="http://kcfinder.sunhater.com/download" target="_blank">' + browser.label("Download version {version} now!", {version: data.version}) + '</a>'); else span.html(browser.label("KCFinder is up to date!")); browser.showDialog(); }, error: function() { if (!$('#dialog').html().length) return; span.removeClass('loading'); span.html(browser.label("Unable to connect!")); browser.showDialog(); } }); }, 1000); $('#dialog').unbind(); return false; }); this.initUploadButton(); }; browser.initUploadButton = function() { var btn = $('#toolbar a[href="kcact:upload"]'); if (!this.access.files.upload) { btn.css('display', 'none'); return; } var top = btn.get(0).offsetTop; var width = btn.outerWidth(); var height = btn.outerHeight(); $('#toolbar').prepend('<div id="upload" style="top:' + top + 'px;width:' + width + 'px;height:' + height + 'px">' + '<form enctype="multipart/form-data" method="post" target="uploadResponse" action="' + browser.baseGetData('upload') + '">' + '<input type="file" name="upload[]" onchange="browser.uploadFile(this.form)" style="height:' + height + 'px" multiple="multiple" />' + '<input type="hidden" name="dir" value="" />' + '</form>' + '</div>'); $('#upload input').css('margin-left', "-" + ($('#upload input').outerWidth() - width) + 'px'); $('#upload').mouseover(function() { $('#toolbar a[href="kcact:upload"]').addClass('hover'); }); $('#upload').mouseout(function() { $('#toolbar a[href="kcact:upload"]').removeClass('hover'); }); }; browser.uploadFile = function(form) { if (!this.dirWritable) { browser.alert(this.label("Cannot write to upload folder.")); $('#upload').detach(); browser.initUploadButton(); return; } form.elements[1].value = browser.dir; $('<iframe id="uploadResponse" name="uploadResponse" src="javascript:;"></iframe>').prependTo(document.body); $('#loading').html(this.label("Uploading file...")); $('#loading').css('display', 'inline'); form.submit(); $('#uploadResponse').load(function() { var response = $(this).contents().find('body').html(); $('#loading').css('display', 'none'); response = response.split("\n"); var selected = [], errors = []; $.each(response, function(i, row) { if (row.substr(0, 1) == '/') selected[selected.length] = row.substr(1, row.length - 1) else errors[errors.length] = row; }); if (errors.length) browser.alert(errors.join("\n")); if (!selected.length) selected = null browser.refresh(selected); $('#upload').detach(); setTimeout(function() { $('#uploadResponse').detach(); }, 1); browser.initUploadButton(); }); }; browser.maximize = function(button) { if (window.opener) { window.moveTo(0, 0); width = screen.availWidth; height = screen.availHeight; if ($.browser.opera) height -= 50; window.resizeTo(width, height); } else if (browser.opener.TinyMCE) { var win, ifr, id; $('iframe', window.parent.document).each(function() { if (/^mce_\d+_ifr$/.test($(this).attr('id'))) { id = parseInt($(this).attr('id').replace(/^mce_(\d+)_ifr$/, "$1")); win = $('#mce_' + id, window.parent.document); ifr = $('#mce_' + id + '_ifr', window.parent.document); } }); if ($(button).hasClass('selected')) { $(button).removeClass('selected'); win.css({ left: browser.maximizeMCE.left + 'px', top: browser.maximizeMCE.top + 'px', width: browser.maximizeMCE.width + 'px', height: browser.maximizeMCE.height + 'px' }); ifr.css({ width: browser.maximizeMCE.width - browser.maximizeMCE.Hspace + 'px', height: browser.maximizeMCE.height - browser.maximizeMCE.Vspace + 'px' }); } else { $(button).addClass('selected') browser.maximizeMCE = { width: _.nopx(win.css('width')), height: _.nopx(win.css('height')), left: win.position().left, top: win.position().top, Hspace: _.nopx(win.css('width')) - _.nopx(ifr.css('width')), Vspace: _.nopx(win.css('height')) - _.nopx(ifr.css('height')) }; var width = $(window.parent).width(); var height = $(window.parent).height(); win.css({ left: $(window.parent).scrollLeft() + 'px', top: $(window.parent).scrollTop() + 'px', width: width + 'px', height: height + 'px' }); ifr.css({ width: width - browser.maximizeMCE.Hspace + 'px', height: height - browser.maximizeMCE.Vspace + 'px' }); } } else if ($('iframe', window.parent.document).get(0)) { var ifrm = $('iframe[name="' + window.name + '"]', window.parent.document); var parent = ifrm.parent(); var width, height; if ($(button).hasClass('selected')) { $(button).removeClass('selected'); if (browser.maximizeThread) { clearInterval(browser.maximizeThread); browser.maximizeThread = null; } if (browser.maximizeW) browser.maximizeW = null; if (browser.maximizeH) browser.maximizeH = null; $.each($('*', window.parent.document).get(), function(i, e) { e.style.display = browser.maximizeDisplay[i]; }); ifrm.css({ display: browser.maximizeCSS.display, position: browser.maximizeCSS.position, left: browser.maximizeCSS.left, top: browser.maximizeCSS.top, width: browser.maximizeCSS.width, height: browser.maximizeCSS.height }); $(window.parent).scrollLeft(browser.maximizeLest); $(window.parent).scrollTop(browser.maximizeTop); } else { $(button).addClass('selected'); browser.maximizeCSS = { display: ifrm.css('display'), position: ifrm.css('position'), left: ifrm.css('left'), top: ifrm.css('top'), width: ifrm.outerWidth() + 'px', height: ifrm.outerHeight() + 'px' }; browser.maximizeTop = $(window.parent).scrollTop(); browser.maximizeLeft = $(window.parent).scrollLeft(); browser.maximizeDisplay = []; $.each($('*', window.parent.document).get(), function(i, e) { browser.maximizeDisplay[i] = $(e).css('display'); $(e).css('display', 'none'); }); ifrm.css('display', 'block'); ifrm.parents().css('display', 'block'); var resize = function() { width = $(window.parent).width(); height = $(window.parent).height(); if (!browser.maximizeW || (browser.maximizeW != width) || !browser.maximizeH || (browser.maximizeH != height) ) { browser.maximizeW = width; browser.maximizeH = height; ifrm.css({ width: width + 'px', height: height + 'px' }); browser.resize(); } } ifrm.css('position', 'absolute'); if ((ifrm.offset().left == ifrm.position().left) && (ifrm.offset().top == ifrm.position().top) ) ifrm.css({left: '0', top: '0'}); else ifrm.css({ left: - ifrm.offset().left + 'px', top: - ifrm.offset().top + 'px' }); resize(); browser.maximizeThread = setInterval(resize, 250); } } }; browser.refresh = function(selected) { this.fadeFiles(); $.ajax({ type: 'POST', dataType: 'json', url: browser.baseGetData('chDir'), data: {dir:browser.dir}, async: false, success: function(data) { if (browser.check4errors(data)) return; browser.dirWritable = data.dirWritable; browser.files = data.files ? data.files : []; browser.orderFiles(null, selected); browser.statusDir(); }, error: function() { $('#files > div').css({opacity:'', filter:''}); $('#files').html(browser.label("Unknown error.")); } }); };
0x6a
trunk/libraries/kcfinder/js/browser/toolbar.js
JavaScript
asf20
12,699
<?php /** This file is part of KCFinder project * * @desc Join all JavaScript files in current directory * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ chdir(".."); // For compatibality chdir(".."); require "lib/helper_httpCache.php"; require "lib/helper_dir.php"; $files = dir::content("js/browser", array( 'types' => "file", 'pattern' => '/^.*\.js$/' )); foreach ($files as $file) { $fmtime = filemtime($file); if (!isset($mtime) || ($fmtime > $mtime)) $mtime = $fmtime; } httpCache::checkMTime($mtime); header("Content-Type: text/javascript"); foreach ($files as $file) require $file; ?>
0x6a
trunk/libraries/kcfinder/js/browser/joiner.php
PHP
asf20
919
<?php /** This file is part of KCFinder project * * @desc Clipboard functionality * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> browser.initClipboard = function() { if (!this.clipboard || !this.clipboard.length) return; var size = 0; $.each(this.clipboard, function(i, val) { size += parseInt(val.size); }); size = this.humanSize(size); $('#clipboard').html('<div title="' + this.label("Clipboard") + ' (' + this.clipboard.length + ' ' + this.label("files") + ', ' + size + ')" onclick="browser.openClipboard()"></div>'); var resize = function() { $('#clipboard').css({ left: $(window).width() - $('#clipboard').outerWidth() + 'px', top: $(window).height() - $('#clipboard').outerHeight() + 'px' }); }; resize(); $('#clipboard').css('display', 'block'); $(window).unbind(); $(window).resize(function() { browser.resize(); resize(); }); }; browser.openClipboard = function() { if (!this.clipboard || !this.clipboard.length) return; if ($('.menu a[href="kcact:cpcbd"]').html()) { $('#clipboard').removeClass('selected'); this.hideDialog(); return; } var html = '<div class="menu"><div class="list">'; $.each(this.clipboard, function(i, val) { icon = _.getFileExtension(val.name); if (val.thumb) icon = '.image'; else if (!val.smallIcon || !icon.length) icon = '.'; var icon = 'themes/' + browser.theme + '/img/files/small/' + icon + '.png'; html += '<a style="background-image:url(' + _.escapeDirs(icon) + ')" title="' + browser.label("Click to remove from the Clipboard") + '" onclick="browser.removeFromClipboard(' + i + ')">' + _.htmlData(_.basename(val.name)) + '</a>'; }); html += '</div><div class="delimiter"></div>'; if (this.support.zip) html+= '<a href="kcact:download">' + this.label("Download files") + '</a>'; if (this.access.files.copy || this.access.files.move || this.access.files['delete']) html += '<div class="delimiter"></div>'; if (this.access.files.copy) html += '<a href="kcact:cpcbd"' + (!browser.dirWritable ? ' class="denied"' : '') + '>' + this.label("Copy files here") + '</a>'; if (this.access.files.move) html += '<a href="kcact:mvcbd"' + (!browser.dirWritable ? ' class="denied"' : '') + '>' + this.label("Move files here") + '</a>'; if (this.access.files['delete']) html += '<a href="kcact:rmcbd">' + this.label("Delete files") + '</a>'; html += '<div class="delimiter"></div>' + '<a href="kcact:clrcbd">' + this.label("Clear the Clipboard") + '</a>' + '</div>'; setTimeout(function() { $('#clipboard').addClass('selected'); $('#dialog').html(html); $('.menu a[href="kcact:download"]').click(function() { browser.hideDialog(); browser.downloadClipboard(); return false; }); $('.menu a[href="kcact:cpcbd"]').click(function() { if (!browser.dirWritable) return false; browser.hideDialog(); browser.copyClipboard(browser.dir); return false; }); $('.menu a[href="kcact:mvcbd"]').click(function() { if (!browser.dirWritable) return false; browser.hideDialog(); browser.moveClipboard(browser.dir); return false; }); $('.menu a[href="kcact:rmcbd"]').click(function() { browser.hideDialog(); browser.confirm( browser.label("Are you sure you want to delete all files in the Clipboard?"), function(callBack) { if (callBack) callBack(); browser.deleteClipboard(); } ); return false; }); $('.menu a[href="kcact:clrcbd"]').click(function() { browser.hideDialog(); browser.clearClipboard(); return false; }); var left = $(window).width() - $('#dialog').outerWidth(); var top = $(window).height() - $('#dialog').outerHeight() - $('#clipboard').outerHeight(); var lheight = top + _.outerTopSpace('#dialog'); $('.menu .list').css('max-height', lheight + 'px'); var top = $(window).height() - $('#dialog').outerHeight() - $('#clipboard').outerHeight(); $('#dialog').css({ left: (left - 4) + 'px', top: top + 'px' }); $('#dialog').fadeIn(); }, 1); }; browser.removeFromClipboard = function(i) { if (!this.clipboard || !this.clipboard[i]) return false; if (this.clipboard.length == 1) { this.clearClipboard(); this.hideDialog(); return; } if (i < this.clipboard.length - 1) { var last = this.clipboard.slice(i + 1); this.clipboard = this.clipboard.slice(0, i); this.clipboard = this.clipboard.concat(last); } else this.clipboard.pop(); this.initClipboard(); this.hideDialog(); this.openClipboard(); return true; }; browser.copyClipboard = function(dir) { if (!this.clipboard || !this.clipboard.length) return; var files = []; var failed = 0; for (i = 0; i < this.clipboard.length; i++) if (this.clipboard[i].readable) files[i] = this.clipboard[i].dir + '/' + this.clipboard[i].name; else failed++; if (this.clipboard.length == failed) { browser.alert(this.label("The files in the Clipboard are not readable.")); return; } var go = function(callBack) { if (dir == browser.dir) browser.fadeFiles(); $.ajax({ type: 'POST', dataType: 'json', url: browser.baseGetData('cp_cbd'), data: {dir: dir, files: files}, async: false, success: function(data) { if (callBack) callBack(); browser.check4errors(data); browser.clearClipboard(); if (dir == browser.dir) browser.refresh(); }, error: function() { if (callBack) callBack(); $('#files > div').css({ opacity: '', filter: '' }); browser.alert(browser.label("Unknown error.")); } }); }; if (failed) browser.confirm( browser.label("{count} files in the Clipboard are not readable. Do you want to copy the rest?", {count:failed}), go ) else go(); }; browser.moveClipboard = function(dir) { if (!this.clipboard || !this.clipboard.length) return; var files = []; var failed = 0; for (i = 0; i < this.clipboard.length; i++) if (this.clipboard[i].readable && this.clipboard[i].writable) files[i] = this.clipboard[i].dir + "/" + this.clipboard[i].name; else failed++; if (this.clipboard.length == failed) { browser.alert(this.label("The files in the Clipboard are not movable.")) return; } var go = function(callBack) { browser.fadeFiles(); $.ajax({ type: 'POST', dataType: 'json', url: browser.baseGetData('mv_cbd'), data: {dir: dir, files: files}, async: false, success: function(data) { if (callBack) callBack(); browser.check4errors(data); browser.clearClipboard(); browser.refresh(); }, error: function() { if (callBack) callBack(); $('#files > div').css({ opacity: '', filter: '' }); browser.alert(browser.label("Unknown error.")); } }); }; if (failed) browser.confirm( browser.label("{count} files in the Clipboard are not movable. Do you want to move the rest?", {count: failed}), go ); else go(); }; browser.deleteClipboard = function() { if (!this.clipboard || !this.clipboard.length) return; var files = []; var failed = 0; for (i = 0; i < this.clipboard.length; i++) if (this.clipboard[i].readable && this.clipboard[i].writable) files[i] = this.clipboard[i].dir + '/' + this.clipboard[i].name; else failed++; if (this.clipboard.length == failed) { browser.alert(this.label("The files in the Clipboard are not removable.")) return; } var go = function(callBack) { browser.fadeFiles(); $.ajax({ type: 'POST', dataType: 'json', url: browser.baseGetData('rm_cbd'), data: {files:files}, async: false, success: function(data) { if (callBack) callBack(); browser.check4errors(data); browser.clearClipboard(); browser.refresh(); }, error: function() { if (callBack) callBack(); $('#files > div').css({ opacity: '', filter:'' }); browser.alert(browser.label("Unknown error.")); } }); }; if (failed) browser.confirm( browser.label("{count} files in the Clipboard are not removable. Do you want to delete the rest?", {count: failed}), go ); else go(); }; browser.downloadClipboard = function() { if (!this.clipboard || !this.clipboard.length) return; var files = []; for (i = 0; i < this.clipboard.length; i++) if (this.clipboard[i].readable) files[i] = this.clipboard[i].dir + '/' + this.clipboard[i].name; if (files.length) this.post(this.baseGetData('downloadClipboard'), {files:files}); }; browser.clearClipboard = function() { $('#clipboard').html(''); this.clipboard = []; };
0x6a
trunk/libraries/kcfinder/js/browser/clipboard.js
JavaScript
asf20
10,474
<?php /** This file is part of KCFinder project * * @desc Base JavaScript object properties * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> var browser = { opener: {}, support: {}, files: [], clipboard: [], labels: [], shows: [], orders: [], cms: "" };
0x6a
trunk/libraries/kcfinder/js/browser/0bject.js
JavaScript
asf20
584
<?php /** This file is part of KCFinder project * * @desc Upload files using drag and drop * @package KCFinder * @version 2.51 * @author Forum user (updated by Pavel Tzonkov) * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> browser.initDropUpload = function() { if ((typeof(XMLHttpRequest) == 'undefined') || (typeof(document.addEventListener) == 'undefined') || (typeof(File) == 'undefined') || (typeof(FileReader) == 'undefined') ) return; if (!XMLHttpRequest.prototype.sendAsBinary) { XMLHttpRequest.prototype.sendAsBinary = function(datastr) { var ords = Array.prototype.map.call(datastr, function(x) { return x.charCodeAt(0) & 0xff; }); var ui8a = new Uint8Array(ords); this.send(ui8a.buffer); } } var uploadQueue = [], uploadInProgress = false, filesCount = 0, errors = [], files = $('#files'), folders = $('div.folder > a'), boundary = '------multipartdropuploadboundary' + (new Date).getTime(), currentFile, filesDragOver = function(e) { if (e.preventDefault) e.preventDefault(); $('#files').addClass('drag'); return false; }, filesDragEnter = function(e) { if (e.preventDefault) e.preventDefault(); return false; }, filesDragLeave = function(e) { if (e.preventDefault) e.preventDefault(); $('#files').removeClass('drag'); return false; }, filesDrop = function(e) { if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); $('#files').removeClass('drag'); if (!$('#folders span.current').first().parent().data('writable')) { browser.alert("Cannot write to upload folder."); return false; } filesCount += e.dataTransfer.files.length for (var i = 0; i < e.dataTransfer.files.length; i++) { var file = e.dataTransfer.files[i]; file.thisTargetDir = browser.dir; uploadQueue.push(file); } processUploadQueue(); return false; }, folderDrag = function(e) { if (e.preventDefault) e.preventDefault(); return false; }, folderDrop = function(e, dir) { if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); if (!$(dir).data('writable')) { browser.alert("Cannot write to upload folder."); return false; } filesCount += e.dataTransfer.files.length for (var i = 0; i < e.dataTransfer.files.length; i++) { var file = e.dataTransfer.files[i]; file.thisTargetDir = $(dir).data('path'); uploadQueue.push(file); } processUploadQueue(); return false; }; files.get(0).removeEventListener('dragover', filesDragOver, false); files.get(0).removeEventListener('dragenter', filesDragEnter, false); files.get(0).removeEventListener('dragleave', filesDragLeave, false); files.get(0).removeEventListener('drop', filesDrop, false); files.get(0).addEventListener('dragover', filesDragOver, false); files.get(0).addEventListener('dragenter', filesDragEnter, false); files.get(0).addEventListener('dragleave', filesDragLeave, false); files.get(0).addEventListener('drop', filesDrop, false); folders.each(function() { var folder = this, dragOver = function(e) { $(folder).children('span.folder').addClass('context'); return folderDrag(e); }, dragLeave = function(e) { $(folder).children('span.folder').removeClass('context'); return folderDrag(e); }, drop = function(e) { $(folder).children('span.folder').removeClass('context'); return folderDrop(e, folder); }; this.removeEventListener('dragover', dragOver, false); this.removeEventListener('dragenter', folderDrag, false); this.removeEventListener('dragleave', dragLeave, false); this.removeEventListener('drop', drop, false); this.addEventListener('dragover', dragOver, false); this.addEventListener('dragenter', folderDrag, false); this.addEventListener('dragleave', dragLeave, false); this.addEventListener('drop', drop, false); }); function updateProgress(evt) { var progress = evt.lengthComputable ? Math.round((evt.loaded * 100) / evt.total) + '%' : Math.round(evt.loaded / 1024) + " KB"; $('#loading').html(browser.label("Uploading file {number} of {count}... {progress}", { number: filesCount - uploadQueue.length, count: filesCount, progress: progress })); } function processUploadQueue() { if (uploadInProgress) return false; if (uploadQueue && uploadQueue.length) { var file = uploadQueue.shift(); currentFile = file; $('#loading').html(browser.label("Uploading file {number} of {count}... {progress}", { number: filesCount - uploadQueue.length, count: filesCount, progress: "" })); $('#loading').css('display', 'inline'); var reader = new FileReader(); reader.thisFileName = file.name; reader.thisFileType = file.type; reader.thisFileSize = file.size; reader.thisTargetDir = file.thisTargetDir; reader.onload = function(evt) { uploadInProgress = true; var postbody = '--' + boundary + '\r\nContent-Disposition: form-data; name="upload[]"'; if (evt.target.thisFileName) postbody += '; filename="' + _.utf8encode(evt.target.thisFileName) + '"'; postbody += '\r\n'; if (evt.target.thisFileSize) postbody += 'Content-Length: ' + evt.target.thisFileSize + '\r\n'; postbody += 'Content-Type: ' + evt.target.thisFileType + '\r\n\r\n' + evt.target.result + '\r\n--' + boundary + '\r\nContent-Disposition: form-data; name="dir"\r\n\r\n' + _.utf8encode(evt.target.thisTargetDir) + '\r\n--' + boundary + '\r\n--' + boundary + '--\r\n'; var xhr = new XMLHttpRequest(); xhr.thisFileName = evt.target.thisFileName; if (xhr.upload) { xhr.upload.thisFileName = evt.target.thisFileName; xhr.upload.addEventListener("progress", updateProgress, false); } xhr.open('POST', browser.baseGetData('upload'), true); xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary); xhr.setRequestHeader('Content-Length', postbody.length); xhr.onload = function(e) { $('#loading').css('display', 'none'); if (browser.dir == reader.thisTargetDir) browser.fadeFiles(); uploadInProgress = false; processUploadQueue(); if (xhr.responseText.substr(0, 1) != '/') errors[errors.length] = xhr.responseText; } xhr.sendAsBinary(postbody); }; reader.onerror = function(evt) { $('#loading').css('display', 'none'); uploadInProgress = false; processUploadQueue(); errors[errors.length] = browser.label("Failed to upload {filename}!", { filename: evt.target.thisFileName }); }; reader.readAsBinaryString(file); } else { filesCount = 0; var loop = setInterval(function() { if (uploadInProgress) return; clearInterval(loop); if (currentFile.thisTargetDir == browser.dir) browser.refresh(); boundary = '------multipartdropuploadboundary' + (new Date).getTime(); if (errors.length) { browser.alert(errors.join('\n')); errors = []; } }, 333); } } };
0x6a
trunk/libraries/kcfinder/js/browser/dropUpload.js
JavaScript
asf20
8,625
<?php /** This file is part of KCFinder project * * @desc Settings panel functionality * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> browser.initSettings = function() { if (!this.shows.length) { var showInputs = $('#show input[type="checkbox"]').toArray(); $.each(showInputs, function (i, input) { browser.shows[i] = input.name; }); } var shows = this.shows; if (!_.kuki.isSet('showname')) { _.kuki.set('showname', 'on'); $.each(shows, function (i, val) { if (val != "name") _.kuki.set('show' + val, 'off'); }); } $('#show input[type="checkbox"]').click(function() { var kuki = $(this).get(0).checked ? 'on' : 'off'; _.kuki.set('show' + $(this).get(0).name, kuki) if ($(this).get(0).checked) $('#files .file div.' + $(this).get(0).name).css('display', 'block'); else $('#files .file div.' + $(this).get(0).name).css('display', 'none'); }); $.each(shows, function(i, val) { var checked = (_.kuki.get('show' + val) == 'on') ? 'checked' : ''; $('#show input[name="' + val + '"]').get(0).checked = checked; }); if (!this.orders.length) { var orderInputs = $('#order input[type="radio"]').toArray(); $.each(orderInputs, function (i, input) { browser.orders[i] = input.value; }); } var orders = this.orders; if (!_.kuki.isSet('order')) _.kuki.set('order', 'name'); if (!_.kuki.isSet('orderDesc')) _.kuki.set('orderDesc', 'off'); $('#order input[value="' + _.kuki.get('order') + '"]').get(0).checked = true; $('#order input[name="desc"]').get(0).checked = (_.kuki.get('orderDesc') == 'on'); $('#order input[type="radio"]').click(function() { _.kuki.set('order', $(this).get(0).value); browser.orderFiles(); }); $('#order input[name="desc"]').click(function() { _.kuki.set('orderDesc', $(this).get(0).checked ? 'on' : 'off'); browser.orderFiles(); }); if (!_.kuki.isSet('view')) _.kuki.set('view', 'thumbs'); if (_.kuki.get('view') == 'list') { $('#show input').each(function() { this.checked = true; }); $('#show input').each(function() { this.disabled = true; }); } $('#view input[value="' + _.kuki.get('view') + '"]').get(0).checked = true; $('#view input').click(function() { var view = $(this).attr('value'); if (_.kuki.get('view') != view) { _.kuki.set('view', view); if (view == 'list') { $('#show input').each(function() { this.checked = true; }); $('#show input').each(function() { this.disabled = true; }); } else { $.each(browser.shows, function(i, val) { $('#show input[name="' + val + '"]').get(0).checked = (_.kuki.get('show' + val) == "on"); }); $('#show input').each(function() { this.disabled = false; }); } } browser.refresh(); }); };
0x6a
trunk/libraries/kcfinder/js/browser/settings.js
JavaScript
asf20
3,422
<?php /** This file is part of KCFinder project * * @desc Miscellaneous functionality * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> browser.drag = function(ev, dd) { var top = dd.offsetY, left = dd.offsetX; if (top < 0) top = 0; if (left < 0) left = 0; if (top + $(this).outerHeight() > $(window).height()) top = $(window).height() - $(this).outerHeight(); if (left + $(this).outerWidth() > $(window).width()) left = $(window).width() - $(this).outerWidth(); $(this).css({ top: top, left: left }); }; browser.showDialog = function(e) { $('#dialog').css({left: 0, top: 0}); this.shadow(); if ($('#dialog div.box') && !$('#dialog div.title').get(0)) { var html = $('#dialog div.box').html(); var title = $('#dialog').data('title') ? $('#dialog').data('title') : ""; html = '<div class="title"><span class="close"></span>' + title + '</div>' + html; $('#dialog div.box').html(html); $('#dialog div.title span.close').mousedown(function() { $(this).addClass('clicked'); }); $('#dialog div.title span.close').mouseup(function() { $(this).removeClass('clicked'); }); $('#dialog div.title span.close').click(function() { browser.hideDialog(); browser.hideAlert(); }); } $('#dialog').drag(browser.drag, {handle: '#dialog div.title'}); $('#dialog').css('display', 'block'); if (e) { var left = e.pageX - parseInt($('#dialog').outerWidth() / 2); var top = e.pageY - parseInt($('#dialog').outerHeight() / 2); if (left < 0) left = 0; if (top < 0) top = 0; if (($('#dialog').outerWidth() + left) > $(window).width()) left = $(window).width() - $('#dialog').outerWidth(); if (($('#dialog').outerHeight() + top) > $(window).height()) top = $(window).height() - $('#dialog').outerHeight(); $('#dialog').css({ left: left + 'px', top: top + 'px' }); } else $('#dialog').css({ left: parseInt(($(window).width() - $('#dialog').outerWidth()) / 2) + 'px', top: parseInt(($(window).height() - $('#dialog').outerHeight()) / 2) + 'px' }); $(document).unbind('keydown'); $(document).keydown(function(e) { if (e.keyCode == 27) browser.hideDialog(); }); }; browser.hideDialog = function() { this.unshadow(); if ($('#clipboard').hasClass('selected')) $('#clipboard').removeClass('selected'); $('#dialog').css('display', 'none'); $('div.folder > a > span.folder').removeClass('context'); $('#dialog').html(''); $('#dialog').data('title', null); $('#dialog').unbind(); $('#dialog').click(function() { return false; }); $(document).unbind('keydown'); $(document).keydown(function(e) { return !browser.selectAll(e); }); browser.hideAlert(); }; browser.showAlert = function(shadow) { $('#alert').css({left: 0, top: 0}); if (typeof shadow == 'undefined') shadow = true; if (shadow) this.shadow(); var left = parseInt(($(window).width() - $('#alert').outerWidth()) / 2), top = parseInt(($(window).height() - $('#alert').outerHeight()) / 2); var wheight = $(window).height(); if (top < 0) top = 0; $('#alert').css({ left: left + 'px', top: top + 'px', display: 'block' }); if ($('#alert').outerHeight() > wheight) { $('#alert div.message').css({ height: wheight - $('#alert div.title').outerHeight() - $('#alert div.ok').outerHeight() - 20 + 'px' }); } $(document).unbind('keydown'); $(document).keydown(function(e) { if (e.keyCode == 27) { browser.hideDialog(); browser.hideAlert(); $(document).unbind('keydown'); $(document).keydown(function(e) { return !browser.selectAll(e); }); } }); }; browser.hideAlert = function(shadow) { if (typeof shadow == 'undefined') shadow = true; if (shadow) this.unshadow(); $('#alert').css('display', 'none'); $('#alert').html(''); $('#alert').data('title', null); }; browser.alert = function(msg, shadow) { msg = msg.replace(/\r?\n/g, "<br />"); var title = $('#alert').data('title') ? $('#alert').data('title') : browser.label("Attention"); $('#alert').html('<div class="title"><span class="close"></span>' + title + '</div><div class="message">' + msg + '</div><div class="ok"><button>' + browser.label("OK") + '</button></div>'); $('#alert div.ok button').click(function() { browser.hideAlert(shadow); }); $('#alert div.title span.close').mousedown(function() { $(this).addClass('clicked'); }); $('#alert div.title span.close').mouseup(function() { $(this).removeClass('clicked'); }); $('#alert div.title span.close').click(function() { browser.hideAlert(shadow); }); $('#alert').drag(browser.drag, {handle: "#alert div.title"}); browser.showAlert(shadow); }; browser.confirm = function(question, callBack) { $('#dialog').data('title', browser.label("Question")); $('#dialog').html('<div class="box"><div class="question">' + browser.label(question) + '<div class="buttons"><button>' + browser.label("No") + '</button> <button>' + browser.label("Yes") + '</button></div></div></div>'); browser.showDialog(); $('#dialog div.buttons button').first().click(function() { browser.hideDialog(); }); $('#dialog div.buttons button').last().click(function() { if (callBack) callBack(function() { browser.hideDialog(); }); else browser.hideDialog(); }); $('#dialog div.buttons button').get(1).focus(); }; browser.shadow = function() { $('#shadow').css('display', 'block'); }; browser.unshadow = function() { $('#shadow').css('display', 'none'); }; browser.showMenu = function(e) { var left = e.pageX; var top = e.pageY; if (($('#dialog').outerWidth() + left) > $(window).width()) left = $(window).width() - $('#dialog').outerWidth(); if (($('#dialog').outerHeight() + top) > $(window).height()) top = $(window).height() - $('#dialog').outerHeight(); $('#dialog').css({ left: left + 'px', top: top + 'px', display: 'none' }); $('#dialog').fadeIn(); }; browser.fileNameDialog = function(e, post, inputName, inputValue, url, labels, callBack, selectAll) { var html = '<form method="post" action="javascript:;">' + '<div class="box">' + '<input name="' + inputName + '" type="text" /><br />' + '<div style="text-align:right">' + '<input type="submit" value="' + _.htmlValue(this.label("OK")) + '" /> ' + '<input type="button" value="' + _.htmlValue(this.label("Cancel")) + '" onclick="browser.hideDialog(); browser.hideAlert(); return false" />' + '</div></div></form>'; $('#dialog').html(html); $('#dialog').data('title', this.label(labels.title)); $('#dialog input[name="' + inputName + '"]').attr('value', inputValue); $('#dialog').unbind(); $('#dialog').click(function() { return false; }); $('#dialog form').submit(function() { var name = this.elements[0]; name.value = $.trim(name.value); if (name.value == '') { browser.alert(browser.label(labels.errEmpty), false); name.focus(); return; } else if (/[\/\\]/g.test(name.value)) { browser.alert(browser.label(labels.errSlash), false); name.focus(); return; } else if (name.value.substr(0, 1) == ".") { browser.alert(browser.label(labels.errDot), false); name.focus(); return; } eval('post.' + inputName + ' = name.value;'); $.ajax({ type: 'POST', dataType: 'json', url: url, data: post, async: false, success: function(data) { if (browser.check4errors(data, false)) return; if (callBack) callBack(data); browser.hideDialog(); }, error: function() { browser.alert(browser.label("Unknown error."), false); } }); return false; }); browser.showDialog(e); $('#dialog').css('display', 'block'); $('#dialog input[type="submit"]').click(function() { return $('#dialog form').submit(); }); var field = $('#dialog input[type="text"]'); var value = field.attr('value'); if (!selectAll && /^(.+)\.[^\.]+$/ .test(value)) { value = value.replace(/^(.+)\.[^\.]+$/, "$1"); _.selection(field.get(0), 0, value.length); } else { field.get(0).focus(); field.get(0).select(); } }; browser.orderFiles = function(callBack, selected) { var order = _.kuki.get('order'); var desc = (_.kuki.get('orderDesc') == 'on'); if (!browser.files || !browser.files.sort) browser.files = []; browser.files = browser.files.sort(function(a, b) { var a1, b1, arr; if (!order) order = 'name'; if (order == 'date') { a1 = a.mtime; b1 = b.mtime; } else if (order == 'type') { a1 = _.getFileExtension(a.name); b1 = _.getFileExtension(b.name); } else if (order == 'size') { a1 = a.size; b1 = b.size; } else eval('a1 = a.' + order + '.toLowerCase(); b1 = b.' + order + '.toLowerCase();'); if ((order == 'size') || (order == 'date')) { if (a1 < b1) return desc ? 1 : -1; if (a1 > b1) return desc ? -1 : 1; } if (a1 == b1) { a1 = a.name.toLowerCase(); b1 = b.name.toLowerCase(); arr = [a1, b1]; arr = arr.sort(); return (arr[0] == a1) ? -1 : 1; } arr = [a1, b1]; arr = arr.sort(); if (arr[0] == a1) return desc ? 1 : -1; return desc ? -1 : 1; }); browser.showFiles(callBack, selected); browser.initFiles(); }; browser.humanSize = function(size) { if (size < 1024) { size = size.toString() + ' B'; } else if (size < 1048576) { size /= 1024; size = parseInt(size).toString() + ' KB'; } else if (size < 1073741824) { size /= 1048576; size = parseInt(size).toString() + ' MB'; } else if (size < 1099511627776) { size /= 1073741824; size = parseInt(size).toString() + ' GB'; } else { size /= 1099511627776; size = parseInt(size).toString() + ' TB'; } return size; }; browser.baseGetData = function(act) { var data = 'browse.php?type=' + encodeURIComponent(this.type) + '&lng=' + this.lang; if (act) data += "&act=" + act; if (this.cms) data += "&cms=" + this.cms; return data; }; browser.label = function(index, data) { var label = this.labels[index] ? this.labels[index] : index; if (data) $.each(data, function(key, val) { label = label.replace('{' + key + '}', val); }); return label; }; browser.check4errors = function(data, shadow) { if (!data.error) return false; var msg; if (data.error.join) msg = data.error.join("\n"); else msg = data.error; browser.alert(msg, shadow); return true; }; browser.post = function(url, data) { var html = '<form id="postForm" method="POST" action="' + url + '">'; $.each(data, function(key, val) { if ($.isArray(val)) $.each(val, function(i, aval) { html += '<input type="hidden" name="' + _.htmlValue(key) + '[]" value="' + _.htmlValue(aval) + '" />'; }); else html += '<input type="hidden" name="' + _.htmlValue(key) + '" value="' + _.htmlValue(val) + '" />'; }); html += '</form>'; $('#dialog').html(html); $('#dialog').css('display', 'block'); $('#postForm').get(0).submit(); }; browser.fadeFiles = function() { $('#files > div').css({ opacity: '0.4', filter: 'alpha(opacity:40)' }); };
0x6a
trunk/libraries/kcfinder/js/browser/misc.js
JavaScript
asf20
12,765
<?php /** This file is part of KCFinder project * * @desc Object initializations * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> browser.init = function() { if (!this.checkAgent()) return; $('body').click(function() { browser.hideDialog(); }); $('#shadow').click(function() { return false; }); $('#dialog').unbind(); $('#dialog').click(function() { return false; }); $('#alert').unbind(); $('#alert').click(function() { return false; }); this.initOpeners(); this.initSettings(); this.initContent(); this.initToolbar(); this.initResizer(); this.initDropUpload(); }; browser.checkAgent = function() { if (!$.browser.version || ($.browser.msie && (parseInt($.browser.version) < 7) && !this.support.chromeFrame) || ($.browser.opera && (parseInt($.browser.version) < 10)) || ($.browser.mozilla && (parseFloat($.browser.version.replace(/^(\d+(\.\d+)?)([^\d].*)?$/, "$1")) < 1.8)) ) { var html = '<div style="padding:10px">Your browser is not capable to display KCFinder. Please update your browser or install another one: <a href="http://www.mozilla.com/firefox/" target="_blank">Mozilla Firefox</a>, <a href="http://www.apple.com/safari" target="_blank">Apple Safari</a>, <a href="http://www.google.com/chrome" target="_blank">Google Chrome</a>, <a href="http://www.opera.com/browser" target="_blank">Opera</a>.'; if ($.browser.msie) html += ' You may also install <a href="http://www.google.com/chromeframe" target="_blank">Google Chrome Frame ActiveX plugin</a> to get Internet Explorer 6 working.'; html += '</div>'; $('body').html(html); return false; } return true; }; browser.initOpeners = function() { if (this.opener.TinyMCE && (typeof(tinyMCEPopup) == 'undefined')) this.opener.TinyMCE = null; if (this.opener.TinyMCE) this.opener.callBack = true; if ((!this.opener.name || (this.opener.name == 'fckeditor')) && window.opener && window.opener.SetUrl ) { this.opener.FCKeditor = true; this.opener.callBack = true; } if (this.opener.CKEditor) { if (window.parent && window.parent.CKEDITOR) this.opener.CKEditor.object = window.parent.CKEDITOR; else if (window.opener && window.opener.CKEDITOR) { this.opener.CKEditor.object = window.opener.CKEDITOR; this.opener.callBack = true; } else this.opener.CKEditor = null; } if (!this.opener.CKEditor && !this.opener.FCKEditor && !this.TinyMCE) { if ((window.opener && window.opener.KCFinder && window.opener.KCFinder.callBack) || (window.parent && window.parent.KCFinder && window.parent.KCFinder.callBack) ) this.opener.callBack = window.opener ? window.opener.KCFinder.callBack : window.parent.KCFinder.callBack; if (( window.opener && window.opener.KCFinder && window.opener.KCFinder.callBackMultiple ) || ( window.parent && window.parent.KCFinder && window.parent.KCFinder.callBackMultiple ) ) this.opener.callBackMultiple = window.opener ? window.opener.KCFinder.callBackMultiple : window.parent.KCFinder.callBackMultiple; } }; browser.initContent = function() { $('div#folders').html(this.label("Loading folders...")); $('div#files').html(this.label("Loading files...")); $.ajax({ type: 'GET', dataType: 'json', url: browser.baseGetData('init'), async: false, success: function(data) { if (browser.check4errors(data)) return; browser.dirWritable = data.dirWritable; $('#folders').html(browser.buildTree(data.tree)); browser.setTreeData(data.tree); browser.initFolders(); browser.files = data.files ? data.files : []; browser.orderFiles(); }, error: function() { $('div#folders').html(browser.label("Unknown error.")); $('div#files').html(browser.label("Unknown error.")); } }); }; browser.initResizer = function() { var cursor = ($.browser.opera) ? 'move' : 'col-resize'; $('#resizer').css('cursor', cursor); $('#resizer').drag('start', function() { $(this).css({opacity:'0.4', filter:'alpha(opacity:40)'}); $('#all').css('cursor', cursor); }); $('#resizer').drag(function(e) { var left = e.pageX - parseInt(_.nopx($(this).css('width')) / 2); left = (left >= 0) ? left : 0; left = (left + _.nopx($(this).css('width')) < $(window).width()) ? left : $(window).width() - _.nopx($(this).css('width')); $(this).css('left', left); }); var end = function() { $(this).css({opacity:'0', filter:'alpha(opacity:0)'}); $('#all').css('cursor', ''); var left = _.nopx($(this).css('left')) + _.nopx($(this).css('width')); var right = $(window).width() - left; $('#left').css('width', left + 'px'); $('#right').css('width', right + 'px'); _('files').style.width = $('#right').innerWidth() - _.outerHSpace('#files') + 'px'; _('resizer').style.left = $('#left').outerWidth() - _.outerRightSpace('#folders', 'm') + 'px'; _('resizer').style.width = _.outerRightSpace('#folders', 'm') + _.outerLeftSpace('#files', 'm') + 'px'; browser.fixFilesHeight(); }; $('#resizer').drag('end', end); $('#resizer').mouseup(end); }; browser.resize = function() { _('left').style.width = '25%'; _('right').style.width = '75%'; _('toolbar').style.height = $('#toolbar a').outerHeight() + "px"; _('shadow').style.width = $(window).width() + 'px'; _('shadow').style.height = _('resizer').style.height = $(window).height() + 'px'; _('left').style.height = _('right').style.height = $(window).height() - $('#status').outerHeight() + 'px'; _('folders').style.height = $('#left').outerHeight() - _.outerVSpace('#folders') + 'px'; browser.fixFilesHeight(); var width = $('#left').outerWidth() + $('#right').outerWidth(); _('status').style.width = width + 'px'; while ($('#status').outerWidth() > width) _('status').style.width = _.nopx(_('status').style.width) - 1 + 'px'; while ($('#status').outerWidth() < width) _('status').style.width = _.nopx(_('status').style.width) + 1 + 'px'; if ($.browser.msie && ($.browser.version.substr(0, 1) < 8)) _('right').style.width = $(window).width() - $('#left').outerWidth() + 'px'; _('files').style.width = $('#right').innerWidth() - _.outerHSpace('#files') + 'px'; _('resizer').style.left = $('#left').outerWidth() - _.outerRightSpace('#folders', 'm') + 'px'; _('resizer').style.width = _.outerRightSpace('#folders', 'm') + _.outerLeftSpace('#files', 'm') + 'px'; }; browser.fixFilesHeight = function() { _('files').style.height = $('#left').outerHeight() - $('#toolbar').outerHeight() - _.outerVSpace('#files') - (($('#settings').css('display') != "none") ? $('#settings').outerHeight() : 0) + 'px'; };
0x6a
trunk/libraries/kcfinder/js/browser/init.js
JavaScript
asf20
7,651
/** This file is part of KCFinder project * * @desc Helper object * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ var _ = function(id) { return document.getElementById(id); }; _.nopx = function(val) { return parseInt(val.replace(/^(\d+)px$/, "$1")); }; _.unselect = function() { if (document.selection && document.selection.empty) document.selection.empty() ; else if (window.getSelection) { var sel = window.getSelection(); if (sel && sel.removeAllRanges) sel.removeAllRanges(); } }; _.selection = function(field, start, end) { if (field.createTextRange) { var selRange = field.createTextRange(); selRange.collapse(true); selRange.moveStart('character', start); selRange.moveEnd('character', end-start); selRange.select(); } else if (field.setSelectionRange) { field.setSelectionRange(start, end); } else if (field.selectionStart) { field.selectionStart = start; field.selectionEnd = end; } field.focus(); }; _.htmlValue = function(value) { return value .replace(/\&/g, "&amp;") .replace(/\"/g, "&quot;") .replace(/\'/g, "&#39;"); }; _.htmlData = function(value) { return value .replace(/\&/g, "&amp;") .replace(/\</g, "&lt;") .replace(/\>/g, "&gt;") .replace(/\ /g, "&nbsp;"); } _.jsValue = function(value) { return value .replace(/\\/g, "\\\\") .replace(/\r?\n/, "\\\n") .replace(/\"/g, "\\\"") .replace(/\'/g, "\\'"); }; _.basename = function(path) { var expr = /^.*\/([^\/]+)\/?$/g; return expr.test(path) ? path.replace(expr, "$1") : path; }; _.dirname = function(path) { var expr = /^(.*)\/[^\/]+\/?$/g; return expr.test(path) ? path.replace(expr, "$1") : ''; }; _.inArray = function(needle, arr) { if ((typeof arr == 'undefined') || !arr.length || !arr.push) return false; for (var i = 0; i < arr.length; i++) if (arr[i] == needle) return true; return false; }; _.getFileExtension = function(filename, toLower) { if (typeof(toLower) == 'undefined') toLower = true; if (/^.*\.[^\.]*$/.test(filename)) { var ext = filename.replace(/^.*\.([^\.]*)$/, "$1"); return toLower ? ext.toLowerCase(ext) : ext; } else return ""; }; _.escapeDirs = function(path) { var fullDirExpr = /^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)$/, prefix = ""; if (fullDirExpr.test(path)) { var port = path.replace(fullDirExpr, "$4"); prefix = path.replace(fullDirExpr, "$1://$2") if (port.length) prefix += ":" + port; prefix += "/"; path = path.replace(fullDirExpr, "$5"); } var dirs = path.split('/'); var escapePath = ''; for (var i = 0; i < dirs.length; i++) escapePath += encodeURIComponent(dirs[i]) + '/'; return prefix + escapePath.substr(0, escapePath.length - 1); }; _.outerSpace = function(selector, type, mbp) { if (!mbp) mbp = "mbp"; var r = 0; if (/m/i.test(mbp)) { var m = _.nopx($(selector).css('margin-' + type)); if (m) r += m; } if (/b/i.test(mbp)) { var b = _.nopx($(selector).css('border-' + type + '-width')); if (b) r += b; } if (/p/i.test(mbp)) { var p = _.nopx($(selector).css('padding-' + type)); if (p) r += p; } return r; }; _.outerLeftSpace = function(selector, mbp) { return _.outerSpace(selector, 'left', mbp); }; _.outerTopSpace = function(selector, mbp) { return _.outerSpace(selector, 'top', mbp); }; _.outerRightSpace = function(selector, mbp) { return _.outerSpace(selector, 'right', mbp); }; _.outerBottomSpace = function(selector, mbp) { return _.outerSpace(selector, 'bottom', mbp); }; _.outerHSpace = function(selector, mbp) { return (_.outerLeftSpace(selector, mbp) + _.outerRightSpace(selector, mbp)); }; _.outerVSpace = function(selector, mbp) { return (_.outerTopSpace(selector, mbp) + _.outerBottomSpace(selector, mbp)); }; _.kuki = { prefix: '', duration: 356, domain: '', path: '', secure: false, set: function(name, value, duration, domain, path, secure) { name = this.prefix + name; if (duration == null) duration = this.duration; if (secure == null) secure = this.secure; if ((domain == null) && this.domain) domain = this.domain; if ((path == null) && this.path) path = this.path; secure = secure ? true : false; var date = new Date(); date.setTime(date.getTime() + (duration * 86400000)); var expires = date.toGMTString(); var str = name + '=' + value + '; expires=' + expires; if (domain != null) str += '; domain=' + domain; if (path != null) str += '; path=' + path; if (secure) str += '; secure'; return (document.cookie = str) ? true : false; }, get: function(name) { name = this.prefix + name; var nameEQ = name + '='; var kukis = document.cookie.split(';'); var kuki; for (var i = 0; i < kukis.length; i++) { kuki = kukis[i]; while (kuki.charAt(0) == ' ') kuki = kuki.substring(1, kuki.length); if (kuki.indexOf(nameEQ) == 0) return kuki.substring(nameEQ.length, kuki.length); } return null; }, del: function(name) { return this.set(name, '', -1); }, isSet: function(name) { return (this.get(name) != null); } }; _.md5 = function(string) { var RotateLeft = function(lValue, iShiftBits) { return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits)); }; var AddUnsigned = function(lX,lY) { var lX4, lY4, lX8, lY8, lResult; lX8 = (lX & 0x80000000); lY8 = (lY & 0x80000000); lX4 = (lX & 0x40000000); lY4 = (lY & 0x40000000); lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); if (lX4 & lY4) return (lResult ^ 0x80000000 ^ lX8 ^ lY8); if (lX4 | lY4) return (lResult & 0x40000000) ? (lResult ^ 0xC0000000 ^ lX8 ^ lY8) : (lResult ^ 0x40000000 ^ lX8 ^ lY8); else return (lResult ^ lX8 ^ lY8); }; var F = function(x, y, z) { return (x & y) | ((~x) & z); }; var G = function(x, y, z) { return (x & z) | (y & (~z)); }; var H = function(x, y, z) { return (x ^ y ^ z); }; var I = function(x, y, z) { return (y ^ (x | (~z))); }; var FF = function(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b); }; var GG = function(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b); }; var HH = function(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b); }; var II = function(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b); }; var ConvertToWordArray = function(string) { var lWordCount; var lMessageLength = string.length; var lNumberOfWords_temp1 = lMessageLength + 8; var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64; var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16; var lWordArray = [lNumberOfWords - 1]; var lBytePosition = 0; var lByteCount = 0; while (lByteCount < lMessageLength) { lWordCount = (lByteCount - (lByteCount % 4)) / 4; lBytePosition = (lByteCount % 4) * 8; lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition)); lByteCount++; } lWordCount = (lByteCount - (lByteCount % 4)) / 4; lBytePosition = (lByteCount % 4) * 8; lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition); lWordArray[lNumberOfWords - 2] = lMessageLength << 3; lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; return lWordArray; }; var WordToHex = function(lValue) { var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount; for (lCount = 0; lCount <= 3; lCount++) { lByte = (lValue >>> (lCount * 8)) & 255; WordToHexValue_temp = "0" + lByte.toString(16); WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2,2); } return WordToHexValue; }; var x = []; var k, AA, BB, CC, DD, a, b, c, d; var S11 = 7, S12 = 12, S13 = 17, S14 = 22; var S21 = 5, S22 = 9, S23 = 14, S24 = 20; var S31 = 4, S32 = 11, S33 = 16, S34 = 23; var S41 = 6, S42 = 10, S43 = 15, S44 = 21; string = _.utf8encode(string); x = ConvertToWordArray(string); a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476; for (k = 0; k < x.length; k += 16) { AA = a; BB = b; CC = c; DD = d; a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478); d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756); c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB); b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE); a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF); d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A); c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613); b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501); a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8); d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF); c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1); b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE); a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122); d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193); c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E); b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821); a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562); d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340); c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51); b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA); a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D); d = GG(d, a, b, c, x[k + 10], S22, 0x2441453); c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681); b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8); a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6); d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6); c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87); b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED); a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905); d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8); c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9); b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A); a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942); d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681); c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122); b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C); a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44); d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9); c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60); b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70); a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6); d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA); c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085); b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05); a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039); d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5); c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8); b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665); a = II(a, b, c, d, x[k + 0], S41, 0xF4292244); d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97); c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7); b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039); a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3); d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92); c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D); b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1); a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F); d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0); c = II(c, d, a, b, x[k + 6], S43, 0xA3014314); b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1); a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82); d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235); c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB); b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391); a = AddUnsigned(a, AA); b = AddUnsigned(b, BB); c = AddUnsigned(c, CC); d = AddUnsigned(d, DD); } var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d); return temp.toLowerCase(); }; _.utf8encode = function(string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; };
0x6a
trunk/libraries/kcfinder/js/helper.js
JavaScript
asf20
14,113
/*! * jQuery Right-Click Plugin * * Version 1.01 * * Cory S.N. LaViska * A Beautiful Site (http://abeautifulsite.net/) * 20 December 2008 * * Visit http://abeautifulsite.net/notebook/68 for more information * * License: * This plugin is dual-licensed under the GNU General Public License and the MIT License * and is copyright 2008 A Beautiful Site, LLC. */ if(jQuery){(function(){$.extend($.fn,{rightClick:function(a){$(this).each(function(){$(this).mousedown(function(c){var b=c;if($.browser.safari&&navigator.userAgent.indexOf("Mac")!=-1&&parseInt($.browser.version,10)<=525){if(b.button==2){a.call($(this),b);return false}else{return true}}else{$(this).mouseup(function(){$(this).unbind("mouseup");if(b.button==2){a.call($(this),b);return false}else{return true}})}});$(this)[0].oncontextmenu=function(){return false}});return $(this)},rightMouseDown:function(a){$(this).each(function(){$(this).mousedown(function(b){if(b.button==2){a.call($(this),b);return false}else{return true}});$(this)[0].oncontextmenu=function(){return false}});return $(this)},rightMouseUp:function(a){$(this).each(function(){$(this).mouseup(function(b){if(b.button==2){a.call($(this),b);return false}else{return true}});$(this)[0].oncontextmenu=function(){return false}});return $(this)},noContext:function(){$(this).each(function(){$(this)[0].oncontextmenu=function(){return false}});return $(this)}})})(jQuery)};
0x6a
trunk/libraries/kcfinder/js/jquery.rightClick.js
JavaScript
asf20
1,408
<?php /** This file is part of KCFinder project * * @desc Base CSS definitions * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ error_reporting(0); require "core/autoload.php"; $mtime = @filemtime(__FILE__); if ($mtime) httpCache::checkMTime($mtime); $browser = new browser(); $config = $browser->config; ob_start(); ?> html, body { overflow: hidden; } body, form, th, td { margin: 0; padding: 0; } a { cursor:pointer; } * { font-family: Tahoma, Verdana, Arial, sans-serif; font-size: 11px; } table { border-collapse: collapse; } #all { vvisibility: hidden; } #left { float: left; display: block; width: 25%; } #right { float: left; display: block; width: 75%; } #settings { display: none; padding: 0; float: left; width: 100%; } #settings > div { float: left; } #folders { padding: 5px; overflow: auto; } #toolbar { padding: 5px; } #files { padding: 5px; overflow: auto; } #status { padding: 5px; float: left; overflow: hidden; } #fileinfo { float: left; } #clipboard div { width: 16px; height: 16px; } .folders { margin-left: 16px; } div.file { overflow-x: hidden; width: <?php echo $config['thumbWidth'] ?>px; float: left; text-align: center; cursor: default; white-space: nowrap; } div.file .thumb { width: <?php echo $config['thumbWidth'] ?>px; height: <?php echo $config['thumbHeight'] ?>px; background: no-repeat center center; } #files table { width: 100%; } tr.file { cursor: default; } tr.file > td { white-space: nowrap; } tr.file > td.name { background-repeat: no-repeat; background-position: left center; padding-left: 20px; width: 100%; } tr.file > td.time, tr.file > td.size { text-align: right; } #toolbar { cursor: default; white-space: nowrap; } #toolbar a { padding-left: 20px; text-decoration: none; background: no-repeat left center; } #toolbar a:hover, a[href="#upload"].uploadHover { color: #000; } #upload { position: absolute; overflow: hidden; opacity: 0; filter: alpha(opacity:0); } #upload input { cursor: pointer; } #uploadResponse { display: none; } span.brace { padding-left: 11px; cursor: default; } span.brace.opened, span.brace.closed { cursor: pointer; } #shadow { position: absolute; top: 0; left: 0; display: none; background: #000; z-index: 100; opacity: 0.7; filter: alpha(opacity:50); } #dialog, #clipboard, #alert { position: absolute; display: none; z-index: 101; cursor: default; } #dialog .box, #alert { max-width: 350px; } #alert { z-index: 102; } #alert div.message { overflow-y: auto; overflow-x: hidden; } #clipboard { z-index: 99; } #loading { display: none; float: right; } .menu { background: #888; white-space: nowrap; } .menu a { display: block; } .menu .list { max-height: 0; overflow-y: auto; overflow-x: hidden; white-space: nowrap; } .file .access, .file .hasThumb { display: none; } #dialog img { cursor: pointer; } #resizer { position: absolute; z-index: 98; top: 0; background: #000; opacity: 0; filter: alpha(opacity:0); } <?php header("Content-Type: text/css"); echo text::compressCSS(ob_get_clean());
0x6a
trunk/libraries/kcfinder/css.php
PHP
asf20
3,691
<script src="js/jquery.js" type="text/javascript"></script> <script src="js/jquery.rightClick.js" type="text/javascript"></script> <script src="js/jquery.drag.js" type="text/javascript"></script> <script src="js/helper.js" type="text/javascript"></script> <script src="js/browser/joiner.php" type="text/javascript"></script> <script src="js_localize.php?lng=<?php echo $this->lang ?>" type="text/javascript"></script> <?php IF (isset($this->opener['TinyMCE']) && $this->opener['TinyMCE']): ?> <script src="<?php echo $this->config['_tinyMCEPath'] ?>/tiny_mce_popup.js" type="text/javascript"></script> <?php ENDIF ?> <?php IF (file_exists("themes/{$this->config['theme']}/init.js")): ?> <script src="themes/<?php echo $this->config['theme'] ?>/init.js" type="text/javascript"></script> <?php ENDIF ?> <script type="text/javascript"> browser.version = "<?php echo self::VERSION ?>"; browser.support.chromeFrame = <?php echo (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), " chromeframe") !== false) ? "true" : "false" ?>; browser.support.zip = <?php echo (class_exists('ZipArchive') && !$this->config['denyZipDownload']) ? "true" : "false" ?>; browser.support.check4Update = <?php echo ((!isset($this->config['denyUpdateCheck']) || !$this->config['denyUpdateCheck']) && (ini_get("allow_url_fopen") || function_exists("http_get") || function_exists("curl_init") || function_exists('socket_create'))) ? "true" : "false" ?>; browser.lang = "<?php echo text::jsValue($this->lang) ?>"; browser.type = "<?php echo text::jsValue($this->type) ?>"; browser.theme = "<?php echo text::jsValue($this->config['theme']) ?>"; browser.access = <?php echo json_encode($this->config['access']) ?>; browser.dir = "<?php echo text::jsValue($this->session['dir']) ?>"; browser.uploadURL = "<?php echo text::jsValue($this->config['uploadURL']) ?>"; browser.thumbsURL = browser.uploadURL + "/<?php echo text::jsValue($this->config['thumbsDir']) ?>"; <?php IF (isset($this->get['opener']) && strlen($this->get['opener'])): ?> browser.opener.name = "<?php echo text::jsValue($this->get['opener']) ?>"; <?php ENDIF ?> <?php IF (isset($this->opener['CKEditor']['funcNum']) && preg_match('/^\d+$/', $this->opener['CKEditor']['funcNum'])): ?> browser.opener.CKEditor = {}; browser.opener.CKEditor.funcNum = <?php echo $this->opener['CKEditor']['funcNum'] ?>; <?php ENDIF ?> <?php IF (isset($this->opener['TinyMCE']) && $this->opener['TinyMCE']): ?> browser.opener.TinyMCE = true; <?php ENDIF ?> browser.cms = "<?php echo text::jsValue($this->cms) ?>"; _.kuki.domain = "<?php echo text::jsValue($this->config['cookieDomain']) ?>"; _.kuki.path = "<?php echo text::jsValue($this->config['cookiePath']) ?>"; _.kuki.prefix = "<?php echo text::jsValue($this->config['cookiePrefix']) ?>"; $(document).ready(function() { browser.resize(); browser.init(); $('#all').css('visibility', 'visible'); }); $(window).resize(browser.resize); </script>
0x6a
trunk/libraries/kcfinder/tpl/tpl_javascript.php
PHP
asf20
2,918
<link href="css.php?type=<?php echo $this->type ?>" rel="stylesheet" type="text/css" /> <link href="themes/<?php echo $this->config['theme'] ?>/style.css" rel="stylesheet" type="text/css" />
0x6a
trunk/libraries/kcfinder/tpl/tpl_css.php
PHP
asf20
191
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>KCFinder: /<?php echo $this->session['dir'] ?></title> <?php INCLUDE "tpl/tpl_css.php" ?> <?php INCLUDE "tpl/tpl_javascript.php" ?> </head> <body> <script type="text/javascript"> $('body').noContext(); </script> <div id="resizer"></div> <div id="shadow"></div> <div id="dialog"></div> <div id="alert"></div> <div id="clipboard"></div> <div id="all"> <div id="left"> <div id="folders"></div> </div> <div id="right"> <div id="toolbar"> <div> <a href="kcact:upload"><?php echo $this->label("Upload") ?></a> <a href="kcact:refresh"><?php echo $this->label("Refresh") ?></a> <a href="kcact:settings"><?php echo $this->label("Settings") ?></a> <a href="kcact:maximize"><?php echo $this->label("Maximize") ?></a> <a href="kcact:about"><?php echo $this->label("About") ?></a> <div id="loading"></div> </div> </div> <div id="settings"> <div> <fieldset> <legend><?php echo $this->label("View:") ?></legend> <table summary="view" id="view"><tr> <th><input id="viewThumbs" type="radio" name="view" value="thumbs" /></th> <td><label for="viewThumbs">&nbsp;<?php echo $this->label("Thumbnails") ?></label> &nbsp;</td> <th><input id="viewList" type="radio" name="view" value="list" /></th> <td><label for="viewList">&nbsp;<?php echo $this->label("List") ?></label></td> </tr></table> </fieldset> </div> <div> <fieldset> <legend><?php echo $this->label("Show:") ?></legend> <table summary="show" id="show"><tr> <th><input id="showName" type="checkbox" name="name" /></th> <td><label for="showName">&nbsp;<?php echo $this->label("Name") ?></label> &nbsp;</td> <th><input id="showSize" type="checkbox" name="size" /></th> <td><label for="showSize">&nbsp;<?php echo $this->label("Size") ?></label> &nbsp;</td> <th><input id="showTime" type="checkbox" name="time" /></th> <td><label for="showTime">&nbsp;<?php echo $this->label("Date") ?></label></td> </tr></table> </fieldset> </div> <div> <fieldset> <legend><?php echo $this->label("Order by:") ?></legend> <table summary="order" id="order"><tr> <th><input id="sortName" type="radio" name="sort" value="name" /></th> <td><label for="sortName">&nbsp;<?php echo $this->label("Name") ?></label> &nbsp;</td> <th><input id="sortType" type="radio" name="sort" value="type" /></th> <td><label for="sortType">&nbsp;<?php echo $this->label("Type") ?></label> &nbsp;</td> <th><input id="sortSize" type="radio" name="sort" value="size" /></th> <td><label for="sortSize">&nbsp;<?php echo $this->label("Size") ?></label> &nbsp;</td> <th><input id="sortTime" type="radio" name="sort" value="date" /></th> <td><label for="sortTime">&nbsp;<?php echo $this->label("Date") ?></label> &nbsp;</td> <th><input id="sortOrder" type="checkbox" name="desc" /></th> <td><label for="sortOrder">&nbsp;<?php echo $this->label("Descending") ?></label></td> </tr></table> </fieldset> </div> </div> <div id="files"> <div id="content"></div> </div> </div> <div id="status"><span id="fileinfo">&nbsp;</span></div> </div> </body> </html>
0x6a
trunk/libraries/kcfinder/tpl/tpl_browser.php
PHP
asf20
3,475
<?php /** This file is part of KCFinder project * * @desc Japanese localization * @package KCFinder * @version 2.2 * @author yama yamamoto@kyms.ne.jp * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 */ $lang = array( '_locale' => "ja_JP.UTF-8", '_charset' => "utf-8", // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%Y/%m/%d %H:%M", '_dateTimeMid' => "%Y/%m/%d %H:%M", '_dateTimeSmall' => "%Y/%m/%d %H:%M", "You don't have permissions to upload files." => "アップロード権限がありません。", "You don't have permissions to browse server." => "サーバーを閲覧する権限がありません", "Cannot move uploaded file to target folder." => "ファイルを移動できません。", "Unknown error." => "原因不明のエラーです。", "The uploaded file exceeds {size} bytes." => "アップロードしたファイルは {size} バイトを越えました。", "The uploaded file was only partially uploaded." => "アップロードしたファイルは、一部のみ処理されました。", "No file was uploaded." => "ファイルはありません。", "Missing a temporary folder." => "一時フォルダが見付かりません。", "Failed to write file." => "ファイルの書き込みに失敗しました。", "Denied file extension." => "このファイルは扱えません。", "Unknown image format/encoding." => "この画像ファイルの種別を判定できません。", "The image is too big and/or cannot be resized." => "画像ファイルのサイズが大き過ぎます。", "Cannot create {dir} folder." => "「{dir}」フォルダを作成できません。", "Cannot write to upload folder." => "アップロードフォルダに書き込みできません。", "Cannot read .htaccess" => ".htaccessが読み込めません。", "Incorrect .htaccess file. Cannot rewrite it!" => "不正な .htaccess ファイルです。再編集できません!", "Cannot fetch content of {dir} folder." => "{dir} フォルダのコンテンツを読み込めません。", "Cannot read upload folder." => "アップロードフォルダを読み取れません。", "Cannot access or create thumbnails folder." => "サムネイルフォルダにアクセス、又はサムネイルフォルダを作成できません。", "Cannot access or write to upload folder." => "アップロードフォルダにアクセス、又は書き込みできません。", "Please enter new folder name." => "新しいフォルダ名を入力して下さい。", "Unallowed characters in folder name." => "フォルダ名には利用できない文字です。", "Folder name shouldn't begins with '.'" => "フォルダ名は、'.'で開始しないで下さい。", "Please enter new file name." => "新しいファイル名を入力して下さい。", "Unallowed characters in file name." => "ファイル名には利用できない文字です。", "File name shouldn't begins with '.'" => "ファイル名は、'.'で開始しないで下さい。", "Are you sure you want to delete this file?" => "このファイルを本当に削除してもよろしいですか?", "Are you sure you want to delete this folder and all its content?" => "このフォルダとフォルダ内の全てのコンテンツを本当に削除してもよろしいですか?", "Unexisting directory type." => "存在しないディレクトリの種類です。", "Undefined MIME types." => "定義されていないMIMEタイプです。", "Fileinfo PECL extension is missing." => "Fileinfo PECL 拡張モジュールが見付かりません。", "Opening fileinfo database failed." => "fileinfo データベースを開くのに失敗しました。", "You can't upload such files." => "このようなファイルをアップロードできません。", "The file '{file}' does not exist." => "ファイル「'{file}'」は存在しません。", "Cannot read '{file}'." => "「'{file}'」を読み取れません。", "Cannot copy '{file}'." => "「{file}」をコピーできません。", "Cannot move '{file}'." => "「{file}」を移動できません。", "Cannot delete '{file}'." => "「'{file}'」を削除できません。", "Click to remove from the Clipboard" => "クリップボードから削除する", "This file is already added to the Clipboard." => "このファイルは既にクリップボードに追加されています。", "Copy files here" => "ここにコピー", "Move files here" => "ここに移動", "Delete files" => "これらを全て削除", "Clear the Clipboard" => // "クリップボードを初期化", "Are you sure you want to delete all files in the Clipboard?" => "クリップボードに記憶した全てのファイルを実際に削除します。", "Copy {count} files" => "ファイル({count}個)をここに複写", "Move {count} files" => "ファイル({count}個)をここに移動", "Add to Clipboard" => "クリップボードに記憶", "New folder name:" => "フォルダ名(半角英数):", "New file name:" => "ファイル名(半角英数):", "Folders" => "フォルダ", "Upload" => "アップロード", "Refresh" => "再表示", "Settings" => "表示設定", "Maximize" => "最大化", "About" => "About", "files" => "ファイル", "View:" => "表示スタイル:", "Show:" => "表示項目:", "Order by:" => "表示順:", "Thumbnails" => "サムネイル", "List" => "リスト", "Name" => "ファイル名", "Size" => "サイズ", "Date" => "日付", "Descending" => "順序を反転", "Uploading file..." => "ファイルをアップロード中...", "Loading image..." => "画像を読み込み中...", "Loading folders..." => "フォルダを読み込み中...", "Loading files..." => "読み込み中...", "New Subfolder..." => "フォルダを作る", "Rename..." => "名前の変更", "Delete" => "削除", "OK" => "OK", "Cancel" => "キャンセル", "Select" => "このファイルを選択", "Select Thumbnail" => "サムネイルを選択", "View" => "プレビュー", "Download" => "ダウンロード", 'Clipboard' => "クリップボード", // VERSION 2 NEW LABELS "Cannot rename the folder." => "ディレクトリを名前を変更できません", "Non-existing directory type." => "存在しないディレクトリの種類です。", "Cannot delete the folder." => "ディレクトリを削除できません", "The files in the Clipboard are not readable." => "クリップボードからファイルを読み取れません", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "クリップボード内の {count} 個のファイルが読み取れません。残りをコピーしてもよろしいですか?", "The files in the Clipboard are not movable." => "クリップボードからファイルを移動できません", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "クリップボード内の {count} 個のファイルが移動できません。残りを移動してもよろしいですか?", "The files in the Clipboard are not removable." => "クリップボードを初期化できません", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "クリップボード内の {count} 個のファイルが削除出来ません。残りを削除してもよろしいですか?", "The selected files are not removable." => "選択したファイルは削除できません。", "{count} selected files are not removable. Do you want to delete the rest?" => "選択された {count} 個のファイルは削除できません。残りを削除してもよろしいですか?", "Are you sure you want to delete all selected files?" => "選択された全てのファイルを本当に削除してもよろしいですか?", "Failed to delete {count} files/folders." => "{count} 個のファイル / フォルダの削除に失敗しました。", "A file or folder with that name already exists." => "その名前のファイル、又はフォルダは既に存在します。", "Inexistant or inaccessible folder." => "存在しない、又はアクセスできないフォルダです。", "selected files" => "選択したファイル", "Type" => "タイプ", "Select Thumbnails" => "サムネイルを選択", "Download files" => "ファイルをダウンロードする", ); ?>
0x6a
trunk/libraries/kcfinder/lang/ja.php
PHP
asf20
9,193
<?php /** Spanish localization file for KCFinder * Type some credits if you want */ $lang = array( '_locale' => "es_ES.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "No tiene permiso para subir archivos.", "You don't have permissions to browse server." => "No tiene permiso para visualizar archivos.", "Cannot move uploaded file to target folder." => "No puede mover archivos al directorio de destino.", "Unknown error." => "Error desconocido.", "The uploaded file exceeds {size} bytes." => "El archivo excede el tamaño permitido ({size} bytes).", "The uploaded file was only partially uploaded." => "El archivo solo fué parcialmente cargado.", "No file was uploaded." => "El archivo no fué cargado.", "Missing a temporary folder." => "No se puede encontrar el directorio temporal.", "Failed to write file." => "No se pudo crear el archivo.", "Denied file extension." => "Extensión de archivo denegada.", "Unknown image format/encoding." => "Formato / codificación de imagen desconocido.", "The image is too big and/or cannot be resized." => "La imagen es muy grande o no se puede redimensionar.", "Cannot create {dir} folder." => "No se puede crear la carpeta {dir}.", "Cannot rename the folder." => "No se puede renombrar la carpeta.", "Cannot write to upload folder." => "No se puede escribir en directorio de carga de archivos.", "Cannot read .htaccess" => "No se puede leer el archivo .htaccess.", "Incorrect .htaccess file. Cannot rewrite it!" => "Archivo .htaccess incorrecto. ¡No puede sobreescribirlo!", "Cannot read upload folder." => "No se puede leer la carpeta de carga de archivos.", "Cannot access or create thumbnails folder." => "No se puede leer o crear carpeta de miniaturas.", "Cannot access or write to upload folder." => "No se puede leer o escribir en la carpeta de carga de archivos.", "Please enter new folder name." => "Por favor introduzca el nombre de la nueva carpeta.", "Unallowable characters in folder name." => "Caracteres inválidos en el nombre de carpeta.", "Folder name shouldn't begins with '.'" => "El nombre de carpeta no puede comenzar con punto '.'", "Please enter new file name." => "Por favor introduzca el nuevo nombre del archivo.", "Unallowable characters in file name." => "Carácteres inválidos en el nombre de archivo.", "File name shouldn't begins with '.'" => "El nombre de archivo no puede comenzar con punto '.'", "Are you sure you want to delete this file?" => "Esta seguro de que desea borrar este archivo?", "Are you sure you want to delete this folder and all its content?" => "Esta seguro de que desea borrar esta carpeta y todo su contenido?", "Non-existing directory type." => "El tipo de directorio no existe.", "Undefined MIME types." => "Tipo MIME no definido.", "Fileinfo PECL extension is missing." => "Archivo PECL con estructura errónea.", "Opening fileinfo database failed." => "Error abriendo el archivo de información de la base de datos.", "You can't upload such files." => "No puede cargar tantos archivos.", "The file '{file}' does not exist." => "El archivo '{file}' no existe.", "Cannot read '{file}'." => "No se puede leer '{file}'.", "Cannot copy '{file}'." => "No se puede copiar '{file}'.", "Cannot move '{file}'." => "No se puede mover '{file}'.", "Cannot delete '{file}'." => "No se puede borrar '{file}'.", "Cannot delete the folder." => "No se puede borrrar la carpeta.", "Click to remove from the Clipboard" => "Haga Click para borrar del portapapeles", "This file is already added to the Clipboard." => "Este archivo ya fué agregado al portapapeles.", "The files in the Clipboard are not readable." => "Los archivos en el portapaleles no son legibles.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} archivos en el portapapeles no son legibles. Desea copiar el resto?", "The files in the Clipboard are not movable." => "Los archivos en el portapapeles no se pueden mover.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} archivos en el portapapeles no se pueden mover. Desea mover el resto?", "The files in the Clipboard are not removable." => "Los archivos en el portapapeles no se pueden remover.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} archivos en el portapapeles no se pueden remover. Desea borrar el resto?", "The selected files are not removable." => "Los archivos seleccionados no son removibles.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} archivos seleccionados no son removibles. Desea borrar el resto?", "Are you sure you want to delete all selected files?" => "Esta seguro de que desea borrar todos los archivos seleccionados?", "Failed to delete {count} files/folders." => "Falló al borrar {count} archivos/carpetas.", "A file or folder with that name already exists." => "Existe una carpeta o archivo con el mismo nombre.", "Copy files here" => "Copiar archivos aquí", "Move files here" => "Mover archivos aquí", "Delete files" => "Borrar archivos", "Clear the Clipboard" => "Limpiar el portapapeles", "Are you sure you want to delete all files in the Clipboard?" => "Esta seguro de que desea borrar todos los archivos del portapapeles?", "Copy {count} files" => "Copiar {count} archivos", "Move {count} files" => "Mover {count} archivos ", "Add to Clipboard" => "Agregar al portapapeles", "Inexistant or inaccessible folder." => "Carpeta inexistente o inaccesible.", "New folder name:" => "Nuevo nombre de carpeta:", "New file name:" => "Nuevo nombre de archivo:", "Upload" => "Cargar", "Refresh" => "Refrescar", "Settings" => "Preferencias", "Maximize" => "Maximizar", "About" => "Acerca de", "files" => "Archivos", "selected files" => "Archivos seleccionados", "View:" => "Ver:", "Show:" => "Mostrar:", "Order by:" => "Ordenar por:", "Thumbnails" => "Miniaturas", "List" => "Lista", "Name" => "Nombre", "Type" => "Tipo", "Size" => "Tamaño", "Date" => "Fecha", "Descending" => "Decendente", "Uploading file..." => "Cargando archivo...", "Loading image..." => "Cargando imagen...", "Loading folders..." => "Cargando carpetas...", "Loading files..." => "Cargando archivos...", "New Subfolder..." => "Nuevo subdirectorio...", "Rename..." => "Renombrar...", "Delete" => "Eliminar", "OK" => "OK", "Cancel" => "Cancelar", "Select" => "Seleccionar", "Select Thumbnail" => "Seleccionar miniatura", "Select Thumbnails" => "Seleccionar miniaturas", "View" => "Ver", "Download" => "Descargar", "Download files" => "Descargar archivos", "Clipboard" => "Portapapeles", "Checking for new version..." => "Verificando nuevas versiones...", "Unable to connect!" => "¡No se pudo realizar la conexión!", "Download version {version} now!" => "¡Descarga la versión {version} ahora!", "KCFinder is up to date!" => "¡KCFinder está actualizado!", "Licenses:" => "Licencias:", "Attention" => "Atención", "Question" => "Pregunta", "Yes" => "Si", "No" => "No", "You cannot rename the extension of files!" => "¡Usted no puede renombrar la extensión de los archivos!", "Uploading file {number} of {count}... {progress}" => "Cargando archivo {number} de {count}... {progress}", "Failed to upload {filename}!" => "¡No se pudo cargar el archivo {filename}!", ); ?>
0x6a
trunk/libraries/kcfinder/lang/es.php
PHP
asf20
8,002
<?php /** Czech localization file for KCFinder * author: Rostislav Sivak <rsivak@rsivak.com> */ $lang = array( '_locale' => "cs_CZ.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e.%B.%Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "Nemáte práva pro nahrávání souborů.", "You don't have permissions to browse server." => "Nemáte práva pro prohlížení serveru.", "Cannot move uploaded file to target folder." => "Nelze přesunout soubor do určeného adresáře.", "Unknown error." => "Neznámá chyba.", "The uploaded file exceeds {size} bytes." => "Nahraný soubor přesahuje {size} bytů.", "The uploaded file was only partially uploaded." => "Nahraný soubor byl nahrán pouze částečně.", "No file was uploaded." => "Žádný soubor nebyl nahrán na server.", "Missing a temporary folder." => "Chybí dočasný adresář.", "Failed to write file." => "Soubor se nepodařilo se uložit.", "Denied file extension." => "Nepodporovaný typ souboru.", "Unknown image format/encoding." => "Neznámý formát obrázku/encoding.", "The image is too big and/or cannot be resized." => "Obrázek je příliš velký/nebo nemohl být zmenšen.", "Cannot create {dir} folder." => "Adresář {dir} nelze vytvořit.", "Cannot write to upload folder." => "Nelze ukládat do adresáře pro nahrávání.", "Cannot read .htaccess" => "Není možno číst soubor .htaccess", "Incorrect .htaccess file. Cannot rewrite it!" => "Chybný soubor .htaccess. Soubor nelze přepsat!", "Cannot read upload folder." => "Nelze číst z adresáře pro nahrávání souborů.", "Cannot access or create thumbnails folder." => "Adresář pro náhledy nelze vytvořit nebo není přístupný.", "Cannot access or write to upload folder." => "Nelze přistoupit, nebo zapisovat do adresáře pro nahrávání souborů.", "Please enter new folder name." => "Vložte prosím nové jméno adresáře.", "Unallowable characters in folder name." => "Nepovolené znaky v názvu adresáře.", "Folder name shouldn't begins with '.'" => "Jméno adresáře nesmí začínat znakem '.'", "Please enter new file name." => "Vložte prosím nové jméno souboru.", "Unallowable characters in file name." => "Nepovolené znaky v názvu souboru.", "File name shouldn't begins with '.'" => "Název soubor nesmí začínat znakem '.'", "Are you sure you want to delete this file?" => "Jste si jistý že chcete smazat tento soubor?", "Are you sure you want to delete this folder and all its content?" => "Jste si jistý že chcete smazat tento adresář a celý jeho obsah?", "Inexistant or inaccessible folder." => "Neexistující nebo nepřístupný adresář.", "Undefined MIME types." => "Nedefinovaný MIME typ souboru.", "Fileinfo PECL extension is missing." => "Rozříření PECL pro zjištění informací o souboru chybí.", "Opening fileinfo database failed." => "Načtení informací o souboru selhalo.", "You can't upload such files." => "Tyto soubory nemůžete nahrát na server.", "The file '{file}' does not exist." => "Tento soubor '{file}' neexistuje.", "Cannot read '{file}'." => "Nelze načíst '{file}'.", "Cannot copy '{file}'." => "Nelze kopírovat '{file}'.", "Cannot move '{file}'." => "Nelze přesunout '{file}'.", "Cannot delete '{file}'." => "Nelze smazat '{file}'.", "Click to remove from the Clipboard" => "Klikněte pro odstranění ze schránky", "This file is already added to the Clipboard." => "Tento soubor je již ve schránce vložen.", "Copy files here" => "Kopírovat soubory na toto místo", "Move files here" => "Přesunout soubory na toto místo", "Delete files" => "Smazat soubory", "Clear the Clipboard" => "Vyčistit schránku", "Are you sure you want to delete all files in the Clipboard?" => "Jste si jistý že chcete vymazat všechny soubory ze schránky?", "Copy {count} files" => "Kopírovat {count} souborů", "Move {count} files" => "Přesunout {count} souborů", "Add to Clipboard" => "Vložit do schránky", "New folder name:" => "Nový název adresáře:", "New file name:" => "Nový název souboru:", "Upload" => "Nahrát", "Refresh" => "Obnovit", "Settings" => "Nastavení", "Maximize" => "Maxializovat", "About" => "O aplikaci", "files" => "soubory", "View:" => "Zobrazit:", "Show:" => "Ukázat:", "Order by:" => "Řadit podle:", "Thumbnails" => "Náhledy", "List" => "Seznam", "Name" => "Jméno", "Size" => "Velikost", "Date" => "Datum", "Descending" => "Sestupně", "Uploading file..." => "Nahrávání souboru...", "Loading image..." => "Načítání obrázku...", "Loading folders..." => "Načítání adresářů...", "Loading files..." => "Načítání souborů...", "New Subfolder..." => "Nový adresář...", "Rename..." => "Přejmenovat...", "Delete" => "Smazat", "OK" => "OK", "Cancel" => "Zrušit", "Select" => "Vybrat", "Select Thumbnail" => "Vybrat náhled", "View" => "Zobrazit", "Download" => "Stažení", 'Clipboard' => "Schránka", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Adresář nelze přejmenovat.", "Non-existing directory type." => "Neexistující typ adresáře.", "Cannot delete the folder." => "Adresář nelze smazat.", "The files in the Clipboard are not readable." => "Soubory ve schránce nelze načíst.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} souborů ve schránce nelze načíst. Chcete zkopírovat zbylé soubory?", "The files in the Clipboard are not movable." => "Soubory ve schránce nelze přesunout.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} souborů ve schránce nelze přesunout. Chcete přesunout zbylé soubory?", "The files in the Clipboard are not removable." => "Soubory ve schránce nelze smazat.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} souborů ve schránce nelze smazat. Chcete smazat zbylé soubory?", "The selected files are not removable." => "Označené soubory nelze smazat.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} označených souborů nelze smazat. Chcete smazat zbylé soubory?", "Are you sure you want to delete all selected files?" => "Jste si jistý že chcete smazat vybrané soubory?", "Failed to delete {count} files/folders." => "Nebylo smazáno {count} souborů/adresářů.", "A file or folder with that name already exists." => "Soubor nebo adresář s takovým jménem již existuje.", "selected files" => "vybrané soubory", "Type" => "Typ", "Select Thumbnails" => "Vybrat náhled", "Download files" => "Stáhnout soubory", // SINCE 2.4 "Checking for new version..." => "Zkontrolovat novou verzi...", "Unable to connect!" => "Nelze připojit!", "Download version {version} now!" => "Stáhnout verzi {version} nyní!", "KCFinder is up to date!" => "KCFinder je aktuální!", "Licenses:" => "Licence:", "Attention" => "Upozornění", "Question" => "Otázka", "Yes" => "Ano", "No" => "Ne", ); ?>
0x6a
trunk/libraries/kcfinder/lang/cs.php
PHP
asf20
7,912
<?php /** French localization file for KCFinder * author: Damien Barrère */ $lang = array( '_locale' => "fr_FR.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "Vous n'avez pas les droits nécessaires pour envoyer des fichiers.", "You don't have permissions to browse server." => "Vous n'avez pas les droits nécessaires pour parcourir le serveur.", "Cannot move uploaded file to target folder." => "Impossible de déplacer le fichier téléchargé vers le répertoire de destination.", "Unknown error." => "Erreur inconnue.", "The uploaded file exceeds {size} bytes." => "Le fichier envoyé dépasse la taille maximale de {size} octects.", "The uploaded file was only partially uploaded." => "Le fichier envoyé ne l'a été que partiellement.", "No file was uploaded." => "Aucun fichier n'a été envoyé", "Missing a temporary folder." => "Il manque un répertoire temporaire.", "Failed to write file." => "Impossible de créer le fichier.", "Denied file extension." => "Type d'extension de fichier interdit.", "Unknown image format/encoding." => "Format/encodage d'image inconnu.", "The image is too big and/or cannot be resized." => "Image trop grande et/ou impossible de la redimensionner.", "Cannot create {dir} folder." => "Impossible de créer le répertoire {dir}.", "Cannot write to upload folder." => "Impossible d'écrire dans le répertoire de destination.", "Cannot read .htaccess" => "Impossible de lire le fichier .htaccess", "Incorrect .htaccess file. Cannot rewrite it!" => "Fichier .htaccess incorrect. Réécriture du fichier impossible!", "Cannot read upload folder." => "Impossible de lire le répertoire d'envoi.", "Cannot access or create thumbnails folder." => "Impossible d'accéder ou de créer le répertoire des miniatures.", "Cannot access or write to upload folder." => "Impossible d'accèder ou d'écrire dans le répertoire d'envoi.", "Please enter new folder name." => "Merci d'entrer le nouveau nom de dossier.", "Unallowable characters in folder name." => "Caractères non autorisés dans le nom du dossier.", "Folder name shouldn't begins with '.'" => "Le nom du dossier ne peut pas commencer par '.'", "Please enter new file name." => "Merci d'entrer le nouveau nom de fichier", "Unallowable characters in file name." => "Caractères non autorisés dans le nom du fichier.", "File name shouldn't begins with '.'" => "Le nom du fichier ne peut pas commencer par '.'", "Are you sure you want to delete this file?" => "Êtes vous sûr du vouloir supprimer ce fichier?", "Are you sure you want to delete this folder and all its content?" => "Êtes vous sûr du vouloir supprimer ce répertoire et tous les fichiers qu'il contient?", "Non-existing directory type." => "Type de répertoire inexistant.", "Undefined MIME types." => "MIME types non déclarés.", "Fileinfo PECL extension is missing." => "L'extension' Fileinfo PECL est manquante.", "Opening fileinfo database failed." => "Ouverture de la base de données fileinfo echouée.", "You can't upload such files." => "Vous ne pouvez pas envoyer de tels fichiers.", "The file '{file}' does not exist." => "Le fichier '{file}' n'existe pas.", "Cannot read '{file}'." => "Impossible de lire le fichier '{file}'.", "Cannot copy '{file}'." => "Impossible de copier le fichier '{file}'.", "Cannot move '{file}'." => "Impossible de déplacer le fichier '{file}'.", "Cannot delete '{file}'." => "Impossible de supprimer le fichier '{file}'.", "Click to remove from the Clipboard" => "Cliquez pour enlever du presse-papier", "This file is already added to the Clipboard." => "Ce fihier a déja été ajouté au presse-papier.", "Copy files here" => "Copier les fichier ici", "Move files here" => "Déplacer le fichiers ici", "Delete files" => "Supprimer les fichiers", "Clear the Clipboard" => "Vider le presse-papier", "Are you sure you want to delete all files in the Clipboard?" => "Êtes vous sûr de vouloir supprimer tous les fichiers du presse-papier?", "Copy {count} files" => "Copie de {count} fichiers", "Move {count} files" => "Déplacement de {count} fichiers", "Add to Clipboard" => "Ajouter au presse-papier", "New folder name:" => "Nom du nouveau dossier:", "New file name:" => "Nom du nouveau fichier:", "Upload" => "Envoyer", "Refresh" => "Rafraîchir", "Settings" => "Paramètres", "Maximize" => "Agrandir", "About" => "A propos", "files" => "fichiers", "View:" => "Voir:", "Show:" => "Montrer:", "Order by:" => "Trier par:", "Thumbnails" => "Miniatures", "List" => "Liste", "Name" => "Nom", "Size" => "Taille", "Date" => "Date", "Descending" => "Décroissant", "Uploading file..." => "Envoi en cours...", "Loading image..." => "Chargement de l'image'...", "Loading folders..." => "Chargement des dossiers...", "Loading files..." => "Chargement des fichiers...", "New Subfolder..." => "Nouveau sous-dossier...", "Rename..." => "Renommer...", "Delete" => "Supprimer", "OK" => "OK", "Cancel" => "Annuler", "Select" => "Sélectionner", "Select Thumbnail" => "Sélectionner la miniature", "View" => "Voir", "Download" => "Télécharger", 'Clipboard' => "Presse-papier", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Impossible de renommer le dossier.", "Cannot delete the folder." => "Impossible de supprimer le dossier.", "The files in the Clipboard are not readable." => "Les fichiers du presse-papier ne sont pas lisibles.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} fichiers dans le presse-papier ne sont pas lisibles. Voulez vous copier le reste?", "The files in the Clipboard are not movable." => "Les fichiers du presse-papier ne peuvent pas être déplacés.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} fichiers du presse-papier ne peuvent pas être déplacées. Voulez vous déplacer le reste?", "The files in the Clipboard are not removable." => "Les fichiers du presse-papier ne peuvent pas être enlevés.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} fichiers du presse-papier ne peuvent pas être enlevés. Vouslez vous supprimer le reste?", "The selected files are not removable." => "Les fichiers sélectionnés ne peuvent pas être enlevés.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} fichier sélectionnés ne peuvent pas être enlevés. Voulez vous supprimer le reste?", "Are you sure you want to delete all selected files?" => "Êtes vous sûr de vouloir supprimer tous les fichiers sélectionnés?", "Failed to delete {count} files/folders." => "Supression de {count} fichiers/dossiers impossible.", "A file or folder with that name already exists." => "Un fichier ou dossier ayant ce nom existe déja.", "Inexistant or inaccessible folder." => "Dossier inexistant ou innacessible.", "selected files" => "fichiers sélectionnés", "Type" => "Type", "Select Thumbnails" => "Sélectionner les miniatures", "Download files" => "Télécharger les fichiers", // SINCE 2.4 "Checking for new version..." => "Vérifier l'existance d'une nouvelle version...", "Unable to connect!" => "Connexion impossible!", "Download version {version} now!" => "Télécharger la version {version} maintenant!", "KCFinder is up to date!" => "KCFinder est à jour!", "Licenses:" => "Licences:", "Attention" => "Alerte", "Question" => "Question", "Yes" => "Oui", "No" => "Non", ); ?>
0x6a
trunk/libraries/kcfinder/lang/fr.php
PHP
asf20
8,435
<?php /** This file is part of KCFinder project * * @desc Default English localization * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ $lang = array( '_locale' => "en_US.UTF-8", '_charset' => "utf-8", // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %B %e, %Y %I:%M %p", '_dateTimeMid' => "%a %b %e %Y %I:%M %p", '_dateTimeSmall' => "%m/%d/%Y %I:%M %p", ); ?>
0x6a
trunk/libraries/kcfinder/lang/en.php
PHP
asf20
728
<?php /** Dutch localization file for KCFinder * author: Lars Anderson <lars16anderson@users.sourceforge.net> */ $lang = array( '_locale' => "nl_NL.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e.%B.%Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d/%m/%Y %H:%M", "You don't have permissions to upload files." => "U heeft geen toestemming om bestanden te uploaden.", "You don't have permissions to browse server." => "U heeft geen toegang tot de server.", "Cannot move uploaded file to target folder." => "Het te uploaden bestand kon niet naar de doel folder verplaatst worden.", "Unknown error." => "Onbekende foutmelding.", "The uploaded file exceeds {size} bytes." => "De bestandsgrootte van het bestand gaat de limiet ({size}) voorbij.", "The uploaded file was only partially uploaded." => "Het te uploaden bestand is slechts gedeeltelijk ge�pload.", "No file was uploaded." => "Er is geen bestand ge�pload.", "Missing a temporary folder." => "Een tijdelijke folder ontbreekt.", "Failed to write file." => "Poging tot schrijven van bestand is mislukt.", "Denied file extension." => "De extensie van dit bestand is niet toegestaan.", "Unknown image format/encoding." => "Onbekende afbeeldingsformaats/-codering.", "The image is too big and/or cannot be resized." => "De afbeelding is te groot en/of de grootte kan niet aangepast worden.", "Cannot create {dir} folder." => "Kan de map {dir} niet aanmaken.", "Cannot write to upload folder." => "Kan niet naar de upload folder schrijven.", "Cannot read .htaccess" => "Kan .htaccess niet lezen.", "Incorrect .htaccess file. Cannot rewrite it!" => "Incorrect .htaccess bestand. Bestand kan niet herschreven worden!", "Cannot read upload folder." => "Upload folder kan niet uitgelezen worden.", "Cannot access or create thumbnails folder." => "Het is niet mogelijk om een miniatuurweergaven folder aan te maken of te benaderen.", "Cannot access or write to upload folder." => "Het is niet mogelijk om in de upload folder te schrijven of deze te benaderen.", "Please enter new folder name." => "Vul a.u.b. een nieuwe foldernaam in.", "Unallowable characters in folder name." => "Er zijn niet toegestane karakters gebruikt in de foldernaam.", "Folder name shouldn't begins with '.'" => "Een foldernaam mag niet met '.' beginnen.", "Please enter new file name." => "Vul a.u.b. een nieuwe bestandsnaam in.", "Unallowable characters in file name." => "Er zijn niet toegestane karakters gebruikt in de bestandsnaam.", "File name shouldn't begins with '.'" => "Een bestandsnaam mag niet met '.' beginnen.", "Are you sure you want to delete this file?" => "Weet u zeker dat u dit bestand wilt verwijderen?", "Are you sure you want to delete this folder and all its content?" => "Weet u zeker dat u deze folder en alle inhoud ervan wilt verwijderen?", "Inexistant or inaccessible folder." => "Folder bestaat niet of kon niet benaderd worden.", "Undefined MIME types." => "Onbekend MIME type.", "Fileinfo PECL extension is missing." => "Bestandsinformatie PECL extensie ontbreekt.", "Opening fileinfo database failed." => "Openen van bestandsinformatie database is mislukt.", "You can't upload such files." => "Uploaden van dergelijke bestanden is niet mogelijk.", "The file '{file}' does not exist." => "Het bestand '{file}' bestaat niet.", "Cannot read '{file}'." => "Kan bestand '{file}' niet lezen.", "Cannot copy '{file}'." => "Kan bestand '{file}' niet kopieren.", "Cannot move '{file}'." => "Kan bestand '{file}' niet verplaatsen.", "Cannot delete '{file}'." => "Kan bestand '{file}' niet verwijderen.", "Click to remove from the Clipboard" => "Klik om te verwijderen van het klembord.", "This file is already added to the Clipboard." => "Dit bestand was reeds toegevoegd aan het klembord.", "Copy files here" => "Kopieer bestanden hierheen", "Move files here" => "Verplaats bestanden hierheen", "Delete files" => "Verwijder bestanden", "Clear the Clipboard" => "Klemborg leegmaken", "Are you sure you want to delete all files in the Clipboard?" => "Weet u zeker dat u alle bestanden op het klembord wilt verwijderen?", "Copy {count} files" => "Kopieer {count} bestanden", "Move {count} files" => "Verplaats {count} bestanden", "Add to Clipboard" => "Voeg toe aan klembord", "New folder name:" => "Nieuwe foldernaam:", "New file name:" => "Nieuwe bestandsnaam:", "Upload" => "Upload", "Refresh" => "Verversen", "Settings" => "Instellingen", "Maximize" => "Maximaliseren", "About" => "Over", "files" => "bestanden", "View:" => "Beeld:", "Show:" => "Weergeven:", "Order by:" => "Sorteren op:", "Thumbnails" => "Miniatuurweergaven", "List" => "Lijst", "Name" => "Naam", "Size" => "Grootte", "Date" => "Datum", "Descending" => "Aflopend", "Uploading file..." => "Bestand uploaden...", "Loading image..." => "Afbeelding wordt geladen...", "Loading folders..." => "Folders worden geladen...", "Loading files..." => "Bestanden worden geladen ...", "New Subfolder..." => "Nieuwe subfolder...", "Rename..." => "Hernoemen...", "Delete" => "Verwijderen", "OK" => "OK", "Cancel" => "Annuleren", "Select" => "Selecteer", "Select Thumbnail" => "Selecteer miniatuurweergave", "View" => "Beeld", "Download" => "Download", 'Clipboard' => "Klembord", // VERSION 2 NEW LABELS "Cannot rename the folder." => "De folder kan niet hernoemd worden.", "Non-existing directory type." => "Het folder type bestaat niet.", "Cannot delete the folder." => "De folder kan niet verwijderd worden.", "The files in the Clipboard are not readable." => "De bestanden op het klembord kunnen niet gelezen worden.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} bestanden op het klembord zijn niet leesbaar. Wilt u de rest toch kopi�ren?", "The files in the Clipboard are not movable." => "De bestanden op het klembord kunnen niet verplaatst worden.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} bestanden op het klembord kunnen niet verplaatst worden. Wilt u de rest toch verplaatsen?", "The files in the Clipboard are not removable." => "De bestanden op het klembord kunnen niet verwijderd worden.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} bestanden op het klembord kunnen niet verwijderd worden. Wilt u de rest toch verwijderen?", "The selected files are not removable." => "De geselecteerde bestanden kunnen niet verwijderd worden.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} geselecteerde bestanden kunnen niet verwijderd worden. Wilt u de rest toch verwijderen?", "Are you sure you want to delete all selected files?" => "Weet u zeker dat u alle geselcteerde bestanden wilt verwijderen?", "Failed to delete {count} files/folders." => "{count} bestanden/folders konden niet verwijderd worden.", "A file or folder with that name already exists." => "Er bestaat reeds een bestand of folder met die naam.", "selected files" => "geselecteerde bestanden", "Type" => "Type", "Select Thumbnails" => "Kies miniatuurweergaven", "Download files" => "Bestanden downloaden", ); ?>
0x6a
trunk/libraries/kcfinder/lang/nl.php
PHP
asf20
7,971
<?php /** Lithuanian localization file for KCFinder * author: Paulius Leščinskas <paulius.lescinskas@gmail.com> */ $lang = array( '_locale' => "lt_LT.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%F %T", '_dateTimeMid' => "%F %T", '_dateTimeSmall' => "%F %T", "You don't have permissions to upload files." => "Jūs neturite teisių įkelti failus", "You don't have permissions to browse server." => "Jūs neturite teisių naršyti po failus", "Cannot move uploaded file to target folder." => "Nepavyko įkelti failo į reikiamą katalogą.", "Unknown error." => "Nežinoma klaida.", "The uploaded file exceeds {size} bytes." => "Įkeliamas failas viršija {size} baitų(-us).", "The uploaded file was only partially uploaded." => "Failas buvo tik dalinai įkeltas.", "No file was uploaded." => "Failas nebuvo įkeltas.", "Missing a temporary folder." => "Nėra laikino katalogo.", "Failed to write file." => "Nepavyko įrašyti failo.", "Denied file extension." => "Draudžiama įkelti šio tipo failus.", "Unknown image format/encoding." => "Nežinomas paveikslėlio formatas/kodavimas.", "The image is too big and/or cannot be resized." => "Paveikslėlis yra per didelis ir/arba negali būti sumažintas.", "Cannot create {dir} folder." => "Nepavyko sukurti {dir} katalogo.", "Cannot write to upload folder." => "Nepavyko įrašyti į įkeliamų failų katalogą.", "Cannot read .htaccess" => "Nepavyko nuskaityti .htaccess failo", "Incorrect .htaccess file. Cannot rewrite it!" => "Blogas .htaccess failas. Nepavyko jo perrašyti", "Cannot read upload folder." => "Nepavyko atidaryti įkeliamų failų katalogo.", "Cannot access or create thumbnails folder." => "Nepavyko atidaryti ar sukurti sumažintų paveikslėlių katalogo.", "Cannot access or write to upload folder." => "Nepavyko atidaryti ar įrašyti į įkeliamų failų katalogą.", "Please enter new folder name." => "Įveskite katalogo pavadinimą.", "Unallowable characters in folder name." => "Katalogo pavadinime yra neleistinų simbolių.", "Folder name shouldn't begins with '.'" => "Katalogo pavadinimas negali prasidėti '.'", "Please enter new file name." => "Įveskite failo pavadinimą.", "Unallowable characters in file name." => "Failo pavadinime yra neleistinų simbolių", "File name shouldn't begins with '.'" => "Failo pavadinimas negali prasidėti '.'", "Are you sure you want to delete this file?" => "Ar tikrai ištrinti šį failą?", "Are you sure you want to delete this folder and all its content?" => "Ar tikrai ištrinti šį katalogą su visu jo turiniu?", "Inexistant or inaccessible folder." => "Katalogas neegzistuoja arba yra neprieinamas.", "Undefined MIME types." => "Nenurodytas MIME tipas.", "Fileinfo PECL extension is missing." => "Trūksa PECL plėtinio Fileinfo", "Opening fileinfo database failed." => "Nepavyko atidaryti Fileinfo duomenų bazės.", "You can't upload such files." => "Negalima įkelti tokių failų.", "The file '{file}' does not exist." => "Failas '{file}' neegzistuoja.", "Cannot read '{file}'." => "Nepavyko atidaryti '{file}' failo.", "Cannot copy '{file}'." => "Nepavyko nukopijuoti '{file}' failo.", "Cannot move '{file}'." => "Nepavyko perkelti '{file}' failo.", "Cannot delete '{file}'." => "Nepavyko ištrinti '{file}' failo.", "Click to remove from the Clipboard" => "Zum entfernen aus der Zwischenablage, hier klicken.", "This file is already added to the Clipboard." => "Šis failas jau įkeltas į laikinąją atmintį.", "Copy files here" => "Kopijuoti failus čia.", "Move files here" => "Perkelti failus čia.", "Delete files" => "Ištrinti failus.", "Clear the Clipboard" => "Išvalyti laikinąją atmintį", "Are you sure you want to delete all files in the Clipboard?" => "Ar tikrai ištrinti visus failus, esančius laikinojoje atmintyje?", "Copy {count} files" => "Kopijuoti {count} failų(-us)", "Move {count} files" => "Perkelti {count} failų(-us)", "Add to Clipboard" => "Įkelti į laikinąją atmintį", "New folder name:" => "Naujo katalogo pavadinimas:", "New file name:" => "Naujo failo pavadinimas:", "Upload" => "Įkelti", "Refresh" => "Atnaujinti", "Settings" => "Nustatymai", "Maximize" => "Padidinti", "About" => "Apie", "files" => "Failai", "View:" => "Peržiūra:", "Show:" => "Rodyti:", "Order by:" => "Rikiuoti:", "Thumbnails" => "Sumažintos iliustracijos", "List" => "Sąrašas", "Name" => "Pavadinimas", "Size" => "Dydis", "Date" => "Data", "Descending" => "Mažejančia tvarka", "Uploading file..." => "Įkeliamas failas...", "Loading image..." => "Kraunami paveikslėliai...", "Loading folders..." => "Kraunami katalogai...", "Loading files..." => "Kraunami failai...", "New Subfolder..." => "Naujas katalogas...", "Rename..." => "Pervadinti...", "Delete" => "Ištrinti", "OK" => "OK", "Cancel" => "Atšaukti", "Select" => "Pažymėti", "Select Thumbnail" => "Pasirinkti sumažintą paveikslėlį", "View" => "Peržiūra", "Download" => "Atsisiųsti", 'Clipboard' => "Laikinoji atmintis", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Nepavyko pervadinti katalogo.", "Non-existing directory type." => "Neegzistuojantis katalogo tipas.", "Cannot delete the folder." => "Nepavyko ištrinti katalogo.", "The files in the Clipboard are not readable." => "Nepavyko nuskaityti failų iš laikinosios atminties.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "Nepavyko atidaryti {count} failų(-ai) iš laikinosios atminties. Ar kopijuoti likusius?", "The files in the Clipboard are not movable." => "Nepavyko perkelti failų iš laikinosios atminties.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "Nepavyko perkelti {count} failų(-ai) iš laikinosios atminties. Ar perkelti likusius?", "The files in the Clipboard are not removable." => "Nepavyko perkelti failų iš laikinosios atminties.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "Nepavyko ištrinti {count} failų(-ai) iš laikinosios atminties. Ar ištrinti likusius?", "The selected files are not removable." => "Nepavyko perkelti pažymėtų failų.", "{count} selected files are not removable. Do you want to delete the rest?" => "Nepavyko ištrinti {count} failų(-ai) iš laikinosios atminties. Ar ištrinti likusius?", "Are you sure you want to delete all selected files?" => "Ar tikrai ištrinti visus pažymėtus failus?", "Failed to delete {count} files/folders." => "Nepavyko ištrinti {count} failų/katalogų.", "A file or folder with that name already exists." => "Failas arba katalogas tokiu pavadinimu jau egzistuoja.", "selected files" => "Pasirinkti failus", "Type" => "Tipas", "Select Thumbnails" => "Pasirinkti sumažintus paveikslėlius", "Download files" => "Atsisiųsti failus", ); ?>
0x6a
trunk/libraries/kcfinder/lang/lt.php
PHP
asf20
7,622
<?php /** Chinese Simplified localization file for KCFinder * author: yutuo * country: China * E-mail: yutuo5@gmail.com * URL: yutuo.net */ $lang = array( '_locale' => "zh_CN.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%Y-%m-%d %H:%M", "You don't have permissions to upload files." => "您没有权限上传文件。", "You don't have permissions to browse server." => "您没有权限查看服务器文件。", "Cannot move uploaded file to target folder." => "无法移动上传文件到指定文件夹。", "Unknown error." => "发生不可预知异常。", "The uploaded file exceeds {size} bytes." => "文件大小超过{size}字节。", "The uploaded file was only partially uploaded." => "文件未完全上传。", "No file was uploaded." => "文件未上传。", "Missing a temporary folder." => "临时文件夹不存在。", "Failed to write file." => "写入文件失败。", "Denied file extension." => "禁止的文件扩展名。", "Unknown image format/encoding." => "无法确认图片格式。", "The image is too big and/or cannot be resized." => "图片大太,且(或)无法更改大小。", "Cannot create {dir} folder." => "无法创建{dir}文件夹。", "Cannot write to upload folder." => "无法写入上传文件夹。", "Cannot read .htaccess" => "文件.htaccess无法读取。", "Incorrect .htaccess file. Cannot rewrite it!" => "文件.htaccess错误,无法重写。", "Cannot read upload folder." => "无法读取上传目录。", "Cannot access or create thumbnails folder." => "无法访问或创建缩略图文件夹。", "Cannot access or write to upload folder." => "无法访问或写入上传文件夹。", "Please enter new folder name." => "请输入文件夹名。", "Unallowable characters in folder name." => "文件夹名含有禁止字符。", "Folder name shouldn't begins with '.'" => "文件夹名不能以点(.)为首字符。", "Please enter new file name." => "请输入新文件名。", "Unallowable characters in file name." => "文件名含有禁止字符。", "File name shouldn't begins with '.'" => "文件名不能以点(.)为首字符。", "Are you sure you want to delete this file?" => "是否确认删除该文件?", "Are you sure you want to delete this folder and all its content?" => "是否确认删除该文件夹以及其子文件和子目录?", "Inexistant or inaccessible folder." => "不存在或不可访问的文件夹。", "Undefined MIME types." => "未定义的MIME类型。", "Fileinfo PECL extension is missing." => "文件PECL属性不存在。", "Opening fileinfo database failed." => "打开文件属性数据库出错。", "You can't upload such files." => "你无法上传该文件。", "The file '{file}' does not exist." => "文件{file}不存在。", "Cannot read '{file}'." => "无法读取文件{file}。", "Cannot copy '{file}'." => "无法复制文件{file}。", "Cannot move '{file}'." => "无法移动文件{file}。", "Cannot delete '{file}'." => "无法删除文件{file}。", "Click to remove from the Clipboard" => "点击从剪贴板删除", "This file is already added to the Clipboard." => "文件已复制到剪贴板。", "Copy files here" => "复制到这里", "Move files here" => "移动到这里", "Delete files" => "删除这些文件", "Clear the Clipboard" => "清除剪贴板", "Are you sure you want to delete all files in the Clipboard?" => "是否确认删除所有在剪贴板的文件?", "Copy {count} files" => "复制 {count} 个文件", "Move {count} files" => "移动 {count} 个文件 ", "Add to Clipboard" => "添加到剪贴板", "New folder name:" => "新文件夹名:", "New file name:" => "新文件夹:", "Upload" => "上传", "Refresh" => "刷新", "Settings" => "设置", "Maximize" => "最大化", "About" => "关于", "files" => "文件", "View:" => "视图:", "Show:" => "显示:", "Order by:" => "排序:", "Thumbnails" => "图标", "List" => "列表", "Name" => "文件名", "Size" => "大小", "Date" => "日期", "Descending" => "降序", "Uploading file..." => "正在上传文件...", "Loading image..." => "正在加载图片...", "Loading folders..." => "正在加载文件夹...", "Loading files..." => "正在加载文件...", "New Subfolder..." => "新建文件夹...", "Rename..." => "重命名...", "Delete" => "删除", "OK" => "OK", "Cancel" => "取消", "Select" => "选择", "Select Thumbnail" => "选择缩略图", "View" => "查看", "Download" => "下载", "Clipboard" => "剪贴板", // VERSION 2 NEW LABELS "Cannot rename the folder." => "无法重命名该文件夹。", "Non-existing directory type." => "不存在的目录类型。", "Cannot delete the folder." => "无法删除该文件夹。", "The files in the Clipboard are not readable." => "剪贴板上该文件无法读取。", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "剪贴板{count}个文件无法读取。 是否复制静态文件?", "The files in the Clipboard are not movable." => "剪贴板上该文件无法移动。", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "剪贴板{count}个文件无法移动。 是否移动静态文件?", "The files in the Clipboard are not removable." => "剪贴板上该文件无法删除。", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "剪贴板{count}个文件无法删除。 是否删除静态文件?", "The selected files are not removable." => "选中文件未删除。", "{count} selected files are not removable. Do you want to delete the rest?" => "选中的{count}个文件未删除。是否删除静态文件?", "Are you sure you want to delete all selected files?" => "是否确认删除选中文件?", "Failed to delete {count} files/folders." => "{count}个文件或文件夹无法删除。", "A file or folder with that name already exists." => "文件或文件夹已存在。", "selected files" => "选中的文件", "Type" => "种类", "Select Thumbnails" => "选择缩略图", "Download files" => "下载文件", ); ?>
0x6a
trunk/libraries/kcfinder/lang/zh-cn.php
PHP
asf20
7,012
<?php /** Greek localization file for KCFinder * author: Spiros Kabasakalis */ $lang = array( '_locale' => "el_GR.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "Δεν έχετε δικαίωμα να ανεβάσετε αρχεία.", "You don't have permissions to browse server." => "Δεν έχετε δικαίωμα να δείτε τα αρχεία στο διακομιστή.", "Cannot move uploaded file to target folder." => "Το αρχείο δε μπορεί να μεταφερθεί στο φάκελο προορισμού.", "Unknown error." => "'Αγνωστο σφάλμα.", "The uploaded file exceeds {size} bytes." => "Το αρχείο υπερβαίνει το μέγεθος των {size} bytes.", "The uploaded file was only partially uploaded." => "Ένα μόνο μέρος του αρχείου ανέβηκε.", "No file was uploaded." => "Κανένα αρχείο δεν ανέβηκε.", "Missing a temporary folder." => "Λείπει ο φάκελος των προσωρινών αρχείων.", "Failed to write file." => "Σφάλμα στη τροποποίηση του αρχείου.", "Denied file extension." => "Δεν επιτρέπονται αυτού του είδους αρχεία.", "Unknown image format/encoding." => "Αγνωστη κωδικοποίηση εικόνας.", "The image is too big and/or cannot be resized." => "Η εικόνα είναι πάρα πολύ μεγάλη και/η δεν μπορεί να αλλάξει μέγεθος.", "Cannot create {dir} folder." => "Αδύνατον να δημιουργηθεί ο φάκελος {dir}.", "Cannot write to upload folder." => "Αδύνατη η εγγραφή στο φάκελο προορισμού.", "Cannot read .htaccess" => "Αδύνατη η ανάγνωση του .htaccess", "Incorrect .htaccess file. Cannot rewrite it!" => "Εσφαλμένο αρχείο .htaccess.Αδύνατη η τροποποίησή του!", "Cannot read upload folder." => "Μη αναγνώσιμος φάκελος προορισμού.", "Cannot access or create thumbnails folder." => "Αδύνατη η πρόσβαση και ανάγνωση του φακέλου με τις μικρογραφίες εικόνων.", "Cannot access or write to upload folder." => "Αδύνατη η πρόσβαση και τροποποίηση του φακέλου προορισμού.", "Please enter new folder name." => "Παρακαλούμε εισάγετε ένα νέο όνομα φακέλου. ", "Unallowable characters in folder name." => "Μη επιτρεπτοί χαρακτήρες στο όνομα φακέλου.", "Folder name shouldn't begins with '.'" => "Το όνομα του φακέλου δε πρέπει να αρχίζει με '.'", "Please enter new file name." => "Παρακαλούμε εισάγετε ένα νέο όνομα αρχείου.", "Unallowable characters in file name." => "Μη επιτρεπτοί χαρακτήρες στο όνομα αρχείου.", "File name shouldn't begins with '.'" => "Το όνομα του αρχείου δε πρέπει να αρχίζει με '.'", "Are you sure you want to delete this file?" => "Σίγουρα θέλετε να διαγράψετε αυτό το αρχείο?", "Are you sure you want to delete this folder and all its content?" => "Σίγουρα θέλετε να διαγράψετε αυτό το φάκελο μαζί με όλα τα περιεχόμενα?", "Non-existing directory type." => "Ανύπαρκτος τύπος φακέλου.", "Undefined MIME types." => "Απροσδιόριστοι τύποι MIME.", "Fileinfo PECL extension is missing." => "Η πληροφορία αρχείου επέκταση PECL δεν υπάρχει.", "Opening fileinfo database failed." => "Η πρόσβαση στις πληροφορίες του αρχείου απέτυχε.", "You can't upload such files." => "Δε μπορείτε να ανεβάσετε τέτοια αρχεία.", "The file '{file}' does not exist." => "Το αρχείο '{file}' δεν υπάρχει.", "Cannot read '{file}'." => "Αρχείο '{file}' μη αναγνώσιμο.", "Cannot copy '{file}'." => "Αδύνατη η αντιγραφή του '{file}'.", "Cannot move '{file}'." => "Αδύνατη η μετακίνηση του '{file}'.", "Cannot delete '{file}'." => "Αδύνατη η διαγραφή του '{file}'.", "Click to remove from the Clipboard" => "Πατήστε για διαγραφή από το Clipboard.", "This file is already added to the Clipboard." => "Αυτό το αρχείο βρίσκεται ήδη στο Clipboard.", "Copy files here" => "Αντιγράψτε αρχεία εδώ.", "Move files here" => "Μετακινήστε αρχεία εδώ.", "Delete files" => "Διαγραφή αρχείων", "Clear the Clipboard" => "Καθαρισμός Clipboard", "Are you sure you want to delete all files in the Clipboard?" => "Σίγουρα θέλετε να διαγράψετε όλα τα αρχεία στο Clipboard?", "Copy {count} files" => "Αντιγραφή {count} αρχείων.", "Move {count} files" => "Μετακίνηση {count} αρχείων.", "Add to Clipboard" => "Προσθήκη στο Clipboard", "New folder name:" => "Νέο όνομα φακέλου:", "New file name:" => "Νέο όνομα αρχείου:", "Upload" => "Ανέβασμα", "Refresh" => "Ανανέωση", "Settings" => "Ρυθμίσεις", "Maximize" => "Μεγιστοποίηση", "About" => "Σχετικά", "files" => "αρχεία", "View:" => "Προβολή:", "Show:" => "Εμφάνιση:", "Order by:" => "Ταξινόμηση κατά:", "Thumbnails" => "Μικρογραφίες", "List" => "Λίστα", "Name" => "Όνομα", "Size" => "Μέγεθος", "Date" => "Ημερομηνία", "Descending" => "Φθίνουσα", "Uploading file..." => "Το αρχείο ανεβαίνει...", "Loading image..." => "Η εικόνα φορτώνει...", "Loading folders..." => "Οι φάκελοι φορτώνουν...", "Loading files..." => "Τα αρχεία φορτώνουν...", "New Subfolder..." => "Νέος υποφάκελος...", "Rename..." => "Μετονομασία...", "Delete" => "Διαγραφή", "OK" => "OK", "Cancel" => "Ακύρωση", "Select" => "Επιλογή", "Select Thumbnail" => "Επιλογή Μικρογραφίας", "View" => "Προβολή", "Download" => "Κατέβασμα", 'Clipboard' => "Clipboard", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Αδύνατη η μετονομασία του φακέλου.", "Cannot delete the folder." => "Αδύνατη η διαγραφή του φακέλου.", "The files in the Clipboard are not readable." => "Τα αρχεία στο Clipboard είναι μη αναγνώσιμα.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} αρχεία στο Clipboard είναι μη αναγώσιμα.Θέλετε να αντιγράψετε τα υπόλοιπα?", "The files in the Clipboard are not movable." => "Τα αρχεία στο Clipboard είναι αδύνατο να μετακινηθούν.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} αρχεία στο Clipboard δεν είναι δυνατό να μετακινηθούν.Θέλετε να μετακινήσετε τα υπόλοιπα?", "The files in the Clipboard are not removable." => "Τα αρχεία στο Clipboard είναι αδύνατο να αφαιρεθούν.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} αρχεία στο Clipboard δεν είναι δυνατό να αφαιρεθούν.Θέλετε να αφαιρέσετε τα υπόλοιπα?", "The selected files are not removable." => "Τα επιλεγμένα αρχεία δε μπορούν να αφαιρεθούν.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} επιλεγμένα αρχεία δεν είναι δυνατό να αφαιρεθούν.Θέλετε να διαγράψετε τα υπόλοιπα?", "Are you sure you want to delete all selected files?" => "Σίγουρα θέλετε να διαγράψετε όλα τα επιλεγμένα αρχεία?", "Failed to delete {count} files/folders." => "Η διαγραφή {count} αρχείων/φακέλων απέτυχε.", "A file or folder with that name already exists." => "Ένα αρχείο ή φάκελος με αυτό το όνομα υπάρχει ήδη.", "Inexistant or inaccessible folder." => "Ανύπαρκτος η μη προσβάσιμος φάκελος.", "selected files" => "επιλεγμένα αρχεία", "Type" => "Τύπος", "Select Thumbnails" => "Επιλέξτε Μικρογραφίες", "Download files" => "Κατέβασμα Αρχείων", // SINCE 2.4 "Checking for new version..." => "Ελεγχος για νέα έκδοση...", "Unable to connect!" => "Αδύνατη η σύνδεση!", "Download version {version} now!" => "Κατεβάστε την έκδοση {version} τώρα!", "KCFinder is up to date!" => "Το KCFinder είναι ενημερωμένο με τη πιο πρόσφατη έκδοση!", "Licenses:" => "Άδειες:", "Attention" => "Προσοχή", "Question" => "Ερώτηση", "Yes" => "Ναι", "No" => "Όχι", ); ?>
0x6a
trunk/libraries/kcfinder/lang/el.php
PHP
asf20
10,584
<?php /** French localization file for KCFinder * author: Krzysztof Lorenc */ $lang = array( '_locale' => "pl_PL.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "Nie masz zezwolenia na wysyłanie plików.", "You don't have permissions to browse server." => "Nie masz zezwolenia na przeglądanie serwera.", "Cannot move uploaded file to target folder." => "Nie można przenieść wysłanego pliku do folderu plików wysłanych.", "Unknown error." => "Nieokreślony błąd.", "The uploaded file exceeds {size} bytes." => "Wysyłany plik przekroczył rozmiar {size} bajtów", "The uploaded file was only partially uploaded." => "Wysyłany plik nie został przesłany w całości.", "No file was uploaded." => "Żaden plik nie został przesłany", "Missing a temporary folder." => "Brak katalogu domyślnego.", "Failed to write file." => "Błąd zapisu pliku.", "Denied file extension." => "Niedozwolone rozszerzenie pliku.", "Unknown image format/encoding." => "Nie znany format/kodowanie pliku.", "The image is too big and/or cannot be resized." => "Obraz jest zbyt duży i/lub nie może zostać zmieniony jego rozmiar.", "Cannot create {dir} folder." => "Nie można utworzyć katalogu {dir}.", "Cannot write to upload folder." => "Nie można zapisywać do katalogu plików wysłanych.", "Cannot read .htaccess" => "Nie można odczytać pliku .htaccess", "Incorrect .htaccess file. Cannot rewrite it!" => "Nie prawidłowy plik .htaccess. Nie można go zapisać!", "Cannot read upload folder." => "Nie można odczytać katalogu plików wysłanych.", "Cannot access or create thumbnails folder." => "Nie ma dostępu lub nie można utworzyć katalogu miniatur.", "Cannot access or write to upload folder." => "Nie ma dostępu lub nie można zapisywać do katalogu plików wysłanych.", "Please enter new folder name." => "Proszę podać nową nazwę katalogu.", "Unallowable characters in folder name." => "Niedozwolony znak w nazwie folderu.", "Folder name shouldn't begins with '.'" => "Nazwa katalogu nie może zaczynać się od '.'", "Please enter new file name." => "Proszę podać nową nazwę pliku", "Unallowable characters in file name." => "Nie dozwolony znak w nazwie pliku.", "File name shouldn't begins with '.'" => "Nazwa pliku nie powinna zaczynać się od '.'", "Are you sure you want to delete this file?" => "Czy jesteś pewien, że chcesz skasować ten plik?", "Are you sure you want to delete this folder and all its content?" => "Czy jesteś pewien, że chcesz skasować ten katalog i jego zawartość?", "Non-existing directory type." => "Nie istniejący katalog.", "Undefined MIME types." => "Niezidentyfikowany typ MIME.", "Fileinfo PECL extension is missing." => "Brak rozszerzenia Fileinfo PECL.", "Opening fileinfo database failed." => "Otwieranie bazy danych fileinfo nie udane.", "You can't upload such files." => "Nie możesz wysyłać plików tego typu.", "The file '{file}' does not exist." => "Plik {file} nie istnieje.", "Cannot read '{file}'." => "Nie można odczytać pliku '{file}'.", "Cannot copy '{file}'." => "Nie można skopiować pliku '{file}'.", "Cannot move '{file}'." => "Nie można przenieść pliku '{file}'.", "Cannot delete '{file}'." => "Nie można usunąć pliku '{file}'.", "Click to remove from the Clipboard" => "Kliknij aby usunąć ze Schowka", "This file is already added to the Clipboard." => "Ten plik już został dodany do Schowka.", "Copy files here" => "Kopiuj pliki tutaj", "Move files here" => "Przenieś pliki tutaj", "Delete files" => "Usuń pliki", "Clear the Clipboard" => "Wyczyść Schowek", "Are you sure you want to delete all files in the Clipboard?" => "Czy jesteś pewien, że chcesz usunąć wszystkie pliki ze schowka?", "Copy {count} files" => "Kopiowanie {count} plików", "Move {count} files" => "Przenoszenie {count} plików", "Add to Clipboard" => "Dodaj do Schowka", "New folder name:" => "Nazwa nowego katalogu:", "New file name:" => "Nowa nazwa pliku:", "Upload" => "Wyślij", "Refresh" => "Odśwież", "Settings" => "Ustawienia", "Maximize" => "Maksymalizuj", "About" => "O...", "files" => "pliki", "View:" => "Widok:", "Show:" => "Pokaż:", "Order by:" => "Sortuj według:", "Thumbnails" => "Miniatury", "List" => "Lista", "Name" => "Nazwa", "Size" => "Rozmiar", "Date" => "Data", "Descending" => "Malejąco", "Uploading file..." => "Wysyłanie pliku...", "Loading image..." => "Ładowanie obrazu...", "Loading folders..." => "Ładowanie katalogów...", "Loading files..." => "Ładowanie plików...", "New Subfolder..." => "Nowy pod-katalog...", "Rename..." => "Zmień nazwę...", "Delete" => "Usuń", "OK" => "OK", "Cancel" => "Anuluj", "Select" => "Wybierz", "Select Thumbnail" => "Wybierz miniaturę", "View" => "Podgląd", "Download" => "Pobierz", 'Clipboard' => "Schowek", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Nie można zmienić nazwy katalogu.", "Cannot delete the folder." => "Nie można usunąć katalogu.", "The files in the Clipboard are not readable." => "Pliki w Schowku nie mogą zostać odczytane.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} plik(i/ów) ze Schowka nie może zostać odczytanych. Czy chcesz skopiować pozostałe?", "The files in the Clipboard are not movable." => "Pliki w Schowku nie mogą zostać przeniesione.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} plik(i/ów) ze Schowka nie może zostać przeniesionych. Czy chcesz przenieść pozostałe?", "The files in the Clipboard are not removable." => "Nie można usunąć plików ze Schowka.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} plik(i/ów) ze Schowka nie może zostać usunięty(ch). Czy usunąć pozostałe?", "The selected files are not removable." => "Wybrane pliki nie mogą zostać usunięte.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} wybrany(ch) plików nie może zostać usunięte. Czy usunąć pozostałe?", "Are you sure you want to delete all selected files?" => "Czy jesteś pewien że, chcesz usunąć wszystkie wybrane pliki?", "Failed to delete {count} files/folders." => "Nie udało się usunąć {count} plik(i/ów) / folder(u/ów).", "A file or folder with that name already exists." => "Plik lub katalog o tej nazwie już istnieje.", "Inexistant or inaccessible folder." => "Nieistniejący lub niedostępny folder.", "selected files" => "wybrane pliki", "Type" => "Typ", "Select Thumbnails" => "Wybierz miniatury", "Download files" => "Pobierz pliki", ); ?>
0x6a
trunk/libraries/kcfinder/lang/pl.php
PHP
asf20
7,583
<?php /** Turkish localization file for KCFinder * translation by: Kursad Olmez <kursad.olmez@gmail.com> **/ $lang = array( '_locale' => "en_US.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e.%B.%Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d/%m/%Y %H:%M", "You don't have permissions to upload files." => "Dosya yüklemek için yetkiniz yok.", "You don't have permissions to browse server." => "Sunucuyu gezmek için yetkiniz yok.", "Cannot move uploaded file to target folder." => "Yüklenilen dosyalar hedef klasöre taşınamıyor.", "Unknown error." => "Bilinmeyen hata.", "The uploaded file exceeds {size} bytes." => "Gönderilen dosya boyutu, maksimum dosya boyutu limitini ({size} byte) aşıyor.", "The uploaded file was only partially uploaded." => "Dosyanın sadece bir kısmı yüklendi. Yüklemeyi tekrar deneyin.", "No file was uploaded." => "Dosya yüklenmedi.", "Missing a temporary folder." => "Geçici dosya klasörü bulunamıyor. Klasörü kontrol edin.", "Failed to write file." => "Dosya yazılamıyor. Klasör yetkilerini kontrol edin.", "Denied file extension." => "Yasaklanmış dosya türü.", "Unknown image format/encoding." => "Bilinmeyen resim formatı.", "The image is too big and/or cannot be resized." => "Resim çok büyük ve/veya yeniden boyutlandırılamıyor.", "Cannot create {dir} folder." => "{dir} klasörü oluşturulamıyor.", "Cannot write to upload folder." => "Dosya yükleme klasörüne yazılamıyor. Klasör yetkisini kontrol edin.", "Cannot read .htaccess" => ".htaccess dosyası okunamıyor", "Incorrect .htaccess file. Cannot rewrite it!" => "Hatalı .htaccess dosyası. Dosyaya yeniden yazılamıyor.", "Cannot read upload folder." => "Dosya yükleme klasörü okunamıyor. Klasör yetkilerini kontrol edin.", "Cannot access or create thumbnails folder." => "Önizleme dosyaları klasörüne erişilemiyor yada oluşturulamıyor.", "Cannot access or write to upload folder." => "Dosya yükleme klasörüne ulaşılamıyor yada oluşturulamıyor.", "Please enter new folder name." => "Lütfen yeni klasör adını girin.", "Unallowable characters in folder name." => "Klasör adında izin verilmeyen karakter kullandınız.", "Folder name shouldn't begins with '.'" => "Klasör adı '.' ile başlayamaz.", "Please enter new file name." => "Lütfen yeni dosya adını girin.", "Unallowable characters in file name." => "Dosya adında izin verilmeyen karakter kullandınız.", "File name shouldn't begins with '.'" => "Dosya adı '.' ile başlayamaz.", "Are you sure you want to delete this file?" => "Dosyayı silmek istediğinizden emin misiniz?", "Are you sure you want to delete this folder and all its content?" => "Bu klasörü ve tüm içeriğini silmek istediğinizden emin misiniz?", "Inexistant or inaccessible folder." => "Klasör yok yada ulaşılamıyor.", "Undefined MIME types." => "Tanımsız MIME türü.", "Fileinfo PECL extension is missing." => "Dosya Bilgisi PECL uzantısı eksik.", "Opening fileinfo database failed." => "Dosya Bilgisi veritabanı açılırken hata oluştu.", "You can't upload such files." => "Bu tür dosyaları yükleyemezsiniz.", "The file '{file}' does not exist." => "'{file}' dosyası yok.", "Cannot read '{file}'." => "'{file}' dosyası okunamıyor.", "Cannot copy '{file}'." => "'{file}' dosyası kopyalanamıyor.", "Cannot move '{file}'." => "'{file}' dosyası taşınamıyor.", "Cannot delete '{file}'." => "'{file}' dosyası silinemiyor.", "Click to remove from the Clipboard" => "Panodan çıkarmak için tıklayın", "This file is already added to the Clipboard." => "Bu dosya zaten panoya eklenmiş.", "Copy files here" => "Dosyaları Buraya Kopyala", "Move files here" => "Dosyaları Buraya Taşı", "Delete files" => "Dosyaları Sil", "Clear the Clipboard" => "Panoyu Temizle", "Are you sure you want to delete all files in the Clipboard?" => "Panodaki tüm dosyaları silmek istediğinizden emin misiniz?", "Copy {count} files" => "{count} adet dosyayı kopyala", "Move {count} files" => "{count} adet dosyayı taşı", "Add to Clipboard" => "Panoya Ekle", "New folder name:" => "Yeni Klasör Adı:", "New file name:" => "Yeni Dosya Adı:", "Upload" => "Yükle", "Refresh" => "Yenile", "Settings" => "Ayarlar", "Maximize" => "Pencereyi Büyüt", "About" => "Hakkında", "files" => "dosya", "View:" => "Görüntüleme:", "Show:" => "Göster:", "Order by:" => "Sıralama:", "Thumbnails" => "Önizleme", "List" => "Liste", "Name" => "Ad", "Size" => "Boyut", "Date" => "Tarih", "Descending" => "Azalarak", "Uploading file..." => "Dosya Gönderiliyor...", "Loading image..." => "Resim Yükleniyor...", "Loading folders..." => "Klasörler Yükleniyor...", "Loading files..." => "Dosyalar Yükleniyor...", "New Subfolder..." => "Yeni Alt Klasör...", "Rename..." => "İsim Değiştir...", "Delete" => "Sil", "OK" => "Tamam", "Cancel" => "İptal", "Select" => "Seç", "Select Thumbnail" => "Önizleme Resmini Seç", "View" => "Göster", "Download" => "İndir", "Clipboard" => "Pano", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Klasör adı değiştirilemiyor.", "Non-existing directory type." => "Geçersiz klasör türü.", "Cannot delete the folder." => "Klasör silinemiyor.", "The files in the Clipboard are not readable." => "Panodaki dosyalar okunamıyor.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "Panodaki {count} adet dosya okunamıyor. Geri kalanlarını kopyalamak istiyor musunuz?", "The files in the Clipboard are not movable." => "Panodaki dosyalar taşınamıyor.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "Panodaki {count} adet dosya taşınamıyor. Geri kalanlarını taşımak istiyor musunuz?", "The files in the Clipboard are not removable." => "Dosyalar panodan çıkartılamıyor.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} adet dosya panodan çıkartılamıyor. Geri kalanları silmek istiyor musunuz?", "The selected files are not removable." => "Seçilen dosyalar panodan çıkartılamıyor.", "{count} selected files are not removable. Do you want to delete the rest?" => "Seçilen dosyaların {count} adedi panodan çıkartılamıyor. Geri kalanları silmek istiyor musunuz?", "Are you sure you want to delete all selected files?" => "Seçilen tüm dosyaları silmek istediğinizden emin misiniz?", "Failed to delete {count} files/folders." => "{count} adet dosya/klasör silinemedi.", "A file or folder with that name already exists." => "Bu isimde bir klasör yada dosya zaten var.", "selected files" => "dosya seçildi", "Type" => "Tür", "Select Thumbnails" => "Önizleme Resimlerini Seç", "Download files" => "Dosyaları İndir", // SINCE 2.4 "Checking for new version..." => "Yeni versiyon kontrol ediliyor...", "Unable to connect!" => "Bağlantı yapılamıyor!", "Download version {version} now!" => " {version} versiyonunu hemen indir!", "KCFinder is up to date!" => "KCFinder güncel durumda!", "Licenses:" => "Lisanslar:", "Attention" => "Dikkat", "Question" => "Soru", "Yes" => "Evet", "No" => "Hayır", // SINCE 2.41 "You cannot rename the extension of files!" => "Dosya uzantılarını değiştiremezsiniz!", ); ?>
0x6a
trunk/libraries/kcfinder/lang/tr.php
PHP
asf20
8,156
<?php /** Catalan localization file for KCFinder * author: Xevi Fuster * country: Catalunya */ $lang = array( '_locale' => "ca_ES.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "No té permissos per pujar arxius.", "You don't have permissions to browse server." => "No té permissos per visualitzar arxius.", "Cannot move uploaded file to target folder." => "No es pot moure el fitxer pujat al directori destí", "Unknown error." => "Error desconegut.", "The uploaded file exceeds {size} bytes." => "La mida del fitxer excedeix la mida màxima de pujada ( {size} bytes ).", "The uploaded file was only partially uploaded." => "El fitxer només ha estat carregat parcialment.", "No file was uploaded." => "Cap arxiu carregat", "Missing a temporary folder." => "Directori Temporal perdut.", "Failed to write file." => "Error en escriure el fitxer.", "Denied file extension." => "Extensió de fitxer no permesa.", "Unknown image format/encoding." => "Format d'imatge desconegut.", "The image is too big and/or cannot be resized." => "La imatge és massa gran i/o no es pot redimensionar.", "Cannot create {dir} folder." => "No s'ha pogut crear el directori {dir}", "Cannot write to upload folder." => "No es pot escriure al directori de càrrega de fitxers.", "Cannot read .htaccess" => "No s'ha pogut llegir .htaccess.", "Incorrect .htaccess file. Cannot rewrite it!" => "Fitxer .htaccess incorrecte. No s'el pot reescriure!", "Cannot read upload folder." => "No s'ha pogut llegir la carpeta de càrrega de fitxers.", "Cannot access or create thumbnails folder." => "No s'ha pogut llegir o crear la carpeta de miniatures.", "Cannot access or write to upload folder." => "No s'ha pogut llegir o escriure la carpeta de càrrega de fitxers.", "Please enter new folder name." => "Si us plau, entri el nom del nou directori.", "Unallowable characters in folder name." => "Caràcters no permesos en el nom d'una carpeta.", "Folder name shouldn't begins with '.'" => "El nom d'un directori no hauria de començar amb punt '.'", "Please enter new file name." => "Si us plau, introdueixi un nou nom pel fitxer ", "Unallowable characters in file name." => "Caràcters no permesos en un nom de fitxer.", "File name shouldn't begins with '.'" => "El nom de fitxer no hauria de començar amb punt '.'", "Are you sure you want to delete this file?" => "Està segur que vol suprimir aquest fitxer?", "Are you sure you want to delete this folder and all its content?" => "Està segur que vol suprimir aquest directori i el seu contingut?", "Inexistant or inaccessible folder." => "Carpeta inexistent o inaccessible.", "Undefined MIME types." => "Tipus MIME no definit.", "Fileinfo PECL extension is missing." => "Fitxer PECL amb estructura incorrecta.", "Opening fileinfo database failed." => "Error obrint el fitxer d'informació de la base de dades.", "You can't upload such files." => "No pot carregar tants fitxers.", "The file '{file}' does not exist." => "El fitxer '{file}' no existeix.", "Cannot read '{file}'." => "No s'ha pogut llegir '{file}'.", "Cannot copy '{file}'." => "No s'ha pogut copiar '{file}'.", "Cannot move '{file}'." => "No s&#39;ha pogut moure '{file}'.", "Cannot delete '{file}'." => "No s'ha pogut esborrar '{file}'.", "Click to remove from the Clipboard" => "Faci click per esborrar del portapapers", "This file is already added to the Clipboard." => "Aquest arxiu ja havia estat afegit al portapapers.", "Copy files here" => "Copiar fitxers aquí", "Move files here" => "Moure fitxers aquí", "Delete files" => "Esborrar fitxers", "Clear the Clipboard" => "Buidar el portapapers", "Are you sure you want to delete all files in the Clipboard?" => "Està convençut que vol esborrar tots els fitxers del portapapers?", "Copy {count} files" => "Copiar {count} fitxers", "Move {count} files" => "Moure {count} fitxers ", "Add to Clipboard" => "Afegir al portapapers", "New folder name:" => "Nou nom del directori:", "New file name:" => "Nou nom del fitxer:", "Upload" => "Carregar", "Refresh" => "Refrescar", "Settings" => "Preferències", "Maximize" => "Maximitzar", "About" => "En quant a...", "files" => "Fitxers", "View:" => "Veure:", "Show:" => "Mostrar:", "Order by:" => "Ordenar per:", "Thumbnails" => "Miniatures", "List" => "Llista", "Name" => "Nom", "Size" => "Mida", "Date" => "Data", "Descending" => "Descendent", "Uploading file..." => "Carregant fitxer...", "Loading image..." => "Carregant imatge...", "Loading folders..." => "Carregant directoris...", "Loading files..." => "Carregant fitxers...", "New Subfolder..." => "Nou subdirectori...", "Rename..." => "Canviar el nom...", "Delete" => "Eliminar", "OK" => "OK", "Cancel" => "Cancel.lar", "Select" => "Seleccionar", "Select Thumbnail" => "Seleccionar miniatura", "View" => "Veure", "Download" => "Descarregar", "Clipboard" => "Portapapers", // VERSION 2 NEW LABELS "Cannot rename the folder." => "No es pot canviar el nom del directori.", "Non-existing directory type." => "Tipus de directori inexistent.", "Cannot delete the folder." => "No es pot esborrar el directori.", "The files in the Clipboard are not readable." => "Els fitxers del portapapers són illegibles.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} fitxers no es poden llegir. Vol copiar la resta?", "The files in the Clipboard are not movable." => "Els fitxers del portapapers no es poden moure.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} fitxers del portapapers no es poden moure. Vol moure la resta?", "The files in the Clipboard are not removable." => "Els fitxers del portapapers no es poden eliminar.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} fitxers del portapapers no poden ser eliminats. Vol eliminar la resta?", "The selected files are not removable." => "Els fitxers seleccionats no poden ser esborrats.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} fitxers dels seleccionats no poden ser esborrats. Vol esborrar la resta?", "Are you sure you want to delete all selected files?" => "Està segur que vol eliminar els fitxers seleccionats?", "Failed to delete {count} files/folders." => "Error en esborrar {count} fitxers/directoris.", "A file or folder with that name already exists." => "Ja existeix un directori o un fitxer amb aquest nom.", "selected files" => "Fitxers seleccionats", "Type" => "Tipus", "Select Thumbnails" => "Seleccionar miniatures", "Download files" => "Descarregar fitxers", ); ?>
0x6a
trunk/libraries/kcfinder/lang/ca.php
PHP
asf20
7,573
<?php /** Hungarian localization file for KCFinder * Dubravszky József <joe@chilicreative.hu> */ $lang = array( '_locale' => "hu_HU.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e.%B.%Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d/%m/%Y %H:%M", "You don't have permissions to upload files." => "Nincs jogosultsága fájlokat feltölteni.", "You don't have permissions to browse server." => "Nincs jogosultsága a kiszolgálón böngészni.", "Cannot move uploaded file to target folder." => "Nem lehet áthelyezni a feltöltött fájlt a célkönyvtárba.", "Unknown error." => "Ismeretlen hiba.", "The uploaded file exceeds {size} bytes." => "A feltöltött fájl mérete meghaladja a {size} bájtot.", "The uploaded file was only partially uploaded." => "A feltöltendő fájl csak részben sikerült feltölteni.", "No file was uploaded." => "Nem történt fájlfeltöltés.", "Missing a temporary folder." => "Hiányzik az ideiglenes könyvtár.", "Failed to write file." => "Nem sikerült a fájl írása.", "Denied file extension." => "Tiltott fájlkiterjesztés.", "Unknown image format/encoding." => "Ismeretlen képformátum vagy kódolás.", "The image is too big and/or cannot be resized." => "A kép mérete túl nagy és/vagy nem lehet átméretezni.", "Cannot create {dir} folder." => "Nem lehet létrehozni a {dir} könyvtárat.", "Cannot rename the folder." => "A könyvtárat nem lehet átnevezni.", "Cannot write to upload folder." => "Nem lehet írni a feltöltési könyvtárba.", "Cannot read .htaccess" => "Nem lehet olvasni a .htaccess fájlt", "Incorrect .htaccess file. Cannot rewrite it!" => "Hibás .htaccess fájl. Nem lehet írni.", "Cannot read upload folder." => "Nem lehet olvasni a feltöltési könyvtárat.", "Cannot access or create thumbnails folder." => "Nem lehet elérni vagy létrehozni a bélyegképek könyvtárat.", "Cannot access or write to upload folder." => "Nem lehet elérni vagy létrehozni a feltöltési könyvtárat.", "Please enter new folder name." => "Kérem, adja meg az új könyvtár nevét.", "Unallowable characters in folder name." => "Meg nem engedett karakter(ek) a könyvtár nevében.", "Folder name shouldn't begins with '.'" => "Könyvtárnév nem kezdődhet '.'-tal", "Please enter new file name." => "Kérem adja meg az új fájl nevét.", "Unallowable characters in file name." => "Meg nem engedett karakter(ek) a fájl nevében.", "File name shouldn't begins with '.'" => "Fájlnév nem kezdődhet '.'-tal", "Are you sure you want to delete this file?" => "Biztos benne, hogy törölni kívánja ezt a fájlt?", "Are you sure you want to delete this folder and all its content?" => "Biztos benne hogy törölni kívánja ezt a könyvtárat és minden tartalmát?", "Non-existing directory type." => "Nem létező könyvtártípus.", "Undefined MIME types." => "Meghatározatlan MIME típusok.", "Fileinfo PECL extension is missing." => "Hiányzó PECL Fileinfo PHP kiegészítés.", "Opening fileinfo database failed." => "Nem sikerült megnyitni a Fileinfo adatbázist.", "You can't upload such files." => "Nem tölthet fel ilyen fájlokat.", "The file '{file}' does not exist." => "A '{file}' fájl nem létezik.", "Cannot read '{file}'." => "A '{file}' fájlt nem lehet olvasni.", "Cannot copy '{file}'." => "A '{file}' fájlt nem lehet másolni.", "Cannot move '{file}'." => "A '{file}' fájlt nem lehet áthelyezni.", "Cannot delete '{file}'." => "A '{file}' fájlt nem lehet törölni.", "Cannot delete the folder." => "Nem lehet törölni a könyvtárat.", "Click to remove from the Clipboard" => "kattintson ide, hogy eltávolítsa a vágólapról", "This file is already added to the Clipboard." => "Ezt a fájlt már hozzáadta a vágólaphoz.", "The files in the Clipboard are not readable." => "A vágólapon lévő fájlok nem olvashatók.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} fájl a vágólapon nem olvasható. Akarja másolni a többit?", "The files in the Clipboard are not movable." => "A vágólapon lévő fájlokat nem lehet áthelyezni.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} fájlt a vágólapon nem lehet áthelyezni. Akarja áthelyezni a többit?", "The files in the Clipboard are not removable." => "A vágólapon lévő fájlokat nem lehet eltávolítani.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} fájlt a vágólapon nem lehet eltávolítani. Akarja törölni a többit?", "The selected files are not removable." => "A kiválasztott fájlokat nem lehet eltávolítani.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} kiválasztott fájlt nem lehet eltávolítani. Akarja törölni a többit?", "Are you sure you want to delete all selected files?" => "Biztosan törölni kíván minden kijelölt fájlt?", "Failed to delete {count} files/folders." => "Nem sikerült törölni {count} fájlt.", "A file or folder with that name already exists." => "Egy fájl vagy könyvtár már létezik ugyan ezzel a névvel.", "Copy files here" => "Fájlok másolása ide", "Move files here" => "Fájlok áthelyezése ide", "Delete files" => "Fájlok törlése", "Clear the Clipboard" => "Vágólap ürítése", "Are you sure you want to delete all files in the Clipboard?" => "Biztosan törölni kívánja a vágólapon lévő összes fájlt?", "Copy {count} files" => "{count} fájl másolása", "Move {count} files" => "{count} fájl áthelyezése", "Add to Clipboard" => "Hozzáadás vágólaphoz", "Inexistant or inaccessible folder." => "Nem létező vagy elérhetetlen könyvtár.", "New folder name:" => "Új könyvtár neve:", "New file name:" => "Új fájl neve:", "Upload" => "Feltöltés", "Refresh" => "Frissítés", "Settings" => "Beállítások", "Maximize" => "Maximalizálás", "About" => "Névjegy", "files" => "fájlok", "selected files" => "kiválasztott fájlok", "View:" => "Nézet:", "Show:" => "Mutat:", "Order by:" => "Rendezés:", "Thumbnails" => "Bélyegképek", "List" => "Lista", "Name" => "Név", "Type" => "Típus", "Size" => "Méret", "Date" => "Datum", "Descending" => "Csökkenő", "Uploading file..." => "Fájl feltöltése...", "Loading image..." => "Képek betöltése...", "Loading folders..." => "Könyvtárak betöltése...", "Loading files..." => "Fájlok betöltése...", "New Subfolder..." => "Új alkönyvtár...", "Rename..." => "Átnevezés...", "Delete" => "Törlés", "OK" => "OK", "Cancel" => "Mégse", "Select" => "Kiválaszt", "Select Thumbnail" => "Bélyegkép kiválasztása", "Select Thumbnails" => "Bélyegképek kiválasztása", "View" => "Nézet", "Download" => "Letöltés", "Download files" => "Fájlok letöltése", "Clipboard" => "Vágólap", "Checking for new version..." => "Új verzió keresése ...", "Unable to connect!" => "Nem lehet csatlakozni!", "Download version {version} now!" => "Töltse le a {version} verziót most!", "KCFinder is up to date!" => "Ez a KCFinder verzió a legfrissebb", "Licenses:" => "Licenszek:", "Attention" => "Figyelem", "Question" => "Kérdés", "Yes" => "Igen", "No" => "Nem", "You cannot rename the extension of files!" => "Nem változtathatja meg a fájlok kiterjezstését", ); ?>
0x6a
trunk/libraries/kcfinder/lang/hu.php
PHP
asf20
7,905
<?php /** German localization file for KCFinder * author: Tim Wahrendorff <wahrendorff@users.sourceforge.net> */ $lang = array( '_locale' => "de_DE.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e.%B.%Y %I:%M %p", '_dateTimeMid' => "%a %e %b %Y %I:%M %p", '_dateTimeSmall' => "%d/%m/%Y %I:%M %p", "You don't have permissions to upload files." => "Du hast keine Berechtigung Dateien hoch zu laden.", "You don't have permissions to browse server." => "Fehlende Berechtigung.", "Cannot move uploaded file to target folder." => "Kann hochgeladene Datei nicht in den Zielordner verschieben.", "Unknown error." => "Unbekannter Fehler.", "The uploaded file exceeds {size} bytes." => "Die hochgeladene Datei überschreitet die erlaubte Dateigröße von {size} bytes.", "The uploaded file was only partially uploaded." => "Die Datei wurde nur teilweise hochgeladen.", "No file was uploaded." => "Keine Datei hochgeladen.", "Missing a temporary folder." => "Temporärer Ordner fehlt.", "Failed to write file." => "Fehler beim schreiben der Datei.", "Denied file extension." => "Die Dateiendung ist nicht erlaubt.", "Unknown image format/encoding." => "Unbekanntes Bildformat/encoding.", "The image is too big and/or cannot be resized." => "Das Bild ist zu groß und/oder kann nicht verkleinert werden.", "Cannot create {dir} folder." => "Ordner {dir} kann nicht angelegt werden.", "Cannot write to upload folder." => "Kann nicht in den upload Ordner schreiben.", "Cannot read .htaccess" => "Kann .htaccess Datei nicht lesen", "Incorrect .htaccess file. Cannot rewrite it!" => "Falsche .htaccess Datei. Die Datei kann nicht geschrieben werden", "Cannot read upload folder." => "Upload Ordner kann nicht gelesen werden.", "Cannot access or create thumbnails folder." => "Kann thumbnails Ordner nicht erstellen oder darauf zugreifen.", "Cannot access or write to upload folder." => "Kann nicht auf den upload Ordner zugreifen oder darin schreiben.", "Please enter new folder name." => "Bitte einen neuen Ordnernamen angeben.", "Unallowable characters in folder name." => "Der Ordnername enthält unerlaubte Zeichen.", "Folder name shouldn't begins with '.'" => "Ordnernamen sollten nicht mit '.' beginnen.", "Please enter new file name." => "Bitte gib einen neuen Dateinamen an.", "Unallowable characters in file name." => "Der Dateiname enthält unerlaubte Zeichen", "File name shouldn't begins with '.'" => "Dateinamen sollten nicht mit '.' beginnen.", "Are you sure you want to delete this file?" => "Willst Du die Datei wirklich löschen?", "Are you sure you want to delete this folder and all its content?" => "Willst Du wirklich diesen Ordner und seinen gesamten Inhalt löschen?", "Inexistant or inaccessible folder." => "Ordnertyp existiert nicht.", "Undefined MIME types." => "Unbekannte MIME Typen.", "Fileinfo PECL extension is missing." => "PECL extension für Dateiinformationen fehlt", "Opening fileinfo database failed." => "Öffnen der Dateiinfo Datenbank fehlgeschlagen.", "You can't upload such files." => "Du kannst solche Dateien nicht hochladen.", "The file '{file}' does not exist." => "Die Datei '{file}' existiert nicht.", "Cannot read '{file}'." => "Kann Datei '{file}' nicht lesen.", "Cannot copy '{file}'." => "Kann Datei '{file}' nicht kopieren.", "Cannot move '{file}'." => "Kann Datei '{file}' nicht verschieben.", "Cannot delete '{file}'." => "Kann Datei '{file}' nicht löschen.", "Click to remove from the Clipboard" => "Zum entfernen aus der Zwischenablage, hier klicken.", "This file is already added to the Clipboard." => "Diese Datei wurde bereits der Zwischenablage hinzugefügt.", "Copy files here" => "Kopiere Dateien hier hin.", "Move files here" => "Verschiebe Dateien hier hin.", "Delete files" => "Lösche Dateien.", "Clear the Clipboard" => "Zwischenablage leeren", "Are you sure you want to delete all files in the Clipboard?" => "Willst Du wirklich alle Dateien in der Zwischenablage löschen?", "Copy {count} files" => "Kopiere {count} Dateien", "Move {count} files" => "Verschiebe {count} Dateien", "Add to Clipboard" => "Der Zwischenablage hinzufügen", "New folder name:" => "Neuer Ordnername:", "New file name:" => "Neuer Dateiname:", "Upload" => "Hochladen", "Refresh" => "Aktualisieren", "Settings" => "Einstellungen", "Maximize" => "Maximieren", "About" => "Über", "files" => "Dateien", "View:" => "Ansicht:", "Show:" => "Zeige:", "Order by:" => "Ordnen nach:", "Thumbnails" => "Miniaturansicht", "List" => "Liste", "Name" => "Name", "Size" => "Größe", "Date" => "Datum", "Descending" => "Absteigend", "Uploading file..." => "Lade Datei hoch...", "Loading image..." => "Lade Bild...", "Loading folders..." => "Lade Ordner...", "Loading files..." => "Lade Dateien...", "New Subfolder..." => "Neuer Unterordner...", "Rename..." => "Umbenennen...", "Delete" => "Löschen", "OK" => "OK", "Cancel" => "Abbruch", "Select" => "Auswählen", "Select Thumbnail" => "Wähle Miniaturansicht", "View" => "Ansicht", "Download" => "Download", 'Clipboard' => "Zwischenablage", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Der Ordner kann nicht umbenannt werden.", "Non-existing directory type." => "Der Ordner Typ existiert nicht.", "Cannot delete the folder." => "Der Ordner kann nicht gelöscht werden.", "The files in the Clipboard are not readable." => "Die Dateien in der Zwischenablage können nicht gelesen werden.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} Dateien in der Zwischenablage sind nicht lesbar. Möchtest Du die Übrigen trotzdem kopieren?", "The files in the Clipboard are not movable." => "Die Dateien in der Zwischenablage können nicht verschoben werden.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} Dateien in der Zwischenablage sind nicht verschiebbar. Möchtest Du die Übrigen trotzdem verschieben?", "The files in the Clipboard are not removable." => "Die Dateien in der Zwischenablage können nicht gelöscht werden.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} Dateien in der Zwischenablage können nicht gelöscht werden. Möchtest Du die Übrigen trotzdem löschen?", "The selected files are not removable." => "Die ausgewählten Dateien können nicht gelöscht werden.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} der ausgewählten Dateien können nicht gelöscht werden. Möchtest Du die Übrigen trotzdem löschen?", "Are you sure you want to delete all selected files?" => "Möchtest Du wirklich alle ausgewählten Dateien löschen?", "Failed to delete {count} files/folders." => "Konnte {count} Dateien/Ordner nicht löschen.", "A file or folder with that name already exists." => "Eine Datei oder ein Ordner mit dem Namen existiert bereits.", "selected files" => "ausgewählte Dateien", "Type" => "Typ", "Select Thumbnails" => "Wähle Miniaturansicht", "Download files" => "Dateien herunterladen", ); ?>
0x6a
trunk/libraries/kcfinder/lang/de.php
PHP
asf20
7,846
<?php /** Danish translation by Thomas Schou <thomas@schouweb.dk> **/ $lang = array( '_locale' => "da_DK.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e.%B.%Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d/%m/%Y %H:%M", "You don't have permissions to upload files." => "Du har ikke tilladelser til at uploade filer.", "You don't have permissions to browse server." => "Du har ikke tilladelser til at se filer.", "Cannot move uploaded file to target folder." => "Kan ikke flytte fil til destinations mappe.", "Unknown error." => "Ukendt fejl.", "The uploaded file exceeds {size} bytes." => "Den uploadede fil overskrider {size} bytes.", "The uploaded file was only partially uploaded." => "Den uploadede fil blev kun delvist uploadet.", "No file was uploaded." => "Ingen fil blev uploadet.", "Missing a temporary folder." => "Mangler en midlertidig mappe.", "Failed to write file." => "Kunne ikke skrive fil.", "Denied file extension." => "N�gtet filtypenavn.", "Unknown image format/encoding." => "Ukendt billedformat / kodning.", "The image is too big and/or cannot be resized." => "Billedet er for stort og / eller kan ikke �ndres.", "Cannot create {dir} folder." => "Kan ikke lave mappen {dir}.", "Cannot write to upload folder." => "Kan ikke skrive til upload mappen.", "Cannot read .htaccess" => "Ikke kan l�se .htaccess", "Incorrect .htaccess file. Cannot rewrite it!" => "Forkert .htaccess fil. Kan ikke omskrive den!", "Cannot read upload folder." => "Kan ikke l�se upload mappen.", "Cannot access or create thumbnails folder." => "Kan ikke f� adgang til eller oprette miniature mappe.", "Cannot access or write to upload folder." => "Kan ikke f� adgang til eller skrive til upload mappe.", "Please enter new folder name." => "Indtast venligst nyt mappe navn.", "Unallowable characters in folder name." => "Ugyldige tegn i mappens navn.", "Folder name shouldn't begins with '.'" => "Mappenavn b�r ikke begynder med '.'", "Please enter new file name." => "Indtast venligst nyt fil navn.", "Unallowable characters in file name." => "Ugyldige tegn i filens navn", "File name shouldn't begins with '.'" => "Fil navnet b�r ikke begynder med '.'", "Are you sure you want to delete this file?" => "Er du sikker p� du vil slette denne fil?", "Are you sure you want to delete this folder and all its content?" => "Er du sikker p� du vil slette denne mappe og al dens indhold?", "Inexistant or inaccessible folder." => "utilg�ngelige mappe.", "Undefined MIME types." => "Udefineret MIME Type.", "Fileinfo PECL extension is missing." => "Fil info PECL udvidelse mangler", "Opening fileinfo database failed." => "�bning af fil info-database mislykkedes.", "You can't upload such files." => "Du kan ikke uploade s�danne filer.", "The file '{file}' does not exist." => "Filen '{file}' eksisterer ikke.", "Cannot read '{file}'." => "Kan ikke l�se '{file}'.", "Cannot copy '{file}'." => "Kan ikke kopi'ere '{file}'.", "Cannot move '{file}'." => "Kan ikke flytte '{file}'.", "Cannot delete '{file}'." => "Kan ikke slette '{file}'.", "Click to remove from the Clipboard" => "Klik for at fjerne fra Udklipsholder.", "This file is already added to the Clipboard." => "Denne fil er allerede f�jet til Udklipsholder.", "Copy files here" => "Kopiere filer her.", "Move files here" => "Flyt filer her.", "Delete files" => "Slet filer.", "Clear the Clipboard" => "Zwischenablage leeren", "Are you sure you want to delete all files in the Clipboard?" => "T�m udklipsholder?", "Copy {count} files" => "Kopier {count} filer", "Move {count} files" => "Flyt {count} filer", "Add to Clipboard" => "Tilf�j til udklipsholder", "New folder name:" => "Nyt mappe navn:", "New file name:" => "Nyt fil navn:", "Upload" => "Upload", "Refresh" => "Genopfriske", "Settings" => "Indstillinger", "Maximize" => "Maksimere", "About" => "Om", "files" => "filer", "View:" => "Vis:", "Show:" => "Vis:", "Order by:" => "Sorter efter:", "Thumbnails" => "Miniaturer", "List" => "Liste", "Name" => "Navn", "Size" => "St�rrelse", "Date" => "Dato", "Descending" => "Faldende", "Uploading file..." => "Uploader fil...", "Loading image..." => "Indl�ser billede...", "Loading folders..." => "Indl�ser mappe...", "Loading files..." => "Indl�ser filer...", "New Subfolder..." => "Ny undermappe...", "Rename..." => "Omd�b...", "Delete" => "Slet", "OK" => "Ok", "Cancel" => "Fortryd", "Select" => "V�lg", "Select Thumbnail" => "V�lg miniature", "View" => "Vis", "Download" => "Download", 'Clipboard' => "Udklipsholder", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Kan ikke omd�be mappen.", "Non-existing directory type." => "Ikke-eksisterende bibliotek type.", "Cannot delete the folder." => "Kan ikke slette mappen.", "The files in the Clipboard are not readable." => "Filerne i udklipsholder ikke kan l�ses.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} filer i udklipsholder ikke kan l�ses. �nsker du at kopiere de �vrige?", "The files in the Clipboard are not movable." => "Filerne i udklipsholder kan ikke flyttes.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} filer i udklipsholder er ikke bev�gelige. �nsker du at flytte resten?", "The files in the Clipboard are not removable." => "Filerne i udklipsholder er ikke flytbare.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} filer i udklipsholder er ikke flytbare. �nsker du at slette resten?", "The selected files are not removable." => "De valgte filer er ikke flytbare.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} valgte filer som ikke kan fjernes. �nsker du at slette resten?", "Are you sure you want to delete all selected files?" => "Er du sikker p� du vil slette alle markerede filer?", "Failed to delete {count} files/folders." => "Kunne ikke slette {count} filer / mapper.", "A file or folder with that name already exists." => "En fil eller mappe med det navn findes allerede.", "selected files" => "Valgte filer", "Type" => "Type", "Select Thumbnails" => "V�lg Miniaturer", "Download files" => "Download filer", ); ?>
0x6a
trunk/libraries/kcfinder/lang/da.php
PHP
asf20
7,101
<?php /** Italian localization file for KCFinder * author: Ivano Raffeca */ $lang = array( '_locale' => "it_IT.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "Non hai il permesso di caricare files.", "You don't have permissions to browse server." => "Non hai il permesso di elencare i files.", "Cannot move uploaded file to target folder." => "Non puoi spostare il file caricato nella cartella di destinazione", "Unknown error." => "Errore sconosciuto.", "The uploaded file exceeds {size} bytes." => "Il file caricato eccede {size} bytes.", "The uploaded file was only partially uploaded." => "Il file è stato caricato parzialmente.", "No file was uploaded." => "Nessun file è stato caricato", "Missing a temporary folder." => "Cartella temporanea non trovata.", "Failed to write file." => "Fallita la scrittura del file.", "Denied file extension." => "Estensione del file non consentita.", "Unknown image format/encoding." => "Sconosciuto format/encoding immagine.", "The image is too big and/or cannot be resized." => "Immagine troppo grande e/o non può essere rimpicciolita", "Cannot create {dir} folder." => "La cartella {dir} non può essere creata.", "Cannot write to upload folder." => "Cartella di destinazione protetta in scrittura.", "Cannot read .htaccess" => "Impossibile leggere il file .htaccess.", "Incorrect .htaccess file. Cannot rewrite it!" => "Il file .htaccess è corrotto. Impossibile riscriverlo!", "Cannot read upload folder." => "Impossibile leggere il contenuto della cartella di destinazione.", "Cannot access or create thumbnails folder." => "Impossibile creare o accedere alla cartella delle miniature.", "Cannot access or write to upload folder." => "Impossibile accedere o scrivere nella cartella di destinazione.", "Please enter new folder name." => "Scrivi il nome della nuova cartella.", "Unallowable characters in folder name." => "Caratteri non permessi nel nome della cartella.", "Folder name shouldn't begins with '.'" => "Il nome della cartella non può iniziare con'.'", "Please enter new file name." => "Inserisci il nuovo nome del file", "Unallowable characters in file name." => "Caratteri non permessi nel nome del file.", "File name shouldn't begins with '.'" => "Il nome del file non può iniziare con '.'", "Are you sure you want to delete this file?" => "Sei sicuro che vuoi cancellare questo file?", "Are you sure you want to delete this folder and all its content?" => "Sei sicuro di voler cancellare questa cartella e il suo contenuto?", "Inexistant or inaccessible folder." => "Tipo di cartella non esistente.", "Undefined MIME types." => "Tipo MIME non definito.", "Fileinfo PECL extension is missing." => "Manca estensione PECL del file.", "Opening fileinfo database failed." => "Apertura del database delle informazioni del file fallita.", "You can't upload such files." => "Non è possibile caricare questi files.", "The file '{file}' does not exist." => "Il file '{file}' non esiste.", "Cannot read '{file}'." => "Impossibile leggere il file '{file}'.", "Cannot copy '{file}'." => "Impossibile copiare il file '{file}'.", "Cannot move '{file}'." => "Impossibile spostare il file '{file}'.", "Cannot delete '{file}'." => "Impossibile cancellare il file '{file}'.", "Click to remove from the Clipboard" => "Click per rimuoverlo dalla Clipboard", "This file is already added to the Clipboard." => "Questo file è già aggiunto alla Clipboard.", "Copy files here" => "Copia i files qui", "Move files here" => "Sposta i files qui", "Delete files" => "Cancella i files", "Clear the Clipboard" => "Pulisci la Clipboard", "Are you sure you want to delete all files in the Clipboard?" => "Sei sicuro che vuoi cancellare tutti i files dalla Clipboard?", "Copy {count} files" => "Copio {count} files", "Move {count} files" => "Sposto {count} files", "Add to Clipboard" => "Aggiungi alla Clipboard", "New folder name:" => "Nuovo nome della cartella:", "New file name:" => "Nuovo nome del file:", "Upload" => "Carica", "Refresh" => "Aggiorna", "Settings" => "Preferenze", "Maximize" => "Massimizza", "About" => "Chi siamo", "files" => "files", "View:" => "Vista:", "Show:" => "Mostra:", "Order by:" => "Ordina per:", "Thumbnails" => "Miniature", "List" => "Lista", "Name" => "Nome", "Size" => "Grandezza", "Date" => "Data", "Descending" => "Discendente", "Uploading file..." => "Carico file...", "Loading image..." => "Caricamento immagine...", "Loading folders..." => "Caricamento cartella...", "Loading files..." => "caricamento files...", "New Subfolder..." => "Nuova sottocartella...", "Rename..." => "Rinomina...", "Delete" => "Elimina", "OK" => "OK", "Cancel" => "Cancella", "Select" => "Seleziona", "Select Thumbnail" => "Seleziona miniatura", "View" => "Vista", "Download" => "Scarica", "Clipboard" => "Clipboard", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Non è possibile rinominare la cartella.", "Non-existing directory type." => "Il tipo di cartella non esiste.", "Cannot delete the folder." => "Non è possibile cancellare la cartella.", "The files in the Clipboard are not readable." => "I files nella clipboard non sono leggibili.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} files nella clipboard non sono leggibili. Copiare il resto?", "The files in the Clipboard are not movable." => "I files nella clipboard non sono spoastabili.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} files nella clipboard non sono spoastabili. Spostare il resto?", "The files in the Clipboard are not removable." => "files nella clipboard non si possono rimuovere.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} files nella clipboard non si possono rimuovere. Cancellare il resto?", "The selected files are not removable." => "Il file selezionato non è rimovibile.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} i files selezionati non sono rimovibili. Cancellare il resto?", "Are you sure you want to delete all selected files?" => "Sei sicuro che vuoi cancellare tutti i files selezionati?", "Failed to delete {count} files/folders." => "Cancellazione fallita {count} files/cartelle.", "A file or folder with that name already exists." => "Un file o cartella con questo nome già esiste.", "selected files" => "files selezionati", "Type" => "Tipo", "Select Thumbnails" => "Seleziona miniature", "Download files" => "Scarica files", // SINCE 2.34 "Checking for new version..." => "Controllo nuova versione...", "Unable to connect!" => "Connessione impossibile", "Download version {version} now!" => "Prelevo la versione {version} adesso!", "KCFinder is up to date!" => "KCFinder è aggiornato!", "Licenses:" => "Licenze: ", "Attention" => "Attensione", "Question" => "Domanda", "Yes" => "Si", "No" => "No", ); ?>
0x6a
trunk/libraries/kcfinder/lang/it.php
PHP
asf20
7,917
<?php /** Bulgarian localization file for KCFinder * author: Pavel Tzonkov <pavelc@users.sourceforge.net> */ $lang = array( '_locale' => "bg_BG.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "Нямате права за качване.", "You don't have permissions to browse server." => "Нямате права за разглеждане на сървъра.", "Cannot move uploaded file to target folder." => "Файлът не може да се премести в целевата папка.", "Unknown error." => "Непозната грешка.", "The uploaded file exceeds {size} bytes." => "Каченият файл надхвърля {size} байта.", "The uploaded file was only partially uploaded." => "Каченият файл беше качен само частично.", "No file was uploaded." => "Файлът не беше качен", "Missing a temporary folder." => "Липсва временна папка.", "Failed to write file." => "Грешка при записване на файла.", "Denied file extension." => "Забранено файлово разширение.", "Unknown image format/encoding." => "Файлът не може да бъде разпознат като изображение.", "The image is too big and/or cannot be resized." => "Изображението е много голямо и/или не може да бъде преоразмерено.", "Cannot create {dir} folder." => "Невъзможност да се създаде папка {dir}.", "Cannot rename the folder." => "Папката не може да се преимеува.", "Cannot write to upload folder." => "Не е възможно записването на файлове в папката за качване.", "Cannot read .htaccess" => "Не е възможно прочитането на .htaccess", "Incorrect .htaccess file. Cannot rewrite it!" => "Невалиден .htaccess файл. Не може да се презапише автоматично!", "Cannot read upload folder." => "Не е възможно прочитането на папката за качване.", "Cannot access or create thumbnails folder." => "Невъзможен достъп или невъзможно създаване на папката за thumbnails.", "Cannot access or write to upload folder." => "Папката не може да се достъпи или не може да се записва в нея.", "Please enter new folder name." => "Моля въведете име на папката.", "Unallowable characters in folder name." => "Непозволени знаци в името на папката.", "Folder name shouldn't begins with '.'" => "Името на папката не трябва да започва с '.'", "Please enter new file name." => "Моля въведете ново име на файла", "Unallowable characters in file name." => "Непозволени знаци в името на файла.", "File name shouldn't begins with '.'" => "Името на файла не трябва да започва с '.'", "Are you sure you want to delete this file?" => "Наистина ли искате да изтриете този файл?", "Are you sure you want to delete this folder and all its content?" => "Наистина ли искате да изтриете тази папка и цялото й съдържание?", "Non-existing directory type." => "Несъществуващ специален тип на папка.", "Undefined MIME types." => "Не са дефинирани MIME типове.", "Fileinfo PECL extension is missing." => "Липсва Fileinfo PECL разширение.", "Opening fileinfo database failed." => "Грешка при отваряне на fileinfo дефиниции.", "You can't upload such files." => "Не можете да качвате такива файлове.", "The file '{file}' does not exist." => "Фаълът '{file}' не съществува.", "Cannot read '{file}'." => "Файлът '{file}' не може да бъде прочетен.", "Cannot copy '{file}'." => "Файлът '{file}' не може да бъде копиран.", "Cannot move '{file}'." => "Файлът '{file}' не може да бъде преместен.", "Cannot delete '{file}'." => "Файлът '{file}' не може да бъде изтрит.", "Cannot delete the folder." => "Папката не може да бъде изтрита.", "Click to remove from the Clipboard" => "Цъкнете за да премахнете файла от клипборда", "This file is already added to the Clipboard." => "Този файл вече е добавен към клипборда.", "The files in the Clipboard are not readable." => "Файловете в клипборда не могат да се прочетат.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} файла в клипборда не могат да се прочетат. Искате ли да копирате останалите?", "The files in the Clipboard are not movable." => "Файловете в клипборда не могат да бъдат преместени.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} файла в клипборда не могат да бъдат преместени. Искате ли да преместите останалите?", "The files in the Clipboard are not removable." => "Файловете в клипборда не могат да бъдат изтрити.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} файла в клипборда не могат да бъдат изтрити. Искате ли да изтриете останалите?", "The selected files are not removable." => "Избраните файлове не могат да бъдат изтрити.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} от избраните файлове не могат да бъдат изтрити. Искате ли да изтриете останалите?", "Are you sure you want to delete all selected files?" => "Наистина ли искате да изтриете всички избрани файлове?", "Failed to delete {count} files/folders." => "{count} файла/папки не могат да бъдат изтрити.", "A file or folder with that name already exists." => "Вече има файл или папка с такова име.", "Copy files here" => "Копирай файловете тук", "Move files here" => "Премести файловете тук", "Delete files" => "Изтрий файловете", "Clear the Clipboard" => "Изчисти клипборда", "Are you sure you want to delete all files in the Clipboard?" => "Наистина ли искате да изтриете всички файлове от клипборда?", "Copy {count} files" => "Копирай {count} файла", "Move {count} files" => "Премести {count} файла", "Add to Clipboard" => "Добави към клипборда", "Inexistant or inaccessible folder." => "Несъществуваща или недостъпна папка.", "New folder name:" => "Име на папката:", "New file name:" => "Ново име на файла:", "Upload" => "Качи", "Refresh" => "Актуализирай", "Settings" => "Настройки", "Maximize" => "Разпъни", "About" => "Информация", "files" => "файла", "selected files" => "избрани файла", "View:" => "Изглед:", "Show:" => "Покажи:", "Order by:" => "Подреди по:", "Thumbnails" => "Картинки", "List" => "Списък", "Name" => "Име", "Type" => "Тип", "Size" => "Размер", "Date" => "Дата", "Descending" => "Обратен ред", "Uploading file..." => "Файлът се качва...", "Loading image..." => "Изображението се зарежда...", "Loading folders..." => "Зареждане на папките...", "Loading files..." => "Зареждане на папката...", "New Subfolder..." => "Нова подпапка...", "Rename..." => "Преименуване...", "Delete" => "Изтрий", "OK" => "OK", "Cancel" => "Отказ", "Select" => "Избери", "Select Thumbnail" => "Избери малък вариант", "Select Thumbnails" => "Избери малки варианти", "View" => "Преглед", "Download" => "Свали", "Download files" => "Свали файловете", "Clipboard" => "Клипборд", // SINCE 2.4 "Checking for new version..." => "Проверка за нова версия...", "Unable to connect!" => "Не може да се свърже!", "Download version {version} now!" => "Свалете версия {version} сега!", "KCFinder is up to date!" => "KCFinder е актуален!", "Licenses:" => "Лицензи:", "Attention" => "Внимание", "Question" => "Въпрос", "Yes" => "Да", "No" => "Не", // SINCE 2.41 "You cannot rename the extension of files!" => "Не можете да преименувате разширенията на файловете!", // SINCE 2.5 "Uploading file {number} of {count}... {progress}" => "Качване на файл {number} от {count}... {progress}", "Failed to upload {filename}!" => "Несполучливо качване на {filename}!", ); ?>
0x6a
trunk/libraries/kcfinder/lang/bg.php
PHP
asf20
10,709
<?php /** This file is part of KCFinder project * * @desc Persian(Farsi) localization file * @package KCFinder * @version 2.2 * @author Hamid Kamalpour <djhamidfatal@gmail.com><http://www.ssfmusic.com> * @copyright 2010 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ $lang = array( '_locale' => "fa_IR.UTF-8", '_charset' => "utf-8", // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %B %e, %Y %H:%M", '_dateTimeMid' => "%a %b %e %Y %H:%M", '_dateTimeSmall' => "%Y/%m/%d %H:%M", "You don't have permissions to upload files." => ".شما فاقد مجوز برای ارسال فایل ها هستید", "You don't have permissions to browse server." => ".شما فاقد مجوز برای جستجو در سرور هستید", "Cannot move uploaded file to target folder." => ".برنامه نمی تواند فایل بارگذاری شده را انتقال دهد به پوشه مورد نظر", "Unknown error." => ".خطای نامشخص", "The uploaded file exceeds {size} bytes." => ".بایت است {size} حجم فایل بارگذاری شده بیشتر از", "The uploaded file was only partially uploaded." => ".فایل ناقص بارگذاری شد", "No file was uploaded." => ".فایل ارسال نشد", "Missing a temporary folder." => ".پوشه تمپ پیدا نشد", "Failed to write file." => ".خطا در نوشتن فایل", "Denied file extension." => ".پسوند فایل غیر مجاز است", "Unknown image format/encoding." => ".عکس معتبر نیست format/encoding", "The image is too big and/or cannot be resized." => ".عکس انتخابی یا بزرگ است یا تغییر اندازه داده نمی شود", "Cannot create {dir} folder." => ".{dir}مشکل در ساخت پوشه", "Cannot write to upload folder." => ".مشکل در نوشتن اطلاعات در پوشه بارگذاری", "Cannot read .htaccess" => ".htaccess خطا در خواندن فایل", "Incorrect .htaccess file. Cannot rewrite it!" => ".غیرقابل بازنویسی است .htaccess فایل", "Cannot read upload folder." => ".مشکل در خواندن پوشه بارگذاری", "Cannot access or create thumbnails folder." => ".مشکل در دسترسی یا ساخت پوشه تام", "Cannot access or write to upload folder." => ".مشکل در دسترسی برای نوشتن اطلاعات در پوشه بارگذاری", "Please enter new folder name." => ".لطفا نام پوشه جدید را وارد کنید", "Unallowable characters in folder name." => ".نام پوشه دارای حروف غیر مجاز است", "Folder name shouldn't begins with '.'" => ".نام پوشه نباید با '.' شروع شود", "Please enter new file name." => ".لطفا نام فایل جدید را وارد کنید", "Unallowable characters in file name." => ".نام فایل دارای حروف غیر مجاز است", "File name shouldn't begins with '.'" => ".نام فایل نباید با '.' شروع شود", "Are you sure you want to delete this file?" => "آیا از حذف این فایل اطمینان دارید؟", "Are you sure you want to delete this folder and all its content?" => "آیا از حذف این پوشه و تمام محتویات داخل آن اطمینان دارید؟", "Inexistant or inaccessible folder." => "Tipo di cartella non esistente.", "Undefined MIME types." => ".تعریف نشده اند MIME پسوند های ", "Fileinfo PECL extension is missing." => "Manca estensione PECL del file.", "Opening fileinfo database failed." => ".خطا در بازکردن بانک اطلاعاتی مشخصات فایل", "You can't upload such files." => ".شما امکان بارگذاری این فایل ها را ندارید", "The file '{file}' does not exist." => ".موجود نیست '{file}' فایل", "Cannot read '{file}'." => ".'{file}' مشکل در خواندن", "Cannot copy '{file}'." => ".'{file}' نمی توانید کپی کنید", "Cannot move '{file}'." => ".'{file}' نمی توانید انتقال دهید", "Cannot delete '{file}'." => ".'{file}'نمی توانید حذف کنید", "Click to remove from the Clipboard" => ".برای حذف از کلیپ برد کلیک کنید", "This file is already added to the Clipboard." => ".این فایل قبلا در حافظه کلیپ برد افزوده شده است", "Copy files here" => "کپی فایل ها به اینجا", "Move files here" => "انتقال فایل ها به اینجا", "Delete files" => "حذف فایل ها", "Clear the Clipboard" => "پاک کردن حافظه کلیپ برد", "Are you sure you want to delete all files in the Clipboard?" => "آیا از حذف فایل های موجود در کلیپ برد اطمینان دارید؟", "Copy {count} files" => "...تعداد {count} فایل آماده کپی به", "Move {count} files" => "...تعداد {count} فایل آماده انتقال به", "Add to Clipboard" => "افزودن در کلیپ برد", "New folder name:" => "نام پوشه جدید:", "New file name:" => "نام فایل جدید:", "Upload" => "ارسال فايل", "Refresh" => "بارگذاری مجدد", "Settings" => "تنظيمات", "Maximize" => "تمام صفحه", "About" => "درباره", "files" => "فايل ها", "View:" => ": نمایش", "Show:" => ": نمايش", "Order by:" => ": مرتب کردن بر مبناي", "Thumbnails" => "نمايش کوچک عکسها", "List" => "ليست", "Name" => "نام", "Size" => "حجم", "Date" => "تاريخ", "Type" => "پسوند", "Descending" => "نزولي", "Uploading file..." => "... درحال ارسال فایل", "Loading image..." => "... درحال بارگذاری عکس", "Loading folders..." => "... درحال بارگذاری پوشه ها", "Loading files..." => "... درحال بارگذاری فایل ها", "New Subfolder..." => "...ساخت زیرپوشه جدید", "Rename..." => "... تغییر نام", "Delete" => "حذف", "OK" => "ادامه", "Cancel" => "انصراف", "Select" => "انتخاب", "Select Thumbnail" => "انتخاب عکس با اندازه کوچک", "View" => "نمایش", "Download" => "دریافت فایل", "Clipboard" => "حافضه کلیپ برد", // VERSION 2 NEW LABELS "Cannot rename the folder." => ".نام وارد شده تکراری است. پوشه ای با این نام وجود دارد. لطفا نام جدیدی انتخاب کنید", "Non-existing directory type." => ".نوع فهرست وجود ندارد", "Cannot delete the folder." => ".نمی توانید این پوشه را حذف کنید", "The files in the Clipboard are not readable." => ".فایل های موجود در کلیپ برد قابل خواندن نیستند", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "تعداد {count} فایل موجود در کلیپ برد قابل خواندن نیستند. آیا مایلید بقیه فایل ها کپی شوند؟", "The files in the Clipboard are not movable." => ".فایل های موجود در کلیپ برد غیر قابل انتقال هستند. لطفا دسترسی فایل ها را چک کنید", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "تعداد {count} فایل از فایل های موجود در کلیپ برد غیر قابل انتقال هستند. آیا مایلید بقیه فایل ها منتقل شوند؟", "The files in the Clipboard are not removable." => ".فایل های موجود در کلیپ برد قابل پاک شدن نیستند. دسترسی فایل ها را چک کنید", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "تعداد {count} فایل از فایل های موجود در کلیپ برد غیر قابل حذف هستند. آیا مایلید بقیه فایل ها حذف شوند؟", "The selected files are not removable." => ".فایل های انتخاب شده قابل برداشتن نیست", "{count} selected files are not removable. Do you want to delete the rest?" => "تعداد {count} فایل از فایل های انتخابی غیر قابل حذف هستند.آیا مایلید بقیه فایل ها حذف شوند؟", "Are you sure you want to delete all selected files?" => "آیا از حذف تمام فایل های انتخابی اطمینان دارید؟", "Failed to delete {count} files/folders." => ".فایل/پوشه {count} خطا در پاک کردن", "A file or folder with that name already exists." => ".یک پوشه یا فایل با این نام وجود دارد.لطفا نام دیگری انتخاب کنید", "selected files" => "فایل های انتخاب شده", "Select Thumbnails" => "انتخاب عکس های کوچک", "Download files" => "دریافت فایل ها", // SINCE 2.4 "Checking for new version..." => "...وجود نسخه جدید را بررسی کن", "Unable to connect!" => "!مشکل در برقراری ارتباط", "Download version {version} now!" => "!را دانلود کن {version} همسین حالا نسخه ", "KCFinder is up to date!" => "!بروز است KCFinder", "Licenses:" => "مجوز", "Attention" => "توجه", "Question" => "پرسش", "Yes" => "بله", "No" => "خیر", // SINCE 2.41 "You cannot rename the extension of files!" => "!شما نمی توانید پسوند فایلها را تغییر دهید", ); ?>
0x6a
trunk/libraries/kcfinder/lang/fa.php
PHP
asf20
10,460
<?php /** Norwegian localization file for KCFinder * author: Robin Helgesen (robin@konsept-it.no) * country: Norway */ $lang = array( '_locale' => "nb_NO.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "Du har ikke tilgang til å laste opp filer", "You don't have permissions to browse server." => "Du har ikke tilgang til å bla igjennom server", "Cannot move uploaded file to target folder." => "Kan ikke flytte fil til denne mappen", "Unknown error." => "Ukjent feil.", "The uploaded file exceeds {size} bytes." => "Filen er for stor.", "The uploaded file was only partially uploaded." => "Opplastning delvis fullført.", "No file was uploaded." => "Ingen filer lastet opp", "Missing a temporary folder." => "Mangler midlertidig mappe.", "Failed to write file." => "Feil ved skriving til fil.", "Denied file extension." => "Feil filformat", "Unknown image format/encoding." => "Ukjent bildeformat.", "The image is too big and/or cannot be resized." => "Bildet er for stort eller kan ikke skaleres ned.", "Cannot create {dir} folder." => "Kan ikke opprette mappe.", "Cannot write to upload folder." => "Ingen tilgang til å skrive til denne mappen.", "Cannot read .htaccess" => "Kan ikke lese .htaccess.", "Incorrect .htaccess file. Cannot rewrite it!" => "Feil! Kan ikke skrive til denne filen", "Cannot read upload folder." => "Kan ikke lese denne mappen.", "Cannot access or create thumbnails folder." => "Ikke tilgang til mappen for miniatyrbilder", "Cannot access or write to upload folder." => "Ikke tilgang til opplastningsmappe.", "Please enter new folder name." => "Skriv inn nytt navn til denne mappen.", "Unallowable characters in folder name." => "Ulovlige tegn i mappenavn.", "Folder name shouldn't begins with '.'" => "Mappenavnet kan ikke begynne med '.'", "Please enter new file name." => "Skriv inn nytt filnavn ", "Unallowable characters in file name." => "Ulovlige tegn i filnavn.", "File name shouldn't begins with '.'" => "Filnavn kan ikke starte med '.'", "Are you sure you want to delete this file?" => "Er du sikker på at du vil slette denne filen?", "Are you sure you want to delete this folder and all its content?" => "Er du sikker på at du vil slette denne mappen og innholdet i den?", "Inexistant or inaccessible folder." => "Kan ikke lese mappe.", "Undefined MIME types." => "Undefined MIME types.", "Fileinfo PECL extension is missing." => "Fileinfo PECL extension is missing.", "Opening fileinfo database failed." => "Opening fileinfo database failed", "You can't upload such files." => "Du kan ikke laste opp denne typen filer", "The file '{file}' does not exist." => "Filen '{file}' finnes ikke.", "Cannot read '{file}'." => "Kan ikke lese '{file}'.", "Cannot copy '{file}'." => "Kan ikke kopiere '{file}'.", "Cannot move '{file}'." => "Kan ikke flytte '{file}'.", "Cannot delete '{file}'." => "Kan ikke slette '{file}'.", "Click to remove from the Clipboard" => "Klikk for å fjerne fra utklippstavle", "This file is already added to the Clipboard." => "Filen finnes allerede på utklippstavlen", "Copy files here" => "Kopier filene til ;", "Move files here" => "Flytt filene til ;", "Delete files" => "Slett filer", "Clear the Clipboard" => "Tøm utklippstavle", "Are you sure you want to delete all files in the Clipboard?" => "Er du sikker på at du vil slette alle filene i utklippstavlen?", "Copy {count} files" => "Kopier {count} filer", "Move {count} files" => "Flytt {count} filer ", "Add to Clipboard" => "Legg til i utklippstavle", "New folder name:" => "Nytt mappenavn:", "New file name:" => "Nytt filnavn:", "Upload" => "Last opp", "Refresh" => "Oppdater", "Settings" => "Innstillinger", "Maximize" => "Maksimer", "About" => "Om/Hjelp", "files" => "filer", "View:" => "Vis:", "Show:" => "Vis:", "Order by:" => "Sorter etter:", "Thumbnails" => "Miniatyrbilder", "List" => "Liste", "Name" => "Navn", "Size" => "Størrelse", "Date" => "Dato", "Descending" => "Synkende", "Uploading file..." => "Laster opp fil...", "Loading image..." => "Laster bilde...", "Loading folders..." => "Laster mapper...", "Loading files..." => "Laster filer...", "New Subfolder..." => "Ny undermappe...", "Rename..." => "Endre navn...", "Delete" => "Slett", "OK" => "OK", "Cancel" => "Avbryt", "Select" => "Velg", "Select Thumbnail" => "Velg miniatyrbilde", "View" => "Vis", "Download" => "Last ned", "Clipboard" => "Utklippstavle", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Kan ikke endre navnet på mappen.", "Non-existing directory type." => "Denne finnes ikke.", "Cannot delete the folder." => "Kan ikke slette mappe.", "The files in the Clipboard are not readable." => "Kan ikke lese filene i utklippstavlen.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} filer i utklippstavlen kan ikke leses, ønsker du kopiere resten av filene?", "The files in the Clipboard are not movable." => "Filene i utklippstavlen kan ikke flyttes", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} filer i utklippstavlen kan ikke flyttes, ønsker du å flytte resten?", "The files in the Clipboard are not removable." => "Filene i utklippstavlen kan ikke flyttes.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} filer i utklippstavlen kan ikke flyttes, ønsker du å flytte resten?", "The selected files are not removable." => "Merkede filer kan ikke flyttes.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} filer kan ikke flyttes, ønsker du å flytte resten?", "Are you sure you want to delete all selected files?" => "Er du sikker på at du ønsker å slette alle merkede filer?", "Failed to delete {count} files/folders." => "Feil ved sletting av {count} filer/mapper.", "A file or folder with that name already exists." => "En fil eller mappe finnes allerede med dette navnet", "selected files" => "merkede filer", "Type" => "Type", "Select Thumbnails" => "Velg miniatyrbilde", "Download files" => "Last ned filer", ); ?>
0x6a
trunk/libraries/kcfinder/lang/no.php
PHP
asf20
7,044
<?php /** Slovak localization file for KCFinder * author: drejk1 <drejk@inmail.sk> */ $lang = array( '_locale' => "sk_SK.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e.%B.%Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "Nemáte právo nahrávať súbory.", "You don't have permissions to browse server." => "Nemáte právo prehliadať súbory na servery.", "Cannot move uploaded file to target folder." => "Nie je možné presunúť súbor do yvoleného adresára.", "Unknown error." => "Neznáma chyba.", "The uploaded file exceeds {size} bytes." => "Nahratý súbor presahuje {size} bytov.", "The uploaded file was only partially uploaded." => "Nahratý súbor bol nahraný len čiastočne.", "No file was uploaded." => "Žiadný súbor alebol nahraný na server.", "Missing a temporary folder." => "Chyba dočasný adresár.", "Failed to write file." => "Súbor se nepodarilo se uložiť.", "Denied file extension." => "Nepodporovaný typ súboru.", "Unknown image format/encoding." => "Neznamý formát obrázku/encoding.", "The image is too big and/or cannot be resized." => "Obrázok je príliš veľký/alebo nemohol byť zmenšený.", "Cannot create {dir} folder." => "Adresár {dir} nie je možné vytvoriť.", "Cannot write to upload folder." => "Nie je možné ukladať do adresáru pre nahrávánie.", "Cannot read .htaccess" => "Nie je možné čítať súbor .htaccess", "Incorrect .htaccess file. Cannot rewrite it!" => "Chybný súbor .htaccess. Súbor nemožno prepísať!", "Cannot read upload folder." => "Nie je možné čítať z adresáru pre nahrávánie súborov.", "Cannot access or create thumbnails folder." => "Adresár pre náhľady nie je možné vytvoriť alebo nie je prístupný.", "Cannot access or write to upload folder." => "Nie je možné pristupova alebo zapisovať do adresáru pre nahrávanie súborov.", "Please enter new folder name." => "Zadajte prosím nové meno adresáru.", "Unallowable characters in folder name." => "Nepovolené znaky v názve adresáru.", "Folder name shouldn't begins with '.'" => "Meno adresára nesmie začínať znakom '.'", "Please enter new file name." => "Vložte prosím nové meno súboru.", "Unallowable characters in file name." => "Nepovolené znaky v názve súboru.", "File name shouldn't begins with '.'" => "Názov súboru nesmie začínať znakom '.'", "Are you sure you want to delete this file?" => "Ste si istý že chcete vymazať tento súbor?", "Are you sure you want to delete this folder and all its content?" => "Ste si istý že chcete vymazať tento adresár a celý jeho obsah?", "Inexistant or inaccessible folder." => "Neexistujúci alebo neprístupný adresár.", "Undefined MIME types." => "Nedefinovaný MIME typ súboru.", "Fileinfo PECL extension is missing." => "Rozšírenie PECL pre zistenie informácií o súbore chýba.", "Opening fileinfo database failed." => "Načítanie informácií o súbore zlyhalo.", "You can't upload such files." => "Tieto súbory nemôžete nahrať na server.", "The file '{file}' does not exist." => "Tento súbor '{file}' neexistuje.", "Cannot read '{file}'." => "Nie je možné načítať '{file}'.", "Cannot copy '{file}'." => "Nie je možné kopírovať '{file}'.", "Cannot move '{file}'." => "Nie je možné presunúť '{file}'.", "Cannot delete '{file}'." => "Nie je možné vymazať '{file}'.", "Click to remove from the Clipboard" => "Kliknite pre odstránenie zo schránky", "This file is already added to the Clipboard." => "Tento súbor je už v schránke uložený.", "Copy files here" => "Kopírovať súbory na toto miesto", "Move files here" => "Presunúť súbory na toto miesto", "Delete files" => "Zmazať súbory", "Clear the Clipboard" => "Vyčistiť schránku", "Are you sure you want to delete all files in the Clipboard?" => "Ste si istý že chcete vymazať všetky súbory zo schránky?", "Copy {count} files" => "Kopírovať {count} súborov", "Move {count} files" => "Presunúť {count} súborov", "Add to Clipboard" => "Vložiť do schránky", "New folder name:" => "Nový názov adresára:", "New file name:" => "Nový názov súboru:", "Upload" => "Nahrať", "Refresh" => "Obnoviť", "Settings" => "Nastavenia", "Maximize" => "Maxializovať", "About" => "O aplikácii", "files" => "súbory", "View:" => "Zobraziť:", "Show:" => "Ukázať:", "Order by:" => "Zoradiť podľa:", "Thumbnails" => "Náhľady", "List" => "Zoznam", "Name" => "Meno", "Size" => "Veľkosť", "Date" => "Dátum", "Descending" => "Zostupne", "Uploading file..." => "Nahrávanie súborov...", "Loading image..." => "Načítanie obrázkov...", "Loading folders..." => "Načítanie adresárov...", "Loading files..." => "Načítanie súborov...", "New Subfolder..." => "Nový adresár...", "Rename..." => "Premenovať...", "Delete" => "Zmazať", "OK" => "OK", "Cancel" => "Zrušit", "Select" => "Vybrať", "Select Thumbnail" => "Vybrať náhľad", "View" => "Zobraziť", "Download" => "Stahnuť", 'Clipboard' => "Schránka", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Adresár nie je možné premenovať.", "Non-existing directory type." => "Neexistujúci typ adresára.", "Cannot delete the folder." => "Adresár nie je možné vymazať.", "The files in the Clipboard are not readable." => "Súbory v schránke nie je možné načítať.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} súborov v schránke nie je možné načítať. Chcete skopírovať ostatné súbory?", "The files in the Clipboard are not movable." => "Súbory v schránke nie je možné presunúť.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} súborov v schránke nie je možné presunúť. Chcete presunúť ostatné súbory?", "The files in the Clipboard are not removable." => "Súbory v schránke nie je možné vymazať.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} súborov v schránke nie je možné vymazať. Chcete vymazať ostatné súbory?", "The selected files are not removable." => "Označené súbory nie je možné vymazať.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} označených súborov nie je možné vymazať. Chcete vymazať ostatné súbory?", "Are you sure you want to delete all selected files?" => "Ste si istý že chcete vymazať vybrané súbory?", "Failed to delete {count} files/folders." => "Nebolo vymazaných {count} súborov/adresárov.", "A file or folder with that name already exists." => "Soubor alebo adresár s takovým menom už existuje.", "selected files" => "vybrané súbory", "Type" => "Typ", "Select Thumbnails" => "Vybrať náhľad", "Download files" => "Stiahnuť súbory", ); ?>
0x6a
trunk/libraries/kcfinder/lang/sk.php
PHP
asf20
7,705
<?php /** Russian localization file for KCFinder * author: Dark Preacher * E-mail: dark@darklab.ru */ $lang = array( '_locale' => "ru_RU.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "У вас нет прав для загрузки файлов.", "You don't have permissions to browse server." => "У вас нет прав для просмотра содержимого на сервере.", "Cannot move uploaded file to target folder." => "Невозможно переместить загруженный файл в папку назначения.", "Unknown error." => "Неизвестная ошибка.", "The uploaded file exceeds {size} bytes." => "Загруженный файл превышает размер {size} байт.", "The uploaded file was only partially uploaded." => "Загруженный файл был загружен только частично.", "No file was uploaded." => "Файл не был загружен", "Missing a temporary folder." => "Временная папка не существует.", "Failed to write file." => "Невозможно записать файл.", "Denied file extension." => "Файлы этого типа запрещены для загрузки.", "Unknown image format/encoding." => "Неизвестный формат изображения.", "The image is too big and/or cannot be resized." => "Изображение слишком большое и/или не может быть уменьшено.", "Cannot create {dir} folder." => "Невозможно создать папку {dir}.", "Cannot write to upload folder." => "Невозможно записать в папку загрузки.", "Cannot read .htaccess" => "Невозможно прочитать файл .htaccess", "Incorrect .htaccess file. Cannot rewrite it!" => "Неправильный файл .htaccess. Невозможно перезаписать!", "Cannot read upload folder." => "Невозможно прочитать папку загрузки.", "Cannot access or create thumbnails folder." => "Нет доступа или невозможно создать папку миниатюр.", "Cannot access or write to upload folder." => "Нет доступа или невозможно записать в папку загрузки.", "Please enter new folder name." => "Укажите имя новой папки.", "Unallowable characters in folder name." => "Недопустимые символы в имени папки.", "Folder name shouldn't begins with '.'" => "Имя папки не может начинаться с '.'", "Please enter new file name." => "Укажите новое имя файла", "Unallowable characters in file name." => "Недопустимые символны в имени файла.", "File name shouldn't begins with '.'" => "Имя файла не может начинаться с '.'", "Are you sure you want to delete this file?" => "Вы уверены, что хотите удалить этот файл?", "Are you sure you want to delete this folder and all its content?" => "Вы уверены, что хотите удалить эту папку и всё её содержимое?", "Non-existing directory type." => "Несуществующий тип папки.", "Undefined MIME types." => "Неопределённые типы MIME.", "Fileinfo PECL extension is missing." => "Расширение Fileinfo PECL отсутствует.", "Opening fileinfo database failed." => "Невозможно открыть базу данных fileinfo.", "You can't upload such files." => "Вы не можете загружать файлы этого типа.", "The file '{file}' does not exist." => "Файл '{file}' не существует.", "Cannot read '{file}'." => "Невозможно прочитать файл '{file}'.", "Cannot copy '{file}'." => "Невозможно скопировать файл '{file}'.", "Cannot move '{file}'." => "Невозможно переместить файл '{file}'.", "Cannot delete '{file}'." => "Невозможно удалить файл '{file}'.", "Click to remove from the Clipboard" => "Нажмите для удаления из буфера обмена", "This file is already added to the Clipboard." => "Этот файл уже добавлен в буфер обмена.", "Copy files here" => "Скопировать файлы сюда", "Move files here" => "Переместить файлы сюда", "Delete files" => "Удалить файлы", "Clear the Clipboard" => "Очистить буфер обмена", "Are you sure you want to delete all files in the Clipboard?" => "Вы уверены, что хотите удалить все файлы в буфере обмена?", "Copy {count} files" => "Скопировать {count} файл(ов)", "Move {count} files" => "Переместить {count} файл(ов)", "Add to Clipboard" => "Добавить в буфер обмена", "New folder name:" => "Новое имя папки:", "New file name:" => "Новое имя файла:", "Upload" => "Загрузить", "Refresh" => "Обновить", "Settings" => "Установки", "Maximize" => "Развернуть", "About" => "О скрипте", "files" => "файлы", "View:" => "Просмотр:", "Show:" => "Показывать:", "Order by:" => "Упорядочить по:", "Thumbnails" => "Миниатюры", "List" => "Список", "Name" => "Имя", "Size" => "Размер", "Date" => "Дата", "Descending" => "По убыванию", "Uploading file..." => "Загрузка файла...", "Loading image..." => "Загрузка изображения...", "Loading folders..." => "Загрузка папок...", "Loading files..." => "Загрузка файлов...", "New Subfolder..." => "Создать папку...", "Rename..." => "Переименовать...", "Delete" => "Удалить", "OK" => "OK", "Cancel" => "Отмена", "Select" => "Выбрать", "Select Thumbnail" => "Выбрать миниатюру", "View" => "Просмотр", "Download" => "Скачать", 'Clipboard' => "Буфер обмена", // VERSION 2 NEW LABELS "Cannot rename the folder." => "Невозможно переименовать папку.", "Cannot delete the folder." => "Невозможно удалить папку.", "The files in the Clipboard are not readable." => "Невозможно прочитать файлы в буфере обмена.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "Невозможно прочитать {count} файл(ов) в буфере обмена. Вы хотите скопировать оставшиеся?", "The files in the Clipboard are not movable." => "Невозможно переместить файлы в буфере обмена.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "Невозможно переместить {count} файл(ов) в буфере обмена. Вы хотите переместить оставшиеся?", "The files in the Clipboard are not removable." => "Невозможно удалить файлы в буфере обмена.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "Невозможно удалить {count} файл(ов) в буфере обмена. Вы хотите удалить оставшиеся?", "The selected files are not removable." => "Невозможно удалить выбранные файлы.", "{count} selected files are not removable. Do you want to delete the rest?" => "Невозможно удалить выбранный(е) {count} файл(ы). Вы хотите удалить оставшиеся?", "Are you sure you want to delete all selected files?" => "Вы уверены, что хотите удалить все выбранные файлы?", "Failed to delete {count} files/folders." => "Невозможно удалить {count} файлов/папок.", "A file or folder with that name already exists." => "Файл или папка с таким именем уже существуют.", "Inexistant or inaccessible folder." => "Несуществующая или недоступная папка.", "selected files" => "выбранные файлы", "Type" => "Тип", "Select Thumbnails" => "Выбрать миниатюры", "Download files" => "Скачать файлы", // SINCE 2.4 "Checking for new version..." => "Проверяем наличие обновлений...", "Unable to connect!" => "Невозможно подключиться!", "Download version {version} now!" => "Скачать версию {version} сейчас!", "KCFinder is up to date!" => "Вы используете последнюю версию KCFinder'а!", "Licenses:" => "Лицензии:", "Attention" => "Внимание", "Question" => "Вопрос", "Yes" => "Да", "No" => "Нет", // SINCE 2.41 "You cannot rename the extension of files!" => "Вы не можете изменять расширения файлов!", ); ?>
0x6a
trunk/libraries/kcfinder/lang/ru.php
PHP
asf20
10,335
<?php /** Portugues Brasil localization file for KCFinder * author: Alexandre Benegas Ferreira * country: Brasil * company website: www.hostcataratas.com.br * e-mail: contato@hostcataratas.com.br */ $lang = array( '_locale' => "pt_BR.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "Voc&ecirc; n&atilde;o tem permiss&otilde;es para fazer upload de arquivos.", "You don't have permissions to browse server." => "Voc&ecirc; n&atilde;o tem permiss&otilde;es para procurar no servidor.", "Cannot move uploaded file to target folder." => "N&atilde;o &eacute; poss&iacutevel mover o arquivo enviado para a pasta de destino.", "Unknown error." => "Erro desconhecido.", "The uploaded file exceeds {size} bytes." => "O arquivo enviado excede {size} bytes.", "The uploaded file was only partially uploaded." => "O arquivo enviado foi apenas parcialmente carregado.", "No file was uploaded." => "Nenhum arquivo foi transferido.", "Missing a temporary folder." => "Faltando uma pasta tempor&aacute;ria.", "Failed to write file." => "Falha ao gravar arquivo.", "Denied file extension." => "Extens&atilde;o de arquivo n&atilde;o permitida.", "Unknown image format/encoding." => "Formato de imagem desconhecido/codifica&ccedil;&atilde;o.", "The image is too big and/or cannot be resized." => "A imagem &eacute; muito grande e/ou n&atilde;o pode ser redimensionada.", "Cannot create {dir} folder." => "N&atilde;o &eacute; poss&iacutevel criar pasta em '{dir}'.", "Cannot write to upload folder." => "N&atilde;o &eacute; poss&iacutevel salvar na pasta.", "Cannot read .htaccess" => "N&atilde;o &eacute; poss&iacutevel ler '.htaccess'.", "Incorrect .htaccess file. Cannot rewrite it!" => "Arquivo '.htaccess' incorreto. N&atilde;o &eacute; poss&iacutevel alterar.", "Cannot read upload folder." => "N&atilde;o &eacute; poss&iacutevel ler a pasta de upload.", "Cannot access or create thumbnails folder." => "N&atilde;o &eacute; poss&iacutevel acessar ou criar pasta de miniaturas.", "Cannot access or write to upload folder." => "N&atilde;o &eacute; poss&iacutevel acessar ou salvar para a pasta.", "Please enter new folder name." => "Por favor, digite o nome da nova pasta.", "Unallowable characters in folder name." => "Caracteres no nome da pasta n&atilde;o Autorizado.", "Folder name shouldn't begins with '.'" => "Nome da pasta n&atilde;o deve come&ccedil;ar com '.'.", "Please enter new file name." => "Por favor, digite o novo nome de arquivo.", "Unallowable characters in file name." => "Caracteres no nome do arquivo n&atilde;o Autorizado.", "File name shouldn't begins with '.'" => "O nome da pasta n&atilde;o deve come&ccedil;ar por '.'.", "Are you sure you want to delete this file?" => "Tem a certeza de que deseja excluir este arquivo?", "Are you sure you want to delete this folder and all its content?" => "Tem a certeza de que deseja excluir esta pasta e todo o seu conte�do?", "Inexistant or inaccessible folder." => "Pasta inacess&iacutevel ou inexistente.", "Undefined MIME types." => "Tipos MIME indefinidos.", "Fileinfo PECL extension is missing." => "Est&aacute; faltando Informa&ccedil;&otilde;es do arquivo extens&atilde;o PECL.", "Opening fileinfo database failed." => "Abrir banco de dados de fileinfo falhou.", "You can't upload such files." => "Voc&ecirc; n&atilde;o pode enviar esses arquivos.", "The file '{file}' does not exist." => "O arquivo '{file}' n&atilde;o existe.", "Cannot read '{file}'." => "N&atilde;o &eacute; poss&iacutevel ler '{file}'.", "Cannot copy '{file}'." => "N&atilde;o &eacute; poss&iacutevel copiar '{file}'.", "Cannot move '{file}'." => "N&atilde;o &eacute; poss&iacutevel mover '{file}'.", "Cannot delete '{file}'." => "N&atilde;o &eacute; poss&iacutevel deletar '{file}'.", "Click to remove from the Clipboard" => "Clique para remover da &aacute;rea de transfer&ecirc;ncia", "This file is already added to the Clipboard." => "Este arquivo j&aacute; foi adicionado &agrave; &aacute;rea de transfer&ecirc;ncia.", "Copy files here" => "Copiar arquivos aqui", "Move files here" => "Mover arquivos aqui", "Delete files" => "Deletar arquivos", "Clear the Clipboard" => "Limpar a &aacute;rea de transfer&ecirc;ncia", "Are you sure you want to delete all files in the Clipboard?" => "Tem a certeza de que deseja excluir todos os arquivos da &aacute;rea de transfer&ecirc;ncia?", "Copy {count} files" => "Copiar {count} arquivos", "Move {count} files" => "Mover {count} arquivos", "Add to Clipboard" => "Adicionar &agrave; &aacute;rea de transfer&ecirc;ncia", "New folder name:" => "Nome da nova pasta:", "New file name:" => "Novo nome do arquivo:", "Upload" => "Enviar arquivo", "Refresh" => "Atualizar", "Settings" => "Configura&ccedil;&otilde;es", "Maximize" => "Maximizar", "About" => "Sobre", "files" => "Arquivos", "View:" => "Exibir:", "Show:" => "Mostrar:", "Order by:" => "Ordenar por:", "Thumbnails" => "Miniaturas", "List" => "Lista", "Name" => "Nome", "Size" => "Tamanho", "Date" => "Data", "Descending" => "", "Uploading file..." => "Carregando arquivo...", "Loading image..." => "Carregando imagem...", "Loading folders..." => "Carregando pastas...", "Loading files..." => "Carregando arquivos...", "New Subfolder..." => "Nova subpasta...", "Rename..." => "Renomear...", "Delete" => "Excluir", "OK" => "OK", "Cancel" => "Cancelar", "Select" => "Selecionar", "Select Thumbnail" => "Selecionar miniatura", "View" => "Exibir", "Download" => "Download", "Clipboard" => "&aacute;rea de transfer&ecirc;ncia", // VERSION 2 NEW LABELS "Cannot rename the folder." => "N&atilde;o &eacute; poss&iacutevel renomear a pasta.", "Non-existing directory type." => "Tipo de diret&oacute;rio n&atilde;o existente.", "Cannot delete the folder." => "N&atilde;o &eacute; poss&iacutevel excluir a pasta.", "The files in the Clipboard are not readable." => "Os arquivos da &aacute;rea de transfer&ecirc;ncia n&atilde;o podem ser lidos.", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} arquivos da &aacute;rea de transfer&ecirc;ncia n&atilde;o podem ser lidos. Voc&ecirc; deseja copiar o resto?", "The files in the Clipboard are not movable." => "Os arquivos da &aacute;rea de transfer&ecirc;ncia n&atilde;o podem ser removidos.", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} arquivos da &aacute;rea de transfer&ecirc;ncia n&atilde;o podem ser movidos. Voc&ecirc; deseja mover o resto?", "The files in the Clipboard are not removable." => "Os arquivos da &aacute;rea de transfer&ecirc;ncia n&atilde;o podem ser removidos.", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} arquivos da &aacute;rea de transfer&ecirc;ncia n&atilde;o s&atilde;o remov&iacuteveis. Voc&ecirc; deseja excluir o restante?", "The selected files are not removable." => "Os arquivos selecionados n&atilde;o s&atilde;o remov&iacuteveis.", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} arquivos selecionados n&atilde;o s&atilde;o remov&iacuteveis. Voc&ecirc; deseja excluir o restante?", "Are you sure you want to delete all selected files?" => "Tem a certeza de que deseja excluir todos os arquivos selecionados?", "Failed to delete {count} files/folders." => "N&atilde;o conseguiu excluir {count} arquivos/pastas.", "A file or folder with that name already exists." => "J&aacute; existe um arquivo ou pasta com esse nome.", "selected files" => "arquivos selecionados", "Type" => "Tipo", "Select Thumbnails" => "Selecionar miniaturas", "Download files" => "Baixar arquivos", ); ?>
0x6a
trunk/libraries/kcfinder/lang/pt-br.php
PHP
asf20
8,575
<?php /** vi localization file for KCFinder * Tran Van Quyet - HQV ltd */ $lang = array( '_locale' => "vi_VN.UTF-8", // UNIX localization code '_charset' => "utf-8", // Browser charset // Date time formats. See http://www.php.net/manual/en/function.strftime.php '_dateTimeFull' => "%A, %e %B, %Y %H:%M", '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d.%m.%Y %H:%M", "You don't have permissions to upload files." => "Bạn không có quyền tải lên", "You don't have permissions to browse server." => "Bạn không có quyền truy cập", "Cannot move uploaded file to target folder." => "Không thể tải lên thư mục đích", "Unknown error." => "Lỗi không xác định", "The uploaded file exceeds {size} bytes." => "Tập tin tải lên lớn hơn {size}", "The uploaded file was only partially uploaded." => "Các tập tin chỉ được tải lên một phần", "No file was uploaded." => "Không có tập tin được tải lên", "Missing a temporary folder." => "Không thấy thư mục tạm", "Failed to write file." => "Không thể ghi", "Denied file extension." => "Phần mở rộng không được phép", "Unknown image format/encoding." => "Không biết định dạng ảnh/mã hóa này", "The image is too big and/or cannot be resized." => "Hình ảnh quá lơn/hoặc không thể thay đổi kích thước", "Cannot create {dir} folder." => "Không thể tạo thư mục {dir}", "Cannot rename the folder." => "Không thể đổi tên thư mục", "Cannot write to upload folder." => "Không thể ghi vào thư mục", "Cannot read .htaccess" => "Không thể đọc tập tin .htaccess", "Incorrect .htaccess file. Cannot rewrite it!" => "không thể ghi tập tin .htaccess", "Cannot read upload folder." => "Không thể đọc thư mục để tải lên", "Cannot access or create thumbnails folder." => "Không có quyền truy cập hoặc không thể tạo thư mục", "Cannot access or write to upload folder." => "Không có quyền truy cập hoặc không thể ghi", "Please enter new folder name." => "Vui lòng nhập tên thư mục", "Unallowable characters in folder name." => "Tên thư mục có chứa những ký tự không được phép", "Folder name shouldn't begins with '.'" => "Thư mục không thể bắt đầu bằng '.'", "Please enter new file name." => "Vui lòng nhập tên tập tin", "Unallowable characters in file name." => "Tên tập tin chứa những ký tự không được phép", "File name shouldn't begins with '.'" => "Tập tin không thể bắt đầu bằng '.'", "Are you sure you want to delete this file?" => "Bạn có chắc bạn muốn xóa tập tin này?", "Are you sure you want to delete this folder and all its content?" => "Bạn có chắc bạn muốn xóa thư mục và tất cả nội dung bên trong?", "Non-existing directory type." => "Không tồn tại thư mục", "Undefined MIME types." => "Không biết kiểu MIME này", "Fileinfo PECL extension is missing." => "Fileinfo PECL extension is missing", "Opening fileinfo database failed." => "Opening fileinfo database failed", "You can't upload such files." => "Bạn không thể tải các tập tin như vậy.", "The file '{file}' does not exist." => "Tập tin '{file}' đã có", "Cannot read '{file}'." => "Không thể đọc '{file}'.", "Cannot copy '{file}'." => "Không thể sao chép '{file}'.", "Cannot move '{file}'." => "Không thể di chuyển '{file}'.", "Cannot delete '{file}'." => "Không thể xóa tập tin '{file}'.", "Cannot delete the folder." => "Không thể xóa thư mục", "Click to remove from the Clipboard" => "Không thể xóa từ Bộ nhớ", "This file is already added to the Clipboard." => "Tập tin đã có trong bộ nhớ", "The files in the Clipboard are not readable." => "Không thể đọc các tập tin trong Bộ nhớ", "{count} files in the Clipboard are not readable. Do you want to copy the rest?" => "{count} tập tin trong Bộ nhớ không thể đọc. Bạn chắc chắn muốn sao chép phần còn lại?", "The files in the Clipboard are not movable." => "Không thể di chuyển các tập tin trong Bộ nhớ", "{count} files in the Clipboard are not movable. Do you want to move the rest?" => "{count} tập tin trong Bộ nhớ không thể di chuyển. Bạn chắc chắn muốn di chuyển phần còn lại?", "The files in the Clipboard are not removable." => "Không thể xóa các tập tin trong Bộ nhớ", "{count} files in the Clipboard are not removable. Do you want to delete the rest?" => "{count} tập tin trong Bộ nhớ không thể xóa. Bạn chắc chắn muốn xóa phần còn lại?", "The selected files are not removable." => "Lựa chọn tập tin để xóa", "{count} selected files are not removable. Do you want to delete the rest?" => "{count} tập tin không thể xóa. Bạn chắc chắn muốn xóa phần còn lại?", "Are you sure you want to delete all selected files?" => "Bạn có chắc bạn muốn xóa tất cả tập tin đựoc chọn?", "Failed to delete {count} files/folders." => "Không thể xóa {count} tập tin/thư mục", "A file or folder with that name already exists." => "Đã tồn tại tập tin hoặc thư mục với tên này", "Copy files here" => "Sao chép ở đây", "Move files here" => "Di chuyển ở đây", "Delete files" => "Xóa tập tin", "Clear the Clipboard" => "Xóa bộ nhớ", "Are you sure you want to delete all files in the Clipboard?" => "Bạn có chắc bạn muốn xóa tất cả tập tin trong Bộ nhớ?", "Copy {count} files" => "Sao chep {count} tập tin", "Move {count} files" => "Di chuyển {count} tập tin", "Add to Clipboard" => "Thêm vào Bộ nhớ", "Inexistant or inaccessible folder." => "Thư mục không tồn tại hoặc không thể truy cập", "New folder name:" => "Tên mới của thư mục", "New file name:" => "Tên mới của tập tin", "Upload" => "Tải lên", "Refresh" => "Làm mới", "Settings" => "Cấu hình", "Maximize" => "Tối đa", "About" => "Giới thiệu", "files" => "tập tin", "selected files" => "chọn tập tin", "View:" => "Xem", "Show:" => "Hiện", "Order by:" => "Thứ tự bởi", "Thumbnails" => "Ảnh thu nhỏ", "List" => "Danh sách", "Name" => "Tên", "Type" => "Kiểu", "Size" => "Kích thước", "Date" => "Ngày tháng", "Descending" => "Giảm dần", "Uploading file..." => "Đang tải lên", "Loading image..." => "Đang đọc ảnh", "Loading folders..." => "Đang đọc thư mục...", "Loading files..." => "Đang đọc tập tin...", "New Subfolder..." => "Thư mục con mới...", "Rename..." => "Đổi tên...", "Delete" => "Xóa", "OK" => "Đồng Ý", "Cancel" => "Hủy", "Select" => "Chọn", "Select Thumbnail" => "Chọn ảnh thu nhỏ", "Select Thumbnails" => "Chọn nhiều ảnh thu nhỏ", "View" => "Xem", "Download" => "Tải xuống", "Download files" => "Tải xuống tập tin", "Clipboard" => "Bộ nhớ", "Checking for new version..." => "Kiểm tra phiên bản mới", "Unable to connect!" => "Không thể kết nối", "Download version {version} now!" => "Có phiên bản mới {version}, tải về ngay!", "KCFinder is up to date!" => "Không có cập nhật", "Licenses:" => "Bản quyền", "Attention" => "Cảnh báo", "Question" => "Câu hỏi", "Yes" => "Có", "No" => "Không", "You cannot rename the extension of files!" => "Bạn không thể đổi tên phần mở rộng của các tập tin!", "Uploading file {number} of {count}... {progress}" => "Đang tải tập tin thứ {number} của {count}... {progress}", "Failed to upload {filename}!" => "Tải lên thất bại {filename}!", ); ?>
0x6a
trunk/libraries/kcfinder/lang/vi.php
PHP
asf20
8,193
<?php /** This file is part of KCFinder project * * @desc Browser actions class * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class browser extends uploader { protected $action; protected $thumbsDir; protected $thumbsTypeDir; public function __construct() { parent::__construct(); if (isset($this->post['dir'])) { $dir = $this->checkInputDir($this->post['dir'], true, false); if ($dir === false) unset($this->post['dir']); $this->post['dir'] = $dir; } if (isset($this->get['dir'])) { $dir = $this->checkInputDir($this->get['dir'], true, false); if ($dir === false) unset($this->get['dir']); $this->get['dir'] = $dir; } $thumbsDir = $this->config['uploadDir'] . "/" . $this->config['thumbsDir']; if (( !is_dir($thumbsDir) && !@mkdir($thumbsDir, $this->config['dirPerms']) ) || !is_readable($thumbsDir) || !dir::isWritable($thumbsDir) || ( !is_dir("$thumbsDir/{$this->type}") && !@mkdir("$thumbsDir/{$this->type}", $this->config['dirPerms']) ) ) $this->errorMsg("Cannot access or create thumbnails folder."); $this->thumbsDir = $thumbsDir; $this->thumbsTypeDir = "$thumbsDir/{$this->type}"; // Remove temporary zip downloads if exists $files = dir::content($this->config['uploadDir'], array( 'types' => "file", 'pattern' => '/^.*\.zip$/i' )); if (is_array($files) && count($files)) { $time = time(); foreach ($files as $file) if (is_file($file) && ($time - filemtime($file) > 3600)) unlink($file); } if (isset($this->get['theme']) && ($this->get['theme'] == basename($this->get['theme'])) && is_dir("themes/{$this->get['theme']}") ) $this->config['theme'] = $this->get['theme']; } public function action() { $act = isset($this->get['act']) ? $this->get['act'] : "browser"; if (!method_exists($this, "act_$act")) $act = "browser"; $this->action = $act; $method = "act_$act"; if ($this->config['disabled']) { $message = $this->label("You don't have permissions to browse server."); if (in_array($act, array("browser", "upload")) || (substr($act, 0, 8) == "download") ) $this->backMsg($message); else { header("Content-Type: text/plain; charset={$this->charset}"); die(json_encode(array('error' => $message))); } } if (!isset($this->session['dir'])) $this->session['dir'] = $this->type; else { $type = $this->getTypeFromPath($this->session['dir']); $dir = $this->config['uploadDir'] . "/" . $this->session['dir']; if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) $this->session['dir'] = $this->type; } $this->session['dir'] = path::normalize($this->session['dir']); if ($act == "browser") { header("X-UA-Compatible: chrome=1"); header("Content-Type: text/html; charset={$this->charset}"); } elseif ( (substr($act, 0, 8) != "download") && !in_array($act, array("thumb", "upload")) ) header("Content-Type: text/plain; charset={$this->charset}"); $return = $this->$method(); echo ($return === true) ? '{}' : $return; } protected function act_browser() { if (isset($this->get['dir']) && is_dir("{$this->typeDir}/{$this->get['dir']}") && is_readable("{$this->typeDir}/{$this->get['dir']}") ) $this->session['dir'] = path::normalize("{$this->type}/{$this->get['dir']}"); return $this->output(); } protected function act_init() { $tree = $this->getDirInfo($this->typeDir); $tree['dirs'] = $this->getTree($this->session['dir']); if (!is_array($tree['dirs']) || !count($tree['dirs'])) unset($tree['dirs']); $files = $this->getFiles($this->session['dir']); $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); $data = array( 'tree' => &$tree, 'files' => &$files, 'dirWritable' => $dirWritable ); return json_encode($data); } protected function act_thumb() { $this->getDir($this->get['dir'], true); if (!isset($this->get['file']) || !isset($this->get['dir'])) $this->sendDefaultThumb(); $file = $this->get['file']; if (basename($file) != $file) $this->sendDefaultThumb(); $file = "{$this->thumbsDir}/{$this->type}/{$this->get['dir']}/$file"; if (!is_file($file) || !is_readable($file)) { $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/" . basename($file); if (!is_file($file) || !is_readable($file)) $this->sendDefaultThumb($file); $image = new gd($file); if ($image->init_error) $this->sendDefaultThumb($file); $browsable = array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG); if (in_array($image->type, $browsable) && ($image->get_width() <= $this->config['thumbWidth']) && ($image->get_height() <= $this->config['thumbHeight']) ) { $type = ($image->type == IMAGETYPE_GIF) ? "gif" : ( ($image->type == IMAGETYPE_PNG) ? "png" : "jpeg"); $type = "image/$type"; httpCache::file($file, $type); } else $this->sendDefaultThumb($file); } httpCache::file($file, "image/jpeg"); } protected function act_expand() { return json_encode(array('dirs' => $this->getDirs($this->postDir()))); } protected function act_chDir() { $this->postDir(); // Just for existing check $this->session['dir'] = $this->type . "/" . $this->post['dir']; $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); return json_encode(array( 'files' => $this->getFiles($this->session['dir']), 'dirWritable' => $dirWritable )); } protected function act_newDir() { if (!$this->config['access']['dirs']['create'] || !isset($this->post['dir']) || !isset($this->post['newDir']) ) $this->errorMsg("Unknown error."); $dir = $this->postDir(); $newDir = $this->normalizeDirname(trim($this->post['newDir'])); if (!strlen($newDir)) $this->errorMsg("Please enter new folder name."); if (preg_match('/[\/\\\\]/s', $newDir)) $this->errorMsg("Unallowable characters in folder name."); if (substr($newDir, 0, 1) == ".") $this->errorMsg("Folder name shouldn't begins with '.'"); if (file_exists("$dir/$newDir")) $this->errorMsg("A file or folder with that name already exists."); if (!@mkdir("$dir/$newDir", $this->config['dirPerms'])) $this->errorMsg("Cannot create {dir} folder.", array('dir' => $newDir)); return true; } protected function act_renameDir() { if (!$this->config['access']['dirs']['rename'] || !isset($this->post['dir']) || !isset($this->post['newName']) ) $this->errorMsg("Unknown error."); $dir = $this->postDir(); $newName = $this->normalizeDirname(trim($this->post['newName'])); if (!strlen($newName)) $this->errorMsg("Please enter new folder name."); if (preg_match('/[\/\\\\]/s', $newName)) $this->errorMsg("Unallowable characters in folder name."); if (substr($newName, 0, 1) == ".") $this->errorMsg("Folder name shouldn't begins with '.'"); if (!@rename($dir, dirname($dir) . "/$newName")) $this->errorMsg("Cannot rename the folder."); $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; if (is_dir($thumbDir)) @rename($thumbDir, dirname($thumbDir) . "/$newName"); return json_encode(array('name' => $newName)); } protected function act_deleteDir() { if (!$this->config['access']['dirs']['delete'] || !isset($this->post['dir']) || !strlen(trim($this->post['dir'])) ) $this->errorMsg("Unknown error."); $dir = $this->postDir(); if (!dir::isWritable($dir)) $this->errorMsg("Cannot delete the folder."); $result = !dir::prune($dir, false); if (is_array($result) && count($result)) $this->errorMsg("Failed to delete {count} files/folders.", array('count' => count($result))); $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; if (is_dir($thumbDir)) dir::prune($thumbDir); return true; } protected function act_upload() { if (!$this->config['access']['files']['upload'] || !isset($this->post['dir']) ) $this->errorMsg("Unknown error."); $dir = $this->postDir(); if (!dir::isWritable($dir)) $this->errorMsg("Cannot access or write to upload folder."); if (is_array($this->file['name'])) { $return = array(); foreach ($this->file['name'] as $i => $name) { $return[] = $this->moveUploadFile(array( 'name' => $name, 'tmp_name' => $this->file['tmp_name'][$i], 'error' => $this->file['error'][$i] ), $dir); } return implode("\n", $return); } else return $this->moveUploadFile($this->file, $dir); } protected function act_download() { $dir = $this->postDir(); if (!isset($this->post['dir']) || !isset($this->post['file']) || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) ) $this->errorMsg("Unknown error."); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private", false); header("Content-Type: application/octet-stream"); header('Content-Disposition: attachment; filename="' . str_replace('"', "_", $this->post['file']) . '"'); header("Content-Transfer-Encoding:­ binary"); header("Content-Length: " . filesize($file)); readfile($file); die; } protected function act_rename() { $dir = $this->postDir(); if (!$this->config['access']['files']['rename'] || !isset($this->post['dir']) || !isset($this->post['file']) || !isset($this->post['newName']) || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) ) $this->errorMsg("Unknown error."); if (isset($this->config['denyExtensionRename']) && $this->config['denyExtensionRename'] && (file::getExtension($this->post['file'], true) !== file::getExtension($this->post['newName'], true) ) ) $this->errorMsg("You cannot rename the extension of files!"); $newName = $this->normalizeFilename(trim($this->post['newName'])); if (!strlen($newName)) $this->errorMsg("Please enter new file name."); if (preg_match('/[\/\\\\]/s', $newName)) $this->errorMsg("Unallowable characters in file name."); if (substr($newName, 0, 1) == ".") $this->errorMsg("File name shouldn't begins with '.'"); $newName = "$dir/$newName"; if (file_exists($newName)) $this->errorMsg("A file or folder with that name already exists."); $ext = file::getExtension($newName); if (!$this->validateExtension($ext, $this->type)) $this->errorMsg("Denied file extension."); if (!@rename($file, $newName)) $this->errorMsg("Unknown error."); $thumbDir = "{$this->thumbsTypeDir}/{$this->post['dir']}"; $thumbFile = "$thumbDir/{$this->post['file']}"; if (file_exists($thumbFile)) @rename($thumbFile, "$thumbDir/" . basename($newName)); return true; } protected function act_delete() { $dir = $this->postDir(); if (!$this->config['access']['files']['delete'] || !isset($this->post['dir']) || !isset($this->post['file']) || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) || !@unlink($file) ) $this->errorMsg("Unknown error."); $thumb = "{$this->thumbsTypeDir}/{$this->post['dir']}/{$this->post['file']}"; if (file_exists($thumb)) @unlink($thumb); return true; } protected function act_cp_cbd() { $dir = $this->postDir(); if (!$this->config['access']['files']['copy'] || !isset($this->post['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) ) $this->errorMsg("Unknown error."); $error = array(); foreach($this->post['files'] as $file) { $file = path::normalize($file); if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); $type = $type[0]; if ($type != $this->type) continue; $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); $ext = file::getExtension($base); if (!file_exists($path)) $error[] = $this->label("The file '{file}' does not exist.", $replace); elseif (substr($base, 0, 1) == ".") $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); elseif (!$this->validateExtension($ext, $type)) $error[] = "$base: " . $this->label("Denied file extension."); elseif (file_exists("$dir/$base")) $error[] = "$base: " . $this->label("A file or folder with that name already exists."); elseif (!is_readable($path) || !is_file($path)) $error[] = $this->label("Cannot read '{file}'.", $replace); elseif (!@copy($path, "$dir/$base")) $error[] = $this->label("Cannot copy '{file}'.", $replace); else { if (function_exists("chmod")) @chmod("$dir/$base", $this->config['filePerms']); $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; if (!is_dir($toThumb)) @mkdir($toThumb, $this->config['dirPerms'], true); $toThumb .= "/$base"; @copy($fromThumb, $toThumb); } } } if (count($error)) return json_encode(array('error' => $error)); return true; } protected function act_mv_cbd() { $dir = $this->postDir(); if (!$this->config['access']['files']['move'] || !isset($this->post['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) ) $this->errorMsg("Unknown error."); $error = array(); foreach($this->post['files'] as $file) { $file = path::normalize($file); if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); $type = $type[0]; if ($type != $this->type) continue; $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); $ext = file::getExtension($base); if (!file_exists($path)) $error[] = $this->label("The file '{file}' does not exist.", $replace); elseif (substr($base, 0, 1) == ".") $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); elseif (!$this->validateExtension($ext, $type)) $error[] = "$base: " . $this->label("Denied file extension."); elseif (file_exists("$dir/$base")) $error[] = "$base: " . $this->label("A file or folder with that name already exists."); elseif (!is_readable($path) || !is_file($path)) $error[] = $this->label("Cannot read '{file}'.", $replace); elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) $error[] = $this->label("Cannot move '{file}'.", $replace); else { if (function_exists("chmod")) @chmod("$dir/$base", $this->config['filePerms']); $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; if (!is_dir($toThumb)) @mkdir($toThumb, $this->config['dirPerms'], true); $toThumb .= "/$base"; @rename($fromThumb, $toThumb); } } } if (count($error)) return json_encode(array('error' => $error)); return true; } protected function act_rm_cbd() { if (!$this->config['access']['files']['delete'] || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) ) $this->errorMsg("Unknown error."); $error = array(); foreach($this->post['files'] as $file) { $file = path::normalize($file); if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); $type = $type[0]; if ($type != $this->type) continue; $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); if (!is_file($path)) $error[] = $this->label("The file '{file}' does not exist.", $replace); elseif (!@unlink($path)) $error[] = $this->label("Cannot delete '{file}'.", $replace); else { $thumb = "{$this->thumbsDir}/$file"; if (is_file($thumb)) @unlink($thumb); } } if (count($error)) return json_encode(array('error' => $error)); return true; } protected function act_downloadDir() { $dir = $this->postDir(); if (!isset($this->post['dir']) || $this->config['denyZipDownload']) $this->errorMsg("Unknown error."); $filename = basename($dir) . ".zip"; do { $file = md5(time() . session_id()); $file = "{$this->config['uploadDir']}/$file.zip"; } while (file_exists($file)); new zipFolder($file, $dir); header("Content-Type: application/x-zip"); header('Content-Disposition: attachment; filename="' . str_replace('"', "_", $filename) . '"'); header("Content-Length: " . filesize($file)); readfile($file); unlink($file); die; } protected function act_downloadSelected() { $dir = $this->postDir(); if (!isset($this->post['dir']) || !isset($this->post['files']) || !is_array($this->post['files']) || $this->config['denyZipDownload'] ) $this->errorMsg("Unknown error."); $zipFiles = array(); foreach ($this->post['files'] as $file) { $file = path::normalize($file); if ((substr($file, 0, 1) == ".") || (strpos($file, '/') !== false)) continue; $file = "$dir/$file"; if (!is_file($file) || !is_readable($file)) continue; $zipFiles[] = $file; } do { $file = md5(time() . session_id()); $file = "{$this->config['uploadDir']}/$file.zip"; } while (file_exists($file)); $zip = new ZipArchive(); $res = $zip->open($file, ZipArchive::CREATE); if ($res === TRUE) { foreach ($zipFiles as $cfile) $zip->addFile($cfile, basename($cfile)); $zip->close(); } header("Content-Type: application/x-zip"); header('Content-Disposition: attachment; filename="selected_files_' . basename($file) . '"'); header("Content-Length: " . filesize($file)); readfile($file); unlink($file); die; } protected function act_downloadClipboard() { if (!isset($this->post['files']) || !is_array($this->post['files']) || $this->config['denyZipDownload'] ) $this->errorMsg("Unknown error."); $zipFiles = array(); foreach ($this->post['files'] as $file) { $file = path::normalize($file); if ((substr($file, 0, 1) == ".")) continue; $type = explode("/", $file); $type = $type[0]; if ($type != $this->type) continue; $file = $this->config['uploadDir'] . "/$file"; if (!is_file($file) || !is_readable($file)) continue; $zipFiles[] = $file; } do { $file = md5(time() . session_id()); $file = "{$this->config['uploadDir']}/$file.zip"; } while (file_exists($file)); $zip = new ZipArchive(); $res = $zip->open($file, ZipArchive::CREATE); if ($res === TRUE) { foreach ($zipFiles as $cfile) $zip->addFile($cfile, basename($cfile)); $zip->close(); } header("Content-Type: application/x-zip"); header('Content-Disposition: attachment; filename="clipboard_' . basename($file) . '"'); header("Content-Length: " . filesize($file)); readfile($file); unlink($file); die; } protected function act_check4Update() { if ($this->config['denyUpdateCheck']) return json_encode(array('version' => false)); // Caching HTTP request for 6 hours if (isset($this->session['checkVersion']) && isset($this->session['checkVersionTime']) && ((time() - $this->session['checkVersionTime']) < 21600) ) return json_encode(array('version' => $this->session['checkVersion'])); $protocol = "http"; $host = "kcfinder.sunhater.com"; $port = 80; $path = "/checkVersion.php"; $url = "$protocol://$host:$port$path"; $pattern = '/^\d+\.\d+$/'; $responsePattern = '/^[A-Z]+\/\d+\.\d+\s+\d+\s+OK\s*([a-zA-Z0-9\-]+\:\s*[^\n]*\n)*\s*(.*)\s*$/'; // file_get_contents() if (ini_get("allow_url_fopen") && (false !== ($ver = file_get_contents($url))) && preg_match($pattern, $ver) // HTTP extension ) {} elseif ( function_exists("http_get") && (false !== ($ver = @http_get($url))) && ( ( preg_match($responsePattern, $ver, $match) && false !== ($ver = $match[2]) ) || true ) && preg_match($pattern, $ver) // Curl extension ) {} elseif ( function_exists("curl_init") && (false !== ( $curl = @curl_init($url) )) && ( @ob_start() || (@curl_close($curl) && false)) && ( @curl_exec($curl) || (@curl_close($curl) && false)) && ((false !== ( $ver = @ob_get_clean() )) || (@curl_close($curl) && false)) && ( @curl_close($curl) || true ) && preg_match($pattern, $ver) // Socket extension ) {} elseif (function_exists('socket_create')) { $cmd = "GET $path " . strtoupper($protocol) . "/1.1\r\n" . "Host: $host\r\n" . "Connection: Close\r\n\r\n"; if ((false !== ( $socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP) )) && (false !== @socket_connect($socket, $host, $port) ) && (false !== @socket_write($socket, $cmd, strlen($cmd)) ) && (false !== ( $ver = @socket_read($socket, 2048) )) && preg_match($responsePattern, $ver, $match) ) $ver = $match[2]; if (isset($socket) && is_resource($socket)) @socket_close($socket); } if (isset($ver) && preg_match($pattern, $ver)) { $this->session['checkVersion'] = $ver; $this->session['checkVersionTime'] = time(); return json_encode(array('version' => $ver)); } else return json_encode(array('version' => false)); } protected function moveUploadFile($file, $dir) { $message = $this->checkUploadedFile($file); if ($message !== true) { if (isset($file['tmp_name'])) @unlink($file['tmp_name']); return "{$file['name']}: $message"; } $filename = $this->normalizeFilename($file['name']); $target = "$dir/" . file::getInexistantFilename($filename, $dir); if (!@move_uploaded_file($file['tmp_name'], $target) && !@rename($file['tmp_name'], $target) && !@copy($file['tmp_name'], $target) ) { @unlink($file['tmp_name']); return "{$file['name']}: " . $this->label("Cannot move uploaded file to target folder."); } elseif (function_exists('chmod')) chmod($target, $this->config['filePerms']); $this->makeThumb($target); return "/" . basename($target); } protected function sendDefaultThumb($file=null) { if ($file !== null) { $ext = file::getExtension($file); $thumb = "themes/{$this->config['theme']}/img/files/big/$ext.png"; } if (!isset($thumb) || !file_exists($thumb)) $thumb = "themes/{$this->config['theme']}/img/files/big/..png"; header("Content-Type: image/png"); readfile($thumb); die; } protected function getFiles($dir) { $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; $dir = "{$this->config['uploadDir']}/$dir"; $return = array(); $files = dir::content($dir, array('types' => "file")); if ($files === false) return $return; foreach ($files as $file) { $size = @getimagesize($file); if (is_array($size) && count($size)) { $thumb_file = "$thumbDir/" . basename($file); if (!is_file($thumb_file)) $this->makeThumb($file, false); $smallThumb = ($size[0] <= $this->config['thumbWidth']) && ($size[1] <= $this->config['thumbHeight']) && in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); } else $smallThumb = false; $stat = stat($file); if ($stat === false) continue; $name = basename($file); $ext = file::getExtension($file); $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); $thumb = file_exists("$thumbDir/$name"); $return[] = array( 'name' => stripcslashes($name), 'size' => $stat['size'], 'mtime' => $stat['mtime'], 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), 'readable' => is_readable($file), 'writable' => file::isWritable($file), 'bigIcon' => $bigIcon, 'smallIcon' => $smallIcon, 'thumb' => $thumb, 'smallThumb' => $smallThumb ); } return $return; } protected function getTree($dir, $index=0) { $path = explode("/", $dir); $pdir = ""; for ($i = 0; ($i <= $index && $i < count($path)); $i++) $pdir .= "/{$path[$i]}"; if (strlen($pdir)) $pdir = substr($pdir, 1); $fdir = "{$this->config['uploadDir']}/$pdir"; $dirs = $this->getDirs($fdir); if (is_array($dirs) && count($dirs) && ($index <= count($path) - 1)) { foreach ($dirs as $i => $cdir) { if ($cdir['hasDirs'] && ( ($index == count($path) - 1) || ($cdir['name'] == $path[$index + 1]) ) ) { $dirs[$i]['dirs'] = $this->getTree($dir, $index + 1); if (!is_array($dirs[$i]['dirs']) || !count($dirs[$i]['dirs'])) { unset($dirs[$i]['dirs']); continue; } } } } else return false; return $dirs; } protected function postDir($existent=true) { $dir = $this->typeDir; if (isset($this->post['dir'])) $dir .= "/" . $this->post['dir']; if ($existent && (!is_dir($dir) || !is_readable($dir))) $this->errorMsg("Inexistant or inaccessible folder."); return $dir; } protected function getDir($existent=true) { $dir = $this->typeDir; if (isset($this->get['dir'])) $dir .= "/" . $this->get['dir']; if ($existent && (!is_dir($dir) || !is_readable($dir))) $this->errorMsg("Inexistant or inaccessible folder."); return $dir; } protected function getDirs($dir) { $dirs = dir::content($dir, array('types' => "dir")); $return = array(); if (is_array($dirs)) { $writable = dir::isWritable($dir); foreach ($dirs as $cdir) { $info = $this->getDirInfo($cdir); if ($info === false) continue; $info['removable'] = $writable && $info['writable']; $return[] = $info; } } return $return; } protected function getDirInfo($dir, $removable=false) { if ((substr(basename($dir), 0, 1) == ".") || !is_dir($dir) || !is_readable($dir)) return false; $dirs = dir::content($dir, array('types' => "dir")); if (is_array($dirs)) { foreach ($dirs as $key => $cdir) if (substr(basename($cdir), 0, 1) == ".") unset($dirs[$key]); $hasDirs = count($dirs) ? true : false; } else $hasDirs = false; $writable = dir::isWritable($dir); $info = array( 'name' => stripslashes(basename($dir)), 'readable' => is_readable($dir), 'writable' => $writable, 'removable' => $removable && $writable && dir::isWritable(dirname($dir)), 'hasDirs' => $hasDirs ); if ($dir == "{$this->config['uploadDir']}/{$this->session['dir']}") $info['current'] = true; return $info; } protected function output($data=null, $template=null) { if (!is_array($data)) $data = array(); if ($template === null) $template = $this->action; if (file_exists("tpl/tpl_$template.php")) { ob_start(); $eval = "unset(\$data);unset(\$template);unset(\$eval);"; $_ = $data; foreach (array_keys($data) as $key) if (preg_match('/^[a-z\d_]+$/i', $key)) $eval .= "\$$key=\$_['$key'];"; $eval .= "unset(\$_);require \"tpl/tpl_$template.php\";"; eval($eval); return ob_get_clean(); } return ""; } protected function errorMsg($message, array $data=null) { if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) die($this->label($message, $data)); if (($this->action === null) || ($this->action == "browser")) $this->backMsg($message, $data); else { $message = $this->label($message, $data); die(json_encode(array('error' => $message))); } } } ?>
0x6a
trunk/libraries/kcfinder/core/browser.php
PHP
asf20
34,143
<?php /** This file is part of KCFinder project * * @desc GD image detection class * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class type_img { public function checkFile($file, array $config) { $gd = new gd($file); if ($gd->init_error) return "Unknown image format/encoding."; return true; } } ?>
0x6a
trunk/libraries/kcfinder/core/types/type_img.php
PHP
asf20
643
<?php /** This file is part of KCFinder project * * @desc MIME type detection class * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class type_mime { public function checkFile($file, array $config) { if (!class_exists("finfo")) return "Fileinfo PECL extension is missing."; if (!isset($config['params'])) return "Undefined MIME types."; $finfo = strlen($config['mime_magic']) ? new finfo(FILEINFO_MIME, $config['mime_magic']) : new finfo(FILEINFO_MIME); if (!$finfo) return "Opening fileinfo database failed."; $type = $finfo->file($file); $type = substr($type, 0, strrpos($type, ";")); $mimes = $config['params']; if (substr($mimes, 0, 1) == "!") { $mimes = trim(substr($mimes, 1)); return in_array($type , explode(" ", $mimes)) ? "You can't upload such files." : true; } return !in_array($type , explode(" ", $mimes)) ? "You can't upload such files." : true; } } ?>
0x6a
trunk/libraries/kcfinder/core/types/type_mime.php
PHP
asf20
1,399
<?php /** This file is part of KCFinder project * * @desc This file is included first, before each other * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com * * This file is the place you can put any code (at the end of the file), * which will be executed before any other. Suitable for: * 1. Set PHP ini settings using ini_set() * 2. Custom session save handler with session_set_save_handler() * 3. Any custom integration code. If you use any global variables * here, they can be accessed in config.php via $GLOBALS array. * It's recommended to use constants instead. */ // PHP VERSION CHECK if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); // GD EXTENSION CHECK if (!function_exists("imagecopyresampled")) die("The GD PHP extension is not available! It's required to run KCFinder."); // SAFE MODE CHECK if (ini_get("safe_mode")) die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode."); // CMS INTEGRATION if (isset($_GET['cms'])) { switch ($_GET['cms']) { case "drupal": require "integration/drupal.php"; } } // MAGIC AUTOLOAD CLASSES FUNCTION function __autoload($class) { if ($class == "uploader") require "core/uploader.php"; elseif ($class == "browser") require "core/browser.php"; elseif (file_exists("core/types/$class.php")) require "core/types/$class.php"; elseif (file_exists("lib/class_$class.php")) require "lib/class_$class.php"; elseif (file_exists("lib/helper_$class.php")) require "lib/helper_$class.php"; } // json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING if (!function_exists("json_encode")) { function kcfinder_json_string_encode($string) { return '"' . str_replace('/', "\\/", str_replace("\t", "\\t", str_replace("\r", "\\r", str_replace("\n", "\\n", str_replace('"', "\\\"", str_replace("\\", "\\\\", $string)))))) . '"'; } function json_encode($data) { if (is_array($data)) { $ret = array(); // OBJECT if (array_keys($data) !== range(0, count($data) - 1)) { foreach ($data as $key => $val) $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val); return "{" . implode(",", $ret) . "}"; // ARRAY } else { foreach ($data as $val) $ret[] = json_encode($val); return "[" . implode(",", $ret) . "]"; } // BOOLEAN OR NULL } elseif (is_bool($data) || ($data === null)) return ($data === null) ? "null" : ($data ? "true" : "false"); // FLOAT elseif (is_float($data)) return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), "."); // INTEGER elseif (is_int($data)) return $data; // STRING return kcfinder_json_string_encode($data); } } // CUSTOM SESSION SAVE HANDLER CLASS EXAMPLE // // Uncomment & edit it if the application you want to integrate with, have // its own session save handler. It's not even needed to save instances of // this class in variables. Just add a row: // new SessionSaveHandler(); // and your handler will rule the sessions ;-) /* class SessionSaveHandler { protected $savePath; protected $sessionName; public function __construct() { session_set_save_handler( array($this, "open"), array($this, "close"), array($this, "read"), array($this, "write"), array($this, "destroy"), array($this, "gc") ); } // Open function, this works like a constructor in classes and is // executed when the session is being opened. The open function expects // two parameters, where the first is the save path and the second is the // session name. public function open($savePath, $sessionName) { $this->savePath = $savePath; $this->sessionName = $sessionName; return true; } // Close function, this works like a destructor in classes and is // executed when the session operation is done. public function close() { return true; } // Read function must return string value always to make save handler // work as expected. Return empty string if there is no data to read. // Return values from other handlers are converted to boolean expression. // TRUE for success, FALSE for failure. public function read($id) { $file = $this->savePath . "/sess_$id"; return (string) @file_get_contents($file); } // Write function that is called when session data is to be saved. This // function expects two parameters: an identifier and the data associated // with it. public function write($id, $data) { $file = $this->savePath . "/sess_$id"; if (false !== ($fp = @fopen($file, "w"))) { $return = fwrite($fp, $data); fclose($fp); return $return; } else return false; } // The destroy handler, this is executed when a session is destroyed with // session_destroy() and takes the session id as its only parameter. public function destroy($id) { $file = $this->savePath . "/sess_$id"; return @unlink($file); } // The garbage collector, this is executed when the session garbage // collector is executed and takes the max session lifetime as its only // parameter. public function gc($maxlifetime) { foreach (glob($this->savePath . "/sess_*") as $file) if (filemtime($file) + $maxlifetime < time()) @unlink($file); return true; } } new SessionSaveHandler(); */ // PUT YOUR ADDITIONAL CODE HERE ?>
0x6a
trunk/libraries/kcfinder/core/autoload.php
PHP
asf20
6,474
<?php /** This file is part of KCFinder project * * @desc Uploader class * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class uploader { /** Release version */ const VERSION = "2.51"; /** Config session-overrided settings * @var array */ protected $config = array(); /** Opener applocation properties * $opener['name'] Got from $_GET['opener']; * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) * $opener['TinyMCE'] Boolean * @var array */ protected $opener = array(); /** Got from $_GET['type'] or first one $config['types'] array key, if inexistant * @var string */ protected $type; /** Helper property. Local filesystem path to the Type Directory * Equivalent: $config['uploadDir'] . "/" . $type * @var string */ protected $typeDir; /** Helper property. Web URL to the Type Directory * Equivalent: $config['uploadURL'] . "/" . $type * @var string */ protected $typeURL; /** Linked to $config['types'] * @var array */ protected $types = array(); /** Settings which can override default settings if exists as keys in $config['types'][$type] array * @var array */ protected $typeSettings = array('disabled', 'theme', 'dirPerms', 'filePerms', 'denyZipDownload', 'maxImageWidth', 'maxImageHeight', 'thumbWidth', 'thumbHeight', 'jpegQuality', 'access', 'filenameChangeChars', 'dirnameChangeChars', 'denyExtensionRename', 'deniedExts'); /** Got from language file * @var string */ protected $charset; /** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property * @var string */ protected $lang = 'en'; /** Possible language $_GET keys * @var array */ protected $langInputNames = array('lang', 'langCode', 'lng', 'language', 'lang_code'); /** Uploaded file(s) info. Linked to first $_FILES element * @var array */ protected $file; /** Next three properties are got from the current language file * @var string */ protected $dateTimeFull; // Currently not used protected $dateTimeMid; // Currently not used protected $dateTimeSmall; /** Contain Specified language labels * @var array */ protected $labels = array(); /** Contain unprocessed $_GET array. Please use this instead of $_GET * @var array */ protected $get; /** Contain unprocessed $_POST array. Please use this instead of $_POST * @var array */ protected $post; /** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE * @var array */ protected $cookie; /** Session array. Please use this property instead of $_SESSION * @var array */ protected $session; /** CMS integration attribute (got from $_GET['cms']) * @var string */ protected $cms = ""; /** Magic method which allows read-only access to protected or private class properties * @param string $property * @return mixed */ public function __get($property) { return property_exists($this, $property) ? $this->$property : null; } public function __construct() { // DISABLE MAGIC QUOTES if (function_exists('set_magic_quotes_runtime')) @set_magic_quotes_runtime(false); // INPUT INIT $input = new input(); $this->get = &$input->get; $this->post = &$input->post; $this->cookie = &$input->cookie; // SET CMS INTEGRATION ATTRIBUTE if (isset($this->get['cms']) && in_array($this->get['cms'], array("drupal")) ) $this->cms = $this->get['cms']; // LINKING UPLOADED FILE if (count($_FILES)) $this->file = &$_FILES[key($_FILES)]; // LOAD DEFAULT CONFIGURATION require "config.php"; // SETTING UP SESSION if (isset($_CONFIG['_sessionLifetime'])) ini_set('session.gc_maxlifetime', $_CONFIG['_sessionLifetime'] * 60); if (isset($_CONFIG['_sessionDir'])) ini_set('session.save_path', $_CONFIG['_sessionDir']); if (isset($_CONFIG['_sessionDomain'])) ini_set('session.cookie_domain', $_CONFIG['_sessionDomain']); switch ($this->cms) { case "drupal": break; default: session_start(); break; } // RELOAD DEFAULT CONFIGURATION require "config.php"; $this->config = $_CONFIG; // LOAD SESSION CONFIGURATION IF EXISTS if (isset($_CONFIG['_sessionVar']) && is_array($_CONFIG['_sessionVar']) ) { foreach ($_CONFIG['_sessionVar'] as $key => $val) if ((substr($key, 0, 1) != "_") && isset($_CONFIG[$key])) $this->config[$key] = $val; if (!isset($this->config['_sessionVar']['self'])) $this->config['_sessionVar']['self'] = array(); $this->session = &$this->config['_sessionVar']['self']; } else $this->session = &$_SESSION; // GET TYPE DIRECTORY $this->types = &$this->config['types']; $firstType = array_keys($this->types); $firstType = $firstType[0]; $this->type = ( isset($this->get['type']) && isset($this->types[$this->get['type']]) ) ? $this->get['type'] : $firstType; // LOAD TYPE DIRECTORY SPECIFIC CONFIGURATION IF EXISTS if (is_array($this->types[$this->type])) { foreach ($this->types[$this->type] as $key => $val) if (in_array($key, $this->typeSettings)) $this->config[$key] = $val; $this->types[$this->type] = isset($this->types[$this->type]['type']) ? $this->types[$this->type]['type'] : ""; } // COOKIES INIT $ip = '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; $ip = '/^' . implode('\.', array($ip, $ip, $ip, $ip)) . '$/'; if (preg_match($ip, $_SERVER['HTTP_HOST']) || preg_match('/^[^\.]+$/', $_SERVER['HTTP_HOST']) ) $this->config['cookieDomain'] = ""; elseif (!strlen($this->config['cookieDomain'])) $this->config['cookieDomain'] = $_SERVER['HTTP_HOST']; if (!strlen($this->config['cookiePath'])) $this->config['cookiePath'] = "/"; // UPLOAD FOLDER INIT // FULL URL if (preg_match('/^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)\/?$/', $this->config['uploadURL'], $patt) ) { list($unused, $protocol, $domain, $unused, $port, $path) = $patt; $path = path::normalize($path); $this->config['uploadURL'] = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/$path"; $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath("/$path"); $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; $this->typeURL = "{$this->config['uploadURL']}/{$this->type}"; // SITE ROOT } elseif ($this->config['uploadURL'] == "/") { $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::normalize($_SERVER['DOCUMENT_ROOT']); $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; $this->typeURL = "/{$this->type}"; // ABSOLUTE & RELATIVE } else { $this->config['uploadURL'] = (substr($this->config['uploadURL'], 0, 1) === "/") ? path::normalize($this->config['uploadURL']) : path::rel2abs_url($this->config['uploadURL']); $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath($this->config['uploadURL']); $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; $this->typeURL = "{$this->config['uploadURL']}/{$this->type}"; } if (!is_dir($this->config['uploadDir'])) @mkdir($this->config['uploadDir'], $this->config['dirPerms']); // HOST APPLICATIONS INIT if (isset($this->get['CKEditorFuncNum'])) $this->opener['CKEditor']['funcNum'] = $this->get['CKEditorFuncNum']; if (isset($this->get['opener']) && (strtolower($this->get['opener']) == "tinymce") && isset($this->config['_tinyMCEPath']) && strlen($this->config['_tinyMCEPath']) ) $this->opener['TinyMCE'] = true; // LOCALIZATION foreach ($this->langInputNames as $key) if (isset($this->get[$key]) && preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) && file_exists("lang/" . strtolower($this->get[$key]) . ".php") ) { $this->lang = $this->get[$key]; break; } $this->localize($this->lang); // CHECK & MAKE DEFAULT .htaccess if (isset($this->config['_check4htaccess']) && $this->config['_check4htaccess'] ) { $htaccess = "{$this->config['uploadDir']}/.htaccess"; if (!file_exists($htaccess)) { if (!@file_put_contents($htaccess, $this->get_htaccess())) $this->backMsg("Cannot write to upload folder. {$this->config['uploadDir']}"); } else { if (false === ($data = @file_get_contents($htaccess))) $this->backMsg("Cannot read .htaccess"); if (($data != $this->get_htaccess()) && !@file_put_contents($htaccess, $data)) $this->backMsg("Incorrect .htaccess file. Cannot rewrite it!"); } } // CHECK & CREATE UPLOAD FOLDER if (!is_dir($this->typeDir)) { if (!mkdir($this->typeDir, $this->config['dirPerms'])) $this->backMsg("Cannot create {dir} folder.", array('dir' => $this->type)); } elseif (!is_readable($this->typeDir)) $this->backMsg("Cannot read upload folder."); } public function upload() { $config = &$this->config; $file = &$this->file; $url = $message = ""; if ($config['disabled'] || !$config['access']['files']['upload']) { if (isset($file['tmp_name'])) @unlink($file['tmp_name']); $message = $this->label("You don't have permissions to upload files."); } elseif (true === ($message = $this->checkUploadedFile())) { $message = ""; $dir = "{$this->typeDir}/"; if (isset($this->get['dir']) && (false !== ($gdir = $this->checkInputDir($this->get['dir']))) ) { $udir = path::normalize("$dir$gdir"); if (substr($udir, 0, strlen($dir)) !== $dir) $message = $this->label("Unknown error."); else { $l = strlen($dir); $dir = "$udir/"; $udir = substr($udir, $l); } } if (!strlen($message)) { if (!is_dir(path::normalize($dir))) @mkdir(path::normalize($dir), $this->config['dirPerms'], true); $filename = $this->normalizeFilename($file['name']); $target = file::getInexistantFilename($dir . $filename); if (!@move_uploaded_file($file['tmp_name'], $target) && !@rename($file['tmp_name'], $target) && !@copy($file['tmp_name'], $target) ) $message = $this->label("Cannot move uploaded file to target folder."); else { if (function_exists('chmod')) @chmod($target, $this->config['filePerms']); $this->makeThumb($target); $url = $this->typeURL; if (isset($udir)) $url .= "/$udir"; $url .= "/" . basename($target); if (preg_match('/^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)$/', $url, $patt)) { list($unused, $protocol, $domain, $unused, $port, $path) = $patt; $base = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/"; $url = $base . path::urlPathEncode($path); } else $url = path::urlPathEncode($url); } } } if (strlen($message) && isset($this->file['tmp_name']) && file_exists($this->file['tmp_name']) ) @unlink($this->file['tmp_name']); if (strlen($message) && method_exists($this, 'errorMsg')) $this->errorMsg($message); $this->callBack($url, $message); } protected function normalizeFilename($filename) { if (isset($this->config['filenameChangeChars']) && is_array($this->config['filenameChangeChars']) ) $filename = strtr($filename, $this->config['filenameChangeChars']); return $filename; } protected function normalizeDirname($dirname) { if (isset($this->config['dirnameChangeChars']) && is_array($this->config['dirnameChangeChars']) ) $dirname = strtr($dirname, $this->config['dirnameChangeChars']); return $dirname; } protected function checkUploadedFile(array $aFile=null) { $config = &$this->config; $file = ($aFile === null) ? $this->file : $aFile; if (!is_array($file) || !isset($file['name'])) return $this->label("Unknown error"); if (is_array($file['name'])) { foreach ($file['name'] as $i => $name) { $return = $this->checkUploadedFile(array( 'name' => $name, 'tmp_name' => $file['tmp_name'][$i], 'error' => $file['error'][$i] )); if ($return !== true) return "$name: $return"; } return true; } $extension = file::getExtension($file['name']); $typePatt = strtolower(text::clearWhitespaces($this->types[$this->type])); // CHECK FOR UPLOAD ERRORS if ($file['error']) return ($file['error'] == UPLOAD_ERR_INI_SIZE) ? $this->label("The uploaded file exceeds {size} bytes.", array('size' => ini_get('upload_max_filesize'))) : ( ($file['error'] == UPLOAD_ERR_FORM_SIZE) ? $this->label("The uploaded file exceeds {size} bytes.", array('size' => $this->get['MAX_FILE_SIZE'])) : ( ($file['error'] == UPLOAD_ERR_PARTIAL) ? $this->label("The uploaded file was only partially uploaded.") : ( ($file['error'] == UPLOAD_ERR_NO_FILE) ? $this->label("No file was uploaded.") : ( ($file['error'] == UPLOAD_ERR_NO_TMP_DIR) ? $this->label("Missing a temporary folder.") : ( ($file['error'] == UPLOAD_ERR_CANT_WRITE) ? $this->label("Failed to write file.") : $this->label("Unknown error.") ))))); // HIDDEN FILENAMES CHECK elseif (substr($file['name'], 0, 1) == ".") return $this->label("File name shouldn't begins with '.'"); // EXTENSION CHECK elseif (!$this->validateExtension($extension, $this->type)) return $this->label("Denied file extension."); // SPECIAL DIRECTORY TYPES CHECK (e.g. *img) elseif (preg_match('/^\*([^ ]+)(.*)?$/s', $typePatt, $patt)) { list($typePatt, $type, $params) = $patt; if (class_exists("type_$type")) { $class = "type_$type"; $type = new $class(); $cfg = $config; $cfg['filename'] = $file['name']; if (strlen($params)) $cfg['params'] = trim($params); $response = $type->checkFile($file['tmp_name'], $cfg); if ($response !== true) return $this->label($response); } else return $this->label("Non-existing directory type."); } // IMAGE RESIZE $gd = new gd($file['tmp_name']); if (!$gd->init_error && !$this->imageResize($gd, $file['tmp_name'])) return $this->label("The image is too big and/or cannot be resized."); return true; } protected function checkInputDir($dir, $inclType=true, $existing=true) { $dir = path::normalize($dir); if (substr($dir, 0, 1) == "/") $dir = substr($dir, 1); if ((substr($dir, 0, 1) == ".") || (substr(basename($dir), 0, 1) == ".")) return false; if ($inclType) { $first = explode("/", $dir); $first = $first[0]; if ($first != $this->type) return false; $return = $this->removeTypeFromPath($dir); } else { $return = $dir; $dir = "{$this->type}/$dir"; } if (!$existing) return $return; $path = "{$this->config['uploadDir']}/$dir"; return (is_dir($path) && is_readable($path)) ? $return : false; } protected function validateExtension($ext, $type) { $ext = trim(strtolower($ext)); if (!isset($this->types[$type])) return false; $exts = strtolower(text::clearWhitespaces($this->config['deniedExts'])); if (strlen($exts)) { $exts = explode(" ", $exts); if (in_array($ext, $exts)) return false; } $exts = trim($this->types[$type]); if (!strlen($exts) || substr($exts, 0, 1) == "*") return true; if (substr($exts, 0, 1) == "!") { $exts = explode(" ", trim(strtolower(substr($exts, 1)))); return !in_array($ext, $exts); } $exts = explode(" ", trim(strtolower($exts))); return in_array($ext, $exts); } protected function getTypeFromPath($path) { return preg_match('/^([^\/]*)\/.*$/', $path, $patt) ? $patt[1] : $path; } protected function removeTypeFromPath($path) { return preg_match('/^[^\/]*\/(.*)$/', $path, $patt) ? $patt[1] : ""; } protected function imageResize($image, $file=null) { if (!($image instanceof gd)) { $gd = new gd($image); if ($gd->init_error) return false; $file = $image; } elseif ($file === null) return false; else $gd = $image; if ((!$this->config['maxImageWidth'] && !$this->config['maxImageHeight']) || ( ($gd->get_width() <= $this->config['maxImageWidth']) && ($gd->get_height() <= $this->config['maxImageHeight']) ) ) return true; if ((!$this->config['maxImageWidth'] || !$this->config['maxImageHeight'])) { if ($this->config['maxImageWidth']) { if ($this->config['maxImageWidth'] >= $gd->get_width()) return true; $width = $this->config['maxImageWidth']; $height = $gd->get_prop_height($width); } else { if ($this->config['maxImageHeight'] >= $gd->get_height()) return true; $height = $this->config['maxImageHeight']; $width = $gd->get_prop_width($height); } if (!$gd->resize($width, $height)) return false; } elseif (!$gd->resize_fit( $this->config['maxImageWidth'], $this->config['maxImageHeight'] )) return false; return $gd->imagejpeg($file, $this->config['jpegQuality']); } protected function makeThumb($file, $overwrite=true) { $gd = new gd($file); // Drop files which are not GD handled images if ($gd->init_error) return true; $thumb = substr($file, strlen($this->config['uploadDir'])); $thumb = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'] . "/" . $thumb; $thumb = path::normalize($thumb); $thumbDir = dirname($thumb); if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) return false; if (!$overwrite && is_file($thumb)) return true; // Images with smaller resolutions than thumbnails if (($gd->get_width() <= $this->config['thumbWidth']) && ($gd->get_height() <= $this->config['thumbHeight']) ) { $browsable = array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG); // Drop only browsable types if (in_array($gd->type, $browsable)) return true; // Resize image } elseif (!$gd->resize_fit($this->config['thumbWidth'], $this->config['thumbHeight'])) return false; // Save thumbnail return $gd->imagejpeg($thumb, $this->config['jpegQuality']); } protected function localize($langCode) { require "lang/{$langCode}.php"; setlocale(LC_ALL, $lang['_locale']); $this->charset = $lang['_charset']; $this->dateTimeFull = $lang['_dateTimeFull']; $this->dateTimeMid = $lang['_dateTimeMid']; $this->dateTimeSmall = $lang['_dateTimeSmall']; unset($lang['_locale']); unset($lang['_charset']); unset($lang['_dateTimeFull']); unset($lang['_dateTimeMid']); unset($lang['_dateTimeSmall']); $this->labels = $lang; } protected function label($string, array $data=null) { $return = isset($this->labels[$string]) ? $this->labels[$string] : $string; if (is_array($data)) foreach ($data as $key => $val) $return = str_replace("{{$key}}", $val, $return); return $return; } protected function backMsg($message, array $data=null) { $message = $this->label($message, $data); if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) @unlink($this->file['tmp_name']); $this->callBack("", $message); die; } protected function callBack($url, $message="") { $message = text::jsValue($message); $CKfuncNum = isset($this->opener['CKEditor']['funcNum']) ? $this->opener['CKEditor']['funcNum'] : 0; if (!$CKfuncNum) $CKfuncNum = 0; header("Content-Type: text/html; charset={$this->charset}"); ?><html> <body> <script type='text/javascript'> var kc_CKEditor = (window.parent && window.parent.CKEDITOR) ? window.parent.CKEDITOR.tools.callFunction : ((window.opener && window.opener.CKEDITOR) ? window.opener.CKEDITOR.tools.callFunction : false); var kc_FCKeditor = (window.opener && window.opener.OnUploadCompleted) ? window.opener.OnUploadCompleted : ((window.parent && window.parent.OnUploadCompleted) ? window.parent.OnUploadCompleted : false); var kc_Custom = (window.parent && window.parent.KCFinder) ? window.parent.KCFinder.callBack : ((window.opener && window.opener.KCFinder) ? window.opener.KCFinder.callBack : false); if (kc_CKEditor) kc_CKEditor(<?php echo $CKfuncNum ?>, '<?php echo $url ?>', '<?php echo $message ?>'); if (kc_FCKeditor) kc_FCKeditor(<?php echo strlen($message) ? 1 : 0 ?>, '<?php echo $url ?>', '', '<?php echo $message ?>'); if (kc_Custom) { if (<?php echo strlen($message) ?>) alert('<?php echo $message ?>'); kc_Custom('<?php echo $url ?>'); } if (!kc_CKEditor && !kc_FCKeditor && !kc_Custom) alert("<?php echo $message ?>"); </script> </body> </html><?php } protected function get_htaccess() { return "<IfModule mod_php4.c> php_value engine off </IfModule> <IfModule mod_php5.c> php_value engine off </IfModule> "; } } ?>
0x6a
trunk/libraries/kcfinder/core/uploader.php
PHP
asf20
24,558
body { background: #e0dfde; } input { margin: 0; } input[type="radio"], input[type="checkbox"], label { cursor: pointer; } input[type="text"] { border: 1px solid #d3d3d3; background: #fff; padding: 2px; margin: 0; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; box-shadow: 0 -1px 0 rgba(0,0,0,0.5); -moz-box-shadow: 0 -1px 0 rgba(0,0,0,0.5); -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.5); outline-width: 0; } input[type="text"]:hover { box-shadow: 0 -1px 0 rgba(0,0,0,0.2); -moz-box-shadow: 0 -1px 0 rgba(0,0,0,0.2); -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.2); } input[type="text"]:focus { border-color: #3687e2; box-shadow: 0 0 3px rgba(54,135,226,1); -moz-box-shadow: 0 0 3px rgba(54,135,226,1); -webkit-box-shadow: 0 0 3px rgba(54,135,226,1); } input[type="button"], input[type="submit"], input[type="reset"], button { outline-width: 0; background: #edeceb; border: 1px solid #fff; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow: 0 1px 1px rgba(0,0,0,0.6); -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.6); -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.6); color: #222; } input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover, button:hover { box-shadow: 0 0 1px rgba(0,0,0,0.6); -moz-box-shadow: 0 0 1px rgba(0,0,0,0.6); -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.6); } input[type="button"]:focus, input[type="submit"]:focus, input[type="reset"]:focus, button:focus { box-shadow: 0 0 5px rgba(54,135,226,1); -moz-box-shadow: 0 0 5px rgba(54,135,226,1); -webkit-box-shadow: 0 0 5px rgba(54,135,226,1); } fieldset { margin: 0 5px 5px 0px; padding: 5px; border: 1px solid #afadaa; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; cursor: default; } fieldset td { white-space: nowrap; } legend { margin: 0; padding:0 3px; font-weight: bold; } #folders { margin: 4px 4px 0 4px; background: #f8f7f6; border: 1px solid #adaba9; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; } #files { float: left; margin: 0 4px 0 0; background: #f8f7f6; border: 1px solid #adaba9; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; } #files.drag { background: #ddebf8; } #topic { padding-left: 12px; } div.folder { padding-top: 2px; margin-top: 4px; white-space: nowrap; } div.folder a { text-decoration: none; cursor: default; outline: none; color: #000; } span.folder { padding: 2px 3px 2px 23px; outline: none; background: no-repeat 3px center; cursor: pointer; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border: 1px solid transparent; } span.brace { width: 16px; height: 16px; outline: none; } span.current { background-image: url(img/tree/folder_current.png); background-color: #5b9bda; border-color: #2973bd; color: #fff; } span.regular { background-image: url(img/tree/folder.png); background-color: #f8f7f6; } span.regular:hover, span.context { background-color: #ddebf8; border-color: #cee0f4; color: #000; } span.opened { background-image: url(img/tree/minus.png); } span.closed { background-image: url(img/tree/plus.png); } span.denied { background-image: url(img/tree/denied.png); } div.file { padding: 4px; margin: 3px; border: 1px solid #aaa; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; background: #fff; } div.file:hover { background: #ddebf8; border-color: #a7bed7; } div.file .name { margin-top: 4px; font-weight: bold; height: 16px; overflow: hidden; } div.file .time { font-size: 10px; } div.file .size { font-size: 10px; } #files div.selected, #files div.selected:hover { background-color: #5b9bda; border-color: #2973bd; color: #fff; } tr.file > td { padding: 3px 4px; background-color: #f8f7f6 } tr.file:hover > td { background-color: #ddebf8; } tr.selected > td, tr.selected:hover > td { background-color: #5b9bda; color: #fff; } #toolbar { padding: 5px 0; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } #toolbar a { color: #000; padding: 4px 4px 4px 24px; margin-right: 5px; border: 1px solid transparent; background: no-repeat 2px center; outline: none; display: block; float: left; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } #toolbar a:hover, #toolbar a.hover { background-color: #cfcfcf; border-color: #afadaa; box-shadow: inset 0 0 3px rgba(175,173,170,1); -moz-box-shadow: inset 0 0 3px rgba(175,173,170,1); -webkit-box-shadow: inset 0 0 3px rgba(175,173,170,1); } #toolbar a.selected { background-color: #eeeeff; border-color: #3687e2; box-shadow: inset 0 0 3px rgba(54,135,226,1); -moz-box-shadow: inset 0 0 3px rgba(54,135,226,1); -webkit-box-shadow: inset 0 0 3px rgba(54,135,226,1); } #toolbar a[href="kcact:upload"] { background-image: url(img/icons/upload.png); } #toolbar a[href="kcact:refresh"] { background-image: url(img/icons/refresh.png); } #toolbar a[href="kcact:settings"] { background-image: url(img/icons/settings.png); } #toolbar a[href="kcact:about"] { background-image: url(img/icons/about.png); } #toolbar a[href="kcact:maximize"] { background-image: url(img/icons/maximize.png); } #settings { background: #e0dfde; } .box, #loading, #alert { padding: 5px; border: 1px solid #3687e2; background: #e0dfde; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } .box, #alert { padding: 8px; border-color: #fff; -moz-box-shadow: 0 0 8px rgba(255,255,255,1); -webkit-box-shadow: 0 0 8px rgba(255,255,255,1); box-shadow: 0 0 8px rgba(255,255,255,1); } #loading { background-image: url(img/loading.gif); font-weight: bold; margin-right: 4px; box-shadow: 0 0 3px rgba(54,135,226,1); -moz-box-shadow: 0 0 3px rgba(54,135,226,1); -webkit-box-shadow: 0 0 3px rgba(54,135,226,1); } #alert div.message, #dialog div.question { padding: 0 0 0 40px; } #alert { background: #e0dfde url(img/alert.png) no-repeat 8px 29px; } #dialog div.question { background: #e0dfde url(img/confirm.png) no-repeat 0 0; } #alert div.ok, #dialog div.buttons { padding-top: 5px; text-align: right; } .menu { padding: 2px; border: 1px solid #acaaa7; background: #e4e3e2; opacity: 0.95; } .menu a { text-decoration: none; padding: 3px 3px 3px 22px; background: no-repeat 2px center; color: #000; margin: 0; background-color: #e4e3e2; outline: none; border: 1px solid transparent; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } .menu .delimiter { border-top: 1px solid #acaaa7; padding-bottom: 3px; margin: 3px 2px 0 2px; } .menu a:hover { background-color: #cfcfcf; border-color: #afadaa; box-shadow: inset 0 0 3px rgba(175,173,170,1); -moz-box-shadow: inset 0 0 3px rgba(175,173,170,1); -webkit-box-shadow: inset 0 0 3px rgba(175,173,170,1); } .menu a[href="kcact:refresh"] { background-image: url(img/icons/refresh.png); } .menu a[href="kcact:mkdir"] { background-image: url(img/icons/folder-new.png); } .menu a[href="kcact:mvdir"], .menu a[href="kcact:mv"] { background-image: url(img/icons/rename.png); } .menu a[href="kcact:rmdir"], .menu a[href="kcact:rm"], .menu a[href="kcact:rmcbd"] { background-image: url(img/icons/delete.png); } .menu a[href="kcact:clpbrdadd"] { background-image: url(img/icons/clipboard-add.png); } .menu a[href="kcact:pick"], .menu a[href="kcact:pick_thumb"] { background-image: url(img/icons/select.png); } .menu a[href="kcact:download"] { background-image: url(img/icons/download.png); } .menu a[href="kcact:view"] { background-image: url(img/icons/view.png); } .menu a[href="kcact:cpcbd"] { background-image: url(img/icons/copy.png); } .menu a[href="kcact:mvcbd"] { background-image: url(img/icons/move.png); } .menu a[href="kcact:clrcbd"] { background-image: url(img/icons/clipboard-clear.png); } a.denied { color: #666; opacity: 0.5; filter: alpha(opacity:50); cursor: default; } a.denied:hover { background-color: #e4e3e2; border-color: transparent; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; } #dialog { -moz-box-shadow: 0 0 5px rgba(0,0,0,0.5); -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.5); box-shadow: 0 0 5px rgba(0,0,0,0.5); } #dialog input[type="text"] { margin: 5px 0; width: 200px; } #dialog div.slideshow { border: 1px solid #000; padding: 5px 5px 3px 5px; background: #000; -moz-box-shadow: 0 0 8px rgba(255,255,255,1); -webkit-box-shadow: 0 0 8px rgba(255,255,255,1); box-shadow: 0 0 8px rgba(255,255,255,1); } #dialog img { padding: 0; margin: 0; background: url(img/bg_transparent.png); } #loadingDirs { padding: 5px 0 1px 24px; } .about { text-align: center; } .about div.head { font-weight: bold; font-size: 12px; padding: 3px 0 8px 0; } .about div.head a { background: url(img/kcf_logo.png) no-repeat left center; padding: 0 0 0 27px; font-size: 17px; } .about a { text-decoration: none; color: #0055ff; } .about a:hover { text-decoration: underline; } .about button { margin-top: 8px; } #clipboard { padding: 0 4px 1px 0; } #clipboard div { background: url(img/icons/clipboard.png) no-repeat center center; border: 1px solid transparent; padding: 1px; cursor: pointer; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } #clipboard div:hover { background-color: #bfbdbb; border-color: #a9a59f; } #clipboard.selected div, #clipboard.selected div:hover { background-color: #c9c7c4; border-color: #3687e2; } #checkver { padding-bottom: 8px; } #checkver > span { padding: 2px; border: 1px solid transparent; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } #checkver > span.loading { background: url(img/loading.gif); border: 1px solid #3687e2; box-shadow: 0 0 3px rgba(54,135,226,1); -moz-box-shadow: 0 0 3px rgba(54,135,226,1); -webkit-box-shadow: 0 0 3px rgba(54,135,226,1); } #checkver span { padding: 3px; } #checkver a { font-weight: normal; padding: 3px 3px 3px 20px; background: url(img/icons/download.png) no-repeat left center; } div.title { overflow: auto; text-align: center; margin: -3px -5px 5px -5px; padding-left: 19px; padding-bottom: 2px; border-bottom: 1px solid #bbb; font-weight: bold; cursor: move; } .about div.title { cursor: default; } span.close, span.clicked { float: right; width: 19px; height: 19px; background: url(img/icons/close.png); margin-top: -3px; cursor: default; } span.close:hover { background: url(img/icons/close-hover.png); } span.clicked:hover { background: url(img/icons/close-clicked.png); }
0x6a
trunk/libraries/kcfinder/themes/oxygen/style.css
CSS
asf20
11,492
// If this file exists in theme directory, it will be loaded in <head> section var imgLoading = new Image(); imgLoading.src = 'themes/oxygen/img/loading.gif';
0x6a
trunk/libraries/kcfinder/themes/oxygen/init.js
JavaScript
asf20
160
body { background: #3B4148; color: #ffffff; } input { margin: 0; } input[type="radio"], input[type="checkbox"], label { cursor: pointer; } input[type="text"] { border: 1px solid #3B4148; background: #fff; padding: 2px; margin: 0; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; outline-width: 0; } input[type="text"]:hover { border-color: #69727B; } input[type="text"]:focus { border-color: #69727B; box-shadow: 0 0 3px rgba(0,0,0,1); -moz-box-shadow: 0 0 3px rgba(0,0,0,1); -webkit-box-shadow: 0 0 3px rgba(0,0,0,1); } input[type="button"], input[type="submit"], input[type="reset"], button { outline-width: 0; background: #edeceb; border: 1px solid #fff; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow: 0 1px 1px rgba(0,0,0,0.6); -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.6); -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.6); color: #222; } input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover, button:hover { box-shadow: 0 0 1px rgba(0,0,0,0.6); -moz-box-shadow: 0 0 1px rgba(0,0,0,0.6); -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.6); } input[type="button"]:focus, input[type="submit"]:focus, input[type="reset"]:focus, button:focus { box-shadow: 0 0 2px rgba(54,135,226,1); -moz-box-shadow: 0 0 2px rgba(255,255,255,1); -webkit-box-shadow: 0 0 2px rgba(54,135,226,1); } fieldset { margin: 0 5px 5px 0px; padding: 5px; border: 1px solid #69727B; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; cursor: default; } fieldset td { white-space: nowrap; } legend { margin: 0; padding:0 3px; font-weight: bold; } #folders { margin: 4px 4px 0 4px; background: #566068; border: 1px solid #69727B; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; } #files { float: left; margin: 0 4px 0 0; background: #566068; border: 1px solid #69727B; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; } #files.drag { background: #69727B; } #topic { padding-left: 12px; } div.folder { padding-top: 2px; margin-top: 4px; white-space: nowrap; } div.folder a { text-decoration: none; cursor: default; outline: none; color: #ffffff; } span.folder { padding: 2px 3px 2px 23px; outline: none; background: no-repeat 3px center; cursor: pointer; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border: 1px solid #566068; } span.brace { width: 16px; height: 16px; outline: none; } span.current { background-image: url(img/tree/folder_current.png); background-color: #454C55; border-color: #3B4148; color: #fff; } span.regular { background-image: url(img/tree/folder.png); background-color: #69727B; } span.regular:hover, span.context { background-color: #9199A1; border-color: #69727B } span.opened { background-image: url(img/tree/minus.png); } span.closed { background-image: url(img/tree/plus.png); } span.denied { background-image: url(img/tree/denied.png); } div.file { padding: 4px; margin: 3px; border: 1px solid #3B4148; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; background: #69727B; color: #000000; } div.file:hover { background: #9199A1; border-color: #3B4148; } div.file .name { margin-top: 4px; font-weight: normal; height: 16px; overflow: hidden; } div.file .time { font-size: 10px; } div.file .size { font-size: 10px; } #files div.selected, #files div.selected:hover { background-color: #3B4148; border-color: #69727B; color: #ffffff; } tr.file > td { padding: 3px 4px; background-color: #69727B } tr.file:hover > td { background-color: #9199A1; } tr.selected > td, tr.selected:hover > td { background-color: #3B4148; color: #fff; } #toolbar { padding: 5px 0; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } #toolbar a { color: #ffffff; padding: 4px 4px 4px 24px; margin-right: 5px; border: 1px solid transparent; background: no-repeat 2px center; outline: none; display: block; float: left; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } #toolbar a:hover, #toolbar a.hover { background-color: #566068; border-color: #69727B; color: #ffffff; } #toolbar a.selected { background-color: #566068; border-color: #69727B; } #toolbar a[href="kcact:upload"] { background-image: url(img/icons/upload.png); } #toolbar a[href="kcact:refresh"] { background-image: url(img/icons/refresh.png); } #toolbar a[href="kcact:settings"] { background-image: url(img/icons/settings.png); } #toolbar a[href="kcact:about"] { background-image: url(img/icons/about.png); } #toolbar a[href="kcact:maximize"] { background-image: url(img/icons/maximize.png); } #settings { /*background: #e0dfde;*/ } .box, #loading, #alert { padding: 5px; border: 1px solid #69727B; background: #566068; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } .box, #alert { padding: 8px; border-color: #69727B; -moz-box-shadow: 0 0 8px rgba(0,0,0,1); -webkit-box-shadow: 0 0 8px rgba(0,0,0,1); box-shadow: 0 0 8px rgba(0,0,0,1); } #loading { background-image: url(img/loading.gif); font-weight: normal; margin-right: 4px; color: #ffffff; } #alert div.message { padding: 0 0 0 40px; } #alert { background: #566068 url(img/cross.png) no-repeat 8px 29px; } #dialog div.question { padding: 0 0 0 40px; background: transparent url(img/question.png) no-repeat 0 0; } #alert div.ok, #dialog div.buttons { padding-top: 5px; text-align: right; } .menu { padding: 2px; border: 1px solid #69727B; background: #3B4148; opacity: 0.95; } .menu a { text-decoration: none; padding: 3px 3px 3px 22px; background: no-repeat 2px center; color: #ffffff; margin: 0; background-color: #3B4148; outline: none; border: 1px solid transparent; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } .menu .delimiter { border-top: 1px solid #69727B; padding-bottom: 3px; margin: 3px 2px 0 2px; } .menu a:hover { background-color: #566068; border-color: #69727B; } .menu a[href="kcact:refresh"] { background-image: url(img/icons/refresh.png); } .menu a[href="kcact:mkdir"] { background-image: url(img/icons/folder-new.png); } .menu a[href="kcact:mvdir"], .menu a[href="kcact:mv"] { background-image: url(img/icons/rename.png); } .menu a[href="kcact:rmdir"], .menu a[href="kcact:rm"], .menu a[href="kcact:rmcbd"] { background-image: url(img/icons/delete.png); } .menu a[href="kcact:clpbrdadd"] { background-image: url(img/icons/clipboard-add.png); } .menu a[href="kcact:pick"], .menu a[href="kcact:pick_thumb"] { background-image: url(img/icons/select.png); } .menu a[href="kcact:download"] { background-image: url(img/icons/download.png); } .menu a[href="kcact:view"] { background-image: url(img/icons/view.png); } .menu a[href="kcact:cpcbd"] { background-image: url(img/icons/copy.png); } .menu a[href="kcact:mvcbd"] { background-image: url(img/icons/move.png); } .menu a[href="kcact:clrcbd"] { background-image: url(img/icons/clipboard-clear.png); } a.denied { color: #666; opacity: 0.5; filter: alpha(opacity:50); cursor: default; } a.denied:hover { background-color: #e4e3e2; border-color: transparent; } #dialog { -moz-box-shadow: 0 0 5px rgba(0,0,0,0.5); -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.5); box-shadow: 0 0 5px rgba(0,0,0,0.5); } #dialog input[type="text"] { margin: 5px 0; width: 200px; } #dialog div.slideshow { border: 1px solid #000; padding: 5px 5px 3px 5px; background: #000; -moz-box-shadow: 0 0 8px rgba(0,0,0,1); -webkit-box-shadow: 0 0 8px rgba(0,0,0,1); box-shadow: 0 0 8px rgba(0,0,0,1); } #dialog img { border: 1px solid #3687e2; background: url(img/bg_transparent.png); } #loadingDirs { padding: 5px 0 1px 24px; } .about { text-align: center; padding: 6px; } .about div.head { font-weight: bold; font-size: 12px; padding: 3px 0 8px 0; } .about div.head a { background: url(img/kcf_logo.png) no-repeat left center; padding: 0 0 0 27px; font-size: 17px; } .about a { text-decoration: none; color: #ffffff; } .about a:hover { text-decoration: underline; } .about button { margin-top: 8px; } #clipboard { padding: 0 4px 1px 0; } #clipboard div { background: url(img/icons/clipboard.png) no-repeat center center; border: 1px solid transparent; padding: 1px; cursor: pointer; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } #clipboard div:hover { background-color: #bfbdbb; border-color: #a9a59f; } #clipboard.selected div, #clipboard.selected div:hover { background-color: #c9c7c4; border-color: #3687e2; } #shadow {background: #000000;} button, input[type="submit"], input[type="button"] { color: #ffffff; background: #3B4148; border: 1px solid #69727B; padding: 3px 5px; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px;} #checkver { padding-bottom: 8px; } #checkver > span { border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } #checkver > span.loading { background: url(img/loading.gif); } #checkver span { padding: 2px; } #checkver a { font-weight: normal; padding: 3px 3px 3px 20px; background: url(img/icons/download.png) no-repeat left center; } div.title { background: #1a1d1f; overflow: auto; text-align: center; margin: -5px -5px 5px -5px; padding-left: 19px; padding-bottom: 2px; padding-top: 2px; font-weight: bold; cursor: move; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; box-shadow: 0 0 1px rgba(0,0,0,0.6); -moz-box-shadow: 0 0 1px rgba(0,0,0,0.6); -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.6); } .about div.title { cursor: default; } span.close, span.clicked { float: right; width: 19px; height: 20px; background: url(img/icons/close.png) no-repeat left 2px; margin-top: -3px; cursor: default; } span.close:hover { background-image: url(img/icons/close-hover.png); } span.clicked:hover { background-image: url(img/icons/close-clicked.png); }
0x6a
trunk/libraries/kcfinder/themes/dark/style.css
CSS
asf20
10,864
// If this file exists in theme directory, it will be loaded in <head> section var imgLoading = new Image(); imgLoading.src = 'themes/dark/img/loading.gif';
0x6a
trunk/libraries/kcfinder/themes/dark/init.js
JavaScript
asf20
158
<!DOCTYPE html> <html lang="en"> <head> <title>403 Request forbidden</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style type="text/css"> body{background: #ebebeb;font-family: dotum,tahoma} .error_contain{ padding: 0px; position:relative; } .error_contain div{ width:500px;margin:0 auto; } .error_contain h1{ padding: 40px 0; font-family: arial; text-align: center; margin: 0; font-size: 169px; line-height: normal; color: #ffffff; text-shadow: 0 0 10px #ffffff, 0 4px 3px #ffffff, 0 9px 3px #dddddd, 0 12px 1px #cccccc, 0 14px 5px rgba(0, 0, 0, 0.4), 0 20px 10px rgba(0, 0, 0, 0.1), 0 15px 80px rgba(0, 0, 100, 0.2); } .error_contain h3{color: #777;margin: 0;padding: 8px;padding-top: 20px} .error_contain p{margin: 0;padding: 8px;color: #777;text-align: justify;font-size: 13px} </style> </head> <body> <div class="error_contain"> <h1 style="">403</h1> <div> <h3>Oops! Request forbidden...<span style="float: right">٩(๏̯͡๏)۶</span></h3> <p> Sorry, it appears the page you were looking for is forbidden and not accessible. If the problem persists, please contact our support at example@domain.com. </p> </div> </div> </body> </html>
0x6a
trunk/libraries/kcfinder/index.html
HTML
asf20
1,319
<?php /** This file is part of KCFinder project1 * * @desc Browser calling script * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ require "core/autoload.php"; $browser = new browser(); $browser->action(); ?>
0x6a
trunk/libraries/kcfinder/browse.php
PHP
asf20
513
<?php /** This file is part of KCFinder project * * @desc Load language labels into JavaScript * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ error_reporting(0); require "core/autoload.php"; if (function_exists('set_magic_quotes_runtime')) @set_magic_quotes_runtime(false); $input = new input(); if (!isset($input->get['lng']) || ($input->get['lng'] == 'en')) { header("Content-Type: text/javascript"); die; } $file = "lang/" . $input->get['lng'] . ".php"; $files = dir::content("lang", array( 'types' => "file", 'pattern' => '/^.*\.php$/' )); if (!in_array($file, $files)) { header("Content-Type: text/javascript"); die; } $mtime = @filemtime($file); if ($mtime) httpCache::checkMTime($mtime); require $file; header("Content-Type: text/javascript; charset={$lang['_charset']}"); foreach ($lang as $english => $native) if (substr($english, 0, 1) != "_") echo "browser.labels['" . text::jsValue($english) . "']=\"" . text::jsValue($native) . "\";"; ?>
0x6a
trunk/libraries/kcfinder/js_localize.php
PHP
asf20
1,289
<?php /** This file is part of KCFinder project * * @desc Base configuration file * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ // IMPORTANT!!! Do not remove uncommented settings in this file even if // you are using session configuration. // See http://kcfinder.sunhater.com/install for setting descriptions $_CONFIG = array( 'disabled' => true, 'denyZipDownload' => false, 'denyUpdateCheck' => false, 'denyExtensionRename' => false, 'theme' => "oxygen", 'uploadURL' => "../../0x4D", 'uploadDir' => "../../0x4D", 'dirPerms' => 0755, 'filePerms' => 0644, 'access' => array( 'files' => array( 'upload' => false, 'delete' => false, 'copy' => false, 'move' => false, 'rename' => false ), 'dirs' => array( 'create' => false, 'delete' => false, 'rename' => false ) ), 'deniedExts' => "exe com msi bat php phps phtml php3 php4 cgi pl tpl ch chm htm html xhtml", 'types' => array( // CKEditor & FCKEditor types '0x1A' => "bmp gif jpeg jpg png ico webp", '0x2A' => "doc txt docx pdf", 'image' => "bmp gif jpeg jpg png ico", 'mimages' => "*mime image/gif image/png image/jpeg", 'notimages' => "*mime ! image/gif image/png image/jpeg", 'flash' => "swf", // TinyMCE types 'image' => "bmp gif jpeg jpg png ico", 'media' => "swf flv avi mpg mpeg qt mov wmv asf rm", 'file' => '', ), 'filenameChangeChars' => array( ' ' => "_", ':' => "." ), 'dirnameChangeChars' => array( ' ' => "_", ':' => "." ), 'mime_magic' => "", 'maxImageWidth' => 800, 'maxImageHeight' => 800, 'thumbWidth' => 120, 'thumbHeight' => 120, 'thumbsDir' => "0x00", 'jpegQuality' => 90, 'cookieDomain' => "", 'cookiePath' => "", 'cookiePrefix' => 'KCFINDER_', // THE FOLLOWING SETTINGS CANNOT BE OVERRIDED WITH SESSION CONFIGURATION '_check4htaccess' => true, '_tinyMCEPath' => "../tiny_mce", '_sessionVar' => &$_SESSION['KCFINDER'], '_sessionLifetime' => 30, //'_sessionDir' => "/full/directory/path", //'_sessionDomain' => ".mysite.com", //'_sessionPath' => "/my/path", ); ?>
0x6a
trunk/libraries/kcfinder/config.php
PHP
asf20
2,647
<?php /** This file is part of KCFinder project * * @desc File helper class * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class file { static $MIME = array( 'ai' => 'application/postscript', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'avi' => 'video/x-msvideo', 'bin' => 'application/macbinary', 'bmp' => 'image/bmp', 'cpt' => 'application/mac-compactpro', 'css' => 'text/css', 'csv' => 'text/x-comma-separated-values', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'doc' => 'application/msword', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'dvi' => 'application/x-dvi', 'dxr' => 'application/x-director', 'eml' => 'message/rfc822', 'eps' => 'application/postscript', 'flv' => 'video/x-flv', 'gif' => 'image/gif', 'gtar' => 'application/x-gtar', 'gz' => 'application/x-gzip', 'hqx' => 'application/mac-binhex40', 'htm' => 'text/html', 'html' => 'text/html', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'js' => 'application/x-javascript', 'log' => 'text/plain', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mif' => 'application/vnd.mif', 'mov' => 'video/quicktime', 'movie' => 'video/x-sgi-movie', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpga' => 'audio/mpeg', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'php' => 'application/x-httpd-php', 'php3' => 'application/x-httpd-php', 'php4' => 'application/x-httpd-php', 'phps' => 'application/x-httpd-php-source', 'phtml' => 'application/x-httpd-php', 'png' => 'image/png', 'ppt' => 'application/powerpoint', 'ps' => 'application/postscript', 'psd' => 'application/x-photoshop', 'qt' => 'video/quicktime', 'ra' => 'audio/x-realaudio', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'rtf' => 'text/rtf', 'rtx' => 'text/richtext', 'rv' => 'video/vnd.rn-realvideo', 'shtml' => 'text/html', 'sit' => 'application/x-stuffit', 'smi' => 'application/smil', 'smil' => 'application/smil', 'swf' => 'application/x-shockwave-flash', 'tar' => 'application/x-tar', 'tgz' => 'application/x-tar', 'text' => 'text/plain', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'txt' => 'text/plain', 'wav' => 'audio/x-wav', 'wbxml' => 'application/wbxml', 'wmlc' => 'application/wmlc', 'word' => 'application/msword', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'xl' => 'application/excel', 'xls' => 'application/excel', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xml' => 'text/xml', 'xsl' => 'text/xml', 'zip' => 'application/x-zip' ); /** Checks if the given file is really writable. The standard PHP function * is_writable() does not work properly on Windows servers. * @param string $dir * @return bool */ static function isWritable($filename) { $filename = path::normalize($filename); if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) return false; fclose($fp); return true; } /** Get the extension from filename * @param string $file * @param bool $toLower * @return string */ static function getExtension($filename, $toLower=true) { return preg_match('/^.*\.([^\.]*)$/s', $filename, $patt) ? ($toLower ? strtolower($patt[1]) : $patt[1]) : ""; } /** Get MIME type of the given filename. If Fileinfo PHP extension is * available the MIME type will be fetched by the file's content. The * second parameter is optional and defines the magic file path. If you * skip it, the default one will be loaded. * If Fileinfo PHP extension is not available the MIME type will be fetched * by filename extension regarding $MIME property. If the file extension * does not exist there, returned type will be application/octet-stream * @param string $filename * @param string $magic * @return string */ static function getMimeType($filename, $magic=null) { if (class_exists("finfo")) { $finfo = ($magic === null) ? new finfo(FILEINFO_MIME) : new finfo(FILEINFO_MIME, $magic); if ($finfo) { $mime = $finfo->file($filename); $mime = substr($mime, 0, strrpos($mime, ";")); return $mime; } } $ext = self::getExtension($filename, true); return isset(self::$MIME[$ext]) ? self::$MIME[$ext] : "application/octet-stream"; } /** Get inexistant filename based on the given filename. If you skip $dir * parameter the directory will be fetched from $filename and returned * value will be full filename path. The third parameter is optional and * defines the template, the filename will be renamed to. Default template * is {name}({sufix}){ext}. Examples: * * file::getInexistantFilename("/my/directory/myfile.txt"); * If myfile.txt does not exist - returns the same path to the file * otherwise returns "/my/directory/myfile(1).txt" * * file::getInexistantFilename("myfile.txt", "/my/directory"); * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... * * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... * * @param string $filename * @param string $dir * @param string $tpl * @return string */ static function getInexistantFilename($filename, $dir=null, $tpl=null) { if ($tpl === null) $tpl = "{name}({sufix}){ext}"; $fullPath = ($dir === null); if ($fullPath) $dir = path::normalize(dirname($filename)); else { $fdir = dirname($filename); $dir = strlen($fdir) ? path::normalize("$dir/$fdir") : path::normalize($dir); } $filename = basename($filename); $ext = self::getExtension($filename, false); $name = strlen($ext) ? substr($filename, 0, -strlen($ext) - 1) : $filename; $tpl = str_replace('{name}', $name, $tpl); $tpl = str_replace('{ext}', (strlen($ext) ? ".$ext" : ""), $tpl); $i = 1; $file = "$dir/$filename"; while (file_exists($file)) $file = "$dir/" . str_replace('{sufix}', $i++, $tpl); return $fullPath ? $file : (strlen($fdir) ? "$fdir/" . basename($file) : basename($file)); } } ?>
0x6a
trunk/libraries/kcfinder/lib/helper_file.php
PHP
asf20
7,733
<?php /** This file is part of KCFinder project * * @desc Input class for GET, POST and COOKIE requests * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class input { /** Filtered $_GET array * @var array */ public $get; /** Filtered $_POST array * @var array */ public $post; /** Filtered $_COOKIE array * @var array */ public $cookie; /** magic_quetes_gpc ini setting flag * @var bool */ protected $magic_quotes_gpc; /** magic_quetes_sybase ini setting flag * @var bool */ protected $magic_quotes_sybase; public function __construct() { $this->magic_quotes_gpc = function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); $this->magic_quotes_sybase = ini_get('magic_quotes_sybase'); $this->magic_quotes_sybase = $this->magic_quotes_sybase ? !in_array(strtolower(trim($this->magic_quotes_sybase)), array('off', 'no', 'false')) : false; $_GET = $this->filter($_GET); $_POST = $this->filter($_POST); $_COOKIE = $this->filter($_COOKIE); $this->get = &$_GET; $this->post = &$_POST; $this->cookie = &$_COOKIE; } /** Magic method to get non-public properties like public. * @param string $property * @return mixed */ public function __get($property) { return property_exists($this, $property) ? $this->$property : null; } /** Filter the given subject. If magic_quotes_gpc and/or magic_quotes_sybase * ini settings are turned on, the method will remove backslashes from some * escaped characters. If the subject is an array, elements with non- * alphanumeric keys will be removed * @param mixed $subject * @return mixed */ public function filter($subject) { if ($this->magic_quotes_gpc) { if (is_array($subject)) { foreach ($subject as $key => $val) if (!preg_match('/^[a-z\d_]+$/si', $key)) unset($subject[$key]); else $subject[$key] = $this->filter($val); } elseif (is_scalar($subject)) $subject = $this->magic_quotes_sybase ? str_replace("\\'", "'", $subject) : stripslashes($subject); } return $subject; } } ?>
0x6a
trunk/libraries/kcfinder/lib/class_input.php
PHP
asf20
2,659
<?php /** This file is part of KCFinder project. The class are taken from * http://www.php.net/manual/en/function.ziparchive-addemptydir.php * * @desc Directory to ZIP file archivator * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class zipFolder { protected $zip; protected $root; protected $ignored; function __construct($file, $folder, $ignored=null) { $this->zip = new ZipArchive(); $this->ignored = is_array($ignored) ? $ignored : ($ignored ? array($ignored) : array()); if ($this->zip->open($file, ZIPARCHIVE::CREATE) !== TRUE) throw new Exception("cannot open <$file>\n"); $folder = rtrim($folder, '/'); if (strstr($folder, '/')) { $this->root = substr($folder, 0, strrpos($folder, '/') + 1); $folder = substr($folder, strrpos($folder, '/') + 1); } $this->zip($folder); $this->zip->close(); } function zip($folder, $parent=null) { $full_path = "{$this->root}$parent$folder"; $zip_path = "$parent$folder"; $this->zip->addEmptyDir($zip_path); $dir = new DirectoryIterator($full_path); foreach ($dir as $file) if (!$file->isDot()) { $filename = $file->getFilename(); if (!in_array($filename, $this->ignored)) { if ($file->isDir()) $this->zip($filename, "$zip_path/"); else $this->zip->addFile("$full_path/$filename", "$zip_path/$filename"); } } } } ?>
0x6a
trunk/libraries/kcfinder/lib/class_zipFolder.php
PHP
asf20
1,915
<?php /** This file is part of KCFinder project * * @desc Path helper class * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class path { /** Get the absolute URL path of the given one. Returns FALSE if the URL * is not valid or the current directory cannot be resolved (getcwd()) * @param string $path * @return string */ static function rel2abs_url($path) { if (substr($path, 0, 1) == "/") return $path; $dir = @getcwd(); if (!isset($_SERVER['DOCUMENT_ROOT']) || ($dir === false)) return false; $dir = self::normalize($dir); $doc_root = self::normalize($_SERVER['DOCUMENT_ROOT']); if (substr($dir, 0, strlen($doc_root)) != $doc_root) return false; $return = self::normalize(substr($dir, strlen($doc_root)) . "/$path"); if (substr($return, 0, 1) !== "/") $return = "/$return"; return $return; } /** Resolve full filesystem path of given URL. Returns FALSE if the URL * cannot be resolved * @param string $url * @return string */ static function url2fullPath($url) { $url = self::normalize($url); $uri = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : (isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : false); $uri = self::normalize($uri); if (substr($url, 0, 1) !== "/") { if ($uri === false) return false; $url = dirname($uri) . "/$url"; } if (isset($_SERVER['DOCUMENT_ROOT'])) { return self::normalize($_SERVER['DOCUMENT_ROOT'] . "/$url"); } else { if ($uri === false) return false; if (isset($_SERVER['SCRIPT_FILENAME'])) { $scr_filename = self::normalize($_SERVER['SCRIPT_FILENAME']); return self::normalize(substr($scr_filename, 0, -strlen($uri)) . "/$url"); } $count = count(explode('/', $uri)) - 1; for ($i = 0, $chdir = ""; $i < $count; $i++) $chdir .= "../"; $chdir = self::normalize($chdir); $dir = getcwd(); if (($dir === false) || !@chdir($chdir)) return false; $rdir = getcwd(); chdir($dir); return ($rdir !== false) ? self::normalize($rdir . "/$url") : false; } } /** Normalize the given path. On Windows servers backslash will be replaced * with slash. Remobes unnecessary doble slashes and double dots. Removes * last slash if it exists. Examples: * path::normalize("C:\\any\\path\\") returns "C:/any/path" * path::normalize("/your/path/..//home/") returns "/your/home" * @param string $path * @return string */ static function normalize($path) { if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") { $path = preg_replace('/([^\\\])\\\([^\\\])/', "$1/$2", $path); if (substr($path, -1) == "\\") $path = substr($path, 0, -1); if (substr($path, 0, 1) == "\\") $path = "/" . substr($path, 1); } $path = preg_replace('/\/+/s', "/", $path); $path = "/$path"; if (substr($path, -1) != "/") $path .= "/"; $expr = '/\/([^\/]{1}|[^\.\/]{2}|[^\/]{3,})\/\.\.\//s'; while (preg_match($expr, $path)) $path = preg_replace($expr, "/", $path); $path = substr($path, 0, -1); $path = substr($path, 1); return $path; } /** Encode URL Path * @param string $path * @return string */ static function urlPathEncode($path) { $path = self::normalize($path); $encoded = ""; foreach (explode("/", $path) as $dir) $encoded .= rawurlencode($dir) . "/"; $encoded = substr($encoded, 0, -1); return $encoded; } /** Decode URL Path * @param string $path * @return string */ static function urlPathDecode($path) { $path = self::normalize($path); $decoded = ""; foreach (explode("/", $path) as $dir) $decoded .= rawurldecode($dir) . "/"; $decoded = substr($decoded, 0, -1); return $decoded; } } ?>
0x6a
trunk/libraries/kcfinder/lib/helper_path.php
PHP
asf20
4,511
<?php /** This file is part of KCFinder project * * @desc HTTP cache helper class * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class httpCache { const DEFAULT_TYPE = "text/html"; const DEFAULT_EXPIRE = 604800; // in seconds /** Cache a file. The $type parameter might define the MIME type of the file * or path to magic file to autodetect the MIME type. If you skip $type * parameter the method will try with the default magic file. Autodetection * of MIME type requires Fileinfo PHP extension used in file::getMimeType() * @param string $file * @param string $type * @param integer $expire * @param array $headers */ static function file($file, $type=null, $expire=null, array $headers=null) { $mtime = @filemtime($file); if ($mtime !== false) self::checkMTime($mtime); if ($type === null) { $magic = ((substr($type, 0, 1) == "/") || preg_match('/^[a-z]\:/i', $type)) ? $type : null; $type = file::getMimeType($file, $magic); if (!$type) $type = null; } self::content(@file_get_contents($file), $mtime, $type, $expire, $headers, false); } /** Cache the given $content with $mtime modification time. * @param binary $content * @param integer $mtime * @param string $type * @param integer $expire * @param array $headers * @param bool $checkMTime */ static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) { if ($checkMTime) self::checkMTime($mtime); if ($type === null) $type = self::DEFAULT_TYPE; if ($expire === null) $expire = self::DEFAULT_EXPIRE; $size = strlen($content); $expires = gmdate("D, d M Y H:i:s", time() + $expire) . " GMT"; header("Content-Type: $type"); header("Expires: $expires"); header("Cache-Control: max-age=$expire"); header("Pragma: !invalid"); header("Content-Length: $size"); if ($headers !== null) foreach ($headers as $header) header($header); echo $content; } /** Check if given modification time is newer than client-side one. If not, * the method will tell the client to get the content from its own cache. * Afterwards the script process will be terminated. This feature requires * the PHP to be configured as Apache module. * @param integer $mtime */ static function checkMTime($mtime, $sendHeaders=null) { header("Last-Modified: " . gmdate("D, d M Y H:i:s", $mtime) . " GMT"); $headers = function_exists("getallheaders") ? getallheaders() : (function_exists("apache_request_headers") ? apache_request_headers() : false); if (is_array($headers) && isset($headers['If-Modified-Since'])) { $client_mtime = explode(';', $headers['If-Modified-Since']); $client_mtime = @strtotime($client_mtime[0]); if ($client_mtime >= $mtime) { header('HTTP/1.1 304 Not Modified'); if (is_array($sendHeaders) && count($sendHeaders)) foreach ($sendHeaders as $header) header($header); elseif ($sendHeaders !== null) header($sendHeaders); die; } } } } ?>
0x6a
trunk/libraries/kcfinder/lib/helper_httpCache.php
PHP
asf20
3,691
<?php /** This file is part of KCFinder project * * @desc Directory helper class * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class dir { /** Checks if the given directory is really writable. The standard PHP * function is_writable() does not work properly on Windows servers * @param string $dir * @return bool */ static function isWritable($dir) { $dir = path::normalize($dir); if (!is_dir($dir)) return false; $i = 0; do { $file = "$dir/is_writable_" . md5($i++); } while (file_exists($file)); if (!@touch($file)) return false; unlink($file); return true; } /** Recursively delete the given directory. Returns TRUE on success. * If $firstFailExit parameter is true (default), the method returns the * path to the first failed file or directory which cannot be deleted. * If $firstFailExit is false, the method returns an array with failed * files and directories which cannot be deleted. The third parameter * $failed is used for internal use only. * @param string $dir * @param bool $firstFailExit * @param array $failed * @return mixed */ static function prune($dir, $firstFailExit=true, array $failed=null) { if ($failed === null) $failed = array(); $files = self::content($dir); if ($files === false) { if ($firstFailExit) return $dir; $failed[] = $dir; return $failed; } foreach ($files as $file) { if (is_dir($file)) { $failed_in = self::prune($file, $firstFailExit, $failed); if ($failed_in !== true) { if ($firstFailExit) return $failed_in; if (is_array($failed_in)) $failed = array_merge($failed, $failed_in); else $failed[] = $failed_in; } } elseif (!@unlink($file)) { if ($firstFailExit) return $file; $failed[] = $file; } } if (!@rmdir($dir)) { if ($firstFailExit) return $dir; $failed[] = $dir; } return count($failed) ? $failed : true; } /** Get the content of the given directory. Returns an array with filenames * or FALSE on failure * @param string $dir * @param array $options * @return mixed */ static function content($dir, array $options=null) { $defaultOptions = array( 'types' => "all", // Allowed: "all" or possible return values // of filetype(), or an array with them 'addPath' => true, // Whether to add directory path to filenames 'pattern' => '/./', // Regular expression pattern for filename 'followLinks' => true ); if (!is_dir($dir) || !is_readable($dir)) return false; if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") $dir = str_replace("\\", "/", $dir); $dir = rtrim($dir, "/"); $dh = @opendir($dir); if ($dh === false) return false; if ($options === null) $options = $defaultOptions; foreach ($defaultOptions as $key => $val) if (!isset($options[$key])) $options[$key] = $val; $files = array(); while (($file = @readdir($dh)) !== false) { $type = filetype("$dir/$file"); if ($options['followLinks'] && ($type === "link")) { $lfile = "$dir/$file"; do { $ldir = dirname($lfile); $lfile = @readlink($lfile); if (substr($lfile, 0, 1) != "/") $lfile = "$ldir/$lfile"; $type = filetype($lfile); } while ($type == "link"); } if ((($type === "dir") && (($file == ".") || ($file == ".."))) || !preg_match($options['pattern'], $file) ) continue; if (($options['types'] === "all") || ($type === $options['types']) || ((is_array($options['types'])) && in_array($type, $options['types'])) ) $files[] = $options['addPath'] ? "$dir/$file" : $file; } closedir($dh); usort($files, "dir::fileSort"); return $files; } static function fileSort($a, $b) { if (function_exists("mb_strtolower")) { $a = mb_strtolower($a); $b = mb_strtolower($b); } else { $a = strtolower($a); $b = strtolower($b); } if ($a == $b) return 0; return ($a < $b) ? -1 : 1; } } ?>
0x6a
trunk/libraries/kcfinder/lib/helper_dir.php
PHP
asf20
5,190
<?php /** This file is part of KCFinder project * * @desc Text processing helper class * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class text { /** Replace repeated white spaces to single space * @param string $string * @return string */ static function clearWhitespaces($string) { return trim(preg_replace('/\s+/s', " ", $string)); } /** Normalize the string for HTML attribute value * @param string $string * @return string */ static function htmlValue($string) { return str_replace('"', "&quot;", str_replace("'", '&#39;', str_replace('<', '&lt;', str_replace('&', "&amp;", $string)))); } /** Normalize the string for JavaScript string value * @param string $string * @return string */ static function jsValue($string) { return preg_replace('/\r?\n/', "\\n", str_replace('"', "\\\"", str_replace("'", "\\'", str_replace("\\", "\\\\", $string)))); } /** Normalize the string for XML tag content data * @param string $string * @param bool $cdata */ static function xmlData($string, $cdata=false) { $string = str_replace("]]>", "]]]]><![CDATA[>", $string); if (!$cdata) $string = "<![CDATA[$string]]>"; return $string; } /** Returns compressed content of given CSS code * @param string $code * @return string */ static function compressCSS($code) { $code = self::clearWhitespaces($code); $code = preg_replace('/ ?\{ ?/', "{", $code); $code = preg_replace('/ ?\} ?/', "}", $code); $code = preg_replace('/ ?\; ?/', ";", $code); $code = preg_replace('/ ?\> ?/', ">", $code); $code = preg_replace('/ ?\, ?/', ",", $code); $code = preg_replace('/ ?\: ?/', ":", $code); $code = str_replace(";}", "}", $code); return $code; } } ?>
0x6a
trunk/libraries/kcfinder/lib/helper_text.php
PHP
asf20
2,269
<?php /** This file is part of KCFinder project * * @desc GD extension class * @package KCFinder * @version 2.51 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */ class gd { /** GD resource * @var resource */ protected $image; /** Image width * @var integer */ protected $width; /** Image height * @var integer */ protected $height; /** Init error * @var bool */ public $init_error = false; /** Last builded image type constant (IMAGETYPE_XXX) * @var integer */ public $type; /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. * Returns FALSE on failure. The only one parameter $image can be an instance of this class, * a GD resource, an array(width, height) or path to image file. * @param mixed $image * @return array */ protected function build_image($image) { if ($image instanceof gd) { $width = $image->get_width(); $height = $image->get_height(); $image = $image->get_image(); } elseif (is_resource($image) && (get_resource_type($image) == "gd")) { $width = @imagesx($image); $height = @imagesy($image); } elseif (is_array($image)) { list($key, $width) = each($image); list($key, $height) = each($image); $image = imagecreatetruecolor($width, $height); } elseif (false !== (list($width, $height, $type) = @getimagesize($image))) { $image = ($type == IMAGETYPE_GIF) ? @imagecreatefromgif($image) : ( ($type == IMAGETYPE_WBMP) ? @imagecreatefromwbmp($image) : ( ($type == IMAGETYPE_JPEG) ? @imagecreatefromjpeg($image) : ( ($type == IMAGETYPE_JPEG2000) ? @imagecreatefromjpeg($image) : ( ($type == IMAGETYPE_PNG) ? imagecreatefrompng($image) : ( ($type == IMAGETYPE_XBM) ? @imagecreatefromxbm($image) : false ))))); if ($type == IMAGETYPE_PNG) imagealphablending($image, false); } $return = ( is_resource($image) && (get_resource_type($image) == "gd") && isset($width) && isset($height) && (preg_match('/^[1-9][0-9]*$/', $width) !== false) && (preg_match('/^[1-9][0-9]*$/', $height) !== false) ) ? array($image, $width, $height) : false; if (($return !== false) && isset($type)) $this->type = $type; return $return; } /** Parameter $image can be: * 1. An instance of this class (copy instance). * 2. A GD resource. * 3. An array with two elements. First - width, second - height. Create a blank image. * 4. A filename string. Get image form file. * The non-required parameter $bigger_size is the bigger dimension (width or height) the image * will be resized to. The other dimension (height or width) will be calculated autamaticaly * @param mixed $image * @param integer $bigger_size * @return gd */ public function __construct($image, $bigger_size=null) { $this->image = $this->width = $this->height = null; $image_details = $this->build_image($image); if ($image_details !== false) list($this->image, $this->width, $this->height) = $image_details; else $this->init_error = true; if (!is_null($this->image) && !is_null($bigger_size) && (preg_match('/^[1-9][0-9]*$/', $bigger_size) !== false) ) { $image = $this->image; list($width, $height) = $this->get_prop_size($bigger_size); $this->image = imagecreatetruecolor($width, $height); if ($this->type == IMAGETYPE_PNG) { imagealphablending($this->image, false); imagesavealpha($this->image, true); } $this->width = $width; $this->height = $height; $this->imagecopyresampled($image); } } /** Returns the GD resource * @return resource */ public function get_image() { return $this->image; } /** Returns the image width * @return integer */ public function get_width() { return $this->width; } /** Returns the image height * @return integer */ public function get_height() { return $this->height; } /** Returns calculated proportional width from the given height * @param integer $resized_height * @return integer */ public function get_prop_width($resized_height) { $width = intval(($this->width * $resized_height) / $this->height); if (!$width) $width = 1; return $width; } /** Returns calculated proportional height from the given width * @param integer $resized_width * @return integer */ public function get_prop_height($resized_width) { $height = intval(($this->height * $resized_width) / $this->width); if (!$height) $height = 1; return $height; } /** Returns an array with calculated proportional width & height. * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. * The other dimension (height or width) will be calculated autamaticaly * @param integer $bigger_size * @return array */ public function get_prop_size($bigger_size) { if ($this->width > $this->height) { $width = $bigger_size; $height = $this->get_prop_height($width); } elseif ($this->height > $this->width) { $height = $bigger_size; $width = $this->get_prop_width($height); } else $width = $height = $bigger_size; return array($width, $height); } /** Resize image. Returns TRUE on success or FALSE on failure * @param integer $width * @param integer $height * @return bool */ public function resize($width, $height) { if (!$width) $width = 1; if (!$height) $height = 1; return ( (false !== ($img = new gd(array($width, $height)))) && $img->imagecopyresampled($this) && (false !== ($this->image = $img->get_image())) && (false !== ($this->width = $img->get_width())) && (false !== ($this->height = $img->get_height())) ); } /** Resize the given image source (GD, gd object or image file path) to fit in the own image. * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure * @param mixed $src * @return bool */ public function resize_crop($src) { $image_details = $this->build_image($src); if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; if (($src_width / $src_height) > ($this->width / $this->height)) { $src_w = $this->get_prop_width($src_height); $src_h = $src_height; $src_x = intval(($src_width - $src_w) / 2); $src_y = 0; } else { $src_w = $src_width; $src_h = $this->get_prop_height($src_width); $src_x = 0; $src_y = intval(($src_height - $src_h) / 2); } return imagecopyresampled($this->image, $src, 0, 0, $src_x, $src_y, $this->width, $this->height, $src_w, $src_h); } else return false; } /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure * @param integer $width * @param integer $height * @return bool */ public function resize_fit($width, $height) { if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) return true; if (!$width || (($height / $width) < ($this->height / $this->width))) $width = intval(($this->width * $height) / $this->height); elseif (!$height || (($width / $height) < ($this->width / $this->height))) $height = intval(($this->height * $width) / $this->width); if (!$width) $width = 1; if (!$height) $height = 1; return $this->resize($width, $height); } /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, * no samo po edno (x ili y) izmerenie * @param integer $width * @param integer $height * @return bool */ public function resize_overflow($width, $height) { $big = (($this->width / $this->height) > ($width / $height)) ? ($this->width * $height) / $this->height : ($this->height * $width) / $this->width; $big = intval($big); $return = ($img = new gd($this->image, $big)); if ($return) { $this->image = $img->get_image(); $this->width = $img->get_width(); $this->height = $img->get_height(); } return $return; } public function gd_color() { $args = func_get_args(); $expr_rgb = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; $expr_hex1 = '/^\#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i'; $expr_hex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; $expr_byte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; if (!isset($args[0])) return false; if (count($args[0]) == 3) { list($r, $g, $b) = $args[0]; } elseif (preg_match($expr_rgb, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_rgb, "$1 $2 $3", $args[0])); } elseif (preg_match($expr_hex1, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_hex1, "$1 $2 $3", $args[0])); $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); } elseif (preg_match($expr_hex2, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_hex2, "$1$1 $2$2 $3$3", $args[0])); $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); } elseif ((count($args) == 3) && preg_match($expr_byte, $args[0]) && preg_match($expr_byte, $args[1]) && preg_match($expr_byte, $args[2]) ) { list($r, $g, $b) = $args; } else return false; return imagecolorallocate($this->image, $r, $g, $b); } public function fill_color($color) { return $this->imagefilledrectangle(0, 0, $this->width - 1, $this->height - 1, $color); } /* G D M E T H O D S */ public function imagecopy( $src, $dst_x=0, $dst_y=0, $src_x=0, $src_y=0, $dst_w=null, $dst_h=null, $src_w=null, $src_h=null ) { $image_details = $this->build_image($src); if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; if (is_null($dst_w)) $dst_w = $this->width - $dst_x; if (is_null($dst_h)) $dst_h = $this->height - $dst_y; if (is_null($src_w)) $src_w = $src_width - $src_x; if (is_null($src_h)) $src_h = $src_height - $src_y; return imagecopy($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); } else return false; } public function imagecopyresampled( $src, $dst_x=0, $dst_y=0, $src_x=0, $src_y=0, $dst_w=null, $dst_h=null, $src_w=null, $src_h=null ) { $image_details = $this->build_image($src); if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; if (is_null($dst_w)) $dst_w = $this->width - $dst_x; if (is_null($dst_h)) $dst_h = $this->height - $dst_y; if (is_null($src_w)) $src_w = $src_width - $src_x; if (is_null($src_h)) $src_h = $src_height - $src_y; return imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); } else return false; } public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) { $color = $this->gd_color($color); if ($color === false) return false; return imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color); } public function imagepng($filename=null, $quality=null, $filters=null) { if (is_null($filename) && !headers_sent()) header("Content-Type: image/png"); @imagesavealpha($this->image, true); return imagepng($this->image, $filename, $quality, $filters); } public function imagejpeg($filename=null, $quality=75) { if (is_null($filename) && !headers_sent()) header("Content-Type: image/jpeg"); return imagejpeg($this->image, $filename, $quality); } public function imagegif($filename=null) { if (is_null($filename) && !headers_sent()) header("Content-Type: image/gif"); return imagegif($this->image, $filename); } } ?>
0x6a
trunk/libraries/kcfinder/lib/class_gd.php
PHP
asf20
13,501
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Galleria Flickr Plugin</title> <style> /* Demo styles */ html,body{background:#222;margin:0;} body{border-top:4px solid #000;} .content{color:#777;font:12px/1.4 "helvetica neue",arial,sans-serif;width:620px;margin:20px auto;} h1{font-size:12px;font-weight:normal;color:#ddd;margin:0;} p{margin:0 0 20px} a {color:#22BCB9;text-decoration:none;} .cred{margin-top:20px;font-size:11px;} /* This rule is read by Galleria to define the gallery height: */ #galleria{height:320px;} </style> <!-- load jQuery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> <!-- load Galleria --> <script src="../../galleria-1.2.7.min.js"></script> <!-- load flickr plugin --> <script src="galleria.flickr.min.js"></script> </head> <body> <div class="content"> <h1>Galleria Flickr Plugin Demo</h1> <p>Demonstrating a basic gallery example with a Flickr search.</p> <!-- Adding gallery images. This is just a container for the dynamic flickr images --> <div id="galleria"></div> <p class="cred">Made by <a href="http://galleria.aino.se">Galleria</a>.</p> </div> <script> // Load the classic theme Galleria.loadTheme('../../themes/classic/galleria.classic.min.js'); // Initialize Galleria Galleria.run('#galleria', { flickr: 'search:cityscape', flickrOptions: { sort: 'interestingness-desc' } }); </script> </body> </html>
0x6a
trunk/libraries/galleria/plugins/flickr/flickr-demo.html
HTML
asf20
1,736
/** * Galleria Flickr Plugin 2012-04-04 * http://galleria.io * * Licensed under the MIT license * https://raw.github.com/aino/galleria/master/LICENSE * */ (function($) { /*global jQuery, Galleria, window */ Galleria.requires(1.25, 'The Flickr Plugin requires Galleria version 1.2.5 or later.'); // The script path var PATH = Galleria.utils.getScriptPath(); /** @class @constructor @example var flickr = new Galleria.Flickr(); @author http://aino.se @requires jQuery @requires Galleria @param {String} [api_key] Flickr API key to be used, defaults to the Galleria key @returns Instance */ Galleria.Flickr = function( api_key ) { this.api_key = api_key || '2a2ce06c15780ebeb0b706650fc890b2'; this.options = { max: 30, // photos to return imageSize: 'medium', // photo size ( thumb,small,medium,big,original ) thumbSize: 'thumb', // thumbnail size ( thumb,small,medium,big,original ) sort: 'interestingness-desc', // sort option ( date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc, interestingness-desc, interestingness-asc, relevance ) description: false, // set this to true to get description as caption complete: function(){}, // callback to be called inside the Galleria.prototype.load backlink: false // set this to true if you want to pass a link back to the original image }; }; Galleria.Flickr.prototype = { // bring back the constructor reference constructor: Galleria.Flickr, /** Search for anything at Flickr @param {String} phrase The string to search for @param {Function} [callback] The callback to be called when the data is ready @returns Instance */ search: function( phrase, callback ) { return this._find({ text: phrase }, callback ); }, /** Search for anything at Flickr by tag @param {String} tag The tag(s) to search for @param {Function} [callback] The callback to be called when the data is ready @returns Instance */ tags: function( tag, callback ) { return this._find({ tags: tag }, callback); }, /** Get a user's public photos @param {String} username The username as shown in the URL to fetch @param {Function} [callback] The callback to be called when the data is ready @returns Instance */ user: function( username, callback ) { return this._call({ method: 'flickr.urls.lookupUser', url: 'flickr.com/photos/' + username }, function( data ) { this._find({ user_id: data.user.id, method: 'flickr.people.getPublicPhotos' }, callback); }); }, /** Get photos from a photoset by ID @param {String|Number} photoset_id The photoset id to fetch @param {Function} [callback] The callback to be called when the data is ready @returns Instance */ set: function( photoset_id, callback ) { return this._find({ photoset_id: photoset_id, method: 'flickr.photosets.getPhotos' }, callback); }, /** Get photos from a gallery by ID @param {String|Number} gallery_id The gallery id to fetch @param {Function} [callback] The callback to be called when the data is ready @returns Instance */ gallery: function( gallery_id, callback ) { return this._find({ gallery_id: gallery_id, method: 'flickr.galleries.getPhotos' }, callback); }, /** Search groups and fetch photos from the first group found Useful if you know the exact name of a group and want to show the groups photos. @param {String} group The group name to search for @param {Function} [callback] The callback to be called when the data is ready @returns Instance */ groupsearch: function( group, callback ) { return this._call({ text: group, method: 'flickr.groups.search' }, function( data ) { this.group( data.groups.group[0].nsid, callback ); }); }, /** Get photos from a group by ID @param {String} group_id The group id to fetch @param {Function} [callback] The callback to be called when the data is ready @returns Instance */ group: function ( group_id, callback ) { return this._find({ group_id: group_id, method: 'flickr.groups.pools.getPhotos' }, callback ); }, /** Set flickr options @param {Object} options The options object to blend @returns Instance */ setOptions: function( options ) { $.extend(this.options, options); return this; }, // call Flickr and raise errors _call: function( params, callback ) { var url = 'http://api.flickr.com/services/rest/?'; var scope = this; params = $.extend({ format : 'json', jsoncallback : '?', api_key: this.api_key }, params ); $.each(params, function( key, value ) { url += '&' + key + '=' + value; }); $.getJSON(url, function(data) { if ( data.stat === 'ok' ) { callback.call(scope, data); } else { Galleria.raise( data.code.toString() + ' ' + data.stat + ': ' + data.message, true ); } }); return scope; }, // "hidden" way of getting a big image (~1024) from flickr _getBig: function( photo ) { if ( photo.url_l ) { return photo.url_l; } else if ( parseInt( photo.width_o, 10 ) > 1280 ) { return 'http://farm'+photo.farm + '.static.flickr.com/'+photo.server + '/' + photo.id + '_' + photo.secret + '_b.jpg'; } return photo.url_o || photo.url_z || photo.url_m; }, // get image size by option name _getSize: function( photo, size ) { var img; switch(size) { case 'thumb': img = photo.url_t; break; case 'small': img = photo.url_s; break; case 'big': img = this._getBig( photo ); break; case 'original': img = photo.url_o ? photo.url_o : this._getBig( photo ); break; default: img = photo.url_z || photo.url_m; break; } return img; }, // ask flickr for photos, parse the result and call the callback with the galleria-ready data array _find: function( params, callback ) { params = $.extend({ method: 'flickr.photos.search', extras: 'url_t,url_m,url_o,url_s,url_l,url_z,description', sort: this.options.sort }, params ); return this._call( params, function(data) { var gallery = [], photos = data.photos ? data.photos.photo : data.photoset.photo, len = Math.min( this.options.max, photos.length ), photo, i; for ( i=0; i<len; i++ ) { photo = photos[i]; gallery.push({ thumb: this._getSize( photo, this.options.thumbSize ), image: this._getSize( photo, this.options.imageSize ), big: this._getBig( photo ), title: photos[i].title, description: this.options.description && photos[i].description ? photos[i].description._content : '', link: this.options.backlink ? 'http://flickr.com/photos/' + photo.owner + '/' + photo.id : '' }); } callback.call( this, gallery ); }); } }; /** Galleria modifications We fake-extend the load prototype to make Flickr integration as simple as possible */ // save the old prototype in a local variable var load = Galleria.prototype.load; // fake-extend the load prototype using the flickr data Galleria.prototype.load = function() { // pass if no data is provided or flickr option not found if ( arguments.length || typeof this._options.flickr !== 'string' ) { load.apply( this, Galleria.utils.array( arguments ) ); return; } // define some local vars var self = this, args = Galleria.utils.array( arguments ), flickr = this._options.flickr.split(':'), f, opts = $.extend({}, self._options.flickrOptions), loader = typeof opts.loader !== 'undefined' ? opts.loader : $('<div>').css({ width: 48, height: 48, opacity: 0.7, background:'#000 url('+PATH+'loader.gif) no-repeat 50% 50%' }); if ( flickr.length ) { // validate the method if ( typeof Galleria.Flickr.prototype[ flickr[0] ] !== 'function' ) { Galleria.raise( flickr[0] + ' method not found in Flickr plugin' ); return load.apply( this, args ); } // validate the argument if ( !flickr[1] ) { Galleria.raise( 'No flickr argument found' ); return load.apply( this, args ); } // apply the preloader window.setTimeout(function() { self.$( 'target' ).append( loader ); },100); // create the instance f = new Galleria.Flickr(); // apply Flickr options if ( typeof self._options.flickrOptions === 'object' ) { f.setOptions( self._options.flickrOptions ); } // call the flickr method and trigger the DATA event f[ flickr[0] ]( flickr[1], function( data ) { self._data = data; loader.remove(); self.trigger( Galleria.DATA ); f.options.complete.call(f, data); }); } else { // if flickr array not found, pass load.apply( this, args ); } }; }( jQuery ) );
0x6a
trunk/libraries/galleria/plugins/flickr/galleria.flickr.js
JavaScript
asf20
10,366
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Galleria Flickr Plugin</title> <style> /* Demo styles */ html,body{background:#222;margin:0;} body{border-top:4px solid #000;} .content{color:#777;font:12px/1.4 "helvetica neue",arial,sans-serif;width:620px;margin:20px auto;} h1{font-size:12px;font-weight:normal;color:#ddd;margin:0;} p{margin:0 0 20px} a {color:#22BCB9;text-decoration:none;} .cred{margin-top:20px;font-size:11px;} /* This rule is read by Galleria to define the gallery height: */ #galleria{height:320px;} </style> <!-- load jQuery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> <!-- load Galleria --> <script src="../../galleria-1.2.7.min.js"></script> <!-- load picasa plugin --> <script src="galleria.picasa.min.js"></script> </head> <body> <div class="content"> <h1>Galleria Picasa Plugin Demo</h1> <p>Demonstrating a basic gallery example with photos from a Picasa album.</p> <!-- Adding gallery images. This is just a container for the dynamic picasa images --> <div id="galleria"></div> <p class="cred">Made by <a href="http://galleria.aino.se">Galleria</a>.</p> </div> <script> // Load the classic theme Galleria.loadTheme('../../themes/classic/galleria.classic.min.js'); Galleria.run('#galleria', { // The user & album. This example fetches the album "Demo" from the user "galleriajs" picasa: 'useralbum:galleriajs/Demo' }); </script> </body> </html>
0x6a
trunk/libraries/galleria/plugins/picasa/picasa-demo.html
HTML
asf20
1,747
/** * Galleria Picasa Plugin 2012-04-04 * http://galleria.io * * Licensed under the MIT license * https://raw.github.com/aino/galleria/master/LICENSE * */ (function($) { /*global jQuery, Galleria, window */ Galleria.requires(1.25, 'The Picasa Plugin requires Galleria version 1.2.5 or later.'); // The script path var PATH = Galleria.utils.getScriptPath(); /** @class @constructor @example var picasa = new Galleria.Picasa(); @author http://aino.se @requires jQuery @requires Galleria @returns Instance */ Galleria.Picasa = function() { this.options = { max: 30, // photos to return imageSize: 'medium', // photo size ( thumb,small,medium,big,original ) or a number thumbSize: 'thumb', // thumbnail size ( thumb,small,medium,big,original ) or a number complete: function(){} // callback to be called inside the Galleria.prototype.load }; }; Galleria.Picasa.prototype = { // bring back the constructor reference constructor: Galleria.Picasa, /** Search for anything at Picasa @param {String} phrase The string to search for @param {Function} [callback] The callback to be called when the data is ready @returns Instance */ search: function( phrase, callback ) { return this._call( 'search', 'all', { q: phrase }, callback ); }, /** Get a user's public photos @param {String} username The username to fetch photos from @param {Function} [callback] The callback to be called when the data is ready @returns Instance */ user: function( username, callback ) { return this._call( 'user', 'user/' + username, callback ); }, /** Get photos from an album @param {String} username The username that owns the album @param {String} album The album ID @param {Function} [callback] The callback to be called when the data is ready @returns Instance */ useralbum: function( username, album, callback ) { return this._call( 'useralbum', 'user/' + username + '/album/' + album, callback ); }, /** Set picasa options @param {Object} options The options object to blend @returns Instance */ setOptions: function( options ) { $.extend(this.options, options); return this; }, // call Picasa _call: function( type, url, params, callback ) { url = 'https://picasaweb.google.com/data/feed/api/' + url + '?'; if (typeof params == 'function') { callback = params; params = {}; } var self = this; params = $.extend({ 'kind': 'photo', 'access': 'public', 'max-results': this.options.max, 'thumbsize': this._getSizes().join(','), 'alt': 'json-in-script', 'callback': '?' }, params ); $.each(params, function( key, value ) { url += '&' + key + '=' + value; }); // since Picasa throws 404 when the call is malformed, we must set a timeout here: var data = false; Galleria.utils.wait({ until: function() { return data; }, success: function() { self._parse.call( self, data.feed.entry, callback ); }, error: function() { var msg = ''; if ( type == 'user' ) { msg = 'user not found.'; } else if ( type == 'useralbum' ) { msg = 'album or user not found.'; } Galleria.raise('Picasa request failed' + (msg ? ': ' + msg : '.')); }, timeout: 5000 }); $.getJSON( url, function( result ) { data = result; }); return self; }, // parse image sizes and return an array of three _getSizes: function() { var self = this, norm = { small: '72c', thumb: '104u', medium: '640u', big: '1024u', original: '1600u' }, op = self.options, t = {}, n, sz = [32,48,64,72,94,104,110,128,144,150,160,200,220,288,320,400,512,576,640,720,800,912,1024,1152,1280,1440,1600]; $(['thumbSize', 'imageSize']).each(function() { if( op[this] in norm ) { t[this] = norm[ op[this] ]; } else { n = Galleria.utils.parseValue( op[this] ); if (n > 1600) { n = 1600; } else { $.each( sz, function(i) { if ( n < this ) { n = sz[i-1]; return false; } }); } t[this] = n; } }); return [ t.thumbSize, t.imageSize, '1280u']; }, // parse the result and call the callback with the galleria-ready data array _parse: function( data, callback ) { var self = this, gallery = [], img; $.each( data, function() { img = this.media$group.media$thumbnail; gallery.push({ thumb: img[0].url, image: img[1].url, big: img[2].url, title: this.summary.$t }); }); callback.call( this, gallery ); } }; /** Galleria modifications We fake-extend the load prototype to make Picasa integration as simple as possible */ // save the old prototype in a local variable var load = Galleria.prototype.load; // fake-extend the load prototype using the picasa data Galleria.prototype.load = function() { // pass if no data is provided or picasa option not found if ( arguments.length || typeof this._options.picasa !== 'string' ) { load.apply( this, Galleria.utils.array( arguments ) ); return; } // define some local vars var self = this, args = Galleria.utils.array( arguments ), picasa = this._options.picasa.split(':'), p, opts = $.extend({}, self._options.picasaOptions), loader = typeof opts.loader !== 'undefined' ? opts.loader : $('<div>').css({ width: 48, height: 48, opacity: 0.7, background:'#000 url('+PATH+'loader.gif) no-repeat 50% 50%' }); if ( picasa.length ) { // validate the method if ( typeof Galleria.Picasa.prototype[ picasa[0] ] !== 'function' ) { Galleria.raise( picasa[0] + ' method not found in Picasa plugin' ); return load.apply( this, args ); } // validate the argument if ( !picasa[1] ) { Galleria.raise( 'No picasa argument found' ); return load.apply( this, args ); } // apply the preloader window.setTimeout(function() { self.$( 'target' ).append( loader ); },100); // create the instance p = new Galleria.Picasa(); // apply Flickr options if ( typeof self._options.picasaOptions === 'object' ) { p.setOptions( self._options.picasaOptions ); } // call the picasa method and trigger the DATA event var arg = []; if ( picasa[0] == 'useralbum' ) { arg = picasa[1].split('/'); if (arg.length != 2) { Galleria.raise( 'Picasa useralbum not correctly formatted (should be [user]/[album])'); return; } } else { arg.push( picasa[1] ); } arg.push(function(data) { self._data = data; loader.remove(); self.trigger( Galleria.DATA ); p.options.complete.call(p, data); }); p[ picasa[0] ].apply( p, arg ); } else { // if flickr array not found, pass load.apply( this, args ); } }; }( jQuery ) );
0x6a
trunk/libraries/galleria/plugins/picasa/galleria.picasa.js
JavaScript
asf20
8,290
/** * Galleria History Plugin 2012-04-04 * http://galleria.io * * Licensed under the MIT license * https://raw.github.com/aino/galleria/master/LICENSE * */ (function( $, window ) { /*global jQuery, Galleria, window */ Galleria.requires(1.25, 'The History Plugin requires Galleria version 1.2.5 or later.'); Galleria.History = (function() { var onloads = [], init = false, loc = window.location, doc = window.document, ie = Galleria.IE, support = 'onhashchange' in window && ( doc.mode === undefined || doc.mode > 7 ), iframe, get = function( winloc ) { if( iframe && !support && Galleria.IE ) { winloc = winloc || iframe.location; } else { winloc = loc; } return parseInt( winloc.hash.substr(2), 10 ); }, saved = get( loc ), callbacks = [], onchange = function() { $.each( callbacks, function( i, fn ) { fn.call( window, get() ); }); }, ready = function() { $.each( onloads, function(i, fn) { fn(); }); init = true; }, setHash = function( val ) { return '/' + val; }; // always remove support if IE < 8 if ( support && ie < 8 ) { support = false; } if ( !support ) { $(function() { var interval = window.setInterval(function() { var hash = get(); if ( !isNaN( hash ) && hash != saved ) { saved = hash; loc.hash = setHash( hash ); onchange(); } }, 50); if ( ie ) { $('<iframe tabindex="-1" title="empty">').hide().attr( 'src', 'about:blank' ).one('load', function() { iframe = this.contentWindow; ready(); }).insertAfter(doc.body); } else { ready(); } }); } else { ready(); } return { change: function( fn ) { callbacks.push( fn ); if( support ) { window.onhashchange = onchange; } }, set: function( val ) { if ( isNaN( val ) ) { return; } if ( !support && ie ) { this.ready(function() { var idoc = iframe.document; idoc.open(); idoc.close(); iframe.location.hash = setHash( val ); }); } loc.hash = setHash( val ); }, ready: function(fn) { if (!init) { onloads.push(fn); } else { fn(); } } }; }()); }( jQuery, this ));
0x6a
trunk/libraries/galleria/plugins/history/galleria.history.js
JavaScript
asf20
2,964
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Galleria History Plugin</title> <style> /* Demo styles */ html,body{background:#222;margin:0;} body{border-top:4px solid #000;} .content{color:#777;font:12px/1.4 "helvetica neue",arial,sans-serif;width:620px;margin:20px auto;} h1{font-size:12px;font-weight:normal;color:#ddd;margin:0;} p{margin:0 0 20px} a {color:#22BCB9;text-decoration:none;} .cred{margin-top:20px;font-size:11px;} /* This rule is read by Galleria to define the gallery height: */ #galleria{height:320px} </style> <!-- load jQuery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> <!-- load Galleria --> <script src="../../galleria-1.2.7.min.js"></script> <!-- load the History plugin, no need for further scripting --> <script src="galleria.history.min.js"></script> </head> <body> <div class="content"> <h1>Galleria History Plugin</h1> <p>Demonstrating a basic history example. Supports most browsers, including FF 3.0+ and IE 7+</p> <!-- Adding gallery images. We use resized thumbnails here for better performance, but it’s not necessary --> <div id="galleria"> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Locomotives-Roundhouse2.jpg/800px-Locomotives-Roundhouse2.jpg"> <img title="Locomotives Roundhouse" alt="Steam locomotives of the Chicago &amp; North Western Railway." src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Locomotives-Roundhouse2.jpg/100px-Locomotives-Roundhouse2.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Icebergs_in_the_High_Arctic_-_20050907.jpg/1000px-Icebergs_in_the_High_Arctic_-_20050907.jpg"> <img title="Icebergs in the High Arctic" alt="”The debris loading isn't particularly extensive, but the color is usual.”" src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Icebergs_in_the_High_Arctic_-_20050907.jpg/100px-Icebergs_in_the_High_Arctic_-_20050907.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg/1000px-Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg"> <img title="Araña" alt="Xysticus cristatus, A Estrada, Galicia, Spain" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg/100px-Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg/1000px-9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg"> <img title="Museo storia naturale" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg/100px-9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg/1000px-Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg"> <img title="Grjótagjá caves in summer 2009" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg/100px-Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg/1000px-20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg"> <img title="Thermes" alt="Xanthi hot-spa springs, Xanthi Prefecture, Greece" src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg/100px-20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Polish_Army_Ko%C5%82obrzeg_077.JPG/1024px-Polish_Army_Ko%C5%82obrzeg_077.JPG"> <img title="Polish Army Kołobrzeg" alt="A display of the Polish Army. Both the soldier, and the vehicle belong to the 7th Pomeranian Coastal Defence Brigade, a part of the Szczecin-based 12th Mechanized Division ”Bolesław Krzywousty”" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Polish_Army_Ko%C5%82obrzeg_077.JPG/100px-Polish_Army_Ko%C5%82obrzeg_077.JPG"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/20100213_Zlatograd_Bulgaria_3.jpg/1024px-20100213_Zlatograd_Bulgaria_3.jpg"> <img title="Zlatograd Bulgaria" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/20100213_Zlatograd_Bulgaria_3.jpg/100px-20100213_Zlatograd_Bulgaria_3.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg/1024px-FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg"> <img title="09-28-2001 in New York City" alt="New York, NY, September 28, 2001 -- Debris on surrounding roofs at the site of the World Trade Center. Photo by Andrea Booher/ FEMA News Photo" src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg/100px-FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Antennae%2C_Hubble_images.jpg/1024px-Antennae%2C_Hubble_images.jpg"> <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Antennae%2C_Hubble_images.jpg/100px-Antennae%2C_Hubble_images.jpg"> </a> </div> <p class="cred">Made by <a href="http://galleria.aino.se">Galleria</a>.</p> </div> <script> // Load the classic theme Galleria.loadTheme('../../themes/classic/galleria.classic.min.js'); // Initialize Galleria Galleria.run('#galleria'); </script> </body> </html>
0x6a
trunk/libraries/galleria/plugins/history/history-demo.html
HTML
asf20
6,797
/** * Galleria v 1.2.7 2012-04-04 * http://galleria.io * * Licensed under the MIT license * https://raw.github.com/aino/galleria/master/LICENSE * */ (function( $ ) { /*global jQuery, navigator, Galleria:true, Image */ // some references var undef, window = this, doc = window.document, $doc = $( doc ), $win = $( window ), // native prototypes protoArray = Array.prototype, // internal constants VERSION = 1.27, DEBUG = true, TIMEOUT = 30000, DUMMY = false, NAV = navigator.userAgent.toLowerCase(), HASH = window.location.hash.replace(/#\//, ''), F = function(){}, FALSE = function() { return false; }, IE = (function() { var v = 3, div = doc.createElement( 'div' ), all = div.getElementsByTagName( 'i' ); do { div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->'; } while ( all[0] ); return v > 4 ? v : undef; }() ), DOM = function() { return { html: doc.documentElement, body: doc.body, head: doc.getElementsByTagName('head')[0], title: doc.title }; }, // list of Galleria events _eventlist = 'data ready thumbnail loadstart loadfinish image play pause progress ' + 'fullscreen_enter fullscreen_exit idle_enter idle_exit rescale ' + 'lightbox_open lightbox_close lightbox_image', _events = (function() { var evs = []; $.each( _eventlist.split(' '), function( i, ev ) { evs.push( ev ); // legacy events if ( /_/.test( ev ) ) { evs.push( ev.replace( /_/g, '' ) ); } }); return evs; }()), // legacy options // allows the old my_setting syntax and converts it to camel case _legacyOptions = function( options ) { var n; if ( typeof options !== 'object' ) { // return whatever it was... return options; } $.each( options, function( key, value ) { if ( /^[a-z]+_/.test( key ) ) { n = ''; $.each( key.split('_'), function( i, k ) { n += i > 0 ? k.substr( 0, 1 ).toUpperCase() + k.substr( 1 ) : k; }); options[ n ] = value; delete options[ key ]; } }); return options; }, _patchEvent = function( type ) { // allow 'image' instead of Galleria.IMAGE if ( $.inArray( type, _events ) > -1 ) { return Galleria[ type.toUpperCase() ]; } return type; }, // video providers _video = { youtube: { reg: /https?:\/\/(?:[a-zA_Z]{2,3}.)?(?:youtube\.com\/watch\?)((?:[\w\d\-\_\=]+&amp;(?:amp;)?)*v(?:&lt;[A-Z]+&gt;)?=([0-9a-zA-Z\-\_]+))/i, embed: function(id) { return 'http://www.youtube.com/embed/'+id; }, getThumb: function( id, success, fail ) { fail = fail || F; $.getJSON('http://gdata.youtube.com/feeds/api/videos/' + id + '?v=2&alt=json-in-script&callback=?', function(data) { try { success( data.entry.media$group.media$thumbnail[0].url ); } catch(e) { fail(); } }).error(fail); } }, vimeo: { reg: /https?:\/\/(?:www\.)?(vimeo\.com)\/(?:hd#)?([0-9]+)/i, embed: function(id) { return 'http://player.vimeo.com/video/'+id; }, getThumb: function( id, success, fail ) { fail = fail || F; $.getJSON('http://vimeo.com/api/v2/video/' + id + '.json?callback=?', function(data) { try { success( data[0].thumbnail_medium ); } catch(e) { fail(); } }).error(fail); } }, dailymotion: { reg: /https?:\/\/(?:www\.)?(dailymotion\.com)\/video\/([^_]+)/, embed: function(id) { return 'http://www.dailymotion.com/embed/video/'+id; }, getThumb: function( id, success, fail ) { fail = fail || F; $.getJSON('https://api.dailymotion.com/video/'+id+'?fields=thumbnail_medium_url&callback=?', function(data) { try { success( data.thumbnail_medium_url ); } catch(e) { fail(); } }).error(fail); } } }, // utility for testing the video URL and getting the video ID _videoTest = function( url ) { var match; for ( var v in _video ) { match = url && url.match( _video[v].reg ); if( match && match.length ) { return { id: match[2], provider: v }; } } return false; }, // the internal timeouts object // provides helper methods for controlling timeouts _timeouts = { trunk: {}, add: function( id, fn, delay, loop ) { id = id || new Date().getTime(); loop = loop || false; this.clear( id ); if ( loop ) { var old = fn; fn = function() { old(); _timeouts.add( id, fn, delay ); }; } this.trunk[ id ] = window.setTimeout( fn, delay ); }, clear: function( id ) { var del = function( i ) { window.clearTimeout( this.trunk[ i ] ); delete this.trunk[ i ]; }, i; if ( !!id && id in this.trunk ) { del.call( _timeouts, id ); } else if ( typeof id === 'undefined' ) { for ( i in this.trunk ) { if ( this.trunk.hasOwnProperty( i ) ) { del.call( _timeouts, i ); } } } } }, // the internal gallery holder _galleries = [], // the internal instance holder _instances = [], // flag for errors _hasError = false, // canvas holder _canvas = false, // instance pool, holds the galleries until themeLoad is triggered _pool = [], // themeLoad trigger _themeLoad = function( theme ) { Galleria.theme = theme; // run the instances we have in the pool $.each( _pool, function( i, instance ) { if ( !instance._initialized ) { instance._init.call( instance ); } }); }, // the Utils singleton Utils = (function() { return { array : function( obj ) { return protoArray.slice.call(obj, 0); }, create : function( className, nodeName ) { nodeName = nodeName || 'div'; var elem = doc.createElement( nodeName ); elem.className = className; return elem; }, getScriptPath : function( src ) { // the currently executing script is always the last src = src || $('script:last').attr('src'); var slices = src.split('/'); if (slices.length == 1) { return ''; } slices.pop(); return slices.join('/') + '/'; }, // CSS3 transitions, added in 1.2.4 animate : (function() { // detect transition var transition = (function( style ) { var props = 'transition WebkitTransition MozTransition OTransition'.split(' '), i; // disable css3 animations in opera until stable if ( window.opera ) { return false; } for ( i = 0; props[i]; i++ ) { if ( typeof style[ props[ i ] ] !== 'undefined' ) { return props[ i ]; } } return false; }(( doc.body || doc.documentElement).style )); // map transitionend event var endEvent = { MozTransition: 'transitionend', OTransition: 'oTransitionEnd', WebkitTransition: 'webkitTransitionEnd', transition: 'transitionend' }[ transition ]; // map bezier easing conversions var easings = { _default: [0.25, 0.1, 0.25, 1], galleria: [0.645, 0.045, 0.355, 1], galleriaIn: [0.55, 0.085, 0.68, 0.53], galleriaOut: [0.25, 0.46, 0.45, 0.94], ease: [0.25, 0, 0.25, 1], linear: [0.25, 0.25, 0.75, 0.75], 'ease-in': [0.42, 0, 1, 1], 'ease-out': [0, 0, 0.58, 1], 'ease-in-out': [0.42, 0, 0.58, 1] }; // function for setting transition css for all browsers var setStyle = function( elem, value, suffix ) { var css = {}; suffix = suffix || 'transition'; $.each( 'webkit moz ms o'.split(' '), function() { css[ '-' + this + '-' + suffix ] = value; }); elem.css( css ); }; // clear styles var clearStyle = function( elem ) { setStyle( elem, 'none', 'transition' ); if ( Galleria.WEBKIT && Galleria.TOUCH ) { setStyle( elem, 'translate3d(0,0,0)', 'transform' ); if ( elem.data('revert') ) { elem.css( elem.data('revert') ); elem.data('revert', null); } } }; // various variables var change, strings, easing, syntax, revert, form, css; // the actual animation method return function( elem, to, options ) { // extend defaults options = $.extend({ duration: 400, complete: F, stop: false }, options); // cache jQuery instance elem = $( elem ); if ( !options.duration ) { elem.css( to ); options.complete.call( elem[0] ); return; } // fallback to jQuery's animate if transition is not supported if ( !transition ) { elem.animate(to, options); return; } // stop if ( options.stop ) { // clear the animation elem.unbind( endEvent ); clearStyle( elem ); } // see if there is a change change = false; $.each( to, function( key, val ) { css = elem.css( key ); if ( Utils.parseValue( css ) != Utils.parseValue( val ) ) { change = true; } // also add computed styles for FF elem.css( key, css ); }); if ( !change ) { window.setTimeout( function() { options.complete.call( elem[0] ); }, options.duration ); return; } // the css strings to be applied strings = []; // the easing bezier easing = options.easing in easings ? easings[ options.easing ] : easings._default; // the syntax syntax = ' ' + options.duration + 'ms' + ' cubic-bezier(' + easing.join(',') + ')'; // add a tiny timeout so that the browsers catches any css changes before animating window.setTimeout( (function(elem, endEvent, to, syntax) { return function() { // attach the end event elem.one(endEvent, (function( elem ) { return function() { // clear the animation clearStyle(elem); // run the complete method options.complete.call(elem[0]); }; }( elem ))); // do the webkit translate3d for better performance on iOS if( Galleria.WEBKIT && Galleria.TOUCH ) { revert = {}; form = [0,0,0]; $.each( ['left', 'top'], function(i, m) { if ( m in to ) { form[ i ] = ( Utils.parseValue( to[ m ] ) - Utils.parseValue(elem.css( m )) ) + 'px'; revert[ m ] = to[ m ]; delete to[ m ]; } }); if ( form[0] || form[1]) { elem.data('revert', revert); strings.push('-webkit-transform' + syntax); // 3d animate setStyle( elem, 'translate3d(' + form.join(',') + ')', 'transform'); } } // push the animation props $.each(to, function( p, val ) { strings.push(p + syntax); }); // set the animation styles setStyle( elem, strings.join(',') ); // animate elem.css( to ); }; }(elem, endEvent, to, syntax)), 2); }; }()), removeAlpha : function( elem ) { if ( IE < 9 && elem ) { var style = elem.style, currentStyle = elem.currentStyle, filter = currentStyle && currentStyle.filter || style.filter || ""; if ( /alpha/.test( filter ) ) { style.filter = filter.replace( /alpha\([^)]*\)/i, '' ); } } }, forceStyles : function( elem, styles ) { elem = $(elem); if ( elem.attr( 'style' ) ) { elem.data( 'styles', elem.attr( 'style' ) ).removeAttr( 'style' ); } elem.css( styles ); }, revertStyles : function() { $.each( Utils.array( arguments ), function( i, elem ) { elem = $( elem ); elem.removeAttr( 'style' ); elem.attr('style',''); // "fixes" webkit bug if ( elem.data( 'styles' ) ) { elem.attr( 'style', elem.data('styles') ).data( 'styles', null ); } }); }, moveOut : function( elem ) { Utils.forceStyles( elem, { position: 'absolute', left: -10000 }); }, moveIn : function() { Utils.revertStyles.apply( Utils, Utils.array( arguments ) ); }, elem : function( elem ) { if (elem instanceof $) { return { $: elem, dom: elem[0] }; } else { return { $: $(elem), dom: elem }; } }, hide : function( elem, speed, callback ) { callback = callback || F; var el = Utils.elem( elem ), $elem = el.$; elem = el.dom; // save the value if not exist if (! $elem.data('opacity') ) { $elem.data('opacity', $elem.css('opacity') ); } // always hide var style = { opacity: 0 }; if (speed) { var complete = IE < 9 && elem ? function() { Utils.removeAlpha( elem ); elem.style.visibility = 'hidden'; callback.call( elem ); } : callback; Utils.animate( elem, style, { duration: speed, complete: complete, stop: true }); } else { if ( IE < 9 && elem ) { Utils.removeAlpha( elem ); elem.style.visibility = 'hidden'; } else { $elem.css( style ); } } }, show : function( elem, speed, callback ) { callback = callback || F; var el = Utils.elem( elem ), $elem = el.$; elem = el.dom; // bring back saved opacity var saved = parseFloat( $elem.data('opacity') ) || 1, style = { opacity: saved }; // animate or toggle if (speed) { if ( IE < 9 ) { $elem.css('opacity', 0); elem.style.visibility = 'visible'; } var complete = IE < 9 && elem ? function() { if ( style.opacity == 1 ) { Utils.removeAlpha( elem ); } callback.call( elem ); } : callback; Utils.animate( elem, style, { duration: speed, complete: complete, stop: true }); } else { if ( IE < 9 && style.opacity == 1 && elem ) { Utils.removeAlpha( elem ); elem.style.visibility = 'visible'; } else { $elem.css( style ); } } }, // enhanced click for mobile devices // we bind a touchend and hijack any click event in the bubble // then we execute the click directly and save it in a separate data object for later optimizeTouch: (function() { var node, evs, fakes, travel, evt = {}, handler = function( e ) { e.preventDefault(); evt = $.extend({}, e, true); }, attach = function() { this.evt = evt; }, fake = function() { this.handler.call(node, this.evt); }; return function( elem ) { $(elem).bind('touchend', function( e ) { node = e.target; travel = true; while( node.parentNode && node != e.currentTarget && travel ) { evs = $(node).data('events'); fakes = $(node).data('fakes'); if (evs && 'click' in evs) { travel = false; e.preventDefault(); // fake the click and save the event object $(node).click(handler).click(); // remove the faked click evs.click.pop(); // attach the faked event $.each( evs.click, attach); // save the faked clicks in a new data object $(node).data('fakes', evs.click); // remove all clicks delete evs.click; } else if ( fakes ) { travel = false; e.preventDefault(); // fake all clicks $.each( fakes, fake ); } // bubble node = node.parentNode; } }); }; }()), addTimer : function() { _timeouts.add.apply( _timeouts, Utils.array( arguments ) ); return this; }, clearTimer : function() { _timeouts.clear.apply( _timeouts, Utils.array( arguments ) ); return this; }, wait : function(options) { options = $.extend({ until : FALSE, success : F, error : function() { Galleria.raise('Could not complete wait function.'); }, timeout: 3000 }, options); var start = Utils.timestamp(), elapsed, now, fn = function() { now = Utils.timestamp(); elapsed = now - start; if ( options.until( elapsed ) ) { options.success(); return false; } if (typeof options.timeout == 'number' && now >= start + options.timeout) { options.error(); return false; } window.setTimeout(fn, 10); }; window.setTimeout(fn, 10); }, toggleQuality : function( img, force ) { if ( ( IE !== 7 && IE !== 8 ) || !img || img.nodeName.toUpperCase() != 'IMG' ) { return; } if ( typeof force === 'undefined' ) { force = img.style.msInterpolationMode === 'nearest-neighbor'; } img.style.msInterpolationMode = force ? 'bicubic' : 'nearest-neighbor'; }, insertStyleTag : function( styles ) { var style = doc.createElement( 'style' ); DOM().head.appendChild( style ); if ( style.styleSheet ) { // IE style.styleSheet.cssText = styles; } else { var cssText = doc.createTextNode( styles ); style.appendChild( cssText ); } }, // a loadscript method that works for local scripts loadScript: function( url, callback ) { var done = false, script = $('<scr'+'ipt>').attr({ src: url, async: true }).get(0); // Attach handlers for all browsers script.onload = script.onreadystatechange = function() { if ( !done && (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete') ) { done = true; // Handle memory leak in IE script.onload = script.onreadystatechange = null; if (typeof callback === 'function') { callback.call( this, this ); } } }; DOM().head.appendChild( script ); }, // parse anything into a number parseValue: function( val ) { if (typeof val === 'number') { return val; } else if (typeof val === 'string') { var arr = val.match(/\-?\d|\./g); return arr && arr.constructor === Array ? arr.join('')*1 : 0; } else { return 0; } }, // timestamp abstraction timestamp: function() { return new Date().getTime(); }, // this is pretty crap, but works for now // it will add a callback, but it can't guarantee that the styles can be fetched // using getComputedStyle further checking needed, possibly a dummy element loadCSS : function( href, id, callback ) { var link, ready = false, length, lastChance = function() { var fake = new Image(); fake.onload = fake.onerror = function(e) { fake = null; ready = true; }; fake.src = href; }; // look for manual css $('link[rel=stylesheet]').each(function() { if ( new RegExp( href ).test( this.href ) ) { link = this; return false; } }); if ( typeof id === 'function' ) { callback = id; id = undef; } callback = callback || F; // dirty // if already present, return if ( link ) { callback.call( link, link ); return link; } // save the length of stylesheets to check against length = doc.styleSheets.length; // check for existing id if( $('#'+id).length ) { $('#'+id).attr('href', href); length--; ready = true; } else { link = $( '<link>' ).attr({ rel: 'stylesheet', href: href, id: id }).get(0); window.setTimeout(function() { var styles = $('link[rel="stylesheet"], style'); if ( styles.length ) { styles.get(0).parentNode.insertBefore( link, styles[0] ); } else { DOM().head.appendChild( link ); } if ( IE ) { // IE has a limit of 31 stylesheets in one document if( length >= 31 ) { Galleria.raise( 'You have reached the browser stylesheet limit (31)', true ); return; } link.onreadystatechange = function(e) { if ( !ready && (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete') ) { ready = true; } }; } else { // final test via ajax var dum = doc.createElement('a'), loc = window.location; dum.href = href; if ( !( /file/.test( loc.protocol ) ) && loc.hostname == dum.hostname && loc.port == dum.port && loc.protocol == dum.protocol ) { // Same origin policy should apply $.ajax({ url: href, success: function() { ready = true; }, error: lastChance }); } else { lastChance(); } } }, 10); } if ( typeof callback === 'function' ) { Utils.wait({ until: function() { return ready && doc.styleSheets.length > length; }, success: function() { window.setTimeout( function() { callback.call( link, link ); }, 100); }, error: function() { Galleria.raise( 'Theme CSS could not load', true ); }, timeout: 10000 }); } return link; } }; }()), // the transitions holder _transitions = (function() { var _slide = function(params, complete, fade, door) { var easing = this.getOptions('easing'), distance = this.getStageWidth(), from = { left: distance * ( params.rewind ? -1 : 1 ) }, to = { left: 0 }; if ( fade ) { from.opacity = 0; to.opacity = 1; } else { from.opacity = 1; } $(params.next).css(from); Utils.animate(params.next, to, { duration: params.speed, complete: (function( elems ) { return function() { complete(); elems.css({ left: 0 }); }; }( $( params.next ).add( params.prev ) )), queue: false, easing: easing }); if (door) { params.rewind = !params.rewind; } if (params.prev) { from = { left: 0 }; to = { left: distance * ( params.rewind ? 1 : -1 ) }; if ( fade ) { from.opacity = 1; to.opacity = 0; } $(params.prev).css(from); Utils.animate(params.prev, to, { duration: params.speed, queue: false, easing: easing, complete: function() { $(this).css('opacity', 0); } }); } }; return { fade: function(params, complete) { $(params.next).css({ opacity: 0, left: 0 }).show(); Utils.animate(params.next, { opacity: 1 },{ duration: params.speed, complete: complete }); if (params.prev) { $(params.prev).css('opacity',1).show(); Utils.animate(params.prev, { opacity: 0 },{ duration: params.speed }); } }, flash: function(params, complete) { $(params.next).css({ opacity: 0, left: 0 }); if (params.prev) { Utils.animate( params.prev, { opacity: 0 },{ duration: params.speed/2, complete: function() { Utils.animate( params.next, { opacity:1 },{ duration: params.speed, complete: complete }); } }); } else { Utils.animate( params.next, { opacity: 1 },{ duration: params.speed, complete: complete }); } }, pulse: function(params, complete) { if (params.prev) { $(params.prev).hide(); } $(params.next).css({ opacity: 0, left: 0 }).show(); Utils.animate(params.next, { opacity:1 },{ duration: params.speed, complete: complete }); }, slide: function(params, complete) { _slide.apply( this, Utils.array( arguments ) ); }, fadeslide: function(params, complete) { _slide.apply( this, Utils.array( arguments ).concat( [true] ) ); }, doorslide: function(params, complete) { _slide.apply( this, Utils.array( arguments ).concat( [false, true] ) ); } }; }()); /** The main Galleria class @class @constructor @example var gallery = new Galleria(); @author http://aino.se @requires jQuery */ Galleria = function() { var self = this; // internal options this._options = {}; // flag for controlling play/pause this._playing = false; // internal interval for slideshow this._playtime = 5000; // internal variable for the currently active image this._active = null; // the internal queue, arrayified this._queue = { length: 0 }; // the internal data array this._data = []; // the internal dom collection this._dom = {}; // the internal thumbnails array this._thumbnails = []; // the internal layers array this._layers = []; // internal init flag this._initialized = false; // internal firstrun flag this._firstrun = false; // global stagewidth/height this._stageWidth = 0; this._stageHeight = 0; // target holder this._target = undef; // instance id this._id = parseInt(Math.random()*10000, 10); // add some elements var divs = 'container stage images image-nav image-nav-left image-nav-right ' + 'info info-text info-title info-description ' + 'thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right ' + 'loader counter tooltip', spans = 'current total'; $.each( divs.split(' '), function( i, elemId ) { self._dom[ elemId ] = Utils.create( 'galleria-' + elemId ); }); $.each( spans.split(' '), function( i, elemId ) { self._dom[ elemId ] = Utils.create( 'galleria-' + elemId, 'span' ); }); // the internal keyboard object // keeps reference of the keybinds and provides helper methods for binding keys var keyboard = this._keyboard = { keys : { 'UP': 38, 'DOWN': 40, 'LEFT': 37, 'RIGHT': 39, 'RETURN': 13, 'ESCAPE': 27, 'BACKSPACE': 8, 'SPACE': 32 }, map : {}, bound: false, press: function(e) { var key = e.keyCode || e.which; if ( key in keyboard.map && typeof keyboard.map[key] === 'function' ) { keyboard.map[key].call(self, e); } }, attach: function(map) { var key, up; for( key in map ) { if ( map.hasOwnProperty( key ) ) { up = key.toUpperCase(); if ( up in keyboard.keys ) { keyboard.map[ keyboard.keys[up] ] = map[key]; } else { keyboard.map[ up ] = map[key]; } } } if ( !keyboard.bound ) { keyboard.bound = true; $doc.bind('keydown', keyboard.press); } }, detach: function() { keyboard.bound = false; keyboard.map = {}; $doc.unbind('keydown', keyboard.press); } }; // internal controls for keeping track of active / inactive images var controls = this._controls = { 0: undef, 1: undef, active : 0, swap : function() { controls.active = controls.active ? 0 : 1; }, getActive : function() { return controls[ controls.active ]; }, getNext : function() { return controls[ 1 - controls.active ]; } }; // internal carousel object var carousel = this._carousel = { // shortcuts next: self.$('thumb-nav-right'), prev: self.$('thumb-nav-left'), // cache the width width: 0, // track the current position current: 0, // cache max value max: 0, // save all hooks for each width in an array hooks: [], // update the carousel // you can run this method anytime, f.ex on window.resize update: function() { var w = 0, h = 0, hooks = [0]; $.each( self._thumbnails, function( i, thumb ) { if ( thumb.ready ) { w += thumb.outerWidth || $( thumb.container ).outerWidth( true ); hooks[ i+1 ] = w; h = Math.max( h, thumb.outerHeight || $( thumb.container).outerHeight( true ) ); } }); self.$( 'thumbnails' ).css({ width: w, height: h }); carousel.max = w; carousel.hooks = hooks; carousel.width = self.$( 'thumbnails-list' ).width(); carousel.setClasses(); self.$( 'thumbnails-container' ).toggleClass( 'galleria-carousel', w > carousel.width ); // one extra calculation carousel.width = self.$( 'thumbnails-list' ).width(); // todo: fix so the carousel moves to the left }, bindControls: function() { var i; carousel.next.bind( 'click', function(e) { e.preventDefault(); if ( self._options.carouselSteps === 'auto' ) { for ( i = carousel.current; i < carousel.hooks.length; i++ ) { if ( carousel.hooks[i] - carousel.hooks[ carousel.current ] > carousel.width ) { carousel.set(i - 2); break; } } } else { carousel.set( carousel.current + self._options.carouselSteps); } }); carousel.prev.bind( 'click', function(e) { e.preventDefault(); if ( self._options.carouselSteps === 'auto' ) { for ( i = carousel.current; i >= 0; i-- ) { if ( carousel.hooks[ carousel.current ] - carousel.hooks[i] > carousel.width ) { carousel.set( i + 2 ); break; } else if ( i === 0 ) { carousel.set( 0 ); break; } } } else { carousel.set( carousel.current - self._options.carouselSteps ); } }); }, // calculate and set positions set: function( i ) { i = Math.max( i, 0 ); while ( carousel.hooks[i - 1] + carousel.width >= carousel.max && i >= 0 ) { i--; } carousel.current = i; carousel.animate(); }, // get the last position getLast: function(i) { return ( i || carousel.current ) - 1; }, // follow the active image follow: function(i) { //don't follow if position fits if ( i === 0 || i === carousel.hooks.length - 2 ) { carousel.set( i ); return; } // calculate last position var last = carousel.current; while( carousel.hooks[last] - carousel.hooks[ carousel.current ] < carousel.width && last <= carousel.hooks.length ) { last ++; } // set position if ( i - 1 < carousel.current ) { carousel.set( i - 1 ); } else if ( i + 2 > last) { carousel.set( i - last + carousel.current + 2 ); } }, // helper for setting disabled classes setClasses: function() { carousel.prev.toggleClass( 'disabled', !carousel.current ); carousel.next.toggleClass( 'disabled', carousel.hooks[ carousel.current ] + carousel.width >= carousel.max ); }, // the animation method animate: function(to) { carousel.setClasses(); var num = carousel.hooks[ carousel.current ] * -1; if ( isNaN( num ) ) { return; } Utils.animate(self.get( 'thumbnails' ), { left: num },{ duration: self._options.carouselSpeed, easing: self._options.easing, queue: false }); } }; // tooltip control // added in 1.2 var tooltip = this._tooltip = { initialized : false, open: false, timer: 'tooltip' + self._id, swapTimer: 'swap' + self._id, init: function() { tooltip.initialized = true; var css = '.galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3' + 'opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}'; Utils.insertStyleTag(css); self.$( 'tooltip' ).css('opacity', 0.8); Utils.hide( self.get('tooltip') ); }, // move handler move: function( e ) { var mouseX = self.getMousePosition(e).x, mouseY = self.getMousePosition(e).y, $elem = self.$( 'tooltip' ), x = mouseX, y = mouseY, height = $elem.outerHeight( true ) + 1, width = $elem.outerWidth( true ), limitY = height + 15; var maxX = self.$( 'container').width() - width - 2, maxY = self.$( 'container').height() - height - 2; if ( !isNaN(x) && !isNaN(y) ) { x += 10; y -= 30; x = Math.max( 0, Math.min( maxX, x ) ); y = Math.max( 0, Math.min( maxY, y ) ); if( mouseY < limitY ) { y = limitY; } $elem.css({ left: x, top: y }); } }, // bind elements to the tooltip // you can bind multiple elementIDs using { elemID : function } or { elemID : string } // you can also bind single DOM elements using bind(elem, string) bind: function( elem, value ) { // todo: revise if alternative tooltip is needed for mobile devices if (Galleria.TOUCH) { return; } if (! tooltip.initialized ) { tooltip.init(); } var hover = function( elem, value) { tooltip.define( elem, value ); $( elem ).hover(function() { Utils.clearTimer( tooltip.swapTimer ); self.$('container').unbind( 'mousemove', tooltip.move ).bind( 'mousemove', tooltip.move ).trigger( 'mousemove' ); tooltip.show( elem ); Utils.addTimer( tooltip.timer, function() { self.$( 'tooltip' ).stop().show().animate({ opacity:1 }); tooltip.open = true; }, tooltip.open ? 0 : 500); }, function() { self.$( 'container' ).unbind( 'mousemove', tooltip.move ); Utils.clearTimer( tooltip.timer ); self.$( 'tooltip' ).stop().animate({ opacity: 0 }, 200, function() { self.$( 'tooltip' ).hide(); Utils.addTimer( tooltip.swapTimer, function() { tooltip.open = false; }, 1000); }); }).click(function() { $( this ).trigger( 'mouseout' ); }); }; if ( typeof value === 'string' ) { hover( ( elem in self._dom ? self.get( elem ) : elem ), value ); } else { // asume elemID here $.each( elem, function( elemID, val ) { hover( self.get(elemID), val ); }); } }, show: function( elem ) { elem = $( elem in self._dom ? self.get(elem) : elem ); var text = elem.data( 'tt' ), mouseup = function( e ) { // attach a tiny settimeout to make sure the new tooltip is filled window.setTimeout( (function( ev ) { return function() { tooltip.move( ev ); }; }( e )), 10); elem.unbind( 'mouseup', mouseup ); }; text = typeof text === 'function' ? text() : text; if ( ! text ) { return; } self.$( 'tooltip' ).html( text.replace(/\s/, '&nbsp;') ); // trigger mousemove on mouseup in case of click elem.bind( 'mouseup', mouseup ); }, define: function( elem, value ) { // we store functions, not strings if (typeof value !== 'function') { var s = value; value = function() { return s; }; } elem = $( elem in self._dom ? self.get(elem) : elem ).data('tt', value); tooltip.show( elem ); } }; // internal fullscreen control var fullscreen = this._fullscreen = { scrolled: 0, crop: undef, transition: undef, active: false, keymap: self._keyboard.map, // The native fullscreen handler os: { callback: F, support: (function() { var html = DOM().html; return html.requestFullscreen || html.mozRequestFullScreen || html.webkitRequestFullScreen; }()), enter: function( callback ) { fullscreen.os.callback = callback || F; var html = DOM().html; if ( html.requestFullscreen ) { html.requestFullscreen(); } else if ( html.mozRequestFullScreen ) { html.mozRequestFullScreen(); } else if ( html.webkitRequestFullScreen ) { html.webkitRequestFullScreen(); } }, exit: function( callback ) { fullscreen.os.callback = callback || F; if ( doc.exitFullscreen ) { doc.exitFullscreen(); } else if ( doc.mozCancelFullScreen ) { doc.mozCancelFullScreen(); } else if ( doc.webkitCancelFullScreen ) { doc.webkitCancelFullScreen(); } }, listen: function() { if ( !fullscreen.os.support ) { return; } var handler = function() { if ( doc.fullscreen || doc.mozFullScreen || doc.webkitIsFullScreen ) { fullscreen._enter( fullscreen.os.callback ); } else { fullscreen._exit( fullscreen.os.callback ); } }; doc.addEventListener( 'fullscreenchange', handler, false ); doc.addEventListener( 'mozfullscreenchange', handler, false ); doc.addEventListener( 'webkitfullscreenchange', handler, false ); } }, enter: function( callback ) { if ( self._options.trueFullscreen && fullscreen.os.support ) { fullscreen.os.enter( callback ); } else { fullscreen._enter( callback ); } }, _enter: function( callback ) { fullscreen.active = true; // hide the image until rescale is complete Utils.hide( self.getActiveImage() ); self.$( 'container' ).addClass( 'fullscreen' ); fullscreen.scrolled = $win.scrollTop(); // begin styleforce Utils.forceStyles(self.get('container'), { position: 'fixed', top: 0, left: 0, width: '100%', height: '100%', zIndex: 10000 }); var htmlbody = { height: '100%', overflow: 'hidden', margin:0, padding:0 }, data = self.getData(), options = self._options; Utils.forceStyles( DOM().html, htmlbody ); Utils.forceStyles( DOM().body, htmlbody ); // temporarily attach some keys // save the old ones first in a cloned object fullscreen.keymap = $.extend({}, self._keyboard.map); self.attachKeyboard({ escape: self.exitFullscreen, right: self.next, left: self.prev }); // temporarily save the crop fullscreen.crop = options.imageCrop; // set fullscreen options if ( options.fullscreenCrop != undef ) { options.imageCrop = options.fullscreenCrop; } // swap to big image if it's different from the display image if ( data && data.big && data.image !== data.big ) { var big = new Galleria.Picture(), cached = big.isCached( data.big ), index = self.getIndex(), thumb = self._thumbnails[ index ]; self.trigger( { type: Galleria.LOADSTART, cached: cached, rewind: false, index: index, imageTarget: self.getActiveImage(), thumbTarget: thumb, galleriaData: data }); big.load( data.big, function( big ) { self._scaleImage( big, { complete: function( big ) { self.trigger({ type: Galleria.LOADFINISH, cached: cached, index: index, rewind: false, imageTarget: big.image, thumbTarget: thumb }); var image = self._controls.getActive().image; if ( image ) { $( image ).width( big.image.width ).height( big.image.height ) .attr( 'style', $( big.image ).attr('style') ) .attr( 'src', big.image.src ); } } }); }); } // init the first rescale and attach callbacks self.rescale(function() { Utils.addTimer(false, function() { // show the image after 50 ms Utils.show( self.getActiveImage() ); if (typeof callback === 'function') { callback.call( self ); } }, 100); self.trigger( Galleria.FULLSCREEN_ENTER ); }); // bind the scaling to the resize event $win.resize( function() { fullscreen.scale(); } ); }, scale : function() { self.rescale(); }, exit: function( callback ) { if ( self._options.trueFullscreen && fullscreen.os.support ) { fullscreen.os.exit( callback ); } else { fullscreen._exit( callback ); } }, _exit: function( callback ) { fullscreen.active = false; Utils.hide( self.getActiveImage() ); self.$('container').removeClass( 'fullscreen' ); // revert all styles Utils.revertStyles( self.get('container'), DOM().html, DOM().body ); // scroll back window.scrollTo(0, fullscreen.scrolled); // detach all keyboard events and apply the old keymap self.detachKeyboard(); self.attachKeyboard( fullscreen.keymap ); // bring back cached options self._options.imageCrop = fullscreen.crop; //self._options.transition = fullscreen.transition; // return to original image var big = self.getData().big, image = self._controls.getActive().image; if ( !self.getData().iframe && image && big && big == image.src ) { window.setTimeout(function(src) { return function() { image.src = src; }; }( self.getData().image ), 1 ); } self.rescale(function() { Utils.addTimer(false, function() { // show the image after 50 ms Utils.show( self.getActiveImage() ); if ( typeof callback === 'function' ) { callback.call( self ); } $win.trigger( 'resize' ); }, 50); self.trigger( Galleria.FULLSCREEN_EXIT ); }); $win.unbind('resize', fullscreen.scale); } }; // invoke the native listeners fullscreen.os.listen(); // the internal idle object for controlling idle states var idle = this._idle = { timer: 'idle' + self._id, trunk: [], bound: false, add: function(elem, to) { if (!elem) { return; } if (!idle.bound) { idle.addEvent(); } elem = $(elem); var from = {}, style; for ( style in to ) { if ( to.hasOwnProperty( style ) ) { from[ style ] = elem.css( style ); } } elem.data('idle', { from: from, to: to, complete: true, busy: false }); idle.addTimer(); idle.trunk.push(elem); }, remove: function(elem) { elem = jQuery(elem); $.each(idle.trunk, function(i, el) { if ( el && el.length && !el.not(elem).length ) { self._idle.show(elem); self._idle.trunk.splice(i, 1); } }); if (!idle.trunk.length) { idle.removeEvent(); Utils.clearTimer( idle.timer ); } }, addEvent : function() { idle.bound = true; self.$('container').bind('mousemove click', idle.showAll ); }, removeEvent : function() { idle.bound = false; self.$('container').unbind('mousemove click', idle.showAll ); }, addTimer : function() { Utils.addTimer( idle.timer, function() { idle.hide(); }, self._options.idleTime ); }, hide : function() { if ( !self._options.idleMode || self.getIndex() === false || self.getData().iframe ) { return; } self.trigger( Galleria.IDLE_ENTER ); $.each( idle.trunk, function(i, elem) { var data = elem.data('idle'); if (! data) { return; } elem.data('idle').complete = false; Utils.animate( elem, data.to, { duration: self._options.idleSpeed }); }); }, showAll : function() { Utils.clearTimer( idle.timer ); $.each( idle.trunk, function( i, elem ) { idle.show( elem ); }); }, show: function(elem) { var data = elem.data('idle'); if (!data.busy && !data.complete) { data.busy = true; self.trigger( Galleria.IDLE_EXIT ); Utils.clearTimer( idle.timer ); Utils.animate( elem, data.from, { duration: self._options.idleSpeed/2, complete: function() { $(this).data('idle').busy = false; $(this).data('idle').complete = true; } }); } idle.addTimer(); } }; // internal lightbox object // creates a predesigned lightbox for simple popups of images in galleria var lightbox = this._lightbox = { width : 0, height : 0, initialized : false, active : null, image : null, elems : {}, keymap: false, init : function() { // trigger the event self.trigger( Galleria.LIGHTBOX_OPEN ); if ( lightbox.initialized ) { return; } lightbox.initialized = true; // create some elements to work with var elems = 'overlay box content shadow title info close prevholder prev nextholder next counter image', el = {}, op = self._options, css = '', abs = 'position:absolute;', prefix = 'lightbox-', cssMap = { overlay: 'position:fixed;display:none;opacity:'+op.overlayOpacity+';filter:alpha(opacity='+(op.overlayOpacity*100)+ ');top:0;left:0;width:100%;height:100%;background:'+op.overlayBackground+';z-index:99990', box: 'position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991', shadow: abs+'background:#000;width:100%;height:100%;', content: abs+'background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden', info: abs+'bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px', close: abs+'top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999', image: abs+'top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;', prevholder: abs+'width:50%;top:0;bottom:40px;cursor:pointer;', nextholder: abs+'width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;', prev: abs+'top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;text-align:center;color:#000;font:bold 16px/36px arial,sans-serif', next: abs+'top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;font:bold 16px/36px arial,sans-serif;text-align:center;color:#000', title: 'float:left', counter: 'float:right;margin-left:8px;' }, hover = function(elem) { return elem.hover( function() { $(this).css( 'color', '#bbb' ); }, function() { $(this).css( 'color', '#444' ); } ); }, appends = {}; // IE8 fix for IE's transparent background event "feature" if ( IE && IE > 7 ) { cssMap.nextholder += 'background:#000;filter:alpha(opacity=0);'; cssMap.prevholder += 'background:#000;filter:alpha(opacity=0);'; } // create and insert CSS $.each(cssMap, function( key, value ) { css += '.galleria-'+prefix+key+'{'+value+'}'; }); css += '.galleria-'+prefix+'box.iframe .galleria-'+prefix+'prevholder,'+ '.galleria-'+prefix+'box.iframe .galleria-'+prefix+'nextholder{'+ 'width:100px;height:100px;top:50%;margin-top:-70px}'; Utils.insertStyleTag( css ); // create the elements $.each(elems.split(' '), function( i, elemId ) { self.addElement( 'lightbox-' + elemId ); el[ elemId ] = lightbox.elems[ elemId ] = self.get( 'lightbox-' + elemId ); }); // initiate the image lightbox.image = new Galleria.Picture(); // append the elements $.each({ box: 'shadow content close prevholder nextholder', info: 'title counter', content: 'info image', prevholder: 'prev', nextholder: 'next' }, function( key, val ) { var arr = []; $.each( val.split(' '), function( i, prop ) { arr.push( prefix + prop ); }); appends[ prefix+key ] = arr; }); self.append( appends ); $( el.image ).append( lightbox.image.container ); $( DOM().body ).append( el.overlay, el.box ); Utils.optimizeTouch( el.box ); // add the prev/next nav and bind some controls hover( $( el.close ).bind( 'click', lightbox.hide ).html('&#215;') ); $.each( ['Prev','Next'], function(i, dir) { var $d = $( el[ dir.toLowerCase() ] ).html( /v/.test( dir ) ? '&#8249;&nbsp;' : '&nbsp;&#8250;' ), $e = $( el[ dir.toLowerCase()+'holder'] ); $e.bind( 'click', function() { lightbox[ 'show' + dir ](); }); // IE7 and touch devices will simply show the nav if ( IE < 8 || Galleria.TOUCH ) { $d.show(); return; } $e.hover( function() { $d.show(); }, function(e) { $d.stop().fadeOut( 200 ); }); }); $( el.overlay ).bind( 'click', lightbox.hide ); // the lightbox animation is slow on ipad if ( Galleria.IPAD ) { self._options.lightboxTransitionSpeed = 0; } }, rescale: function(event) { // calculate var width = Math.min( $win.width()-40, lightbox.width ), height = Math.min( $win.height()-60, lightbox.height ), ratio = Math.min( width / lightbox.width, height / lightbox.height ), destWidth = Math.round( lightbox.width * ratio ) + 40, destHeight = Math.round( lightbox.height * ratio ) + 60, to = { width: destWidth, height: destHeight, 'margin-top': Math.ceil( destHeight / 2 ) *- 1, 'margin-left': Math.ceil( destWidth / 2 ) *- 1 }; // if rescale event, don't animate if ( event ) { $( lightbox.elems.box ).css( to ); } else { $( lightbox.elems.box ).animate( to, { duration: self._options.lightboxTransitionSpeed, easing: self._options.easing, complete: function() { var image = lightbox.image, speed = self._options.lightboxFadeSpeed; self.trigger({ type: Galleria.LIGHTBOX_IMAGE, imageTarget: image.image }); $( image.container ).show(); $( image.image ).animate({ opacity: 1 }, speed); Utils.show( lightbox.elems.info, speed ); } }); } }, hide: function() { // remove the image lightbox.image.image = null; $win.unbind('resize', lightbox.rescale); $( lightbox.elems.box ).hide(); Utils.hide( lightbox.elems.info ); self.detachKeyboard(); self.attachKeyboard( lightbox.keymap ); lightbox.keymap = false; Utils.hide( lightbox.elems.overlay, 200, function() { $( this ).hide().css( 'opacity', self._options.overlayOpacity ); self.trigger( Galleria.LIGHTBOX_CLOSE ); }); }, showNext: function() { lightbox.show( self.getNext( lightbox.active ) ); }, showPrev: function() { lightbox.show( self.getPrev( lightbox.active ) ); }, show: function(index) { lightbox.active = index = typeof index === 'number' ? index : self.getIndex() || 0; if ( !lightbox.initialized ) { lightbox.init(); } // temporarily attach some keys // save the old ones first in a cloned object if ( !lightbox.keymap ) { lightbox.keymap = $.extend({}, self._keyboard.map); self.attachKeyboard({ escape: lightbox.hide, right: lightbox.showNext, left: lightbox.showPrev }); } $win.unbind('resize', lightbox.rescale ); var data = self.getData(index), total = self.getDataLength(), n = self.getNext( index ), ndata, p, i; Utils.hide( lightbox.elems.info ); try { for ( i = self._options.preload; i > 0; i-- ) { p = new Galleria.Picture(); ndata = self.getData( n ); p.preload( 'big' in ndata ? ndata.big : ndata.image ); n = self.getNext( n ); } } catch(e) {} lightbox.image.isIframe = !!data.iframe; $(lightbox.elems.box).toggleClass( 'iframe', !!data.iframe ); lightbox.image.load( data.iframe || data.big || data.image, function( image ) { lightbox.width = image.isIframe ? $(window).width() : image.original.width; lightbox.height = image.isIframe ? $(window).height() : image.original.height; $( image.image ).css({ width: image.isIframe ? '100%' : '100.1%', height: image.isIframe ? '100%' : '100.1%', top: 0, zIndex: 99998, opacity: 0, visibility: 'visible' }); lightbox.elems.title.innerHTML = data.title || ''; lightbox.elems.counter.innerHTML = (index + 1) + ' / ' + total; $win.resize( lightbox.rescale ); lightbox.rescale(); }); $( lightbox.elems.overlay ).show().css( 'visibility', 'visible' ); $( lightbox.elems.box ).show(); } }; return this; }; // end Galleria constructor Galleria.prototype = { // bring back the constructor reference constructor: Galleria, /** Use this function to initialize the gallery and start loading. Should only be called once per instance. @param {HTMLElement} target The target element @param {Object} options The gallery options @returns Instance */ init: function( target, options ) { var self = this; options = _legacyOptions( options ); // save the original ingredients this._original = { target: target, options: options, data: null }; // save the target here this._target = this._dom.target = target.nodeName ? target : $( target ).get(0); // save the original content for destruction this._original.html = this._target.innerHTML; // push the instance _instances.push( this ); // raise error if no target is detected if ( !this._target ) { Galleria.raise('Target not found', true); return; } // apply options this._options = { autoplay: false, carousel: true, carouselFollow: true, carouselSpeed: 400, carouselSteps: 'auto', clicknext: false, dailymotion: { foreground: '%23EEEEEE', highlight: '%235BCEC5', background: '%23222222', logo: 0, hideInfos: 1 }, dataConfig : function( elem ) { return {}; }, dataSelector: 'img', dataSource: this._target, debug: undef, dummy: undef, // 1.2.5 easing: 'galleria', extend: function(options) {}, fullscreenCrop: undef, // 1.2.5 fullscreenDoubleTap: true, // 1.2.4 toggles fullscreen on double-tap for touch devices fullscreenTransition: undef, // 1.2.6 height: 0, idleMode: true, // 1.2.4 toggles idleMode idleTime: 3000, idleSpeed: 200, imageCrop: false, imageMargin: 0, imagePan: false, imagePanSmoothness: 12, imagePosition: '50%', imageTimeout: undef, // 1.2.5 initialTransition: undef, // 1.2.4, replaces transitionInitial keepSource: false, layerFollow: true, // 1.2.5 lightbox: false, // 1.2.3 lightboxFadeSpeed: 200, lightboxTransitionSpeed: 200, linkSourceImages: true, maxScaleRatio: undef, minScaleRatio: undef, overlayOpacity: 0.85, overlayBackground: '#0b0b0b', pauseOnInteraction: true, popupLinks: false, preload: 2, queue: true, responsive: false, show: 0, showInfo: true, showCounter: true, showImagenav: true, swipe: true, // 1.2.4 thumbCrop: true, thumbEventType: 'click', thumbFit: true, thumbMargin: 0, thumbQuality: 'auto', thumbnails: true, touchTransition: undef, // 1.2.6 transition: 'fade', transitionInitial: undef, // legacy, deprecate in 1.3. Use initialTransition instead. transitionSpeed: 400, trueFullscreen: true, // 1.2.7 useCanvas: false, // 1.2.4 vimeo: { title: 0, byline: 0, portrait: 0, color: 'aaaaaa' }, wait: 5000, // 1.2.7 width: 'auto', youtube: { modestbranding: 1, autohide: 1, color: 'white', hd: 1, rel: 0, showinfo: 0 } }; // legacy support for transitionInitial this._options.initialTransition = this._options.initialTransition || this._options.transitionInitial; // turn off debug if ( options && options.debug === false ) { DEBUG = false; } // set timeout if ( options && typeof options.imageTimeout === 'number' ) { TIMEOUT = options.imageTimeout; } // set dummy if ( options && typeof options.dummy === 'string' ) { DUMMY = options.dummy; } // hide all content $( this._target ).children().hide(); // now we just have to wait for the theme... if ( typeof Galleria.theme === 'object' ) { this._init(); } else { // push the instance into the pool and run it when the theme is ready _pool.push( this ); } return this; }, // this method should only be called once per instance // for manipulation of data, use the .load method _init: function() { var self = this, options = this._options; if ( this._initialized ) { Galleria.raise( 'Init failed: Gallery instance already initialized.' ); return this; } this._initialized = true; if ( !Galleria.theme ) { Galleria.raise( 'Init failed: No theme found.', true ); return this; } // merge the theme & caller options $.extend( true, options, Galleria.theme.defaults, this._original.options, Galleria.configure.options ); // check for canvas support (function( can ) { if ( !( 'getContext' in can ) ) { can = null; return; } _canvas = _canvas || { elem: can, context: can.getContext( '2d' ), cache: {}, length: 0 }; }( doc.createElement( 'canvas' ) ) ); // bind the gallery to run when data is ready this.bind( Galleria.DATA, function() { // Warn for quirks mode if ( Galleria.QUIRK ) { Galleria.raise('Your page is in Quirks mode, Galleria may not render correctly. Please validate your HTML.'); } // save the new data this._original.data = this._data; // lets show the counter here this.get('total').innerHTML = this.getDataLength(); // cache the container var $container = this.$( 'container' ); // the gallery is ready, let's just wait for the css var num = { width: 0, height: 0 }; var testHeight = function() { return self.$( 'stage' ).height(); }; // check container and thumbnail height Utils.wait({ until: function() { // keep trying to get the value num = self._getWH(); $container.width( num.width ).height( num.height ); return testHeight() && num.width && num.height > 50; }, success: function() { self._width = num.width; self._height = num.height; // for some strange reason, webkit needs a single setTimeout to play ball if ( Galleria.WEBKIT ) { window.setTimeout( function() { self._run(); }, 1); } else { self._run(); } }, error: function() { // Height was probably not set, raise hard errors if ( testHeight() ) { Galleria.raise('Could not extract sufficient width/height of the gallery container. Traced measures: width:' + num.width + 'px, height: ' + num.height + 'px.', true); } else { Galleria.raise('Could not extract a stage height from the CSS. Traced height: ' + testHeight() + 'px.', true); } }, timeout: typeof this._options.wait == 'number' ? this._options.wait : false }); }); // build the gallery frame this.append({ 'info-text' : ['info-title', 'info-description'], 'info' : ['info-text'], 'image-nav' : ['image-nav-right', 'image-nav-left'], 'stage' : ['images', 'loader', 'counter', 'image-nav'], 'thumbnails-list' : ['thumbnails'], 'thumbnails-container' : ['thumb-nav-left', 'thumbnails-list', 'thumb-nav-right'], 'container' : ['stage', 'thumbnails-container', 'info', 'tooltip'] }); Utils.hide( this.$( 'counter' ).append( this.get( 'current' ), doc.createTextNode(' / '), this.get( 'total' ) ) ); this.setCounter('&#8211;'); Utils.hide( self.get('tooltip') ); // add a notouch class on the container to prevent unwanted :hovers on touch devices this.$( 'container' ).addClass( Galleria.TOUCH ? 'touch' : 'notouch' ); // add images to the controls $.each( new Array(2), function( i ) { // create a new Picture instance var image = new Galleria.Picture(); // apply some styles, create & prepend overlay $( image.container ).css({ position: 'absolute', top: 0, left: 0 }).prepend( self._layers[i] = $( Utils.create('galleria-layer') ).css({ position: 'absolute', top:0, left:0, right:0, bottom:0, zIndex:2 })[0] ); // append the image self.$( 'images' ).append( image.container ); // reload the controls self._controls[i] = image; }); // some forced generic styling this.$( 'images' ).css({ position: 'relative', top: 0, left: 0, width: '100%', height: '100%' }); this.$( 'thumbnails, thumbnails-list' ).css({ overflow: 'hidden', position: 'relative' }); // bind image navigation arrows this.$( 'image-nav-right, image-nav-left' ).bind( 'click', function(e) { // tune the clicknext option if ( options.clicknext ) { e.stopPropagation(); } // pause if options is set if ( options.pauseOnInteraction ) { self.pause(); } // navigate var fn = /right/.test( this.className ) ? 'next' : 'prev'; self[ fn ](); }); // hide controls if chosen to $.each( ['info','counter','image-nav'], function( i, el ) { if ( options[ 'show' + el.substr(0,1).toUpperCase() + el.substr(1).replace(/-/,'') ] === false ) { Utils.moveOut( self.get( el.toLowerCase() ) ); } }); // load up target content this.load(); // now it's usually safe to remove the content // IE will never stop loading if we remove it, so let's keep it hidden for IE (it's usually fast enough anyway) if ( !options.keepSource && !IE ) { this._target.innerHTML = ''; } // re-append the errors, if they happened before clearing if ( this.get( 'errors' ) ) { this.appendChild( 'target', 'errors' ); } // append the gallery frame this.appendChild( 'target', 'container' ); // parse the carousel on each thumb load if ( options.carousel ) { var count = 0, show = options.show; this.bind( Galleria.THUMBNAIL, function() { this.updateCarousel(); if ( ++count == this.getDataLength() && typeof show == 'number' && show > 0 ) { this._carousel.follow( show ); } }); } // bind window resize for responsiveness if ( options.responsive ) { $win.bind( 'resize', function() { if ( !self.isFullscreen() ) { self.resize(); } }); } // bind swipe gesture if ( options.swipe ) { (function( images ) { var swipeStart = [0,0], swipeStop = [0,0], limitX = 30, limitY = 100, multi = false, tid = 0, data, ev = { start: 'touchstart', move: 'touchmove', stop: 'touchend' }, getData = function(e) { return e.originalEvent.touches ? e.originalEvent.touches[0] : e; }, moveHandler = function( e ) { if ( e.originalEvent.touches && e.originalEvent.touches.length > 1 ) { return; } data = getData( e ); swipeStop = [ data.pageX, data.pageY ]; if ( !swipeStart[0] ) { swipeStart = swipeStop; } if ( Math.abs( swipeStart[0] - swipeStop[0] ) > 10 ) { e.preventDefault(); } }, upHandler = function( e ) { images.unbind( ev.move, moveHandler ); // if multitouch (possibly zooming), abort if ( ( e.originalEvent.touches && e.originalEvent.touches.length ) || multi ) { multi = !multi; return; } if ( Utils.timestamp() - tid < 1000 && Math.abs( swipeStart[0] - swipeStop[0] ) > limitX && Math.abs( swipeStart[1] - swipeStop[1] ) < limitY ) { e.preventDefault(); self[ swipeStart[0] > swipeStop[0] ? 'next' : 'prev' ](); } swipeStart = swipeStop = [0,0]; }; images.bind(ev.start, function(e) { if ( e.originalEvent.touches && e.originalEvent.touches.length > 1 ) { return; } data = getData(e); tid = Utils.timestamp(); swipeStart = swipeStop = [ data.pageX, data.pageY ]; images.bind(ev.move, moveHandler ).one(ev.stop, upHandler); }); }( self.$( 'images' ) )); // double-tap/click fullscreen toggle if ( options.fullscreenDoubleTap ) { this.$( 'stage' ).bind( 'touchstart', (function() { var last, cx, cy, lx, ly, now, getData = function(e) { return e.originalEvent.touches ? e.originalEvent.touches[0] : e; }; return function(e) { now = Galleria.utils.timestamp(); cx = getData(e).pageX; cy = getData(e).pageY; if ( ( now - last < 500 ) && ( cx - lx < 20) && ( cy - ly < 20) ) { self.toggleFullscreen(); e.preventDefault(); self.$( 'stage' ).unbind( 'touchend', arguments.callee ); return; } last = now; lx = cx; ly = cy; }; }())); } } // optimize touch for container Utils.optimizeTouch( this.get( 'container' ) ); // bind the ons $.each( Galleria.on.binds, function(i, bind) { self.bind( bind.type, bind.callback ); }); return this; }, // parse width & height from CSS or options _getWH : function() { var $container = this.$( 'container' ), $target = this.$( 'target' ), self = this, num = {}, arr; $.each(['width', 'height'], function( i, m ) { // first check if options is set if ( self._options[ m ] && typeof self._options[ m ] === 'number') { num[ m ] = self._options[ m ]; } else { arr = [ Utils.parseValue( $container.css( m ) ), // the container css height Utils.parseValue( $target.css( m ) ), // the target css height $container[ m ](), // the container jQuery method $target[ m ]() // the target jQuery method ]; // if first time, include the min-width & min-height if ( !self[ '_'+m ] ) { arr.splice(arr.length, Utils.parseValue( $container.css( 'min-'+m ) ), Utils.parseValue( $target.css( 'min-'+m ) ) ); } // else extract the measures from different sources and grab the highest value num[ m ] = Math.max.apply( Math, arr ); } }); // allow setting a height ratio instead of exact value // useful when doing responsive galleries if ( self._options.height && self._options.height < 2 ) { num.height = num.width * self._options.height; } return num; }, // Creates the thumbnails and carousel // can be used at any time, f.ex when the data object is manipulated _createThumbnails : function() { this.get( 'total' ).innerHTML = this.getDataLength(); var i, src, thumb, data, special, $container, self = this, o = this._options, // get previously active thumbnail, if exists active = (function() { var a = self.$('thumbnails').find('.active'); if ( !a.length ) { return false; } return a.find('img').attr('src'); }()), // cache the thumbnail option optval = typeof o.thumbnails === 'string' ? o.thumbnails.toLowerCase() : null, // move some data into the instance // for some reason, jQuery cant handle css(property) when zooming in FF, breaking the gallery // so we resort to getComputedStyle for browsers who support it getStyle = function( prop ) { return doc.defaultView && doc.defaultView.getComputedStyle ? doc.defaultView.getComputedStyle( thumb.container, null )[ prop ] : $container.css( prop ); }, fake = function(image, index, container) { return function() { $( container ).append( image ); self.trigger({ type: Galleria.THUMBNAIL, thumbTarget: image, index: index, galleriaData: self.getData( index ) }); }; }, onThumbEvent = function( e ) { // pause if option is set if ( o.pauseOnInteraction ) { self.pause(); } // extract the index from the data var index = $( e.currentTarget ).data( 'index' ); if ( self.getIndex() !== index ) { self.show( index ); } e.preventDefault(); }, onThumbLoad = function( thumb ) { // scale when ready thumb.scale({ width: thumb.data.width, height: thumb.data.height, crop: o.thumbCrop, margin: o.thumbMargin, canvas: o.useCanvas, complete: function( thumb ) { // shrink thumbnails to fit var top = ['left', 'top'], arr = ['Width', 'Height'], m, css, data = self.getData( thumb.index ), special = data.thumb.split(':'); // calculate shrinked positions $.each(arr, function( i, measure ) { m = measure.toLowerCase(); if ( (o.thumbCrop !== true || o.thumbCrop === m ) && o.thumbFit ) { css = {}; css[ m ] = thumb[ m ]; $( thumb.container ).css( css ); css = {}; css[ top[ i ] ] = 0; $( thumb.image ).css( css ); } // cache outer measures thumb[ 'outer' + measure ] = $( thumb.container )[ 'outer' + measure ]( true ); }); // set high quality if downscale is moderate Utils.toggleQuality( thumb.image, o.thumbQuality === true || ( o.thumbQuality === 'auto' && thumb.original.width < thumb.width * 3 ) ); // get "special" thumbs from provider if( data.iframe && special.length == 2 && special[0] in _video ) { _video[ special[0] ].getThumb( special[1], (function(img) { return function(src) { img.src = src; }; }( thumb.image ) )); } // trigger the THUMBNAIL event self.trigger({ type: Galleria.THUMBNAIL, thumbTarget: thumb.image, index: thumb.data.order, galleriaData: self.getData( thumb.data.order ) }); } }); }; this._thumbnails = []; this.$( 'thumbnails' ).empty(); // loop through data and create thumbnails for( i = 0; this._data[ i ]; i++ ) { data = this._data[ i ]; if ( o.thumbnails === true && (data.thumb || data.image) ) { // add a new Picture instance thumb = new Galleria.Picture(i); // save the index thumb.index = i; // get source from thumb or image src = data.thumb || data.image; // append the thumbnail this.$( 'thumbnails' ).append( thumb.container ); // cache the container $container = $( thumb.container ); thumb.data = { width : Utils.parseValue( getStyle( 'width' ) ), height : Utils.parseValue( getStyle( 'height' ) ), order : i }; // grab & reset size for smoother thumbnail loads if ( o.thumbFit && o.thumbCrop !== true ) { $container.css( { width: 'auto', height: 'auto' } ); } else { $container.css( { width: thumb.data.width, height: thumb.data.height } ); } // load the thumbnail special = src.split(':'); if ( special.length == 2 && special[0] in _video ) { thumb.load('data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D', { height: thumb.data.height, width: thumb.data.height*1.25 }, onThumbLoad); } else { thumb.load( src, onThumbLoad ); } // preload all images here if ( o.preload === 'all' ) { thumb.preload( data.image ); } // create empty spans if thumbnails is set to 'empty' } else if ( data.iframe || optval === 'empty' || optval === 'numbers' ) { thumb = { container: Utils.create( 'galleria-image' ), image: Utils.create( 'img', 'span' ), ready: true }; // create numbered thumbnails if ( optval === 'numbers' ) { $( thumb.image ).text( i + 1 ); } if( data.iframe ) { $( thumb.image ).addClass('iframe'); } this.$( 'thumbnails' ).append( thumb.container ); // we need to "fake" a loading delay before we append and trigger // 50+ should be enough window.setTimeout( ( fake )( thumb.image, i, thumb.container ), 50 + ( i*20 ) ); // create null object to silent errors } else { thumb = { container: null, image: null }; } // add events for thumbnails // you can control the event type using thumb_event_type // we'll add the same event to the source if it's kept $( thumb.container ).add( o.keepSource && o.linkSourceImages ? data.original : null ) .data('index', i).bind( o.thumbEventType, onThumbEvent ); if (active === src) { $( thumb.container ).addClass( 'active' ); } this._thumbnails.push( thumb ); } }, // the internal _run method should be called after loading data into galleria // makes sure the gallery has proper measurements before postrun & ready _run : function() { var self = this; self._createThumbnails(); // make sure we have a stageHeight && stageWidth Utils.wait({ timeout: 10000, until: function() { // Opera crap if ( Galleria.OPERA ) { self.$( 'stage' ).css( 'display', 'inline-block' ); } self._stageWidth = self.$( 'stage' ).width(); self._stageHeight = self.$( 'stage' ).height(); return( self._stageWidth && self._stageHeight > 50 ); // what is an acceptable height? }, success: function() { // save the instance _galleries.push( self ); // postrun some stuff after the gallery is ready // show counter Utils.show( self.get('counter') ); // bind carousel nav if ( self._options.carousel ) { self._carousel.bindControls(); } // start autoplay if ( self._options.autoplay ) { self.pause(); if ( typeof self._options.autoplay === 'number' ) { self._playtime = self._options.autoplay; } self.trigger( Galleria.PLAY ); self._playing = true; } // if second load, just do the show and return if ( self._firstrun ) { if ( typeof self._options.show === 'number' ) { self.show( self._options.show ); } return; } self._firstrun = true; // initialize the History plugin if ( Galleria.History ) { // bind the show method Galleria.History.change(function( value ) { // if ID is NaN, the user pressed back from the first image // return to previous address if ( isNaN( value ) ) { window.history.go(-1); // else show the image } else { self.show( value, undef, true ); } }); } self.trigger( Galleria.READY ); // call the theme init method Galleria.theme.init.call( self, self._options ); // Trigger Galleria.ready $.each( Galleria.ready.callbacks, function() { this.call( self, self._options ); }); // call the extend option self._options.extend.call( self, self._options ); // show the initial image // first test for permalinks in history if ( /^[0-9]{1,4}$/.test( HASH ) && Galleria.History ) { self.show( HASH, undef, true ); } else if( self._data[ self._options.show ] ) { self.show( self._options.show ); } }, error: function() { Galleria.raise('Stage width or height is too small to show the gallery. Traced measures: width:' + self._stageWidth + 'px, height: ' + self._stageHeight + 'px.', true); } }); }, /** Loads data into the gallery. You can call this method on an existing gallery to reload the gallery with new data. @param {Array|string} [source] Optional JSON array of data or selector of where to find data in the document. Defaults to the Galleria target or dataSource option. @param {string} [selector] Optional element selector of what elements to parse. Defaults to 'img'. @param {Function} [config] Optional function to modify the data extraction proceedure from the selector. See the dataConfig option for more information. @returns Instance */ load : function( source, selector, config ) { var self = this; // empty the data array this._data = []; // empty the thumbnails this._thumbnails = []; this.$('thumbnails').empty(); // shorten the arguments if ( typeof selector === 'function' ) { config = selector; selector = null; } // use the source set by target source = source || this._options.dataSource; // use selector set by option selector = selector || this._options.dataSelector; // use the dataConfig set by option config = config || this._options.dataConfig; // if source is a true object, make it into an array if( /^function Object/.test( source.constructor ) ) { source = [source]; } // check if the data is an array already if ( source.constructor === Array ) { if ( this.validate( source ) ) { this._data = source; this._parseData().trigger( Galleria.DATA ); } else { Galleria.raise( 'Load failed: JSON Array not valid.' ); } return this; } // add .video and .iframe to the selector (1.2.7) selector += ',.video,.iframe'; // loop through images and set data $( source ).find( selector ).each( function( i, elem ) { elem = $( elem ); var data = {}, parent = elem.parent(), href = parent.attr( 'href' ), rel = parent.attr( 'rel' ); if( href && ( elem[0].nodeName == 'IMG' || elem.hasClass('video') ) && _videoTest( href ) ) { data.video = href; } else if( href && elem.hasClass('iframe') ) { data.iframe = href; } else { data.image = data.big = href; } if ( rel ) { data.big = rel; } // alternative extraction from HTML5 data attribute, added in 1.2.7 $.each( 'big title description link layer'.split(' '), function( i, val ) { if ( elem.data(val) ) { data[ val ] = elem.data(val); } }); // mix default extractions with the hrefs and config // and push it into the data array self._data.push( $.extend({ title: elem.attr('title') || '', thumb: elem.attr('src'), image: elem.attr('src'), big: elem.attr('src'), description: elem.attr('alt') || '', link: elem.attr('longdesc'), original: elem.get(0) // saved as a reference }, data, config( elem ) ) ); }); // trigger the DATA event and return if ( this.getDataLength() ) { this._parseData().trigger( Galleria.DATA ); } else { Galleria.raise('Load failed: no data found.'); } return this; }, // make sure the data works properly _parseData : function() { var self = this, current; $.each( this._data, function( i, data ) { current = self._data[ i ]; // copy image as thumb if no thumb exists if ( 'thumb' in data === false ) { current.thumb = data.image; } // copy image as big image if no biggie exists if ( !'big' in data ) { current.big = data.image; } // parse video if ( 'video' in data ) { var result = _videoTest( data.video ); if ( result ) { current.iframe = _video[ result.provider ].embed( result.id ) + (function() { // add options if ( typeof self._options[ result.provider ] == 'object' ) { var str = '?', arr = []; $.each( self._options[ result.provider ], function( key, val ) { arr.push( key + '=' + val ); }); // small youtube specifics, perhaps move to _video later if ( result.provider == 'youtube' ) { arr = ['wmode=opaque'].concat(arr); } return str + arr.join('&'); } return ''; }()); delete current.video; if( !('thumb' in current) || !current.thumb ) { current.thumb = result.provider+':'+result.id; } } } }); return this; }, /** Destroy the Galleria instance and recover the original content @example this.destroy(); @returns Instance */ destroy: function() { this.get('target').innerHTML = this._original.html; return this; }, /** Adds and/or removes images from the gallery Works just like Array.splice https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice @example this.splice( 2, 4 ); // removes 4 images after the second image @returns Instance */ splice: function() { var self = this, args = Utils.array( arguments ); window.setTimeout(function() { protoArray.splice.apply( self._data, args ); self._parseData()._createThumbnails(); },2); return self; }, /** Append images to the gallery Works just like Array.push https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push @example this.push({ image: 'image1.jpg' }); // appends the image to the gallery @returns Instance */ push: function() { var self = this, args = Utils.array( arguments ); window.setTimeout(function() { protoArray.push.apply( self._data, args ); self._parseData()._createThumbnails(); },2); return self; }, _getActive: function() { return this._controls.getActive(); }, validate : function( data ) { // todo: validate a custom data array return true; }, /** Bind any event to Galleria @param {string} type The Event type to listen for @param {Function} fn The function to execute when the event is triggered @example this.bind( 'image', function() { Galleria.log('image shown') }); @returns Instance */ bind : function(type, fn) { // allow 'image' instead of Galleria.IMAGE type = _patchEvent( type ); this.$( 'container' ).bind( type, this.proxy(fn) ); return this; }, /** Unbind any event to Galleria @param {string} type The Event type to forget @returns Instance */ unbind : function(type) { type = _patchEvent( type ); this.$( 'container' ).unbind( type ); return this; }, /** Manually trigger a Galleria event @param {string} type The Event to trigger @returns Instance */ trigger : function( type ) { type = typeof type === 'object' ? $.extend( type, { scope: this } ) : { type: _patchEvent( type ), scope: this }; this.$( 'container' ).trigger( type ); return this; }, /** Assign an "idle state" to any element. The idle state will be applied after a certain amount of idle time Useful to hide f.ex navigation when the gallery is inactive @param {HTMLElement|string} elem The Dom node or selector to apply the idle state to @param {Object} styles the CSS styles to apply @example addIdleState( this.get('image-nav'), { opacity: 0 }); @example addIdleState( '.galleria-image-nav', { top: -200 }); @returns Instance */ addIdleState: function( elem, styles ) { this._idle.add.apply( this._idle, Utils.array( arguments ) ); return this; }, /** Removes any idle state previously set using addIdleState() @param {HTMLElement|string} elem The Dom node or selector to remove the idle state from. @returns Instance */ removeIdleState: function( elem ) { this._idle.remove.apply( this._idle, Utils.array( arguments ) ); return this; }, /** Force Galleria to enter idle mode. @returns Instance */ enterIdleMode: function() { this._idle.hide(); return this; }, /** Force Galleria to exit idle mode. @returns Instance */ exitIdleMode: function() { this._idle.showAll(); return this; }, /** Enter FullScreen mode @param {Function} callback the function to be executed when the fullscreen mode is fully applied. @returns Instance */ enterFullscreen: function( callback ) { this._fullscreen.enter.apply( this, Utils.array( arguments ) ); return this; }, /** Exits FullScreen mode @param {Function} callback the function to be executed when the fullscreen mode is fully applied. @returns Instance */ exitFullscreen: function( callback ) { this._fullscreen.exit.apply( this, Utils.array( arguments ) ); return this; }, /** Toggle FullScreen mode @param {Function} callback the function to be executed when the fullscreen mode is fully applied or removed. @returns Instance */ toggleFullscreen: function( callback ) { this._fullscreen[ this.isFullscreen() ? 'exit' : 'enter'].apply( this, Utils.array( arguments ) ); return this; }, /** Adds a tooltip to any element. You can also call this method with an object as argument with elemID:value pairs to apply tooltips to (see examples) @param {HTMLElement} elem The DOM Node to attach the event to @param {string|Function} value The tooltip message. Can also be a function that returns a string. @example this.bindTooltip( this.get('thumbnails'), 'My thumbnails'); @example this.bindTooltip( this.get('thumbnails'), function() { return 'My thumbs' }); @example this.bindTooltip( { image_nav: 'Navigation' }); @returns Instance */ bindTooltip: function( elem, value ) { this._tooltip.bind.apply( this._tooltip, Utils.array(arguments) ); return this; }, /** Note: this method is deprecated. Use refreshTooltip() instead. Redefine a tooltip. Use this if you want to re-apply a tooltip value to an already bound tooltip element. @param {HTMLElement} elem The DOM Node to attach the event to @param {string|Function} value The tooltip message. Can also be a function that returns a string. @returns Instance */ defineTooltip: function( elem, value ) { this._tooltip.define.apply( this._tooltip, Utils.array(arguments) ); return this; }, /** Refresh a tooltip value. Use this if you want to change the tooltip value at runtime, f.ex if you have a play/pause toggle. @param {HTMLElement} elem The DOM Node that has a tooltip that should be refreshed @returns Instance */ refreshTooltip: function( elem ) { this._tooltip.show.apply( this._tooltip, Utils.array(arguments) ); return this; }, /** Open a pre-designed lightbox with the currently active image. You can control some visuals using gallery options. @returns Instance */ openLightbox: function() { this._lightbox.show.apply( this._lightbox, Utils.array( arguments ) ); return this; }, /** Close the lightbox. @returns Instance */ closeLightbox: function() { this._lightbox.hide.apply( this._lightbox, Utils.array( arguments ) ); return this; }, /** Get the currently active image element. @returns {HTMLElement} The image element */ getActiveImage: function() { return this._getActive().image || undef; }, /** Get the currently active thumbnail element. @returns {HTMLElement} The thumbnail element */ getActiveThumb: function() { return this._thumbnails[ this._active ].image || undef; }, /** Get the mouse position relative to the gallery container @param e The mouse event @example var gallery = this; $(document).mousemove(function(e) { console.log( gallery.getMousePosition(e).x ); }); @returns {Object} Object with x & y of the relative mouse postion */ getMousePosition : function(e) { return { x: e.pageX - this.$( 'container' ).offset().left, y: e.pageY - this.$( 'container' ).offset().top }; }, /** Adds a panning effect to the image @param [img] The optional image element. If not specified it takes the currently active image @returns Instance */ addPan : function( img ) { if ( this._options.imageCrop === false ) { return; } img = $( img || this.getActiveImage() ); // define some variables and methods var self = this, x = img.width() / 2, y = img.height() / 2, destX = parseInt( img.css( 'left' ), 10 ), destY = parseInt( img.css( 'top' ), 10 ), curX = destX || 0, curY = destY || 0, distX = 0, distY = 0, active = false, ts = Utils.timestamp(), cache = 0, move = 0, // positions the image position = function( dist, cur, pos ) { if ( dist > 0 ) { move = Math.round( Math.max( dist * -1, Math.min( 0, cur ) ) ); if ( cache !== move ) { cache = move; if ( IE === 8 ) { // scroll is faster for IE img.parent()[ 'scroll' + pos ]( move * -1 ); } else { var css = {}; css[ pos.toLowerCase() ] = move; img.css(css); } } } }, // calculates mouse position after 50ms calculate = function(e) { if (Utils.timestamp() - ts < 50) { return; } active = true; x = self.getMousePosition(e).x; y = self.getMousePosition(e).y; }, // the main loop to check loop = function(e) { if (!active) { return; } distX = img.width() - self._stageWidth; distY = img.height() - self._stageHeight; destX = x / self._stageWidth * distX * -1; destY = y / self._stageHeight * distY * -1; curX += ( destX - curX ) / self._options.imagePanSmoothness; curY += ( destY - curY ) / self._options.imagePanSmoothness; position( distY, curY, 'Top' ); position( distX, curX, 'Left' ); }; // we need to use scroll in IE8 to speed things up if ( IE === 8 ) { img.parent().scrollTop( curY * -1 ).scrollLeft( curX * -1 ); img.css({ top: 0, left: 0 }); } // unbind and bind event this.$( 'stage' ).unbind( 'mousemove', calculate ).bind( 'mousemove', calculate ); // loop the loop Utils.addTimer( 'pan' + self._id, loop, 50, true); return this; }, /** Brings the scope into any callback @param fn The callback to bring the scope into @param [scope] Optional scope to bring @example $('#fullscreen').click( this.proxy(function() { this.enterFullscreen(); }) ) @returns {Function} Return the callback with the gallery scope */ proxy : function( fn, scope ) { if ( typeof fn !== 'function' ) { return F; } scope = scope || this; return function() { return fn.apply( scope, Utils.array( arguments ) ); }; }, /** Removes the panning effect set by addPan() @returns Instance */ removePan: function() { // todo: doublecheck IE8 this.$( 'stage' ).unbind( 'mousemove' ); Utils.clearTimer( 'pan' + this._id ); return this; }, /** Adds an element to the Galleria DOM array. When you add an element here, you can access it using element ID in many API calls @param {string} id The element ID you wish to use. You can add many elements by adding more arguments. @example addElement('mybutton'); @example addElement('mybutton','mylink'); @returns Instance */ addElement : function( id ) { var dom = this._dom; $.each( Utils.array(arguments), function( i, blueprint ) { dom[ blueprint ] = Utils.create( 'galleria-' + blueprint ); }); return this; }, /** Attach keyboard events to Galleria @param {Object} map The map object of events. Possible keys are 'UP', 'DOWN', 'LEFT', 'RIGHT', 'RETURN', 'ESCAPE', 'BACKSPACE', and 'SPACE'. @example this.attachKeyboard({ right: this.next, left: this.prev, up: function() { console.log( 'up key pressed' ) } }); @returns Instance */ attachKeyboard : function( map ) { this._keyboard.attach.apply( this._keyboard, Utils.array( arguments ) ); return this; }, /** Detach all keyboard events to Galleria @returns Instance */ detachKeyboard : function() { this._keyboard.detach.apply( this._keyboard, Utils.array( arguments ) ); return this; }, /** Fast helper for appending galleria elements that you added using addElement() @param {string} parentID The parent element ID where the element will be appended @param {string} childID the element ID that should be appended @example this.addElement('myElement'); this.appendChild( 'info', 'myElement' ); @returns Instance */ appendChild : function( parentID, childID ) { this.$( parentID ).append( this.get( childID ) || childID ); return this; }, /** Fast helper for prepending galleria elements that you added using addElement() @param {string} parentID The parent element ID where the element will be prepended @param {string} childID the element ID that should be prepended @example this.addElement('myElement'); this.prependChild( 'info', 'myElement' ); @returns Instance */ prependChild : function( parentID, childID ) { this.$( parentID ).prepend( this.get( childID ) || childID ); return this; }, /** Remove an element by blueprint @param {string} elemID The element to be removed. You can remove multiple elements by adding arguments. @returns Instance */ remove : function( elemID ) { this.$( Utils.array( arguments ).join(',') ).remove(); return this; }, // a fast helper for building dom structures // leave this out of the API for now append : function( data ) { var i, j; for( i in data ) { if ( data.hasOwnProperty( i ) ) { if ( data[i].constructor === Array ) { for( j = 0; data[i][j]; j++ ) { this.appendChild( i, data[i][j] ); } } else { this.appendChild( i, data[i] ); } } } return this; }, // an internal helper for scaling according to options _scaleImage : function( image, options ) { image = image || this._controls.getActive(); // janpub (JH) fix: // image might be unselected yet // e.g. when external logics rescales the gallery on window resize events if( !image ) { return; } var self = this, complete, scaleLayer = function( img ) { $( img.container ).children(':first').css({ top: Math.max(0, Utils.parseValue( img.image.style.top )), left: Math.max(0, Utils.parseValue( img.image.style.left )), width: Utils.parseValue( img.image.width ), height: Utils.parseValue( img.image.height ) }); }; options = $.extend({ width: this._stageWidth, height: this._stageHeight, crop: this._options.imageCrop, max: this._options.maxScaleRatio, min: this._options.minScaleRatio, margin: this._options.imageMargin, position: this._options.imagePosition }, options ); if ( this._options.layerFollow && this._options.imageCrop !== true ) { if ( typeof options.complete == 'function' ) { complete = options.complete; options.complete = function() { complete.call( image, image ); scaleLayer( image ); }; } else { options.complete = scaleLayer; } } else { $( image.container ).children(':first').css({ top: 0, left: 0 }); } image.scale( options ); return this; }, /** Updates the carousel, useful if you resize the gallery and want to re-check if the carousel nav is needed. @returns Instance */ updateCarousel : function() { this._carousel.update(); return this; }, /** Resize the entire gallery container @param {Object} [measures] Optional object with width/height specified @param {Function} [complete] The callback to be called when the scaling is complete @returns Instance */ resize : function( measures, complete ) { if ( typeof measures == 'function' ) { complete = measures; measures = undef; } measures = $.extend( { width:0, height:0 }, measures ); var self = this, $container = this.$( 'container' ), aspect = this._options.responsive == 'aspect' && ( !measures.width || !measures.height ), ratio; $.each( measures, function( m, val ) { if ( !val ) { $container[ m ]( 'auto' ); measures[ m ] = self._getWH()[ m ]; } }); // experimental aspect option, not documented yet. Use ratio-based height instead! if ( aspect ) { ratio = Math.min( measures.width/this._width, measures.height/this._height ); } $.each( measures, function( m, val ) { $container[ m ]( ratio ? ratio * self[ '_' + m ] : val ); }); return this.rescale( complete ); }, /** Rescales the gallery @param {number} width The target width @param {number} height The target height @param {Function} complete The callback to be called when the scaling is complete @returns Instance */ rescale : function( width, height, complete ) { var self = this; // allow rescale(fn) if ( typeof width === 'function' ) { complete = width; width = undef; } var scale = function() { // set stagewidth self._stageWidth = width || self.$( 'stage' ).width(); self._stageHeight = height || self.$( 'stage' ).height(); // scale the active image self._scaleImage(); if ( self._options.carousel ) { self.updateCarousel(); } self.trigger( Galleria.RESCALE ); if ( typeof complete === 'function' ) { complete.call( self ); } }; if ( Galleria.WEBKIT && !Galleria.TOUCH && !width && !height ) { Utils.addTimer( false, scale, 10 );// webkit is too fast } else { scale.call( self ); } return this; }, /** Refreshes the gallery. Useful if you change image options at runtime and want to apply the changes to the active image. @returns Instance */ refreshImage : function() { this._scaleImage(); if ( this._options.imagePan ) { this.addPan(); } return this; }, /** Shows an image by index @param {number|boolean} index The index to show @param {Boolean} rewind A boolean that should be true if you want the transition to go back @returns Instance */ show : function( index, rewind, _history ) { // do nothing if index is false or queue is false and transition is in progress if ( index === false || ( !this._options.queue && this._queue.stalled ) ) { return; } index = Math.max( 0, Math.min( parseInt( index, 10 ), this.getDataLength() - 1 ) ); rewind = typeof rewind !== 'undefined' ? !!rewind : index < this.getIndex(); _history = _history || false; // do the history thing and return if ( !_history && Galleria.History ) { Galleria.History.set( index.toString() ); return; } this._active = index; protoArray.push.call( this._queue, { index : index, rewind : rewind }); if ( !this._queue.stalled ) { this._show(); } return this; }, // the internal _show method does the actual showing _show : function() { // shortcuts var self = this, queue = this._queue[ 0 ], data = this.getData( queue.index ); if ( !data ) { return; } var src = data.iframe || ( this.isFullscreen() && 'big' in data ? data.big : data.image ), // use big image if fullscreen mode active = this._controls.getActive(), next = this._controls.getNext(), cached = next.isCached( src ), thumb = this._thumbnails[ queue.index ], mousetrigger = function() { $( next.image ).trigger( 'mouseup' ); }; // to be fired when loading & transition is complete: var complete = (function( data, next, active, queue, thumb ) { return function() { var win; // remove stalled self._queue.stalled = false; // optimize quality Utils.toggleQuality( next.image, self._options.imageQuality ); // remove old layer self._layers[ self._controls.active ].innerHTML = ''; // swap $( active.container ).css({ zIndex: 0, opacity: 0 }).show(); if( active.isIframe ) { $( active.container ).find( 'iframe' ).remove(); } self.$('container').toggleClass('iframe', !!data.iframe); $( next.container ).css({ zIndex: 1, left: 0, top: 0 }).show(); self._controls.swap(); // add pan according to option if ( self._options.imagePan ) { self.addPan( next.image ); } // make the image link or add lightbox // link takes precedence over lightbox if both are detected if ( data.link || self._options.lightbox || self._options.clicknext ) { $( next.image ).css({ cursor: 'pointer' }).bind( 'mouseup', function() { // clicknext if ( self._options.clicknext && !Galleria.TOUCH ) { if ( self._options.pauseOnInteraction ) { self.pause(); } self.next(); return; } // popup link if ( data.link ) { if ( self._options.popupLinks ) { win = window.open( data.link, '_blank' ); } else { window.location.href = data.link; } return; } if ( self._options.lightbox ) { self.openLightbox(); } }); } // remove the queued image protoArray.shift.call( self._queue ); // if we still have images in the queue, show it if ( self._queue.length ) { self._show(); } // check if we are playing self._playCheck(); // trigger IMAGE event self.trigger({ type: Galleria.IMAGE, index: queue.index, imageTarget: next.image, thumbTarget: thumb.image, galleriaData: data }); }; }( data, next, active, queue, thumb )); // let the carousel follow if ( this._options.carousel && this._options.carouselFollow ) { this._carousel.follow( queue.index ); } // preload images if ( this._options.preload ) { var p, i, n = this.getNext(), ndata; try { for ( i = this._options.preload; i > 0; i-- ) { p = new Galleria.Picture(); ndata = self.getData( n ); p.preload( this.isFullscreen() && 'big' in ndata ? ndata.big : ndata.image ); n = self.getNext( n ); } } catch(e) {} } // show the next image, just in case Utils.show( next.container ); next.isIframe = !!data.iframe; // add active classes $( self._thumbnails[ queue.index ].container ) .addClass( 'active' ) .siblings( '.active' ) .removeClass( 'active' ); // trigger the LOADSTART event self.trigger( { type: Galleria.LOADSTART, cached: cached, index: queue.index, rewind: queue.rewind, imageTarget: next.image, thumbTarget: thumb.image, galleriaData: data }); // begin loading the next image next.load( src, function( next ) { // add layer HTML var layer = $( self._layers[ 1-self._controls.active ] ).html( data.layer || '' ).hide(); self._scaleImage( next, { complete: function( next ) { // toggle low quality for IE if ( 'image' in active ) { Utils.toggleQuality( active.image, false ); } Utils.toggleQuality( next.image, false ); // stall the queue self._queue.stalled = true; // remove the image panning, if applied // TODO: rethink if this is necessary self.removePan(); // set the captions and counter self.setInfo( queue.index ); self.setCounter( queue.index ); // show the layer now if ( data.layer ) { layer.show(); // inherit click events set on image if ( data.link || self._options.lightbox || self._options.clicknext ) { layer.css( 'cursor', 'pointer' ).unbind( 'mouseup' ).mouseup( mousetrigger ); } } // trigger the LOADFINISH event self.trigger({ type: Galleria.LOADFINISH, cached: cached, index: queue.index, rewind: queue.rewind, imageTarget: next.image, thumbTarget: self._thumbnails[ queue.index ].image, galleriaData: self.getData( queue.index ) }); var transition = self._options.transition; // can JavaScript loop through objects in order? yes. $.each({ initial: active.image === null, touch: Galleria.TOUCH, fullscreen: self.isFullscreen() }, function( type, arg ) { if ( arg && self._options[ type + 'Transition' ] !== undef ) { transition = self._options[ type + 'Transition' ]; return false; } }); // validate the transition if ( transition in _transitions === false ) { complete(); } else { var params = { prev: active.container, next: next.container, rewind: queue.rewind, speed: self._options.transitionSpeed || 400 }; // call the transition function and send some stuff _transitions[ transition ].call(self, params, complete ); } } }); }); }, /** Gets the next index @param {number} [base] Optional starting point @returns {number} the next index, or the first if you are at the first (looping) */ getNext : function( base ) { base = typeof base === 'number' ? base : this.getIndex(); return base === this.getDataLength() - 1 ? 0 : base + 1; }, /** Gets the previous index @param {number} [base] Optional starting point @returns {number} the previous index, or the last if you are at the first (looping) */ getPrev : function( base ) { base = typeof base === 'number' ? base : this.getIndex(); return base === 0 ? this.getDataLength() - 1 : base - 1; }, /** Shows the next image in line @returns Instance */ next : function() { if ( this.getDataLength() > 1 ) { this.show( this.getNext(), false ); } return this; }, /** Shows the previous image in line @returns Instance */ prev : function() { if ( this.getDataLength() > 1 ) { this.show( this.getPrev(), true ); } return this; }, /** Retrieve a DOM element by element ID @param {string} elemId The delement ID to fetch @returns {HTMLElement} The elements DOM node or null if not found. */ get : function( elemId ) { return elemId in this._dom ? this._dom[ elemId ] : null; }, /** Retrieve a data object @param {number} index The data index to retrieve. If no index specified it will take the currently active image @returns {Object} The data object */ getData : function( index ) { return index in this._data ? this._data[ index ] : this._data[ this._active ]; }, /** Retrieve the number of data items @returns {number} The data length */ getDataLength : function() { return this._data.length; }, /** Retrieve the currently active index @returns {number|boolean} The active index or false if none found */ getIndex : function() { return typeof this._active === 'number' ? this._active : false; }, /** Retrieve the stage height @returns {number} The stage height */ getStageHeight : function() { return this._stageHeight; }, /** Retrieve the stage width @returns {number} The stage width */ getStageWidth : function() { return this._stageWidth; }, /** Retrieve the option @param {string} key The option key to retrieve. If no key specified it will return all options in an object. @returns option or options */ getOptions : function( key ) { return typeof key === 'undefined' ? this._options : this._options[ key ]; }, /** Set options to the instance. You can set options using a key & value argument or a single object argument (see examples) @param {string} key The option key @param {string} value the the options value @example setOptions( 'autoplay', true ) @example setOptions({ autoplay: true }); @returns Instance */ setOptions : function( key, value ) { if ( typeof key === 'object' ) { $.extend( this._options, key ); } else { this._options[ key ] = value; } return this; }, /** Starts playing the slideshow @param {number} delay Sets the slideshow interval in milliseconds. If you set it once, you can just call play() and get the same interval the next time. @returns Instance */ play : function( delay ) { this._playing = true; this._playtime = delay || this._playtime; this._playCheck(); this.trigger( Galleria.PLAY ); return this; }, /** Stops the slideshow if currently playing @returns Instance */ pause : function() { this._playing = false; this.trigger( Galleria.PAUSE ); return this; }, /** Toggle between play and pause events. @param {number} delay Sets the slideshow interval in milliseconds. @returns Instance */ playToggle : function( delay ) { return ( this._playing ) ? this.pause() : this.play( delay ); }, /** Checks if the gallery is currently playing @returns {Boolean} */ isPlaying : function() { return this._playing; }, /** Checks if the gallery is currently in fullscreen mode @returns {Boolean} */ isFullscreen : function() { return this._fullscreen.active; }, _playCheck : function() { var self = this, played = 0, interval = 20, now = Utils.timestamp(), timer_id = 'play' + this._id; if ( this._playing ) { Utils.clearTimer( timer_id ); var fn = function() { played = Utils.timestamp() - now; if ( played >= self._playtime && self._playing ) { Utils.clearTimer( timer_id ); self.next(); return; } if ( self._playing ) { // trigger the PROGRESS event self.trigger({ type: Galleria.PROGRESS, percent: Math.ceil( played / self._playtime * 100 ), seconds: Math.floor( played / 1000 ), milliseconds: played }); Utils.addTimer( timer_id, fn, interval ); } }; Utils.addTimer( timer_id, fn, interval ); } }, /** Modify the slideshow delay @param {number} delay the number of milliseconds between slides, @returns Instance */ setPlaytime: function( delay ) { this._playtime = delay; return this; }, setIndex: function( val ) { this._active = val; return this; }, /** Manually modify the counter @param {number} [index] Optional data index to fectch, if no index found it assumes the currently active index @returns Instance */ setCounter: function( index ) { if ( typeof index === 'number' ) { index++; } else if ( typeof index === 'undefined' ) { index = this.getIndex()+1; } this.get( 'current' ).innerHTML = index; if ( IE ) { // weird IE bug var count = this.$( 'counter' ), opacity = count.css( 'opacity' ); if ( parseInt( opacity, 10 ) === 1) { Utils.removeAlpha( count[0] ); } else { this.$( 'counter' ).css( 'opacity', opacity ); } } return this; }, /** Manually set captions @param {number} [index] Optional data index to fectch and apply as caption, if no index found it assumes the currently active index @returns Instance */ setInfo : function( index ) { var self = this, data = this.getData( index ); $.each( ['title','description'], function( i, type ) { var elem = self.$( 'info-' + type ); if ( !!data[type] ) { elem[ data[ type ].length ? 'show' : 'hide' ]().html( data[ type ] ); } else { elem.empty().hide(); } }); return this; }, /** Checks if the data contains any captions @param {number} [index] Optional data index to fectch, if no index found it assumes the currently active index. @returns {boolean} */ hasInfo : function( index ) { var check = 'title description'.split(' '), i; for ( i = 0; check[i]; i++ ) { if ( !!this.getData( index )[ check[i] ] ) { return true; } } return false; }, jQuery : function( str ) { var self = this, ret = []; $.each( str.split(','), function( i, elemId ) { elemId = $.trim( elemId ); if ( self.get( elemId ) ) { ret.push( elemId ); } }); var jQ = $( self.get( ret.shift() ) ); $.each( ret, function( i, elemId ) { jQ = jQ.add( self.get( elemId ) ); }); return jQ; }, /** Converts element IDs into a jQuery collection You can call for multiple IDs separated with commas. @param {string} str One or more element IDs (comma-separated) @returns jQuery @example this.$('info,container').hide(); */ $ : function( str ) { return this.jQuery.apply( this, Utils.array( arguments ) ); } }; // End of Galleria prototype // Add events as static variables $.each( _events, function( i, ev ) { // legacy events var type = /_/.test( ev ) ? ev.replace( /_/g, '' ) : ev; Galleria[ ev.toUpperCase() ] = 'galleria.'+type; } ); $.extend( Galleria, { // Browser helpers IE9: IE === 9, IE8: IE === 8, IE7: IE === 7, IE6: IE === 6, IE: IE, WEBKIT: /webkit/.test( NAV ), CHROME: /chrome/.test( NAV ), SAFARI: /safari/.test( NAV ) && !(/chrome/.test( NAV )), QUIRK: ( IE && doc.compatMode && doc.compatMode === "BackCompat" ), MAC: /mac/.test( navigator.platform.toLowerCase() ), OPERA: !!window.opera, IPHONE: /iphone/.test( NAV ), IPAD: /ipad/.test( NAV ), ANDROID: /android/.test( NAV ), TOUCH: ('ontouchstart' in doc) }); // Galleria static methods /** Adds a theme that you can use for your Gallery @param {Object} theme Object that should contain all your theme settings. <ul> <li>name - name of the theme</li> <li>author - name of the author</li> <li>css - css file name (not path)</li> <li>defaults - default options to apply, including theme-specific options</li> <li>init - the init function</li> </ul> @returns {Object} theme */ Galleria.addTheme = function( theme ) { // make sure we have a name if ( !theme.name ) { Galleria.raise('No theme name specified'); } if ( typeof theme.defaults !== 'object' ) { theme.defaults = {}; } else { theme.defaults = _legacyOptions( theme.defaults ); } var css = false, reg; if ( typeof theme.css === 'string' ) { // look for manually added CSS $('link').each(function( i, link ) { reg = new RegExp( theme.css ); if ( reg.test( link.href ) ) { // we found the css css = true; // the themeload trigger _themeLoad( theme ); return false; } }); // else look for the absolute path and load the CSS dynamic if ( !css ) { $('script').each(function( i, script ) { // look for the theme script reg = new RegExp( 'galleria\\.' + theme.name.toLowerCase() + '\\.' ); if( reg.test( script.src )) { // we have a match css = script.src.replace(/[^\/]*$/, '') + theme.css; Utils.addTimer( "css", function() { Utils.loadCSS( css, 'galleria-theme', function() { // the themeload trigger _themeLoad( theme ); }); }, 1); } }); } if ( !css ) { Galleria.raise('No theme CSS loaded'); } } else { // pass _themeLoad( theme ); } return theme; }; /** loadTheme loads a theme js file and attaches a load event to Galleria @param {string} src The relative path to the theme source file @param {Object} [options] Optional options you want to apply @returns Galleria */ Galleria.loadTheme = function( src, options ) { var loaded = false, length = _galleries.length, err = window.setTimeout( function() { Galleria.raise( "Theme at " + src + " could not load, check theme path.", true ); }, 5000 ); // first clear the current theme, if exists Galleria.theme = undef; // load the theme Utils.loadScript( src, function() { window.clearTimeout( err ); // check for existing galleries and reload them with the new theme if ( length ) { // temporary save the new galleries var refreshed = []; // refresh all instances // when adding a new theme to an existing gallery, all options will be resetted but the data will be kept // you can apply new options as a second argument $.each( Galleria.get(), function(i, instance) { // mix the old data and options into the new instance var op = $.extend( instance._original.options, { data_source: instance._data }, options); // remove the old container instance.$('container').remove(); // create a new instance var g = new Galleria(); // move the id g._id = instance._id; // initialize the new instance g.init( instance._original.target, op ); // push the new instance refreshed.push( g ); }); // now overwrite the old holder with the new instances _galleries = refreshed; } }); return Galleria; }; /** Retrieves a Galleria instance. @param {number} [index] Optional index to retrieve. If no index is supplied, the method will return all instances in an array. @returns Instance or Array of instances */ Galleria.get = function( index ) { if ( !!_instances[ index ] ) { return _instances[ index ]; } else if ( typeof index !== 'number' ) { return _instances; } else { Galleria.raise('Gallery index ' + index + ' not found'); } }; /** Configure Galleria options via a static function. The options will be applied to all instances @param {string|object} key The options to apply or a key @param [value] If key is a string, this is the value @returns Galleria */ Galleria.configure = function( key, value ) { var opts = {}; if( typeof key == 'string' && value ) { opts[key] = value; key = opts; } else { $.extend( opts, key ); } Galleria.configure.options = opts; $.each( Galleria.get(), function(i, instance) { instance.setOptions( opts ); }); return Galleria; }; Galleria.configure.options = {}; /** Bind a Galleria event to the gallery @param {string} type A string representing the galleria event @param {function} callback The function that should run when the event is triggered @returns Galleria */ Galleria.on = function( type, callback ) { if ( !type ) { return; } Galleria.on.binds.push({ type: type, callback: callback || F }); $.each( Galleria.get(), function(i, instance) { instance.bind( type, callback ); }); return Galleria; }; Galleria.on.binds = []; /** Run Galleria Alias for $(selector).galleria(options) @param {string} selector A selector of element(s) to intialize galleria to @param {object} options The options to apply @returns Galleria */ Galleria.run = function( selector, options ) { $( selector || '#galleria' ).galleria( options ); return Galleria; }; /** Creates a transition to be used in your gallery @param {string} name The name of the transition that you will use as an option @param {Function} fn The function to be executed in the transition. The function contains two arguments, params and complete. Use the params Object to integrate the transition, and then call complete when you are done. @returns Galleria */ Galleria.addTransition = function( name, fn ) { _transitions[name] = fn; return Galleria; }; /** The Galleria utilites */ Galleria.utils = Utils; /** A helper metod for cross-browser logging. It uses the console log if available otherwise it falls back to alert @example Galleria.log("hello", document.body, [1,2,3]); */ Galleria.log = (function() { if( 'console' in window && 'log' in window.console ) { return window.console.log; } else { return function() { window.alert( Utils.array( arguments ).join(', ') ); }; } }()); /** A ready method for adding callbacks when a gallery is ready Each method is call before the extend option for every instance @param {function} callback The function to call @returns Galleria */ Galleria.ready = function( fn ) { $.each( _galleries, function( i, gallery ) { fn.call( gallery, gallery._options ); }); Galleria.ready.callbacks.push( fn ); return Galleria; }; Galleria.ready.callbacks = []; /** Method for raising errors @param {string} msg The message to throw @param {boolean} [fatal] Set this to true to override debug settings and display a fatal error */ Galleria.raise = function( msg, fatal ) { var type = fatal ? 'Fatal error' : 'Error', self = this, css = { color: '#fff', position: 'absolute', top: 0, left: 0, zIndex: 100000 }, echo = function( msg ) { var html = '<div style="padding:4px;margin:0 0 2px;background:#' + ( fatal ? '811' : '222' ) + '";>' + ( fatal ? '<strong>' + type + ': </strong>' : '' ) + msg + '</div>'; $.each( _instances, function() { var cont = this.$( 'errors' ), target = this.$( 'target' ); if ( !cont.length ) { target.css( 'position', 'relative' ); cont = this.addElement( 'errors' ).appendChild( 'target', 'errors' ).$( 'errors' ).css(css); } cont.append( html ); }); if ( !_instances.length ) { $('<div>').css( $.extend( css, { position: 'fixed' } ) ).append( html ).appendTo( DOM().body ); } }; // if debug is on, display errors and throw exception if fatal if ( DEBUG ) { echo( msg ); if ( fatal ) { throw new Error(type + ': ' + msg); } // else just echo a silent generic error if fatal } else if ( fatal ) { if ( _hasError ) { return; } _hasError = true; fatal = false; echo( 'Gallery could not load.' ); } }; // Add the version Galleria.version = VERSION; /** A method for checking what version of Galleria the user has installed and throws a readable error if the user needs to upgrade. Useful when building plugins that requires a certain version to function. @param {number} version The minimum version required @param {string} [msg] Optional message to display. If not specified, Galleria will throw a generic error. @returns Galleria */ Galleria.requires = function( version, msg ) { msg = msg || 'You need to upgrade Galleria to version ' + version + ' to use one or more components.'; if ( Galleria.version < version ) { Galleria.raise(msg, true); } return Galleria; }; /** Adds preload, cache, scale and crop functionality @constructor @requires jQuery @param {number} [id] Optional id to keep track of instances */ Galleria.Picture = function( id ) { // save the id this.id = id || null; // the image should be null until loaded this.image = null; // Create a new container this.container = Utils.create('galleria-image'); // add container styles $( this.container ).css({ overflow: 'hidden', position: 'relative' // for IE Standards mode }); // saves the original measurements this.original = { width: 0, height: 0 }; // flag when the image is ready this.ready = false; // flag for iframe Picture this.isIframe = false; }; Galleria.Picture.prototype = { // the inherited cache object cache: {}, // show the image on stage show: function() { Utils.show( this.image ); }, // hide the image hide: function() { Utils.moveOut( this.image ); }, clear: function() { this.image = null; }, /** Checks if an image is in cache @param {string} src The image source path, ex '/path/to/img.jpg' @returns {boolean} */ isCached: function( src ) { return !!this.cache[src]; }, /** Preloads an image into the cache @param {string} src The image source path, ex '/path/to/img.jpg' @returns Galleria.Picture */ preload: function( src ) { $( new Image() ).load((function(src, cache) { return function() { cache[ src ] = src; }; }( src, this.cache ))).attr( 'src', src ); }, /** Loads an image and call the callback when ready. Will also add the image to cache. @param {string} src The image source path, ex '/path/to/img.jpg' @param {Object} [size] The forced size of the image, defined as an object { width: xx, height:xx } @param {Function} callback The function to be executed when the image is loaded & scaled @returns The image container (jQuery object) */ load: function(src, size, callback) { if ( typeof size == 'function' ) { callback = size; size = null; } if( this.isIframe ) { var id = 'if'+new Date().getTime(); this.image = $('<iframe>', { src: src, frameborder: 0, id: id, allowfullscreen: true, css: { visibility: 'hidden' } })[0]; $( this.container ).find( 'iframe,img' ).remove(); this.container.appendChild( this.image ); $('#'+id).load( (function( self, callback ) { return function() { window.setTimeout(function() { $( self.image ).css( 'visibility', 'visible' ); if( typeof callback == 'function' ) { callback.call( self, self ); } }, 10); }; }( this, callback ))); return this.container; } this.image = new Image(); var i = 0, reload = false, resort = false, // some jquery cache $container = $( this.container ), $image = $( this.image ), // the onload method onload = (function( self, callback, src ) { return function() { var complete = function() { $( this ).unbind( 'load' ); // save the original size self.original = size || { height: this.height, width: this.width }; self.container.appendChild( this ); self.cache[ src ] = src; // will override old cache if (typeof callback == 'function' ) { window.setTimeout(function() { callback.call( self, self ); },1); } }; // Delay the callback to "fix" the Adblock Bug // http://code.google.com/p/adblockforchrome/issues/detail?id=3701 if ( ( !this.width || !this.height ) ) { window.setTimeout( (function( img ) { return function() { if ( img.width && img.height ) { complete.call( img ); } else { // last resort, this should never happen but just in case it does... if ( !resort ) { $(new Image()).load( onload ).attr( 'src', img.src ); resort = true; } else { Galleria.raise('Could not extract width/height from image: ' + img.src + '. Traced measures: width:' + img.width + 'px, height: ' + img.height + 'px.'); } } }; }( this )), 2); } else { complete.call( this ); } }; }( this, callback, src )); // remove any previous images $container.find( 'iframe,img' ).remove(); // append the image $image.css( 'display', 'block'); // hide it for now Utils.hide( this.image ); // remove any max/min scaling $.each('minWidth minHeight maxWidth maxHeight'.split(' '), function(i, prop) { $image.css(prop, (/min/.test(prop) ? '0' : 'none')); }); if ( this.cache[ src ] ) { // quick load on cache $image.load( onload ).attr( 'src', src ); return this.container; } // begin load and insert in cache when done $image.load( onload ).error( function() { if ( !reload ) { reload = true; // reload the image with a timestamp window.setTimeout((function(image, src) { return function() { image.attr('src', src + '?' + Utils.timestamp() ); }; }( $(this), src )), 50); } else { // apply the dummy image if it exists if ( DUMMY ) { $( this ).attr( 'src', DUMMY ); } else { Galleria.raise('Image not found: ' + src); } } }).attr( 'src', src ); // return the container return this.container; }, /** Scales and crops the image @param {Object} options The method takes an object with a number of options: <ul> <li>width - width of the container</li> <li>height - height of the container</li> <li>min - minimum scale ratio</li> <li>max - maximum scale ratio</li> <li>margin - distance in pixels from the image border to the container</li> <li>complete - a callback that fires when scaling is complete</li> <li>position - positions the image, works like the css background-image property.</li> <li>crop - defines how to crop. Can be true, false, 'width' or 'height'</li> <li>canvas - set to true to try a canvas-based rescale</li> </ul> @returns The image container object (jQuery) */ scale: function( options ) { var self = this; // extend some defaults options = $.extend({ width: 0, height: 0, min: undef, max: undef, margin: 0, complete: F, position: 'center', crop: false, canvas: false }, options); if( this.isIframe ) { $( this.image ).width( options.width ).height( options.height ).removeAttr( 'width' ).removeAttr( 'height' ); $( this.container ).width( options.width ).height( options.height) ; options.complete.call(self, self); try { if( this.image.contentWindow ) { $( this.image.contentWindow ).trigger('resize'); } } catch(e) {} return this.container; } // return the element if no image found if (!this.image) { return this.container; } // store locale variables var width, height, $container = $( self.container ), data; // wait for the width/height Utils.wait({ until: function() { width = options.width || $container.width() || Utils.parseValue( $container.css('width') ); height = options.height || $container.height() || Utils.parseValue( $container.css('height') ); return width && height; }, success: function() { // calculate some cropping var newWidth = ( width - options.margin * 2 ) / self.original.width, newHeight = ( height - options.margin * 2 ) / self.original.height, min = Math.min( newWidth, newHeight ), max = Math.max( newWidth, newHeight ), cropMap = { 'true' : max, 'width' : newWidth, 'height': newHeight, 'false' : min, 'landscape': self.original.width > self.original.height ? max : min, 'portrait': self.original.width < self.original.height ? max : min }, ratio = cropMap[ options.crop.toString() ], canvasKey = ''; // allow max_scale_ratio if ( options.max ) { ratio = Math.min( options.max, ratio ); } // allow min_scale_ratio if ( options.min ) { ratio = Math.max( options.min, ratio ); } $.each( ['width','height'], function( i, m ) { $( self.image )[ m ]( self[ m ] = self.image[ m ] = Math.round( self.original[ m ] * ratio ) ); }); $( self.container ).width( width ).height( height ); if ( options.canvas && _canvas ) { _canvas.elem.width = self.width; _canvas.elem.height = self.height; canvasKey = self.image.src + ':' + self.width + 'x' + self.height; self.image.src = _canvas.cache[ canvasKey ] || (function( key ) { _canvas.context.drawImage(self.image, 0, 0, self.original.width*ratio, self.original.height*ratio); try { data = _canvas.elem.toDataURL(); _canvas.length += data.length; _canvas.cache[ key ] = data; return data; } catch( e ) { return self.image.src; } }( canvasKey ) ); } // calculate image_position var pos = {}, mix = {}, getPosition = function(value, measure, margin) { var result = 0; if (/\%/.test(value)) { var flt = parseInt( value, 10 ) / 100, m = self.image[ measure ] || $( self.image )[ measure ](); result = Math.ceil( m * -1 * flt + margin * flt ); } else { result = Utils.parseValue( value ); } return result; }, positionMap = { 'top': { top: 0 }, 'left': { left: 0 }, 'right': { left: '100%' }, 'bottom': { top: '100%' } }; $.each( options.position.toLowerCase().split(' '), function( i, value ) { if ( value === 'center' ) { value = '50%'; } pos[i ? 'top' : 'left'] = value; }); $.each( pos, function( i, value ) { if ( positionMap.hasOwnProperty( value ) ) { $.extend( mix, positionMap[ value ] ); } }); pos = pos.top ? $.extend( pos, mix ) : mix; pos = $.extend({ top: '50%', left: '50%' }, pos); // apply position $( self.image ).css({ position : 'absolute', top : getPosition(pos.top, 'height', height), left : getPosition(pos.left, 'width', width) }); // show the image self.show(); // flag ready and call the callback self.ready = true; options.complete.call( self, self ); }, error: function() { Galleria.raise('Could not scale image: '+self.image.src); }, timeout: 1000 }); return this; } }; // our own easings $.extend( $.easing, { galleria: function (_, t, b, c, d) { if ((t/=d/2) < 1) { return c/2*t*t*t + b; } return c/2*((t-=2)*t*t + 2) + b; }, galleriaIn: function (_, t, b, c, d) { return c*(t/=d)*t + b; }, galleriaOut: function (_, t, b, c, d) { return -c *(t/=d)*(t-2) + b; } }); // the plugin initializer $.fn.galleria = function( options ) { var selector = this.selector; // try domReady if element not found if ( !$(this).length ) { $(function() { if ( $( selector ).length ) { // if found on domReady, go ahead $( selector ).galleria( options ); } else { // if not, try fetching the element for 5 secs, then raise a warning. Galleria.utils.wait({ until: function() { return $( selector ).length; }, success: function() { $( selector ).galleria( options ); }, error: function() { Galleria.raise('Init failed: Galleria could not find the element "'+selector+'".'); }, timeout: 5000 }); } }); return this; } return this.each(function() { // fail silent if already run if ( !$.data(this, 'galleria') ) { $.data( this, 'galleria', new Galleria().init( this, options ) ); } }); }; // phew }( jQuery ) );
0x6a
trunk/libraries/galleria/galleria-1.2.7.js
JavaScript
asf20
173,451
/* Galleria Azur Theme 2012-08-08 | http://galleria.io/license/ | (c) Aino */ #galleria-loader{height: 1px} .galleria-container { position: relative; overflow: hidden; font: 12px/1.4 arial,sans-serif; color: #fff; background:#111 url(bg.png); } .galleria-container img { -moz-user-select: none; -webkit-user-select: none; -o-user-select: none; } .galleria-stage { overflow: hidden; position: absolute; top: 0; left: 0; right: 0; bottom: 40px; background:#000 url(bg.png); } .galleria-bar { height: 40px; position: absolute; bottom: 0; left: 0; right: 0; z-index: 3; overflow: hidden; } .galleria-fullscreen, .galleria-play { width: 40px; height: 40px; position: absolute; left: 0; background-position: 50% 50%; background-repeat: no-repeat; cursor: pointer; border-right: 1px solid #333; outline: 1px solid #000; outline-width: 0 1px 0 0; } .galleria-play { background-image: url(playpause-white.png); background-position: 50% 11px; } .galleria-play.pause { background-position: 50% -89px; } .galleria-fullscreen { left: 42px; background-image: url(fscreen.png); background-position: 50% 11px; } .galleria-container.fullscreen .galleria-fullscreen { background-position: 50% -89px; } .galleria-play.playing { background-position: 10px -91px } .galleria-fullscreen.open { background-position: 8px -93px } .galleria-container.notouch .galleria-thumblink:hover, .galleria-container.touch .galleria-thumblink:active, .galleria-thumblink.open, .galleria-container.notouch .galleria-fullscreen:hover, .galleria-container.touch .galleria-fullscreen:active, .galleria-container.notouch .galleria-play:hover, .galleria-container.touch .galleria-play:active, .galleria-container.notouch .galleria-popout:hover, .galleria-container.touch .galleria-popout:active { background-color: #000 } .galleria-thumbnails-container { position: absolute; top: 4px; right: 5px; left: 86px; bottom: 0; z-index: 2; *top: 6px; *right: 6px; } .galleria-thumbnails-list { position: absolute!important; top: 0; right: 0; left: 0; bottom: 0; } .galleria-thumbnails { text-align: right; float: right; } .galleria-carousel .galleria-thumbnails { float: none; } .galleria-thumbnails .galleria-image { width: 27px; height: 27px; display: inline-block; margin: 0 0 0 2px; cursor: pointer; border: 3px double #111; *border: 1px solid #111; opacity: .6; filter: alpha(opacity=60); background: transparent; } .galleria-thumbnails .galleria-image { *display: inline; } .galleria-container.notouch .galleria-thumbnails .galleria-image:hover, .galleria-container.touch .galleria-thumbnails .galleria-image:active { opacity: .9; background: #444; background: rgba(255, 255, 255, .3); filter: alpha(opacity=90); } .galleria-container .galleria-thumbnails .galleria-image.active, .galleria-container.notouch .galleria-thumbnails .galleria-image.active:hover { opacity: 1; background: #ddd; background: rgba(255, 255, 255, .7); *border-color: #ccc; filter: alpha(opacity=100); } body .galleria-tooltip { background: #fff; background: rgba( 255, 255, 255, .8); } .galleria-captionopen { position: absolute; bottom: 10px; right: 10px; background: url(bgie.png); background: rgba(0,0,0,.7); padding: 3px 8px; font-size: 10px; text-transform:uppercase; letter-spacing: 0.5; z-index: 2; cursor:pointer; color: #ccc; } .galleria-captionopen:hover { background: #000; color: #fff; } .galleria-captionclose { background: none; font-size: 18px; position: absolute; top: 0; right: 10px; cursor: pointer; } .galleria-captionclose:hover{ color:#ccc; } .galleria-progress.nocanvas { width: 32px; height: 5px; background: rgba(255,255,255,.2); background: url( 20.png ); position: absolute; top: 10px; right: 10px; z-index: 2; display: none; } .galleria-progress.nocanvas .galleria-progressbar { height: 100%; width: 0; background: white; } .galleria-info { position: absolute; overflow: hidden; left: 0; right: 0; bottom: 0; color: #fff; background: url(bgie.png); background: url(bg.png) rgba(0,0,0,.6); z-index:2; } .galleria-info.toggler { visibility: hidden; } .galleria-info.toggler.open { visibility: visible; } .galleria-info-title { font-size: 14px; font-weight: bold; margin: 10px 14px 10px; padding-right: 100px; } .galleria-info-description { opacity: .8; margin: 10px 14px 10px; padding-right: 60px; font-size:14px; } .galleria-counter { opacity: 0; position: absolute; top: 10px; left: 10px; font-size: 10px; z-index: 2; font-weight: bold; } .galleria-loader { width: 48px; height: 48px; position: absolute; top: 50%; left: 50%; margin: -24px 0 0 -24px; z-index: 2; display: none; } .galleria-loader.nocanvas { width: 48px; height: 48px; position: absolute; top: 50%; left: 50%; margin: -24px 0 0 -24px; z-index: 2; display: none; background: #000 url(loader.gif) no-repeat 50% 50%; opacity: .6; filter: alpha(opacity=60); -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; } .galleria-image-nav { position: absolute; top: 50%; margin-top: -18px; width: 100%; height: 36px; left: 0; } .galleria-image-nav-left, .galleria-image-nav-right { cursor: pointer; width: 36px; height: 36px; position: absolute; left: 20px; z-index: 2; background: url(left.png) 50% 50% no-repeat; opacity: 0; } .galleria-image-nav-right { left: auto; right: 20px; background-image: url(right.png); z-index: 2; } .galleria-container.notouch .galleria-image-nav-left:hover, .galleria-container.touch .galleria-image-nav-left:active { opacity: .7!important } .galleria-container.notouch .galleria-image-nav-right:hover, .galleria-container.touch .galleria-image-nav-right:active { opacity: .7!important } .galleria-thumb-nav-left, .galleria-thumb-nav-right { cursor: pointer; display: none; background: url(thumbleft-white.png) 50% 50%; position: absolute; left: 3px; top: 3px; *top: 1px; *left: 1px; height: 27px; width: 23px; z-index: 3; } .galleria-thumb-nav-right { border-right: none; right: 3px; *right: 1px; left: auto; background: url(thumbright-white.png) 50% 50%; } .galleria-thumbnails-container .disabled { opacity: .2; filter: alpha(opacity=20); cursor: default; } .notouch .galleria-thumb-nav-left:hover, .notouch .galleria-thumb-nav-right:hover { opacity: 1; filter: alpha(opacity=100); background-color: #222; background-color: rgba(255, 255, 255, .07); } .touch .galleria-thumb-nav-left:active, .touch .galleria-thumb-nav-right:active { opacity: 1; filter: alpha(opacity=100); background-color: #111; } .notouch .galleria-thumbnails-container .disabled:hover { opacity: .2; filter: alpha(opacity=20); background-color: transparent; } .galleria-carousel .galleria-thumb-nav-left, .galleria-carousel .galleria-thumb-nav-right { display: block; } .galleria-carousel .galleria-thumbnails-list { right: 28px; left: 28px; }
0x6a
trunk/libraries/galleria/themes/azur/galleria.azur.css
CSS
asf20
7,533
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Galleria Classic Theme</title> <style> /* Demo styles */ html,body{background:#222;margin:0;} body{border-top:4px solid #000;} .content{color:#777;font:12px/1.4 "helvetica neue",arial,sans-serif;width:620px;margin:20px auto;} h1{font-size:12px;font-weight:normal;color:#ddd;margin:0;} p{margin:0 0 20px} a {color:#22BCB9;text-decoration:none;} .cred{margin-top:20px;font-size:11px;} /* This rule is read by Galleria to define the gallery height: */ #galleria{height:320px} </style> <!-- load jQuery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> <!-- load Galleria --> <script src="../../galleria-1.2.7.min.js"></script> </head> <body> <div class="content"> <h1>Galleria Classic Theme</h1> <p>Demonstrating a basic gallery example.</p> <!-- Adding gallery images. We use resized thumbnails here for better performance, but it’s not necessary --> <div id="galleria"> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Locomotives-Roundhouse2.jpg/800px-Locomotives-Roundhouse2.jpg"> <img data-title="Locomotives Roundhouse" data-description="Steam locomotives of the Chicago &amp; North Western Railway." src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Locomotives-Roundhouse2.jpg/100px-Locomotives-Roundhouse2.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Icebergs_in_the_High_Arctic_-_20050907.jpg/1000px-Icebergs_in_the_High_Arctic_-_20050907.jpg"> <img data-title="Icebergs in the High Arctic" data-description="”The debris loading isn't particularly extensive, but the color is usual.”" src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Icebergs_in_the_High_Arctic_-_20050907.jpg/100px-Icebergs_in_the_High_Arctic_-_20050907.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg/1000px-Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg"> <img data-title="Araña" data-description="Xysticus cristatus, A Estrada, Galicia, Spain" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg/100px-Ara%C3%B1a._A_Estrada%2C_Galiza._02.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg/1000px-9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg"> <img data-title="Museo storia naturale" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg/100px-9104_-_Milano_-_Museo_storia_naturale_-_Fluorite_-_Foto_Giovanni_Dall%27Orto_22-Apr-2007.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg/1000px-Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg"> <img data-title="Grjótagjá caves in summer 2009" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg/100px-Grj%C3%B3tagj%C3%A1_caves_in_summer_2009_%282%29.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg/1000px-20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg"> <img data-title="Thermes" data-description="Xanthi hot-spa springs, Xanthi Prefecture, Greece" src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg/100px-20091128_Loutra_Thermes_Xanthi_Thrace_Greece_2.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Polish_Army_Ko%C5%82obrzeg_077.JPG/1024px-Polish_Army_Ko%C5%82obrzeg_077.JPG"> <img data-title="Polish Army Kołobrzeg" data-description="A display of the Polish Army. Both the soldier, and the vehicle belong to the 7th Pomeranian Coastal Defence Brigade, a part of the Szczecin-based 12th Mechanized Division ”Bolesław Krzywousty”" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Polish_Army_Ko%C5%82obrzeg_077.JPG/100px-Polish_Army_Ko%C5%82obrzeg_077.JPG"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/20100213_Zlatograd_Bulgaria_3.jpg/1024px-20100213_Zlatograd_Bulgaria_3.jpg"> <img data-title="Zlatograd Bulgaria" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/20100213_Zlatograd_Bulgaria_3.jpg/100px-20100213_Zlatograd_Bulgaria_3.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg/1024px-FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg"> <img data-title="09-28-2001 in New York City" data-description="New York, NY, September 28, 2001 -- Debris on surrounding roofs at the site of the World Trade Center. Photo by Andrea Booher/ FEMA News Photo" src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg/100px-FEMA_-_5399_-_Photograph_by_Andrea_Booher_taken_on_09-28-2001_in_New_York.jpg"> </a> <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Antennae%2C_Hubble_images.jpg/1024px-Antennae%2C_Hubble_images.jpg"> <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Antennae%2C_Hubble_images.jpg/100px-Antennae%2C_Hubble_images.jpg"> </a> </div> <p class="cred">Made by <a href="http://galleria.aino.se">Galleria</a>.</p> </div> <script> // Load the classic theme Galleria.loadTheme('galleria.classic.min.js'); // Initialize Galleria Galleria.run('#galleria'); </script> </body> </html>
0x6a
trunk/libraries/galleria/themes/classic/classic-demo.html
HTML
asf20
5,969
/* * Galleria Classic Theme * Copyright (c) 2010, Aino * Licensed under the MIT license. */ .galleria-container { position: relative; overflow: hidden; background: #000; } .galleria-container img { -moz-user-select: none; -webkit-user-select: none; -o-user-select: none; } .galleria-stage { position: absolute; top: 10px; bottom: 60px; left: 10px; right: 10px; overflow:hidden; } .galleria-thumbnails-container { height: 50px; bottom: 0; position: absolute; left: 10px; right: 10px; z-index: 2; } .galleria-carousel .galleria-thumbnails-list { margin-left: 30px; margin-right: 30px; } .galleria-thumbnails .galleria-image { height: 40px; width: 60px; background: #000; margin: 0 5px 0 0; border: 1px solid #000; float: left; cursor: pointer; } .galleria-counter { position: absolute; bottom: 10px; left: 10px; text-align: right; color: #fff; font: normal 11px/1 arial,sans-serif; z-index: 1; } .galleria-loader { background: #000; width: 20px; height: 20px; position: absolute; top: 10px; right: 10px; z-index: 2; display: none; background: url(classic-loader.gif) no-repeat 2px 2px; } .galleria-info { width: 50%; top: 15px; left: 15px; z-index: 2; position: absolute; } .galleria-info-text { background-color: #000; padding: 12px; display: none; /* IE7 */ zoom:1; } .galleria-info-title { font: bold 12px/1.1 arial,sans-serif; margin: 0; color: #fff; margin-bottom: 7px; } .galleria-info-description { font: italic 12px/1.4 georgia,serif; margin: 0; color: #bbb; } .galleria-info-close { width: 9px; height: 9px; position: absolute; top: 5px; right: 5px; background-position: -753px -11px; opacity: .5; filter: alpha(opacity=50); cursor: pointer; display: none; } .notouch .galleria-info-close:hover{ opacity:1; filter: alpha(opacity=100); } .touch .galleria-info-close:active{ opacity:1; filter: alpha(opacity=100); } .galleria-info-link { background-position: -669px -5px; opacity: .7; filter: alpha(opacity=70); position: absolute; width: 20px; height: 20px; cursor: pointer; background-color: #000; } .notouch .galleria-info-link:hover { opacity: 1; filter: alpha(opacity=100); } .touch .galleria-info-link:active { opacity: 1; filter: alpha(opacity=100); } .galleria-image-nav { position: absolute; top: 50%; margin-top: -62px; width: 100%; height: 62px; left: 0; } .galleria-image-nav-left, .galleria-image-nav-right { opacity: .3; filter: alpha(opacity=30); cursor: pointer; width: 62px; height: 124px; position: absolute; left: 10px; z-index: 2; background-position: 0 46px; } .galleria-image-nav-right { left: auto; right: 10px; background-position: -254px 46px; z-index: 2; } .notouch .galleria-image-nav-left:hover, .notouch .galleria-image-nav-right:hover { opacity: 1; filter: alpha(opacity=100); } .touch .galleria-image-nav-left:active, .touch .galleria-image-nav-right:active { opacity: 1; filter: alpha(opacity=100); } .galleria-thumb-nav-left, .galleria-thumb-nav-right { cursor: pointer; display: none; background-position: -495px 5px; position: absolute; left: 0; top: 0; height: 40px; width: 23px; z-index: 3; opacity: .8; filter: alpha(opacity=80); } .galleria-thumb-nav-right { background-position: -578px 5px; border-right: none; right: 0; left: auto; } .galleria-thumbnails-container .disabled { opacity: .2; filter: alpha(opacity=20); cursor: default; } .notouch .galleria-thumb-nav-left:hover, .notouch .galleria-thumb-nav-right:hover { opacity: 1; filter: alpha(opacity=100); background-color: #111; } .touch .galleria-thumb-nav-left:active, .touch .galleria-thumb-nav-right:active { opacity: 1; filter: alpha(opacity=100); background-color: #111; } .notouch .galleria-thumbnails-container .disabled:hover { opacity: .2; filter: alpha(opacity=20); background-color: transparent; } .galleria-carousel .galleria-thumb-nav-left, .galleria-carousel .galleria-thumb-nav-right { display: block; } .galleria-thumb-nav-left, .galleria-thumb-nav-right, .galleria-info-link, .galleria-info-close, .galleria-image-nav-left, .galleria-image-nav-right { background-image: url(classic-map.png); background-repeat: no-repeat; }
0x6a
trunk/libraries/galleria/themes/classic/galleria.classic.css
CSS
asf20
4,601
/** * Galleria Classic Theme 2012-04-04 * http://galleria.io * * Licensed under the MIT license * https://raw.github.com/aino/galleria/master/LICENSE * */ (function($) { /*global jQuery, Galleria */ Galleria.addTheme({ name: 'classic', author: 'Galleria', css: 'galleria.classic.css', defaults: { transition: 'slide', thumbCrop: 'height', // set this to false if you want to show the caption all the time: _toggleInfo: true }, init: function(options) { Galleria.requires(1.25, 'This version of Classic theme requires Galleria 1.2.5 or later'); // add some elements this.addElement('info-link','info-close'); this.append({ 'info' : ['info-link','info-close'] }); // cache some stuff var info = this.$('info-link,info-close,info-text'), touch = Galleria.TOUCH, click = touch ? 'touchstart' : 'click'; // show loader & counter with opacity this.$('loader,counter').show().css('opacity', 0.4); // some stuff for non-touch browsers if (! touch ) { this.addIdleState( this.get('image-nav-left'), { left:-50 }); this.addIdleState( this.get('image-nav-right'), { right:-50 }); this.addIdleState( this.get('counter'), { opacity:0 }); } // toggle info if ( options._toggleInfo === true ) { info.bind( click, function() { info.toggle(); }); } else { info.show(); this.$('info-link, info-close').hide(); } // bind some stuff this.bind('thumbnail', function(e) { if (! touch ) { // fade thumbnails $(e.thumbTarget).css('opacity', 0.6).parent().hover(function() { $(this).not('.active').children().stop().fadeTo(100, 1); }, function() { $(this).not('.active').children().stop().fadeTo(400, 0.6); }); if ( e.index === this.getIndex() ) { $(e.thumbTarget).css('opacity',1); } } else { $(e.thumbTarget).css('opacity', this.getIndex() ? 1 : 0.6); } }); this.bind('loadstart', function(e) { if (!e.cached) { this.$('loader').show().fadeTo(200, 0.4); } this.$('info').toggle( this.hasInfo() ); $(e.thumbTarget).css('opacity',1).parent().siblings().children().css('opacity', 0.6); }); this.bind('loadfinish', function(e) { this.$('loader').fadeOut(200); }); } }); }(jQuery));
0x6a
trunk/libraries/galleria/themes/classic/galleria.classic.js
JavaScript
asf20
2,745