/* - at.kss - */ /* Base kss resource for Archetypes */ /* XXX Note you can't use comma separation for selectors! */ input.blurrable:blur { action-server: kssValidateField; kssValidateField-fieldname: kssAttr('atfieldname', true); kssValidateField-value: currentFormVar(); kssValidateField-uid: kssAttr('atuid', true); } select.blurrable:blur { action-server: kssValidateField; kssValidateField-fieldname: kssAttr('atfieldname', true); kssValidateField-value: currentFormVar(); kssValidateField-uid: kssAttr('atuid', true); } textarea.blurrable:blur { action-server: kssValidateField; kssValidateField-fieldname: kssAttr('atfieldname', true); kssValidateField-value: currentFormVar(); kssValidateField-uid: kssAttr('atuid', true); } form[action=criterion_edit_form] input.blurrable:blur { action-cancel: kssValidateField; } form[action=criterion_edit_form] select.blurrable:blur { action-cancel: kssValidateField; } form[action=criterion_edit_form] textarea.blurrable:blur { action-cancel: kssValidateField; } .inlineEditable:click { evt-click-allowbubbling: true; action-server: replaceField; replaceField-fieldname: kssAttr('atfieldname', true); replaceField-macro: kssAttr('macro', true); replaceField-templateId: kssAttr('templateId', true); replaceField-uid: kssAttr('atuid', true); replaceField-target: kssAttr('target', true); replaceField-edit: true; action-client: log; } form.inlineForm input[name=kss-save]:click { evt-click-preventdefault: true; action-server: saveField; saveField-fieldname: kssAttr('atfieldname', true); saveField-kssSubmitForm: currentForm(); saveField-macro: kssAttr('macro', true); saveField-templateId: kssAttr('templateId', true); saveField-uid: kssAttr('atuid', true); saveField-target: kssAttr('target', true); } /* XXX Note you can't use comma separation for selectors! */ form.inlineForm input[name=kss-cancel]:click { evt-click-preventdefault: true; action-server: replaceWithView; replaceWithView-fieldname: kssAttr('atfieldname', true); replaceWithView-macro: kssAttr('macro', true); replaceWithView-templateId: kssAttr('templateId', true); replaceWithView-uid: kssAttr('atuid', true); replaceWithView-target: kssAttr('target', true); replaceWithView-edit: true; } /* XXX Note you can't use comma separation for selectors! */ form.inlineForm input.blurrable:keypress(inlineescape) { evt-keypress-keycodes: '27'; action-server: replaceWithView; replaceWithView-fieldname: kssAttr('atfieldname', true); replaceWithView-macro: kssAttr('macro', true); replaceWithView-templateId: kssAttr('templateId', true); replaceWithView-uid: kssAttr('atuid', true); replaceWithView-target: kssAttr('target', true); replaceWithView-edit: true; } form.inlineForm select.blurrable:keypress(inlineescape) { evt-keypress-keycodes: '27'; action-server: replaceWithView; replaceWithView-fieldname: kssAttr('atfieldname', true); replaceWithView-macro: kssAttr('macro', true); replaceWithView-templateId: kssAttr('templateId', true); replaceWithView-uid: kssAttr('atuid', true); replaceWithView-target: kssAttr('target', true); replaceWithView-edit: true; } form.inlineForm textarea.blurrable:keypress(inlineescape) { evt-keypress-keycodes: '27'; action-server: replaceWithView; replaceWithView-fieldname: kssAttr('atfieldname', true); replaceWithView-macro: kssAttr('macro', true); replaceWithView-templateId: kssAttr('templateId', true); replaceWithView-uid: kssAttr('atuid', true); replaceWithView-target: kssAttr('target', true); replaceWithView-edit: true; } form.inlineForm input[type="text"].blurrable:keydown { evt-keydown-preventdefault: true; evt-keydown-keycodes: 13; action-client: log; } /* Since some browsers (mainly, some version of Safari) do a little bit of fireworks with the events (yeah, cause it fires them up all together) we disable the default on all of them */ form.inlineForm input[type="text"].blurrable:keypress { evt-keypress-preventdefault: true; evt-keypress-keycodes: 13; action-client: log; } form.inlineForm input[type="text"].blurrable:keyup { evt-keyup-preventdefault: true; evt-keyup-keycodes: 13; action-client: log; action-server: saveField; saveField-fieldname: kssAttr('atfieldname', true); saveField-kssSubmitForm: currentForm(); saveField-macro: kssAttr('macro', true); saveField-templateId: kssAttr('templateId', true); saveField-uid: kssAttr('atuid', true); saveField-target: kssAttr('target', true); } .inlineEditable a:click { evt-click-preventbubbling: true; } /* - plone.kss - */ /* */ /* The above trick to let this file not be cached does not work, unless this file is renamed to have a kss.dtml extension. */ /* General stylesheet for Plone AJAX */ /* Add class to body to allow conditional styling when kss is available */ body:load { action-client: addClass; addClass-value: kssActive; } ul.contentViews li a:plone-formProtectionChecked { action-server: replaceContentRegion; replaceContentRegion-tabid: nodeAttr(id, true); replaceContentRegion-url: nodeAttr(href); replaceContentRegion-error: plone-followLink; action-client: plone-removeLockProtection; } /* Load the kupu editor. The editor is also loaded from the page, so we give the initial=false, otherwise that should be left out if we do that too. */ iframe.kupu-editor-iframe:load { action-client: plone-initKupu; } #region-content:load { evt-load-initial: false; action-client: initializeCollapsible; } /* This loads the external links markers each time an element marked inlineEditable is reloaded (needed to make it work with inlineEditable). However, this isn't the best, client-performance wise. TODO: Find a better way to "bind just once" or just bind the effectively reloaded links, and not rebind everything */ #region-content .inlineEditable:load { evt-load-initial: false; action-client: bindExternalLinks; } /* Portlet refreshing. The refreshing portlets must have the kssPortletRefresh class for selection. You can also select per portlet, however this shows how to handle them all in one rule. */ /* dl.kssPortletRefresh:timeout { evt-timeout-delay: 60000; action-server: refreshPortlet; refreshPortlet-portlethash: kssAttr("portlethash", True); refreshPortlet-name: nodeAttr(id); } */ /* Deferred portlets */ div.portlet-deferred:load { action-server: refreshPortlet; refreshPortlet-portlethash: kssAttr(portlethash, True); } /* Content Menu Sections: General */ #contentActionMenus:load { evt-load-initial: false; action-client: bindActionMenus; } /* Content Menu Sections: Change View */ /* #plone-contentmenu-display dd.actionMenuContent a:click { evt-click-preventdefault: True; action-server: changeViewTemplate; evt-click-allowbubbling: True; changeViewTemplate-url: nodeAttr(href); } */ /* This rule is needed for keeping the default behavior for menu elements that */ /* are supposed to send user to another page */ #contextSetDefaultPage:click { evt-click-preventdefault: False; action-cancel: changeViewTemplate; } #folderChangeDefaultPage:click { evt-click-preventdefault: False; action-cancel: changeViewTemplate; } /* Content Menu Sections: Cut and Paste */ /* Needed allowbubbling, because the menu-item is inside a span an the event selector is on the enclosing a-tag */ a.actionicon-object_buttons-cut:click { evt-click-preventdefault: True; evt-click-allowbubbling: True; action-server: cutObject; } a.actionicon-object_buttons-copy:click { evt-click-preventdefault: True; evt-click-allowbubbling: True; action-server: copyObject; } /* Content Menu Sections: Workflow State */ #plone-contentmenu-workflow dd.actionMenuContent a:click { evt-click-preventdefault: True; evt-click-allowbubbling: True; action-server: changeWorkflowState; changeWorkflowState-url: nodeAttr(href); } #plone-contentmenu-workflow dd.actionMenuContent a.kssIgnore:click { evt-click-preventdefault: False; action-cancel: changeWorkflowState; } /* In-place calendar changing */ a.kssCalendarChange:click { evt-click-preventdefault: true; action-server: refreshCalendar; refreshCalendar-portlethash: kssAttr(portlethash, True); refreshCalendar-year: kssAttr(year); refreshCalendar-month: kssAttr(month); } /* Spinner */ /* effects do not seem to like animated gifs #kss-spinner:spinneron { evt-spinneron-laziness: 1000; action-client: effect; effect-type: appear; } #kss-spinner:spinneroff { action-client: effect; effect-type: fade; } */ #kss-spinner:spinneron { action-client: setStyle; setStyle-name: display; setStyle-value: block; } #kss-spinner:spinneroff { action-client: setStyle; setStyle-name: display; setStyle-value: none; } /* ** Form tabs */ form.enableFormTabbing:load { evt-load-initial: false; action-client: plone-initFormTabs; } form.enableUnloadProtection:load { evt-load-initial: false; action-client: plone-initFormProtection; } form.enableUnlockProtection:load { evt-load-initial: false; action-client: plone-initLockingProtection; } /* Selector for the sharing page in plone.app.workflow. the search_term parameters, puts the needed info into the request */ #sharing-save-button:click { evt-click-preventdefault: true; action-server: updateSharingInfo; updateSharingInfo-kssSubmitForm: currentForm(); updateSharingInfo-error: plone-submitCurrentForm; } #sharing-user-group-search:keydown { evt-keydown-preventdefault: true; evt-keydown-keycodes: 13; action-client: log; } #sharing-user-group-search:keypress { evt-keypress-preventdefault: true; evt-keypress-keycodes: 13; action-client: log; } #sharing-user-group-search:keyup { evt-keyup-preventdefault: true; evt-keyup-keycodes: 13; action-server: updateSharingInfo; updateSharingInfo-kssSubmitForm: currentForm(); } /* kupu stuff */ #kupu-save-button:load { action-client: setStyle; setStyle-name: display; setStyle-value: inline; } button.kupu-save:click { action-server: savekupu; savekupu-text: currentFormVarFromKssAttr("atfieldname", true); savekupu-fieldname: kssAttr("atfieldname", true); } /* Folder contents stuff */ body:load { action-client: plone-initShiftDetection; } #folderlisting-main-table input[type="checkbox"]:change { action-client: plone-createCheckBoxSelection; plone-createCheckBoxSelection-group: 'table.listing input[type="checkbox"]'; } #folderlisting-main-table input[type="checkbox"]:change { action-client: toggleClass; toggleClass-kssSelector: parentnode("table.listing tbody tr"); toggleClass-classname: "selected"; } #foldercontents-title-column:click { action-server: foldercontents_update_table; evt-click-preventdefault: True; foldercontents_update_table-pagenumber: currentFormVar('pagenumber'); foldercontents_update_table-sort_on: "sortable_title"; } #foldercontents-modified-column:click { action-server: foldercontents_update_table; evt-click-preventdefault: True; foldercontents_update_table-pagenumber: currentFormVar('pagenumber'); foldercontents_update_table-sort_on: "modified"; } #foldercontents-status-column:click { action-server: foldercontents_update_table; evt-click-preventdefault: True; foldercontents_update_table-pagenumber: currentFormVar('pagenumber'); foldercontents_update_table-sort_on: "review_state"; } #foldercontents-selectall:click { action-server: foldercontents_update_table; foldercontents_update_table-pagenumber: currentFormVar('pagenumber'); foldercontents_update_table-sort_on: currentFormVar('sort_on'); foldercontents_update_table-select: 'screen'; evt-click-preventdefault: True; } #foldercontents-selectall-completebatch:click { action-server: foldercontents_update_table; foldercontents_update_table-pagenumber: currentFormVar('pagenumber'); foldercontents_update_table-sort_on: currentFormVar('sort_on'); foldercontents_update_table-select: 'all'; evt-click-preventdefault: True; } #foldercontents-clearselection:click { action-server: foldercontents_update_table; foldercontents_update_table-pagenumber: currentFormVar('pagenumber'); foldercontents_update_table-sort_on: currentFormVar('sort_on'); foldercontents_update_table-select: 'none'; evt-click-preventdefault: True; } #folderlisting-main-table:load { action-client: plone-initDragAndDrop; plone-initDragAndDrop-table: '#listing-table'; } #folderlisting-main-table:load { action-client: plone-initCheckBoxSelection; } /* kupu stuff */ #kupu-save-button:load { action-client: setStyle; setStyle-name: display; setStyle-value: inline; } div.kupu-save-message:timeout { evt-timeout-delay: 2000; evt-timeout-repeat: ''; action-client: deleteNode; } #portal-message:timeout { evt-timeout-delay: 2000; evt-timeout-repeat: ''; action-client: deleteNode; } /* check if the object if really locked before showing the icon */ /* an xmlhttprequest might have just been sent on the object to */ /* unlock just a few moment ago. So we need to be really sure */ /* that the object wasn't locked, to be sure, we do one more */ /* xmlhttprequest */ #lock-icon:load{ action-server: updateLockInfo; } /* - ++resource++plone.app.form.kss - */ /* /portal_kss/++resource++plone.app.form.kss?original=1 */ .formlibInlineValidation input[type="text"]:blur { action-server: kss_formlib_inline_validation; kss_formlib_inline_validation-formname: kssAttr('formname', true); kss_formlib_inline_validation-fieldname: kssAttr('fieldname', true); kss_formlib_inline_validation-value: currentFormVar(); kss_formlib_inline_validation-kssSubmitForm: currentForm(); } .formlibInlineValidation input[type="password"]:blur { action-server: kss_formlib_inline_validation; kss_formlib_inline_validation-formname: kssAttr('formname', true); kss_formlib_inline_validation-fieldname: kssAttr('fieldname', true); kss_formlib_inline_validation-value: currentFormVar(); kss_formlib_inline_validation-kssSubmitForm: currentForm(); } .formlibInlineValidation input[type="checkbox"]:blur { action-server: kss_formlib_inline_validation; kss_formlib_inline_validation-formname: kssAttr('formname', true); kss_formlib_inline_validation-fieldname: kssAttr('fieldname', true); kss_formlib_inline_validation-value: currentFormVar(); kss_formlib_inline_validation-kssSubmitForm: currentForm(); } .formlibInlineValidation input[type="radio"]:blur { action-server: kss_formlib_inline_validation; kss_formlib_inline_validation-formname: kssAttr('formname', true); kss_formlib_inline_validation-fieldname: kssAttr('fieldname', true); kss_formlib_inline_validation-value: currentFormVar(); kss_formlib_inline_validation-kssSubmitForm: currentForm(); } .formlibInlineValidation select:blur { action-server: kss_formlib_inline_validation; kss_formlib_inline_validation-formname: kssAttr('formname', true); kss_formlib_inline_validation-fieldname: kssAttr('fieldname', true); kss_formlib_inline_validation-value: currentFormVar(); kss_formlib_inline_validation-kssSubmitForm: currentForm(); } .formlibInlineValidation textarea:blur { action-server: kss_formlib_inline_validation; kss_formlib_inline_validation-formname: kssAttr('formname', true); kss_formlib_inline_validation-fieldname: kssAttr('fieldname', true); kss_formlib_inline_validation-value: currentFormVar(); kss_formlib_inline_validation-kssSubmitForm: currentForm(); } /* */ .formlibInlineEditable:click { evt-click-allowbubbling: true; action-server: kss_formlib_inline_edit_begin; kss_formlib_inline_edit_begin-formname: kssAttr('formname', true); kss_formlib_inline_edit_begin-fieldname: kssAttr('fieldname'); kss_formlib_inline_edit_begin-structure: kssAttr('structure'); } .formlibInlineEditable a:click { evt-click-preventbubbling: true; } .formlibInlineEditable form.formlibInlineForm:click { evt-click-allowbubbling: true; evt-click-preventbubbling: true; } /* */ form.inlineForm input[type="text"]:keyup { evt-keyup-preventdefault: true; evt-keyup-keycodes: 13; action-server: kss_formlib_inline_edit_save; kss_formlib_inline_edit_save-kssSubmitForm: currentForm(); kss_formlib_inline_edit_save-formname: kssAttr('formname', true); kss_formlib_inline_edit_save-fieldname: kssAttr('fieldname', true); kss_formlib_inline_edit_save-structure: kssAttr('structure', true); } form.formlibInlineForm input[type="text"]:keydown { evt-keydown-preventdefault: true; evt-keydown-keycodes: 13; action-client: log; } form.formlibInlineForm input[type="text"]:keypress { evt-keypress-preventdefault: true; evt-keypress-keycodes: 13; action-client: log; } form.formlibInlineForm input[name=kss-save]:click { evt-click-preventdefault: true; action-server: kss_formlib_inline_edit_save; kss_formlib_inline_edit_save-kssSubmitForm: currentForm(); kss_formlib_inline_edit_save-formname: kssAttr('formname', true); kss_formlib_inline_edit_save-fieldname: kssAttr('fieldname', true); kss_formlib_inline_edit_save-structure: kssAttr('structure', true); } /* */ form.formlibInlineForm input:keypress(inlineescape) { evt-keypress-keycodes: '27'; action-server: kss_formlib_inline_edit_cancel; kss_formlib_inline_edit_cancel-fieldname: kssAttr('fieldname', true); } form.formlibInlineForm select:keypress(inlineescape) { evt-keypress-keycodes: '27'; action-server: kss_formlib_inline_edit_cancel; kss_formlib_inline_edit_cancel-fieldname: kssAttr('fieldname', true); } form.formlibInlineForm textarea:keypress(inlineescape) { evt-keypress-keycodes: '27'; action-server: kss_formlib_inline_edit_cancel; kss_formlib_inline_edit_cancel-fieldname: kssAttr('fieldname', true); } form.formlibInlineForm input[name=kss-cancel]:click { evt-click-preventdefault: true; action-server: kss_formlib_inline_edit_cancel; kss_formlib_inline_edit_cancel-fieldname: kssAttr('fieldname', true); } /* - linguaplone.kss - */ /* /portal_kss/linguaplone.kss?original=1 */ .canonicalLanguage .inlineEditable:click { action-cancel: replaceField; } .canonicalLanguage:load { action-client: removeClass; removeClass-value: kssActive; removeClass-kssSelector: body; }