Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | global $wgOut; |
61 | 61 | $result = ""; |
62 | 62 | $spectitle = $this->getTitle(); |
| 63 | + $formatBox = $this->getFormatSelectBoxSep( 'broadtable' ); |
63 | 64 | $result .= '<form name="ask" action="' . $spectitle->escapeLocalURL() . '" method="get">' . "\n" . |
64 | 65 | '<input type="hidden" name="title" value="' . $spectitle->getPrefixedText() . '"/>'; |
65 | 66 | $result .= '<br>'; |
— | — | @@ -66,6 +67,8 @@ |
67 | 68 | // Main query and printouts. |
68 | 69 | $result .= '<p><strong>' . wfMsg( 'smw_ask_queryhead' ) . "</strong></p>\n"; |
69 | 70 | $result .= '<p>' . $this->getQueryFormBox() . '</p>'; |
| 71 | + //format select |
| 72 | + $result .= $formatBox[0]; |
70 | 73 | // sorting and prinouts |
71 | 74 | $result .= $this->getPoSortFormBox(); |
72 | 75 | // show|hide additional options and querying help |
— | — | @@ -83,7 +86,7 @@ |
84 | 87 | // additional options |
85 | 88 | $result .= '<div id="additional_options" style="display:none">'; |
86 | 89 | |
87 | | - $result .= $this->getFormatSelectBox( 'broadtable' ); |
| 90 | + $result .= $formatBox[1]; //display the format options |
88 | 91 | |
89 | 92 | if ( $this->uiCore->getQueryString() != '' ) // hide #ask if there isnt any query defined |
90 | 93 | $result .= $this->getAskEmbedBox(); |
— | — | @@ -111,7 +114,9 @@ |
112 | 115 | |
113 | 116 | if ( !$smwgQSortingSupport ) return ''; |
114 | 117 | $this->enableJQueryUI(); |
115 | | - $wgOut->addScriptFile( "$smwgScriptPath/libs/jquery-ui/jquery-ui.min.dialog.js" ); |
| 118 | + $wgOut->addScriptFile( "$smwgScriptPath/libs/jquery-ui/jquery-ui.dialog.min.js" ); |
| 119 | + $wgOut->addScriptFile( "$smwgScriptPath/libs/jquery-ui/jquery-ui.tabs.min.js" ); |
| 120 | + $wgOut->addStyle( "$smwgScriptPath/skins/SMW_custom.css" ); |
116 | 121 | |
117 | 122 | $result = ''; |
118 | 123 | $num_sort_values = 0; |
— | — | @@ -172,49 +177,72 @@ |
173 | 178 | } |
174 | 179 | $num_sort_values = count( $property_values ); |
175 | 180 | foreach ( $property_values as $i => $property_value ) { |
176 | | - $result .= Html::openElement( 'div', array( 'id' => "sort_div_$i" ) ) . wfMsg( 'smw_qui_property' ); |
| 181 | + |
| 182 | + $result .= Html::openElement( 'div', array( 'id' => "sort_div_$i" ) ); |
| 183 | + $result .= '<span class="smw-remove"> <a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"> </a></span>'; |
| 184 | + $result .= wfMsg( 'smw_qui_property' ); |
177 | 185 | $result .= Html::input( 'property[' . $i . ']', $property_value, 'text', array( 'size' => '35' ) ) . "\n"; |
178 | | - $result .= html::openElement( 'select', array( 'name' => "order[$i]" ) ); |
179 | | - if ( !is_array( $order_values ) or !array_key_exists( $i, $order_values ) or $order_values[$i] == 'NONE' ) { |
180 | | - $result .= '<option selected value="NONE">' . wfMsg( 'smw_qui_nosort' ) . "</option>\n"; |
181 | | - } else { |
182 | | - $result .= '<option value="NONE">' . wfMsg( 'smw_qui_nosort' ) . "</option>\n"; |
183 | | - } |
184 | | - if ( is_array( $order_values ) and array_key_exists( $i, $order_values ) and $order_values[$i] == 'ASC' ) { |
185 | | - $result .= '<option selected value="ASC">' . wfMsg( 'smw_qui_ascorder' ) . "</option>\n"; |
186 | | - } else { |
187 | | - $result .= '<option value="ASC">' . wfMsg( 'smw_qui_ascorder' ) . "</option>\n"; |
188 | | - } |
189 | | - if ( is_array( $order_values ) and array_key_exists( $i, $order_values ) and $order_values[$i] == 'DESC' ) { |
190 | | - $result .= '<option selected value="DESC">' . wfMsg( 'smw_qui_descorder' ) . "</option>\n"; |
191 | | - } else { |
192 | | - $result .= '<option value="DESC">' . wfMsg( 'smw_qui_descorder' ) . "</option>\n"; |
193 | | - } |
194 | | - $result .= "</select> \n"; |
195 | | - if ( is_array( $display_values ) and array_key_exists( $i, $display_values ) ) { |
196 | | - $result .= '<input type="checkbox" checked name="display[' . $i . ']" value="yes">' . wfMsg( 'smw_qui_shownresults' ) . "\n"; |
197 | | - } else { |
198 | | - $result .= '<input type="checkbox" name="display[' . $i . ']" value="yes">' . wfMsg( 'smw_qui_shownresults' ) . "\n"; |
199 | | - } |
200 | | - $result .= '[<a href="javascript:removePOInstance(\'sort_div_' . $i . '\')">' . wfMsg( 'smw_qui_delete' ) . '</a>]' . "\n"; |
201 | | - $result .= "</div> \n"; |
| 186 | + $result .= Html::openElement( 'select', array( 'name' => "order[$i]" ) ); |
| 187 | + |
| 188 | + $if1 = ( !is_array( $order_values ) or !array_key_exists( $i, $order_values ) or $order_values[$i] == 'NONE' ); |
| 189 | + $result .= Xml::option(wfMsg( 'smw_qui_nosort' ), "NONE", $if1); |
| 190 | + |
| 191 | + $if2 = ( is_array( $order_values ) and array_key_exists( $i, $order_values ) and $order_values[$i] == 'ASC' ); |
| 192 | + $result .= Xml::option(wfMsg( 'smw_qui_ascorder' ), "ASC", $if2); |
| 193 | + |
| 194 | + $if3 = ( is_array( $order_values ) and array_key_exists( $i, $order_values ) and $order_values[$i] == 'DESC' ); |
| 195 | + $result .= Xml::option(wfMsg( 'smw_qui_descorder' ), "DESC", $if3); |
| 196 | + |
| 197 | + $result .= Xml::closeElement('select'); |
| 198 | + |
| 199 | + $if4 = ( is_array( $display_values ) and array_key_exists( $i, $display_values ) ); |
| 200 | + $result .=Xml::checkLabel(wfMsg( 'smw_qui_shownresults' ), "display[$i]", "display$i", $if4 ); |
| 201 | + |
| 202 | + $result .= Xml::closeElement('div'); |
202 | 203 | } |
203 | 204 | // END: create form elements already submitted earlier via form |
204 | 205 | |
205 | 206 | // create hidden form elements to be cloned later |
206 | | - $hidden = '<div id="sorting_starter" style="display: none">' . wfMsg( 'smw_qui_property' ) . |
207 | | - ' <input type="text" size="35" name="property_num" />'; |
208 | | - $hidden .= ' <select name="order_num">'; |
209 | | - $hidden .= ' <option value="NONE">' . wfMsg( 'smw_qui_nosort' ) . '</option>'; |
210 | | - $hidden .= ' <option value="ASC">' . wfMsg( 'smw_qui_ascorder' ) . '</option>'; |
211 | | - $hidden .= ' <option value="DESC">' . wfMsg( 'smw_qui_descorder' ) . '</option></select>'; |
212 | | - $hidden .= '<input type="checkbox" checked name="display_num" value="yes">' . wfMsg( 'smw_qui_shownresults' ); |
213 | | - $hidden .= '</div>'; |
| 207 | + $hidden = Html::openElement( 'div', array( 'id' => 'sorting_starter', 'style' => 'display:none' ) ) . |
| 208 | + '<span class="smw-remove"><a> </a></span>'. |
| 209 | + wfMsg( 'smw_qui_property' ) . |
| 210 | + Xml::input( "property_num", '35' ) . " "; |
214 | 211 | |
215 | | - $dialogbox = '<div id="dialog"><form>' . |
216 | | - '<input type="checkbox" checked id="dialog-show-results" >' . wfMsg( 'smw_qui_shownresults' ) . '<fieldset id="show-result-box">' . |
217 | | - '<br>Label:<input id="sort-label"><br> still under construction </fieldset>' . //TODO; remove |
218 | | - '<br><select id ="dialog-order">' . |
| 212 | + $hidden .= Html::openElement( 'select', array( 'name' => 'order_num' ) ); |
| 213 | + $hidden .= Xml::option( wfMsg( 'smw_qui_nosort' ), 'NONE' ); |
| 214 | + $hidden .= Xml::option( wfMsg( 'smw_qui_ascorder' ), 'ASC' ); |
| 215 | + $hidden .= Xml::option( wfMsg( 'smw_qui_descorder' ), 'DESC' ); |
| 216 | + $hidden .= Xml::closeElement( 'select' ); |
| 217 | + |
| 218 | + $hidden .= Xml::checkLabel( wfMsg( 'smw_qui_shownresults' ), "display_num", '', true ); |
| 219 | + $hidden .= Xml::closeElement( 'div' ); |
| 220 | + |
| 221 | + $hidden = json_encode( $hidden ); |
| 222 | + |
| 223 | + $dialogbox = Xml::openElement('div', array('id'=>'dialog')) . |
| 224 | + Xml::checkLabel(wfMsg( 'smw_qui_shownresults' ), '', 'dialog-show-results', true). |
| 225 | + '<div id="tab-box">'. |
| 226 | + '<ul>'. |
| 227 | + '<li><a href="#property-tab">Property</a></li>'. //todo i18n |
| 228 | + '<li><a href="#category-tab">Category</a></li>'. //todo i18n |
| 229 | + '</ul>'. |
| 230 | + '<div id="property-tab">'. |
| 231 | + Xml::inputLabel('Property', '','tab-property', 'tab-property'). '<br/>'. //todo i18n |
| 232 | + Xml::inputLabel('Label (optional):', '','tab-property-label', 'tab-property-label'). '<br/>'. //todo i18n |
| 233 | + 'Format: '. Html::openElement('select', array('name'=>'tab-format')) . //todo i18n |
| 234 | + Xml::option('None (default)', 'NONE'). //todo i18n |
| 235 | + Xml::option('Simple', '-'). //todo i18n |
| 236 | + Xml::option('Numeric', 'n'). //todo i18n |
| 237 | + Xml::option('Unit', 'u'). //todo i18n |
| 238 | + Xml::option('Custom', 'CUSTOM'). //todo i18n |
| 239 | + Xml::closeElement('select'). |
| 240 | + Xml::input('format-custom'). |
| 241 | + '</div>'. |
| 242 | + '<div id="category-tab">'. |
| 243 | + 'category options go here'. |
| 244 | + '</div>'. |
| 245 | + '</div>'. |
| 246 | + '<br>Sort by: <select id ="dialog-order">' . //todo i18n |
219 | 247 | '<option value="NONE">' . wfMsg( 'smw_qui_nosort' ) . '</option>' . |
220 | 248 | '<option value="ASC">' . wfMsg( 'smw_qui_ascorder' ) . '</option>' . |
221 | 249 | '<option value="DESC">' . wfMsg( 'smw_qui_descorder' ) . '</option>' . |
— | — | @@ -224,8 +252,6 @@ |
225 | 253 | $result .= '[<a href="javascript:addPOInstance(\'sorting_starter\', \'sorting_main\')">' . wfMsg( 'smw_qui_addnprop' ) . '</a>]' . "\n"; |
226 | 254 | |
227 | 255 | // Javascript code for handling adding and removing the "sort" inputs |
228 | | - $delete_msg = wfMsg( 'smw_qui_delete' ); |
229 | | - |
230 | 256 | if ( $enableAutocomplete == SMWQueryUI::ENABLE_AUTO_SUGGEST ) { |
231 | 257 | $this->addAutocompletionJavascriptAndCSS(); |
232 | 258 | } |
— | — | @@ -238,17 +264,22 @@ |
239 | 265 | jQuery('$dialogbox').appendTo(document.body); |
240 | 266 | jQuery('#dialog').dialog({ |
241 | 267 | autoOpen: false, |
242 | | - modal: true |
| 268 | + modal: true, |
| 269 | + resizable: true, |
| 270 | + minHeight: 500, |
| 271 | + minWidth: 500 |
243 | 272 | }); |
| 273 | + jQuery('#tab-box').tabs({ |
| 274 | + selected:1 |
| 275 | + }); |
244 | 276 | }); |
245 | 277 | jQuery(document).ready(function(){ |
246 | 278 | jQuery('#sort-more').click(function(){jQuery('#dialog').dialog("open");}); |
247 | 279 | jQuery('#dialog-show-results').click(function(){ |
248 | 280 | if(jQuery('#dialog-show-results')[0].checked){ |
249 | | - //alert("hello"); |
250 | | - jQuery('#show-result-box').show('blind'); |
| 281 | + jQuery('#tab-box').show('blind'); |
251 | 282 | } else { |
252 | | - jQuery('#show-result-box').hide('blind'); |
| 283 | + jQuery('#tab-box').hide('blind'); |
253 | 284 | } |
254 | 285 | }); |
255 | 286 | }); |
— | — | @@ -283,13 +314,13 @@ |
284 | 315 | var more_button =document.createElement('span'); |
285 | 316 | more_button.innerHTML = ' <a class="smwq-more" href="javascript:smw_makeDialog(\'' + num_elements + '\')">more</a> '; //TODO: i18n |
286 | 317 | new_div.appendChild(more_button); |
287 | | - //Create 'delete' link |
288 | | - var remove_button = document.createElement('span'); |
289 | | - remove_button.innerHTML = '[<a class="smwq-remove" href="javascript:removePOInstance(\'sort_div_' + num_elements + '\')">{$delete_msg}</a>]'; |
290 | | - new_div.appendChild(remove_button); |
291 | 318 | |
292 | 319 | //Add the new instance |
293 | 320 | main_div.appendChild(new_div); |
| 321 | + |
| 322 | + // initialize delete button |
| 323 | + st='sort_div_'+num_elements; |
| 324 | + jQuery('#'+new_div.id).find(".smw-remove a")[0].href="javascript:removePOInstance('"+st+"')"; |
294 | 325 | EOT; |
295 | 326 | if ( $enableAutocomplete == SMWQueryUI::ENABLE_AUTO_SUGGEST ) { |
296 | 327 | $javascript_text .= <<<EOT |
Index: trunk/extensions/SemanticMediaWiki/skins/SMW_custom.css |
— | — | @@ -130,6 +130,14 @@ |
131 | 131 | font-size: 90%; |
132 | 132 | } |
133 | 133 | |
| 134 | +/* ui buttons for QueryUI */ |
| 135 | +span.smw-remove a{ |
| 136 | + background: url(images/close-button.png) center no-repeat; |
| 137 | + height: 16px; |
| 138 | + width: 16px; |
| 139 | + text-decoration: none; |
| 140 | +} |
| 141 | + |
134 | 142 | /* search, browse, RDF icons */ |
135 | 143 | |
136 | 144 | span.smwsearchicon { /*FIXME: this was only used for Factbox docu, should be removed from code*/ |
Index: trunk/extensions/SemanticMediaWiki/libs/jquery-ui/jquery-ui.tabs.min.js |
— | — | @@ -0,0 +1,36 @@ |
| 2 | +/* |
| 3 | + * jQuery UI Tabs 1.8.14 |
| 4 | + * |
| 5 | + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| 6 | + * Dual licensed under the MIT or GPL Version 2 licenses. |
| 7 | + * http://jquery.org/license |
| 8 | + * |
| 9 | + * http://docs.jquery.com/UI/Tabs |
| 10 | + * |
| 11 | + * Depends: |
| 12 | + * jquery.ui.core.js |
| 13 | + * jquery.ui.widget.js |
| 14 | + */ |
| 15 | +(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& |
| 16 | +e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= |
| 17 | +d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| |
| 18 | +(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); |
| 19 | +this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= |
| 20 | +this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); |
| 21 | +if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); |
| 22 | +this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ |
| 23 | +g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", |
| 24 | +function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; |
| 25 | +this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= |
| 26 | +-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; |
| 27 | +d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= |
| 28 | +d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, |
| 29 | +e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); |
| 30 | +j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); |
| 31 | +if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),function(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, |
| 32 | +this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, |
| 33 | +load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, |
| 34 | +"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, |
| 35 | +url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.14"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&& |
| 36 | +a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery); |
| 37 | +; |
Property changes on: trunk/extensions/SemanticMediaWiki/libs/jquery-ui/jquery-ui.tabs.min.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 38 | + native |
Index: trunk/extensions/SemanticMediaWiki/libs/jquery-ui/jquery-ui.dialog.min.js |
— | — | @@ -0,0 +1,41 @@ |
| 2 | +/* |
| 3 | + * jQuery UI Dialog 1.8.14 |
| 4 | + * |
| 5 | + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) |
| 6 | + * Dual licensed under the MIT or GPL Version 2 licenses. |
| 7 | + * http://jquery.org/license |
| 8 | + * |
| 9 | + * http://docs.jquery.com/UI/Dialog |
| 10 | + * |
| 11 | + * Depends: |
| 12 | + * jquery.ui.core.js |
| 13 | + * jquery.ui.widget.js |
| 14 | + * jquery.ui.button.js |
| 15 | + * jquery.ui.draggable.js |
| 16 | + * jquery.ui.mouse.js |
| 17 | + * jquery.ui.position.js |
| 18 | + * jquery.ui.resizable.js |
| 19 | + */ |
| 20 | +(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, |
| 21 | +position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ |
| 22 | +b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), |
| 23 | +h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id", |
| 24 | +e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); |
| 25 | +a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== |
| 26 | +b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+= |
| 27 | +1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== |
| 28 | +f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a, |
| 29 | +function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('<button type="button"></button>').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", |
| 30 | +handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition, |
| 31 | +originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize", |
| 32 | +f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "): |
| 33 | +[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f); |
| 34 | +if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): |
| 35 | +e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a= |
| 36 | +this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height- |
| 37 | +b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.14",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), |
| 38 | +create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(), |
| 39 | +height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); |
| 40 | +b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,function(){a= |
| 41 | +a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery); |
| 42 | +; |
Property changes on: trunk/extensions/SemanticMediaWiki/libs/jquery-ui/jquery-ui.dialog.min.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 43 | + native |