Changeset 3040 for trunk


Ignore:
Timestamp:
06/02/10 13:38:43 (10 years ago)
Author:
jukka
Message:

Ajaxified sorting of collections. Similar solution should work for reordering content chapters.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Collection.py

    r3026 r3040  
    211211        self._renameAfterCreation() 
    212212 
     213 
     214    security.declarePrivate('_processForm') 
     215    def _processForm(self, data=1, metadata=None, REQUEST=None, values=None): 
     216        request = REQUEST or self.REQUEST 
     217        if values: 
     218            form = values 
     219        else: 
     220            form = request.form 
     221        # Instead of using schema fields, we call them manually 
     222        # (because there are only two)       
     223        title_field=self.getField('title') 
     224        title, other = title_field.widget.process_form(self, title_field, form,validating=False) 
     225        self.setTitle(title) 
     226        desc_field=self.getField('description') 
     227        desc, other = desc_field.widget.process_form(self, desc_field, form,validating=False) 
     228        self.setDescription(desc) 
     229        # Delete & reorder items 
     230        for (reftype,ordered_by) in [('relatedContent','order_'), ('relatedMethods',''), ('relatedTools',''),('relatedCollections','col_order_')]: 
     231            sorted=self.getSortedList(reftype) 
     232            if ordered_by: 
     233                new_list=[] 
     234                for index, item in enumerate(sorted): 
     235                    order=form.get(ordered_by+str(index), 100) 
     236                    new_list.append((order, item)) 
     237                new_list.sort() 
     238                new_list=[item.targetUID for (order, item) in new_list] 
     239                self._setOrderedReferences(new_list, reftype) 
     240            # check if deleted 
     241            for item in sorted: 
     242                delete_flag=int(form.get('%s_deleted' % item.targetUID, 0)) 
     243                if delete_flag: 
     244                    self._delete(item.targetUID, reftype) 
     245        self.reindexObject() 
     246 
     247    security.declarePrivate('_delete') 
     248    def _delete(self, uid, reftype): 
     249        field=self.getField(reftype) 
     250        newlist = [u for u in field.getRaw(self) if u!=uid] 
     251        field.set(self, newlist) 
     252        ltool=getToolByName(self, 'lemill_tool') 
     253        obj=ltool.getObjectByUID(uid) 
     254        if obj: 
     255            obj.recalculateScore() 
     256            obj.reindexObject() 
     257 
    213258    def setPermissions(self): 
    214259        # Setting View permission 
     
    355400    def getContent(self): 
    356401        """ make sure that related content comes in correct order even when programmer forgets to ask for it""" 
    357         return self.getResources() 
     402        return self.getResources('relatedContent') 
    358403 
    359404    def getMethods(self): 
     
    428473        return resource in objects 
    429474 
    430     security.declareProtected(MODIFY_CONTENT, 'delete') 
    431     def delete(self, obj, REQUEST=None): 
    432         """ delete object from collection """ 
    433         if type(obj)==str: 
    434             uid_catalog=getToolByName(self, 'uid_catalog') 
    435             obj=uid_catalog(UID=obj) 
    436             if obj: 
    437                 obj=obj[0].getObject() 
    438             elif REQUEST: 
    439                 return REQUEST.RESPONSE.redirect(self.absolute_url() + "/edit") 
    440             else: 
    441                 return None              
    442         reftype=self.getReferenceType(obj) 
    443         field = self.Schema().get(reftype) 
    444         objlist = field.get(self) 
    445  
    446         newlist = [o.UID() for o in objlist if o.id!=obj.id] 
    447         field.set(self, newlist) 
    448         self.updateStory() 
    449         # Recalculate score for deleted resource and Reindex it 
    450         for x in objlist: 
    451             if x.id == obj.id: 
    452                 x.recalculateScore() 
    453                 x.reindexObject() 
    454         if REQUEST: 
    455             return REQUEST.RESPONSE.redirect(self.absolute_url() + "/edit") 
     475 
    456476     
    457477    def getCollectionContent(self): 
     
    470490            ref.collection_position=i 
    471491             
    472  
    473     security.declareProtected(MODIFY_CONTENT,'moveUpContent') 
    474     def moveUpContent(self, objid,REQUEST=None): 
    475         """ Front for more general moveUpResources """ 
    476         if objid: 
    477             self.moveUpResources(objid, reftype='relatedContent') 
    478         return REQUEST.RESPONSE.redirect(self.absolute_url() + "/edit") 
    479  
    480     security.declareProtected(MODIFY_CONTENT,'moveUpCollection') 
    481     def moveUpCollection(self, objid,REQUEST=None): 
    482         """ Front for more general moveUpResources """ 
    483         if objid: 
    484             self.moveUpResources(objid, reftype='relatedCollections') 
    485         return REQUEST.RESPONSE.redirect(self.absolute_url() + "/edit") 
    486  
    487     security.declareProtected(MODIFY_CONTENT,'moveUpResources') 
    488     def moveUpResources(self, objid, reftype='relatedContent'): 
    489         """ move up """ 
    490         field = self.getField(reftype) 
    491         sorted = self.getSortedList(reftype) 
    492         found=0 
    493         for i, ref in enumerate(sorted): 
    494             if ref.targetId() == objid: 
    495                 found = i 
    496                 break 
    497         if found: 
    498             swap=sorted[found-1] 
    499             sorted[found-1]=sorted[found] 
    500             sorted[found]=swap 
    501             new_list=[ref.targetUID for ref in sorted] 
    502             self._setOrderedReferences(new_list, reftype) 
    503  
    504  
    505     security.declareProtected(MODIFY_CONTENT,'moveDownContent') 
    506     def moveDownContent(self, objid,REQUEST=None): 
    507         """ Front for more general moveDownResources """ 
    508         if objid: 
    509             self.moveDownResources(objid, reftype='relatedContent') 
    510         return REQUEST.RESPONSE.redirect(self.absolute_url() + "/edit") 
    511  
    512     security.declareProtected(MODIFY_CONTENT,'moveDownCollection') 
    513     def moveDownCollection(self, objid,REQUEST=None): 
    514         """ Front for more general moveDownResources """ 
    515         if objid: 
    516             self.moveDownResources(objid, reftype='relatedCollections') 
    517         return REQUEST.RESPONSE.redirect(self.absolute_url() + "/edit") 
    518  
    519     security.declareProtected(MODIFY_CONTENT,'moveDownResources') 
    520     def moveDownResources(self, objid, reftype='relatedContent'): 
    521         """ move down """ 
    522         field = self.getField(reftype) 
    523         sorted = self.getSortedList(reftype) 
    524         found=10000 
    525         for i, ref in enumerate(sorted): 
    526             if ref.targetId() == objid: 
    527                 found = i 
    528                 break 
    529         if len(sorted)>found+1: 
    530             swap=sorted[found+1] 
    531             sorted[found+1]=sorted[found] 
    532             sorted[found]=swap 
    533             new_list=[ref.targetUID for ref in sorted] 
    534             self._setOrderedReferences(new_list, reftype) 
    535  
    536492    def getLearningStoryText(self): 
    537493        """ will return the nice version for the story text """ 
  • trunk/skins/lemill/collection_edit.cpt

    r2923 r3040  
    2525            <tal:content tal:define="resources python:here.getResources(reftype='relatedContent');" tal:condition="resources"> 
    2626            <h2 i18n:translate="label_content">Content</h2> 
    27             <table width="100%" border="0" cellpadding="4" cellspacing="0"> 
    28                 <tr tal:repeat="obj resources"> 
    29                    <tal:defines define="start repeat/obj/start; 
    30                                        end repeat/obj/end; 
    31                                        deleted obj/isDeleted"> 
     27            <table border="0" cellpadding="4" cellspacing="0" class="sortable" width="80%"> 
     28                <tr tal:repeat="obj resources" class="choice_row"> 
     29                   <tal:defines define="index repeat/obj/index; deleted obj/isDeleted"> 
     30                    <td valign="top" style="border-right: 1px solid #8cacbb" width="20"><img src="images/sorthandle.png" width="20" height="20" valign="top" class="handle"> 
     31                    <input type="hidden" class="orderkeeper" value="0" name="order_0" id="order_0" tal:attributes="value index;name python:'order_%s' % index"></td>  
    3232                    <td class="coverimage_cell_small"><img src="" alt="" class="coverimage_small" tal:attributes="src obj/getCoverImageURL; alt obj/title_or_id | nothing" /></td> 
    3333                            <td> 
    34                             <a href="" tal:attributes="href python:here.getPathInsideCollection(obj)" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a> 
     34                            <a href="" class="collection_item" tal:attributes="href python:here.getPathInsideCollection(obj)" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a> 
    3535                             <span tal:condition="deleted" i18n:translate="deleted_object_marker">DELETED</span> 
    3636                            </td> 
    3737                      
    38                         <td width="270" align="right"> 
    39                         <a href="" tal:condition="python: not start and not deleted" tal:attributes="href python:'%s/moveUpContent?objid=%s' % (here.absolute_url(), obj.id)" i18n:translate="label_move_up">Move up</a><span tal:condition="python:start or deleted" i18n:translate="label_move_up">Move up</span> | 
    40                         <a href="" tal:condition="python: not end and not deleted" tal:attributes="href python:'%s/moveDownContent?objid=%s' % (here.absolute_url(), obj.id)" i18n:translate="label_move_down">Move down</a><span tal:condition="python:end or deleted" i18n:translate="label_move_down">Move down</span> | 
    41                         <a href="" tal:attributes="href python:'%s/delete?obj=%s' % (here.absolute_url(), obj.UID())" i18n:translate="" i18n:domain="plone">Delete</a> 
     38                        <td ><img src="images/cross.gif" class="delete_button" width="20" height="20" alt="Remove" onclick="javascript:collectionDelete(this);"/> 
     39                        <input type="hidden" class="deletion_marker" tal:attributes="name python:'%s_deleted' % obj.UID()" value="0"/> 
    4240                        </td> 
    4341                   </tal:defines> 
     
    4846            <tal:methods tal:define="resources python:here.getResources(reftype='relatedMethods');" tal:condition="resources"> 
    4947            <h2 i18n:translate="label_methods">Methods</h2> 
    50             <table width="100%" border="0" cellpadding="4" cellspacing="0"> 
     48            <table border="0" cellpadding="4" cellspacing="0" width="80%"> 
    5149                <tr tal:repeat="obj resources"> 
     50                    <td width="20"></td> 
    5251                    <td class="coverimage_cell_small"><img src="" alt="" class="coverimage_small" tal:attributes="src obj/getCoverImageURL; alt obj/title_or_id | nothing" /></td> 
    53                             <td><a href="" tal:attributes="href python:here.getPathInsideCollection(obj)" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a></td> 
     52                            <td><a href="" class="collection_item" tal:attributes="href python:here.getPathInsideCollection(obj)" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a></td> 
    5453                      
    55                         <td class="button_cell" /> 
    56                         <td class="button_cell" /> 
    57                         <td class="button_cell"><a href="" tal:attributes="href python:'%s/delete?obj=%s' % (here.absolute_url(), obj.UID())" i18n:translate="" i18n:domain="plone">Delete</a></td> 
     54                        <td><img src="images/cross.gif" class="delete_button" width="20" height="20" alt="Remove" onclick="javascript:collectionDelete(this);"/> 
     55                        <input type="hidden" class="deletion_marker" tal:attributes="name python:'%s_deleted' % obj.UID()" value="0"/> 
    5856                     
    5957                </tr> 
     
    6361            <tal:tools tal:define="resources python:here.getResources(reftype='relatedTools');" tal:condition="resources"> 
    6462            <h2 i18n:translate="label_tools">Tools</h2> 
    65             <table width="100%" border="0" cellpadding="4" cellspacing="0"> 
     63            <table border="0" cellpadding="4" cellspacing="0" width="80%"> 
    6664                <tr tal:repeat="obj resources"> 
     65                    <td width="20"></td> 
    6766                    <td class="coverimage_cell_small"><img src="" alt="" class="coverimage_small" tal:attributes="src obj/getCoverImageURL; alt obj/title_or_id | nothing" /></td> 
    68                             <td><a href="" tal:attributes="href python:here.getPathInsideCollection(obj)" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a></td> 
     67                            <td><a href="" class="collection_item" tal:attributes="href python:here.getPathInsideCollection(obj)" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a></td> 
    6968                      
    70                         <td class="button_cell" /> 
    71                         <td class="button_cell" /> 
    72                         <td class="button_cell"><a href="" tal:attributes="href python:'%s/delete?obj=%s' % (here.absolute_url(), obj.UID())" i18n:translate="" i18n:domain="plone">Delete</a></td> 
    73                      
     69                        <td><img src="images/cross.gif" class="delete_button" width="20" height="20" alt="Remove" onclick="javascript:collectionDelete(this);"/> 
     70                        <input type="hidden" class="deletion_marker" tal:attributes="name python:'%s_deleted' % obj.UID()" value="0"/> 
     71                        </td> 
    7472                </tr> 
    7573            </table> 
     
    7876            <tal:collections condition="here/getRelatedCollections" tal:define="resources python:here.getResources(reftype='relatedCollections');"> 
    7977            <h2 i18n:translate="label_collections">Collections</h2> 
    80             <table width="100%" border="0" cellpadding="4" cellspacing="0"> 
    81                 <tr tal:repeat="obj resources"> 
    82                    <tal:defines define="start repeat/obj/start; 
    83                                        end repeat/obj/end; 
    84                                        deleted obj/isDeleted"> 
     78            <table border="0" cellpadding="4" cellspacing="0" class="sortable" width="80%"> 
     79                <tr tal:repeat="obj resources" class="choice_row"> 
     80                   <tal:defines define="index repeat/obj/index; deleted obj/isDeleted"> 
     81                    <td valign="top" style="border-right: 1px solid #8cacbb" width="20"><img src="images/sorthandle.png" width="20" height="20" valign="top" class="handle"> 
     82                    <input type="hidden" class="orderkeeper" value="0" name="col_order_0" id="col_order_0" tal:attributes="value index;name python:'col_order_%s' % index"></td>  
     83 
    8584                    <td class="coverimage_cell_small"><img src="" alt="" class="coverimage_small" tal:attributes="src obj/getCoverImageURL; alt obj/title_or_id | nothing" /></td> 
    8685                            <td> 
    87                                 <a href="" tal:attributes="href obj/absolute_url" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a> 
     86                                <a href="" class="collection_item" tal:attributes="href obj/absolute_url" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a> 
    8887                            </td> 
    8988                      
    90                         <td width="270" align="right"> 
    91                             <a href="" tal:condition="python: not start and not deleted" tal:attributes="href python:'%s/moveUpCollection?objid=%s' % (here.absolute_url(), obj.id)" i18n:translate="label_move_up">Move up</a><span tal:condition="python:start or deleted" i18n:translate="label_move_up">Move up</span> | 
    92                             <a href="" tal:condition="python: not end and not deleted" tal:attributes="href python:'%s/moveDownCollection?objid=%s' % (here.absolute_url(), obj.id)" i18n:translate="label_move_down">Move down</a><span tal:condition="python:end or deleted" i18n:translate="label_move_down">Move down</span> | 
    93                             <a href="" tal:attributes="href python:'%s/delete?obj=%s' % (here.absolute_url(), obj.UID())" i18n:translate="" i18n:domain="plone">Delete</a> 
     89                        <td><img src="images/cross.gif" class="delete_button" width="20" height="20" alt="Remove" onclick="javascript:collectionDelete(this);"/> 
     90                        <input type="hidden" class="deletion_marker" tal:attributes="name python:'%s_deleted' % obj.UID()" value="0"/> 
    9491                        </td> 
    9592                   </tal:defines> 
     
    103100            <metal:fieldMacro use-macro="python:here.widget('description', mode='edit')" /> 
    104101     
    105               <metal:block define-slot="extra_bottom" /> 
    106102     
    107103              <div class="formControls"> 
    108104     
    109105                <input type="hidden" 
    110                        name="fieldset" 
    111                        value="default" 
    112                        tal:attributes="value fieldset" 
    113                        /> 
    114                 <input type="hidden" 
    115106                       name="form.submitted" 
    116107                       value="1" 
    117108                       /> 
    118                 <input type="hidden" 
    119                        name="add_reference.field:record" 
    120                        value="" 
    121                        /> 
    122                 <input type="hidden" 
    123                        name="add_reference.type:record" 
    124                        value="" 
    125                        /> 
    126                 <input type="hidden" 
    127                        name="add_reference.destination:record" 
    128                        value="" 
    129                        /> 
    130109     
    131                 <tal:env define="env request/controller_state/kwargs"> 
    132                   <tal:loop repeat="varname python:('reference_source_url', 'reference_source_field', 'reference_source_fieldset')"> 
    133                     <tal:reference define="items python:env.get(varname, request.get(varname))" 
    134                                    condition="items"> 
    135                       <input tal:repeat="item items" 
    136                              type="hidden" 
    137                              name="form_env.reference_source_url:list:record" 
    138                              value="value" 
    139                              tal:attributes="value item; 
    140                                              name string:form_env.${varname}:list:record" 
    141                              /> 
    142                     </tal:reference> 
    143                   </tal:loop> 
    144                 </tal:env> 
    145110     
    146                 <tal:comment replace="nothing"> 
    147                   Turn 'persistent_' variables from controller_state persistent 
    148                 </tal:comment> 
    149                 <tal:env repeat="env request/controller_state/kwargs/items"> 
    150                   <input type="hidden" 
    151                          name="key" 
    152                          value="value" 
    153                          tal:define="key python:env[0]; 
    154                                      value python:env[1]" 
    155                          tal:condition="python:key.startswith('persistent_')" 
    156                          tal:attributes="name string:form_env.${key}:record; 
    157                                          value value" 
    158                          /> 
    159                 </tal:env> 
    160      
    161                 <tal:comment replace="nothing"> 
    162                   Turn 'persistent_' variables from forms (GET/POST) persistent 
    163                 </tal:comment> 
    164                 <tal:env repeat="env request/form"> 
    165                   <input type="hidden" 
    166                          name="key" 
    167                          value="value" 
    168                          tal:define="key env; 
    169                                      value request/?env" 
    170                          tal:condition="python:key.startswith('persistent_')" 
    171                          tal:attributes="name string:form_env.${key}:record; 
    172                                          value value" 
    173                          /> 
    174                 </tal:env> 
    175      
    176                 <tal:comment replace="nothing"> 
    177                   Store referrer to remember where to go back 
    178                 </tal:comment> 
    179                 <input type="hidden" 
    180                        name="last_referer" 
    181                        tal:define="last_referer python:here.session_restore_value('HTTP_REFERER', request.form.get('last_referer', request.get('HTTP_REFERER')))" 
    182                        tal:attributes="value python:(last_referer and '%s/%s' % (here.absolute_url(), template.id) not in last_referer) and last_referer or (here.getParentNode() and here.getParentNode().absolute_url())" 
    183                        /> 
    184      
    185                 <metal:block define-slot="buttons" 
    186                        tal:define="fieldset_index python:fieldsets.index(fieldset); 
    187                                    n_fieldsets python:len(fieldsets)"> 
    188      
    189                     <input tal:condition="python:fieldset_index &gt; 0" 
    190                            class="context" 
    191                            tabindex="" 
    192                            type="submit" 
    193                            name="form_previous" 
    194                            value="Previous" 
    195                            i18n:attributes="value label_previous;" 
    196                            tal:attributes="tabindex tabindex/next; 
    197                                            disabled python:test(isLocked, 'disabled', None);" 
    198                            /> 
    199                     <input tal:condition="python:fieldset_index &lt; n_fieldsets - 1" 
    200                            class="context" 
    201                            tabindex="" 
    202                            type="submit" 
    203                            name="form_next" 
    204                            value="Next" 
    205                            i18n:attributes="value label_next;" 
    206                            tal:attributes="tabindex tabindex/next; 
    207                                            disabled python:test(isLocked, 'disabled', None);" 
    208                            /> 
    209111                    <input class="context" 
    210112                           tabindex="" 
     
    213115                           value="Save" 
    214116                           i18n:attributes="value label_save;" i18n:domain="plone" 
    215                            tal:attributes="tabindex tabindex/next; 
    216                                            disabled python:test(isLocked, 'disabled', None);" 
     117                           tal:attributes="tabindex tabindex/next;" 
    217118                           /> 
    218119                    <input class="standalone" 
     
    224125                           tal:attributes="tabindex tabindex/next" 
    225126                           /> 
    226                 </metal:block> 
    227127     
    228128              </div> 
  • trunk/skins/lemill/jquery.js

    r2999 r3040  
    150150c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+ 
    151151b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); 
     152 
     153 
     154/*! 
     155 * jQuery UI 1.8.1 
     156 * 
     157 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 
     158 * Dual licensed under the MIT (MIT-LICENSE.txt) 
     159 * and GPL (GPL-LICENSE.txt) licenses. 
     160 * 
     161 * http://docs.jquery.com/UI 
     162 */ 
     163jQuery.ui||function(c){c.ui={version:"1.8.1",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")=="hidden")return false; 
     164b=b&&b=="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,f,g){return c.ui.isOverAxis(a,d,f)&&c.ui.isOverAxis(b,e,g)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33, 
     165PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))|| 
     166/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!== 
     167undefined)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b||"area"==b?a.href||!isNaN(d):!isNaN(d))&& 
     168!c(a)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}(jQuery); 
     169;/*! 
     170 * jQuery UI Widget 1.8.1 
     171 * 
     172 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 
     173 * Dual licensed under the MIT (MIT-LICENSE.txt) 
     174 * and GPL (GPL-LICENSE.txt) licenses. 
     175 * 
     176 * http://docs.jquery.com/UI/Widget 
     177 */ 
     178(function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype= 
     179b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g= 
     180b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create(); 
     181this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f, 
     182h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a= 
     183b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); 
     184;/*! 
     185 * jQuery UI Mouse 1.8.1 
     186 * 
     187 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 
     188 * Dual licensed under the MIT (MIT-LICENSE.txt) 
     189 * and GPL (GPL-LICENSE.txt) licenses. 
     190 * 
     191 * http://docs.jquery.com/UI/Mouse 
     192 * 
     193 * Depends: 
     194 *  jquery.ui.widget.js 
     195 */ 
     196(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&& 
     197this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault(); 
     198return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&& 
     199this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX- 
     200a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); 
     201;/* 
     202 * jQuery UI Sortable 1.8.1 
     203 * 
     204 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 
     205 * Dual licensed under the MIT (MIT-LICENSE.txt) 
     206 * and GPL (GPL-LICENSE.txt) licenses. 
     207 * 
     208 * http://docs.jquery.com/UI/Sortables 
     209 * 
     210 * Depends: 
     211 *  jquery.ui.core.js 
     212 *  jquery.ui.mouse.js 
     213 *  jquery.ui.widget.js 
     214 */ 
     215(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); 
     216this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(self, 
     217arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= 
     218c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, 
     219{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); 
     220if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", 
     221a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); 
     222if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+ 
     223this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+ 
     224b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+ 
     225"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, 
     226c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== 
     227document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate", 
     228null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem): 
     229d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c}, 
     230_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/ 
     2312&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b= 
     232d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a= 
     233this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)? 
     234h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"), 
     235b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)? 
     236i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement, 
     237c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height= 
     238this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()- 
     239parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0], 
     240this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b= 
     2411E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change", 
     242a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]== 
     243this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width==""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| 
     2440};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], 
     245this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top- 
     246(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options; 
     247if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b= 
     248d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width- 
     249this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+ 
     250this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], 
     251this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top; 
     252if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f- 
     253this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+ 
     254(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&& 
     255this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]|| 
     256this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update", 
     257g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity", 
     258this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e= 
     2590;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.1"})})(jQuery); 
     260;/* 
     261 * jQuery UI Effects 1.8.1 
     262 * 
     263 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 
     264 * Dual licensed under the MIT (MIT-LICENSE.txt) 
     265 * and GPL (GPL-LICENSE.txt) licenses. 
     266 * 
     267 * http://docs.jquery.com/UI/Effects/ 
     268 */ 
     269jQuery.effects||function(f){function k(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], 
     27016),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return l.transparent;return l[f.trim(c).toLowerCase()]}function q(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return k(b)}function m(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, 
     271a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function n(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in r||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function s(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function j(c,a,b,d){if(typeof c=="object"){d= 
     272a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(f.isFunction(b)){d=b;b=null}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:f.fx.speeds[b]||f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=q(b.elem,a);b.end=k(b.end);b.colorInit= 
     273true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var l={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189, 
     274183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255, 
     275165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},o=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){var e=f(this),g=e.attr("style")||" ",h=n(m.call(this)),p,t=e.attr("className");f.each(o,function(u, 
     276i){c[i]&&e[i+"Class"](c[i])});p=n(m.call(this));e.attr("className",t);e.animate(s(h,p),a,b,function(){f.each(o,function(u,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a? 
     277f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===undefined?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.1",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!== 
     278null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent(); 
     279var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"}); 
     280c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=j.apply(this,arguments);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c|| 
     281typeof c=="number"||f.fx.speeds[c])return this._show.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(!c||typeof c=="number"||f.fx.speeds[c])return this._hide.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||typeof c=="boolean"||f.isFunction(c))return this.__toggle.apply(this, 
     282arguments);else{var a=j.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c, 
     283a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+ 
     284b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2, 
     28510*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)* 
     286a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c, 
     287a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==undefined)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==undefined)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c, 
     288a,b,d,e,g){if(g==undefined)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0, 
     289d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery); 
     290;/* 
     291 * jQuery UI Effects Slide 1.8.1 
     292 * 
     293 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 
     294 * Dual licensed under the MIT (MIT-LICENSE.txt) 
     295 * and GPL (GPL-LICENSE.txt) licenses. 
     296 * 
     297 * http://docs.jquery.com/UI/Effects/Slide 
     298 * 
     299 * Depends: 
     300 *  jquery.effects.core.js 
     301 */ 
     302(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","left"],e=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(e=="show")a.css(f,b=="pos"?-g:g);var i={};i[f]=(e=="show"?b=="pos"? 
     303"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); 
     304; 
  • trunk/skins/lemill/master.css

    r3018 r3040  
    915915} 
    916916 
     917.deletedText { 
     918    color: #ff0000; 
     919    text-decoration: line-through; 
     920} 
     921 
    917922.deleteButtonPosition { 
    918923    margin-left:24px; 
     
    10831088    } 
    10841089 
    1085 .button_cell { 
    1086     width: 20px; 
    1087     } 
    10881090     
    10891091.tablecell_link { 
  • trunk/skins/lemill/master.js

    r3028 r3040  
    3636        event.preventDefault(); 
    3737    }); 
     38/* 2. Sortable things 
     39*/ 
     40    $(".sortable").sortable({  
     41        handle : '.handle', items : '.choice_row',  
     42        update : function(event, ui) { 
     43            /* Write new indexes for every row  
     44            */ 
     45            siblings=ui.item.parent().children('.choice_row'); 
     46            siblings.each(function(index){ 
     47                $(this).find('.orderkeeper:first').attr('value',index); 
     48                }); 
     49        } 
     50        }); 
     51 
    3852}); 
    3953 
     54/* Mark resource for deletion in collection 
     55*/ 
     56function collectionDelete(img){ 
     57        row=$(img).parents('tr:first'); 
     58        row.find('a.collection_item:first').addClass('deletedText').click(collectionRestore); 
     59        row.find('input.deletion_marker').attr('value',1) 
     60        $(img).hide(); 
     61} 
     62function collectionRestore(){     
     63        row=$(this).parents('tr:first') 
     64        row.find('img.delete_button:first').show(); 
     65        row.find('input.deletion_marker').attr('value',0) 
     66        $(this).removeClass('deletedText'); 
     67        $(this).unbind('click', collectionRestore); 
     68        return false; 
     69} 
     70function fadeToggle(query) { 
     71    query.each(function() { 
     72        if (this.style.display=='none') { 
     73            $(this).fadeIn();  
     74        } else { 
     75            $(this).fadeOut(); 
     76        } 
     77    }); 
     78} 
     79 
     80function questionWizard(mode, index) { 
     81    switch(mode) { 
     82    case 0: 
     83        $('#question_type_selection_'+index).toggle('slide', {direction:'left'}); 
     84        $('#multiple_choice_edit_'+index).toggle('slide', {direction:'right'}); 
     85        break;         
     86    case 1: 
     87        $('#question_type_selection_'+index).toggle('slide', {direction:'left'}); 
     88        $('#fill_blanks_edit_'+index).toggle('slide', {direction:'right'}); 
     89        break; 
     90    case 2: 
     91        $('#question_type_selection_'+index).toggle('slide', {direction:'left'}); 
     92        $('#open_ended_edit_'+index).toggle('slide', {direction:'right'}); 
     93        break; 
     94    case 3: 
     95        $('#question_type_selection_'+index).toggle('slide', {direction:'left'}); 
     96        $('#hot_potatoes_edit_'+index).toggle('slide', {direction:'right'}); 
     97        break; 
     98    case 4: 
     99        previewMultipleChoice(index); 
     100        $('#multiple_choice_edit_'+index).toggle('slide', {direction:'left'}); 
     101        $('#preview_'+index).toggle('slide', {direction:'right'}); 
     102        break;         
     103    case 5: 
     104        $('#fill_blanks_edit_'+index).toggle('slide', {direction:'left'}); 
     105        $('#preview_'+index).toggle('slide', {direction:'right'}); 
     106        break;         
     107    case 6: 
     108        $('#open_ended_edit_'+index).toggle('slide', {direction:'left'}); 
     109        $('#preview_'+index).toggle('slide', {direction:'right'}); 
     110        break;         
     111    }; 
     112} 
     113 
     114 
     115function previewMultipleChoice(index) { 
     116    question='Vai niin.'; 
     117    choices=['Hah','hei','huh']; 
     118    s='<table><tr><td valign="middle" align="left"><p>'; 
     119    s+=question; 
     120    s+='</p></td></tr><tr><td>'; 
     121    for (choice in choices) { 
     122        s+=choice; 
     123        }        
     124    s+='</td></tr></table>'; 
     125    $('#preview_'+index+' > div.innermost').html(s); 
     126    clicked='javascript:questionWizard(4, '+index+')'; 
     127    $('#preview_'+index+' > a.backlink').click(function(){questionWizard(4, index)}); 
     128    } 
     129 
     130/*      tal:define="question python:chapter[0]; answers python:context.getAllAnswers(chapter)"> 
     131*        <tr> 
     132*        <td valign="middle" align="left"> 
     133*            <p tal:content="structure question">PLACEHOLDER</p> 
     134*        </td> 
     135*        </tr> 
     136*        <tr> 
     137*        <td> 
     138*            <span tal:repeat="answer answers" tal:omit-tag=""> 
     139*            <p> 
     140*                <input type="radio" value="" 
     141*                tal:attributes="id python:'exercise_%s_checkbox_%s' % (index,answer[0]); 
     142*                name python:'exercise_%s_checkbox' % (index); 
     143*                value python:answer[0]" /> 
     144*                <input type="hidden" value="" 
     145*                tal:attributes="id python:'exercise_%s_hiddencheck_%s' % (index, answer[0]); 
     146*                name python:'exercise_%s_hiddencheck_%s' % (index, answer[0]); 
     147*                value repeat/answer/index" /> 
     148*                <span tal:replace="structure python:answer[1]"></span> 
     149*            </p> 
     150*            </span> 
     151*        </td>                     
     152*        </tr> 
     153*    </table> 
     154*/ 
    40155 
    41156function getLatestBlogPost(lang){ 
     
    789904}); 
    790905 
    791  
Note: See TracChangeset for help on using the changeset viewer.