elveos

elveos Commit Details

Date:2011-05-03 16:55:02 (2 years 17 days ago)
Author:Frédéric Bertolus
Branch:
Commit:c54c6b30d4991a2adfeeb882682aec7256d7a17d
Parents: 15a53e714d51d316b0c9dfc77fc4cd948eab1623
Message:add showhide in all form

File differences

css/include/components.less
570570    color: @default_link_color * 1.5;
571571}
572572
573form .fake_link {
574 text-align: right;
575 font-size: 0.8em;
576}
577
573578.bold{
574579    font-weight:bold
575580}
main/src/main/java/com/bloatit/framework/webprocessor/components/javascript/JsShowHide.java
6767
6868        for (final HtmlBranch actuator : actuators) {
6969
70            final String effectCall = "toggle( \"blind\")";
70            final String effectCall = "toggle( \"blind\", 200)";
7171            HtmlScript script = new HtmlScript();
7272
7373            script.append("$(function() {\n" + " function runEffect() {\n");
main/src/main/java/com/bloatit/web/linkable/usercontent/AttachmentField.java
1616//
1717package com.bloatit.web.linkable.usercontent;
1818
19import com.bloatit.framework.webprocessor.components.HtmlDiv;
20import com.bloatit.framework.webprocessor.components.HtmlParagraph;
1921import com.bloatit.framework.webprocessor.components.PlaceHolderElement;
2022import com.bloatit.framework.webprocessor.components.form.FieldData;
2123import com.bloatit.framework.webprocessor.components.form.HtmlFileInput;
2224import com.bloatit.framework.webprocessor.components.form.HtmlTextField;
25import com.bloatit.framework.webprocessor.components.javascript.JsShowHide;
2326import com.bloatit.framework.webprocessor.context.Context;
2427import com.bloatit.web.url.UserContentActionUrl;
2528
...... 
3538
3639    /**
3740     * Do not forget the: form.enableFileUpload();
38     *
41     *
3942     * @param targetUrl
4043     * @param attachmentLabel
4144     * @param attachmentComment
...... 
4952                           final String descriptionComment) {
5053        super();
5154        // Attachment
55        HtmlParagraph addAttachementLink = new HtmlParagraph(Context.tr("+ add attachement"), "fake_link");
56        add(addAttachementLink);
57
58        HtmlDiv attachmentDiv = new HtmlDiv();
59        add(attachmentDiv);
60
5261        final FieldData attachedFileData = targetUrl.getAttachmentParameter().pickFieldData();
5362        final HtmlFileInput attachedFileInput = new HtmlFileInput(attachedFileData.getName(), attachmentLabel);
5463        attachedFileInput.setDefaultValue(attachedFileData.getSuggestedValue());
5564        attachedFileInput.addErrorMessages(attachedFileData.getErrorMessages());
5665        attachedFileInput.setComment(attachmentComment);
57        add(attachedFileInput);
66        attachmentDiv.add(attachedFileInput);
5867
5968        final FieldData attachmentDescriptiondData = targetUrl.getAttachmentDescriptionParameter().pickFieldData();
6069        final HtmlTextField attachmentDescriptionInput = new HtmlTextField(attachmentDescriptiondData.getName(), descriptionLabel);
6170        attachmentDescriptionInput.setDefaultValue(attachmentDescriptiondData.getSuggestedValue());
6271        attachmentDescriptionInput.addErrorMessages(attachmentDescriptiondData.getErrorMessages());
6372        attachmentDescriptionInput.setComment(descriptionComment);
64        add(attachmentDescriptionInput);
73        attachmentDiv.add(attachmentDescriptionInput);
74
75        JsShowHide showHide = new JsShowHide(false);
76        showHide.setHasFallback(false);
77
78        showHide.addActuator(addAttachementLink);
79        showHide.addListener(attachmentDiv);
80        showHide.apply();
81
6582    }
6683
6784}

Archive Download the corresponding diff file