kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
March 2009
- 1 participants
- 37 discussions
Author: vjrj
Date: 2009-03-30 15:48:35 +0200 (Mon, 30 Mar 2009)
New Revision: 1089
Added:
trunk/src/main/java/org/ourproject/kune/app/public/css/img/film.png
trunk/src/main/java/org/ourproject/kune/app/public/css/img/specialchars.png
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionMenuItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTELinkPopup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstract.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java
Modified:
trunk/img/kune-logos.svg
trunk/script/generateBasicUIElements.sh
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
Log:
Incomplete - task RTE: Edit/erase link contextual menu
Incomplete - task Actions UI position reorganization
Complete - task LinkInfo and LinkImage reference in Abstra*
Incomplete - task Insert Media dialog
Complete - task RTE Insert Image size bug (trans field instead of other)
Modified: trunk/img/kune-logos.svg
===================================================================
--- trunk/img/kune-logos.svg 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/img/kune-logos.svg 2009-03-30 13:48:35 UTC (rev 1089)
@@ -86,14 +86,14 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="0.72123458"
- inkscape:cx="372.04724"
- inkscape:cy="526.18109"
+ inkscape:zoom="1"
+ inkscape:cx="342.68538"
+ inkscape:cy="391.54295"
inkscape:document-units="px"
inkscape:current-layer="layer1"
- inkscape:window-width="1379"
- inkscape:window-height="936"
- inkscape:window-x="61"
+ inkscape:window-width="1280"
+ inkscape:window-height="1001"
+ inkscape:window-x="1280"
inkscape:window-y="0"
showguides="true"
inkscape:guide-bbox="true"
@@ -747,5 +747,81 @@
d="M 372.87905,411.27704 L 437.81346,411.27704"
style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23947906;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
</g>
+ <g
+ id="g2737">
+ <path
+ inkscape:export-ydpi="399.59854"
+ inkscape:export-xdpi="399.59854"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-logo-1200.png"
+ id="path2689"
+ d="M 298.07933,890.09763 C 297.3363,890.09763 296.6221,890.10025 295.90542,890.14704 C 295.83851,890.16067 295.77509,890.18388 295.70779,890.19644 C 295.04064,890.32105 294.38243,890.42731 293.6821,890.44348 C 293.58509,890.45708 293.48215,890.42895 293.38566,890.44348 C 287.66961,891.30403 282.84012,893.78596 278.95878,897.90395 C 274.42607,902.69101 272.14061,908.42577 272.1406,915.09763 C 272.1406,921.84435 274.42608,927.61807 278.95878,932.39012 C 283.86545,937.53616 290.24058,940.09761 298.07933,940.09763 C 302.23802,940.09761 306.23614,939.06435 310.03585,936.98498 C 313.8355,934.96547 317.1393,932.10715 319.96668,928.48696 L 311.41925,923.74388 C 307.7392,928.65056 303.21767,931.10554 297.8323,931.10554 C 294.09242,931.10554 290.7392,929.89235 287.85206,927.49882 C 284.91999,925.10531 283.45479,922.18991 283.45483,918.70435 L 322.53585,918.70435 L 322.53585,916.72806 C 322.53581,908.27602 319.67294,901.50799 313.98842,896.42174 C 309.20137,892.18827 303.89852,890.09769 298.07933,890.09763 z M 116.35996,890.44348 L 116.35996,909.3664 L 109.73941,909.3664 L 109.73941,919.0502 L 116.35996,919.0502 L 116.35996,938.81305 L 126.43901,938.81305 L 126.43901,919.0502 L 132.51609,919.0502 L 144.91728,938.81305 L 156.8738,938.81305 L 140.2236,913.71423 L 156.13269,891.38221 L 143.92913,891.38221 L 131.62676,909.3664 L 126.43901,909.3664 L 126.43901,890.44348 L 116.35996,890.44348 z M 240.02597,890.44348 C 238.29094,890.75314 236.67426,891.25714 235.18407,892.02451 C 232.67087,893.37089 230.68678,895.14652 229.20581,897.36048 L 229.20581,891.38221 L 219.07735,891.38221 L 219.07735,938.81305 L 229.20581,938.81305 L 229.20581,912.23202 C 229.2058,908.43237 230.27805,905.51695 232.41728,903.43755 C 234.57141,901.35823 237.30235,900.32493 240.66826,900.3249 C 244.22858,900.32493 247.00891,901.28027 248.96866,903.23992 C 250.9283,905.19964 251.88362,908.27094 251.88368,912.42965 L 251.88368,938.81305 L 262.01214,938.81305 L 262.01214,910.20633 C 262.01209,904.38713 260.23647,899.57918 256.67617,895.77945 C 254.00588,892.92972 250.91617,891.15594 247.38763,890.44348 L 240.02597,890.44348 z M 163.24732,891.38221 L 163.24732,918.85257 C 163.2473,925.28514 165.41585,930.48601 169.76905,934.46522 C 173.80809,938.20508 178.81094,940.09761 184.69,940.09763 C 190.62886,940.09761 195.60633,938.20508 199.66036,934.46522 C 204.01351,930.48601 206.18205,925.28514 206.1821,918.85257 L 206.1821,891.38221 L 196.05364,891.38221 L 196.05364,917.96324 C 196.05359,921.46376 194.98134,924.31165 192.84218,926.51067 C 190.62814,928.78452 187.93618,929.91976 184.69,929.91976 C 181.56346,929.91978 178.85062,928.76957 176.63664,926.51067 C 174.43759,924.23686 173.37574,921.40394 173.37577,917.96324 L 173.37577,891.38221 L 163.24732,891.38221 z M 296.79475,899.18854 C 300.10075,899.18859 302.9876,900.11537 305.44099,901.95534 C 307.8195,903.84025 309.57113,906.58618 310.67815,910.20633 L 283.45483,910.20633 C 284.24766,906.72081 285.89275,904.01387 288.34613,902.05415 C 290.72466,900.15434 293.53358,899.18859 296.79475,899.18854 z"
+ style="font-size:58.13353348px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#a56941;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Emblem" />
+ <g
+ inkscape:export-ydpi="399.59854"
+ inkscape:export-xdpi="399.59854"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-logo-1200.png"
+ transform="matrix(0.347343,0,0,0.346901,34.203754,588.03773)"
+ id="g2691">
+ <path
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path2693"
+ d="M 60.321717,411.99998 L 437.33633,411.99998"
+ style="fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23953247;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
+ <path
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path2695"
+ d="M 252.61203,788.60332 L 252.61203,411.59154"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffdb6b;stroke-width:109.23950958;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
+ <path
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path2697"
+ d="M 252.86937,597.15755 L 629.88177,597.15755"
+ style="fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#69312f;stroke-width:109.23951721;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
+ <path
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path2699"
+ d="M 437.45588,596.97447 L 437.45588,219.95956"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#cc6633;stroke-width:109.23950195;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
+ <path
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path2701"
+ d="M 372.87905,411.27704 L 437.81346,411.27704"
+ style="fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23947906;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
+ </g>
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-size:18.13397598px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:end;line-height:100%;writing-mode:lr-tb;text-anchor:end;fill:#dd8a3d;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Emblem;-inkscape-font-specification:Emblem"
+ x="954.11047"
+ y="752.78009"
+ id="text2703"
+ sodipodi:linespacing="100%"><tspan
+ sodipodi:role="line"
+ x="954.11047"
+ y="752.78009"
+ id="tspan2709">a web infrastructure to encourage collaboration,</tspan><tspan
+ sodipodi:role="line"
+ x="954.11047"
+ y="770.91406"
+ id="tspan2727">content sharing & free culture</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:17.27686882px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:end;line-height:100%;writing-mode:lr-tb;text-anchor:end;fill:#dd8a3d;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Emblem;-inkscape-font-specification:Emblem"
+ x="620.35358"
+ y="901.5686"
+ id="text2729"
+ sodipodi:linespacing="100%"><tspan
+ sodipodi:role="line"
+ x="625.28021"
+ y="901.5686"
+ id="tspan2731">a web infrastructure </tspan><tspan
+ sodipodi:role="line"
+ x="620.35358"
+ y="918.84546"
+ id="tspan2735">to encourage collaboration,</tspan><tspan
+ sodipodi:role="line"
+ x="620.35358"
+ y="936.12231"
+ id="tspan2733">content sharing & free culture</tspan></text>
</g>
</svg>
Modified: trunk/script/generateBasicUIElements.sh
===================================================================
--- trunk/script/generateBasicUIElements.sh 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/script/generateBasicUIElements.sh 2009-03-30 13:48:35 UTC (rev 1089)
@@ -14,11 +14,11 @@
fi
# DO
-PACKAGE=`echo $DIR | cut -d "/" -f 4- | sed 's/\//\./g' | sed 's/\.$//g'
+PACKAGE=`echo $DIR | cut -d "/" -f 4- | sed 's/\//\./g' | sed 's/\.$//g'`
if [[ ! -d $DIR ]]
then
- mkdir $DIR
+ mkdir -p $DIR
fi
cat <<EOF > $DIR/${NAME}.java
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-30 13:48:35 UTC (rev 1089)
@@ -41,4 +41,4 @@
padding: 1px 0px 1px 1px;
text-decoration:none;
}
-*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}.k-specialchar-grid{border:1px solid #ACA899;}.k-specialchar-grid table{}.k-specialchar-grid div{line-height:22px;}.k-specialchar-grid td{padding:1px;}.k-specialchar-pb{border:1px solid #EBE8D7;cursor:pointer;font-size:108%!important;text-align:center;vertical-align:middle;width:18px;height:18px;}.k-specialchar-pb-up{}.k-specialchar-big{padding:3px;line-height:22px;font-size:153.899994%!important;}.k-specialchar-adv-label{margin-left:-10px;}.k-specialchar-popup{border:1px solid silver;z-index:9999!important;background-color:#FFF;}.k-specialchar-pb-down{color:#161616;}.k-specialchar-pb-up-hovering{border:thin solid #ACA899;}.k-specialchar-pb-down-hovering{color:#161616;}
\ No newline at end of file
+*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-film-icon{background-image:url(img/film.png)!important;}.k-specialchars-icon{background-image:url(img/specialchars.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}.k-specialchar-grid{border:1px solid #ACA899;}.k-specialchar-grid table{}.k-specialchar-grid div{line-height:22px;}.k-specialchar-grid td{padding:1px;}.k-specialchar-pb{border:1px solid #EBE8D7;cursor:pointer;font-size:108%!important;text-align:center;vertical-align:middle;width:18px;height:18px;}.k-specialchar-pb-up{}.k-specialchar-big{padding:3px;line-height:22px;font-size:153.899994%!important;}.k-specialchar-adv-label{margin-left:-10px;}.k-specialchar-popup,.k-rte-changelink-popup{border:1px solid silver;z-index:9999!important;background-color:#FFF;}.k-specialchar-pb-down{color:#161616;}.k-specialchar-pb-up-hovering{border:thin solid #ACA899;}.k-specialchar-pb-down-hovering{color:#161616;}.k-preview-panel{border:dashed 1px gray;}.k-rte-changelink{white-space:nowrap;color:navy;cursor:pointer;text-decoration:underline;margin:5px;}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/app/public/css/img/film.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/css/img/film.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/css/img/specialchars.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/css/img/specialchars.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-03-30 13:48:35 UTC (rev 1089)
@@ -841,6 +841,14 @@
background-image: url(img/picture.png) !important;
}
+.k-film-icon {
+ background-image: url(img/film.png) !important;
+}
+
+.k-specialchars-icon {
+ background-image: url(img/specialchars.png) !important;
+}
+
.k-info-icon {
background-image: url(img/info.gif) !important;
}
@@ -854,6 +862,7 @@
}
.x-toolbar-body table { /* width: 100%; */
+
}
.k-preview-msg {
@@ -904,6 +913,7 @@
}
.k-specialchar-pb-up {
+
}
.k-specialchar-big {
@@ -916,7 +926,7 @@
margin-left: -10px;
}
-.k-specialchar-popup {
+.k-specialchar-popup, {
border: 1px solid #C0C0C0;
z-index: 9999 !important;
background-color: #FFF;
@@ -932,4 +942,22 @@
.k-specialchar-pb-down-hovering {
color: #161616;
+}
+
+.k-preview-panel {
+ border: dashed 1px gray;
+}
+
+.k-rte-changelink {
+ white-space: nowrap;
+ color: navy;
+ cursor: pointer;
+ text-decoration: underline;
+ margin: 5px;
+}
+
+.k-rte-changelink-popup {
+ border: 1px solid #C0C0C0;
+ z-index: 9999 !important;
+ background-color: #ECECEC;
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -79,6 +79,7 @@
createNewContentAction(TYPE_DOCUMENT, "images/nav/page_add.png", i18n.t("New document"), parentMenuTitleCtx,
Position.ctx, TYPE_ROOT, TYPE_FOLDER);
+ createTranslateAction(parentMenuTitle, TYPE_DOCUMENT, TYPE_FOLDER);
createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
createEditAction(parentMenuTitle, TYPE_DOCUMENT);
createContentModeratedActions(parentMenuTitle, contentsModerated);
@@ -101,8 +102,6 @@
createGoHomeAction(containers);
- createTranslateAction(TYPE_DOCUMENT, TYPE_FOLDER);
-
createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
createShowDeletedItems(parentMenuTitleCtx, all);
Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionMenuItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionMenuItem.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionMenuItem.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,71 @@
+package org.ourproject.kune.platf.client.actions.toolbar;
+
+import org.ourproject.kune.platf.client.actions.ActionItem;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuCheckItemDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
+
+import com.calclab.suco.client.events.Listener0;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.CheckItem;
+import com.gwtext.client.widgets.menu.Item;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
+
+public class ActionMenuItem<T> {
+
+ Item item;
+
+ public ActionMenuItem(final ActionItem<T> actionItem, final String id, final Listener0 onclick) {
+ final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
+ if (action instanceof ActionToolbarMenuRadioDescriptor) {
+ CheckItem checkItem = new CheckItem();
+ ActionToolbarMenuRadioDescriptor<T> radioDescriptor = (ActionToolbarMenuRadioDescriptor<T>) action;
+ checkItem.setGroup(radioDescriptor.getGroup());
+ checkItem.setChecked(radioDescriptor.mustBeChecked());
+ item = checkItem;
+ } else if (action instanceof ActionToolbarMenuCheckItemDescriptor) {
+ CheckItem checkItem = new CheckItem();
+ ActionToolbarMenuCheckItemDescriptor<T> checkItemDescriptor = (ActionToolbarMenuCheckItemDescriptor<T>) action;
+ checkItem.setChecked(checkItemDescriptor.getMustBeChecked().mustBeChecked());
+ item = checkItem;
+ } else {
+ item = new Item();
+ }
+ item.setText(genMenuItemText(action));
+ BaseItemListenerAdapter clickListener = new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(final BaseItem item, final EventObject e) {
+ onclick.onEvent();
+ }
+ };
+ item.addListener(clickListener);
+ String iconCls = action.getIconCls();
+ String iconUrl = action.getIconUrl();
+ if (iconCls != null) {
+ item.setIconCls(iconCls);
+ }
+ if (iconUrl != null) {
+ item.setIcon(iconUrl);
+ }
+ item.setTitle(action.getToolTip());
+ if (id != null) {
+ item.setId(id);
+ }
+ }
+
+ public Item getItem() {
+ return item;
+ }
+
+ private String genMenuItemText(final ActionToolbarMenuDescriptor<T> action) {
+ // HorizontalPanel hp = new HorizontalPanel();
+ // Label title = new Label(action.getText());
+ // hp.add(title);
+ // hp.setCellWidth(title, "100%");
+ // hp.add(new Label(action.getShortcutToS(i 18n)));
+ // return hp.getElement().getInnerHTML();
+ return action.getText() + action.getShortcutToS();
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -26,9 +26,7 @@
import org.ourproject.kune.platf.client.actions.ActionManager;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuCheckItemDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.FlowToolbar;
@@ -38,15 +36,11 @@
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.ioc.Provider;
import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
import com.gwtext.client.core.Ext;
import com.gwtext.client.widgets.ToolbarButton;
-import com.gwtext.client.widgets.menu.BaseItem;
-import com.gwtext.client.widgets.menu.CheckItem;
import com.gwtext.client.widgets.menu.Item;
import com.gwtext.client.widgets.menu.Menu;
import com.gwtext.client.widgets.menu.MenuItem;
-import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
public class ActionToolbarPanel<T> implements ActionToolbarView<T> {
@@ -60,7 +54,7 @@
this(actionManagerProvider, false);
}
- public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider, boolean flow) {
+ public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider, final boolean flow) {
if (flow) {
toolbar = new FlowToolbar();
} else {
@@ -124,7 +118,7 @@
public void detach() {
}
- public int getLeftPosition(ActionDescriptor<T> action) {
+ public int getLeftPosition(final ActionDescriptor<T> action) {
final ToolbarButton button = findButton(action);
if (button != null) {
return button.getAbsoluteLeft();
@@ -136,7 +130,7 @@
return toolbar;
}
- public int getTopPosition(ActionDescriptor<T> action) {
+ public int getTopPosition(final ActionDescriptor<T> action) {
final ToolbarButton button = findButton(action);
if (button != null) {
return button.getAbsoluteTop();
@@ -167,7 +161,8 @@
toolbar.setNormalStyle();
}
- public void setParentMenuTitle(ActionToolbarPosition position, String origTitle, String origTooltip, String newTitle) {
+ public void setParentMenuTitle(final ActionToolbarPosition position, final String origTitle,
+ final String origTooltip, final String newTitle) {
final String menuKey = genMenuKey(position, origTitle, origTooltip, null, null);
ToolbarButton button = buttons.get(menuKey);
if (button != null) {
@@ -208,59 +203,27 @@
toolbar.add(widget);
}
- private void addFloatStyle(Widget widget) {
+ private void addFloatStyle(final Widget widget) {
if (toolbar instanceof FlowToolbar) {
widget.addStyleName("kune-floatleft");
}
}
- private void addSeparator(Menu menu, boolean separator) {
+ private void addSeparator(final Menu menu, final boolean separator) {
if (separator) {
menu.addSeparator();
}
}
private Item createToolbarMenu(final ActionToolbarPosition toolBarPos, final String menuTitle,
- final String menuTooltip, final String menuSubTitle, final ActionItem<T> actionItem, String id) {
+ final String menuTooltip, final String menuSubTitle, final ActionItem<T> actionItem, final String id) {
final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
- final Item item;
- if (action instanceof ActionToolbarMenuRadioDescriptor) {
- CheckItem checkItem = new CheckItem();
- ActionToolbarMenuRadioDescriptor<T> radioDescriptor = (ActionToolbarMenuRadioDescriptor<T>) action;
- checkItem.setGroup(radioDescriptor.getGroup());
- checkItem.setChecked(radioDescriptor.mustBeChecked());
- item = checkItem;
- } else if (action instanceof ActionToolbarMenuCheckItemDescriptor) {
- CheckItem checkItem = new CheckItem();
- ActionToolbarMenuCheckItemDescriptor<T> checkItemDescriptor = (ActionToolbarMenuCheckItemDescriptor<T>) action;
- checkItem.setChecked(checkItemDescriptor.getMustBeChecked().mustBeChecked());
- item = checkItem;
- } else {
- item = new Item();
- }
- item.setText(genMenuItemText(action));
- BaseItemListenerAdapter clickListener = new BaseItemListenerAdapter() {
- @Override
- public void onClick(BaseItem item, EventObject e) {
+
+ Item item = (new ActionMenuItem<T>(actionItem, id, new Listener0() {
+ public void onEvent() {
actionManagerProvider.get().doAction(actionItem);
}
- };
- item.addListener(clickListener);
- String iconCls = action.getIconCls();
- String iconUrl = action.getIconUrl();
- if (iconCls != null) {
- item.setIconCls(iconCls);
- }
- if (iconUrl != null) {
- item.setIcon(iconUrl);
- }
- // ToolTip tip = new ToolTip();
- // tip.setHtml(action.getToolTip());
- // tip.setShowDelay(5000);
- item.setTitle(action.getToolTip());
- if (id != null) {
- item.setId(id);
- }
+ })).getItem();
final String menuKey = genMenuKey(toolBarPos, menuTitle, menuTooltip, null, null);
final String subMenuKey = genMenuKey(toolBarPos, menuTitle, menuTooltip, menuSubTitle, null);
@@ -294,7 +257,7 @@
}
private Menu createToolbarMenu(final ActionToolbarPosition barPosition, final String iconUrl, final String iconCls,
- final String menuTitle, final String menuKey, final String menuTooltip, int position) {
+ final String menuTitle, final String menuKey, final String menuTooltip, final int position) {
final Menu menu = new Menu();
menu.setShadow(true);
final ToolbarButton toolbarMenu = new ToolbarButton(menuTitle);
@@ -330,16 +293,6 @@
return id;
}
- private String genMenuItemText(final ActionToolbarMenuDescriptor<T> action) {
- // HorizontalPanel hp = new HorizontalPanel();
- // Label title = new Label(action.getText());
- // hp.add(title);
- // hp.setCellWidth(title, "100%");
- // hp.add(new Label(action.getShortcutToS(i 18n)));
- // return hp.getElement().getInnerHTML();
- return action.getText() + action.getShortcutToS();
- }
-
private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuTooltip,
final String menuSubTitle, final String actionText) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -23,6 +23,7 @@
import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkGroup;
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharGroup;
@@ -36,6 +37,7 @@
registerDecorator(ToolGroup.class, new ToolGroup(container));
registerDecorator(EntityOptionsGroup.class, new EntityOptionsGroup(container));
registerDecorator(InsertImageGroup.class, new InsertImageGroup(container));
+ registerDecorator(InsertMediaGroup.class, new InsertMediaGroup(container));
registerDecorator(InsertLinkGroup.class, new InsertLinkGroup(container));
registerDecorator(InsertSpecialCharGroup.class, new InsertSpecialCharGroup(container));
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -73,6 +73,7 @@
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialogPanel;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialogPresenter;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
import org.ourproject.kune.platf.client.ui.rte.insertimg.ext.InsertImageExt;
import org.ourproject.kune.platf.client.ui.rte.insertimg.ext.InsertImageExtPanel;
import org.ourproject.kune.platf.client.ui.rte.insertimg.ext.InsertImageExtPresenter;
@@ -87,6 +88,13 @@
import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.InsertLinkExtPanel;
import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.InsertLinkExtPresenter;
import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.InsertLinkExtView;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaRegistry;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialogPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialogPresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertExtMedia;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertExtMediaPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertExtMediaPresenter;
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogPanel;
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogPresenter;
@@ -330,7 +338,7 @@
final RTEditorPresenter presenter = new RTEditorPresenter($(I18nTranslationService.class),
$(Session.class), topBar, sndBar, $(RTEImgResources.class), $$(InsertLinkDialog.class),
$$(ColorWebSafePalette.class), $$(EditHtmlDialog.class), $$(InsertImageDialog.class),
- $$(InsertTableDialog.class), $$(InsertSpecialCharDialog.class), $(DeferredCommandWrapper.class));
+ $$(InsertMediaDialog.class), $$(InsertTableDialog.class), $$(InsertSpecialCharDialog.class), $(DeferredCommandWrapper.class));
final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class),
$(ActionManager.class), $(GlobalShortcutRegister.class));
presenter.init(panel);
@@ -479,6 +487,32 @@
}
});
+ register(InsertMediaGroup.class, new Factory<InsertExtMedia>(InsertExtMedia.class) {
+ @Override
+ public InsertExtMedia create() {
+ final InsertExtMediaPresenter presenter = new InsertExtMediaPresenter($(InsertMediaDialog.class), $(ExternalMediaRegistry.class));
+ final InsertExtMediaPanel panel = new InsertExtMediaPanel(presenter, i18n, $(ExternalMediaRegistry.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<InsertMediaDialog>(InsertMediaDialog.class) {
+ @Override
+ public InsertMediaDialog create() {
+ final InsertMediaDialogPresenter presenter = new InsertMediaDialogPresenter();
+ final InsertMediaDialogPanel panel = new InsertMediaDialogPanel(presenter, i18n, $(Images.class), $(InsertMediaGroup.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<ExternalMediaRegistry>(ExternalMediaRegistry.class) {
+ @Override
+ public ExternalMediaRegistry create() {
+ return new ExternalMediaRegistry();
+ }});
+
$(ApplicationComponentGroup.class).createAll();
$(ToolGroup.class).createAll();
$(Application.class).start();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -26,11 +26,11 @@
private AbstractTabbedDialogView view;
- public void activateTab(int index) {
+ public void activateTab(final int index) {
view.activateTab(index);
}
- public void addTab(View tab) {
+ public void addTab(final View tab) {
view.addTab(tab);
}
@@ -46,19 +46,20 @@
view.hideMessages();
}
- public void init(AbstractTabbedDialogView view) {
+ public void init(final AbstractTabbedDialogView view) {
this.view = view;
}
- public void insertTab(int index, View tab) {
+ public void insertTab(final int index, final View tab) {
view.insertTab(index, tab);
}
- public void setErrorMessage(String message, Level level) {
+ public void setErrorMessage(final String message, final Level level) {
view.setErrorMessage(message, level);
}
public void show() {
+ hideMessages();
view.createAndShow();
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTELinkPopup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTELinkPopup.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTELinkPopup.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,48 @@
+package org.ourproject.kune.platf.client.ui.rte.basic;
+
+import org.ourproject.kune.platf.client.actions.ActionItem;
+
+import com.calclab.suco.client.events.Listener0;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.PopupPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class RTELinkPopup {
+ private final HorizontalPanel hp;
+ private PopupPanel popupPalette;
+
+ public RTELinkPopup() {
+ hp = new HorizontalPanel();
+ hp.setSpacing(5);
+ }
+
+ public void addAction(final ActionItem<Object> item, final Listener0 onClick) {
+ Label actionLabel = new Label();
+ actionLabel.setText(item.getAction().getText());
+ actionLabel.addStyleName("k-rte-changelink");
+ actionLabel.addClickListener(new ClickListener() {
+ public void onClick(final Widget arg0) {
+ onClick.onEvent();
+ }
+ });
+ hp.add(actionLabel);
+ }
+
+ public void hide() {
+ if (popupPalette != null) {
+ popupPalette.hide();
+ }
+ }
+
+ public void show(final int left, final int top) {
+ popupPalette = new PopupPanel(false, false);
+ popupPalette.addStyleName("k-rte-changelink-popup");
+ popupPalette.setVisible(false);
+ popupPalette.show();
+ popupPalette.setPopupPosition(left, top);
+ popupPalette.setWidget(hp);
+ popupPalette.setVisible(true);
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -13,6 +13,7 @@
public final ActionToolbarPosition topbarPosition = new ActionToolbarPosition("rte-topbar");
public final ActionToolbarPosition sndbarPosition = new ActionToolbarPosition("rte-sndbar");;
+ public final ActionToolbarPosition linkCtxPosition = new ActionToolbarPosition("rte-linkctx");;
void addAction(ActionDescriptor<Object> action);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -28,8 +28,11 @@
import org.xwiki.gwt.dom.client.Range;
import org.xwiki.gwt.dom.client.Selection;
+import com.calclab.suco.client.events.Listener0;
import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.FocusListener;
import com.google.gwt.user.client.ui.Widget;
@@ -38,11 +41,11 @@
private class EventListener implements FocusListener {
- public void onFocus(Widget sender) {
+ public void onFocus(final Widget sender) {
presenter.onEditorFocus();
}
- public void onLostFocus(Widget sender) {
+ public void onLostFocus(final Widget sender) {
}
}
private final I18nUITranslationService i18n;
@@ -52,9 +55,10 @@
private final ActionManager actionManager;
private final ShortcutRegister shortcutRegister;
private final GlobalShortcutRegister globalShortcutReg;
+ private final RTELinkPopup linkCtxMenu;
- public RTEditorPanel(final RTEditorPresenter presenter, I18nUITranslationService i18n,
- final ActionManager actionManager, GlobalShortcutRegister globalShortcutReg) {
+ public RTEditorPanel(final RTEditorPresenter presenter, final I18nUITranslationService i18n,
+ final ActionManager actionManager, final GlobalShortcutRegister globalShortcutReg) {
this.presenter = presenter;
this.i18n = i18n;
this.actionManager = actionManager;
@@ -66,10 +70,10 @@
addFocusListener(listener);
setWidth("96%");
setHeight("100%");
-
+ linkCtxMenu = new RTELinkPopup();
}
- public void addActions(ActionItemCollection<Object> actionItems) {
+ public void addActions(final ActionItemCollection<Object> actionItems) {
for (ActionItem<Object> actionItem : actionItems) {
ActionDescriptor<Object> action = actionItem.getAction();
if (action.hasShortcut() && action.mustBeAdded(null)) {
@@ -79,7 +83,15 @@
}
}
- public void adjustSize(int height) {
+ public void addCtxAction(final ActionItem<Object> actionItem) {
+ linkCtxMenu.addAction(actionItem, new Listener0() {
+ public void onEvent() {
+ actionManager.doAction(actionItem);
+ }
+ });
+ }
+
+ public void adjustSize(final int height) {
setHeight("" + height);
}
@@ -95,7 +107,7 @@
extended.copy();
}
- public void createLink(String url) {
+ public void createLink(final String url) {
extended.createLink(url);
}
@@ -141,6 +153,10 @@
return getFstRange().cloneContents().getInnerText();
}
+ public void hideLinkCtxMenu() {
+ linkCtxMenu.hide();
+ }
+
public void insertBlockquote() {
DocumentFragment extracted = getFstRange().cloneContents();
// delete();
@@ -148,18 +164,18 @@
focus();
}
- public void insertComment(String author) {
+ public void insertComment(final String author) {
String comment = null;
createCommentAndSelectIt(author, comment);
}
- public void insertCommentNotUsingSelection(String author) {
+ public void insertCommentNotUsingSelection(final String author) {
getFstRange().collapse(false);
createCommentAndSelectIt(author, null);
focus();
}
- public void insertCommentUsingSelection(String author) {
+ public void insertCommentUsingSelection(final String author) {
DocumentFragment extracted = getFstRange().cloneContents();
extended.delete();
String comment = extracted.getInnerText();
@@ -171,11 +187,11 @@
extended.insertHorizontalRule();
}
- public void insertHtml(String html) {
+ public void insertHtml(final String html) {
extended.insertHtml(html);
}
- public void insertImage(String url) {
+ public void insertImage(final String url) {
extended.insertImage(url);
}
@@ -203,6 +219,14 @@
return basic.isItalic();
}
+ public boolean isLink() {
+ if (LinkExecutableUtils.getSelectedAnchor(this) != null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
public boolean isStrikethrough() {
return extended.isStrikethrough();
}
@@ -237,7 +261,7 @@
@SuppressWarnings("unchecked")
@Override
- public void onBrowserEvent(Event event) {
+ public void onBrowserEvent(final Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONCLICK:
updateStatus();
@@ -256,6 +280,7 @@
} else {
super.onBrowserEvent(event);
updateStatus();
+ updateLinkInfo();
if (isAnEditionKey(event.getKeyCode())) {
fireEdit();
}
@@ -288,22 +313,33 @@
basic.selectAll();
}
- public void setBackColor(String color) {
+ public void setBackColor(final String color) {
basic.setBackColor(color);
}
- public void setFontName(String name) {
+ public void setFontName(final String name) {
basic.setFontName(name);
}
- public void setFontSize(FontSize size) {
+ public void setFontSize(final FontSize size) {
basic.setFontSize(size);
}
- public void setForeColor(String color) {
+ public void setForeColor(final String color) {
basic.setForeColor(color);
}
+ public void showLinkCtxMenu() {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ org.xwiki.gwt.dom.client.Element selectedAnchor = LinkExecutableUtils.getSelectedAnchor(RTEditorPanel.this);
+ linkCtxMenu.show(RTEditorPanel.this.getAbsoluteLeft() + selectedAnchor.getAbsoluteLeft(),
+ RTEditorPanel.this.getAbsoluteTop() + selectedAnchor.getAbsoluteTop() + 20);
+ }
+ });
+
+ }
+
public void toggleBold() {
basic.toggleBold();
}
@@ -340,7 +376,7 @@
presenter.fireOnEdit();
}
- private void createCommentAndSelectIt(String author, String comment) {
+ private void createCommentAndSelectIt(final String author, final String comment) {
Element commentEl = createCommentElement(author, comment);
Range innerCommentRange = getDocument().createRange();
getFstRange().insertNode(commentEl);
@@ -349,7 +385,7 @@
fireEdit();
}
- private Element createCommentElement(String userName, String insertComment) {
+ private Element createCommentElement(final String userName, final String insertComment) {
String time = i18n.formatDateWithLocale(new Date(), true);
Element span = getDocument().createSpanElement();
String comment = insertComment != null ? insertComment : i18n.t("type your comment here");
@@ -367,7 +403,7 @@
return getDocument().getSelection();
}
- private boolean isAnEditionKey(int keyCode) {
+ private boolean isAnEditionKey(final int keyCode) {
if (keyCode != KEY_HOME && keyCode != KEY_END && keyCode != KEY_UP && keyCode != KEY_DOWN
&& keyCode != KEY_LEFT && keyCode != KEY_RIGHT && keyCode != KEY_PAGEDOWN && keyCode != KEY_PAGEUP
&& keyCode != KEY_ESCAPE) {
@@ -377,6 +413,10 @@
}
}
+ private void updateLinkInfo() {
+ presenter.updateLinkInfo();
+ }
+
/**
* Updates the status of all the stateful buttons.
*/
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -16,7 +16,6 @@
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
@@ -26,6 +25,7 @@
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
@@ -75,17 +75,19 @@
private Listener<String> insertTableListener;
private Listener<LinkInfo> insertLinkListener;
private Listener<ImageInfo> insertImageListener;
+ private Listener<String> insertMediaListener;
private Listener<String> updateHtmlListener;
private ActionToolbarButtonDescriptor<Object> insertTableBtn;
private final Provider<InsertSpecialCharDialog> insertSpecialCharDialog;
protected Listener<String> insertSpecialCharListener;
+ private final Provider<InsertMediaDialog> insertMediaDialog;
- public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
- RTEActionSndToolbar sndBar, RTEImgResources imgResources,
- Provider<InsertLinkDialog> textEditorInsertElement, Provider<ColorWebSafePalette> palette,
- Provider<EditHtmlDialog> editHtmlDialog, Provider<InsertImageDialog> insertImageDialog,
- Provider<InsertTableDialog> insertTableDialog, Provider<InsertSpecialCharDialog> insertSpecialCharDialog,
- DeferredCommandWrapper deferred) {
+ public RTEditorPresenter(final I18nTranslationService i18n, final Session session,
+ final RTEActionTopToolbar topBar, final RTEActionSndToolbar sndBar, final RTEImgResources imgResources,
+ final Provider<InsertLinkDialog> textEditorInsertElement, final Provider<ColorWebSafePalette> palette,
+ final Provider<EditHtmlDialog> editHtmlDialog, final Provider<InsertImageDialog> insertImageDialog,
+ final Provider<InsertMediaDialog> insertMediaDialog, final Provider<InsertTableDialog> insertTableDialog,
+ final Provider<InsertSpecialCharDialog> insertSpecialCharDialog, final DeferredCommandWrapper deferred) {
this.i18n = i18n;
this.session = session;
this.topBar = topBar;
@@ -94,6 +96,7 @@
this.palette = palette;
this.editHtmlDialog = editHtmlDialog;
this.insertImageDialog = insertImageDialog;
+ this.insertMediaDialog = insertMediaDialog;
this.insertTableDialog = insertTableDialog;
this.insertSpecialCharDialog = insertSpecialCharDialog;
this.deferred = deferred;
@@ -105,22 +108,22 @@
actions = new ActionItemCollection<Object>();
this.onEdit = new Event0("onRTEEdit");
canBeBasic = new ActionAddCondition<Object>() {
- public boolean mustBeAdded(Object param) {
+ public boolean mustBeAdded(final Object param) {
return view.canBeBasic();
}
};
canBeExtended = new ActionAddCondition<Object>() {
- public boolean mustBeAdded(Object param) {
+ public boolean mustBeAdded(final Object param) {
return isExtended();
}
};
}
- public void addAction(ActionDescriptor<Object> action) {
+ public void addAction(final ActionDescriptor<Object> action) {
actions.add(withNoItem(action));
}
- public void addActions(ActionCollection<Object> actioncollection) {
+ public void addActions(final ActionCollection<Object> actioncollection) {
actions.addAll(withNoItem(actioncollection));
}
@@ -177,7 +180,7 @@
return topBar;
}
- public void init(RTEditorView view) {
+ public void init(final RTEditorView view) {
this.view = view;
createBasicActions();
}
@@ -188,24 +191,32 @@
palette.get().hide();
}
- public void setExtended(boolean extended) {
+ public void setExtended(final boolean extended) {
this.extended = extended;
}
- public void setFocus(boolean focus) {
+ public void setFocus(final boolean focus) {
view.setFocus(focus);
}
- public void setHtml(String html) {
+ public void setHtml(final String html) {
view.setHTML(html);
view.focus();
}
- public void setText(String text) {
+ public void setText(final String text) {
view.setText(text);
view.focus();
}
+ public void updateLinkInfo() {
+ if (isExtended() && view.isLink()) {
+ view.showLinkCtxMenu();
+ } else {
+ view.hideLinkCtxMenu();
+ }
+ }
+
public void updateStatus() {
if (view.canBeBasic()) {
sndBar.setPushButtonPressed(bold, view.isBold());
@@ -424,7 +435,7 @@
public void onEvent() {
if (updateHtmlListener == null) {
updateHtmlListener = new Listener<String>() {
- public void onEvent(String html) {
+ public void onEvent(final String html) {
view.setHTML(html);
fireOnEdit();
}
@@ -474,7 +485,7 @@
}
});
comment.setEnableCondition(new ActionEnableCondition<Object>() {
- public boolean mustBeEnabled(Object param) {
+ public boolean mustBeEnabled(final Object param) {
return session.isLogged();
}
});
@@ -587,7 +598,7 @@
public void onEvent() {
if (insertImageListener == null) {
insertImageListener = new Listener<ImageInfo>() {
- public void onEvent(ImageInfo imageInfo) {
+ public void onEvent(final ImageInfo imageInfo) {
String img = imageInfo.toString();
Log.debug("Image: " + imageInfo);
view.focus();
@@ -597,9 +608,7 @@
};
}
InsertImageDialog dialog = insertImageDialog.get();
- dialog.setImageInfo(new ImageInfo("", ImageInfo.DEF_WRAP_VALUE,
- ImageInfo.DEF_CLICK_ORIGINAL_VALUE, ImageInfo.POSITION_LEFT,
- ImageInfo.SIZE_ORIGINAL));
+ dialog.reset();
dialog.setOnCreateImage(insertImageListener);
dialog.show();
}
@@ -616,34 +625,64 @@
imgMenu.setParentMenuTitle(i18n.t(INSERT_MENU));
imgMenu.setActionPosition(topbarPosition);
+ final ActionToolbarMenuDescriptor<Object> insertMedia = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ topbarPosition, new Listener0() {
+ public void onEvent() {
+ deferred.addCommand(new Listener0() {
+ public void onEvent() {
+ if (insertMediaListener == null) {
+ insertMediaListener = new Listener<String>() {
+ public void onEvent(final String html) {
+ Log.debug("Media: " + html);
+ view.focus();
+ view.insertHtml(html);
+ fireOnEdit();
+ }
+ };
+ }
+ InsertMediaDialog dialog = insertMediaDialog.get();
+ dialog.setOnCreate(insertMediaListener);
+ dialog.show();
+ }
+ });
+ }
+ });
+ insertMedia.setIconCls(getCssName(imgResources.film()));
+ insertMedia.setTextDescription(i18n.t("Audio/Video..."));
+ insertMedia.setAddCondition(canBeExtended);
+ insertMedia.setParentMenuTitle(i18n.t(INSERT_MENU));
+
ActionToolbarButtonDescriptor<Object> createOrEditLinkBtn = new ActionToolbarButtonDescriptor<Object>(
accessRol, sndbarPosition, new Listener0() {
public void onEvent() {
- if (insertLinkListener == null) {
- insertLinkListener = new Listener<LinkInfo>() {
- public void onEvent(LinkInfo linkInfo) {
- String link = linkInfo.toString();
- Log.debug("Link: " + link);
- view.focus();
- view.insertHtml(link);
- fireOnEdit();
+ deferred.addCommand(new Listener0() {
+ public void onEvent() {
+ if (insertLinkListener == null) {
+ insertLinkListener = new Listener<LinkInfo>() {
+ public void onEvent(final LinkInfo linkInfo) {
+ String link = linkInfo.toString();
+ Log.debug("Link: " + link);
+ view.focus();
+ view.insertHtml(link);
+ fireOnEdit();
+ }
+ };
}
- };
- }
- LinkInfo linkInfo = view.getLinkInfoIfHref();
- InsertLinkDialog dialog = insertLinkDialog.get();
- dialog.setLinkInfo(linkInfo);
- dialog.setOnCreateLink(insertLinkListener);
- dialog.show();
- String href = linkInfo.getHref();
- if (href.length() > 0) {
- if (href.startsWith("mailto")) {
- dialog.activateTab(2);
- } else {
- dialog.activateTab(1);
+ LinkInfo linkInfo = view.getLinkInfoIfHref();
+ InsertLinkDialog dialog = insertLinkDialog.get();
+ dialog.setLinkInfo(linkInfo);
+ dialog.setOnCreateLink(insertLinkListener);
+ dialog.show();
+ String href = linkInfo.getHref();
+ if (href.length() > 0) {
+ if (href.startsWith("mailto")) {
+ dialog.activateTab(2);
+ } else {
+ dialog.activateTab(1);
+ }
+ }
}
- }
-
+ });
}
});
createOrEditLinkBtn.setIconCls(getCssName(imgResources.link()));
@@ -659,6 +698,13 @@
createOrEditLink.setActionPosition(topbarPosition);
createOrEditLink.setParentMenuTitle(i18n.t(INSERT_MENU));
+ ActionToolbarMenuDescriptor<Object> editLinkCtx = new ActionToolbarMenuDescriptor<Object>(createOrEditLink);
+ editLinkCtx.setTextDescription(i18n.t("Change"));
+ editLinkCtx.setToolTip(null);
+ editLinkCtx.setShortcut(null);
+ editLinkCtx.setActionPosition(linkCtxPosition);
+ editLinkCtx.setParentMenuTitle(i18n.t(INSERT_MENU));
+
ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
sndbarPosition, new Listener0() {
public void onEvent() {
@@ -671,6 +717,13 @@
removeLink.setShortcut(new ShortcutDescriptor(true, true, 'K'));
removeLink.setAddCondition(canBeExtended);
+ ActionToolbarMenuDescriptor<Object> removeLinkCtx = new ActionToolbarMenuDescriptor<Object>(removeLink);
+ removeLinkCtx.setTextDescription(i18n.t("Remove"));
+ removeLinkCtx.setToolTip(null);
+ removeLinkCtx.setShortcut(null);
+ removeLinkCtx.setActionPosition(linkCtxPosition);
+ removeLinkCtx.setParentMenuTitle(i18n.t(INSERT_MENU));
+
final ActionToolbarMenuDescriptor<Object> removeFormat = new ActionToolbarMenuDescriptor<Object>(accessRol,
topbarPosition, new Listener0() {
public void onEvent() {
@@ -704,7 +757,7 @@
NotifyUser.showProgressLoading();
if (insertSpecialCharListener == null) {
insertSpecialCharListener = new Listener<String>() {
- public void onEvent(String character) {
+ public void onEvent(final String character) {
view.insertHtml(character);
}
};
@@ -720,17 +773,6 @@
insertSpecialChar.setParentMenuTitle(i18n.t(INSERT_MENU));
insertSpecialChar.setTopSeparator(true);
- final ActionToolbarMenuDescriptor<Object> insertMedia = new ActionToolbarMenuDescriptor<Object>(accessRol,
- topbarPosition, new Listener0() {
- public void onEvent() {
- NotifyUser.info(TextUtils.IN_DEVELOPMENT);
- }
- });
- insertMedia.setIconCls(getCssName(imgResources.film()));
- insertMedia.setTextDescription(i18n.t("Media..."));
- insertMedia.setAddCondition(canBeExtended);
- insertMedia.setParentMenuTitle(i18n.t(INSERT_MENU));
-
final ActionToolbarMenuDescriptor<Object> insertTable = new ActionToolbarMenuDescriptor<Object>(accessRol,
topbarPosition, new Listener0() {
public void onEvent() {
@@ -757,7 +799,7 @@
public void onEvent() {
palette.get().show(getActionLeftPosition(sndBar, insertTableBtn),
getActionTopPosition(sndBar, removeFormatBtn), new Listener<String>() {
- public void onEvent(String color) {
+ public void onEvent(final String color) {
palette.get().hide();
view.setForeColor(color);
fireOnEdit();
@@ -774,7 +816,7 @@
public void onEvent() {
palette.get().show(getActionLeftPosition(sndBar, fontColor),
getActionTopPosition(sndBar, fontColor), new Listener<String>() {
- public void onEvent(String color) {
+ public void onEvent(final String color) {
palette.get().hide();
view.setBackColor(color);
fireOnEdit();
@@ -853,9 +895,12 @@
}
actions.add(withNoItem(fontColor));
actions.add(withNoItem(backgroundColor));
+
+ view.addCtxAction(withNoItem(editLinkCtx));
+ view.addCtxAction(withNoItem(removeLinkCtx));
}
- private ActionToolbarMenuDescriptor<Object> createFontNameAction(ActionAddCondition<Object> canBeBasic,
+ private ActionToolbarMenuDescriptor<Object> createFontNameAction(final ActionAddCondition<Object> canBeBasic,
final String fontName) {
final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol,
sndbarPosition, new Listener0() {
@@ -871,8 +916,8 @@
return font;
}
- private ActionToolbarMenuDescriptor<Object> createFontSizeAction(ActionAddCondition<Object> canBeBasic,
- final int fontSize, String fontSizeName) {
+ private ActionToolbarMenuDescriptor<Object> createFontSizeAction(final ActionAddCondition<Object> canBeBasic,
+ final int fontSize, final String fontSizeName) {
final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol,
sndbarPosition, new Listener0() {
public void onEvent() {
@@ -888,15 +933,16 @@
return font;
}
- private int getActionLeftPosition(ActionToolbar<Object> bar, ActionToolbarButtonDescriptor<Object> action) {
+ private int getActionLeftPosition(final ActionToolbar<Object> bar,
+ final ActionToolbarButtonDescriptor<Object> action) {
return bar.getLeftPosition(action);
}
- private int getActionTopPosition(ActionToolbar<Object> bar, ActionToolbarButtonDescriptor<Object> action) {
+ private int getActionTopPosition(final ActionToolbar<Object> bar, final ActionToolbarButtonDescriptor<Object> action) {
return bar.getTopPosition(action);
}
- private String getCssName(ImageResource imageResource) {
+ private String getCssName(final ImageResource imageResource) {
return RTEImgResources.SUFFIX + imageResource.getName();
}
@@ -906,7 +952,7 @@
private ActionEnableCondition<Object> isInsertHtmlSupported() {
return new ActionEnableCondition<Object>() {
- public boolean mustBeEnabled(Object param) {
+ public boolean mustBeEnabled(final Object param) {
return true;
}
};
@@ -915,9 +961,8 @@
private void onInsertTablePressed() {
if (insertTableListener == null) {
insertTableListener = new Listener<String>() {
- public void onEvent(String table) {
+ public void onEvent(final String table) {
if (view.isAnythingSelected()) {
- // FIXME
// move to end of selection?
}
view.insertHtml(table);
@@ -929,11 +974,11 @@
insertTableDialog.get().show();
}
- private void styleToolbar(ActionToolbar<Object> bar) {
+ private void styleToolbar(final ActionToolbar<Object> bar) {
bar.setNormalStyle();
}
- private ActionItemCollection<Object> withNoItem(ActionCollection<Object> actions) {
+ private ActionItemCollection<Object> withNoItem(final ActionCollection<Object> actions) {
ActionItemCollection<Object> collection = new ActionItemCollection<Object>();
for (ActionDescriptor<Object> action : actions) {
// this action don't have a associated item
@@ -942,7 +987,7 @@
return collection;
}
- private ActionItem<Object> withNoItem(ActionDescriptor<Object> action) {
+ private ActionItem<Object> withNoItem(final ActionDescriptor<Object> action) {
return new ActionItem<Object>(action, null);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -1,6 +1,7 @@
package org.ourproject.kune.platf.client.ui.rte.basic;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.ActionItem;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.FontSize;
import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
@@ -9,6 +10,8 @@
void addActions(ActionItemCollection<Object> actions);
+ void addCtxAction(ActionItem<Object> actionItem);
+
void adjustSize(int height);
boolean canBeBasic();
@@ -35,6 +38,8 @@
String getText();
+ void hideLinkCtxMenu();
+
void insertBlockquote();
void insertComment(String author);
@@ -61,6 +66,8 @@
boolean isItalic();
+ boolean isLink();
+
boolean isStrikethrough();
boolean isSubscript();
@@ -101,6 +108,8 @@
void setText(String text);
+ void showLinkCtxMenu();
+
void toggleBold();
void toggleItalic();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -39,7 +39,8 @@
private String position;
private String size;
- public ImageInfo(String src, boolean wraptext, boolean clickOriginal, String position, String size) {
+ public ImageInfo(final String src, final boolean wraptext, final boolean clickOriginal, final String position,
+ final String size) {
this.src = src;
this.wraptext = wraptext;
this.clickOriginal = clickOriginal;
@@ -80,23 +81,23 @@
return wraptext;
}
- public void setClickOriginal(boolean clickOriginal) {
+ public void setClickOriginal(final boolean clickOriginal) {
this.clickOriginal = clickOriginal;
}
- public void setPosition(String position) {
+ public void setPosition(final String position) {
this.position = position;
}
- public void setSize(String size) {
+ public void setSize(final String size) {
this.size = size;
}
- public void setSrc(String src) {
+ public void setSrc(final String src) {
this.src = src;
}
- public void setWraptext(boolean wraptext) {
+ public void setWraptext(final boolean wraptext) {
this.wraptext = wraptext;
}
@@ -123,7 +124,7 @@
private String getStyleSize() {
for (String[] current : sizes) {
- if (current[1].equals(size)) {
+ if (current[0].equals(size)) {
return current[2];
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -11,12 +11,8 @@
ImageInfo getImageInfo();
- void setImageInfo(ImageInfo imageInfo);
+ void reset();
- void setImagePosition(String position);
-
- void setImageSize(String size);
-
void setOnCreateImage(Listener<ImageInfo> listener);
void setOnInsertImagePressed(Listener0 onInsertLinkPressed);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -11,7 +11,11 @@
private ImageInfo imageInfo;
private Listener0 onInsertPressed;
- public void fireOnInsertImage(ImageInfo imageInfo) {
+ public InsertImageDialogPresenter() {
+ initImageInfo();
+ }
+
+ public void fireOnInsertImage(final ImageInfo imageInfo) {
onCreateListener.onEvent(imageInfo);
super.hide();
}
@@ -20,23 +24,15 @@
return imageInfo;
}
- public void setImageInfo(ImageInfo imageInfo) {
- this.imageInfo = imageInfo;
+ public void reset() {
+ initImageInfo();
}
- public void setImagePosition(String position) {
- imageInfo.setPosition(position);
- }
-
- public void setImageSize(String size) {
- imageInfo.setSize(size);
- }
-
- public void setOnCreateImage(Listener<ImageInfo> listener) {
+ public void setOnCreateImage(final Listener<ImageInfo> listener) {
onCreateListener = listener;
}
- public void setOnInsertImagePressed(Listener0 onInsertPressed) {
+ public void setOnInsertImagePressed(final Listener0 onInsertPressed) {
this.onInsertPressed = onInsertPressed;
}
@@ -47,4 +43,9 @@
protected void onInsert() {
onInsertPressed.onEvent();
}
+
+ private void initImageInfo() {
+ imageInfo = new ImageInfo("", ImageInfo.DEF_WRAP_VALUE, ImageInfo.DEF_CLICK_ORIGINAL_VALUE,
+ ImageInfo.POSITION_LEFT, ImageInfo.SIZE_ORIGINAL);
+ }
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,27 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
+
+import com.calclab.suco.client.ioc.Container;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.ioc.decorator.ProviderCollection;
+import com.calclab.suco.client.ioc.decorator.Singleton;
+
+public class InsertMediaGroup extends ProviderCollection {
+
+ public InsertMediaGroup(final Container container) {
+ super(container, Singleton.instance);
+ }
+
+ public void createAll() {
+ for (final Provider<?> p : getProviders()) {
+ p.get();
+ }
+ }
+
+ public void resetAll() {
+ for (final Provider<?> p : getProviders()) {
+ ((InsertMediaAbstract) p.get()).reset();
+ }
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -13,6 +13,8 @@
import com.gwtext.client.widgets.form.Checkbox;
import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.FieldSet;
+import com.gwtext.client.widgets.form.Label;
+import com.gwtext.client.widgets.form.event.CheckboxListenerAdapter;
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
import com.gwtext.client.widgets.form.event.FormPanelListenerAdapter;
@@ -24,12 +26,16 @@
private final ComboBox positionCombo;
protected final Checkbox wrapText;
protected final Checkbox clickOriginal;
+ private final Label intro;
- public InsertImageAbstractPanel(String title, final InsertImageAbstractPresenter presenter) {
+ public InsertImageAbstractPanel(final String title, final InsertImageAbstractPresenter presenter) {
super(title);
super.setAutoWidth(true);
super.setHeight(InsertImageDialogView.HEIGHT);
+ super.getFormPanel().setLabelWidth(DEF_FIELD_LABEL_WITH + 20);
+ intro = new Label();
+
final Store storeSizes = new SimpleStore(new String[] { "abbr", "trans", "size" }, getSizes());
storeSizes.load();
@@ -46,34 +52,60 @@
clickOriginal.setChecked(ImageInfo.DEF_CLICK_ORIGINAL_VALUE);
clickOriginal.setWidth(DEF_FIELD_WIDTH);
+ sizeCombo.addListener(new ComboBoxListenerAdapter() {
+ @Override
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+ String size = record.getAsString("abbr");
+ presenter.setSize(size);
+ }
+ });
+
positionCombo.addListener(new ComboBoxListenerAdapter() {
@Override
- public void onSelect(ComboBox comboBox, Record record, int index) {
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
String pos = record.getAsString("abbr");
+ presenter.setPosition(pos);
setWrapVisible(pos);
}
});
super.addListener(new FormPanelListenerAdapter() {
@Override
- public void onActivate(Panel panel) {
+ public void onActivate(final Panel panel) {
ImageInfo linkImage = presenter.getImageInfo();
updateValues(linkImage);
presenter.onActivate();
}
});
+ clickOriginal.addListener(new CheckboxListenerAdapter() {
+ @Override
+ public void onCheck(final Checkbox field, final boolean checked) {
+ presenter.onClickOriginalChecked(checked);
+ }
+ });
+
+ wrapText.addListener(new CheckboxListenerAdapter() {
+ @Override
+ public void onCheck(final Checkbox field, final boolean checked) {
+ presenter.onWrapTextChecked(checked);
+ }
+ });
+
FieldSet advanced = new FieldSet(Resources.i18n.t("More options"));
advanced.setCollapsible(true);
advanced.setCollapsed(true);
advanced.setAutoHeight(true);
advanced.setAutoWidth(true);
advanced.setAutoScroll(false);
+ advanced.addClass("kune-Margin-Large-t");
+ // advanced.setPaddings(10, 0, 0, 0);
advanced.add(sizeCombo);
advanced.add(positionCombo);
advanced.add(wrapText);
advanced.add(clickOriginal);
+ add(intro);
add(advanced);
}
@@ -98,11 +130,15 @@
}
@Override
- public void insert(int index, Component component) {
+ public void insert(final int index, final Component component) {
super.insert(index, component);
}
- protected void updateValues(ImageInfo imageInfo) {
+ public void setIntro(final String text) {
+ intro.setHtml(text);
+ }
+
+ protected void updateValues(final ImageInfo imageInfo) {
sizeCombo.setValue(imageInfo.getSize());
String position = imageInfo.getPosition();
positionCombo.setValue(position);
@@ -111,7 +147,7 @@
setWrapVisible(position);
}
- private ComboBox createCombo(final Store storeSizes, String title) {
+ private ComboBox createCombo(final Store storeSizes, final String title) {
ComboBox cb = new ComboBox();
cb.setEditable(false);
cb.setForceSelection(true);
@@ -119,6 +155,7 @@
cb.setFieldLabel(title);
cb.setStore(storeSizes);
cb.setDisplayField("trans");
+ cb.setValueField("abbr");
cb.setMode(ComboBox.LOCAL);
cb.setTriggerAction(ComboBox.ALL);
cb.setTypeAhead(true);
@@ -158,7 +195,7 @@
return sizesObjs;
}
- private void setWrapVisible(String position) {
+ private void setWrapVisible(final String position) {
if (position.equals(ImageInfo.POSITION_CENTER)) {
wrapText.setVisible(false);
} else {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -12,6 +12,7 @@
protected InsertImageAbstractView view;
protected final InsertImageDialog insertImageDialog;
private final Listener0 onInsertImagePressed;
+ protected ImageInfo imageInfo;
public InsertImageAbstractPresenter(final InsertImageDialog insertImageDialog) {
this.insertImageDialog = insertImageDialog;
@@ -35,7 +36,7 @@
return view;
}
- public void init(InsertImageAbstractView view) {
+ public void init(final InsertImageAbstractView view) {
this.view = view;
insertImageDialog.addTab(view);
}
@@ -48,23 +49,39 @@
insertImageDialog.setOnInsertImagePressed(onInsertImagePressed);
}
- public void onInsert(ImageInfo linkInfo) {
+ public void onClickOriginalChecked(final boolean checked) {
+ insertImageDialog.getImageInfo().setClickOriginal(checked);
+ }
+
+ public void onInsert(final ImageInfo linkInfo) {
insertImageDialog.fireOnInsertImage(linkInfo);
reset();
}
- public void onPositionFieldChanged(String position) {
- insertImageDialog.setImagePosition(position);
+ public void onPositionFieldChanged(final String position) {
+ insertImageDialog.getImageInfo().setPosition(position);
}
- public void onSizeFieldChanged(String size) {
- insertImageDialog.setImageSize(size);
+ public void onSizeFieldChanged(final String size) {
+ insertImageDialog.getImageInfo().setSize(size);
}
+ public void onWrapTextChecked(final boolean checked) {
+ insertImageDialog.getImageInfo().setWraptext(checked);
+ }
+
public void reset() {
view.reset();
}
+ public void setPosition(final String position) {
+ insertImageDialog.getImageInfo().setPosition(position);
+ }
+
+ public void setSize(final String size) {
+ insertImageDialog.getImageInfo().setSize(size);
+ }
+
protected ImageInfo updateImageInfo() {
return new ImageInfo(view.getSrc(), view.getWrapText(), view.getClickOriginal(), view.getPosition(),
view.getSize());
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -12,9 +12,10 @@
String getSrc();
+ boolean getWrapText();
+
boolean isValid();
void reset();
- boolean getWrapText();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -4,11 +4,14 @@
import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractPanel;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.Label;
+import com.gwtext.client.core.EventCallback;
import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.PaddedPanel;
import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.layout.FitLayout;
@@ -17,9 +20,12 @@
private static final String LINK_FIELD = "iiep-img-field";
private final TextField srcField;
private final Panel previewPanel;
+ private final InsertImageExtPresenter presenter;
+ private final Label previewLabel;
- public InsertImageExtPanel(final InsertImageExtPresenter presenter, I18nTranslationService i18n) {
- super(i18n.t("External image"), presenter);
+ public InsertImageExtPanel(final InsertImageExtPresenter presenter, final I18nTranslationService i18n) {
+ super(i18n.t("External"), presenter);
+ this.presenter = presenter;
srcField = new TextField();
srcField.setTabIndex(1);
@@ -34,22 +40,54 @@
srcField.setValidationEvent(false);
srcField.setId(LINK_FIELD);
insert(0, srcField);
+
previewPanel = new Panel();
previewPanel.setLayout(new FitLayout());
- previewPanel.setHeight(125);
+ previewPanel.setHeight(75);
+
add(new PaddedPanel(previewPanel, 0));
- Button preview = new Button(i18n.t("Preview"));
- preview.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(Button button, EventObject e) {
- // presenter.onPreview();
+
+ srcField.addKeyPressListener(new EventCallback() {
+ public void execute(final EventObject e) {
+ refreshPreview();
}
});
- addButton(preview);
+
+ previewLabel = new Label(i18n.t("Image preview will be displayed here."));
+ // previewLabel.setStyleName("kune-Margin-20-trbl");
+ previewLabel.addStyleName("k-preview-panel");
+ previewReset();
}
@Override
public String getSrc() {
return srcField.getValueAsString();
}
+
+ @Override
+ public void reset() {
+ super.reset();
+ previewReset();
+ }
+
+ public void setPreviewUrl(final String url) {
+ Frame previewFrame = new Frame(url);
+ previewPanel.clear();
+ previewPanel.add(previewFrame);
+ previewPanel.doLayout();
+ }
+
+ private void previewReset() {
+ previewPanel.clear();
+ previewPanel.add(previewLabel);
+ }
+
+ private void refreshPreview() {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ presenter.onPreview();
+ }
+ });
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -5,8 +5,21 @@
public class InsertImageExtPresenter extends InsertImageAbstractPresenter implements InsertImageExt {
+ private InsertImageExtView view;
+
public InsertImageExtPresenter(InsertImageDialog insertImageDialog) {
super(insertImageDialog);
}
+ public void init(InsertImageExtView view) {
+ super.init(view);
+ this.view = view;
+ }
+
+ public void onPreview() {
+ if (isValid()) {
+ view.setPreviewUrl(view.getSrc());
+ }
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -3,4 +3,7 @@
import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractView;
public interface InsertImageExtView extends InsertImageAbstractView {
+
+ void setPreviewUrl(String src);
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -32,10 +32,6 @@
void setLinkInfo(LinkInfo linkInfo);
- void setLinkText(String text);
-
- void setLinkTitle(String title);
-
void setOnCreateLink(Listener<LinkInfo> listener);
void setOnInsertLinkPressed(Listener0 onInsertLinkPressed);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -30,7 +30,11 @@
private LinkInfo linkInfo;
private Listener0 onInsertLinkPressed;
- public void fireOnInsertLink(LinkInfo linkInfo) {
+ public InsertLinkDialogPresenter() {
+ linkInfo = new LinkInfo("");
+ }
+
+ public void fireOnInsertLink(final LinkInfo linkInfo) {
onCreateListener.onEvent(linkInfo);
super.hide();
}
@@ -43,23 +47,15 @@
super.hide();
}
- public void setLinkInfo(LinkInfo linkInfo) {
+ public void setLinkInfo(final LinkInfo linkInfo) {
this.linkInfo = linkInfo;
}
- public void setLinkText(String text) {
- linkInfo.setText(text);
- }
-
- public void setLinkTitle(String title) {
- linkInfo.setTitle(title);
- }
-
public void setOnCreateLink(final Listener<LinkInfo> listener) {
this.onCreateListener = listener;
}
- public void setOnInsertLinkPressed(Listener0 onInsertLinkPressed) {
+ public void setOnInsertLinkPressed(final Listener0 onInsertLinkPressed) {
this.onInsertLinkPressed = onInsertLinkPressed;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -8,14 +8,15 @@
public static final String TITLE = "title";
public static final String TARGET = "target";
public static final String _BLANK = "_blank";
+ private static final String NO_TARGET = null;
- public static LinkInfo parse(Element element) {
+ public static LinkInfo parse(final Element element) {
String target = element.getAttribute(TARGET);
return new LinkInfo(element.getInnerText(), element.getTitle(), element.getAttribute(HREF), target != null
&& target.equals(_BLANK));
}
- public static LinkInfo parse(org.xwiki.gwt.dom.client.Element element) {
+ public static LinkInfo parse(final org.xwiki.gwt.dom.client.Element element) {
String target = element.getAttribute(TARGET);
return new LinkInfo(element.getInnerText(), element.getTitle(), element.getAttribute(HREF), target != null
&& target.equals(_BLANK));
@@ -26,29 +27,27 @@
private String href;
private String target;
- public LinkInfo(String text) {
+ public LinkInfo(final String text) {
this(text, null, "", false);
}
- public LinkInfo(String text, String href) {
+ public LinkInfo(final String text, final String href) {
this.text = text;
this.href = href;
}
- public LinkInfo(String text, String title, String href, boolean inNewWindow) {
+ public LinkInfo(final String text, final String title, final String href, final boolean inNewWindow) {
this.text = text;
this.href = href;
this.title = title;
- if (inNewWindow) {
- this.setTarget(_BLANK);
- }
+ setInNewWindow(inNewWindow);
}
public Element getElement() {
Element anchor = DOM.createAnchor();
com.google.gwt.user.client.Element element = (com.google.gwt.user.client.Element) anchor;
DOM.setElementProperty(element, HREF, href);
- if (getTarget() != null) {
+ if (getTarget() != NO_TARGET) {
DOM.setElementProperty(element, TARGET, getTarget());
}
if (title != null) {
@@ -75,26 +74,34 @@
}
public boolean inSameWindow() {
- if (target != null) {
+ if (target != NO_TARGET) {
return target.equals(_BLANK);
} else {
return false;
}
}
- public void setHref(String href) {
+ public void setHref(final String href) {
this.href = href;
}
- public void setTarget(String target) {
+ public void setInNewWindow(final boolean inNewWindow) {
+ if (inNewWindow) {
+ this.setTarget(_BLANK);
+ } else {
+ setTarget(NO_TARGET);
+ }
+ }
+
+ public void setTarget(final String target) {
this.target = target;
}
- public void setText(String text) {
+ public void setText(final String text) {
this.text = text;
}
- public void setTitle(String title) {
+ public void setTitle(final String title) {
this.title = title;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -14,6 +14,7 @@
import com.gwtext.client.widgets.form.Checkbox;
import com.gwtext.client.widgets.form.FieldSet;
import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.form.event.CheckboxListenerAdapter;
import com.gwtext.client.widgets.form.event.FormPanelListenerAdapter;
public class InsertLinkAbstractPanel extends DefaultForm {
@@ -23,7 +24,7 @@
protected TextField onOverField;
protected final Checkbox sameWindow;
- public InsertLinkAbstractPanel(String title, final InsertLinkAbstractPresenter presenter) {
+ public InsertLinkAbstractPanel(final String title, final InsertLinkAbstractPresenter presenter) {
super(title);
super.setAutoWidth(true);
super.setHeight(InsertLinkDialogView.HEIGHT);
@@ -56,7 +57,7 @@
sameWindow.setChecked(false);
textField.addKeyPressListener(new EventCallback() {
- public void execute(EventObject e) {
+ public void execute(final EventObject e) {
DeferredCommand.addCommand(new Command() {
public void execute() {
presenter.onTextFieldChanged(textField.getRawValue());
@@ -66,7 +67,7 @@
});
onOverField.addKeyPressListener(new EventCallback() {
- public void execute(EventObject e) {
+ public void execute(final EventObject e) {
DeferredCommand.addCommand(new Command() {
public void execute() {
presenter.onOverFieldChanged(onOverField.getRawValue());
@@ -75,9 +76,16 @@
}
});
+ sameWindow.addListener(new CheckboxListenerAdapter() {
+ @Override
+ public void onCheck(final Checkbox field, final boolean checked) {
+ presenter.onSameWindowCheck(checked);
+ }
+ });
+
super.addListener(new FormPanelListenerAdapter() {
@Override
- public void onActivate(Panel panel) {
+ public void onActivate(final Panel panel) {
LinkInfo linkInfo = presenter.getLinkInfo();
updateValues(linkInfo);
presenter.onActivate();
@@ -113,11 +121,11 @@
}
@Override
- public void insert(int index, Component component) {
+ public void insert(final int index, final Component component) {
super.insert(index, component);
}
- protected void updateValues(LinkInfo linkInfo) {
+ protected void updateValues(final LinkInfo linkInfo) {
textField.setValue(linkInfo.getText());
onOverField.setValue(linkInfo.getTitle());
if (sameWindow.isVisible()) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -54,7 +54,7 @@
return view;
}
- public void init(InsertLinkAbstractView view) {
+ public void init(final InsertLinkAbstractView view) {
this.view = view;
editorInsertDialog.addTab(view);
}
@@ -67,19 +67,23 @@
editorInsertDialog.setOnInsertLinkPressed(onInsertLinkPressed);
}
- public void onInsert(LinkInfo linkInfo) {
+ public void onInsert(final LinkInfo linkInfo) {
editorInsertDialog.fireOnInsertLink(linkInfo);
reset();
}
- public void onOverFieldChanged(String title) {
- editorInsertDialog.setLinkTitle(title);
+ public void onOverFieldChanged(final String title) {
+ editorInsertDialog.getLinkInfo().setTitle(title);
}
- public void onTextFieldChanged(String text) {
- editorInsertDialog.setLinkText(text);
+ public void onSameWindowCheck(final boolean checked) {
+ editorInsertDialog.getLinkInfo().setInNewWindow(checked);
}
+ public void onTextFieldChanged(final String text) {
+ editorInsertDialog.getLinkInfo().setText(text);
+ }
+
public void reset() {
view.reset();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -47,6 +47,7 @@
previewPanel = new Panel();
previewPanel.setLayout(new FitLayout());
previewPanel.setHeight(125);
+ previewPanel.setCls("k-preview-panel");
add(new PaddedPanel(previewPanel, 0));
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaDescriptor.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaDescriptor.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,36 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+public class ExternalMediaDescriptor {
+
+ private final String name;
+ private final String siteurl;
+ private final String detectRegex;
+ private final String idRegex;
+ private final String embedTemplate;
+
+ public ExternalMediaDescriptor(final String name, final String siteurl, final String detectRegex,
+ final String idRegex, final String embedTemplate) {
+ this.name = name;
+ this.siteurl = siteurl;
+ this.detectRegex = detectRegex;
+ this.idRegex = idRegex;
+ this.embedTemplate = embedTemplate;
+ }
+
+ public String getEmbed(final String url) {
+ String id = url.replaceFirst(idRegex, "kk");
+ return embedTemplate.replaceFirst("\\[%d\\]", id);
+ }
+
+ public boolean is(final String url) {
+ return url.matches(detectRegex);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getSiteurl() {
+ return siteurl;
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,33 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public class ExternalMediaRegistry extends ArrayList<ExternalMediaDescriptor> {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final ExternalMediaDescriptor NO_MEDIA = new ExternalMediaDescriptor(null, null, null, null, null);
+
+ public ExternalMediaDescriptor get(final String url) {
+ for (ExternalMediaDescriptor media : this) {
+ if (media.is(url)) {
+ return media;
+ }
+
+ }
+ return NO_MEDIA;
+ }
+
+ public String getNames() {
+ String names = "";
+ for (Iterator<ExternalMediaDescriptor> iterator = this.iterator(); iterator.hasNext();) {
+ ExternalMediaDescriptor elem = iterator.next();
+ names += elem.getName();
+ if (iterator.hasNext()) {
+ names += ", ";
+ }
+ }
+ return names;
+ }
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialog;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
+public interface InsertMediaDialog extends AbstractTabbedDialog {
+
+ void fireOnInsertMedia(String html);
+
+ void setOnCreate(Listener<String> listener);
+
+ void setOnInsertPressed(Listener0 onInsertPressed);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,56 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
+
+import com.calclab.suco.client.events.Listener0;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+
+public class InsertMediaDialogPanel extends AbstractTabbedDialogPanel implements InsertMediaDialogView {
+
+ private static final String INSERT_MEDIA_DIALOG = "k-imdp-dialog";
+ private static final String INSERT_MEDIA_DIALOG_ERROR_ID = "k-imdp-dialog-err";
+ private final InsertMediaGroup insertMediaGroup;
+
+ public InsertMediaDialogPanel(final InsertMediaDialogPresenter presenter, final I18nTranslationService i18n,
+ final Images images, final InsertMediaGroup insertMediaGroup) {
+ super(INSERT_MEDIA_DIALOG, i18n.t("Insert Media (audio/video)"), 380, HEIGHT + 100, 380, HEIGHT + 100, true,
+ images, INSERT_MEDIA_DIALOG_ERROR_ID);
+ super.setIconCls("k-film-icon");
+ this.insertMediaGroup = insertMediaGroup;
+
+ super.addHideListener(new Listener0() {
+ public void onEvent() {
+ insertMediaGroup.resetAll();
+ }
+ });
+
+ Button insert = new Button(i18n.t("Insert"));
+ insert.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ presenter.onInsert();
+ }
+ });
+
+ Button cancel = new Button(i18n.t("Cancel"));
+ cancel.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ presenter.onCancel();
+ }
+ });
+ addButton(insert);
+ addButton(cancel);
+ }
+
+ @Override
+ public void createAndShow() {
+ insertMediaGroup.createAll();
+ super.createAndShow();
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,33 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
+public class InsertMediaDialogPresenter extends AbstractTabbedDialogPresenter implements InsertMediaDialog {
+
+ private Listener0 onInsertPressed;
+ Listener<String> onCreateListener;
+
+ public void fireOnInsertMedia(String html) {
+ onCreateListener.onEvent(html);
+ super.hide();
+ }
+
+ public void setOnCreate(Listener<String> listener) {
+ onCreateListener = listener;
+ }
+
+ public void setOnInsertPressed(Listener0 onInsertPressed) {
+ this.onInsertPressed = onInsertPressed;
+ }
+
+ protected void onCancel() {
+ super.hide();
+ }
+
+ protected void onInsert() {
+ onInsertPressed.onEvent();
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface InsertMediaDialogView extends View {
+
+ int HEIGHT = 150;
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstract.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstract.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstract.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia;
+
+public interface InsertMediaAbstract {
+
+ void reset();
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,57 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia;
+
+import org.ourproject.kune.platf.client.i18n.Resources;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialogView;
+
+import com.gwtext.client.widgets.Component;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.form.Label;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.form.event.FormPanelListenerAdapter;
+
+public class InsertMediaAbstractPanel extends DefaultForm implements InsertMediaAbstractView {
+
+ protected TextField hrefField;
+ private final Label intro;
+
+ public InsertMediaAbstractPanel(final String title, final InsertMediaAbstractPresenter presenter) {
+ super(title);
+ super.setAutoWidth(true);
+ super.setHeight(InsertMediaDialogView.HEIGHT);
+
+ intro = new Label();
+
+ hrefField = new TextField();
+ hrefField.setTabIndex(1);
+ hrefField.setLabel(Resources.i18n.t("Link"));
+ hrefField.setWidth(DEF_FIELD_WIDTH);
+ hrefField.setAllowBlank(false);
+ hrefField.setMinLength(3);
+ hrefField.setMaxLength(250);
+ hrefField.setValidationEvent(false);
+
+ super.addListener(new FormPanelListenerAdapter() {
+ @Override
+ public void onActivate(final Panel panel) {
+ presenter.onActivate();
+ }
+ });
+
+ add(intro);
+ add(hrefField);
+ }
+
+ public String getSrc() {
+ return hrefField.getRawValue();
+ }
+
+ @Override
+ public void insert(final int index, final Component component) {
+ super.insert(index, component);
+ }
+
+ public void setIntro(final String text) {
+ intro.setHtml(text);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,58 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.events.Listener0;
+
+public class InsertMediaAbstractPresenter implements InsertMediaAbstract {
+
+ protected InsertMediaAbstractView view;
+ protected final InsertMediaDialog insertMediaDialog;
+ private final Listener0 onInsertMediaPressed;
+
+ public InsertMediaAbstractPresenter(final InsertMediaDialog insertMediaDialog) {
+ this.insertMediaDialog = insertMediaDialog;
+ onInsertMediaPressed = new Listener0() {
+ public void onEvent() {
+ if (isValid()) {
+ String embedInfo = updateMediaInfo();
+ insertMediaDialog.fireOnInsertMedia(embedInfo);
+ } else {
+ Log.debug("Form in InsertMedia not valid");
+ }
+ }
+ };
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final InsertMediaAbstractView view) {
+ this.view = view;
+ insertMediaDialog.addTab(view);
+ }
+
+ public boolean isValid() {
+ return view.isValid();
+ }
+
+ public void onActivate() {
+ insertMediaDialog.setOnInsertPressed(onInsertMediaPressed);
+ }
+
+ public void onInsert(final String linkInfo) {
+ insertMediaDialog.fireOnInsertMedia(linkInfo);
+ reset();
+ }
+
+ public void reset() {
+ view.reset();
+ }
+
+ protected String updateMediaInfo() {
+ return "";
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractView.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractView.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,13 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface InsertMediaAbstractView extends View {
+
+ String getSrc();
+
+ boolean isValid();
+
+ void reset();
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
+
+public interface InsertExtMedia extends InsertMediaAbstract {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaRegistry;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPanel;
+
+public class InsertExtMediaPanel extends InsertMediaAbstractPanel implements InsertExtMediaView {
+
+ public InsertExtMediaPanel(final InsertExtMediaPresenter presenter, final I18nTranslationService i18n,
+ final ExternalMediaRegistry externalMediaRegistry) {
+ super(i18n.t("External"), presenter);
+ String supportedVideos = externalMediaRegistry.getNames();
+ setIntro(i18n.t("Provide a link to the external video (supported videos: [%s])", supportedVideos) + "<br/>");
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,45 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaDescriptor;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaRegistry;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPresenter;
+
+public class InsertExtMediaPresenter extends InsertMediaAbstractPresenter implements InsertExtMedia {
+
+ private InsertExtMediaView view;
+ private final ExternalMediaRegistry externalMediaRegistry;
+ private ExternalMediaDescriptor mediaDescriptor;
+
+ public InsertExtMediaPresenter(final InsertMediaDialog insertMediaDialog,
+ final ExternalMediaRegistry externalMediaRegistry) {
+ super(insertMediaDialog);
+ this.externalMediaRegistry = externalMediaRegistry;
+
+ externalMediaRegistry.add(new ExternalMediaDescriptor("youtube", "http://youtube.com",
+ "http://[a-z]*.youtube.com/watch?v=.*", "FIXME", "<embed [%d]>"));
+ }
+
+ public void init(final InsertExtMediaView view) {
+ super.init(view);
+ this.view = view;
+ }
+
+ @Override
+ public boolean isValid() {
+ String url = view.getSrc();
+ mediaDescriptor = externalMediaRegistry.get(url);
+ if (mediaDescriptor.equals(ExternalMediaRegistry.NO_MEDIA)) {
+ insertMediaDialog.setErrorMessage("We cannot process this video link", Level.error);
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ @Override
+ protected String updateMediaInfo() {
+ return mediaDescriptor.getEmbed(view.getSrc());
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractView;
+
+public interface InsertExtMediaView extends InsertMediaAbstractView {
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -15,17 +15,17 @@
private static final String INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID = "iscdp-err";
private final InsertSpecialCharGroup insertSpecialCharGroup;
- public InsertSpecialCharDialogPanel(final InsertSpecialCharDialogPresenter presenter, Images images,
- I18nTranslationService i18n, InsertSpecialCharGroup insertSpecialCharGroup, RTEImgResources imgResources) {
+ public InsertSpecialCharDialogPanel(final InsertSpecialCharDialogPresenter presenter, final Images images,
+ final I18nTranslationService i18n, final InsertSpecialCharGroup insertSpecialCharGroup,
+ final RTEImgResources imgResources) {
super(INSERT_SPECIAL_CHAR_DIALOG, i18n.t("Insert Special Character"), 495, HEIGHT + 90, 495, HEIGHT + 90, true,
images, INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID);
- // super.setIconCls(RTEImgResources.SUFFIX +
- // imgResources.insertspreadsheet().getName());
+ super.setIconCls("k-specialchars-icon");
this.insertSpecialCharGroup = insertSpecialCharGroup;
Button close = new Button(i18n.t("Close"));
close.addListener(new ButtonListenerAdapter() {
@Override
- public void onClick(Button button, EventObject e) {
+ public void onClick(final Button button, final EventObject e) {
hide();
}
});
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -80,7 +80,7 @@
parentMenuTitleCtx, Position.ctx, TYPE_ROOT, TYPE_FOLDER);
// createContentModeratedActions(parentMenuTitle, contentsModerated);
-
+ createTranslateAction(parentMenuTitle, TYPE_FOLDER, TYPE_WIKIPAGE);
createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
createEditAction(parentMenuTitle, TYPE_WIKIPAGE);
@@ -102,8 +102,6 @@
createGoHomeAction(containers);
- createTranslateAction(TYPE_FOLDER, TYPE_WIKIPAGE);
-
createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
createShowDeletedItems(parentMenuTitleCtx, all);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -98,14 +98,16 @@
protected final EntityHeader entityLogo;
private final SitePublicSpaceLink publicLink;
- public AbstractFoldableContentActions(Session session, StateManager stateManager, I18nUITranslationService i18n,
- ErrorHandler errorHandler, DeferredCommandWrapper deferredCommandWrapper,
- Provider<GroupServiceAsync> groupServiceProvider, Provider<ContentServiceAsync> contentServiceProvider,
- Provider<FileUploader> fileUploaderProvider, ContextNavigator contextNavigator,
- ContentActionRegistry contentActionRegistry, ContextActionRegistry contextActionRegistry,
- Provider<FileDownloadUtils> fileDownloadProvider, Provider<ContentEditor> textEditorProvider,
- Provider<ContextPropEditor> contextPropEditorProvider, FoldableContent foldableContent,
- EntityHeader entityLogo, SitePublicSpaceLink publicLink) {
+ public AbstractFoldableContentActions(final Session session, final StateManager stateManager,
+ final I18nUITranslationService i18n, final ErrorHandler errorHandler,
+ final DeferredCommandWrapper deferredCommandWrapper,
+ final Provider<GroupServiceAsync> groupServiceProvider,
+ final Provider<ContentServiceAsync> contentServiceProvider,
+ final Provider<FileUploader> fileUploaderProvider, final ContextNavigator contextNavigator,
+ final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
+ final Provider<FileDownloadUtils> fileDownloadProvider, final Provider<ContentEditor> textEditorProvider,
+ final Provider<ContextPropEditor> contextPropEditorProvider, final FoldableContent foldableContent,
+ final EntityHeader entityLogo, final SitePublicSpaceLink publicLink) {
this.session = session;
this.stateManager = stateManager;
this.i18n = i18n;
@@ -125,7 +127,7 @@
this.publicLink = publicLink;
createActions();
session.onInitDataReceived(new Listener<InitDataDTO>() {
- public void onEvent(InitDataDTO parameter) {
+ public void onEvent(final InitDataDTO parameter) {
createPostSessionInitActions();
}
});
@@ -134,7 +136,7 @@
protected void createActions() {
}
- protected void createContentModeratedActions(String parentMenuTitle, final String... contentsModerated) {
+ protected void createContentModeratedActions(final String parentMenuTitle, final String... contentsModerated) {
createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Published online"), ContentStatusDTO.publishedOnline,
contentsModerated);
createSetStatusAction(AccessRolDTO.Editor, i18n.t("Editing in progress"), ContentStatusDTO.editingInProgress,
@@ -147,7 +149,8 @@
contentsModerated);
}
- protected void createContentRenameAction(String parentMenuTitle, String textDescription, String... registerInTypes) {
+ protected void createContentRenameAction(final String parentMenuTitle, final String textDescription,
+ final String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = new ActionToolbarMenuAndItemDescriptor<StateToken>(
AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
@@ -162,7 +165,8 @@
contentActionRegistry.addAction(renameCtn, registerInTypes);
}
- protected void createDelContainerAction(String text, String parentMenuTitle, String... registerInTypes) {
+ protected void createDelContainerAction(final String text, final String parentMenuTitle,
+ final String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = new ActionToolbarMenuAndItemDescriptor<StateToken>(
AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
@@ -177,7 +181,8 @@
contextActionRegistry.addAction(delContainer, registerInTypes);
}
- protected void createDelContentAction(String parentMenuTitle, String textDescription, String... registerInTypes) {
+ protected void createDelContentAction(final String parentMenuTitle, final String textDescription,
+ final String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> delContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
@@ -202,7 +207,7 @@
contentActionRegistry.addAction(delContent, registerInTypes);
}
- protected void createDownloadActions(String typeUploadedfile) {
+ protected void createDownloadActions(final String typeUploadedfile) {
ActionToolbarButtonDescriptor<StateToken> download = new ActionToolbarButtonDescriptor<StateToken>(
AccessRolDTO.Viewer, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
@@ -229,7 +234,7 @@
}
protected ActionToolbarButtonDescriptor<StateToken> createEditAction(final String fileMenuTitle,
- String... registerInTypes) {
+ final String... registerInTypes) {
ActionToolbarButtonDescriptor<StateToken> editContent = new ActionToolbarButtonDescriptor<StateToken>(
AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
@@ -258,7 +263,7 @@
}
}
- public void onSuccess(Object param) {
+ public void onSuccess(final Object param) {
NotifyUser.hideProgress();
session.getContentState().setContent(html);
editor.onSavedSuccessful();
@@ -295,7 +300,7 @@
return editContent;
}
- protected ActionMenuItemDescriptor<StateToken> createGoAction(String... registerInTypes) {
+ protected ActionMenuItemDescriptor<StateToken> createGoAction(final String... registerInTypes) {
ActionMenuItemDescriptor<StateToken> go = new ActionMenuItemDescriptor<StateToken>(AccessRolDTO.Viewer,
new Listener<StateToken>() {
public void onEvent(final StateToken token) {
@@ -309,7 +314,7 @@
return go;
}
- protected ActionToolbarButtonDescriptor<StateToken> createGoHomeAction(String... registerInTypes) {
+ protected ActionToolbarButtonDescriptor<StateToken> createGoHomeAction(final String... registerInTypes) {
ActionToolbarButtonDescriptor<StateToken> goGroupHome = new ActionToolbarButtonDescriptor<StateToken>(
AccessRolDTO.Viewer, CONTEXT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
@@ -319,7 +324,7 @@
goGroupHome.setMustBeAuthenticated(false);
goGroupHome.setIconUrl("images/group-home.png");
goGroupHome.setEnableCondition(new ActionEnableCondition<StateToken>() {
- public boolean mustBeEnabled(StateToken token) {
+ public boolean mustBeEnabled(final StateToken token) {
final StateToken defContentToken = session.getCurrentState().getGroup().getDefaultContent().getStateToken();
return !session.getCurrentStateToken().equals(defContentToken);
}
@@ -331,7 +336,7 @@
protected void createNewContainerAction(final String contentTypeId, final String iconUrl,
final String textDescription, final String parentMenuTitle, final String parentMenuSubtitle,
- final String defaultName, Position position, String... registerInTypes) {
+ final String defaultName, final Position position, final String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTENT_TOPBAR,
new Listener<StateToken>() {
@@ -354,8 +359,8 @@
}
protected ActionToolbarMenuAndItemDescriptor<StateToken> createNewContentAction(final String typeId,
- String iconUrl, final String description, final String parentMenuTitle, Position position,
- String... registerInTypes) {
+ final String iconUrl, final String description, final String parentMenuTitle, final Position position,
+ final String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> addContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
public void onEvent() {
@@ -381,8 +386,8 @@
protected void createPostSessionInitActions() {
}
- protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(String parentMenuTitle,
- String... registerInTypes) {
+ protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(final String parentMenuTitle,
+ final String... registerInTypes) {
final ActionToolbarMenuDescriptor<StateToken> refreshCnt = new ActionToolbarMenuDescriptor<StateToken>(
AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
@@ -398,8 +403,8 @@
return refreshCnt;
}
- protected ActionToolbarMenuDescriptor<StateToken> createRefreshCxtAction(String parentMenuTitleCtx,
- String... registerInTypes) {
+ protected ActionToolbarMenuDescriptor<StateToken> createRefreshCxtAction(final String parentMenuTitleCtx,
+ final String... registerInTypes) {
final ActionToolbarMenuDescriptor<StateToken> refreshCtx = new ActionToolbarMenuDescriptor<StateToken>(
AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
@@ -415,8 +420,8 @@
return refreshCtx;
}
- protected ActionToolbarMenuAndItemDescriptor<StateToken> createRenameContentInCtxAction(String parentMenuTitleCtx,
- String textDescription, String... registerInTypes) {
+ protected ActionToolbarMenuAndItemDescriptor<StateToken> createRenameContentInCtxAction(
+ final String parentMenuTitleCtx, final String textDescription, final String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtx = new ActionToolbarMenuAndItemDescriptor<StateToken>(
AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
@@ -429,8 +434,8 @@
return renameCtx;
}
- protected ActionToolbarMenuDescriptor<StateToken> createSetAsDefContent(String parentMenuTitle,
- String... registerInTypes) {
+ protected ActionToolbarMenuDescriptor<StateToken> createSetAsDefContent(final String parentMenuTitle,
+ final String... registerInTypes) {
final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupContent;
setAsDefGroupContent = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Administrator, CONTENT_TOPBAR,
new Listener<StateToken>() {
@@ -455,7 +460,7 @@
}
protected void createSetStatusAction(final AccessRolDTO rol, final String textDescription,
- final ContentStatusDTO status, String[] contentsModerated) {
+ final ContentStatusDTO status, final String[] contentsModerated) {
final ActionToolbarMenuRadioDescriptor<StateToken> action = new ActionToolbarMenuRadioDescriptor<StateToken>(
rol, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
@@ -476,7 +481,7 @@
contentActionRegistry.addAction(action, contentsModerated);
}
- protected void createShowDeletedItems(String parentMenuTitle, String... registerInTypes) {
+ protected void createShowDeletedItems(final String parentMenuTitle, final String... registerInTypes) {
ActionToolbarMenuCheckItemDescriptor<StateToken> showDeletedItems = new ActionToolbarMenuCheckItemDescriptor<StateToken>(
AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
public void onEvent() {
@@ -500,24 +505,26 @@
contextActionRegistry.addAction(showDeletedItems, registerInTypes);
}
- protected ActionToolbarButtonDescriptor<StateToken> createTranslateAction(String... registerInTypes) {
- ActionToolbarButtonDescriptor<StateToken> translateContent = new ActionToolbarButtonDescriptor<StateToken>(
+ protected ActionToolbarMenuDescriptor<StateToken> createTranslateAction(final String fileMenuTitle,
+ final String... registerInTypes) {
+ ActionToolbarMenuDescriptor<StateToken> translateContent = new ActionToolbarMenuDescriptor<StateToken>(
AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
NotifyUser.important(i18n.t("Sorry, this functionality is currently in development"));
}
});
+ translateContent.setParentMenuTitle(fileMenuTitle);
translateContent.setTextDescription(i18n.tWithNT("Translate", "used in button"));
translateContent.setToolTip(i18n.t("Translate this document to other languages"));
translateContent.setIconUrl("images/language.gif");
- translateContent.setLeftSeparator(ActionToolbarButtonSeparator.spacer);
translateContent.setEnableCondition(notDeleted());
contentActionRegistry.addAction(translateContent, registerInTypes);
return translateContent;
}
protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadAction(final String textDescription,
- final String iconUrl, final String toolTip, final String permitedExtensions, String... registerInTypes) {
+ final String iconUrl, final String toolTip, final String permitedExtensions,
+ final String... registerInTypes) {
final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile;
uploadFile = new ActionToolbarButtonAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTEXT_BOTTOMBAR,
new Listener0() {
@@ -539,7 +546,7 @@
return uploadFile;
}
- protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadMediaAction(String... registerInTypes) {
+ protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadMediaAction(final String... registerInTypes) {
ActionToolbarButtonAndItemDescriptor<StateToken> uploadMedia = createUploadAction(i18n.t("Upload media"),
"images/nav/upload.png", i18n.t("Upload some media (images, videos...)"),
session.getGalleryPermittedExtensions());
@@ -556,13 +563,13 @@
* TYPE_UPLOADEDFILE);
*/
@SuppressWarnings("unused")
- private ActionToolbarMenuAndItemDescriptor<StateToken> createSetGroupLogoAction(String parentMenuTitle) {
+ private ActionToolbarMenuAndItemDescriptor<StateToken> createSetGroupLogoAction(final String parentMenuTitle) {
final ActionToolbarMenuAndItemDescriptor<StateToken> setGroupLogo = new ActionToolbarMenuAndItemDescriptor<StateToken>(
AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
groupServiceProvider.get().setGroupFullLogo(session.getUserHash(), token,
new AsyncCallbackSimple<GroupDTO>() {
- public void onSuccess(GroupDTO newGroup) {
+ public void onSuccess(final GroupDTO newGroup) {
NotifyUser.info("Logo selected");
if (session.getCurrentState().getGroup().getShortName().equals(
newGroup.getShortName())) {
@@ -577,7 +584,7 @@
setGroupLogo.setTextDescription(i18n.t("Set this as the group logo"));
setGroupLogo.setIconUrl("images/nav/picture.png");
setGroupLogo.setEnableCondition(new ActionEnableCondition<StateToken>() {
- public boolean mustBeEnabled(StateToken token) {
+ public boolean mustBeEnabled(final StateToken token) {
final BasicMimeTypeDTO mime = session.getContentState().getMimeType();
return mime != null && mime.getType().equals("image");
}
@@ -587,7 +594,7 @@
private ActionEnableCondition<StateToken> notDefAndNotDeleted() {
return new ActionEnableCondition<StateToken>() {
- public boolean mustBeEnabled(StateToken token) {
+ public boolean mustBeEnabled(final StateToken token) {
final boolean isNotDefContentToken = !session.getCurrentState().getGroup().getDefaultContent().getStateToken().equals(
session.getCurrentStateToken());
return isNotDefContentToken && notDeleted().mustBeEnabled(token);
@@ -597,7 +604,7 @@
private ActionEnableCondition<StateToken> notDeleted() {
return new ActionEnableCondition<StateToken>() {
- public boolean mustBeEnabled(StateToken token) {
+ public boolean mustBeEnabled(final StateToken token) {
final boolean isNotDeleted = !(session.isCurrentStateAContent() && session.getContentState().getStatus().equals(
ContentStatusDTO.inTheDustbin));
return isNotDeleted;
@@ -605,8 +612,8 @@
};
}
- private void register(ActionToolbarMenuAndItemDescriptor<StateToken> action, Position position,
- String... registerInTypes) {
+ private void register(final ActionToolbarMenuAndItemDescriptor<StateToken> action, final Position position,
+ final String... registerInTypes) {
switch (position) {
case ctx:
contextActionRegistry.addAction(action, registerInTypes);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -52,8 +52,10 @@
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorPanel;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.platf.client.utils.TimerWrapper;
@@ -77,6 +79,9 @@
import org.ourproject.kune.workspace.client.editor.insertlocallink.InsertLinkLocal;
import org.ourproject.kune.workspace.client.editor.insertlocallink.InsertLinkLocalPanel;
import org.ourproject.kune.workspace.client.editor.insertlocallink.InsertLinkLocalPresenter;
+import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertLocalMedia;
+import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertLocalMediaPanel;
+import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertLocalMediaPresenter;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPanel;
import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPresenter;
@@ -956,6 +961,17 @@
}
});
+ register(InsertMediaGroup.class, new Factory<InsertLocalMedia>(InsertLocalMedia.class) {
+ @Override
+ public InsertLocalMedia create() {
+ final InsertLocalMediaPresenter presenter = new InsertLocalMediaPresenter($(InsertMediaDialog.class));
+ final InsertLocalMediaPanel panel = new InsertLocalMediaPanel(presenter,
+ $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
$(GlobalShortcutRegister.class).enable();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -8,9 +8,10 @@
public class InsertImageLocalPanel extends InsertImageAbstractPanel implements InsertImageLocalView {
- public InsertImageLocalPanel(final InsertImageLocalPresenter presenter, I18nTranslationService i18n) {
- super(i18n.t("Local image"), presenter);
- insert(0, new Label(TextUtils.IN_DEVELOPMENT));
+ public InsertImageLocalPanel(final InsertImageLocalPresenter presenter, final I18nTranslationService i18n) {
+ super(i18n.t("Local"), presenter);
+ Label label = new Label();
+ label.setHtml(TextUtils.IN_DEVELOPMENT + "<br/><br/>");
+ insert(0, label);
}
-
}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
+
+public interface InsertLocalMedia extends InsertMediaAbstract {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,14 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPanel;
+
+public class InsertLocalMediaPanel extends InsertMediaAbstractPanel implements InsertLocalMediaView {
+
+ public InsertLocalMediaPanel(final InsertLocalMediaPresenter presenter, final I18nTranslationService i18n) {
+ super(i18n.t("Local"), presenter);
+ setIntro(TextUtils.IN_DEVELOPMENT + "<br/><br/>");
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,18 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPresenter;
+
+public class InsertLocalMediaPresenter extends InsertMediaAbstractPresenter implements InsertLocalMedia {
+
+ private InsertLocalMediaView view;
+
+ public InsertLocalMediaPresenter(InsertMediaDialog insertMediaDialog) {
+ super(insertMediaDialog);
+ }
+
+ public void init(InsertLocalMediaView view) {
+ super.init(view);
+ this.view = view;
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java 2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java 2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractView;
+
+public interface InsertLocalMediaView extends InsertMediaAbstractView {
+}
1
0
r1088 - in trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte: basic insertimg insertimg/abstractimg insertlink saving
by vjrj 26 Mar '09
by vjrj 26 Mar '09
26 Mar '09
Author: vjrj
Date: 2009-03-26 01:07:59 +0100 (Thu, 26 Mar 2009)
New Revision: 1088
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
Log:
Incomplete - task RTE: Create Image
Complete - task RTE Autosave on/off
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-25 17:15:09 UTC (rev 1087)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
@@ -597,7 +597,8 @@
};
}
InsertImageDialog dialog = insertImageDialog.get();
- dialog.setImageInfo(new ImageInfo("", true, ImageInfo.POSITION_LEFT,
+ dialog.setImageInfo(new ImageInfo("", ImageInfo.DEF_WRAP_VALUE,
+ ImageInfo.DEF_CLICK_ORIGINAL_VALUE, ImageInfo.POSITION_LEFT,
ImageInfo.SIZE_ORIGINAL));
dialog.setOnCreateImage(insertImageListener);
dialog.show();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2009-03-25 17:15:09 UTC (rev 1087)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2009-03-26 00:07:59 UTC (rev 1088)
@@ -1,12 +1,16 @@
package org.ourproject.kune.platf.client.ui.rte.insertimg;
import org.cobogw.gwt.user.client.CSS;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
public class ImageInfo {
+ public static final boolean DEF_WRAP_VALUE = true;
+ public static final boolean DEF_CLICK_ORIGINAL_VALUE = false;
+
public static final String SIZE_ORIGINAL = "original";
public static final String SIZE_FIT = "fit";
public static final String SIZE_XS = "xs";
@@ -31,28 +35,32 @@
private String src;
private boolean wraptext;
+ private boolean clickOriginal;
private String position;
private String size;
- public ImageInfo(String src, boolean wraptext, String position, String size) {
+ public ImageInfo(String src, boolean wraptext, boolean clickOriginal, String position, String size) {
this.src = src;
this.wraptext = wraptext;
+ this.clickOriginal = clickOriginal;
this.setPosition(position);
this.setSize(size);
}
+ public boolean getClickOriginal() {
+ return clickOriginal;
+ }
+
public Element getElement() {
- com.google.gwt.user.client.Element img = DOM.createImg();
- DOM.setElementProperty(img, "src", src);
- CSS.setProperty(img, CSS.A.WIDTH, getStyleSize());
- if (!wraptext || position.equals(POSITION_CENTER)) {
- com.google.gwt.user.client.Element divEl = DOM.createDiv();
- CSS.setProperty(divEl, CSS.A.TEXT_ALIGN, position);
- divEl.setInnerHTML(img.getString());
- return divEl;
+ Element imgElement = getImageElement();
+ if (clickOriginal) {
+ com.google.gwt.user.client.Element anchor = DOM.createAnchor();
+ DOM.setElementProperty(anchor, LinkInfo.HREF, src);
+ DOM.setElementProperty(anchor, LinkInfo.TARGET, LinkInfo._BLANK);
+ anchor.setInnerHTML(imgElement.getString());
+ return anchor;
} else {
- CSS.setProperty(img, CSS.A.FLOAT, position);
- return img;
+ return imgElement;
}
}
@@ -72,6 +80,10 @@
return wraptext;
}
+ public void setClickOriginal(boolean clickOriginal) {
+ this.clickOriginal = clickOriginal;
+ }
+
public void setPosition(String position) {
this.position = position;
}
@@ -94,6 +106,21 @@
return element.getString();
}
+ private Element getImageElement() {
+ com.google.gwt.user.client.Element img = DOM.createImg();
+ DOM.setElementProperty(img, "src", src);
+ CSS.setProperty(img, CSS.A.WIDTH, getStyleSize());
+ if (!wraptext || position.equals(POSITION_CENTER)) {
+ com.google.gwt.user.client.Element divEl = DOM.createDiv();
+ CSS.setProperty(divEl, CSS.A.TEXT_ALIGN, position);
+ divEl.setInnerHTML(img.getString());
+ return divEl;
+ } else {
+ CSS.setProperty(img, CSS.A.FLOAT, position);
+ return img;
+ }
+ }
+
private String getStyleSize() {
for (String[] current : sizes) {
if (current[1].equals(size)) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java 2009-03-25 17:15:09 UTC (rev 1087)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java 2009-03-26 00:07:59 UTC (rev 1088)
@@ -23,6 +23,7 @@
private final ComboBox sizeCombo;
private final ComboBox positionCombo;
protected final Checkbox wrapText;
+ protected final Checkbox clickOriginal;
public InsertImageAbstractPanel(String title, final InsertImageAbstractPresenter presenter) {
super(title);
@@ -39,8 +40,12 @@
positionCombo = createCombo(storePositions, Resources.i18n.t("Position"));
wrapText = new Checkbox(Resources.i18n.t("Wrap text around image"));
- wrapText.setChecked(false);
+ wrapText.setChecked(ImageInfo.DEF_WRAP_VALUE);
+ clickOriginal = new Checkbox(Resources.i18n.t("Clicking this image links to the original image file"));
+ clickOriginal.setChecked(ImageInfo.DEF_CLICK_ORIGINAL_VALUE);
+ clickOriginal.setWidth(DEF_FIELD_WIDTH);
+
positionCombo.addListener(new ComboBoxListenerAdapter() {
@Override
public void onSelect(ComboBox comboBox, Record record, int index) {
@@ -62,13 +67,20 @@
advanced.setCollapsible(true);
advanced.setCollapsed(true);
advanced.setAutoHeight(true);
+ advanced.setAutoWidth(true);
+ advanced.setAutoScroll(false);
advanced.add(sizeCombo);
advanced.add(positionCombo);
advanced.add(wrapText);
+ advanced.add(clickOriginal);
add(advanced);
}
+ public boolean getClickOriginal() {
+ return clickOriginal.getValue();
+ }
+
public String getPosition() {
return positionCombo.getValueAsString();
}
@@ -81,20 +93,21 @@
return null;
}
+ public boolean getWrapText() {
+ return wrapText.getValue();
+ }
+
@Override
public void insert(int index, Component component) {
super.insert(index, component);
}
- public boolean wrapText() {
- return wrapText.getValue();
- }
-
protected void updateValues(ImageInfo imageInfo) {
sizeCombo.setValue(imageInfo.getSize());
String position = imageInfo.getPosition();
positionCombo.setValue(position);
wrapText.setChecked(imageInfo.isWraptext());
+ clickOriginal.setChecked(imageInfo.getClickOriginal());
setWrapVisible(position);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java 2009-03-25 17:15:09 UTC (rev 1087)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
@@ -66,7 +66,7 @@
}
protected ImageInfo updateImageInfo() {
- return new ImageInfo(view.getSrc(), view.wrapText(), view.getPosition(), view.getSize());
+ return new ImageInfo(view.getSrc(), view.getWrapText(), view.getClickOriginal(), view.getPosition(),
+ view.getSize());
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java 2009-03-25 17:15:09 UTC (rev 1087)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java 2009-03-26 00:07:59 UTC (rev 1088)
@@ -4,6 +4,8 @@
public interface InsertImageAbstractView extends View {
+ boolean getClickOriginal();
+
String getPosition();
String getSize();
@@ -14,5 +16,5 @@
void reset();
- boolean wrapText();
+ boolean getWrapText();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java 2009-03-25 17:15:09 UTC (rev 1087)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java 2009-03-26 00:07:59 UTC (rev 1088)
@@ -4,10 +4,10 @@
import com.google.gwt.user.client.DOM;
public class LinkInfo {
- private static final String HREF = "href";
- // private static final String TITLE = "title";
- private static final String TARGET = "target";
- private static final String _BLANK = "_blank";
+ public static final String HREF = "href";
+ public static final String TITLE = "title";
+ public static final String TARGET = "target";
+ public static final String _BLANK = "_blank";
public static LinkInfo parse(Element element) {
String target = element.getAttribute(TARGET);
@@ -47,12 +47,12 @@
public Element getElement() {
Element anchor = DOM.createAnchor();
com.google.gwt.user.client.Element element = (com.google.gwt.user.client.Element) anchor;
- DOM.setElementProperty(element, "href", href);
+ DOM.setElementProperty(element, HREF, href);
if (getTarget() != null) {
DOM.setElementProperty(element, TARGET, getTarget());
}
if (title != null) {
- DOM.setElementAttribute(element, "title", title);
+ DOM.setElementAttribute(element, TITLE, title);
}
DOM.setInnerText(element, text);
return anchor;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java 2009-03-25 17:15:09 UTC (rev 1087)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java 2009-03-26 00:07:59 UTC (rev 1088)
@@ -1,7 +1,9 @@
package org.ourproject.kune.platf.client.ui.rte.saving;
+import org.ourproject.kune.platf.client.actions.ActionCheckedCondition;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuCheckItemDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.BeforeActionListener;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
@@ -23,7 +25,7 @@
public static final int AUTOSAVE_IN_MILLISECONDS = 10000;
private final RTEditor editor;
- private final boolean autoSave;
+ private boolean autoSave;
private boolean savePending;
private boolean saveAndCloseConfirmed;
private Listener<String> onSave;
@@ -193,6 +195,23 @@
save.setTextDescription(i18n.t("Save") + (ctrl_S.toString()));
save.setPosition(0);
+ ActionToolbarMenuCheckItemDescriptor<Object> autoSaveMenuItem = new ActionToolbarMenuCheckItemDescriptor<Object>(AccessRolDTO.Editor,
+ RTEditor.topbarPosition, new Listener0() {
+ public void onEvent() {
+ autoSave = !autoSave;
+ if (autoSave) {
+ timer.schedule(AUTOSAVE_IN_MILLISECONDS);
+ } else {
+ timer.cancel();
+ }
+ }}
+ , new ActionCheckedCondition() {
+ public boolean mustBeChecked() {
+ return autoSave;
+ }});
+ autoSaveMenuItem.setParentMenuTitle(i18n.t(FILE_DEF_MENU_OPTION));
+ autoSaveMenuItem.setTextDescription(i18n.t("Autosave"));
+
ActionToolbarMenuDescriptor<Object> close = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
RTEditor.topbarPosition, new Listener<Object>() {
public void onEvent(Object parameter) {
@@ -225,8 +244,10 @@
saveCloseBtn.setLeftSeparator(ActionToolbarButtonSeparator.fill);
editor.addAction(save);
+ editor.addAction(autoSaveMenuItem);
editor.addAction(saveclose);
editor.addAction(close);
+
editor.addAction(saveBtn);
editor.addAction(saveCloseBtn);
}
1
0
Author: vjrj
Date: 2009-03-25 18:15:09 +0100 (Wed, 25 Mar 2009)
New Revision: 1087
Modified:
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
Log:
Incomplete - task RTE: Create Image
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/pom.xml 2009-03-25 17:15:09 UTC (rev 1087)
@@ -53,6 +53,11 @@
</dependency>
-->
<dependency>
+ <groupId>org.cobogw</groupId>
+ <artifactId>gwt</artifactId>
+ <version>1.2.2</version>
+ </dependency>
+ <dependency>
<groupId>com.gwtext</groupId>
<artifactId>gwtext</artifactId>
<version>2.0.5</version>
Modified: trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2009-03-25 17:15:09 UTC (rev 1087)
@@ -18,6 +18,8 @@
<inherits name='org.ourproject.kune.chat.Kune-Chat' />
<inherits name='org.ourproject.kune.gallery.Kune-Gallery' />
+ <inherits name='org.cobogw.gwt.user.User' />
+
<!-- gwt-ext -->
<inherits name='com.gwtext.GwtExt' />
<script src="js/ext/adapter/ext/ext-base.js" />
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2009-03-25 17:15:09 UTC (rev 1087)
@@ -328,8 +328,8 @@
RTEActionTopToolbar topBar = $(RTEActionTopToolbar.class);
RTEActionSndToolbar sndBar = $(RTEActionSndToolbar.class);
final RTEditorPresenter presenter = new RTEditorPresenter($(I18nTranslationService.class),
- $(Session.class), topBar, sndBar, $(RTEImgResources.class), $(InsertLinkDialog.class),
- $(ColorWebSafePalette.class), $$(EditHtmlDialog.class), $$(InsertImageDialog.class),
+ $(Session.class), topBar, sndBar, $(RTEImgResources.class), $$(InsertLinkDialog.class),
+ $$(ColorWebSafePalette.class), $$(EditHtmlDialog.class), $$(InsertImageDialog.class),
$$(InsertTableDialog.class), $$(InsertSpecialCharDialog.class), $(DeferredCommandWrapper.class));
final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class),
$(ActionManager.class), $(GlobalShortcutRegister.class));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-25 17:15:09 UTC (rev 1087)
@@ -22,6 +22,7 @@
import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtmlDialog;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.ImageInfo;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
@@ -63,31 +64,33 @@
private ActionToolbarPushButtonDescriptor<Object> underline;
private ActionToolbarPushButtonDescriptor<Object> strikethrough;
private final Event0 onEdit;
- private final InsertLinkDialog insertElement;
- private final ColorWebSafePalette palette;
private final DeferredCommandWrapper deferred;
private final ActionAddCondition<Object> canBeBasic;
private final ActionAddCondition<Object> canBeExtended;
+ private final Provider<ColorWebSafePalette> palette;
+ private final Provider<InsertLinkDialog> insertLinkDialog;
private final Provider<EditHtmlDialog> editHtmlDialog;
private final Provider<InsertImageDialog> insertImageDialog;
private final Provider<InsertTableDialog> insertTableDialog;
private Listener<String> insertTableListener;
private Listener<LinkInfo> insertLinkListener;
+ private Listener<ImageInfo> insertImageListener;
private Listener<String> updateHtmlListener;
private ActionToolbarButtonDescriptor<Object> insertTableBtn;
private final Provider<InsertSpecialCharDialog> insertSpecialCharDialog;
protected Listener<String> insertSpecialCharListener;
public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
- RTEActionSndToolbar sndBar, RTEImgResources imgResources, InsertLinkDialog textEditorInsertElement,
- ColorWebSafePalette palette, Provider<EditHtmlDialog> editHtmlDialog,
- Provider<InsertImageDialog> insertImageDialog, Provider<InsertTableDialog> insertTableDialog,
- Provider<InsertSpecialCharDialog> insertSpecialCharDialog, DeferredCommandWrapper deferred) {
+ RTEActionSndToolbar sndBar, RTEImgResources imgResources,
+ Provider<InsertLinkDialog> textEditorInsertElement, Provider<ColorWebSafePalette> palette,
+ Provider<EditHtmlDialog> editHtmlDialog, Provider<InsertImageDialog> insertImageDialog,
+ Provider<InsertTableDialog> insertTableDialog, Provider<InsertSpecialCharDialog> insertSpecialCharDialog,
+ DeferredCommandWrapper deferred) {
this.i18n = i18n;
this.session = session;
this.topBar = topBar;
this.sndBar = sndBar;
- this.insertElement = textEditorInsertElement;
+ this.insertLinkDialog = textEditorInsertElement;
this.palette = palette;
this.editHtmlDialog = editHtmlDialog;
this.insertImageDialog = insertImageDialog;
@@ -182,7 +185,7 @@
public void onEditorFocus() {
topBar.hideAllMenus();
sndBar.hideAllMenus();
- palette.hide();
+ palette.get().hide();
}
public void setExtended(boolean extended) {
@@ -215,8 +218,8 @@
}
private void createBasicActions() {
- ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
- new Listener0() {
+ ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ topbarPosition, new Listener0() {
public void onEvent() {
view.selectAll();
}
@@ -263,8 +266,8 @@
underline.setShortcut(new ShortcutDescriptor(true, 'U'));
underline.setAddCondition(canBeBasic);
- ActionToolbarMenuDescriptor<Object> subscript = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
- new Listener0() {
+ ActionToolbarMenuDescriptor<Object> subscript = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ topbarPosition, new Listener0() {
public void onEvent() {
view.toggleSubscript();
fireOnEdit();
@@ -276,8 +279,8 @@
subscript.setShortcut(new ShortcutDescriptor(true, 188, ","));
subscript.setAddCondition(canBeBasic);
- ActionToolbarMenuDescriptor<Object> superscript = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
- new Listener0() {
+ ActionToolbarMenuDescriptor<Object> superscript = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ topbarPosition, new Listener0() {
public void onEvent() {
view.toggleSuperscript();
fireOnEdit();
@@ -352,8 +355,8 @@
redo.setBottomSeparator(true);
redo.setIconCls(getCssName(imgResources.redo()));
- ActionToolbarButtonDescriptor<Object> undoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
- new Listener0() {
+ ActionToolbarButtonDescriptor<Object> undoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.undo();
fireOnEdit();
@@ -364,8 +367,8 @@
undoBtn.setIconCls(getCssName(imgResources.undo()));
undoBtn.setPosition(0);
- ActionToolbarButtonDescriptor<Object> redoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
- new Listener0() {
+ ActionToolbarButtonDescriptor<Object> redoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.redo();
fireOnEdit();
@@ -415,8 +418,8 @@
paste.setAddCondition(canBeExtended);
paste.setIconCls(getCssName(imgResources.paste()));
- ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
- new Listener0() {
+ ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ topbarPosition, new Listener0() {
public void onEvent() {
if (updateHtmlListener == null) {
@@ -438,8 +441,8 @@
editHtml.setParentMenuTitle(i18n.t(EDIT_MENU));
editHtml.setAddCondition(canBeExtended);
- ActionToolbarMenuDescriptor<Object> comment = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
- new Listener0() {
+ ActionToolbarMenuDescriptor<Object> comment = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ topbarPosition, new Listener0() {
public void onEvent() {
deferred.addCommand(new Listener0() {
public void onEvent() {
@@ -495,8 +498,8 @@
hr.setParentMenuTitle(i18n.t(INSERT_MENU));
hr.setAddCondition(canBeExtended);
- ActionToolbarMenuDescriptor<Object> blockquote = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
- new Listener0() {
+ ActionToolbarMenuDescriptor<Object> blockquote = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ topbarPosition, new Listener0() {
public void onEvent() {
view.focus();
view.insertBlockquote();
@@ -507,8 +510,8 @@
blockquote.setParentMenuTitle(i18n.t(FORMAT_MENU));
blockquote.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> hrButton = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
- new Listener0() {
+ ActionToolbarButtonDescriptor<Object> hrButton = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.focus();
view.insertHorizontalRule();
@@ -577,10 +580,29 @@
ul.setRightSeparator(ActionToolbarButtonSeparator.separator);
ul.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> imgBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
- new Listener0() {
+ ActionToolbarButtonDescriptor<Object> imgBtn = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ sndbarPosition, new Listener0() {
public void onEvent() {
- insertImageDialog.get().show();
+ deferred.addCommand(new Listener0() {
+ public void onEvent() {
+ if (insertImageListener == null) {
+ insertImageListener = new Listener<ImageInfo>() {
+ public void onEvent(ImageInfo imageInfo) {
+ String img = imageInfo.toString();
+ Log.debug("Image: " + imageInfo);
+ view.focus();
+ view.insertHtml(img);
+ fireOnEdit();
+ }
+ };
+ }
+ InsertImageDialog dialog = insertImageDialog.get();
+ dialog.setImageInfo(new ImageInfo("", true, ImageInfo.POSITION_LEFT,
+ ImageInfo.SIZE_ORIGINAL));
+ dialog.setOnCreateImage(insertImageListener);
+ dialog.show();
+ }
+ });
}
});
imgBtn.setIconCls(getCssName(imgResources.images()));
@@ -596,33 +618,31 @@
ActionToolbarButtonDescriptor<Object> createOrEditLinkBtn = new ActionToolbarButtonDescriptor<Object>(
accessRol, sndbarPosition, new Listener0() {
public void onEvent() {
- deferred.addCommand(new Listener0() {
- public void onEvent() {
- if (insertLinkListener == null) {
- insertLinkListener = new Listener<LinkInfo>() {
- public void onEvent(LinkInfo linkInfo) {
- String link = linkInfo.toString();
- Log.debug("Link: " + link);
- view.focus();
- view.insertHtml(link);
- fireOnEdit();
- }
- };
+ if (insertLinkListener == null) {
+ insertLinkListener = new Listener<LinkInfo>() {
+ public void onEvent(LinkInfo linkInfo) {
+ String link = linkInfo.toString();
+ Log.debug("Link: " + link);
+ view.focus();
+ view.insertHtml(link);
+ fireOnEdit();
}
- LinkInfo linkInfo = view.getLinkInfoIfHref();
- insertElement.setLinkInfo(linkInfo);
- insertElement.setOnCreateLink(insertLinkListener);
- insertElement.show();
- String href = linkInfo.getHref();
- if (href.length() > 0) {
- if (href.startsWith("mailto")) {
- insertElement.activateTab(2);
- } else {
- insertElement.activateTab(1);
- }
- }
+ };
+ }
+ LinkInfo linkInfo = view.getLinkInfoIfHref();
+ InsertLinkDialog dialog = insertLinkDialog.get();
+ dialog.setLinkInfo(linkInfo);
+ dialog.setOnCreateLink(insertLinkListener);
+ dialog.show();
+ String href = linkInfo.getHref();
+ if (href.length() > 0) {
+ if (href.startsWith("mailto")) {
+ dialog.activateTab(2);
+ } else {
+ dialog.activateTab(1);
}
- });
+ }
+
}
});
createOrEditLinkBtn.setIconCls(getCssName(imgResources.link()));
@@ -638,8 +658,8 @@
createOrEditLink.setActionPosition(topbarPosition);
createOrEditLink.setParentMenuTitle(i18n.t(INSERT_MENU));
- ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
- new Listener0() {
+ ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.unlink();
fireOnEdit();
@@ -734,14 +754,14 @@
final ActionToolbarButtonDescriptor<Object> fontColor = new ActionToolbarButtonDescriptor<Object>(accessRol,
sndbarPosition, new Listener0() {
public void onEvent() {
- palette.show(getActionLeftPosition(sndBar, insertTableBtn), getActionTopPosition(sndBar,
- removeFormatBtn), new Listener<String>() {
- public void onEvent(String color) {
- palette.hide();
- view.setForeColor(color);
- fireOnEdit();
- }
- });
+ palette.get().show(getActionLeftPosition(sndBar, insertTableBtn),
+ getActionTopPosition(sndBar, removeFormatBtn), new Listener<String>() {
+ public void onEvent(String color) {
+ palette.get().hide();
+ view.setForeColor(color);
+ fireOnEdit();
+ }
+ });
}
});
fontColor.setIconCls(getCssName(imgResources.fontcolor()));
@@ -751,10 +771,10 @@
ActionToolbarButtonDescriptor<Object> backgroundColor = new ActionToolbarButtonDescriptor<Object>(accessRol,
sndbarPosition, new Listener0() {
public void onEvent() {
- palette.show(getActionLeftPosition(sndBar, fontColor), getActionTopPosition(sndBar, fontColor),
- new Listener<String>() {
+ palette.get().show(getActionLeftPosition(sndBar, fontColor),
+ getActionTopPosition(sndBar, fontColor), new Listener<String>() {
public void onEvent(String color) {
- palette.hide();
+ palette.get().hide();
view.setBackColor(color);
fireOnEdit();
}
@@ -765,8 +785,8 @@
backgroundColor.setToolTip(i18n.t("Text Background Colour"));
backgroundColor.setAddCondition(canBeBasic);
- final ActionToolbarMenuDescriptor<Object> devInfo = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
- new Listener0() {
+ final ActionToolbarMenuDescriptor<Object> devInfo = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ topbarPosition, new Listener0() {
public void onEvent() {
deferred.addCommand(new Listener0() {
public void onEvent() {
@@ -836,8 +856,8 @@
private ActionToolbarMenuDescriptor<Object> createFontNameAction(ActionAddCondition<Object> canBeBasic,
final String fontName) {
- final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol, sndbarPosition,
- new Listener0() {
+ final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.setFontName(fontName);
fireOnEdit();
@@ -852,8 +872,8 @@
private ActionToolbarMenuDescriptor<Object> createFontSizeAction(ActionAddCondition<Object> canBeBasic,
final int fontSize, String fontSizeName) {
- final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol, sndbarPosition,
- new Listener0() {
+ final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.setFontSize(fontSizesConstants[fontSize]);
fireOnEdit();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2009-03-25 17:15:09 UTC (rev 1087)
@@ -1,31 +1,59 @@
package org.ourproject.kune.platf.client.ui.rte.insertimg;
+import org.cobogw.gwt.user.client.CSS;
+
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.DOM;
+
public class ImageInfo {
- public static String[][] positions = { new String[] { "left" }, new String[] { "center" }, new String[] { "right" } };
+ public static final String SIZE_ORIGINAL = "original";
+ public static final String SIZE_FIT = "fit";
+ public static final String SIZE_XS = "xs";
+ public static final String SIZE_S = "s";
+ public static final String SIZE_M = "m";
+ public static final String SIZE_L = "l";
+ public static final String SIZE_XL = "xl";
+ public static final String POSITION_LEFT = "left";
+ public static final String POSITION_CENTER = "center";
+ public static final String POSITION_RIGHT = "right";
- public static String[][] sizes = { new String[] { "original", "Original image size", "" },
- new String[] { "fit", "Fit page width", "100%" },
- new String[] { "xs", "Thumbnail, up to 160 pixels wide", "160px" },
- new String[] { "s", "Small, up to 320 pixels wide", "320px" },
- new String[] { "m", "Medium, up to 640 pixels wide", "640px" },
- new String[] { "l", "Large, up to 1024 pixels wide", "1024px" },
- new String[] { "xl", "Extra large, up to 1600 pixels wide", "1600px" } };
+ public static String[][] positions = { new String[] { POSITION_LEFT }, new String[] { POSITION_CENTER },
+ new String[] { POSITION_RIGHT } };
- private String href;
+ public static String[][] sizes = { new String[] { SIZE_ORIGINAL, "Original image size", "" },
+ new String[] { SIZE_FIT, "Fit page width", "100%" },
+ new String[] { SIZE_XS, "Thumbnail, up to 160 pixels wide", "160px" },
+ new String[] { SIZE_S, "Small, up to 320 pixels wide", "320px" },
+ new String[] { SIZE_M, "Medium, up to 640 pixels wide", "640px" },
+ new String[] { SIZE_L, "Large, up to 1024 pixels wide", "1024px" },
+ new String[] { SIZE_XL, "Extra large, up to 1600 pixels wide", "1600px" } };
+
+ private String src;
private boolean wraptext;
private String position;
private String size;
- public ImageInfo(String href, boolean wraptext, String position, String size) {
- this.href = href;
+ public ImageInfo(String src, boolean wraptext, String position, String size) {
+ this.src = src;
this.wraptext = wraptext;
this.setPosition(position);
this.setSize(size);
}
- public String getHref() {
- return href;
+ public Element getElement() {
+ com.google.gwt.user.client.Element img = DOM.createImg();
+ DOM.setElementProperty(img, "src", src);
+ CSS.setProperty(img, CSS.A.WIDTH, getStyleSize());
+ if (!wraptext || position.equals(POSITION_CENTER)) {
+ com.google.gwt.user.client.Element divEl = DOM.createDiv();
+ CSS.setProperty(divEl, CSS.A.TEXT_ALIGN, position);
+ divEl.setInnerHTML(img.getString());
+ return divEl;
+ } else {
+ CSS.setProperty(img, CSS.A.FLOAT, position);
+ return img;
+ }
}
public String getPosition() {
@@ -36,14 +64,14 @@
return size;
}
+ public String getSrc() {
+ return src;
+ }
+
public boolean isWraptext() {
return wraptext;
}
- public void setHref(String href) {
- this.href = href;
- }
-
public void setPosition(String position) {
this.position = position;
}
@@ -52,8 +80,26 @@
this.size = size;
}
+ public void setSrc(String src) {
+ this.src = src;
+ }
+
public void setWraptext(boolean wraptext) {
this.wraptext = wraptext;
}
+ @Override
+ public String toString() {
+ Element element = getElement();
+ return element.getString();
+ }
+
+ private String getStyleSize() {
+ for (String[] current : sizes) {
+ if (current[1].equals(size)) {
+ return current[2];
+ }
+ }
+ return "";
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java 2009-03-25 17:15:09 UTC (rev 1087)
@@ -5,6 +5,7 @@
import org.ourproject.kune.platf.client.ui.rte.insertimg.ImageInfo;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialogView;
+import com.gwtext.client.data.Record;
import com.gwtext.client.data.SimpleStore;
import com.gwtext.client.data.Store;
import com.gwtext.client.widgets.Component;
@@ -12,6 +13,7 @@
import com.gwtext.client.widgets.form.Checkbox;
import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.FieldSet;
+import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
import com.gwtext.client.widgets.form.event.FormPanelListenerAdapter;
public class InsertImageAbstractPanel extends DefaultForm implements InsertImageAbstractView {
@@ -36,9 +38,17 @@
sizeCombo = createCombo(storeSizes, Resources.i18n.t("Size"));
positionCombo = createCombo(storePositions, Resources.i18n.t("Position"));
- wrapText = new Checkbox(Resources.i18n.t("Open link in new window"));
+ wrapText = new Checkbox(Resources.i18n.t("Wrap text around image"));
wrapText.setChecked(false);
+ positionCombo.addListener(new ComboBoxListenerAdapter() {
+ @Override
+ public void onSelect(ComboBox comboBox, Record record, int index) {
+ String pos = record.getAsString("abbr");
+ setWrapVisible(pos);
+ }
+ });
+
super.addListener(new FormPanelListenerAdapter() {
@Override
public void onActivate(Panel panel) {
@@ -59,18 +69,18 @@
add(advanced);
}
- public String getHref() {
- return null;
- }
-
public String getPosition() {
- return positionCombo.getValue();
+ return positionCombo.getValueAsString();
}
public String getSize() {
- return sizeCombo.getValue();
+ return sizeCombo.getValueAsString();
}
+ public String getSrc() {
+ return null;
+ }
+
@Override
public void insert(int index, Component component) {
super.insert(index, component);
@@ -82,14 +92,15 @@
protected void updateValues(ImageInfo imageInfo) {
sizeCombo.setValue(imageInfo.getSize());
- positionCombo.setValue(imageInfo.getPosition());
- if (wrapText.isVisible()) {
- wrapText.setChecked(imageInfo.isWraptext());
- }
+ String position = imageInfo.getPosition();
+ positionCombo.setValue(position);
+ wrapText.setChecked(imageInfo.isWraptext());
+ setWrapVisible(position);
}
private ComboBox createCombo(final Store storeSizes, String title) {
ComboBox cb = new ComboBox();
+ cb.setEditable(false);
cb.setForceSelection(true);
cb.setMinChars(1);
cb.setFieldLabel(title);
@@ -97,14 +108,14 @@
cb.setDisplayField("trans");
cb.setMode(ComboBox.LOCAL);
cb.setTriggerAction(ComboBox.ALL);
- // cb.setEmptyText("Enter state");
- // cb.setLoadingText("Searching...");
cb.setTypeAhead(true);
cb.setSelectOnFocus(true);
cb.setWidth(DEF_FIELD_WIDTH);
cb.setHideTrigger(false);
cb.setAllowBlank(false);
cb.setValidationEvent(false);
+ cb.setListWidth(DEF_FIELD_WIDTH + 30);
+ cb.setResizable(true);
return cb;
}
@@ -134,4 +145,12 @@
return sizesObjs;
}
+ private void setWrapVisible(String position) {
+ if (position.equals(ImageInfo.POSITION_CENTER)) {
+ wrapText.setVisible(false);
+ } else {
+ wrapText.setVisible(true);
+ }
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java 2009-03-25 17:15:09 UTC (rev 1087)
@@ -66,7 +66,7 @@
}
protected ImageInfo updateImageInfo() {
- return new ImageInfo(view.getHref(), view.wrapText(), view.getPosition(), view.getSize());
+ return new ImageInfo(view.getSrc(), view.wrapText(), view.getPosition(), view.getSize());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java 2009-03-25 17:15:09 UTC (rev 1087)
@@ -4,12 +4,12 @@
public interface InsertImageAbstractView extends View {
- String getHref();
-
String getPosition();
String getSize();
+ String getSrc();
+
boolean isValid();
void reset();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java 2009-03-25 17:15:09 UTC (rev 1087)
@@ -15,25 +15,25 @@
public class InsertImageExtPanel extends InsertImageAbstractPanel implements InsertImageExtView {
private static final String LINK_FIELD = "iiep-img-field";
- private final TextField linkField;
+ private final TextField srcField;
private final Panel previewPanel;
public InsertImageExtPanel(final InsertImageExtPresenter presenter, I18nTranslationService i18n) {
super(i18n.t("External image"), presenter);
- linkField = new TextField();
- linkField.setTabIndex(1);
- linkField.setFieldLabel(i18n.t("External image link (URL)"));
- linkField.setRegex(TextUtils.URL_REGEXP);
- linkField.setRegexText(i18n.t("The link should be a URL in the format 'http://www.domain.com'"));
- linkField.setName(LINK_FIELD);
- linkField.setWidth(DEF_FIELD_WIDTH);
- linkField.setAllowBlank(false);
- linkField.setMinLength(3);
- linkField.setMaxLength(250);
- linkField.setValidationEvent(false);
- linkField.setId(LINK_FIELD);
- add(linkField);
+ srcField = new TextField();
+ srcField.setTabIndex(1);
+ srcField.setFieldLabel(i18n.t("External image link (URL)"));
+ srcField.setRegex(TextUtils.URL_REGEXP);
+ srcField.setRegexText(i18n.t("The link should be a URL in the format 'http://www.domain.com'"));
+ srcField.setName(LINK_FIELD);
+ srcField.setWidth(DEF_FIELD_WIDTH);
+ srcField.setAllowBlank(false);
+ srcField.setMinLength(3);
+ srcField.setMaxLength(250);
+ srcField.setValidationEvent(false);
+ srcField.setId(LINK_FIELD);
+ insert(0, srcField);
previewPanel = new Panel();
previewPanel.setLayout(new FitLayout());
previewPanel.setHeight(125);
@@ -46,6 +46,10 @@
}
});
addButton(preview);
+ }
+ @Override
+ public String getSrc() {
+ return srcField.getValueAsString();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-25 17:15:09 UTC (rev 1087)
@@ -384,7 +384,7 @@
protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(String parentMenuTitle,
String... registerInTypes) {
final ActionToolbarMenuDescriptor<StateToken> refreshCnt = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Viewer, CONTENT_TOPBAR, new Listener<StateToken>() {
+ AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
stateManager.reload();
contextNavigator.selectItem(stateToken);
@@ -401,7 +401,7 @@
protected ActionToolbarMenuDescriptor<StateToken> createRefreshCxtAction(String parentMenuTitleCtx,
String... registerInTypes) {
final ActionToolbarMenuDescriptor<StateToken> refreshCtx = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Viewer, CONTEXT_TOPBAR, new Listener<StateToken>() {
+ AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
stateManager.reload();
contextNavigator.selectItem(stateToken);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java 2009-03-24 14:25:48 UTC (rev 1086)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java 2009-03-25 17:15:09 UTC (rev 1087)
@@ -1,12 +1,16 @@
package org.ourproject.kune.workspace.client.editor.insertlocalimg;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractPanel;
+import com.gwtext.client.widgets.form.Label;
+
public class InsertImageLocalPanel extends InsertImageAbstractPanel implements InsertImageLocalView {
public InsertImageLocalPanel(final InsertImageLocalPresenter presenter, I18nTranslationService i18n) {
super(i18n.t("Local image"), presenter);
+ insert(0, new Label(TextUtils.IN_DEVELOPMENT));
}
}
1
0
Author: vjrj
Date: 2009-03-24 15:25:48 +0100 (Tue, 24 Mar 2009)
New Revision: 1086
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstract.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExt.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocal.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalView.java
Log:
Complete - task RTE Create/Edit link improved
Incomplete - task Create/Edit Image
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -61,7 +61,7 @@
private final Listener<T> onPerformCall;
/** The on not confirmed. */
- private final Listener<T> onNotConfirmed;
+ private Listener<T> onNotConfirmed;
/** The must be authenticated. */
private boolean mustBeAuthenticated;
@@ -141,6 +141,24 @@
this.enableCondition = enableCondition;
}
+ public ActionDescriptor(ActionDescriptor<T> copy) {
+ this(copy.getAccessRol(), copy.getOnPerformCall());
+ setAddCondition(copy.getAddCondition());
+ setConfirmationText(copy.getConfirmationText());
+ setConfirmationTitle(copy.getConfirmationTitle());
+ setEnableCondition(copy.getEnableCondition());
+ setIconCls(copy.getIconCls());
+ setIconDescriptor(copy.getIconDescriptor());
+ setIconUrl(copy.getIconUrl());
+ setMustBeAuthenticated(copy.mustBeAuthenticated());
+ setMustBeConfirmed(copy.mustBeConfirmed());
+ setOnNotConfirmed(copy.getOnNotConfirmed());
+ setPosition(copy.getPosition());
+ setShortcut(copy.getShortcut());
+ setTextDescription(copy.getTextDescription());
+ setToolTip(copy.getToolTip());
+ }
+
/**
* Fire on not confirmed.
*
@@ -262,15 +280,6 @@
return shortcut != null;
}
- /**
- * Checks if is must be confirmed.
- *
- * @return true, if is must be confirmed
- */
- public boolean isMustBeConfirmed() {
- return mustBeConfirmed;
- }
-
public boolean mustBeAdded(T item) {
return addCondition != null ? addCondition.mustBeAdded(item) : true;
}
@@ -284,6 +293,15 @@
return mustBeAuthenticated;
}
+ /**
+ * Checks if is must be confirmed.
+ *
+ * @return true, if is must be confirmed
+ */
+ public boolean mustBeConfirmed() {
+ return mustBeConfirmed;
+ }
+
public boolean mustBeEnabled(T item) {
return enableCondition != null ? enableCondition.mustBeEnabled(item) : true;
}
@@ -424,4 +442,29 @@
public void setToolTip(final String toolTip) {
this.toolTip = toolTip;
}
+
+ private ActionAddCondition<T> getAddCondition() {
+ return addCondition;
+ }
+
+ private ActionEnableCondition<T> getEnableCondition() {
+ return enableCondition;
+ }
+
+ private Listener<T> getOnNotConfirmed() {
+ return onNotConfirmed;
+ }
+
+ private Listener<T> getOnPerformCall() {
+ return onPerformCall;
+ }
+
+ private String getTextDescription() {
+ return textDescription;
+ }
+
+ private void setOnNotConfirmed(Listener<T> onNotConfirmed) {
+ this.onNotConfirmed = onNotConfirmed;
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -31,7 +31,7 @@
public void doAction(final ActionItem<?> actionItem) {
final ActionDescriptor<?> action = actionItem.getAction();
final Object item = actionItem.getItem();
- if (action.isMustBeConfirmed()) {
+ if (action.mustBeConfirmed()) {
NotifyUser.askConfirmation(action.getConfirmationTitle(), action.getConfirmationText(), new Listener0() {
public void onEvent() {
fire(action, item);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -63,6 +63,10 @@
super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
}
+ public ActionToolbarButtonDescriptor(ActionDescriptor<T> copy) {
+ super(copy);
+ }
+
public ActionToolbarButtonSeparator getLeftSeparator() {
return leftSeparator;
}
@@ -86,4 +90,5 @@
public void setRightSeparator(final ActionToolbarButtonSeparator rightSeparator) {
this.rightSeparator = rightSeparator;
}
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -64,6 +64,15 @@
this.actionToolbarPosition = actionToolbarPosition;
}
+ public ActionToolbarDescriptor(ActionDescriptor<T> copy) {
+ super(copy);
+ }
+
+ public ActionToolbarDescriptor(ActionToolbarDescriptor<T> copy) {
+ super(copy);
+ setActionPosition(copy.getActionPosition());
+ }
+
public ActionToolbarPosition getActionPosition() {
return actionToolbarPosition;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -69,6 +69,10 @@
super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
}
+ public ActionToolbarMenuDescriptor(ActionDescriptor<T> copy) {
+ super(copy);
+ }
+
public String getParentMenuIconCls() {
return parentMenuIconCls;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -11,8 +11,8 @@
public interface RTEditor {
- public final ActionToolbarPosition topbar = new ActionToolbarPosition("rte-topbar");
- public final ActionToolbarPosition sndbar = new ActionToolbarPosition("rte-sndbar");;
+ public final ActionToolbarPosition topbarPosition = new ActionToolbarPosition("rte-topbar");
+ public final ActionToolbarPosition sndbarPosition = new ActionToolbarPosition("rte-sndbar");;
void addAction(ActionDescriptor<Object> action);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -132,8 +132,8 @@
public void attach() {
topBar.clear();
sndBar.clear();
- topBar.addActions(actions, topbar);
- sndBar.addActions(actions, sndbar);
+ topBar.addActions(actions, topbarPosition);
+ sndBar.addActions(actions, sndbarPosition);
view.addActions(actions);
}
@@ -215,7 +215,7 @@
}
private void createBasicActions() {
- ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
view.selectAll();
@@ -229,7 +229,7 @@
selectAll.setTopSeparator(true);
selectAll.setBottomSeparator(true);
- bold = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbar, new Listener0() {
+ bold = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbarPosition, new Listener0() {
public void onEvent() {
view.toggleBold();
fireOnEdit();
@@ -240,7 +240,7 @@
bold.setShortcut(new ShortcutDescriptor(true, 'B'));
bold.setAddCondition(canBeBasic);
- italic = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbar, new Listener0() {
+ italic = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbarPosition, new Listener0() {
public void onEvent() {
view.toggleItalic();
fireOnEdit();
@@ -252,7 +252,7 @@
italic.setAddCondition(canBeBasic);
italic.setAddCondition(canBeBasic);
- underline = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbar, new Listener0() {
+ underline = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbarPosition, new Listener0() {
public void onEvent() {
view.toggleUnderline();
fireOnEdit();
@@ -263,7 +263,7 @@
underline.setShortcut(new ShortcutDescriptor(true, 'U'));
underline.setAddCondition(canBeBasic);
- ActionToolbarMenuDescriptor<Object> subscript = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> subscript = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
view.toggleSubscript();
@@ -276,7 +276,7 @@
subscript.setShortcut(new ShortcutDescriptor(true, 188, ","));
subscript.setAddCondition(canBeBasic);
- ActionToolbarMenuDescriptor<Object> superscript = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> superscript = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
view.toggleSuperscript();
@@ -290,7 +290,7 @@
superscript.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyLeft = new ActionToolbarButtonDescriptor<Object>(accessRol,
- sndbar, new Listener0() {
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.justifyLeft();
fireOnEdit();
@@ -302,7 +302,7 @@
justifyLeft.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyCentre = new ActionToolbarButtonDescriptor<Object>(accessRol,
- sndbar, new Listener0() {
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.justifyCenter();
fireOnEdit();
@@ -314,7 +314,7 @@
justifyCentre.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyRight = new ActionToolbarButtonDescriptor<Object>(accessRol,
- sndbar, new Listener0() {
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.justifyRight();
fireOnEdit();
@@ -325,7 +325,7 @@
justifyRight.setShortcut(new ShortcutDescriptor(true, 'R'));
justifyRight.setAddCondition(canBeBasic);
- ActionToolbarMenuDescriptor<Object> undo = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> undo = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
view.undo();
@@ -338,7 +338,7 @@
undo.setAddCondition(canBeExtended);
undo.setIconCls(getCssName(imgResources.undo()));
- ActionToolbarMenuDescriptor<Object> redo = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> redo = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
view.redo();
@@ -352,7 +352,7 @@
redo.setBottomSeparator(true);
redo.setIconCls(getCssName(imgResources.redo()));
- ActionToolbarButtonDescriptor<Object> undoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ ActionToolbarButtonDescriptor<Object> undoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
new Listener0() {
public void onEvent() {
view.undo();
@@ -364,7 +364,7 @@
undoBtn.setIconCls(getCssName(imgResources.undo()));
undoBtn.setPosition(0);
- ActionToolbarButtonDescriptor<Object> redoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ ActionToolbarButtonDescriptor<Object> redoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
new Listener0() {
public void onEvent() {
view.redo();
@@ -377,7 +377,7 @@
redoBtn.setPosition(1);
redoBtn.setRightSeparator(ActionToolbarButtonSeparator.separator);
- ActionToolbarMenuDescriptor<Object> copy = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> copy = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
view.copy();
@@ -389,7 +389,7 @@
copy.setAddCondition(canBeExtended);
copy.setIconCls(getCssName(imgResources.copy()));
- ActionToolbarMenuDescriptor<Object> cut = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> cut = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
view.cut();
@@ -402,7 +402,7 @@
cut.setAddCondition(canBeExtended);
cut.setIconCls(getCssName(imgResources.cut()));
- ActionToolbarMenuDescriptor<Object> paste = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> paste = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
view.paste();
@@ -415,7 +415,7 @@
paste.setAddCondition(canBeExtended);
paste.setIconCls(getCssName(imgResources.paste()));
- ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
@@ -438,7 +438,7 @@
editHtml.setParentMenuTitle(i18n.t(EDIT_MENU));
editHtml.setAddCondition(canBeExtended);
- ActionToolbarMenuDescriptor<Object> comment = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> comment = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
deferred.addCommand(new Listener0() {
@@ -481,7 +481,7 @@
comment.setEnableCondition(isInsertHtmlSupported());
comment.setAddCondition(canBeExtended);
- ActionToolbarMenuDescriptor<Object> hr = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> hr = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
view.focus();
@@ -495,7 +495,7 @@
hr.setParentMenuTitle(i18n.t(INSERT_MENU));
hr.setAddCondition(canBeExtended);
- ActionToolbarMenuDescriptor<Object> blockquote = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ ActionToolbarMenuDescriptor<Object> blockquote = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
view.focus();
@@ -507,7 +507,7 @@
blockquote.setParentMenuTitle(i18n.t(FORMAT_MENU));
blockquote.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> hrButton = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ ActionToolbarButtonDescriptor<Object> hrButton = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
new Listener0() {
public void onEvent() {
view.focus();
@@ -519,7 +519,7 @@
hrButton.setToolTip(i18n.t("Horizontal line"));
hrButton.setAddCondition(canBeExtended);
- strikethrough = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbar, new Listener0() {
+ strikethrough = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbarPosition, new Listener0() {
public void onEvent() {
view.toggleStrikethrough();
fireOnEdit();
@@ -531,7 +531,7 @@
strikethrough.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> decreaseIndent = new ActionToolbarButtonDescriptor<Object>(accessRol,
- sndbar, new Listener0() {
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.leftIndent();
fireOnEdit();
@@ -542,7 +542,7 @@
decreaseIndent.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> increaseIndent = new ActionToolbarButtonDescriptor<Object>(accessRol,
- sndbar, new Listener0() {
+ sndbarPosition, new Listener0() {
public void onEvent() {
view.rightIndent();
fireOnEdit();
@@ -552,7 +552,7 @@
increaseIndent.setToolTip(i18n.t("Increase Indent"));
increaseIndent.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> ol = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ ActionToolbarButtonDescriptor<Object> ol = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
new Listener0() {
public void onEvent() {
view.insertOrderedList();
@@ -564,7 +564,7 @@
ol.setShortcut(new ShortcutDescriptor(true, '7'));
ol.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> ul = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ ActionToolbarButtonDescriptor<Object> ul = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
new Listener0() {
public void onEvent() {
view.insertUnorderedList();
@@ -577,18 +577,24 @@
ul.setRightSeparator(ActionToolbarButtonSeparator.separator);
ul.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> img = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ ActionToolbarButtonDescriptor<Object> imgBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
new Listener0() {
public void onEvent() {
insertImageDialog.get().show();
}
});
- img.setIconCls(getCssName(imgResources.images()));
- img.setToolTip(i18n.t("Insert Image"));
- img.setAddCondition(canBeExtended);
+ imgBtn.setIconCls(getCssName(imgResources.images()));
+ imgBtn.setToolTip(i18n.t("Insert Image"));
+ imgBtn.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> createOrEditLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
- sndbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> imgMenu = new ActionToolbarMenuDescriptor<Object>(imgBtn);
+ imgMenu.setTextDescription(i18n.t("Image..."));
+ imgMenu.setToolTip(null);
+ imgMenu.setParentMenuTitle(i18n.t(INSERT_MENU));
+ imgMenu.setActionPosition(topbarPosition);
+
+ ActionToolbarButtonDescriptor<Object> createOrEditLinkBtn = new ActionToolbarButtonDescriptor<Object>(
+ accessRol, sndbarPosition, new Listener0() {
public void onEvent() {
deferred.addCommand(new Listener0() {
public void onEvent() {
@@ -619,12 +625,20 @@
});
}
});
- createOrEditLink.setIconCls(getCssName(imgResources.link()));
- createOrEditLink.setToolTip(i18n.t("Create or Edit Link"));
- createOrEditLink.setShortcut(new ShortcutDescriptor(true, 'K'));
- createOrEditLink.setAddCondition(canBeExtended);
+ createOrEditLinkBtn.setIconCls(getCssName(imgResources.link()));
+ createOrEditLinkBtn.setToolTip(i18n.t("Create or Edit Link"));
+ createOrEditLinkBtn.setShortcut(new ShortcutDescriptor(true, 'K'));
+ createOrEditLinkBtn.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ ActionToolbarMenuDescriptor<Object> createOrEditLink = new ActionToolbarMenuDescriptor<Object>(
+ createOrEditLinkBtn);
+ createOrEditLink.setTextDescription(i18n.t("Link...") + createOrEditLinkBtn.getShortcutToS());
+ createOrEditLink.setToolTip(null);
+ createOrEditLink.setShortcut(null);
+ createOrEditLink.setActionPosition(topbarPosition);
+ createOrEditLink.setParentMenuTitle(i18n.t(INSERT_MENU));
+
+ ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition,
new Listener0() {
public void onEvent() {
view.unlink();
@@ -637,7 +651,7 @@
removeLink.setAddCondition(canBeExtended);
final ActionToolbarMenuDescriptor<Object> removeFormat = new ActionToolbarMenuDescriptor<Object>(accessRol,
- topbar, new Listener0() {
+ topbarPosition, new Listener0() {
public void onEvent() {
view.removeFormat();
fireOnEdit();
@@ -651,7 +665,7 @@
removeFormat.setBottomSeparator(true);
final ActionToolbarButtonDescriptor<Object> removeFormatBtn = new ActionToolbarButtonDescriptor<Object>(
- accessRol, sndbar, new Listener0() {
+ accessRol, sndbarPosition, new Listener0() {
public void onEvent() {
view.removeFormat();
fireOnEdit();
@@ -664,7 +678,7 @@
removeFormatBtn.setRightSeparator(ActionToolbarButtonSeparator.separator);
final ActionToolbarMenuDescriptor<Object> insertSpecialChar = new ActionToolbarMenuDescriptor<Object>(
- accessRol, topbar, new Listener0() {
+ accessRol, topbarPosition, new Listener0() {
public void onEvent() {
NotifyUser.showProgressLoading();
if (insertSpecialCharListener == null) {
@@ -686,7 +700,7 @@
insertSpecialChar.setTopSeparator(true);
final ActionToolbarMenuDescriptor<Object> insertMedia = new ActionToolbarMenuDescriptor<Object>(accessRol,
- topbar, new Listener0() {
+ topbarPosition, new Listener0() {
public void onEvent() {
NotifyUser.info(TextUtils.IN_DEVELOPMENT);
}
@@ -697,7 +711,7 @@
insertMedia.setParentMenuTitle(i18n.t(INSERT_MENU));
final ActionToolbarMenuDescriptor<Object> insertTable = new ActionToolbarMenuDescriptor<Object>(accessRol,
- topbar, new Listener0() {
+ topbarPosition, new Listener0() {
public void onEvent() {
onInsertTablePressed();
}
@@ -707,7 +721,7 @@
insertTable.setAddCondition(canBeExtended);
insertTable.setParentMenuTitle(i18n.t(INSERT_MENU));
- insertTableBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar, new Listener0() {
+ insertTableBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbarPosition, new Listener0() {
public void onEvent() {
onInsertTablePressed();
}
@@ -718,7 +732,7 @@
insertTableBtn.setRightSeparator(ActionToolbarButtonSeparator.separator);
final ActionToolbarButtonDescriptor<Object> fontColor = new ActionToolbarButtonDescriptor<Object>(accessRol,
- sndbar, new Listener0() {
+ sndbarPosition, new Listener0() {
public void onEvent() {
palette.show(getActionLeftPosition(sndBar, insertTableBtn), getActionTopPosition(sndBar,
removeFormatBtn), new Listener<String>() {
@@ -735,7 +749,7 @@
fontColor.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> backgroundColor = new ActionToolbarButtonDescriptor<Object>(accessRol,
- sndbar, new Listener0() {
+ sndbarPosition, new Listener0() {
public void onEvent() {
palette.show(getActionLeftPosition(sndBar, fontColor), getActionTopPosition(sndBar, fontColor),
new Listener<String>() {
@@ -751,7 +765,7 @@
backgroundColor.setToolTip(i18n.t("Text Background Colour"));
backgroundColor.setAddCondition(canBeBasic);
- final ActionToolbarMenuDescriptor<Object> devInfo = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ final ActionToolbarMenuDescriptor<Object> devInfo = new ActionToolbarMenuDescriptor<Object>(accessRol, topbarPosition,
new Listener0() {
public void onEvent() {
deferred.addCommand(new Listener0() {
@@ -792,10 +806,12 @@
actions.add(withNoItem(ul));
actions.add(withNoItem(removeFormatBtn));
actions.add(withNoItem(hrButton));
- actions.add(withNoItem(img));
- actions.add(withNoItem(createOrEditLink));
+ actions.add(withNoItem(imgBtn));
+ actions.add(withNoItem(createOrEditLinkBtn));
actions.add(withNoItem(removeLink));
actions.add(withNoItem(insertTableBtn));
+ actions.add(withNoItem(createOrEditLink));
+ actions.add(withNoItem(imgMenu));
actions.add(withNoItem(insertTable));
actions.add(withNoItem(insertMedia));
actions.add(withNoItem(insertSpecialChar));
@@ -820,7 +836,7 @@
private ActionToolbarMenuDescriptor<Object> createFontNameAction(ActionAddCondition<Object> canBeBasic,
final String fontName) {
- final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol, sndbar,
+ final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol, sndbarPosition,
new Listener0() {
public void onEvent() {
view.setFontName(fontName);
@@ -836,7 +852,7 @@
private ActionToolbarMenuDescriptor<Object> createFontSizeAction(ActionAddCondition<Object> canBeBasic,
final int fontSize, String fontSizeName) {
- final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol, sndbar,
+ final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol, sndbarPosition,
new Listener0() {
public void onEvent() {
view.setFontSize(fontSizesConstants[fontSize]);
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -0,0 +1,59 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg;
+
+public class ImageInfo {
+
+ public static String[][] positions = { new String[] { "left" }, new String[] { "center" }, new String[] { "right" } };
+
+ public static String[][] sizes = { new String[] { "original", "Original image size", "" },
+ new String[] { "fit", "Fit page width", "100%" },
+ new String[] { "xs", "Thumbnail, up to 160 pixels wide", "160px" },
+ new String[] { "s", "Small, up to 320 pixels wide", "320px" },
+ new String[] { "m", "Medium, up to 640 pixels wide", "640px" },
+ new String[] { "l", "Large, up to 1024 pixels wide", "1024px" },
+ new String[] { "xl", "Extra large, up to 1600 pixels wide", "1600px" } };
+
+ private String href;
+ private boolean wraptext;
+ private String position;
+ private String size;
+
+ public ImageInfo(String href, boolean wraptext, String position, String size) {
+ this.href = href;
+ this.wraptext = wraptext;
+ this.setPosition(position);
+ this.setSize(size);
+ }
+
+ public String getHref() {
+ return href;
+ }
+
+ public String getPosition() {
+ return position;
+ }
+
+ public String getSize() {
+ return size;
+ }
+
+ public boolean isWraptext() {
+ return wraptext;
+ }
+
+ public void setHref(String href) {
+ this.href = href;
+ }
+
+ public void setPosition(String position) {
+ this.position = position;
+ }
+
+ public void setSize(String size) {
+ this.size = size;
+ }
+
+ public void setWraptext(boolean wraptext) {
+ this.wraptext = wraptext;
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -2,6 +2,23 @@
import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialog;
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
public interface InsertImageDialog extends AbstractTabbedDialog {
+ void fireOnInsertImage(ImageInfo imageInfo);
+
+ ImageInfo getImageInfo();
+
+ void setImageInfo(ImageInfo imageInfo);
+
+ void setImagePosition(String position);
+
+ void setImageSize(String size);
+
+ void setOnCreateImage(Listener<ImageInfo> listener);
+
+ void setOnInsertImagePressed(Listener0 onInsertLinkPressed);
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -4,18 +4,47 @@
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
+import com.calclab.suco.client.events.Listener0;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+
public class InsertImageDialogPanel extends AbstractTabbedDialogPanel implements InsertImageDialogView {
- private static final String INSERT_IMG_DIALOG = "iip-dial";
- private static final String INSERT_IMG_DIALOG_ERROR_ID = "iip-err";
+ private static final String INSERT_IMG_DIALOG = "k-iip-dial";
+ private static final String INSERT_IMG_DIALOG_ERROR_ID = "k-iip-err";
private final InsertImageGroup insertImageGroup;
- public InsertImageDialogPanel(final InsertImageDialogPresenter presenter, I18nTranslationService i18n, Images images,
- InsertImageGroup insertImageGroup) {
- super(INSERT_IMG_DIALOG, i18n.t("Insert an image"), 380, HEIGHT + 90, 380, HEIGHT + 90, true, images,
+ public InsertImageDialogPanel(final InsertImageDialogPresenter presenter, I18nTranslationService i18n,
+ Images images, final InsertImageGroup insertImageGroup) {
+ super(INSERT_IMG_DIALOG, i18n.t("Insert Image"), 380, HEIGHT + 100, 380, HEIGHT + 100, true, images,
INSERT_IMG_DIALOG_ERROR_ID);
super.setIconCls("k-picture-icon");
this.insertImageGroup = insertImageGroup;
+
+ super.addHideListener(new Listener0() {
+ public void onEvent() {
+ insertImageGroup.resetAll();
+ }
+ });
+
+ Button insert = new Button(i18n.t("Insert"));
+ insert.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ presenter.onInsert();
+ }
+ });
+
+ Button cancel = new Button(i18n.t("Cancel"));
+ cancel.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ presenter.onCancel();
+ }
+ });
+ addButton(insert);
+ addButton(cancel);
}
@Override
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -2,8 +2,49 @@
import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
public class InsertImageDialogPresenter extends AbstractTabbedDialogPresenter implements InsertImageDialog {
- public InsertImageDialogPresenter() {
+ private Listener<ImageInfo> onCreateListener;
+ private ImageInfo imageInfo;
+ private Listener0 onInsertPressed;
+
+ public void fireOnInsertImage(ImageInfo imageInfo) {
+ onCreateListener.onEvent(imageInfo);
+ super.hide();
}
+
+ public ImageInfo getImageInfo() {
+ return imageInfo;
+ }
+
+ public void setImageInfo(ImageInfo imageInfo) {
+ this.imageInfo = imageInfo;
+ }
+
+ public void setImagePosition(String position) {
+ imageInfo.setPosition(position);
+ }
+
+ public void setImageSize(String size) {
+ imageInfo.setSize(size);
+ }
+
+ public void setOnCreateImage(Listener<ImageInfo> listener) {
+ onCreateListener = listener;
+ }
+
+ public void setOnInsertImagePressed(Listener0 onInsertPressed) {
+ this.onInsertPressed = onInsertPressed;
+ }
+
+ protected void onCancel() {
+ super.hide();
+ }
+
+ protected void onInsert() {
+ onInsertPressed.onEvent();
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -3,5 +3,7 @@
import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogView;
public interface InsertImageDialogView extends AbstractTabbedDialogView {
- int HEIGHT = 225;
+
+ int HEIGHT = 350;
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -1,5 +1,7 @@
package org.ourproject.kune.platf.client.ui.rte.insertimg;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstract;
+
import com.calclab.suco.client.ioc.Container;
import com.calclab.suco.client.ioc.Provider;
import com.calclab.suco.client.ioc.decorator.ProviderCollection;
@@ -16,4 +18,10 @@
p.get();
}
}
+
+ public void resetAll() {
+ for (final Provider<?> p : getProviders()) {
+ ((InsertImageAbstract) p.get()).reset();
+ }
+ }
}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstract.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstract.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstract.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg;
+
+public interface InsertImageAbstract {
+
+ void reset();
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -0,0 +1,137 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg;
+
+import org.ourproject.kune.platf.client.i18n.Resources;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.ImageInfo;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialogView;
+
+import com.gwtext.client.data.SimpleStore;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.widgets.Component;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.form.Checkbox;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.FieldSet;
+import com.gwtext.client.widgets.form.event.FormPanelListenerAdapter;
+
+public class InsertImageAbstractPanel extends DefaultForm implements InsertImageAbstractView {
+
+ private Object[][] sizesObjs;
+ private Object[][] positionObjs;
+ private final ComboBox sizeCombo;
+ private final ComboBox positionCombo;
+ protected final Checkbox wrapText;
+
+ public InsertImageAbstractPanel(String title, final InsertImageAbstractPresenter presenter) {
+ super(title);
+ super.setAutoWidth(true);
+ super.setHeight(InsertImageDialogView.HEIGHT);
+
+ final Store storeSizes = new SimpleStore(new String[] { "abbr", "trans", "size" }, getSizes());
+ storeSizes.load();
+
+ final Store storePositions = new SimpleStore(new String[] { "abbr", "trans" }, getPositions());
+ storePositions.load();
+
+ sizeCombo = createCombo(storeSizes, Resources.i18n.t("Size"));
+ positionCombo = createCombo(storePositions, Resources.i18n.t("Position"));
+
+ wrapText = new Checkbox(Resources.i18n.t("Open link in new window"));
+ wrapText.setChecked(false);
+
+ super.addListener(new FormPanelListenerAdapter() {
+ @Override
+ public void onActivate(Panel panel) {
+ ImageInfo linkImage = presenter.getImageInfo();
+ updateValues(linkImage);
+ presenter.onActivate();
+ }
+ });
+
+ FieldSet advanced = new FieldSet(Resources.i18n.t("More options"));
+ advanced.setCollapsible(true);
+ advanced.setCollapsed(true);
+ advanced.setAutoHeight(true);
+
+ advanced.add(sizeCombo);
+ advanced.add(positionCombo);
+ advanced.add(wrapText);
+ add(advanced);
+ }
+
+ public String getHref() {
+ return null;
+ }
+
+ public String getPosition() {
+ return positionCombo.getValue();
+ }
+
+ public String getSize() {
+ return sizeCombo.getValue();
+ }
+
+ @Override
+ public void insert(int index, Component component) {
+ super.insert(index, component);
+ }
+
+ public boolean wrapText() {
+ return wrapText.getValue();
+ }
+
+ protected void updateValues(ImageInfo imageInfo) {
+ sizeCombo.setValue(imageInfo.getSize());
+ positionCombo.setValue(imageInfo.getPosition());
+ if (wrapText.isVisible()) {
+ wrapText.setChecked(imageInfo.isWraptext());
+ }
+ }
+
+ private ComboBox createCombo(final Store storeSizes, String title) {
+ ComboBox cb = new ComboBox();
+ cb.setForceSelection(true);
+ cb.setMinChars(1);
+ cb.setFieldLabel(title);
+ cb.setStore(storeSizes);
+ cb.setDisplayField("trans");
+ cb.setMode(ComboBox.LOCAL);
+ cb.setTriggerAction(ComboBox.ALL);
+ // cb.setEmptyText("Enter state");
+ // cb.setLoadingText("Searching...");
+ cb.setTypeAhead(true);
+ cb.setSelectOnFocus(true);
+ cb.setWidth(DEF_FIELD_WIDTH);
+ cb.setHideTrigger(false);
+ cb.setAllowBlank(false);
+ cb.setValidationEvent(false);
+ return cb;
+ }
+
+ private Object[][] getPositions() {
+ if (positionObjs == null) {
+ String[][] values = ImageInfo.positions;
+ positionObjs = new Object[values.length][1];
+ int i = 0;
+ for (String[] position : values) {
+ final Object[] obj = new Object[] { position[0], Resources.i18n.t(position[0]) };
+ positionObjs[i++] = obj;
+ }
+ }
+ return positionObjs;
+ }
+
+ private Object[][] getSizes() {
+ if (sizesObjs == null) {
+ String[][] values = ImageInfo.sizes;
+ sizesObjs = new Object[values.length][1];
+ int i = 0;
+ for (String[] size : values) {
+ final Object[] obj = new Object[] { size[0], Resources.i18n.t(size[1], size[2]) };
+ sizesObjs[i++] = obj;
+ }
+ }
+ return sizesObjs;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -0,0 +1,72 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.ImageInfo;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.events.Listener0;
+
+public class InsertImageAbstractPresenter implements InsertImageAbstract {
+
+ protected InsertImageAbstractView view;
+ protected final InsertImageDialog insertImageDialog;
+ private final Listener0 onInsertImagePressed;
+
+ public InsertImageAbstractPresenter(final InsertImageDialog insertImageDialog) {
+ this.insertImageDialog = insertImageDialog;
+ onInsertImagePressed = new Listener0() {
+ public void onEvent() {
+ if (isValid()) {
+ ImageInfo linkInfo = updateImageInfo();
+ insertImageDialog.fireOnInsertImage(linkInfo);
+ } else {
+ Log.debug("Form in InsertImage not valid");
+ }
+ }
+ };
+ }
+
+ public ImageInfo getImageInfo() {
+ return insertImageDialog.getImageInfo();
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(InsertImageAbstractView view) {
+ this.view = view;
+ insertImageDialog.addTab(view);
+ }
+
+ public boolean isValid() {
+ return view.isValid();
+ }
+
+ public void onActivate() {
+ insertImageDialog.setOnInsertImagePressed(onInsertImagePressed);
+ }
+
+ public void onInsert(ImageInfo linkInfo) {
+ insertImageDialog.fireOnInsertImage(linkInfo);
+ reset();
+ }
+
+ public void onPositionFieldChanged(String position) {
+ insertImageDialog.setImagePosition(position);
+ }
+
+ public void onSizeFieldChanged(String size) {
+ insertImageDialog.setImageSize(size);
+ }
+
+ public void reset() {
+ view.reset();
+ }
+
+ protected ImageInfo updateImageInfo() {
+ return new ImageInfo(view.getHref(), view.wrapText(), view.getPosition(), view.getSize());
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -0,0 +1,18 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface InsertImageAbstractView extends View {
+
+ String getHref();
+
+ String getPosition();
+
+ String getSize();
+
+ boolean isValid();
+
+ void reset();
+
+ boolean wrapText();
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExt.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExt.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExt.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -1,5 +1,7 @@
package org.ourproject.kune.platf.client.ui.rte.insertimg.ext;
-public interface InsertImageExt {
+import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstract;
+public interface InsertImageExt extends InsertImageAbstract {
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -2,8 +2,7 @@
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.TextUtils;
-import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
-import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialogView;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractPanel;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.Button;
@@ -13,16 +12,15 @@
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.layout.FitLayout;
-public class InsertImageExtPanel extends DefaultForm implements InsertImageExtView {
+public class InsertImageExtPanel extends InsertImageAbstractPanel implements InsertImageExtView {
private static final String LINK_FIELD = "iiep-img-field";
private final TextField linkField;
private final Panel previewPanel;
public InsertImageExtPanel(final InsertImageExtPresenter presenter, I18nTranslationService i18n) {
- super(i18n.t("External image"));
- super.setAutoWidth(true);
- super.setHeight(InsertImageDialogView.HEIGHT);
+ super(i18n.t("External image"), presenter);
+
linkField = new TextField();
linkField.setTabIndex(1);
linkField.setFieldLabel(i18n.t("External image link (URL)"));
@@ -44,18 +42,10 @@
preview.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(Button button, EventObject e) {
- presenter.onPreview();
+ // presenter.onPreview();
}
});
addButton(preview);
- Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(Button button, EventObject e) {
- presenter.onInsert();
- }
- });
- addButton(insert);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -1,26 +1,12 @@
package org.ourproject.kune.platf.client.ui.rte.insertimg.ext;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractPresenter;
-public class InsertImageExtPresenter implements InsertImageExt {
+public class InsertImageExtPresenter extends InsertImageAbstractPresenter implements InsertImageExt {
- private final InsertImageDialog insertImageDialog;
-
public InsertImageExtPresenter(InsertImageDialog insertImageDialog) {
- this.insertImageDialog = insertImageDialog;
+ super(insertImageDialog);
}
- public void init(InsertImageExtView view) {
- insertImageDialog.addTab(view);
- }
-
- public void onInsert() {
- // TODO Auto-generated method stub
-
- }
-
- public void onPreview() {
- // TODO Auto-generated method stub
-
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -1,7 +1,6 @@
package org.ourproject.kune.platf.client.ui.rte.insertimg.ext;
-import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractView;
-public interface InsertImageExtView extends View {
+public interface InsertImageExtView extends InsertImageAbstractView {
}
-
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -30,9 +30,6 @@
private LinkInfo linkInfo;
private Listener0 onInsertLinkPressed;
- public InsertLinkDialogPresenter() {
- }
-
public void fireOnInsertLink(LinkInfo linkInfo) {
onCreateListener.onEvent(linkInfo);
super.hide();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -179,7 +179,7 @@
onDoSave();
}
};
- saveBtn = new ActionToolbarButtonDescriptor<Object>(AccessRolDTO.Editor, RTEditor.sndbar, onPerformSaveCall);
+ saveBtn = new ActionToolbarButtonDescriptor<Object>(AccessRolDTO.Editor, RTEditor.sndbarPosition, onPerformSaveCall);
saveBtn.setIconCls(RTEImgResources.SUFFIX + imgResources.save().getName());
saveBtn.setToolTip(i18n.t("Save"));
ShortcutDescriptor ctrl_S = new ShortcutDescriptor(true, 'S');
@@ -187,14 +187,14 @@
saveBtn.setPosition(0);
ActionToolbarMenuDescriptor<Object> save = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
- RTEditor.topbar, onPerformSaveCall);
+ RTEditor.topbarPosition, onPerformSaveCall);
save.setIconCls(RTEImgResources.SUFFIX + imgResources.save().getName());
save.setParentMenuTitle(i18n.t(FILE_DEF_MENU_OPTION));
save.setTextDescription(i18n.t("Save") + (ctrl_S.toString()));
save.setPosition(0);
ActionToolbarMenuDescriptor<Object> close = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
- RTEditor.topbar, new Listener<Object>() {
+ RTEditor.topbarPosition, new Listener<Object>() {
public void onEvent(Object parameter) {
onCancel();
}
@@ -213,12 +213,12 @@
}
};
ActionToolbarMenuDescriptor<Object> saveclose = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
- RTEditor.topbar, onPerformSaveAndCloseCall);
+ RTEditor.topbarPosition, onPerformSaveAndCloseCall);
saveclose.setParentMenuTitle(i18n.t(FILE_DEF_MENU_OPTION));
saveclose.setTextDescription(i18n.t("Save & Close"));
ActionToolbarButtonDescriptor<Object> saveCloseBtn = new ActionToolbarButtonDescriptor<Object>(
- AccessRolDTO.Editor, RTEditor.topbar, onPerformSaveAndCloseCall);
+ AccessRolDTO.Editor, RTEditor.topbarPosition, onPerformSaveAndCloseCall);
// saveCloseBtn.setIconCls(RTEImgResources.SUFFIX +
// imgResources.save().getName());
saveCloseBtn.setTextDescription(i18n.t("Save & Close"));
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -97,7 +97,7 @@
}
public void setFileMenuTitle(String fileMenuTitleNew) {
- basicEditor.getTopBar().setParentMenuTitle(RTEditor.topbar, fileMenuTitle, null, fileMenuTitleNew);
+ basicEditor.getTopBar().setParentMenuTitle(RTEditor.topbarPosition, fileMenuTitle, null, fileMenuTitleNew);
}
@Override
@@ -109,7 +109,7 @@
private void addContentActions() {
ActionToolbarMenuDescriptor<Object> rename = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
- RTEditor.topbar, new Listener0() {
+ RTEditor.topbarPosition, new Listener0() {
public void onEvent() {
entityTitle.edit();
// basicEditor.setFocus(false);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocal.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocal.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocal.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -1,5 +1,7 @@
package org.ourproject.kune.workspace.client.editor.insertlocalimg;
-public interface InsertImageLocal {
+import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstract;
+public interface InsertImageLocal extends InsertImageAbstract {
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -1,19 +1,12 @@
package org.ourproject.kune.workspace.client.editor.insertlocalimg;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.TextUtils;
-import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialogView;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.gwtext.client.widgets.Panel;
+public class InsertImageLocalPanel extends InsertImageAbstractPanel implements InsertImageLocalView {
-public class InsertImageLocalPanel extends Panel implements InsertImageLocalView {
-
public InsertImageLocalPanel(final InsertImageLocalPresenter presenter, I18nTranslationService i18n) {
- super(i18n.t("Local image"));
- setAutoWidth(true);
- setHeight(InsertImageDialogView.HEIGHT);
- setPaddings(20);
- add(new Label(TextUtils.IN_DEVELOPMENT));
+ super(i18n.t("Local image"), presenter);
}
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -1,16 +1,12 @@
package org.ourproject.kune.workspace.client.editor.insertlocalimg;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractPresenter;
-public class InsertImageLocalPresenter implements InsertImageLocal {
+public class InsertImageLocalPresenter extends InsertImageAbstractPresenter implements InsertImageLocal {
- private final InsertImageDialog insertImageDialog;
-
public InsertImageLocalPresenter(InsertImageDialog insertImageDialog) {
- this.insertImageDialog = insertImageDialog;
+ super(insertImageDialog);
}
- public void init(InsertImageLocalView view) {
- insertImageDialog.addTab(view);
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalView.java 2009-03-23 21:21:45 UTC (rev 1085)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalView.java 2009-03-24 14:25:48 UTC (rev 1086)
@@ -1,7 +1,6 @@
package org.ourproject.kune.workspace.client.editor.insertlocalimg;
-import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractView;
-public interface InsertImageLocalView extends View {
+public interface InsertImageLocalView extends InsertImageAbstractView {
}
-
1
0
r1085 - in trunk/src/main/java/org/ourproject/kune/platf/client/ui: . dialogs/tabbed rte/basic rte/insertlink/email rte/insertlink/ext
by vjrj 23 Mar '09
by vjrj 23 Mar '09
23 Mar '09
Author: vjrj
Date: 2009-03-23 22:21:45 +0100 (Mon, 23 Mar 2009)
New Revision: 1085
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java
Log:
Incomplete - task RTE Create/Edit link improved
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -27,7 +27,7 @@
public static final String IN_DEVELOPMENT = "In development";
// Original regexp from http://snippets.dzone.com/posts/show/452
- public static final String URL_REGEXP = "((ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?)";
+ public static final String URL_REGEXP = "((ftp|http|https|mailto):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?)";
// Original regexp from http://www.regular-expressions.info/email.html
public static final String EMAIL_REGEXP = "[-!#$%&\'*+/=?_`{|}~a-z0-9^]+(\\.[-!#$%&\'*+/=?_`{|}~a-z0-9^]+)*@(localhost|([a-z0-9]([-a-z0-9]*[a-z0-9])?\\.)+[a-z0-9]([-a-z0-9]*[a-z0-9]))?";
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -28,6 +28,8 @@
public void setErrorMessage(String message, Level level);
+ void activateTab(int index);
+
void addTab(View view);
void show();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -36,7 +36,7 @@
import com.gwtext.client.widgets.TabPanel;
import com.gwtext.client.widgets.event.WindowListenerAdapter;
-public abstract class AbstractTabbedDialogPanel {
+public abstract class AbstractTabbedDialogPanel implements AbstractTabbedDialogView {
private BasicDialog dialog;
private final String dialogId;
private TabPanel tabPanel;
@@ -67,6 +67,11 @@
buttons = new ArrayList<Button>();
}
+ public void activateTab(int index) {
+ createDialogIfNecessary();
+ tabPanel.activate(index);
+ }
+
/**
* User before show/render
*
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -22,10 +22,14 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-public abstract class AbstractTabbedDialogPresenter {
+public abstract class AbstractTabbedDialogPresenter implements AbstractTabbedDialog {
private AbstractTabbedDialogView view;
+ public void activateTab(int index) {
+ view.activateTab(index);
+ }
+
public void addTab(View tab) {
view.addTab(tab);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -24,6 +24,8 @@
public interface AbstractTabbedDialogView extends View {
+ void activateTab(int index);
+
void addTab(View tab);
void createAndShow();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -603,9 +603,18 @@
}
};
}
- insertElement.setLinkInfo(view.getLinkInfoIfHref());
+ LinkInfo linkInfo = view.getLinkInfoIfHref();
+ insertElement.setLinkInfo(linkInfo);
insertElement.setOnCreateLink(insertLinkListener);
insertElement.show();
+ String href = linkInfo.getHref();
+ if (href.length() > 0) {
+ if (href.startsWith("mailto")) {
+ insertElement.activateTab(2);
+ } else {
+ insertElement.activateTab(1);
+ }
+ }
}
});
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -43,8 +43,11 @@
@Override
protected void updateValues(LinkInfo linkInfo) {
super.updateValues(linkInfo);
- if (!linkInfo.getHref().startsWith("mailto")) {
+ String href = linkInfo.getHref();
+ if (!href.startsWith("mailto")) {
hrefField.reset();
+ } else {
+ hrefField.setValue(href.replaceFirst("mailto:\\/\\/", ""));
}
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java 2009-03-23 20:55:51 UTC (rev 1084)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java 2009-03-23 21:21:45 UTC (rev 1085)
@@ -88,7 +88,11 @@
if (href != null && !href.equals("")) {
String hrefValue = hrefField.getRawValue();
if (hrefValue != null && hrefValue.length() == 0) {
- hrefField.setValue(href);
+ if (href.startsWith("mailto")) {
+ hrefField.reset();
+ } else {
+ hrefField.setValue(href);
+ }
}
}
}
1
0
Author: vjrj
Date: 2009-03-23 21:55:51 +0100 (Mon, 23 Mar 2009)
New Revision: 1084
Modified:
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPresenter.java
Log:
Incomplete - task RTE Create/Edit link improved
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-03-23 19:21:30 UTC (rev 1083)
+++ trunk/pom.xml 2009-03-23 20:55:51 UTC (rev 1084)
@@ -397,7 +397,7 @@
</releases>
<snapshots>
<enabled>true</enabled>
- <updatePolicy>always</updatePolicy>
+ <updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
Modified: trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2009-03-23 19:21:30 UTC (rev 1083)
+++ trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2009-03-23 20:55:51 UTC (rev 1084)
@@ -34,8 +34,6 @@
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.calclab.suco.client.Suco;
import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
@@ -46,12 +44,6 @@
public void onModuleLoad() {
Log.setUncaughtExceptionHandler();
- GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
- public void onUncaughtException(Throwable e) {
- String message = e.getMessage();
- Log.error("Caught: " + e.toString() + " " + (message != null ? message : ""), e);
- }
- });
// At the moment, in runtime:
Log.setCurrentLogLevel(Log.LOG_LEVEL_DEBUG);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java 2009-03-23 19:21:30 UTC (rev 1083)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java 2009-03-23 20:55:51 UTC (rev 1084)
@@ -30,8 +30,6 @@
void addTab(View view);
- void insertTab(int index, View view);
-
void show();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-23 20:55:51 UTC (rev 1084)
@@ -587,8 +587,8 @@
img.setToolTip(i18n.t("Insert Image"));
img.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> createLink = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
- new Listener0() {
+ ActionToolbarButtonDescriptor<Object> createOrEditLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ sndbar, new Listener0() {
public void onEvent() {
deferred.addCommand(new Listener0() {
public void onEvent() {
@@ -610,10 +610,10 @@
});
}
});
- createLink.setIconCls(getCssName(imgResources.link()));
- createLink.setToolTip(i18n.t("Create Link"));
- createLink.setShortcut(new ShortcutDescriptor(true, 'K'));
- createLink.setAddCondition(canBeExtended);
+ createOrEditLink.setIconCls(getCssName(imgResources.link()));
+ createOrEditLink.setToolTip(i18n.t("Create or Edit Link"));
+ createOrEditLink.setShortcut(new ShortcutDescriptor(true, 'K'));
+ createOrEditLink.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
new Listener0() {
@@ -784,7 +784,7 @@
actions.add(withNoItem(removeFormatBtn));
actions.add(withNoItem(hrButton));
actions.add(withNoItem(img));
- actions.add(withNoItem(createLink));
+ actions.add(withNoItem(createOrEditLink));
actions.add(withNoItem(removeLink));
actions.add(withNoItem(insertTableBtn));
actions.add(withNoItem(insertTable));
@@ -794,7 +794,7 @@
actions.add(withNoItem(hr));
actions.add(withNoItem(undoBtn));
actions.add(withNoItem(redoBtn));
- actions.add(withNoItem(devInfo));
+ // actions.add(withNoItem(devInfo));
for (String fontName : this.fontNames) {
ActionToolbarMenuDescriptor<Object> fontNameAction = createFontNameAction(canBeBasic, fontName);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java 2009-03-23 19:21:30 UTC (rev 1083)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java 2009-03-23 20:55:51 UTC (rev 1084)
@@ -24,6 +24,6 @@
public interface InsertLinkDialogView extends AbstractTabbedDialogView, View {
- int HEIGHT = 320;
+ int HEIGHT = 350;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java 2009-03-23 20:55:51 UTC (rev 1084)
@@ -12,6 +12,7 @@
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.form.Checkbox;
+import com.gwtext.client.widgets.form.FieldSet;
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.form.event.FormPanelListenerAdapter;
@@ -83,10 +84,16 @@
}
});
+ FieldSet advanced = new FieldSet(Resources.i18n.t("More options"));
+ advanced.setCollapsible(true);
+ advanced.setCollapsed(true);
+ advanced.setAutoHeight(true);
+
+ advanced.add(onOverField);
+ advanced.add(sameWindow);
add(hrefField);
add(textField);
- add(onOverField);
- add(sameWindow);
+ add(advanced);
}
public String getHref() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPresenter.java 2009-03-23 20:55:51 UTC (rev 1084)
@@ -34,7 +34,6 @@
public void init(InsertLinkExtView view) {
super.init(view);
this.view = view;
- // editorInsertDialog.insertTab(0, view);
}
@Override
1
0
Author: vjrj
Date: 2009-03-23 20:21:30 +0100 (Mon, 23 Mar 2009)
New Revision: 1083
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/AbstractRichTextAreaTest.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherField.java
Removed:
trunk/src/main/java/com/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/AbstractRichTextAreaTest.java
Modified:
trunk/COPYRIGHT
trunk/TODO
trunk/TODO_done
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfoTest.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstract.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/InsertLinkLocalPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/InsertLinkLocalPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherPanel.java
Log:
Incomplete - task RTE Create link improved
Modified: trunk/COPYRIGHT
===================================================================
--- trunk/COPYRIGHT 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/COPYRIGHT 2009-03-23 19:21:30 UTC (rev 1083)
@@ -109,7 +109,7 @@
Copyright: under GNU Lesser General Public License
http://www.gnu.org/licenses/lgpl.html
-dom region and diff libraries:
+dom region library:
XWiki Platform
http://www.xwiki.org/
Copyright: under GNU Lesser General Public License
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/TODO 2009-03-23 19:21:30 UTC (rev 1083)
@@ -22,7 +22,6 @@
<a href="http://example.com">s^amp^le</a> --- Parse and edit
<a href="http://example.com">s^a<em>kk</em>mp^le</a> --- Parse, get contains and edit
^some text <a href="http://example.com">samp^le</a> --- new link with get inner content?
-**** with different menus (File/Blog ...)
**** bidi support
**** images (local/remote) with preview
**** youtube videos/podcasts
@@ -113,6 +112,12 @@
** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
* MID-TERM
+** vjrj <v> shortcuts enhacement
+*** Clarify the keycodes vs utf8 chars Shortcut definition (Function keys and so on...)
+*** shortcuts in tool actions no registered in GlobalShorcuts
+*** Links:
+ http://www.quirksmode.org/js/keys.html
+ http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/Javas…
** TODO <s> tag UI refactorization
Think about wikipedia suggestions:
http://www.mediawiki.org/wiki/API
@@ -424,6 +429,8 @@
http://creativecommons.org/license/zero/
** TODO <v> Revise use the HP and VP in gwt code
http://groups.google.com/group/Google-Web-Toolkit/browse_frm/thread/5d01cd8…
+** TODO <v> captcha in anonymous comments/edits
+ http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/99c2…
* LONG-TERM
** <s> integrate some blog/wiki converter:
http://code.google.com/p/google-blog-converters-appengine/
Modified: trunk/TODO_done
===================================================================
--- trunk/TODO_done 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/TODO_done 2009-03-23 19:21:30 UTC (rev 1083)
@@ -39,7 +39,17 @@
http://extjs.com/deploy/ext/examples/locale/dutch-form.js
http://groups.google.com/group/gwt-ext/browse_thread/thread/ebec316effea2b8…
http://extjs.com/forum/showthread.php?t=20160&highlight=localization
+* FIXED with different menus (File/Blog ...)
+* FIXED with different menus (File/Blog ...)
+ :PROPERTIES:
+ :ARCHIVE_TIME: 2009-03-20 vie 09:12
+ :ARCHIVE_FILE: ~/proyectos/dev/kune/trunk/TODO
+ :ARCHIVE_OLPATH: SHORT-TERM (URGENT)/<v> better RTE/Pending
+ :ARCHIVE_CATEGORY: TODO
+ :END:
+
+
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/pom.xml 2009-03-23 19:21:30 UTC (rev 1083)
@@ -94,13 +94,11 @@
<artifactId>jmagick</artifactId>
<version>6.2.6-0</version>
</dependency>
- <!--
<dependency>
- <groupId>com.xpn.xwiki.platform</groupId>
- <artifactId>xwiki-web-gwt</artifactId>
+ <groupId>org.xwiki.platform</groupId>
+ <artifactId>xwiki-web-gwt-dom</artifactId>
<version>1.9-SNAPSHOT</version>
</dependency>
- -->
<!-- xmpp -->
<dependency>
Modified: trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -48,7 +48,8 @@
Log.setUncaughtExceptionHandler();
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
public void onUncaughtException(Throwable e) {
- Log.error(e.toString());
+ String message = e.getMessage();
+ Log.error("Caught: " + e.toString() + " " + (message != null ? message : ""), e);
}
});
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -79,7 +79,7 @@
Position.ctx, TYPE_BLOG);
createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
- createEditAction(TYPE_POST);
+ createEditAction(parentMenuTitle, TYPE_POST);
createContentModeratedActions(parentMenuTitle, contentsModerated);
createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -80,7 +80,7 @@
Position.ctx, TYPE_ROOT, TYPE_FOLDER);
createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
- createEditAction(TYPE_DOCUMENT);
+ createEditAction(parentMenuTitle, TYPE_DOCUMENT);
createContentModeratedActions(parentMenuTitle, contentsModerated);
createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
Modified: trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml 2009-03-23 19:21:30 UTC (rev 1083)
@@ -8,7 +8,7 @@
<inherits name="com.google.gwt.libideas.ImmutableResources" />
<inherits name="com.google.gwt.libideas.StyleInjector" />
- <inherits name="com.xpn.xwiki.wysiwyg.Wysiwyg" />
+ <inherits name="org.xwiki.gwt.dom.DOM" />
<public path="public" />
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -21,7 +21,6 @@
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
public interface ActionToolbar<T> {
@@ -52,7 +51,7 @@
void setNormalStyle();
- void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip, String newTitle);
+ void setParentMenuTitle(ActionToolbarPosition position, String origTitle, String origTooltip, String newTitle);
void setPushButtonPressed(ActionDescriptor<T> action, boolean pressed);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -167,12 +167,11 @@
toolbar.setNormalStyle();
}
- public void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip,
- String newTitle) {
- final String menuKey = genMenuKey(action.getActionPosition(), origTitle, origTooltip, null, null);
- Menu menu = menus.get(menuKey);
- if (menu != null) {
- menu.setTitle(newTitle);
+ public void setParentMenuTitle(ActionToolbarPosition position, String origTitle, String origTooltip, String newTitle) {
+ final String menuKey = genMenuKey(position, origTitle, origTooltip, null, null);
+ ToolbarButton button = buttons.get(menuKey);
+ if (button != null) {
+ button.setText(newTitle);
} else {
Log.error("Tryng to rename a non existent menu");
}
@@ -310,6 +309,7 @@
toolbarMenu.setTooltip(menuTooltip);
}
menus.put(menuKey, menu);
+ buttons.put(menuKey, toolbarMenu);
add(toolbarMenu);
return menu;
}
@@ -343,7 +343,7 @@
private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuTooltip,
final String menuSubTitle, final String actionText) {
- final String basePart = "km-atp-menu-" + pos.toString().substring(0, 2) + "-" + menuTitle + "-" + menuTooltip;
+ final String basePart = "km-atp-menu-" + pos + "-" + menuTitle + "-" + menuTooltip;
final String subMenuPart = menuSubTitle != null ? "-subm-" + menuSubTitle : "";
final String itemPart = actionText != null ? "-item-" + actionText : "";
return basePart + subMenuPart + itemPart;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -110,9 +110,8 @@
view.setNormalStyle();
}
- public void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip,
- String newTitle) {
- view.setParentMenuTitle(action, origTitle, origTooltip, newTitle);
+ public void setParentMenuTitle(ActionToolbarPosition position, String origTitle, String origTooltip, String newTitle) {
+ view.setParentMenuTitle(position, origTitle, origTooltip, newTitle);
}
public void setPushButtonPressed(ActionDescriptor<T> action, boolean pressed) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -22,7 +22,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.ActionItem;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
public interface ActionToolbarView<T> extends View {
@@ -49,7 +49,7 @@
void setNormalStyle();
- void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip, String newTitle);
+ void setParentMenuTitle(ActionToolbarPosition position, String origTitle, String origTooltip, String newTitle);
void setPushButtonPressed(ActionDescriptor<T> action, boolean pressed);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -301,6 +301,27 @@
}
});
+ register(InsertLinkGroup.class, new Factory<InsertLinkExt>(InsertLinkExt.class) {
+ @Override
+ public InsertLinkExt create() {
+ final InsertLinkExtPresenter presenter = new InsertLinkExtPresenter($(InsertLinkDialog.class));
+ final InsertLinkExtView panel = new InsertLinkExtPanel(presenter, $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(InsertLinkGroup.class, new Factory<InsertLinkEmail>(InsertLinkEmail.class) {;
+
+ @Override
+ public InsertLinkEmail create() {
+ final InsertLinkEmailPresenter presenter = new InsertLinkEmailPresenter($(InsertLinkDialog.class));
+ final InsertLinkEmailPanel panel = new InsertLinkEmailPanel(presenter, $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
register(NoDecoration.class, new Factory<RTEditor>(RTEditor.class) {
@Override
public RTEditor create() {
@@ -413,26 +434,6 @@
}
});
- register(InsertLinkGroup.class, new Factory<InsertLinkExt>(InsertLinkExt.class) {
- @Override
- public InsertLinkExt create() {
- final InsertLinkExtPresenter presenter = new InsertLinkExtPresenter($(InsertLinkDialog.class));
- final InsertLinkExtView panel = new InsertLinkExtPanel(presenter, $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(InsertLinkGroup.class, new Factory<InsertLinkEmail>(InsertLinkEmail.class) {
- @Override
- public InsertLinkEmail create() {
- final InsertLinkEmailPresenter presenter = new InsertLinkEmailPresenter($(InsertLinkDialog.class));
- final InsertLinkEmailPanel panel = new InsertLinkEmailPanel(presenter, $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
register(Singleton.class, new Factory<InsertTableDialog>(InsertTableDialog.class) {
@Override
public InsertTableDialog create() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -21,11 +21,13 @@
import com.gwtext.client.core.Position;
import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.PaddedPanel;
import com.gwtext.client.widgets.form.Field;
import com.gwtext.client.widgets.form.FieldSet;
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.Label;
+import com.gwtext.client.widgets.form.event.FormPanelListener;
public class DefaultForm {
@@ -81,6 +83,10 @@
form.addButton(button);
}
+ public void addListener(FormPanelListener listener) {
+ form.addListener(listener);
+ }
+
public void addStyleName(final String cls) {
form.addStyleName(cls);
}
@@ -93,6 +99,10 @@
return form;
}
+ public void insert(int index, Component component) {
+ form.insert(index, component);
+ }
+
public boolean isValid() {
return form.getForm().isValid();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialog.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -28,8 +28,10 @@
public void setErrorMessage(String message, Level level);
- void addOptionTab(View view);
+ void addTab(View view);
+ void insertTab(int index, View view);
+
void show();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -83,14 +83,8 @@
}
}
- public void addOptionTab(View view) {
- if (view instanceof Panel) {
- addTab((Panel) view);
- } else if (view instanceof DefaultForm) {
- addTab(((DefaultForm) view).getFormPanel());
- } else {
- Log.error("Programatic error: Unexpected element added to GroupOptions");
- }
+ public void addTab(View view) {
+ addTabPanel(castPanel(view));
doLayoutIfNeeded();
}
@@ -117,6 +111,11 @@
}
}
+ public void insertTab(int index, View view) {
+ insertTabPanel(index, castPanel(view));
+ doLayoutIfNeeded();
+ }
+
public boolean isVisible() {
createDialogIfNecessary();
return dialog.isVisible();
@@ -163,11 +162,24 @@
});
}
- private void addTab(Panel newTab) {
+ private void addTabPanel(Panel newTab) {
createDialogIfNecessary();
tabPanel.add(newTab);
}
+ private Panel castPanel(View view) {
+ Panel panel;
+ if (view instanceof Panel) {
+ panel = (Panel) view;
+ } else if (view instanceof DefaultForm) {
+ panel = ((DefaultForm) view).getFormPanel();
+ } else {
+ panel = null;
+ Log.error("Programatic error: Unexpected element added to GroupOptions");
+ }
+ return panel;
+ }
+
private void createDialog() {
dialog = new BasicDialog(dialogId, title, modal, true, width, height, minWidth, minHeight);
dialog.setCollapsible(false);
@@ -192,4 +204,9 @@
createDialog();
}
}
+
+ private void insertTabPanel(int index, Panel newTab) {
+ createDialogIfNecessary();
+ tabPanel.insert(index, newTab);
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -26,8 +26,8 @@
private AbstractTabbedDialogView view;
- public void addOptionTab(View tab) {
- view.addOptionTab(tab);
+ public void addTab(View tab) {
+ view.addTab(tab);
}
public View getView() {
@@ -46,6 +46,10 @@
this.view = view;
}
+ public void insertTab(int index, View tab) {
+ view.insertTab(index, tab);
+ }
+
public void setErrorMessage(String message, Level level) {
view.setErrorMessage(message, level);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogView.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -24,7 +24,7 @@
public interface AbstractTabbedDialogView extends View {
- void addOptionTab(View tab);
+ void addTab(View tab);
void createAndShow();
@@ -32,6 +32,8 @@
void hideMessages();
+ void insertTab(int index, View tab);
+
void setErrorMessage(final String message, final Level level);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -16,6 +16,7 @@
package org.ourproject.kune.platf.client.ui.rte;
import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl;
+import org.xwiki.gwt.dom.client.Document;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.IFrameElement;
@@ -26,7 +27,6 @@
import com.google.gwt.user.client.ui.MouseListener;
import com.google.gwt.user.client.ui.MouseListenerCollection;
import com.google.gwt.user.client.ui.SourcesMouseEvents;
-import com.xpn.xwiki.wysiwyg.client.dom.Document;
/**
* A rich text editor that allows complex styling and formatting.
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -20,16 +20,19 @@
import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister;
import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
import org.ourproject.kune.platf.client.shortcuts.ShortcutRegister;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkExecutableUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
+import org.xwiki.gwt.dom.client.DocumentFragment;
+import org.xwiki.gwt.dom.client.Range;
+import org.xwiki.gwt.dom.client.Selection;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.FocusListener;
import com.google.gwt.user.client.ui.Widget;
-import com.xpn.xwiki.wysiwyg.client.dom.DocumentFragment;
-import com.xpn.xwiki.wysiwyg.client.dom.Range;
-import com.xpn.xwiki.wysiwyg.client.dom.Selection;
public class RTEditorPanel extends RichTextArea implements RTEditorView {
@@ -108,9 +111,39 @@
setFocus(true);
}
+ public LinkInfo getLinkInfoIfHref() {
+ LinkInfo linkinfo = null;
+ org.xwiki.gwt.dom.client.Element selectedAnchor = LinkExecutableUtils.getSelectedAnchor(this);
+ if (selectedAnchor != null) {
+ Range range = getDocument().createRange();
+ range.selectNode(selectedAnchor);
+ getSelection().addRange(range);
+ linkinfo = LinkInfo.parse(selectedAnchor);
+ } else {
+ linkinfo = new LinkInfo(getSelectionText());
+ }
+ return linkinfo;
+ }
+
+ public void getRangeInfo() {
+ // Selection selection = getSelection();
+ // String info = "range count: " + selection.getRangeCount() +
+ // "<br/>focus offset: " + selection.getFocusOffset()
+ // + "<br/>anchor offset:" + selection.getAnchorOffset() +
+ // "<br/>range 0 as html: "
+ // + selection.getRangeAt(0).toHTML();
+ // NotifyUser.info(info);
+ String info = "range count: " + getFstRange().getCommonAncestorContainer().getFirstChild().getNodeName();
+ NotifyUser.info(info);
+ }
+
+ public String getSelectionText() {
+ return getFstRange().cloneContents().getInnerText();
+ }
+
public void insertBlockquote() {
DocumentFragment extracted = getFstRange().cloneContents();
- delete();
+ // delete();
insertHtml("<blockquote>" + extracted.getInnerHTML() + "</blockquote>");
focus();
}
@@ -162,6 +195,10 @@
return basic.isBold();
}
+ public boolean isCollapsed() {
+ return getFstRange().isCollapsed();
+ }
+
public boolean isItalic() {
return basic.isItalic();
}
@@ -346,5 +383,4 @@
private void updateStatus() {
presenter.updateStatus();
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -24,14 +24,15 @@
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.events.Event0;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
-import com.calclab.suco.client.events.Listener2;
import com.calclab.suco.client.ioc.Provider;
import com.google.gwt.libideas.resources.client.ImageResource;
@@ -71,7 +72,7 @@
private final Provider<InsertImageDialog> insertImageDialog;
private final Provider<InsertTableDialog> insertTableDialog;
private Listener<String> insertTableListener;
- private Listener2<String, String> insertLinkListener;
+ private Listener<LinkInfo> insertLinkListener;
private Listener<String> updateHtmlListener;
private ActionToolbarButtonDescriptor<Object> insertTableBtn;
private final Provider<InsertSpecialCharDialog> insertSpecialCharDialog;
@@ -592,13 +593,17 @@
deferred.addCommand(new Listener0() {
public void onEvent() {
if (insertLinkListener == null) {
- insertLinkListener = new Listener2<String, String>() {
- public void onEvent(String name, String url) {
- view.createLink(url);
+ insertLinkListener = new Listener<LinkInfo>() {
+ public void onEvent(LinkInfo linkInfo) {
+ String link = linkInfo.toString();
+ Log.debug("Link: " + link);
+ view.focus();
+ view.insertHtml(link);
fireOnEdit();
}
};
}
+ insertElement.setLinkInfo(view.getLinkInfoIfHref());
insertElement.setOnCreateLink(insertLinkListener);
insertElement.show();
}
@@ -742,17 +747,7 @@
public void onEvent() {
deferred.addCommand(new Listener0() {
public void onEvent() {
- // Selection selection =
- // view.getDocument().getSelection();
- // String info = "range count: " +
- // selection.getRangeCount() +
- // "<br/>focus offset: "
- // + selection.getFocusOffset() +
- // "<br/>anchor offset:"
- // + selection.getAnchorOffset() +
- // "<br/>range 0 as html: "
- // + selection.getRangeAt(0).toHTML();
- // NotifyUser.info(info);
+ view.getRangeInfo();
}
});
}
@@ -799,7 +794,7 @@
actions.add(withNoItem(hr));
actions.add(withNoItem(undoBtn));
actions.add(withNoItem(redoBtn));
- // actions.add(withNoItem(devInfo));
+ actions.add(withNoItem(devInfo));
for (String fontName : this.fontNames) {
ActionToolbarMenuDescriptor<Object> fontNameAction = createFontNameAction(canBeBasic, fontName);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -3,6 +3,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.FontSize;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
public interface RTEditorView extends View {
@@ -26,6 +27,12 @@
String getHTML();
+ LinkInfo getLinkInfoIfHref();
+
+ void getRangeInfo();
+
+ String getSelectionText();
+
String getText();
void insertBlockquote();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -24,7 +24,7 @@
public void init(EditHtmlEditorView view) {
this.view = view;
- editHtml.addOptionTab(view);
+ editHtml.addTab(view);
}
public void setHtml(String html) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -22,6 +22,6 @@
public void init(EditHtmlPreviewView view) {
this.view = view;
- editHtml.addOptionTab(view);
+ editHtml.addTab(view);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -11,7 +11,7 @@
}
public void init(InsertImageExtView view) {
- insertImageDialog.addOptionTab(view);
+ insertImageDialog.addTab(view);
}
public void onInsert() {
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/AbstractRichTextAreaTest.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/AbstractRichTextAreaTest.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/AbstractRichTextAreaTest.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -1,161 +0,0 @@
-/*
- * See the NOTICE file distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
-
-import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.ui.LoadListener;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.SourcesLoadEvents;
-import com.google.gwt.user.client.ui.Widget;
-import com.xpn.xwiki.wysiwyg.client.dom.Element;
-import com.xpn.xwiki.wysiwyg.client.dom.Range;
-import com.xpn.xwiki.wysiwyg.client.dom.Selection;
-
-/**
- * Base class for tests running on a rich text area.
- *
- * @version $Id$
- */
-public class AbstractRichTextAreaTest extends AbstractWysiwygClientTest implements LoadListener {
- /**
- * The number of milliseconds we delay the test finish. This delay is needed
- * because in some browsers the rich text area is initialized after a
- * timeout.
- */
- public static final int FINISH_DELAY = 400;
-
- /**
- * The number of milliseconds we delay the test start. This delay is needed
- * because in some browsers the rich text area is initialized after a
- * timeout and we want to start the test after the rich text area is fully
- * initialized.
- */
- public static final int START_DELAY = 300;
-
- /**
- * The rich text area on which we run the tests.
- */
- protected RichTextArea rta;
-
- /**
- * {@inheritDoc}
- *
- * @see LoadListener#onError(Widget)
- */
- public void onError(Widget sender) {
- // ignore
- }
-
- /**
- * {@inheritDoc}
- *
- * @see LoadListener#onLoad(Widget)
- */
- public void onLoad(Widget sender) {
- // http://wiki.codetalks.org/wiki/index.php/Docs/Keyboard_navigable_JS_widgets
- // #Use_setTimeout_with_element.focus.28.29_to_set_focus
- (new Timer() {
- @Override
- public void run() {
- rta.setFocus(true);
- }
- }).schedule(1);
- }
-
- /**
- * Cleans the HTML input. This is needed in order to have uniform tests
- * between Firefox and Internet Explorer.
- *
- * @param html
- * The HTML fragment to be cleaned.
- * @return The input string in lower case, stripped of new lines.
- */
- protected String clean(String html) {
- return html.replaceAll("\r\n", "").toLowerCase();
- }
-
- /**
- * @return The body element of the DOM document edited with the rich text
- * area.
- */
- protected Element getBody() {
- return rta.getDocument().getBody().cast();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see AbstractWysiwygClientTest#gwtSetUp()
- */
- @Override
- protected void gwtSetUp() throws Exception {
- super.gwtSetUp();
-
- if (rta == null) {
- rta = new RichTextArea();
- // Workaround till GWT provides a way to detect when the rich text
- // area has finished loading.
- if (rta.getBasicFormatter() != null && rta.getBasicFormatter() instanceof SourcesLoadEvents) {
- ((SourcesLoadEvents) rta.getBasicFormatter()).addLoadListener(this);
- }
- }
- RootPanel.get().add(rta);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see AbstractWysiwygClientTest#gwtTearDown()
- */
- @Override
- protected void gwtTearDown() throws Exception {
- super.gwtTearDown();
-
- RootPanel.get().remove(rta);
- }
-
- /**
- * Removes the non-breaking spaces, {@code }, from the given HTML. The
- * is method is needed because the Selection implementation for Internet
- * Explorer adds {@code } when it cannot place the caret at the
- * specified place.
- *
- * @param html
- * the HTML fragment to be cleaned of non-breaking spaces
- * @return the input HTML fragment without any non-breaking spaces
- */
- protected String removeNonBreakingSpaces(String html) {
- return html.replace(" ", "");
- }
-
- /**
- * Selects the given range.
- *
- * @param range
- * The range to be selected.
- */
- protected void select(Range range) {
- Selection selection = rta.getDocument().getSelection();
- selection.removeAllRanges();
- selection.addRange(range);
- }
-}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/AbstractRichTextAreaTest.java (from rev 1078, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/AbstractRichTextAreaTest.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/AbstractRichTextAreaTest.java 2009-03-16 04:13:36 UTC (rev 1078)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/AbstractRichTextAreaTest.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -0,0 +1,161 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.ourproject.kune.platf.client.ui.rte.insertlink;
+
+import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
+import org.xwiki.gwt.dom.client.Element;
+import org.xwiki.gwt.dom.client.Range;
+import org.xwiki.gwt.dom.client.Selection;
+
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.ui.LoadListener;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.SourcesLoadEvents;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * Base class for tests running on a rich text area.
+ *
+ * @version $Id$
+ */
+public class AbstractRichTextAreaTest extends AbstractWysiwygClientTest implements LoadListener {
+ /**
+ * The number of milliseconds we delay the test finish. This delay is needed
+ * because in some browsers the rich text area is initialized after a
+ * timeout.
+ */
+ public static final int FINISH_DELAY = 400;
+
+ /**
+ * The number of milliseconds we delay the test start. This delay is needed
+ * because in some browsers the rich text area is initialized after a
+ * timeout and we want to start the test after the rich text area is fully
+ * initialized.
+ */
+ public static final int START_DELAY = 300;
+
+ /**
+ * The rich text area on which we run the tests.
+ */
+ protected RichTextArea rta;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see LoadListener#onError(Widget)
+ */
+ public void onError(Widget sender) {
+ // ignore
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see LoadListener#onLoad(Widget)
+ */
+ public void onLoad(Widget sender) {
+ // http://wiki.codetalks.org/wiki/index.php/Docs/Keyboard_navigable_JS_widgets
+ // #Use_setTimeout_with_element.focus.28.29_to_set_focus
+ (new Timer() {
+ @Override
+ public void run() {
+ rta.setFocus(true);
+ }
+ }).schedule(1);
+ }
+
+ /**
+ * Cleans the HTML input. This is needed in order to have uniform tests
+ * between Firefox and Internet Explorer.
+ *
+ * @param html
+ * The HTML fragment to be cleaned.
+ * @return The input string in lower case, stripped of new lines.
+ */
+ protected String clean(String html) {
+ return html.replaceAll("\r\n", "").toLowerCase();
+ }
+
+ /**
+ * @return The body element of the DOM document edited with the rich text
+ * area.
+ */
+ protected Element getBody() {
+ return rta.getDocument().getBody().cast();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see AbstractWysiwygClientTest#gwtSetUp()
+ */
+ @Override
+ protected void gwtSetUp() throws Exception {
+ super.gwtSetUp();
+
+ if (rta == null) {
+ rta = new RichTextArea();
+ // Workaround till GWT provides a way to detect when the rich text
+ // area has finished loading.
+ if (rta.getBasicFormatter() != null && rta.getBasicFormatter() instanceof SourcesLoadEvents) {
+ ((SourcesLoadEvents) rta.getBasicFormatter()).addLoadListener(this);
+ }
+ }
+ RootPanel.get().add(rta);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see AbstractWysiwygClientTest#gwtTearDown()
+ */
+ @Override
+ protected void gwtTearDown() throws Exception {
+ super.gwtTearDown();
+
+ RootPanel.get().remove(rta);
+ }
+
+ /**
+ * Removes the non-breaking spaces, {@code }, from the given HTML. The
+ * is method is needed because the Selection implementation for Internet
+ * Explorer adds {@code } when it cannot place the caret at the
+ * specified place.
+ *
+ * @param html
+ * the HTML fragment to be cleaned of non-breaking spaces
+ * @return the input HTML fragment without any non-breaking spaces
+ */
+ protected String removeNonBreakingSpaces(String html) {
+ return html.replace(" ", "");
+ }
+
+ /**
+ * Selects the given range.
+ *
+ * @param range
+ * The range to be selected.
+ */
+ protected void select(Range range) {
+ Selection selection = rta.getDocument().getSelection();
+ selection.removeAllRanges();
+ selection.addRange(range);
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -21,12 +21,23 @@
import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialog;
-import com.calclab.suco.client.events.Listener2;
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
public interface InsertLinkDialog extends AbstractTabbedDialog {
- void fireOnCreateLink(String name, String link);
+ void fireOnInsertLink(LinkInfo linkInfo);
- void setOnCreateLink(Listener2<String, String> listener);
+ LinkInfo getLinkInfo();
+ void setLinkInfo(LinkInfo linkInfo);
+
+ void setLinkText(String text);
+
+ void setLinkTitle(String title);
+
+ void setOnCreateLink(Listener<LinkInfo> listener);
+
+ void setOnInsertLinkPressed(Listener0 onInsertLinkPressed);
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -24,16 +24,19 @@
import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
import com.calclab.suco.client.events.Listener0;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
public class InsertLinkDialogPanel extends AbstractTabbedDialogPanel implements InsertLinkDialogView {
public static final String TEXT_EDT_INSERT_DIALOG = "k-ted-iep-dialog";
public static final String TEXT_EDT_INSERT_DIALOG_ERROR_ID = "k-ted-iep-dialog-err";
private final InsertLinkGroup textEditorInsertElementGroup;
- public InsertLinkDialogPanel(final InsertLinkDialogPresenter presenter, Images images,
- I18nTranslationService i18n, final InsertLinkGroup textEditorInsertElementGroup) {
+ public InsertLinkDialogPanel(final InsertLinkDialogPresenter presenter, Images images, I18nTranslationService i18n,
+ final InsertLinkGroup textEditorInsertElementGroup) {
super(TEXT_EDT_INSERT_DIALOG, i18n.tWithNT("Insert a link",
- "Option in a text editor to insert links and other elements"), 380, HEIGHT + 90, 380, HEIGHT + 90,
+ "Option in a text editor to insert links and other elements"), 380, HEIGHT + 100, 380, HEIGHT + 100,
true, images, TEXT_EDT_INSERT_DIALOG_ERROR_ID);
super.setIconCls("k-link-icon");
this.textEditorInsertElementGroup = textEditorInsertElementGroup;
@@ -42,6 +45,25 @@
textEditorInsertElementGroup.resetAll();
}
});
+
+ Button insert = new Button(i18n.t("Insert"));
+ insert.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ presenter.onInsert();
+ }
+ });
+
+ Button cancel = new Button(i18n.t("Cancel"));
+ cancel.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ presenter.onCancel();
+ }
+ });
+ addButton(insert);
+ addButton(cancel);
+
}
@Override
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -21,27 +21,53 @@
import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
-import com.calclab.suco.client.events.Listener2;
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
public class InsertLinkDialogPresenter extends AbstractTabbedDialogPresenter implements InsertLinkDialog {
- private Listener2<String, String> onCreateListener;
+ private Listener<LinkInfo> onCreateListener;
+ private LinkInfo linkInfo;
+ private Listener0 onInsertLinkPressed;
public InsertLinkDialogPresenter() {
}
- public void fireOnCreateLink(String name, String link) {
- onCreateListener.onEvent(name, link);
+ public void fireOnInsertLink(LinkInfo linkInfo) {
+ onCreateListener.onEvent(linkInfo);
super.hide();
}
- public void fireOnInsertHtml(String name, String link) {
- onCreateListener.onEvent(name, link);
+ public LinkInfo getLinkInfo() {
+ return linkInfo;
+ }
+
+ public void onCancel() {
super.hide();
}
- public void setOnCreateLink(final Listener2<String, String> listener) {
+ public void setLinkInfo(LinkInfo linkInfo) {
+ this.linkInfo = linkInfo;
+ }
+
+ public void setLinkText(String text) {
+ linkInfo.setText(text);
+ }
+
+ public void setLinkTitle(String title) {
+ linkInfo.setTitle(title);
+ }
+
+ public void setOnCreateLink(final Listener<LinkInfo> listener) {
this.onCreateListener = listener;
}
+ public void setOnInsertLinkPressed(Listener0 onInsertLinkPressed) {
+ this.onInsertLinkPressed = onInsertLinkPressed;
+ }
+
+ protected void onInsert() {
+ onInsertLinkPressed.onEvent();
+ }
+
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -23,5 +23,7 @@
import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogView;
public interface InsertLinkDialogView extends AbstractTabbedDialogView, View {
- int HEIGHT = 225;
+
+ int HEIGHT = 320;
+
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -0,0 +1,106 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.ourproject.kune.platf.client.ui.rte.insertlink;
+
+import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
+import org.xwiki.gwt.dom.client.DOMUtils;
+import org.xwiki.gwt.dom.client.Element;
+import org.xwiki.gwt.dom.client.Range;
+
+import com.google.gwt.dom.client.Node;
+
+/**
+ * Utility class to perform functions associated to link executables, such as
+ * detecting the selected anchor. We have this as static function in a distinct
+ * class since there is no way to insert this on both the
+ * {@link CreateLinkExecutable} and {@link UnlinkExecutable} hierarchies.
+ *
+ * @version $Id$
+ */
+public class LinkExecutableUtils {
+ /**
+ * The tag name of the anchor element.
+ */
+ public static final String ANCHOR_TAG_NAME = "a";
+
+ /**
+ * Returns the currently selected anchor element in the passed
+ * {@link RichTextArea}, as the user perceives the selection. The algorithm
+ * used is as follows:
+ * <ul>
+ * <li>find anchor ancestor of the first leaf of the selection. If the first
+ * leaf is the selection start container and the offset is at the end, then
+ * eliminate this first leaf and analyze the second</li>
+ * <li>find anchor ancestor of the last leaf of the selection. If the last
+ * leaf is the end container and the selection starts at its very beginning,
+ * skip this and analyze the previous leaf</li>
+ * <li>is the two ancestor anchors are not null and are the same, this
+ * anchor is the selected anchor</li>
+ * </ul>
+ *
+ * @param rta
+ * the rich text area whose selection to test
+ * @return the anchor in which the current selection is found
+ */
+ public static Element getSelectedAnchor(RichTextArea rta) {
+ // there is no wrapping anchor if there is no selection
+ if (rta.getDocument().getSelection().getRangeCount() == 0) {
+ return null;
+ }
+ // Find the selected anchor by the following algorithm:
+ Range range = rta.getDocument().getSelection().getRangeAt(0);
+ // if the selection is collapsed, we have our answer already
+ if (range.isCollapsed()) {
+ return (Element) DOMUtils.getInstance().getFirstAncestor(range.getStartContainer(), ANCHOR_TAG_NAME);
+ }
+ Element foundAncestorStart = null;
+ Element foundAncestorEnd = null;
+ // get the first leaf of the selection and check it out
+ Node firstLeaf = DOMUtils.getInstance().getFirstLeaf(range);
+ if (firstLeaf == range.getStartContainer()
+ && range.getStartOffset() == DOMUtils.getInstance().getLength(firstLeaf)) {
+ firstLeaf = DOMUtils.getInstance().getNextLeaf(firstLeaf);
+ }
+ foundAncestorStart = (Element) DOMUtils.getInstance().getFirstAncestor(firstLeaf, ANCHOR_TAG_NAME);
+ // if no anchor found for start, it's pointless to keep looking, won't
+ // find anything
+ if (foundAncestorStart == null) {
+ return null;
+ }
+ // check the other end
+ Node lastLeaf = DOMUtils.getInstance().getLastLeaf(range);
+ if (lastLeaf == range.getEndContainer() && range.getEndOffset() == 0) {
+ lastLeaf = DOMUtils.getInstance().getPreviousLeaf(lastLeaf);
+ }
+ foundAncestorEnd = (Element) DOMUtils.getInstance().getFirstAncestor(lastLeaf, ANCHOR_TAG_NAME);
+
+ if (foundAncestorStart == foundAncestorEnd && foundAncestorStart != null) {
+ return foundAncestorStart;
+ }
+
+ return null;
+ }
+
+ /**
+ * Protected constructor.
+ */
+ protected LinkExecutableUtils() {
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -1,9 +1,9 @@
package org.ourproject.kune.platf.client.ui.rte.insertlink;
import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.DOM;
public class LinkInfo {
-
private static final String HREF = "href";
// private static final String TITLE = "title";
private static final String TARGET = "target";
@@ -15,19 +15,57 @@
&& target.equals(_BLANK));
}
+ public static LinkInfo parse(org.xwiki.gwt.dom.client.Element element) {
+ String target = element.getAttribute(TARGET);
+ return new LinkInfo(element.getInnerText(), element.getTitle(), element.getAttribute(HREF), target != null
+ && target.equals(_BLANK));
+ }
+
private String text;
private String title;
- private String url;
+ private String href;
+ private String target;
- private boolean inNewWindow;
+ public LinkInfo(String text) {
+ this(text, null, "", false);
+ }
- public LinkInfo(String text, String title, String url, boolean inNewWindow) {
+ public LinkInfo(String text, String href) {
this.text = text;
+ this.href = href;
+ }
+
+ public LinkInfo(String text, String title, String href, boolean inNewWindow) {
+ this.text = text;
+ this.href = href;
this.title = title;
- this.url = url;
- this.inNewWindow = inNewWindow;
+ if (inNewWindow) {
+ this.setTarget(_BLANK);
+ }
}
+ public Element getElement() {
+ Element anchor = DOM.createAnchor();
+ com.google.gwt.user.client.Element element = (com.google.gwt.user.client.Element) anchor;
+ DOM.setElementProperty(element, "href", href);
+ if (getTarget() != null) {
+ DOM.setElementProperty(element, TARGET, getTarget());
+ }
+ if (title != null) {
+ DOM.setElementAttribute(element, "title", title);
+ }
+ DOM.setInnerText(element, text);
+ return anchor;
+ }
+
+ public String getHref() {
+ return href;
+ }
+
+ public String getTarget() {
+ return target;
+ }
+
public String getText() {
return text;
}
@@ -36,16 +74,20 @@
return title;
}
- public String getUrl() {
- return url;
+ public boolean inSameWindow() {
+ if (target != null) {
+ return target.equals(_BLANK);
+ } else {
+ return false;
+ }
}
- public boolean isInNewWindow() {
- return inNewWindow;
+ public void setHref(String href) {
+ this.href = href;
}
- public void setInNewWindow(boolean inNewWindow) {
- this.inNewWindow = inNewWindow;
+ public void setTarget(String target) {
+ this.target = target;
}
public void setText(String text) {
@@ -56,8 +98,10 @@
this.title = title;
}
- public void setUrl(String url) {
- this.url = url;
+ @Override
+ public String toString() {
+ Element anchor = getElement();
+ return anchor.getString();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfoTest.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfoTest.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfoTest.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -1,8 +1,11 @@
package org.ourproject.kune.platf.client.ui.rte.insertlink;
+import org.xwiki.gwt.dom.client.Element;
+import org.xwiki.gwt.dom.client.Range;
+import org.xwiki.gwt.dom.client.Selection;
+
import com.allen_sauer.gwt.log.client.Log;
-import com.xpn.xwiki.wysiwyg.client.dom.Range;
-import com.xpn.xwiki.wysiwyg.client.dom.Selection;
+import com.google.gwt.user.client.Timer;
public class LinkInfoTest extends AbstractRichTextAreaTest {
@@ -11,35 +14,48 @@
private static final String TITLE = "on over";
private static final String _BLANK = "_blank";
- @Override
- public String getModuleName() {
- return "org.ourproject.kune.app.Kune";
- }
-
- public void testSimpleLink() {
- // String html = createHtmlLink(HREF, TITLE, _BLANK, TEXT);
- rta.setHTML(TEXT);
+ public void doTestSimpleLink() {
+ String html = createHtmlLink(HREF, TITLE, _BLANK, TEXT);
+ rta.setHTML(html);
Log.debug(rta.getHTML());
Range range = rta.getDocument().createRange();
range.setStart(getBody().getFirstChild(), 1);
- range.setEnd(getBody().getFirstChild(), 3);
- String selectedText = "om";
+ range.setEnd(getBody().getFirstChild(), 1);
Selection selection = rta.getDocument().getSelection();
selection.removeAllRanges();
selection.addRange(range);
- assertEquals(selectedText, selection.toString());
- //
- // LinkInfo linkParsed =
- // LinkInfo.parse(getBody().getFirstChildElement());
- // assertEquals(TEXT, linkParsed.getText());
- // assertEquals(HREF, linkParsed.getUrl());
- // assertEquals(TITLE, linkParsed.getTitle());
- // assertEquals(false, linkParsed.isInNewWindow());
+
+ Element selectedAnchor = LinkExecutableUtils.getSelectedAnchor(rta);
+
+ Log.info(selectedAnchor.getString());
+
+ LinkInfo linkParsed = LinkInfo.parse(getBody().getFirstChildElement());
+ assertEquals(TEXT, linkParsed.getText());
+ assertEquals(HREF, linkParsed.getHref());
+ assertEquals(TITLE, linkParsed.getTitle());
+ assertEquals(_BLANK, linkParsed.getTarget());
}
+ @Override
+ public String getModuleName() {
+ return "org.ourproject.kune.app.Kune";
+ }
+
+ public void testPlainTextSelectionWithoutModification() {
+ delayTestFinish(FINISH_DELAY);
+ (new Timer() {
+ @Override
+ public void run() {
+ doTestSimpleLink();
+ finishTest();
+ }
+ }).schedule(START_DELAY);
+ }
+
private String createHtmlLink(String href, String title, String target, String text) {
return "<a title=\"" + title + "\" href=\"" + href + "\" target=\"" + target + "\">" + text + "</a>";
}
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstract.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstract.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstract.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -22,5 +22,4 @@
public interface InsertLinkAbstract {
void reset();
-
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -0,0 +1,120 @@
+package org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink;
+
+import org.ourproject.kune.platf.client.i18n.Resources;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialogView;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
+
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.gwtext.client.core.EventCallback;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Component;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.form.Checkbox;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.form.event.FormPanelListenerAdapter;
+
+public class InsertLinkAbstractPanel extends DefaultForm {
+
+ protected TextField textField;
+ protected TextField hrefField;
+ protected TextField onOverField;
+ protected final Checkbox sameWindow;
+
+ public InsertLinkAbstractPanel(String title, final InsertLinkAbstractPresenter presenter) {
+ super(title);
+ super.setAutoWidth(true);
+ super.setHeight(InsertLinkDialogView.HEIGHT);
+
+ hrefField = new TextField();
+ hrefField.setTabIndex(1);
+ hrefField.setWidth(DEF_FIELD_WIDTH);
+ hrefField.setAllowBlank(false);
+ hrefField.setMinLength(3);
+ hrefField.setMaxLength(250);
+ hrefField.setValidationEvent(false);
+
+ textField = new TextField();
+ textField.setTabIndex(2);
+ textField.setFieldLabel(Resources.i18n.t("Text"));
+ textField.setWidth(DEF_FIELD_WIDTH);
+ textField.setValidationEvent(false);
+ textField.setTitle(Resources.i18n.t("The hyper-linked text, like: ")
+ + "<span style=\"font-color:navy !important; text-decoration:underline;\">"
+ + Resources.i18n.t("Click me for more information!"));
+
+ onOverField = new TextField();
+ onOverField.setTabIndex(3);
+ onOverField.setFieldLabel(Resources.i18n.t("Flyover"));
+ onOverField.setWidth(DEF_FIELD_WIDTH);
+ onOverField.setValidationEvent(false);
+ onOverField.setTitle(Resources.i18n.t("The flyover appears when the viewer's mouse cursor is over the link."));
+
+ sameWindow = new Checkbox(Resources.i18n.t("Open link in new window"));
+ sameWindow.setChecked(false);
+
+ textField.addKeyPressListener(new EventCallback() {
+ public void execute(EventObject e) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ presenter.onTextFieldChanged(textField.getRawValue());
+ }
+ });
+ }
+ });
+
+ onOverField.addKeyPressListener(new EventCallback() {
+ public void execute(EventObject e) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ presenter.onOverFieldChanged(onOverField.getRawValue());
+ }
+ });
+ }
+ });
+
+ super.addListener(new FormPanelListenerAdapter() {
+ @Override
+ public void onActivate(Panel panel) {
+ LinkInfo linkInfo = presenter.getLinkInfo();
+ updateValues(linkInfo);
+ presenter.onActivate();
+ }
+ });
+
+ add(hrefField);
+ add(textField);
+ add(onOverField);
+ add(sameWindow);
+ }
+
+ public String getHref() {
+ return hrefField.getRawValue();
+ }
+
+ public String getText() {
+ return textField.getRawValue();
+ }
+
+ public String getTitle() {
+ return onOverField.getRawValue();
+ }
+
+ public boolean inSameWindow() {
+ return sameWindow.getValue();
+ }
+
+ @Override
+ public void insert(int index, Component component) {
+ super.insert(index, component);
+ }
+
+ protected void updateValues(LinkInfo linkInfo) {
+ textField.setValue(linkInfo.getText());
+ onOverField.setValue(linkInfo.getTitle());
+ if (sameWindow.isVisible()) {
+ sameWindow.setChecked(linkInfo.inSameWindow());
+ }
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -21,31 +21,70 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.events.Listener0;
+
public class InsertLinkAbstractPresenter implements InsertLinkAbstract {
- private InsertLinkAbstractView view;
- private final InsertLinkDialog editorInsertElement;
+ protected InsertLinkAbstractView view;
+ protected final InsertLinkDialog editorInsertDialog;
+ private final Listener0 onInsertLinkPressed;
- public InsertLinkAbstractPresenter(InsertLinkDialog editorInsertElement) {
- this.editorInsertElement = editorInsertElement;
+ public InsertLinkAbstractPresenter(final InsertLinkDialog editorInsertDialog) {
+ this.editorInsertDialog = editorInsertDialog;
+ onInsertLinkPressed = new Listener0() {
+ public void onEvent() {
+ if (isValid()) {
+ LinkInfo linkInfo = updateLinkInfo();
+ editorInsertDialog.fireOnInsertLink(linkInfo);
+ } else {
+ Log.debug("Form in InsertLink not valid");
+ }
+ }
+ };
}
+ public LinkInfo getLinkInfo() {
+ return editorInsertDialog.getLinkInfo();
+ }
+
public View getView() {
return view;
}
public void init(InsertLinkAbstractView view) {
this.view = view;
- editorInsertElement.addOptionTab(view);
+ editorInsertDialog.addTab(view);
}
- public void onInsert(String name, String link) {
- editorInsertElement.fireOnCreateLink(name, link);
+ public boolean isValid() {
+ return view.isValid();
+ }
+
+ public void onActivate() {
+ editorInsertDialog.setOnInsertLinkPressed(onInsertLinkPressed);
+ }
+
+ public void onInsert(LinkInfo linkInfo) {
+ editorInsertDialog.fireOnInsertLink(linkInfo);
reset();
}
+ public void onOverFieldChanged(String title) {
+ editorInsertDialog.setLinkTitle(title);
+ }
+
+ public void onTextFieldChanged(String text) {
+ editorInsertDialog.setLinkText(text);
+ }
+
public void reset() {
view.reset();
}
+
+ protected LinkInfo updateLinkInfo() {
+ return new LinkInfo(view.getText(), view.getTitle(), view.getHref(), view.inSameWindow());
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractView.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractView.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -23,6 +23,15 @@
public interface InsertLinkAbstractView extends View {
+ String getHref();
+
+ String getText();
+
+ String getTitle();
+
+ boolean inSameWindow();
+
+ boolean isValid();
+
void reset();
-
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -20,48 +20,31 @@
package org.ourproject.kune.platf.client.ui.rte.insertlink.email;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
-import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialogView;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.InsertLinkAbstractPanel;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.form.VType;
-public class InsertLinkEmailPanel extends DefaultForm implements InsertLinkEmailView {
+public class InsertLinkEmailPanel extends InsertLinkAbstractPanel implements InsertLinkEmailView {
- public static final String EMAIL_FIELD = "k-teilep-email-field";
- private final TextField emailField;
+ public InsertLinkEmailPanel(final InsertLinkEmailPresenter presenter, I18nTranslationService i18n) {
+ super(i18n.t("Email link"), presenter);
- public InsertLinkEmailPanel(final InsertLinkEmailPresenter presenter,
- I18nTranslationService i18n) {
- super(i18n.t("Email link"));
- super.setAutoWidth(true);
- super.setHeight(InsertLinkDialogView.HEIGHT);
- emailField = new TextField();
- emailField.setTabIndex(4);
- emailField.setFieldLabel(i18n.t("Email"));
- emailField.setName(EMAIL_FIELD);
- emailField.setVtype(VType.EMAIL);
- emailField.setWidth(DEF_MEDIUM_FIELD_WIDTH);
- emailField.setAllowBlank(false);
- emailField.setValidationEvent(false);
- emailField.setId(EMAIL_FIELD);
- add(emailField);
- Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(Button button, EventObject e) {
- if (getFormPanel().getForm().isValid()) {
- presenter.onInsert("", "mailto://" + emailField.getRawValue());
- }
- }
- });
- addButton(insert);
+ hrefField.setFieldLabel(i18n.t("Email"));
+ hrefField.setVtype(VType.EMAIL);
+
+ sameWindow.setVisible(false);
}
public void clear() {
super.reset();
}
+
+ @Override
+ protected void updateValues(LinkInfo linkInfo) {
+ super.updateValues(linkInfo);
+ if (!linkInfo.getHref().startsWith("mailto")) {
+ hrefField.reset();
+ }
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -20,13 +20,24 @@
package org.ourproject.kune.platf.client.ui.rte.insertlink.email;
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.InsertLinkAbstractPresenter;
-public class InsertLinkEmailPresenter extends InsertLinkAbstractPresenter implements
- InsertLinkEmail {
+public class InsertLinkEmailPresenter extends InsertLinkAbstractPresenter implements InsertLinkEmail {
+ private InsertLinkEmailView view;
+
public InsertLinkEmailPresenter(InsertLinkDialog editorInsertElement) {
super(editorInsertElement);
}
+ public void init(InsertLinkEmailView view) {
+ super.init(view);
+ this.view = view;
+ }
+
+ @Override
+ protected LinkInfo updateLinkInfo() {
+ return new LinkInfo(view.getText(), view.getTitle(), "mailto://" + view.getHref(), false);
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailView.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/InsertLinkEmailView.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -22,4 +22,5 @@
import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.InsertLinkAbstractView;
public interface InsertLinkEmailView extends InsertLinkAbstractView {
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -20,9 +20,10 @@
package org.ourproject.kune.platf.client.ui.rte.insertlink.ext;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.Resources;
import org.ourproject.kune.platf.client.ui.TextUtils;
-import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
-import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialogView;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.InsertLinkAbstractPanel;
import com.google.gwt.user.client.ui.Frame;
import com.gwtext.client.core.EventObject;
@@ -30,37 +31,25 @@
import com.gwtext.client.widgets.PaddedPanel;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.layout.FitLayout;
-public class InsertLinkExtPanel extends DefaultForm implements InsertLinkExtView {
+public class InsertLinkExtPanel extends InsertLinkAbstractPanel implements InsertLinkExtView {
- public static final String LINK_FIELD = "k-teilep-link-f";
- final TextField linkField;
final Panel previewPanel;
- public InsertLinkExtPanel(final InsertLinkExtPresenter presenter,
- final I18nTranslationService i18n) {
- super(i18n.t("External link"));
- super.setAutoWidth(true);
- super.setHeight(InsertLinkDialogView.HEIGHT);
- linkField = new TextField();
- linkField.setTabIndex(1);
- linkField.setFieldLabel(i18n.t("External link (URL)"));
- linkField.setRegex(TextUtils.URL_REGEXP);
- linkField.setRegexText(i18n.t("The link should be a URL in the format 'http://www.domain.com'"));
- linkField.setName(LINK_FIELD);
- linkField.setWidth(DEF_FIELD_WIDTH);
- linkField.setAllowBlank(false);
- linkField.setMinLength(3);
- linkField.setMaxLength(250);
- linkField.setValidationEvent(false);
- linkField.setId(LINK_FIELD);
- add(linkField);
+ public InsertLinkExtPanel(final InsertLinkExtPresenter presenter, final I18nTranslationService i18n) {
+ super(i18n.t("External link"), presenter);
+
+ hrefField.setFieldLabel(Resources.i18n.t("External link (URL)"));
+ hrefField.setRegex(TextUtils.URL_REGEXP);
+ hrefField.setRegexText(Resources.i18n.t("The link should be a URL in the format 'http://www.domain.com'"));
+
previewPanel = new Panel();
previewPanel.setLayout(new FitLayout());
previewPanel.setHeight(125);
+
add(new PaddedPanel(previewPanel, 0));
+
Button preview = new Button(i18n.t("Preview"));
preview.addListener(new ButtonListenerAdapter() {
@Override
@@ -69,19 +58,10 @@
}
});
addButton(preview);
-
- Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(Button button, EventObject e) {
- presenter.onInsert();
- }
- });
- addButton(insert);
}
public String getUrl() {
- return linkField.getRawValue();
+ return hrefField.getRawValue();
}
@Override
@@ -98,6 +78,18 @@
}
public void setUrl(String url) {
- linkField.setValue(url);
+ hrefField.setValue(url);
}
+
+ @Override
+ protected void updateValues(LinkInfo linkInfo) {
+ super.updateValues(linkInfo);
+ String href = linkInfo.getHref();
+ if (href != null && !href.equals("")) {
+ String hrefValue = hrefField.getRawValue();
+ if (hrefValue != null && hrefValue.length() == 0) {
+ hrefField.setValue(href);
+ }
+ }
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -23,13 +23,8 @@
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.InsertLinkAbstractPresenter;
-public class InsertLinkExtPresenter extends InsertLinkAbstractPresenter implements
- InsertLinkExt {
+public class InsertLinkExtPresenter extends InsertLinkAbstractPresenter implements InsertLinkExt {
- interface Action {
- void onValid(String url);
- }
-
private InsertLinkExtView view;
public InsertLinkExtPresenter(InsertLinkDialog editorInsertElement) {
@@ -39,41 +34,33 @@
public void init(InsertLinkExtView view) {
super.init(view);
this.view = view;
+ // editorInsertDialog.insertTab(0, view);
}
- public void onInsert() {
- doActionIfValid(new Action() {
- public void onValid(String url) {
- onInsert("", url);
- }
- });
- }
-
- public void onPreview() {
- doActionIfValid(new Action() {
- public void onValid(String url) {
- view.setPreviewUrl(url);
- }
- });
- }
-
- private void doActionIfValid(Action action) {
+ @Override
+ public boolean isValid() {
String url = view.getUrl();
if (url.matches(TextUtils.URL_REGEXP)) {
- action.onValid(url);
+ return true;
} else {
if (!url.startsWith("http://")) {
url = "http://" + url;
if (url.matches(TextUtils.URL_REGEXP)) {
view.setUrl(url);
- action.onValid(url);
+ return true;
} else {
- view.isValid();
+ return view.isValid();
}
} else {
// Seems is not valid
- view.isValid();
+ return view.isValid();
}
}
}
+
+ public void onPreview() {
+ if (isValid()) {
+ view.setPreviewUrl(view.getUrl());
+ }
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtView.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtView.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -30,4 +30,6 @@
public void setPreviewUrl(String url);
public void setUrl(String url);
+
+ boolean inSameWindow();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -17,6 +17,6 @@
public InsertSpecialAsianCharPanel(InsertSpecialCharDialog insertSpecialCharDialog, I18nTranslationService i18n) {
super(insertSpecialCharDialog, i18n.t("Asian characters"), i18n.t(InsertSpecialCharDialog.DEF_LABEL),
SPECIAL_CHARS, 7, 20);
- insertSpecialCharDialog.addOptionTab(this);
+ insertSpecialCharDialog.addTab(this);
}
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -20,6 +20,6 @@
public InsertSpecialOccCharPanel(InsertSpecialCharDialog insertSpecialCharDialog, I18nTranslationService i18n) {
super(insertSpecialCharDialog, i18n.t("Special characters"), i18n.t(InsertSpecialCharDialog.DEF_LABEL),
SPECIAL_CHARS, 11, 20);
- insertSpecialCharDialog.addOptionTab(this);
+ insertSpecialCharDialog.addTab(this);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -79,7 +79,7 @@
form.addButton(insert);
super.add(form.getFormPanel());
- charDialog.addOptionTab(this);
+ charDialog.addTab(this);
}
private char getCharEntered() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -18,8 +18,7 @@
public class RTESavingEditorPresenter implements RTESavingEditor {
- @Deprecated
- public static final String FILE_MENU_OPTION = "File";
+ public static final String FILE_DEF_MENU_OPTION = "File";
public static final int AUTOSAVE_AFTER_FAILS_IN_MILLISECONS = 20000;
public static final int AUTOSAVE_IN_MILLISECONDS = 10000;
@@ -190,7 +189,7 @@
ActionToolbarMenuDescriptor<Object> save = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
RTEditor.topbar, onPerformSaveCall);
save.setIconCls(RTEImgResources.SUFFIX + imgResources.save().getName());
- save.setParentMenuTitle(i18n.t(FILE_MENU_OPTION));
+ save.setParentMenuTitle(i18n.t(FILE_DEF_MENU_OPTION));
save.setTextDescription(i18n.t("Save") + (ctrl_S.toString()));
save.setPosition(0);
@@ -200,7 +199,7 @@
onCancel();
}
});
- close.setParentMenuTitle(i18n.t(FILE_MENU_OPTION));
+ close.setParentMenuTitle(i18n.t(FILE_DEF_MENU_OPTION));
close.setTextDescription(i18n.t("Close"));
Listener0 onPerformSaveAndCloseCall = new Listener0() {
@@ -215,7 +214,7 @@
};
ActionToolbarMenuDescriptor<Object> saveclose = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
RTEditor.topbar, onPerformSaveAndCloseCall);
- saveclose.setParentMenuTitle(i18n.t(FILE_MENU_OPTION));
+ saveclose.setParentMenuTitle(i18n.t(FILE_DEF_MENU_OPTION));
saveclose.setTextDescription(i18n.t("Save & Close"));
ActionToolbarButtonDescriptor<Object> saveCloseBtn = new ActionToolbarButtonDescriptor<Object>(
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -83,7 +83,7 @@
createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
- createEditAction(TYPE_WIKIPAGE);
+ createEditAction(parentMenuTitle, TYPE_WIKIPAGE);
// final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
// createSetAsDefContent(parentMenuTitleCtx);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -228,7 +228,8 @@
contextActionRegistry.addAction(downloadCtx, typeUploadedfile);
}
- protected ActionToolbarButtonDescriptor<StateToken> createEditAction(String... registerInTypes) {
+ protected ActionToolbarButtonDescriptor<StateToken> createEditAction(final String fileMenuTitle,
+ String... registerInTypes) {
ActionToolbarButtonDescriptor<StateToken> editContent = new ActionToolbarButtonDescriptor<StateToken>(
AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
@@ -280,6 +281,7 @@
});
}
});
+ editor.setFileMenuTitle(fileMenuTitle);
NotifyUser.hideProgress();
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -810,17 +810,6 @@
}
});
- register(InsertLinkGroup.class, new Factory<InsertLinkLocal>(InsertLinkLocal.class) {
- @Override
- public InsertLinkLocal create() {
- final InsertLinkLocalPresenter presenter = new InsertLinkLocalPresenter($(InsertLinkDialog.class));
- final InsertLinkLocalPanel panel = new InsertLinkLocalPanel(presenter, $(WorkspaceSkeleton.class),
- $(I18nTranslationService.class), $(FileDownloadUtils.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
register(Singleton.class, new Factory<LanguageSelector>(LanguageSelector.class) {
@Override
public LanguageSelector create() {
@@ -956,6 +945,17 @@
}
});
+ register(InsertLinkGroup.class, new Factory<InsertLinkLocal>(InsertLinkLocal.class) {
+ @Override
+ public InsertLinkLocal create() {
+ final InsertLinkLocalPresenter presenter = new InsertLinkLocalPresenter($(InsertLinkDialog.class));
+ final InsertLinkLocalPanel panel = new InsertLinkLocalPanel(presenter, $(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class), $(FileDownloadUtils.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
$(GlobalShortcutRegister.class).enable();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -39,6 +39,8 @@
private final SiteSignOutLink siteSignOutLink;
private final I18nTranslationService i18n;
private final EntityTitle entityTitle;
+ private final String fileMenuTitle;
+ private final AbstractToolbar sndbar;
public ContentEditor(RTEditor editor, boolean autoSave, final I18nTranslationService i18n,
StateManager stateManager, SiteSignOutLink siteSignOutLink, DeferredCommandWrapper deferredCommandWrapper,
@@ -50,6 +52,7 @@
this.entityTitle = entityTitle;
super.init(view);
this.ws = ws;
+ fileMenuTitle = i18n.t(RTESavingEditorPresenter.FILE_DEF_MENU_OPTION);
Window.addWindowCloseListener(new WindowCloseListener() {
public void onWindowClosed() {
}
@@ -79,6 +82,7 @@
}
});
topbar = ((ActionToolbarPanel<Object>) basicEditor.getTopBar().getView()).getToolbar();
+ sndbar = ((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar();
}
@Override
@@ -92,6 +96,10 @@
siteSignOutLink.addBeforeSignOut(getBeforeSavingListener());
}
+ public void setFileMenuTitle(String fileMenuTitleNew) {
+ basicEditor.getTopBar().setParentMenuTitle(RTEditor.topbar, fileMenuTitle, null, fileMenuTitleNew);
+ }
+
@Override
protected void onCancelConfirmed() {
ws.getEntityWorkspace().clearContent();
@@ -107,14 +115,13 @@
// basicEditor.setFocus(false);
}
});
- rename.setParentMenuTitle(i18n.t(RTESavingEditorPresenter.FILE_MENU_OPTION));
+ rename.setParentMenuTitle(fileMenuTitle);
rename.setShortcut(new ShortcutDescriptor(false, Keyboard.KEY_F2, i18n.tWithNT("F2", "The F2 Function key")));
rename.setTextDescription(i18n.t("Rename"));
basicEditor.addAction(rename);
}
private void adjHeight(final int height) {
- AbstractToolbar sndbar = ((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar();
int barHeight = sndbar.getOffsetHeight();
int newHeight = height - 20 - barHeight;
// Log.debug("Sndbar height: " + barHeight + " new height: " +
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -11,6 +11,6 @@
}
public void init(InsertImageLocalView view) {
- insertImageDialog.addOptionTab(view);
+ insertImageDialog.addTab(view);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/InsertLinkLocalPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/InsertLinkLocalPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/InsertLinkLocalPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -22,30 +22,43 @@
import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.WindowUtils;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialogView;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.InsertLinkAbstractPanel;
+import org.ourproject.kune.workspace.client.search.AbstractLiveSearcherField;
import org.ourproject.kune.workspace.client.search.AbstractLiveSearcherPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.suco.client.events.Listener;
-public class InsertLinkLocalPanel extends AbstractLiveSearcherPanel implements InsertLinkLocalView {
+public class InsertLinkLocalPanel extends InsertLinkAbstractPanel implements InsertLinkLocalView {
private static final String DATA_PROXY_URL = "/kune/json/ContentJSONService/search";
- public InsertLinkLocalPanel(final InsertLinkLocalPresenter presenter,
- final WorkspaceSkeleton ws, I18nTranslationService i18n, FileDownloadUtils downloadUtils) {
- super(i18n, TEMPLATE_TEXT_PREFIX + downloadUtils.getLogoImageUrl(new StateToken("{shortName}"))
- + TEMPLATE_TEXT_SUFFIX, DATA_PROXY_URL, new Listener<LinkDTO>() {
- public void onEvent(LinkDTO link) {
- // FIXME
- presenter.onInsert("", WindowUtils.getLocation().getHref() + link.getLink());
- }
- });
- super.setTitle(i18n.t("Local link"));
- super.setFrame(true);
- super.setHeight(InsertLinkDialogView.HEIGHT);
- super.setPaddings(20);
+ private String href;
+
+ public InsertLinkLocalPanel(final InsertLinkLocalPresenter presenter, final WorkspaceSkeleton ws,
+ I18nTranslationService i18n, FileDownloadUtils downloadUtils) {
+ super(i18n.t("Local link"), presenter);
+
+ AbstractLiveSearcherField cb = new AbstractLiveSearcherField(i18n,
+ AbstractLiveSearcherPanel.TEMPLATE_TEXT_PREFIX
+ + downloadUtils.getLogoImageUrl(new StateToken("{shortName}"))
+ + AbstractLiveSearcherPanel.TEMPLATE_TEXT_SUFFIX, DATA_PROXY_URL, new Listener<LinkDTO>() {
+ public void onEvent(LinkDTO link) {
+ href = (new StateToken(link.getLink())).getPublicUrl();
+ }
+ });
+ cb.setLabel(i18n.t("Local content"));
+ cb.setHideLabel(false);
+ cb.setAllowBlank(false);
+ cb.setWidth(220);
+ hrefField.setVisible(false);
+ hrefField.disable();
+ super.insert(0, cb);
}
+
+ @Override
+ public String getHref() {
+ return href;
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/InsertLinkLocalPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/InsertLinkLocalPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/InsertLinkLocalPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -22,8 +22,7 @@
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.InsertLinkAbstractPresenter;
-public class InsertLinkLocalPresenter extends InsertLinkAbstractPresenter implements
- InsertLinkLocal {
+public class InsertLinkLocalPresenter extends InsertLinkAbstractPresenter implements InsertLinkLocal {
public InsertLinkLocalPresenter(InsertLinkDialog editorInsertElement) {
super(editorInsertElement);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -25,7 +25,7 @@
public interface EntityOptions extends AbstractTabbedDialog {
- public void addOptionTab(View tab);
+ public void addTab(View tab);
public View getView();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -59,7 +59,7 @@
public void init(EntityOptionsDefLicenseView view) {
this.view = view;
- entityOptions.addOptionTab(view);
+ entityOptions.addTab(view);
setState();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -62,7 +62,7 @@
public void init(EntityOptionsLogoView view) {
this.view = view;
- entityOptions.addOptionTab(view);
+ entityOptions.addTab(view);
setState();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -37,6 +37,6 @@
public void init(EntityOptionsPublicSpaceConfView view) {
this.view = view;
- entityOptions.addOptionTab(view);
+ entityOptions.addTab(view);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -66,7 +66,7 @@
public void init(EntityOptionsToolsConfView view) {
this.view = view;
setState();
- entityOptions.addOptionTab(view);
+ entityOptions.addTab(view);
}
public void onCheck(ToolSimpleDTO tool, boolean checked) {
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherField.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherField.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherField.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -0,0 +1,78 @@
+package org.ourproject.kune.workspace.client.search;
+
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+
+import com.calclab.suco.client.events.Listener;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.gwtext.client.core.Connection;
+import com.gwtext.client.core.Template;
+import com.gwtext.client.core.UrlParam;
+import com.gwtext.client.data.DataProxy;
+import com.gwtext.client.data.FieldDef;
+import com.gwtext.client.data.HttpProxy;
+import com.gwtext.client.data.JsonReader;
+import com.gwtext.client.data.Record;
+import com.gwtext.client.data.RecordDef;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.data.StringFieldDef;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
+
+public class AbstractLiveSearcherField extends ComboBox {
+ private static final String LONG_NAME_FIELD = "longName";
+ private static final String SHORT_NAME_FIELD = "shortName";
+ private static final String ICON_URL_FIELD = "iconUrl";
+ private static final String LINK_FIELD = "link";
+ public static final int PAGINATION_SIZE = 10;
+
+ public AbstractLiveSearcherField(I18nTranslationService i18n, String templateText, String dataProxyUrl,
+ final Listener<LinkDTO> listener) {
+ DataProxy dataProxy = new HttpProxy(dataProxyUrl, Connection.POST);
+
+ final JsonReader reader = new JsonReader(new RecordDef(
+ new FieldDef[] { new StringFieldDef(SHORT_NAME_FIELD), new StringFieldDef(LONG_NAME_FIELD),
+ new StringFieldDef(LINK_FIELD), new StringFieldDef(ICON_URL_FIELD) }));
+ reader.setRoot("list");
+ reader.setTotalProperty("size");
+ reader.setId(SHORT_NAME_FIELD);
+
+ final Store store = new Store(dataProxy, reader);
+
+ store.load(new UrlParam[] { new UrlParam("query", "."), new UrlParam("first", 1),
+ new UrlParam("max", PAGINATION_SIZE) });
+
+ final Template resultTpl = new Template(templateText);
+ super.setStore(store);
+ super.setEmptyText(i18n.t("Write here to search"));
+ super.setDisplayField(LONG_NAME_FIELD);
+ super.setTypeAhead(true);
+ super.setLoadingText(i18n.t("Searching..."));
+ super.setWidth(268);
+ super.setPageSize(PAGINATION_SIZE);
+ super.setTpl(resultTpl);
+ super.setMode(ComboBox.REMOTE);
+ super.setMinChars(2);
+ super.setSelectOnFocus(false);
+ super.setHideTrigger(true);
+ super.setHideLabel(true);
+ // setTitle(i18n.t("User or group"));
+ super.setItemSelector("div.search-item");
+
+ super.addListener(new ComboBoxListenerAdapter() {
+ @Override
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ final LinkDTO link = new LinkDTO(record.getAsString(SHORT_NAME_FIELD),
+ record.getAsString(LONG_NAME_FIELD), record.getAsString(ICON_URL_FIELD),
+ record.getAsString(LINK_FIELD));
+ listener.onEvent(link);
+ }
+ });
+ }
+ });
+
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherPanel.java 2009-03-23 19:21:30 UTC (rev 1083)
@@ -23,88 +23,19 @@
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import com.calclab.suco.client.events.Listener;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
-import com.gwtext.client.core.Connection;
-import com.gwtext.client.core.Template;
-import com.gwtext.client.core.UrlParam;
-import com.gwtext.client.data.DataProxy;
-import com.gwtext.client.data.FieldDef;
-import com.gwtext.client.data.HttpProxy;
-import com.gwtext.client.data.JsonReader;
-import com.gwtext.client.data.Record;
-import com.gwtext.client.data.RecordDef;
-import com.gwtext.client.data.Store;
-import com.gwtext.client.data.StringFieldDef;
-import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.FormPanel;
-import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
public class AbstractLiveSearcherPanel extends FormPanel {
- protected static final String TEMPLATE_TEXT_PREFIX = "<div class=\"search-item\"><span class=\"kune-IconHyperlink\"><img src=\"";
- protected static final String TEMPLATE_TEXT_SUFFIX = "\" style=\"height: 16px; width: 16px;\" />{shortName}: {longName}</span></div>";
+ public static final String TEMPLATE_TEXT_PREFIX = "<div class=\"search-item\"><span class=\"kune-IconHyperlink\"><img src=\"";
+ public static final String TEMPLATE_TEXT_SUFFIX = "\" style=\"height: 16px; width: 16px;\" />{shortName}: {longName}</span></div>";
- private static final String LONG_NAME_FIELD = "longName";
- private static final String SHORT_NAME_FIELD = "shortName";
- private static final String ICON_URL_FIELD = "iconUrl";
- private static final String LINK_FIELD = "link";
-
- public static final int PAGINATION_SIZE = 10;
-
public AbstractLiveSearcherPanel(I18nTranslationService i18n, String templateText, String dataProxyUrl,
final Listener<LinkDTO> listener) {
- DataProxy dataProxy = new HttpProxy(dataProxyUrl, Connection.POST);
-
- final JsonReader reader = new JsonReader(new RecordDef(
- new FieldDef[] { new StringFieldDef(SHORT_NAME_FIELD), new StringFieldDef(LONG_NAME_FIELD),
- new StringFieldDef(LINK_FIELD), new StringFieldDef(ICON_URL_FIELD) }));
- reader.setRoot("list");
- reader.setTotalProperty("size");
- reader.setId(SHORT_NAME_FIELD);
-
- final Store store = new Store(dataProxy, reader);
-
- store.load(new UrlParam[] { new UrlParam("query", "."), new UrlParam("first", 1),
- new UrlParam("max", PAGINATION_SIZE) });
-
super.setBorder(false);
super.setWidth(275);
super.setHideLabels(true);
-
- final Template resultTpl = new Template(templateText);
- final ComboBox cb = new ComboBox();
- cb.setStore(store);
- cb.setEmptyText(i18n.t("Write here to search"));
- cb.setDisplayField(LONG_NAME_FIELD);
- cb.setTypeAhead(true);
- cb.setLoadingText(i18n.t("Searching..."));
- cb.setWidth(268);
- cb.setPageSize(PAGINATION_SIZE);
- cb.setTpl(resultTpl);
- cb.setMode(ComboBox.REMOTE);
- cb.setMinChars(2);
- cb.setSelectOnFocus(false);
- cb.setHideTrigger(true);
- cb.setHideLabel(true);
- // setTitle(i18n.t("User or group"));
- cb.setItemSelector("div.search-item");
-
- cb.addListener(new ComboBoxListenerAdapter() {
- @Override
- public void onSelect(final ComboBox comboBox, final Record record, final int index) {
- DeferredCommand.addCommand(new Command() {
- public void execute() {
- final LinkDTO link = new LinkDTO(record.getAsString(SHORT_NAME_FIELD),
- record.getAsString(LONG_NAME_FIELD), record.getAsString(ICON_URL_FIELD),
- record.getAsString(LINK_FIELD));
- listener.onEvent(link);
- }
- });
- }
- });
-
- super.add(cb);
+ super.add(new AbstractLiveSearcherField(i18n, templateText, dataProxyUrl, listener));
}
public void reset() {
1
0
Author: vjrj
Date: 2009-03-18 15:37:36 +0100 (Wed, 18 Mar 2009)
New Revision: 1082
Added:
trunk/TODO_done
trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/Keyboard.java
trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ShortcutDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ShortcutRegister.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcut.java
trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcutRegister.java
Modified:
trunk/TODO
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarButton.java
trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/GlobalShortcutRegister.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java
trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java
Log:
Shortcuts improved...
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/TODO 2009-03-18 14:37:36 UTC (rev 1082)
@@ -1,4 +1,5 @@
TODO-list for kune -*- mode: org; -*-
+#+ARCHIVE: %s_done::
#+SEQ_TODO: TODO danigb samer vjrj FEEDBACK VERIFY | FIXED CANCELED WONTFIX
@@ -14,15 +15,6 @@
http://maven.xwiki.org/releases/com/xpn/xwiki/platform/xwiki-web-wysiwyg/1.…
** vjrj <v> better RTE
*** Pending
-**** W3C Range/Selection support in RTE
- https://developer.mozilla.org/en/DOM/selection
- http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html
- As an intro:
- http://www.quirksmode.org/dom/range_intro.html
- http://maven.xwiki.org/site/xwiki-web/xwiki-web-wysiwyg/apidocs/com/xpn/xwi…
- other links:
- http://groups.google.com/group/rocket-gwt/browse_frm/thread/e56540d4168479c…
- http://code.google.com/p/gwt-html-editor/source/browse/branches/gwt1.4/src/…
**** Insert/Edit link
***** use cases
^<a href="http://example.com">sample</a>^ --- Parse and edit
@@ -30,19 +22,11 @@
<a href="http://example.com">s^amp^le</a> --- Parse and edit
<a href="http://example.com">s^a<em>kk</em>mp^le</a> --- Parse, get contains and edit
^some text <a href="http://example.com">samp^le</a> --- new link with get inner content?
-**** Quite urgent: Shortcuts propagation to browser
- http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/use…
- http://openkm.cvs.sourceforge.net/viewvc/openkm/openkm/src/es/git/openkm/fr…
- http://openkm.cvs.sourceforge.net/viewvc/openkm/openkm/src/es/git/openkm/fr…
- http://whatwouldnickdo.com/wordpress/370/gwt-right-click-context-menu/
**** with different menus (File/Blog ...)
**** bidi support
-**** Insert special chars (for table or from unicode).
**** images (local/remote) with preview
**** youtube videos/podcasts
-**** Edit HTML
**** File > Rename (F2)
-**** Insert > Special char
**** Insert > Page break (for printing)
**** Shortcut to fonts (Ctrl + numbers)
*** Links
@@ -167,10 +151,6 @@
- for ogg :: http://www.flumotion.net/cortado/
- for mp3+ogg :: flowplayer
** TODO <d> Inform to translators when original content changes
-** TODO <v> extjs i18n
- http://extjs.com/deploy/ext/examples/locale/dutch-form.js
- http://groups.google.com/group/gwt-ext/browse_thread/thread/ebec316effea2b8…
- http://extjs.com/forum/showthread.php?t=20160&highlight=localization
** TODO <v> Restarting server don't affect client session
Now there are problems if client was started before server, when server restart (session persist)
** TODO <v> Interceptors also useful for translation of db fields
Added: trunk/TODO_done
===================================================================
--- trunk/TODO_done 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/TODO_done 2009-03-18 14:37:36 UTC (rev 1082)
@@ -0,0 +1,45 @@
+# -*- mode: org -*-
+
+
+Archived entries from file TODO
+* FIXED Quite urgent: Shortcuts propagation to browser
+ :PROPERTIES:
+ :ARCHIVE_TIME: 2009-03-17 mar 15:13
+ :ARCHIVE_FILE: TODO
+ :ARCHIVE_OLPATH: SHORT-TERM (URGENT)/<v> better RTE/Pending
+ :ARCHIVE_CATEGORY: TODO
+ :END:
+ http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/use…
+ http://openkm.cvs.sourceforge.net/viewvc/openkm/openkm/src/es/git/openkm/fr…
+ http://openkm.cvs.sourceforge.net/viewvc/openkm/openkm/src/es/git/openkm/fr…
+ http://whatwouldnickdo.com/wordpress/370/gwt-right-click-context-menu/
+* FIXED W3C Range/Selection support in RTE
+ :PROPERTIES:
+ :ARCHIVE_TIME: 2009-03-17 mar 15:15
+ :ARCHIVE_FILE: TODO
+ :ARCHIVE_OLPATH: SHORT-TERM (URGENT)/<v> better RTE/Pending
+ :ARCHIVE_CATEGORY: TODO
+ :END:
+ https://developer.mozilla.org/en/DOM/selection
+ http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html
+ As an intro:
+ http://www.quirksmode.org/dom/range_intro.html
+ http://maven.xwiki.org/site/xwiki-web/xwiki-web-wysiwyg/apidocs/com/xpn/xwi…
+ other links:
+ http://groups.google.com/group/rocket-gwt/browse_frm/thread/e56540d4168479c…
+ http://code.google.com/p/gwt-html-editor/source/browse/branches/gwt1.4/src/…
+* FIXED <v> extjs i18n :ARCHIVE:
+ :PROPERTIES:
+ :ARCHIVE_TIME: 2009-03-17 mar 15:20
+ :ARCHIVE_FILE: TODO
+ :ARCHIVE_OLPATH: MID-TERM
+ :ARCHIVE_CATEGORY: TODO
+ :ARCHIVE_TODO: TODO
+ :END:
+ http://extjs.com/deploy/ext/examples/locale/dutch-form.js
+ http://groups.google.com/group/gwt-ext/browse_thread/thread/ebec316effea2b8…
+ http://extjs.com/forum/showthread.php?t=20160&highlight=localization
+
+
+
+
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-18 14:37:36 UTC (rev 1082)
@@ -41,4 +41,4 @@
padding: 1px 0px 1px 1px;
text-decoration:none;
}
-*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}.k-specialchar-grid{border:1px solid #ACA899;}.k-specialchar-grid table{}.k-specialchar-grid div{line-height:22px;}.k-specialchar-grid td{padding:1px;}.k-specialchar-pb{border:1px solid #EBE8D7;cursor:pointer;font-size:108%!important;text-align:center;vertical-align:middle;width:18px;height:18px;}.k-specialchar-pb-up{}.k-specialchar-big{padding:3px;line-height:22px;font-size:153.899994%!important;}.k-specialchar-adv-label{margin-left:-30px;}.k-specialchar-popup{border:1px solid silver;z-index:9999!important;background-color:#FFF;}.k-specialchar-pb-down{color:#161616;}.k-specialchar-pb-up-hovering{border:thin solid #ACA899;}.k-specialchar-pb-down-hovering{color:#161616;}
\ No newline at end of file
+*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}.k-specialchar-grid{border:1px solid #ACA899;}.k-specialchar-grid table{}.k-specialchar-grid div{line-height:22px;}.k-specialchar-grid td{padding:1px;}.k-specialchar-pb{border:1px solid #EBE8D7;cursor:pointer;font-size:108%!important;text-align:center;vertical-align:middle;width:18px;height:18px;}.k-specialchar-pb-up{}.k-specialchar-big{padding:3px;line-height:22px;font-size:153.899994%!important;}.k-specialchar-adv-label{margin-left:-10px;}.k-specialchar-popup{border:1px solid silver;z-index:9999!important;background-color:#FFF;}.k-specialchar-pb-down{color:#161616;}.k-specialchar-pb-up-hovering{border:thin solid #ACA899;}.k-specialchar-pb-down-hovering{color:#161616;}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -27,7 +27,7 @@
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.shortcuts.ActionShortcut;
+import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.WindowUtils;
@@ -61,7 +61,7 @@
private final Provider<FileDownloadUtils> downloadUtils;
private Collection<RosterItem> roster;
private final Event0 onRosterChanged;
- private final ActionShortcut shortcut;
+ private final ShortcutDescriptor shortcut;
public ChatEngineDefault(final I18nTranslationService i18n, final WorkspaceSkeleton ws, Application application,
Session session, final Provider<EmiteUIDialog> emiteUIProvider,
@@ -71,7 +71,7 @@
this.emiteUIProvider = emiteUIProvider;
this.downloadUtils = downloadUtils;
this.onRosterChanged = new Event0("onRosterChanged");
- shortcut = new ActionShortcut(false, true, false, 'C');
+ shortcut = new ShortcutDescriptor(false, true, false, 'C');
globalShortcutRegister.put(shortcut, new Listener0() {
public void onEvent() {
if (isDialogStarted()) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.services.ImageDescriptor;
-import org.ourproject.kune.platf.client.shortcuts.ActionShortcut;
+import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
@@ -78,7 +78,7 @@
/** The id. */
private String id;
- private ActionShortcut shortcut;
+ private ShortcutDescriptor shortcut;
private int position = NO_POSITION;
@@ -232,7 +232,7 @@
return position;
}
- public ActionShortcut getShortcut() {
+ public ShortcutDescriptor getShortcut() {
return shortcut;
}
@@ -401,7 +401,7 @@
this.position = position;
}
- public void setShortcut(ActionShortcut shortcut) {
+ public void setShortcut(ShortcutDescriptor shortcut) {
this.shortcut = shortcut;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarButton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarButton.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarButton.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -1,7 +1,7 @@
package org.ourproject.kune.platf.client.actions.toolbar;
import org.ourproject.kune.platf.client.actions.ActionToolbarDescriptor;
-import org.ourproject.kune.platf.client.shortcuts.ActionShortcut;
+import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
import com.calclab.suco.client.events.Listener0;
import com.gwtext.client.core.EventObject;
@@ -37,7 +37,7 @@
super.setIconCls(iconCls);
}
String toolTip = action.getToolTip();
- ActionShortcut shortcut = action.getShortcut();
+ ShortcutDescriptor shortcut = action.getShortcut();
super.setTooltip((toolTip == null ? "" : toolTip) + (shortcut != null ? shortcut.toString() : ""));
setEnableButton(enabled);
// Waring: If you put set Id above click listener fires twice
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcut.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcut.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcut.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -1,125 +0,0 @@
-package org.ourproject.kune.platf.client.shortcuts;
-
-import org.ourproject.kune.platf.client.i18n.Resources;
-
-import com.google.gwt.user.client.ui.KeyboardListener;
-
-public class ActionShortcut {
-
- private static final String NO_KEYNAME = "nokeyname";
-
- private static boolean has(int modifiers, int modifier) {
- return ((modifiers & modifier) == modifier);
- }
-
- private final boolean alt;
- private final boolean ctrl;
- private final boolean shift;
- private final char key;
- private final String keyName;
-
- public ActionShortcut(boolean ctrl, boolean alt, boolean shift, char key) {
- this(ctrl, alt, shift, key, NO_KEYNAME);
- }
-
- public ActionShortcut(boolean ctrl, boolean alt, boolean shift, char key, String keyName) {
- this.alt = alt;
- this.ctrl = ctrl;
- this.shift = shift;
- this.key = key;
- this.keyName = keyName;
- }
-
- public ActionShortcut(boolean ctrl, boolean shift, char key) {
- this(ctrl, false, shift, key, NO_KEYNAME);
- }
-
- public ActionShortcut(boolean ctrl, boolean shift, char key, String keyName) {
- this(ctrl, false, shift, key, keyName);
- }
-
- public ActionShortcut(boolean ctrl, char key) {
- this(ctrl, false, false, key, NO_KEYNAME);
- }
-
- public ActionShortcut(boolean ctrl, char key, String keyName) {
- this(ctrl, false, false, key, keyName);
- }
-
- public ActionShortcut(char key, int modifiers) {
- this(has(modifiers, KeyboardListener.MODIFIER_CTRL), has(modifiers, KeyboardListener.MODIFIER_ALT), has(
- modifiers, KeyboardListener.MODIFIER_SHIFT), key, NO_KEYNAME);
- }
-
- public ActionShortcut(char key, int modifiers, String keyName) {
- this(has(modifiers, KeyboardListener.MODIFIER_CTRL), has(modifiers, KeyboardListener.MODIFIER_ALT), has(
- modifiers, KeyboardListener.MODIFIER_SHIFT), key, keyName);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ActionShortcut other = (ActionShortcut) obj;
- if (alt != other.alt) {
- return false;
- }
- if (ctrl != other.ctrl) {
- return false;
- }
- if (key != other.key) {
- return false;
- }
- if (shift != other.shift) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (alt ? 1231 : 1237);
- result = prime * result + (ctrl ? 1231 : 1237);
- result = prime * result + key;
- result = prime * result + (shift ? 1231 : 1237);
- return result;
- }
-
- public boolean is(char keyCode, int modifiers) {
- return (keyCode == keyCode && same(modifiers, KeyboardListener.MODIFIER_ALT, alt)
- && same(modifiers, KeyboardListener.MODIFIER_CTRL, ctrl) && same(modifiers,
- KeyboardListener.MODIFIER_SHIFT, shift));
- }
-
- public boolean same(int modifiers, int modifier, boolean keyValue) {
- return (has(modifiers, modifier) == keyValue);
- }
-
- @Override
- public String toString() {
- String s = " (";
- s += sKey(alt, "Alt");
- s += sKey(ctrl, "Ctrl");
- s += sKey(shift, "Shift");
- s += keyName != NO_KEYNAME ? translateKey(keyName) + ")" : String.valueOf(key).toUpperCase() + ")";
- return s;
- }
-
- private String sKey(boolean key, String specialKeyName) {
- return key ? translateKey(specialKeyName) + "+" : "";
- }
-
- private String translateKey(String keyNameToTranslate) {
- return Resources.i18n.tWithNT(keyNameToTranslate, "The '" + keyNameToTranslate + "' keyboard key");
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcutRegister.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcutRegister.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcutRegister.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -1,62 +0,0 @@
-package org.ourproject.kune.platf.client.shortcuts;
-
-import java.util.HashMap;
-
-import org.ourproject.kune.platf.client.actions.ActionDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionItem;
-import org.ourproject.kune.platf.client.dto.AccessRolDTO;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.events.Listener0;
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.ui.KeyboardListenerCollection;
-
-public class ActionShortcutRegister {
-
- @SuppressWarnings("unchecked")
- private final HashMap<ActionShortcut, ActionItem> shortcuts;
-
- @SuppressWarnings("unchecked")
- public ActionShortcutRegister() {
- shortcuts = new HashMap<ActionShortcut, ActionItem>();
- }
-
- @SuppressWarnings("unchecked")
- public ActionItem get(ActionShortcut shortcut) {
- return shortcuts.get(shortcut);
- }
-
- @SuppressWarnings("unchecked")
- public ActionItem get(Event event) {
- int modifiers = KeyboardListenerCollection.getKeyboardModifiers(event);
- if (event.getTypeInt() == Event.ONKEYDOWN && modifiers != 0) {
- ActionShortcut shortcut = new ActionShortcut((char) event.getKeyCode(), modifiers);
- Log.debug("Shortcut pressed" + shortcut.toString());
- return shortcuts.get(shortcut);
- }
- // if (modifiers != 0) {
- // Log.debug("Not action associated with this shortcut");
- // }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public void put(ActionShortcut shortcut, ActionItem actionItem) {
- if (shortcuts.get(shortcut) != null) {
- Log.warn("Shortcut" + shortcut + " already registered");
- }
- shortcuts.put(shortcut, actionItem);
- }
-
- @SuppressWarnings("unchecked")
- public void put(ActionShortcut shortcut, final Listener0 listener) {
- ActionDescriptor descriptor = new ActionDescriptor(AccessRolDTO.Viewer, new Listener0() {
- public void onEvent() {
- listener.onEvent();
- }
- });
- ActionItem item = new ActionItem(descriptor, null);
- put(shortcut, item);
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/GlobalShortcutRegister.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/GlobalShortcutRegister.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/GlobalShortcutRegister.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -7,7 +7,7 @@
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.EventPreview;
-public class GlobalShortcutRegister extends ActionShortcutRegister {
+public class GlobalShortcutRegister extends ShortcutRegister {
private final EventPreview eventPreview;
Added: trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/Keyboard.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/Keyboard.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/Keyboard.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -0,0 +1,22 @@
+package org.ourproject.kune.platf.client.shortcuts;
+
+public interface Keyboard {
+
+ @Deprecated
+ public int KEY_F1 = 112; /* Browser's help */
+ public int KEY_F2 = 113;
+ public int KEY_F3 = 114;
+ public int KEY_F4 = 115;
+ @Deprecated
+ public int KEY_F5 = 116; /* Refresh in browsers */
+ public int KEY_F6 = 117;
+ @Deprecated
+ public int KEY_F7 = 118; /* Turn of caret in ff */
+ public int KEY_F8 = 119;
+ public int KEY_F9 = 120;
+ public int KEY_F10 = 121;
+ @Deprecated
+ public int KEY_F11 = 122; /* Full screen */
+ public int KEY_F12 = 123;
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ShortcutDescriptor.java (from rev 1078, trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcut.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcut.java 2009-03-16 04:13:36 UTC (rev 1078)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ShortcutDescriptor.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -0,0 +1,125 @@
+package org.ourproject.kune.platf.client.shortcuts;
+
+import org.ourproject.kune.platf.client.i18n.Resources;
+
+import com.google.gwt.user.client.ui.KeyboardListener;
+
+public class ShortcutDescriptor {
+
+ private static final String NO_KEYNAME = "nokeyname";
+
+ private static boolean has(int modifiers, int modifier) {
+ return ((modifiers & modifier) == modifier);
+ }
+
+ private final boolean alt;
+ private final boolean ctrl;
+ private final boolean shift;
+ private final int keycode;
+ private final String keyName;
+
+ public ShortcutDescriptor(boolean ctrl, boolean alt, boolean shift, int key) {
+ this(ctrl, alt, shift, key, NO_KEYNAME);
+ }
+
+ public ShortcutDescriptor(boolean ctrl, boolean alt, boolean shift, int key, String keyName) {
+ this.alt = alt;
+ this.ctrl = ctrl;
+ this.shift = shift;
+ this.keycode = key;
+ this.keyName = keyName;
+ }
+
+ public ShortcutDescriptor(boolean ctrl, boolean shift, int key) {
+ this(ctrl, false, shift, key, NO_KEYNAME);
+ }
+
+ public ShortcutDescriptor(boolean ctrl, boolean shift, int key, String keyName) {
+ this(ctrl, false, shift, key, keyName);
+ }
+
+ public ShortcutDescriptor(boolean ctrl, int key) {
+ this(ctrl, false, false, key, NO_KEYNAME);
+ }
+
+ public ShortcutDescriptor(boolean ctrl, int keycode, String keyName) {
+ this(ctrl, false, false, keycode, keyName);
+ }
+
+ public ShortcutDescriptor(int keycode, int modifiers) {
+ this(has(modifiers, KeyboardListener.MODIFIER_CTRL), has(modifiers, KeyboardListener.MODIFIER_ALT), has(
+ modifiers, KeyboardListener.MODIFIER_SHIFT), keycode, NO_KEYNAME);
+ }
+
+ public ShortcutDescriptor(int keycode, int modifiers, String keyName) {
+ this(has(modifiers, KeyboardListener.MODIFIER_CTRL), has(modifiers, KeyboardListener.MODIFIER_ALT), has(
+ modifiers, KeyboardListener.MODIFIER_SHIFT), keycode, keyName);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ShortcutDescriptor other = (ShortcutDescriptor) obj;
+ if (alt != other.alt) {
+ return false;
+ }
+ if (ctrl != other.ctrl) {
+ return false;
+ }
+ if (keycode != other.keycode) {
+ return false;
+ }
+ if (shift != other.shift) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (alt ? 1231 : 1237);
+ result = prime * result + (ctrl ? 1231 : 1237);
+ result = prime * result + keycode;
+ result = prime * result + (shift ? 1231 : 1237);
+ return result;
+ }
+
+ public boolean is(char keyCode, int modifiers) {
+ return (keyCode == keyCode && same(modifiers, KeyboardListener.MODIFIER_ALT, alt)
+ && same(modifiers, KeyboardListener.MODIFIER_CTRL, ctrl) && same(modifiers,
+ KeyboardListener.MODIFIER_SHIFT, shift));
+ }
+
+ public boolean same(int modifiers, int modifier, boolean keyValue) {
+ return (has(modifiers, modifier) == keyValue);
+ }
+
+ @Override
+ public String toString() {
+ String s = " (";
+ s += sKey(alt, "Alt");
+ s += sKey(ctrl, "Ctrl");
+ s += sKey(shift, "Shift");
+ s += keyName != NO_KEYNAME ? translateKey(keyName) + ")" : ("" + (char) keycode).toUpperCase() + ")";
+ return s;
+ }
+
+ private String sKey(boolean key, String specialKeyName) {
+ return key ? translateKey(specialKeyName) + "+" : "";
+ }
+
+ private String translateKey(String keyNameToTranslate) {
+ return Resources.i18n.tWithNT(keyNameToTranslate, "The '" + keyNameToTranslate + "' keyboard key");
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ShortcutRegister.java (from rev 1078, trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcutRegister.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ActionShortcutRegister.java 2009-03-16 04:13:36 UTC (rev 1078)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/ShortcutRegister.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -0,0 +1,65 @@
+package org.ourproject.kune.platf.client.shortcuts;
+
+import java.util.HashMap;
+
+import org.ourproject.kune.platf.client.actions.ActionDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionItem;
+import org.ourproject.kune.platf.client.dto.AccessRolDTO;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.events.Listener0;
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.ui.KeyboardListenerCollection;
+
+public class ShortcutRegister {
+
+ @SuppressWarnings("unchecked")
+ private final HashMap<ShortcutDescriptor, ActionItem> shortcuts;
+
+ @SuppressWarnings("unchecked")
+ public ShortcutRegister() {
+ shortcuts = new HashMap<ShortcutDescriptor, ActionItem>();
+ }
+
+ @SuppressWarnings("unchecked")
+ public ActionItem get(Event event) {
+ if (event.getTypeInt() == Event.ONKEYDOWN) {
+ int modifiers = KeyboardListenerCollection.getKeyboardModifiers(event);
+ boolean fnKey = (event.getKeyCode() >= Keyboard.KEY_F2 && event.getKeyCode() <= Keyboard.KEY_F12);
+ if (modifiers != 0 || fnKey) {
+ ShortcutDescriptor shortcut = new ShortcutDescriptor(event.getKeyCode(), modifiers);
+ return get(shortcut);
+ }
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public ActionItem get(ShortcutDescriptor shortcut) {
+ ActionItem actionItem = shortcuts.get(shortcut);
+ if (actionItem != null) {
+ Log.debug("Shortcut pressed" + actionItem.getAction().getShortcut());
+ }
+ return actionItem;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void put(ShortcutDescriptor shortcut, ActionItem actionItem) {
+ if (shortcuts.get(shortcut) != null) {
+ Log.warn("Shortcut" + shortcut + " already registered");
+ }
+ shortcuts.put(shortcut, actionItem);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void put(ShortcutDescriptor shortcut, final Listener0 listener) {
+ ActionDescriptor descriptor = new ActionDescriptor(AccessRolDTO.Viewer, new Listener0() {
+ public void onEvent() {
+ listener.onEvent();
+ }
+ });
+ ActionItem item = new ActionItem(descriptor, null);
+ put(shortcut, item);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -72,6 +72,11 @@
init(text, useDoubleClick);
}
+ public void edit() {
+ showEditor();
+ editor.setFocus(true);
+ }
+
public String getText() {
return label.getText();
}
@@ -123,7 +128,7 @@
}
private void init(final String text, final boolean useDoubleClick) {
- this.onEdit = new Event2<String, String>("onEdit");
+ this.onEdit = new Event2<String, String>("onLabelEdit");
doubleClickToRenameLabel = "Double click to rename";
clickToRenameLabel = "Click to rename";
hp = new HorizontalPanel();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -40,6 +40,8 @@
void setExtended(boolean extended);
+ void setFocus(boolean focus);
+
void setHtml(String html);
void setText(String text);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -17,9 +17,9 @@
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionManager;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.platf.client.shortcuts.ActionShortcut;
-import org.ourproject.kune.platf.client.shortcuts.ActionShortcutRegister;
import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister;
+import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
+import org.ourproject.kune.platf.client.shortcuts.ShortcutRegister;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
import com.google.gwt.dom.client.Element;
@@ -47,7 +47,7 @@
private final ExtendedFormatter extended;
private final RTEditorPresenter presenter;
private final ActionManager actionManager;
- private final ActionShortcutRegister shortcutRegister;
+ private final ShortcutRegister shortcutRegister;
private final GlobalShortcutRegister globalShortcutReg;
public RTEditorPanel(final RTEditorPresenter presenter, I18nUITranslationService i18n,
@@ -58,7 +58,7 @@
this.globalShortcutReg = globalShortcutReg;
basic = getBasicFormatter();
extended = getExtendedFormatter();
- shortcutRegister = new ActionShortcutRegister();
+ shortcutRegister = new ShortcutRegister();
EventListener listener = new EventListener();
addFocusListener(listener);
setWidth("96%");
@@ -70,7 +70,7 @@
for (ActionItem<Object> actionItem : actionItems) {
ActionDescriptor<Object> action = actionItem.getAction();
if (action.hasShortcut() && action.mustBeAdded(null)) {
- ActionShortcut shortcut = action.getShortcut();
+ ShortcutDescriptor shortcut = action.getShortcut();
shortcutRegister.put(shortcut, actionItem);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -14,7 +14,7 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.shortcuts.ActionShortcut;
+import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
@@ -188,6 +188,10 @@
this.extended = extended;
}
+ public void setFocus(boolean focus) {
+ view.setFocus(focus);
+ }
+
public void setHtml(String html) {
view.setHTML(html);
view.focus();
@@ -217,7 +221,7 @@
}
});
selectAll.setIconCls(getCssName(imgResources.selectall()));
- selectAll.setShortcut(new ActionShortcut(true, 'A'));
+ selectAll.setShortcut(new ShortcutDescriptor(true, 'A'));
selectAll.setTextDescription(i18n.t("Select all"));
selectAll.setParentMenuTitle(i18n.t(EDIT_MENU));
selectAll.setAddCondition(canBeBasic);
@@ -232,7 +236,7 @@
});
bold.setIconCls(getCssName(imgResources.bold()));
bold.setToolTip(i18n.t("Bold"));
- bold.setShortcut(new ActionShortcut(true, 'B'));
+ bold.setShortcut(new ShortcutDescriptor(true, 'B'));
bold.setAddCondition(canBeBasic);
italic = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbar, new Listener0() {
@@ -243,7 +247,7 @@
});
italic.setIconCls(getCssName(imgResources.italic()));
italic.setToolTip(i18n.t("Italic"));
- italic.setShortcut(new ActionShortcut(true, 'I'));
+ italic.setShortcut(new ShortcutDescriptor(true, 'I'));
italic.setAddCondition(canBeBasic);
italic.setAddCondition(canBeBasic);
@@ -255,7 +259,7 @@
});
underline.setIconCls(getCssName(imgResources.underline()));
underline.setToolTip(i18n.t("Underline"));
- underline.setShortcut(new ActionShortcut(true, 'U'));
+ underline.setShortcut(new ShortcutDescriptor(true, 'U'));
underline.setAddCondition(canBeBasic);
ActionToolbarMenuDescriptor<Object> subscript = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
@@ -268,7 +272,7 @@
subscript.setParentMenuTitle(i18n.t(FORMAT_MENU));
subscript.setTextDescription(i18n.t("Subscript"));
subscript.setIconCls(getCssName(imgResources.subscript()));
- subscript.setShortcut(new ActionShortcut(true, '0'));
+ subscript.setShortcut(new ShortcutDescriptor(true, 188, ","));
subscript.setAddCondition(canBeBasic);
ActionToolbarMenuDescriptor<Object> superscript = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
@@ -281,7 +285,7 @@
superscript.setParentMenuTitle(i18n.t(FORMAT_MENU));
superscript.setTextDescription(i18n.t("Superscript"));
superscript.setIconCls(getCssName(imgResources.superscript()));
- superscript.setShortcut(new ActionShortcut(true, '9'));
+ superscript.setShortcut(new ShortcutDescriptor(true, 190, "."));
superscript.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyLeft = new ActionToolbarButtonDescriptor<Object>(accessRol,
@@ -293,7 +297,7 @@
});
justifyLeft.setIconCls(getCssName(imgResources.alignleft()));
justifyLeft.setToolTip(i18n.t("Left Justify"));
- justifyLeft.setShortcut(new ActionShortcut(true, 'L'));
+ justifyLeft.setShortcut(new ShortcutDescriptor(true, 'L'));
justifyLeft.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyCentre = new ActionToolbarButtonDescriptor<Object>(accessRol,
@@ -305,7 +309,7 @@
});
justifyCentre.setIconCls(getCssName(imgResources.centerpara()));
justifyCentre.setToolTip(i18n.t("Centre Justify"));
- justifyCentre.setShortcut(new ActionShortcut(true, 'E'));
+ justifyCentre.setShortcut(new ShortcutDescriptor(true, 'E'));
justifyCentre.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyRight = new ActionToolbarButtonDescriptor<Object>(accessRol,
@@ -317,7 +321,7 @@
});
justifyRight.setIconCls(getCssName(imgResources.alignright()));
justifyRight.setToolTip(i18n.t("Right Justify"));
- justifyRight.setShortcut(new ActionShortcut(true, 'R'));
+ justifyRight.setShortcut(new ShortcutDescriptor(true, 'R'));
justifyRight.setAddCondition(canBeBasic);
ActionToolbarMenuDescriptor<Object> undo = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
@@ -327,7 +331,7 @@
fireOnEdit();
}
});
- undo.setShortcut(new ActionShortcut(true, 'Z'));
+ undo.setShortcut(new ShortcutDescriptor(true, 'Z'));
undo.setTextDescription(i18n.t("Undo"));
undo.setParentMenuTitle(i18n.t(EDIT_MENU));
undo.setAddCondition(canBeExtended);
@@ -340,7 +344,7 @@
fireOnEdit();
}
});
- redo.setShortcut(new ActionShortcut(true, 'Y'));
+ redo.setShortcut(new ShortcutDescriptor(true, 'Y'));
redo.setTextDescription(i18n.t("Redo"));
redo.setParentMenuTitle(i18n.t(EDIT_MENU));
redo.setAddCondition(canBeExtended);
@@ -378,7 +382,7 @@
view.copy();
}
});
- copy.setShortcut(new ActionShortcut(true, 'C'));
+ copy.setShortcut(new ShortcutDescriptor(true, 'C'));
copy.setTextDescription(i18n.t("Copy"));
copy.setParentMenuTitle(i18n.t(EDIT_MENU));
copy.setAddCondition(canBeExtended);
@@ -391,7 +395,7 @@
fireOnEdit();
}
});
- cut.setShortcut(new ActionShortcut(true, 'X'));
+ cut.setShortcut(new ShortcutDescriptor(true, 'X'));
cut.setTextDescription(i18n.t("Cut"));
cut.setParentMenuTitle(i18n.t(EDIT_MENU));
cut.setAddCondition(canBeExtended);
@@ -404,7 +408,7 @@
fireOnEdit();
}
});
- paste.setShortcut(new ActionShortcut(true, 'V'));
+ paste.setShortcut(new ShortcutDescriptor(true, 'V'));
paste.setTextDescription(i18n.t("Paste"));
paste.setParentMenuTitle(i18n.t(EDIT_MENU));
paste.setAddCondition(canBeExtended);
@@ -470,7 +474,7 @@
return session.isLogged();
}
});
- comment.setShortcut(new ActionShortcut(true, 'M'));
+ comment.setShortcut(new ShortcutDescriptor(true, 'M'));
comment.setTextDescription(i18n.t("Comment"));
comment.setParentMenuTitle(i18n.t(INSERT_MENU));
comment.setEnableCondition(isInsertHtmlSupported());
@@ -485,7 +489,7 @@
}
});
hr.setTextDescription(i18n.t("Horizontal line"));
- hr.setShortcut(new ActionShortcut(true, true, ' ', "Space"));
+ hr.setShortcut(new ShortcutDescriptor(true, true, ' ', "Space"));
hr.setIconCls(getCssName(imgResources.hfixedline()));
hr.setParentMenuTitle(i18n.t(INSERT_MENU));
hr.setAddCondition(canBeExtended);
@@ -556,7 +560,7 @@
});
ol.setIconCls(getCssName(imgResources.defaultnumbering()));
ol.setToolTip(i18n.t("Numbered List"));
- ol.setShortcut(new ActionShortcut(true, '7'));
+ ol.setShortcut(new ShortcutDescriptor(true, '7'));
ol.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> ul = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
@@ -568,7 +572,7 @@
});
ul.setIconCls(getCssName(imgResources.defaultbullet()));
ul.setToolTip(i18n.t("Bullet List"));
- ul.setShortcut(new ActionShortcut(true, '8'));
+ ul.setShortcut(new ShortcutDescriptor(true, '8'));
ul.setRightSeparator(ActionToolbarButtonSeparator.separator);
ul.setAddCondition(canBeExtended);
@@ -603,7 +607,7 @@
});
createLink.setIconCls(getCssName(imgResources.link()));
createLink.setToolTip(i18n.t("Create Link"));
- createLink.setShortcut(new ActionShortcut(true, 'K'));
+ createLink.setShortcut(new ShortcutDescriptor(true, 'K'));
createLink.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
@@ -615,7 +619,7 @@
});
removeLink.setIconCls(getCssName(imgResources.linkbreak()));
removeLink.setToolTip(i18n.t("Remove Link"));
- removeLink.setShortcut(new ActionShortcut(true, true, 'K'));
+ removeLink.setShortcut(new ShortcutDescriptor(true, true, 'K'));
removeLink.setAddCondition(canBeExtended);
final ActionToolbarMenuDescriptor<Object> removeFormat = new ActionToolbarMenuDescriptor<Object>(accessRol,
@@ -626,7 +630,7 @@
}
});
removeFormat.setIconCls(getCssName(imgResources.removeFormat()));
- ActionShortcut ctrl_space = new ActionShortcut(true, ' ', "Space");
+ ShortcutDescriptor ctrl_space = new ShortcutDescriptor(true, ' ', "Space");
removeFormat.setTextDescription(i18n.t("Clear Formatting") + (ctrl_space.toString()));
removeFormat.setAddCondition(canBeExtended);
removeFormat.setParentMenuTitle(i18n.t(FORMAT_MENU));
@@ -756,7 +760,7 @@
devInfo.setTextDescription(i18n.t("Developers info"));
devInfo.setAddCondition(canBeExtended);
devInfo.setParentMenuTitle(i18n.t(FORMAT_MENU));
- devInfo.setShortcut(new ActionShortcut(false, true, false, 'I'));
+ devInfo.setShortcut(new ShortcutDescriptor(false, true, false, 'I'));
actions.add(withNoItem(bold));
actions.add(withNoItem(italic));
@@ -839,6 +843,7 @@
font.setParentMenuTooltip(i18n.t("Font size"));
font.setParentMenuIconCls(getCssName(imgResources.fontheight()));
font.setAddCondition(canBeBasic);
+ font.setShortcut(new ShortcutDescriptor(true, 48 + fontSize));
return font;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -82,6 +82,8 @@
void setBackColor(String color);
+ void setFocus(boolean focus);
+
void setFontName(String name);
void setFontSize(FontSize fontSize);
@@ -107,4 +109,5 @@
void undo();
void unlink();
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -6,7 +6,7 @@
import org.ourproject.kune.platf.client.actions.BeforeActionListener;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.shortcuts.ActionShortcut;
+import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.rte.basic.RTEditor;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
@@ -19,7 +19,7 @@
public class RTESavingEditorPresenter implements RTESavingEditor {
@Deprecated
- private static final String FILE_MENU_OPTION = "File";
+ public static final String FILE_MENU_OPTION = "File";
public static final int AUTOSAVE_AFTER_FAILS_IN_MILLISECONS = 20000;
public static final int AUTOSAVE_IN_MILLISECONDS = 10000;
@@ -183,7 +183,7 @@
saveBtn = new ActionToolbarButtonDescriptor<Object>(AccessRolDTO.Editor, RTEditor.sndbar, onPerformSaveCall);
saveBtn.setIconCls(RTEImgResources.SUFFIX + imgResources.save().getName());
saveBtn.setToolTip(i18n.t("Save"));
- ActionShortcut ctrl_S = new ActionShortcut(true, 'S');
+ ShortcutDescriptor ctrl_S = new ShortcutDescriptor(true, 'S');
saveBtn.setShortcut(ctrl_S);
saveBtn.setPosition(0);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -157,6 +157,8 @@
renameCtn.setTextDescription(textDescription);
renameCtn.setParentMenuTitle(parentMenuTitle);
renameCtn.setEnableCondition(notDeleted());
+ // renameCtn.setShortcut(new ShortcutDescriptor(false, Keyboard.KEY_F2,
+ // i18n.tWithNT("F2", "The F2 Function key")));
contentActionRegistry.addAction(renameCtn, registerInTypes);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -873,7 +873,7 @@
return new ContentEditor($(RTEditor.class), true, $(I18nTranslationService.class),
$(StateManager.class), $(SiteSignOutLink.class), $(DeferredCommandWrapper.class),
$(RTEImgResources.class), $(WorkspaceSkeleton.class), $(TimerWrapper.class),
- new RTESavingEditorPanel());
+ new RTESavingEditorPanel(), $(EntityTitle.class));
}
});
register(NoDecoration.class, new Factory<ActionContextTopToolbar>(ActionContextTopToolbar.class) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -1,7 +1,11 @@
package org.ourproject.kune.workspace.client.editor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
+import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.shortcuts.Keyboard;
+import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.rte.basic.RTEditor;
@@ -14,6 +18,7 @@
import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import org.ourproject.kune.workspace.client.skel.Toolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.title.EntityTitle;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
@@ -32,12 +37,17 @@
private final RTEditorPanel editorPanel;
private final AbstractToolbar topbar;
private final SiteSignOutLink siteSignOutLink;
+ private final I18nTranslationService i18n;
+ private final EntityTitle entityTitle;
public ContentEditor(RTEditor editor, boolean autoSave, final I18nTranslationService i18n,
StateManager stateManager, SiteSignOutLink siteSignOutLink, DeferredCommandWrapper deferredCommandWrapper,
- RTEImgResources imgResources, WorkspaceSkeleton ws, TimerWrapper timer, RTESavingEditorView view) {
+ RTEImgResources imgResources, WorkspaceSkeleton ws, TimerWrapper timer, RTESavingEditorView view,
+ EntityTitle entityTitle) {
super(editor, autoSave, i18n, stateManager, deferredCommandWrapper, imgResources, timer);
+ this.i18n = i18n;
this.siteSignOutLink = siteSignOutLink;
+ this.entityTitle = entityTitle;
super.init(view);
this.ws = ws;
Window.addWindowCloseListener(new WindowCloseListener() {
@@ -55,6 +65,7 @@
});
vp = new VerticalPanel();
basicEditor = super.getBasicEditor();
+ addContentActions();
vp.add((Widget) ((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar());
editorPanel = (RTEditorPanel) basicEditor.getEditorArea();
vp.add(editorPanel);
@@ -88,6 +99,20 @@
siteSignOutLink.addBeforeSignOut(getBeforeSavingListener());
}
+ private void addContentActions() {
+ ActionToolbarMenuDescriptor<Object> rename = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
+ RTEditor.topbar, new Listener0() {
+ public void onEvent() {
+ entityTitle.edit();
+ // basicEditor.setFocus(false);
+ }
+ });
+ rename.setParentMenuTitle(i18n.t(RTESavingEditorPresenter.FILE_MENU_OPTION));
+ rename.setShortcut(new ShortcutDescriptor(false, Keyboard.KEY_F2, i18n.tWithNT("F2", "The F2 Function key")));
+ rename.setTextDescription(i18n.t("Rename"));
+ basicEditor.addAction(rename);
+ }
+
private void adjHeight(final int height) {
AbstractToolbar sndbar = ((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar();
int barHeight = sndbar.getOffsetHeight();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -25,7 +25,7 @@
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.i18n.I18nTranslationServiceMocked;
-import org.ourproject.kune.platf.client.shortcuts.ActionShortcut;
+import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
@@ -208,7 +208,7 @@
/**
* Global shortcut sample definition
*/
- $(GlobalShortcutRegister.class).put(new ActionShortcut(false, true, false, 'S'), new Listener0() {
+ $(GlobalShortcutRegister.class).put(new ShortcutDescriptor(false, true, false, 'S'), new Listener0() {
public void onEvent() {
NotifyUser.info("Global Ctrl+S pressed");
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -19,9 +19,10 @@
\*/
package org.ourproject.kune.workspace.client.title;
-
public interface EntityTitle {
+ void edit();
+
void setContentTitle(String title);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -52,6 +52,10 @@
icon.setVisible(false);
}
+ public void edit() {
+ titleLabel.edit();
+ }
+
public void setContentIcon(final String iconUrl) {
icon.setUrl(iconUrl);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -62,6 +62,10 @@
addRenameListeners();
}
+ public void edit() {
+ view.edit();
+ }
+
public View getView() {
return view;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -23,6 +23,8 @@
public interface EntityTitleView extends View {
+ void edit();
+
void setContentIcon(String iconUrl);
void setContentIconVisible(boolean visible);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -44,8 +44,8 @@
this.i18n = i18n;
this.session = session;
this.contentService = contentService;
- this.onSuccess = new Event2<StateToken, String>("onSuccess");
- this.onFail = new Event2<StateToken, String>("onFail");
+ this.onSuccess = new Event2<StateToken, String>("onRenameSuccess");
+ this.onFail = new Event2<StateToken, String>("onRenamaFail");
}
public void onFail(final Listener2<StateToken, String> slot) {
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java 2009-03-17 12:48:20 UTC (rev 1081)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java 2009-03-18 14:37:36 UTC (rev 1082)
@@ -5,7 +5,7 @@
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.platf.client.shortcuts.ActionShortcut;
+import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
import com.google.gwt.user.client.ui.KeyboardListener;
@@ -13,7 +13,7 @@
@Test
public void altS() {
- ActionShortcut shortcut = new ActionShortcut(false, true, false, 'S', null);
+ ShortcutDescriptor shortcut = new ShortcutDescriptor(false, true, false, 'S', null);
assertEquals(" (Alt+S)", shortcut.toString());
assertTrue(shortcut.is('S', KeyboardListener.MODIFIER_ALT));
assertTrue(!shortcut.is('S', KeyboardListener.MODIFIER_CTRL));
@@ -26,7 +26,7 @@
@Test
public void ctrl_coma() {
- ActionShortcut shortcut = new ActionShortcut(true, ',');
+ ShortcutDescriptor shortcut = new ShortcutDescriptor(true, ',');
assertEquals(" (Ctrl+,)", shortcut.toString());
assertTrue(shortcut.is(',', KeyboardListener.MODIFIER_CTRL));
assertTrue(!shortcut.is(',', KeyboardListener.MODIFIER_ALT));
@@ -35,7 +35,7 @@
@Test
public void ctrl_s() {
- ActionShortcut shortcut = new ActionShortcut(true, 's');
+ ShortcutDescriptor shortcut = new ShortcutDescriptor(true, 's');
assertEquals(" (Ctrl+S)", shortcut.toString());
assertTrue(shortcut.is('s', KeyboardListener.MODIFIER_CTRL));
assertTrue(!shortcut.is('s', KeyboardListener.MODIFIER_ALT));
@@ -44,7 +44,7 @@
@Test
public void ctrlS() {
- ActionShortcut shortcut = new ActionShortcut(true, 'S');
+ ShortcutDescriptor shortcut = new ShortcutDescriptor(true, 'S');
assertEquals(" (Ctrl+S)", shortcut.toString());
assertTrue(shortcut.is('S', KeyboardListener.MODIFIER_CTRL));
assertTrue(!shortcut.is('S', KeyboardListener.MODIFIER_ALT));
@@ -53,7 +53,7 @@
@Test
public void ctrlShiftS() {
- ActionShortcut shortcut = new ActionShortcut(true, false, true, 'S', null);
+ ShortcutDescriptor shortcut = new ShortcutDescriptor(true, false, true, 'S', null);
assertEquals(" (Ctrl+Shift+S)", shortcut.toString());
assertTrue(!shortcut.is('S', KeyboardListener.MODIFIER_ALT));
assertTrue(shortcut.is('S', KeyboardListener.MODIFIER_SHIFT | KeyboardListener.MODIFIER_CTRL));
1
0
Author: vjrj
Date: 2009-03-17 13:48:20 +0100 (Tue, 17 Mar 2009)
New Revision: 1081
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharView.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css
trunk/src/main/java/org/ourproject/kune/app/public/css/rte.css
trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/AbstractInsertCharPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/inserttable/InsertTableDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
Log:
Complete - task Insert special char dialog
Complete - task Add quotation RTE action
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-17 12:48:20 UTC (rev 1081)
@@ -33,7 +33,7 @@
-moz-opacity: 0.2;
opacity: 0.2;
}
-*/.kune-NavigationBar .topBar .gwt-Image{margin:0 2px 0 5px;}.kune-NavigationBar .Items{margin:2px 0;}.kune-NavigationBar .Items .gwt-Image{margin:2px 0;vertical-align:middle;}.kune-NavigationBar .Items .gwt-Hyperlink a{color:green;/* FIXME: other color */}.kune-NavigationBar .topBar .topBar-margin{margin-left:5px;}.kune-NavigationBar .pathMenu{vertical-align:middle;}.kune-NavigationBar .pathMenu .gwt-MenuItem{background:transparent url(img/button-bg-hard.gif) repeat-x 0 0;border-left:1px solid #AAA;border-right:1px solid #AAA;color:#999;cursor:pointer;white-space:nowrap;padding:3px 6px;}.kune-NavigationBar .pathMenu .gwt-MenuItem-selected{background:transparent url(img/button-bg-soft.gif) repeat-x 0 0;color:#000;}.kune-NavigationBar .kune-IconHyperlink{vertical-align:middle;margin-left:5px;}.kune-NavigationBar .kune-IconHyperlink a{color:green;text-decoration:none;}.kune-NavigationBar .kune-IconHyperlink .gwt-Image{margin-right:3px;vertical-align:middle;}/* Social Network */.kune-StackedDropDownPanel{}.kune-StackedDropDownPanel .gwt-StackPanelItem{border-top:1px solid #CCC;border-bottom:1px solid #CCC;background-color:#EFA;cursor:pointer;padding:1px 3px 0 6px;overflow:hidden;}.kune-StackedDropDownPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-StackedDropDownPanel .kune-DropDownInner table{width:100%;}.kune-StackedDropDownPanel .gwt-StackPanelItem-selected{}.kune-StackedDropDownPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-StackedDropDownPanel .kune-DropDownInner{padding:0;}/* StackedDropDownPanel Members */.kune-StackSubItemLabel{overflow:hidden;}.kune-StackSubItemLabel .gwt-MenuItem{white-space:nowrap;cursor:pointer;border-bottom:1px solid #F2F2F2;}.kune-StackSubItemLabel table{width:100%;}.kune-StackSubItemLabel .gwt-MenuItem img{vertical-align:middle;margin-top:1px;margin-bottom:1px;margin-left:5px;margin-right:3px;}.kune-StackSubItemLabel .gwt-MenuItem-selected{background-color:#FFE6D5;}.kune-StackSubItemActions{background-color:#F2F2F2;border:1px solid #999;vertical-align:middle;padding:5px 0;margin-left:-120px;margin-top:-2px;}.kune-StackSubItemActions .gwt-MenuItem{cursor:pointer;padding:1px 10px;white-space:nowrap;}.kune-StackSubItemActions .gwt-MenuItem img{vertical-align:middle;margin-right:3px;}.kune-StackSubItemActions .gwt-MenuItem-selected{background-color:#FFB958;}/* AccessList */.kune-AccessListSubLabel{font-style:italic;}.kune-AccessList{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel-open{width:100%;}.kune-AccessList .gwt-DisclosurePanel-closed{width:100%;}.kune-AccessList .header{margin:0 0 3px;text-decoration:none;width:100%;background-color:#8DD35F;}.kune-AccessList .header table{margin:0 5px 0 0;width:100%;color:#FFF;}.kune-AccessList .header img{margin:0 3px 0 0;}.kune-AccessList .content{margin:0 0 0 7px;width:100%;}.kune-AccessList .content table{margin-bottom:5px;width:100%;}/* Rate */.kune-RatePanel-Label{white-space:nowrap;vertical-align:middle;}.kune-RatePanel-Stars{margin-left:5px;vertical-align:middle;}.kune-RatePanel-Stars-RateIt{cursor:pointer;}/* Licenses */.kune-License-CC-Header{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}.kune-License-CC-Header .gwt-Label{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}/* Theme */.kune-IconBottomPanel .gwt-MenuItem{cursor:pointer;background-color:#FFF;margin:2px 2px 2px 5px;}.kune-IconBottomPanel .gwt-MenuItem-selected{background-color:#F2F2F2;}.gwt-MenuBar-bottomMenu{margin-left:-60px;margin-top:-120px;}/* i18n */.kune-I18nTranslatorCell{white-space:normal;}.kune-i18nTranslator-recommend{margin:10px;}.kune-i18nTranslator-recommend h1{font-size:131%;font-weight:700;}.kune-i18nTranslator-recommend h2{font-size:116%;font-weight:700;}.kune-i18nTranslator-recommend h3{font-size:108%;font-weight:700;font-style:italic;}.kune-i18nTranslator-recommend em{font-weight:700;}.kune-i18nTranslator-recommend strong{font-weight:700;}/* Admin Context */.kune-AdminContextPanel{margin:6px;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem{background:transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;cursor:pointer;padding:3px 10px 1px 20px;overflow:hidden;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-AdminContextPanel .gwt-StackPanelItem-selected{background:transparent url(img/arrow-down-white.gif) no-repeat scroll 3px 2px;background-color:#DEE3DB;}.kune-AdminContextPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-AdminContextPanel-inner{background-color:#FFF;}.kune-AdminContextPanel-inner-wrap{margin:5px;}.kune-EditableLabel{}.kune-EditableLabel .kune-EditableLabel-editable{}.kune-EditableLabel-high{background-color:#FFFBC1;cursor:pointer;}.kune-EditableLabel-high span{background-color:#FFFBC1;}.kune-EditableLabel a{margin-left:5px;}.kune-EditableLabel a:link{color:green;}.kune-EditableLabel a:hover{text-decoration:underline;}.kune-EditableLabel a:visited{color:olive;}.kune-EditableLabel img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable span{margin:3px;}.kune-EditableLabel span{margin:3px;}.kune-BottomIconsTrayPanel{width:165px;height:21px;vertical-align:middle;background-color:#EFEFEF;}.kune-Content-Main{margin:5px;}/* Yahoo ui base.css */.kune-Content-Main h1{font-size:138.5%;}.kune-Content-Main h2{font-size:123.099998%;}.kune-Content-Main h3{font-size:108%;}.kune-Content-Main h1{margin:1em 0;}.kune-Content-Main h2{margin:1em 0;}.kune-Content-Main h3{margin:1em 0;}.kune-Content-Main h1{font-weight:700;}.kune-Content-Main h2{font-weight:700;}.kune-Content-Main h3{font-weight:700;}.kune-Content-Main h4{font-weight:700;}.kune-Content-Main h5{font-weight:700;}.kune-Content-Main h6{font-weight:700;}.kune-Content-Main strong{font-weight:700;}.kune-Content-Main abbr{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main acronym{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main em{font-style:italic;}.kune-Content-Main blockquote{margin:1em;}.kune-Content-Main ul{margin:1em;}.kune-Content-Main ol{margin:1em;}.kune-Content-Main dl{margin:1em;}.kune-Content-Main ol{margin-left:2em;}.kune-Content-Main ul{margin-left:2em;}.kune-Content-Main dl{margin-left:2em;}.kune-Content-Main ol{list-style:decimal outside;}.kune-Content-Main li{list-style:decimal outside;}.kune-Content-Main li{list-style:disc outside;}.kune-Content-Main ul{list-style:disc outside;}.kune-Content-Main dl{margin-left:1em;}.kune-Content-Main dd{margin-left:1em;}.kune-Content-Main th{border:1px solid #000;padding:.5em;font-weight:700;text-align:center;}.kune-Content-Main td{border:1px solid #000;padding:.5em;}.kune-Content-Main caption{margin-bottom:.5em;text-align:center;}.kune-Content-Main p{margin-bottom:1em;}.kune-Content-Main fieldset{margin-bottom:1em;}.kune-Content-Main table{margin-bottom:1em;}.kune-Content-Main pre{margin-bottom:1em;}.kune-Content-Main input[type=text]{width:12.25em;width:11.9em;}.kune-Content-Main input[type=password]{width:12.25em;width:11.9em;}.kune-Content-Main textarea{width:12.25em;width:11.9em;}.search-icon{background-image:url(img/search.gif)!important;}.i18n-icon{background-image:url(img/language.gif)!important;}/* RTE Text editor */.kune-TexEditorPanel-TextArea{margin:3px;}.gwt-RichTextArea{/* border: 1px solid #000;
+*/.kune-NavigationBar .topBar .gwt-Image{margin:0 2px 0 5px;}.kune-NavigationBar .Items{margin:2px 0;}.kune-NavigationBar .Items .gwt-Image{margin:2px 0;vertical-align:middle;}.kune-NavigationBar .Items .gwt-Hyperlink a{color:green;/* FIXME: other color */}.kune-NavigationBar .topBar .topBar-margin{margin-left:5px;}.kune-NavigationBar .pathMenu{vertical-align:middle;}.kune-NavigationBar .pathMenu .gwt-MenuItem{background:transparent url(img/button-bg-hard.gif) repeat-x 0 0;border-left:1px solid #AAA;border-right:1px solid #AAA;color:#999;cursor:pointer;white-space:nowrap;padding:3px 6px;}.kune-NavigationBar .pathMenu .gwt-MenuItem-selected{background:transparent url(img/button-bg-soft.gif) repeat-x 0 0;color:#000;}.kune-NavigationBar .kune-IconHyperlink{vertical-align:middle;margin-left:5px;}.kune-NavigationBar .kune-IconHyperlink a{color:green;text-decoration:none;}.kune-NavigationBar .kune-IconHyperlink .gwt-Image{margin-right:3px;vertical-align:middle;}/* Social Network */.kune-StackedDropDownPanel{}.kune-StackedDropDownPanel .gwt-StackPanelItem{border-top:1px solid #CCC;border-bottom:1px solid #CCC;background-color:#EFA;cursor:pointer;padding:1px 3px 0 6px;overflow:hidden;}.kune-StackedDropDownPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-StackedDropDownPanel .kune-DropDownInner table{width:100%;}.kune-StackedDropDownPanel .gwt-StackPanelItem-selected{}.kune-StackedDropDownPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-StackedDropDownPanel .kune-DropDownInner{padding:0;}/* StackedDropDownPanel Members */.kune-StackSubItemLabel{overflow:hidden;}.kune-StackSubItemLabel .gwt-MenuItem{white-space:nowrap;cursor:pointer;border-bottom:1px solid #F2F2F2;}.kune-StackSubItemLabel table{width:100%;}.kune-StackSubItemLabel .gwt-MenuItem img{vertical-align:middle;margin-top:1px;margin-bottom:1px;margin-left:5px;margin-right:3px;}.kune-StackSubItemLabel .gwt-MenuItem-selected{background-color:#FFE6D5;}.kune-StackSubItemActions{background-color:#F2F2F2;border:1px solid #999;vertical-align:middle;padding:5px 0;margin-left:-120px;margin-top:-2px;}.kune-StackSubItemActions .gwt-MenuItem{cursor:pointer;padding:1px 10px;white-space:nowrap;}.kune-StackSubItemActions .gwt-MenuItem img{vertical-align:middle;margin-right:3px;}.kune-StackSubItemActions .gwt-MenuItem-selected{background-color:#FFB958;}/* AccessList */.kune-AccessListSubLabel{font-style:italic;}.kune-AccessList{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel-open{width:100%;}.kune-AccessList .gwt-DisclosurePanel-closed{width:100%;}.kune-AccessList .header{margin:0 0 3px;text-decoration:none;width:100%;background-color:#8DD35F;}.kune-AccessList .header table{margin:0 5px 0 0;width:100%;color:#FFF;}.kune-AccessList .header img{margin:0 3px 0 0;}.kune-AccessList .content{margin:0 0 0 7px;width:100%;}.kune-AccessList .content table{margin-bottom:5px;width:100%;}/* Rate */.kune-RatePanel-Label{white-space:nowrap;vertical-align:middle;}.kune-RatePanel-Stars{margin-left:5px;vertical-align:middle;}.kune-RatePanel-Stars-RateIt{cursor:pointer;}/* Licenses */.kune-License-CC-Header{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}.kune-License-CC-Header .gwt-Label{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}/* Theme */.kune-IconBottomPanel .gwt-MenuItem{cursor:pointer;background-color:#FFF;margin:2px 2px 2px 5px;}.kune-IconBottomPanel .gwt-MenuItem-selected{background-color:#F2F2F2;}.gwt-MenuBar-bottomMenu{margin-left:-60px;margin-top:-120px;}/* i18n */.kune-I18nTranslatorCell{white-space:normal;}.kune-i18nTranslator-recommend{margin:10px;}.kune-i18nTranslator-recommend h1{font-size:131%;font-weight:700;}.kune-i18nTranslator-recommend h2{font-size:116%;font-weight:700;}.kune-i18nTranslator-recommend h3{font-size:108%;font-weight:700;font-style:italic;}.kune-i18nTranslator-recommend em{font-weight:700;}.kune-i18nTranslator-recommend strong{font-weight:700;}/* Admin Context */.kune-AdminContextPanel{margin:6px;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem{background:transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;cursor:pointer;padding:3px 10px 1px 20px;overflow:hidden;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-AdminContextPanel .gwt-StackPanelItem-selected{background:transparent url(img/arrow-down-white.gif) no-repeat scroll 3px 2px;background-color:#DEE3DB;}.kune-AdminContextPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-AdminContextPanel-inner{background-color:#FFF;}.kune-AdminContextPanel-inner-wrap{margin:5px;}.kune-EditableLabel{}.kune-EditableLabel .kune-EditableLabel-editable{}.kune-EditableLabel-high{background-color:#FFFBC1;cursor:pointer;}.kune-EditableLabel-high span{background-color:#FFFBC1;}.kune-EditableLabel a{margin-left:5px;}.kune-EditableLabel a:link{color:green;}.kune-EditableLabel a:hover{text-decoration:underline;}.kune-EditableLabel a:visited{color:olive;}.kune-EditableLabel img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable span{margin:3px;}.kune-EditableLabel span{margin:3px;}.kune-BottomIconsTrayPanel{width:165px;height:21px;vertical-align:middle;background-color:#EFEFEF;}.kune-Content-Main{margin:5px;}/* Yahoo ui base.css */.kune-Content-Main h1{font-size:138.5%;}.kune-Content-Main h2{font-size:123.099998%;}.kune-Content-Main h3{font-size:108%;}.kune-Content-Main h1{margin:1em 0;}.kune-Content-Main h2{margin:1em 0;}.kune-Content-Main h3{margin:1em 0;}.kune-Content-Main h1{font-weight:700;}.kune-Content-Main h2{font-weight:700;}.kune-Content-Main h3{font-weight:700;}.kune-Content-Main h4{font-weight:700;}.kune-Content-Main h5{font-weight:700;}.kune-Content-Main h6{font-weight:700;}.kune-Content-Main strong{font-weight:700;}.kune-Content-Main abbr{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main acronym{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main em{font-style:italic;}.kune-Content-Main blockquote{margin:1em;}.kune-Content-Main ul{margin:1em;}.kune-Content-Main ol{margin:1em;}.kune-Content-Main dl{margin:1em;}.kune-Content-Main ol{margin-left:2em;}.kune-Content-Main ul{margin-left:2em;}.kune-Content-Main dl{margin-left:2em;}.kune-Content-Main ol{list-style:decimal outside;}.kune-Content-Main li{list-style:decimal outside;}.kune-Content-Main li{list-style:disc outside;}.kune-Content-Main ul{list-style:disc outside;}.kune-Content-Main dl{margin-left:1em;}.kune-Content-Main dd{margin-left:1em;}.kune-Content-Main th{border:1px solid #000;padding:.5em;font-weight:700;text-align:center;}.kune-Content-Main td{border:1px solid #000;padding:.5em;}.kune-Content-Main caption{margin-bottom:.5em;text-align:center;}.kune-Content-Main p{margin-bottom:1em;}.kune-Content-Main fieldset{margin-bottom:1em;}.kune-Content-Main table{margin-bottom:1em;}.kune-Content-Main pre{margin-bottom:1em;}.kune-Content-Main input[type=text]{width:12.25em;width:11.9em;}.kune-Content-Main input[type=password]{width:12.25em;width:11.9em;}.kune-Content-Main textarea{width:12.25em;width:11.9em;}.kune-Content-Main blockquote{border:1px dashed #DDD;padding:10px;}.search-icon{background-image:url(img/search.gif)!important;}.i18n-icon{background-image:url(img/language.gif)!important;}/* RTE Text editor */.kune-TexEditorPanel-TextArea{margin:3px;}.gwt-RichTextArea{/* border: 1px solid #000;
background-color: #FFF; */border:1px solid #4D4D4D;background-color:#FFF;margin:5px 0 5px 10px;}.gwt-RichTextToolbar{/* background-color: #F2F2F2;
padding: 5px; */height:24px;vertical-align:middle;}.gwt-RichTextToolbar table{vertical-align:middle;}.gwt-RichTextToolbar .gwt-ToggleButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-PushButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-PushButton-down{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-PushButton-down-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-ToggleButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-ToggleButton-down{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-down-hovering{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .x-btn{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lSpace{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lrSpace{float:left;}.RichTextToolbar-menu{float:left;margin-top:2px;z-index:4;}.RichTextToolbar-menu table{border-collapse:collapse;border-spacing:0;margin:0;z-index:4;}.RichTextToolbar-menu .gwt-MenuItem{margin-right:2px;border:1px solid #F2F2F2;}.RichTextToolbar-menu .gwt-MenuItem-selected{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.RichTextToolbar-submenu{background-color:#FFFCD5;border:1px solid #D38D5F;cursor:default;z-index:4;}.RichTextToolbar-submenu .gwt-MenuItem{cursor:default;white-space:nowrap;border:1px solid #FFFCD5;padding:0 4px;}.RichTextToolbar-submenu .gwt-MenuItem-selected{background-color:#FFB958;border:1px solid #C83737;}.kune-WebSafePalette{background-color:#FFF;border:1px solid #AAA;margin:1px;}.kune-WebSafePalette-popup{z-index:9999!important;background-color:#FFF;border:1px solid gray;}.kune-WebSafePalette td{width:12px;height:10px;}.k-site-traybar{background:#FFF none repeat scroll 0 50%;}.k-blank-toolbar{background:#FFF none repeat scroll 0 50%;}.k-sitebar .kune-IconHyperlink{white-space:nowrap;}.k-sitebar .kune-IconHyperlink a:link{cursor:pointer;text-decoration:underline;color:#B3B3B3;}.k-sitebar .kune-IconHyperlink a:hover{text-decoration:underline;}.k-sitebar .kune-IconHyperlink a:visited{color:#B3B3B3;}.k-sitebar-labellink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-sitebar{margin-right:10px;height:16px;background:#FFF;}.k-sitebar .gwt-TextBox{border:1px solid #E4A374;margin:0 15px 0 3px;padding-left:1px;color:#B3B3B3;}.k-sitebar .gwt-Hyperlink a{white-space:nowrap;color:#B3B3B3;text-decoration:underline;cursor:pointer;}.k-sitebar .gwt-PushButton{cursor:pointer;}.k-sitebar-LabelLink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-entity-summary{border-left-color:#FFF;border-left-width:5px;border-bottom-color:#FFF;border-bottom-width:5px;}.k-entitytextlogo-border{border:2px solid #F2F2F2;}.k-entitytextlogo-no-border{border:none;}.k-entitytextlogo{height:60px;margin:0 0 4px;overflow:hidden;width:468px;}.k-entitytextlogo table{vertical-align:middle;}.k-elogo-l-l{font-size:272%;}.k-elogo-l-m{font-size:167%;}.k-elogo-l-s{font-size:108%;}.k-entitytextlogo .gwt-Label{font-weight:700;margin:5px;height:27px;}.k-entitytextlogo-default .gwt-Label{color:#69312F;}.k-entitytextlogo-green .gwt-Label{color:#250;}.k-entitytextlogo-blue .gwt-Label{color:navy;}.k-entitytextlogo-grey .gwt-Label{color:#1A1A1A;}.k-entitytextlogo-purple .gwt-Label{color:#405;}.k-entitytextlogo-red .gwt-Label{color:maroon;}.k-elogo-plink{color:#CCC;font-size:85%;margin:5px;text-decoration:underline;white-space:nowrap;background-color:#FFF;}.k-elogop-expand{background-color:transparent;}.k-entity-default .x-layout-split,.k-entity-default .x-layout-collapsed{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-green .x-layout-split,.k-entity-green .x-layout-collapsed{background:#5FD35F none repeat scroll 0 50%;}.k-entity-blue .x-layout-split,.k-entity-blue .x-layout-collapsed{background:#06F none repeat scroll 0 50%;}.k-entity-grey .x-layout-split,.k-entity-grey .x-layout-collapsed{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-purple .x-layout-split,.k-entity-purple .x-layout-collapsed{background:#660080 none repeat scroll 0 50%;}.k-entity-red .x-layout-split,.k-entity-red .x-layout-collapsed{background:#D40000 none repeat scroll 0 50%;}.k-entityworkspace .x-layout-split,.k-entityworkspace .x-layout-collapsed{background:transparent none repeat scroll 0 50%;}.k-entityworkspace-default .x-layout-split,.k-entityworkspace-default .x-layout-collapsed{background:#DEAA87 none repeat scroll 0 50%;}.k-entityworkspace-green .x-layout-split,.k-entityworkspace-green .x-layout-collapsed{background:#DCE8AB none repeat scroll 0 50%;}.k-entityworkspace-blue .x-layout-split,.k-entityworkspace-blue .x-layout-collapsed{background:#D5D5FF none repeat scroll 0 50%;}.k-entityworkspace-grey .x-layout-split,.k-entityworkspace-grey .x-layout-collapsed{background:#999 none repeat scroll 0 50%;}.k-entityworkspace-purple .x-layout-split,.k-entityworkspace-purple .x-layout-collapsed{background:#A793AC none repeat scroll 0 50%;}.k-entityworkspace-red .x-layout-split,.k-entityworkspace-red .x-layout-collapsed{background:#F55 none repeat scroll 0 50%;}.k-entity-title{border-left-style:solid;border-left-width:2px;}.k-entity-title div{line-height:22px;white-space:nowrap;}.k-entity-subtitle{}.k-entity-subtitle div{line-height:22px;white-space:nowrap;}.k-entity-title-rd-default{background:#DD8A3D;}.k-entity-title-rd-green{background:#5FD35F;}.k-entity-title-rd-blue{background:#06F;}.k-entity-title-rd-grey{background:#4D4D4D;}.k-entity-title-rd-purple{background:#660080;}.k-entity-title-rd-red{background:#D40000;}.k-entity-title-default{background:#F1BB59 none repeat scroll 0 50%;border-left-color:#DD8A3D;}.k-entity-title-green{background:#AFA none repeat scroll 0 50%;border-left-color:#5FD35F;}.k-entity-title-blue{background:#AFDDE9 none repeat scroll 0 50%;border-left-color:#06F;}.k-entity-title-grey{background:#CCC none repeat scroll 0 50%;border-left-color:#4D4D4D;}.k-entity-title-purple{background:#DDAFE9 none repeat scroll 0 50%;border-left-color:#660080;}.k-entity-title-red{background:#FF8080 none repeat scroll 0 50%;border-left-color:#D40000;}.k-entity-title-default div{color:#69312F;}.k-entity-title-green div{color:#250;}.k-entity-title-blue div{color:navy;}.k-entity-title-grey div{color:#1A1A1A;}.k-entity-title-purple div{color:#405;}.k-entity-title-red div{color:maroon;}.k-entity-subtitle-default{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-subtitle-green{background:#5FD35F none repeat scroll 0 50%;}.k-entity-subtitle-blue{background:#06F none repeat scroll 0 50%;}.k-entity-subtitle-grey{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-subtitle-purple{background:#660080 none repeat scroll 0 50%;}.k-entity-subtitle-red{background:#D40000 none repeat scroll 0 50%;}.k-entity-subtitle-default div{color:#FFF;}.k-entity-subtitle-green div{color:#FFF;}.k-entity-subtitle-blue div{color:#FFF;}.k-entity-subtitle-grey div{color:#FFF;}.k-entity-subtitle-purple div{color:#FFF;}.k-entity-subtitle-red div{color:#FFF;}.k-entity-bottom-rd-default,.k-entity-bottom-default,.k-toolselectoritem-sel-default{background:#DD8A3D;}.k-entity-bottom-rd-green,.k-entity-bottom-green,.k-toolselectoritem-sel-green{background:#5FD35F;}.k-entity-bottom-rd-blue,.k-entity-bottom-blue,.k-toolselectoritem-sel-blue{background:#06F;}.k-entity-bottom-rd-grey,.k-entity-bottom-grey,.k-toolselectoritem-sel-grey{background:#4D4D4D;}.k-entity-bottom-rd-purple,.k-entity-bottom-purple,.k-toolselectoritem-sel-purple{background:#660080;}.k-entity-bottom-rd-red,.k-entity-bottom-red,.k-toolselectoritem-sel-red{background:#D40000;}.k-entity-context-default div,.k-entity-context-default .x-tree .x-panel-body{background:#FFD09D none repeat scroll 0 50%;}.k-entity-context-green div,.k-entity-context-green .x-tree .x-panel-body{background:#CFA none repeat scroll 0 50%;}.k-entity-context-blue div,.k-entity-context-blue .x-tree .x-panel-body{background:#ACF none repeat scroll 0 50%;}.k-entity-context-grey div,.k-entity-context-grey .x-tree .x-panel-body{background:#B3B3B3 none repeat scroll 0 50%;}.k-entity-context-purple div,.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-context-red div,.k-entity-context-red .x-tree .x-panel-body{background:#FAA none repeat scroll 0 50%;}.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-bottom div{/* line-height: 24px; */color:#FFF;}.k-toolbar-top-line{border-top-color:#d0d0d0;border-top-style:solid;border-top-width:1px;}.k-toolbar-bottom-line{border-bottom-color:#d0d0d0;border-bottom-style:solid;border-bottom-width:1px;}.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{white-space:nowrap;font:normal 100% arial, sans;line-height:19px;}.k-toolbar-sep{padding-top:4px;padding-left:5px;}/* Custom gwt-ext styles */.ytb-sep{background-image:url(../js/ext/resources/images/default/grid/grid-split.gif);background-position:center;background-repeat:no-repeat;display:block;font-size:1px;height:16px;width:4px;overflow:hidden;cursor:default;margin:0 2px;border:0;}.ytb-spacer{width:2px;}.x-grid-group-hd{border-bottom:2px solid grey;cursor:pointer;padding-top:3px;}/* Drop down */.k-dropdownouter{background-color:grey;}.k-dropdownouter-members{}.k-dropdownouter-members-default{background-color:#DF5244;}.k-dropdownouter-members-green{background-color:green;}.k-dropdownouter-members-blue{background-color:#5500D4;}.k-dropdownouter-members-grey{background-color:#4D4D4D;}.k-dropdownouter-members-purple{background-color:#672178;}.k-dropdownouter-members-red{background-color:#A02C2C;}.k-dropdownouter-part{}.k-dropdownouter-part-default{background-color:#CA5842;}.k-dropdownouter-part-green{background-color:#0A0;}.k-dropdownouter-part-blue{background-color:#60F;}.k-dropdownouter-part-grey{background-color:#666;}.k-dropdownouter-part-purple{background-color:#892CA0;}.k-dropdownouter-part-red{background-color:#C83737;}.k-dropdownouter-tags{}.k-dropdownouter-tags-default{background-color:#87501E;}.k-dropdownouter-tags-green{background-color:#00D400;}.k-dropdownouter-tags-blue{background-color:#95F;}.k-dropdownouter-tags-grey{background-color:gray;}.k-dropdownouter-tags-purple{background-color:#AB37C8;}.k-dropdownouter-tags-red{background-color:#D35F5F;}.k-dropdownouter-summary{}.k-dropdownouter-summary-default{background-color:#9F734B;}.k-dropdownouter-summary-green{background-color:#4CE14C;}.k-dropdownouter-summary-blue{background-color:#69A5FF;}.k-dropdownouter-summary-grey{background-color:#A6A6A6;}.k-dropdownouter-summary-purple{background-color:#C473D8;}.k-dropdownouter-summary-red{background-color:#E08F8F;}.k-dropdowninner{margin:0 3px 1px;background:green;background-color:#FFF;/* padding: 3px; */}.k-dropdownlabel{color:#FFF;cursor:pointer;}.k-dropdownlabel .gwt-Label{margin:0 5px 0 0;width:100%;}.k-dropdownlabel img{margin:0 3px 0 1px;}/* WsTheme */.k-wstheme-icon-default{background:#FF8C00;}.k-wstheme-icon-green{background:green;}.k-wstheme-icon-blue{background:blue;}.k-wstheme-icon-grey{background:grey;}.k-wstheme-icon-purple{background:purple;}.k-wstheme-icon-red{background:red;}/* Tool selector items */.k-toolselectoritem{width:auto;margin-bottom:5px;cursor:pointer;}.k-toolselectoritem-sel{}.k-toolselectoritem-notsel-default{background:#FFE9A5;}.k-toolselectoritem-notsel-green{background:#D6F4D6;}.k-toolselectoritem-notsel-blue{background:#D7D7F4;}.k-toolselectoritem-notsel-grey{background:#E6E6E6;}.k-toolselectoritem-notsel-purple{background:#EED7F4;}.k-toolselectoritem-notsel-red{background:#FFD5D5;}.k-toolselectoritem-sel a{color:#FFF;padding:0 9px;text-decoration:none;}.k-toolselectoritem-sel a:hover{text-decoration:none;}.k-toolselectoritem-notsel{}.k-toolselectoritem-notsel a{color:#00F;padding:0 9px;text-decoration:none;}.k-toolselectoritem-notsel a:hover{text-decoration:underline;}/* others *//*
.x-tree-node a span, .x-dd-drag-ghost a span {
@@ -41,4 +41,4 @@
padding: 1px 0px 1px 1px;
text-decoration:none;
}
-*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}.k-specialchar-grid{border:1px solid #ACA899;}.k-specialchar-grid table{}.k-specialchar-grid div{line-height:22px;}.k-specialchar-grid td{padding:1px;}.k-specialchar-pb{border:1px solid #EBE8D7;cursor:pointer;font-size:108%!important;text-align:center;vertical-align:middle;width:18px;height:18px;}.k-specialchar-pb-up{}.k-specialchar-pb-down{color:#161616;}.k-specialchar-pb-up-hovering{border:thin solid #ACA899;}.k-specialchar-pb-down-hovering{color:#161616;}
\ No newline at end of file
+*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}.k-specialchar-grid{border:1px solid #ACA899;}.k-specialchar-grid table{}.k-specialchar-grid div{line-height:22px;}.k-specialchar-grid td{padding:1px;}.k-specialchar-pb{border:1px solid #EBE8D7;cursor:pointer;font-size:108%!important;text-align:center;vertical-align:middle;width:18px;height:18px;}.k-specialchar-pb-up{}.k-specialchar-big{padding:3px;line-height:22px;font-size:153.899994%!important;}.k-specialchar-adv-label{margin-left:-30px;}.k-specialchar-popup{border:1px solid silver;z-index:9999!important;background-color:#FFF;}.k-specialchar-pb-down{color:#161616;}.k-specialchar-pb-up-hovering{border:thin solid #ACA899;}.k-specialchar-pb-down-hovering{color:#161616;}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-03-17 12:48:20 UTC (rev 1081)
@@ -854,7 +854,6 @@
}
.x-toolbar-body table { /* width: 100%; */
-
}
.k-preview-msg {
@@ -907,6 +906,22 @@
.k-specialchar-pb-up {
}
+.k-specialchar-big {
+ padding: 3px;
+ line-height: 22px;
+ font-size: 153.9% !important;
+}
+
+.k-specialchar-adv-label {
+ margin-left: -10px;
+}
+
+.k-specialchar-popup {
+ border: 1px solid #C0C0C0;
+ z-index: 9999 !important;
+ background-color: #FFF;
+}
+
.k-specialchar-pb-down {
color: #161616;
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css 2009-03-17 12:48:20 UTC (rev 1081)
@@ -13,4 +13,4 @@
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.4.1
-*/h1{font-size:138.5%;}h2{font-size:123.099998%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:700;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:700;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;width:11.9em;}body{font-family:arial, sans;margin:5px;}.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}
\ No newline at end of file
+*/h1{font-size:138.5%;}h2{font-size:123.099998%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:700;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:700;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;width:11.9em;}body{font-family:arial, sans;margin:5px;}.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}blockquote{border:1px dashed #DDD;padding:10px;}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/rte.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/rte.css 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/rte.css 2009-03-17 12:48:20 UTC (rev 1081)
@@ -4,8 +4,13 @@
}
.k-rte-comment {
- border:1px dashed #C0C0C0;
- line-height:1.4;
- padding:1px;
- background-color:#D7FFD7;
+ border: 1px dashed #C0C0C0;
+ line-height: 1.4;
+ padding: 1px;
+ background-color: #D7FFD7;
+}
+
+blockquote {
+ border: 1px dashed #DDDDDD;
+ padding: 10px;
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2009-03-17 12:48:20 UTC (rev 1081)
@@ -761,6 +761,10 @@
.kune-Content-Main textarea {width: 12.25em;*width: 11.9em;}
+.kune-Content-Main blockquote {
+ border: 1px dashed #DDDDDD;
+ padding: 10px;
+}
.search-icon {
background-image: url(img/search.gif) !important;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -97,6 +97,7 @@
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental.InsertSpecialOccChar;
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental.InsertSpecialOccCharPanel;
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental.InsertSpecialOccCharPresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.utf8.InsertSpecialUTF8CharPanel;
import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialogPanel;
import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialogPresenter;
@@ -437,7 +438,7 @@
public InsertTableDialog create() {
final InsertTableDialogPresenter presenter = new InsertTableDialogPresenter();
final InsertTableDialogPanel panel = new InsertTableDialogPanel(presenter, i18n,
- $$(SimplePalette.class));
+ $$(SimplePalette.class), $(RTEImgResources.class));
presenter.init(panel);
return presenter;
}
@@ -448,7 +449,7 @@
public InsertSpecialCharDialog create() {
final InsertSpecialCharDialogPresenter presenter = new InsertSpecialCharDialogPresenter();
final InsertSpecialCharDialogPanel panel = new InsertSpecialCharDialogPanel(presenter, $(Images.class),
- $(I18nTranslationService.class), $(InsertSpecialCharGroup.class));
+ $(I18nTranslationService.class), $(InsertSpecialCharGroup.class), $(RTEImgResources.class));
presenter.init(panel);
return presenter;
}
@@ -470,6 +471,11 @@
presenter.init(panel);
return presenter;
}
+ }, new Factory<InsertSpecialUTF8CharPanel>(InsertSpecialUTF8CharPanel.class) {
+ @Override
+ public InsertSpecialUTF8CharPanel create() {
+ return new InsertSpecialUTF8CharPanel(i18n, $(InsertSpecialCharDialog.class));
+ }
});
$(ApplicationComponentGroup.class).createAll();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -38,18 +38,26 @@
private final FormPanel form;
public DefaultForm() {
+ this(Position.RIGHT);
+ }
+
+ public DefaultForm(Position buttonAlign) {
form = new FormPanel();
form.setFrame(true);
form.setPaddings(10);
form.setBorder(false);
form.setLabelWidth(DEF_FIELD_LABEL_WITH);
form.setLabelAlign(Position.RIGHT);
- form.setButtonAlign(Position.RIGHT);
+ form.setButtonAlign(buttonAlign);
form.setHeader(false);
}
public DefaultForm(String title) {
- this();
+ this(title, Position.RIGHT);
+ }
+
+ public DefaultForm(String title, Position buttonAlign) {
+ this(buttonAlign);
form.setTitle(title);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -108,6 +108,13 @@
setFocus(true);
}
+ public void insertBlockquote() {
+ DocumentFragment extracted = getFstRange().cloneContents();
+ delete();
+ insertHtml("<blockquote>" + extracted.getInnerHTML() + "</blockquote>");
+ focus();
+ }
+
public void insertComment(String author) {
String comment = null;
createCommentAndSelectIt(author, comment);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -490,6 +490,18 @@
hr.setParentMenuTitle(i18n.t(INSERT_MENU));
hr.setAddCondition(canBeExtended);
+ ActionToolbarMenuDescriptor<Object> blockquote = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
+ public void onEvent() {
+ view.focus();
+ view.insertBlockquote();
+ fireOnEdit();
+ }
+ });
+ blockquote.setTextDescription(i18n.t("Block Quotation"));
+ blockquote.setParentMenuTitle(i18n.t(FORMAT_MENU));
+ blockquote.setAddCondition(canBeExtended);
+
ActionToolbarButtonDescriptor<Object> hrButton = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
new Listener0() {
public void onEvent() {
@@ -606,22 +618,37 @@
removeLink.setShortcut(new ActionShortcut(true, true, 'K'));
removeLink.setAddCondition(canBeExtended);
- final ActionToolbarButtonDescriptor<Object> removeFormat = new ActionToolbarButtonDescriptor<Object>(accessRol,
- sndbar, new Listener0() {
+ final ActionToolbarMenuDescriptor<Object> removeFormat = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ topbar, new Listener0() {
public void onEvent() {
view.removeFormat();
fireOnEdit();
}
});
removeFormat.setIconCls(getCssName(imgResources.removeFormat()));
- removeFormat.setToolTip(i18n.t("Clear Formatting"));
- removeFormat.setShortcut(new ActionShortcut(true, ' ', "Space"));
+ ActionShortcut ctrl_space = new ActionShortcut(true, ' ', "Space");
+ removeFormat.setTextDescription(i18n.t("Clear Formatting") + (ctrl_space.toString()));
removeFormat.setAddCondition(canBeExtended);
- removeFormat.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ removeFormat.setParentMenuTitle(i18n.t(FORMAT_MENU));
+ removeFormat.setBottomSeparator(true);
+ final ActionToolbarButtonDescriptor<Object> removeFormatBtn = new ActionToolbarButtonDescriptor<Object>(
+ accessRol, sndbar, new Listener0() {
+ public void onEvent() {
+ view.removeFormat();
+ fireOnEdit();
+ }
+ });
+ removeFormatBtn.setIconCls(getCssName(imgResources.removeFormat()));
+ removeFormatBtn.setToolTip(i18n.t("Clear Formatting"));
+ removeFormatBtn.setShortcut(ctrl_space);
+ removeFormatBtn.setAddCondition(canBeExtended);
+ removeFormatBtn.setRightSeparator(ActionToolbarButtonSeparator.separator);
+
final ActionToolbarMenuDescriptor<Object> insertSpecialChar = new ActionToolbarMenuDescriptor<Object>(
accessRol, topbar, new Listener0() {
public void onEvent() {
+ NotifyUser.showProgressLoading();
if (insertSpecialCharListener == null) {
insertSpecialCharListener = new Listener<String>() {
public void onEvent(String character) {
@@ -631,6 +658,7 @@
}
insertSpecialCharDialog.get().setOnInsertSpecialChar(insertSpecialCharListener);
insertSpecialCharDialog.get().show();
+ NotifyUser.hideProgress();
}
});
insertSpecialChar.setIconCls(getCssName(imgResources.specialchars()));
@@ -675,7 +703,7 @@
sndbar, new Listener0() {
public void onEvent() {
palette.show(getActionLeftPosition(sndBar, insertTableBtn), getActionTopPosition(sndBar,
- removeFormat), new Listener<String>() {
+ removeFormatBtn), new Listener<String>() {
public void onEvent(String color) {
palette.hide();
view.setForeColor(color);
@@ -746,13 +774,15 @@
actions.add(withNoItem(paste));
actions.add(withNoItem(selectAll));
actions.add(withNoItem(editHtml));
+ actions.add(withNoItem(removeFormat));
actions.add(withNoItem(subscript));
actions.add(withNoItem(superscript));
+ actions.add(withNoItem(blockquote));
actions.add(withNoItem(decreaseIndent));
actions.add(withNoItem(increaseIndent));
actions.add(withNoItem(ol));
actions.add(withNoItem(ul));
- actions.add(withNoItem(removeFormat));
+ actions.add(withNoItem(removeFormatBtn));
actions.add(withNoItem(hrButton));
actions.add(withNoItem(img));
actions.add(withNoItem(createLink));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -28,6 +28,8 @@
String getText();
+ void insertBlockquote();
+
void insertComment(String author);
void insertCommentNotUsingSelection(String author);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -3,6 +3,7 @@
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
+import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.Button;
@@ -15,10 +16,11 @@
private final InsertSpecialCharGroup insertSpecialCharGroup;
public InsertSpecialCharDialogPanel(final InsertSpecialCharDialogPresenter presenter, Images images,
- I18nTranslationService i18n, InsertSpecialCharGroup insertSpecialCharGroup) {
- super(INSERT_SPECIAL_CHAR_DIALOG, i18n.t("Insert Special Character"), 500, HEIGHT + 90, 500, HEIGHT + 90, true,
+ I18nTranslationService i18n, InsertSpecialCharGroup insertSpecialCharGroup, RTEImgResources imgResources) {
+ super(INSERT_SPECIAL_CHAR_DIALOG, i18n.t("Insert Special Character"), 495, HEIGHT + 90, 495, HEIGHT + 90, true,
images, INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID);
- // super.setIconCls("k-picture-icon");
+ // super.setIconCls(RTEImgResources.SUFFIX +
+ // imgResources.insertspreadsheet().getName());
this.insertSpecialCharGroup = insertSpecialCharGroup;
Button close = new Button(i18n.t("Close"));
close.addListener(new ButtonListenerAdapter() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/AbstractInsertCharPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/AbstractInsertCharPanel.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/AbstractInsertCharPanel.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -3,8 +3,11 @@
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogView;
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.user.client.ui.FocusListener;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.SourcesTableEvents;
import com.google.gwt.user.client.ui.TableListener;
@@ -13,6 +16,8 @@
public class AbstractInsertCharPanel extends Panel {
+ private FocusListener focusListener;
+
public AbstractInsertCharPanel(final InsertSpecialCharDialog insertSpecialCharDialog, String title,
String initialLabel, final char[] specialChars, int rows, final int cols) {
super(title);
@@ -45,10 +50,27 @@
add(grid);
}
- private Widget createButton(char c) {
+ private Widget createButton(final char c) {
PushButton button = new PushButton();
button.setText("" + c);
button.setStyleName("k-specialchar-pb");
+ if (focusListener == null) {
+ focusListener = new FocusListener() {
+ public void onFocus(Widget sender) {
+ PopupPanel popup = new PopupPanel(true);
+ popup.setStyleName("k-specialchar-popup");
+ Label characterLabel = new Label(sender.getElement().getInnerText());
+ characterLabel.setStyleName("k-specialchar-big");
+ popup.add(characterLabel);
+ popup.show();
+ Log.info("Focus!!!!!");
+ }
+
+ public void onLostFocus(Widget sender) {
+ }
+ };
+ }
+ // button.addFocusListener(focusListener);
return button;
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharPanel.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharPanel.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -0,0 +1,102 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.utf8;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogView;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.gwtext.client.core.EventCallback;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.Position;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.form.Label;
+import com.gwtext.client.widgets.form.TextField;
+
+public class InsertSpecialUTF8CharPanel extends Panel implements InsertSpecialUTF8CharView {
+ private static final int DEF_CHAR = 215;
+ private final DefaultForm form;
+ private final TextField inputUnicodeField;
+ private final TextField previewField;
+
+ public InsertSpecialUTF8CharPanel(I18nTranslationService i18n, final InsertSpecialCharDialog charDialog) {
+ super(i18n.t("Advanced"));
+ setAutoWidth(true);
+ setHeight(InsertSpecialCharDialogView.HEIGHT - 10);
+ form = new DefaultForm(Position.LEFT);
+ form.setAutoWidth(true);
+ form.setHeight(InsertSpecialCharDialogView.HEIGHT - 10);
+
+ Label label = new Label();
+ label.setHtml(i18n.t("If you know a special character's [%s] value, enter it below.",
+ "<a href=\"http://unicode.org/charts/\" target=\"_blank\">Unicode</a>")
+ + "<br/><br/>");
+ // label.setCls("k-specialchar-adv-label");
+
+ inputUnicodeField = new TextField();
+ inputUnicodeField.setTabIndex(4);
+ inputUnicodeField.setFieldLabel(i18n.t("Unicode"));
+ inputUnicodeField.setWidth(DefaultForm.DEF_XSMALL_FIELD_WIDTH);
+ inputUnicodeField.setRegex(TextUtils.NUM_REGEXP);
+ inputUnicodeField.setRegexText(i18n.t("This must be a number"));
+ inputUnicodeField.setAllowBlank(false);
+ inputUnicodeField.setValidationEvent(true);
+ inputUnicodeField.setValue("" + DEF_CHAR);
+
+ previewField = new TextField();
+ previewField.setTabIndex(5);
+ previewField.setFieldLabel(i18n.t("Preview"));
+ previewField.setWidth(DefaultForm.DEF_XSMALL_FIELD_WIDTH);
+ previewField.setValue("" + ((char) DEF_CHAR));
+ previewField.setDisabled(true);
+ previewField.setStyle("background-color:#FFF;background-image:none;color:#000;");
+
+ inputUnicodeField.addKeyPressListener(new EventCallback() {
+ public void execute(EventObject e) {
+ refreshPreview();
+ }
+ });
+
+ form.add(label);
+ form.add(inputUnicodeField);
+ form.add(previewField);
+
+ Button insert = new Button(i18n.t("Insert character"));
+
+ insert.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ if (form.getFormPanel().getForm().isValid()) {
+ charDialog.onInsert(getCharEntered());
+ }
+ }
+ });
+ form.addButton(insert);
+
+ super.add(form.getFormPanel());
+ charDialog.addOptionTab(this);
+ }
+
+ private char getCharEntered() {
+ try {
+ return (char) (new Integer(inputUnicodeField.getRawValue())).intValue();
+ } catch (Exception except) {
+ Log.debug("Not possible to cast utf8 int to char");
+ }
+ return '?';
+ }
+
+ private void refreshPreview() {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ previewField.setValue("" + getCharEntered());
+ }
+ });
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharView.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/InsertSpecialUTF8CharView.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.utf8;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface InsertSpecialUTF8CharView extends View {
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/inserttable/InsertTableDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/inserttable/InsertTableDialogPanel.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/inserttable/InsertTableDialogPanel.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -5,6 +5,7 @@
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.platf.client.ui.palette.SimplePalette;
+import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.ioc.Provider;
@@ -33,8 +34,10 @@
private final TextField borderColorField;
public InsertTableDialogPanel(final InsertTableDialogPresenter presenter, I18nTranslationService i18n,
- final Provider<SimplePalette> simplePalette) {
+ final Provider<SimplePalette> simplePalette, RTEImgResources imgResources) {
super(INSERT_LINK_ID, i18n.t("Insert Table"), true, false, 320, 260);
+ // super.setIconCls(RTEImgResources.SUFFIX +
+ // imgResources.insertspreadsheet().getName());
this.i18n = i18n;
form = new DefaultForm();
form.setAutoWidth(true);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java 2009-03-17 01:18:55 UTC (rev 1080)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java 2009-03-17 12:48:20 UTC (rev 1081)
@@ -183,15 +183,15 @@
saveBtn = new ActionToolbarButtonDescriptor<Object>(AccessRolDTO.Editor, RTEditor.sndbar, onPerformSaveCall);
saveBtn.setIconCls(RTEImgResources.SUFFIX + imgResources.save().getName());
saveBtn.setToolTip(i18n.t("Save"));
- saveBtn.setShortcut(new ActionShortcut(true, 'S'));
+ ActionShortcut ctrl_S = new ActionShortcut(true, 'S');
+ saveBtn.setShortcut(ctrl_S);
saveBtn.setPosition(0);
ActionToolbarMenuDescriptor<Object> save = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
RTEditor.topbar, onPerformSaveCall);
save.setIconCls(RTEImgResources.SUFFIX + imgResources.save().getName());
save.setParentMenuTitle(i18n.t(FILE_MENU_OPTION));
- save.setTextDescription(i18n.t("Save"));
- save.setShortcut(new ActionShortcut(true, 'S'));
+ save.setTextDescription(i18n.t("Save") + (ctrl_S.toString()));
save.setPosition(0);
ActionToolbarMenuDescriptor<Object> close = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
1
0
Author: vjrj
Date: 2009-03-17 02:18:55 +0100 (Tue, 17 Mar 2009)
New Revision: 1080
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianChar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/AbstractInsertCharPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccChar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharView.java
Modified:
trunk/TODO
trunk/pom.xml
trunk/script/generateBasicUIElements.sh
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java
Log:
Complete - task Insert Table Dialog
Incomplete - task Insert special char dialog
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/TODO 2009-03-17 01:18:55 UTC (rev 1080)
@@ -28,6 +28,7 @@
^<a href="http://example.com">sample</a>^ --- Parse and edit
<a href="http://example.com">s^ample</a> --- Parse and edit
<a href="http://example.com">s^amp^le</a> --- Parse and edit
+ <a href="http://example.com">s^a<em>kk</em>mp^le</a> --- Parse, get contains and edit
^some text <a href="http://example.com">samp^le</a> --- new link with get inner content?
**** Quite urgent: Shortcuts propagation to browser
http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/use…
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/pom.xml 2009-03-17 01:18:55 UTC (rev 1080)
@@ -94,6 +94,13 @@
<artifactId>jmagick</artifactId>
<version>6.2.6-0</version>
</dependency>
+ <!--
+ <dependency>
+ <groupId>com.xpn.xwiki.platform</groupId>
+ <artifactId>xwiki-web-gwt</artifactId>
+ <version>1.9-SNAPSHOT</version>
+ </dependency>
+ -->
<!-- xmpp -->
<dependency>
@@ -244,19 +251,19 @@
<!-- jetty dependencies -->
<dependency>
<groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>6.1.5</version>
- <!-- <version>7.0.0.pre5</version> -->
- <scope>provided</scope>
+ <artifactId>jetty-util</artifactId>
+ <version>6.1.5</version>
+ <!-- <version>7.0.0.pre5</version> -->
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.5</version>
<!--
- <artifactId>jetty-maven-plugin</artifactId>
- <version>7.0.0.pre5</version>
- -->
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>7.0.0.pre5</version>
+ -->
<scope>provided</scope>
</dependency>
@@ -383,25 +390,38 @@
<enabled>false</enabled>
</releases>
</repository>
+ <repository>
+ <id>xwiki</id>
+ <name>XWiki Repository</name>
+ <url>http://maven.xwiki.org/snapshots</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>always</updatePolicy>
+ <checksumPolicy>warn</checksumPolicy>
+ </snapshots>
+ </repository>
</repositories>
<issueManagement>
<system>kune issues list at ourproject.org</system>
<url>http://ourproject.org/tracker/?group_id=407</url>
</issueManagement>
<developers>
- <developer>
- <id>dani</id>
- <name>Daniel Gómez Blasco</name>
- <email>danigb(a)gmail.com</email>
- </developer>
- <developer>
- <name>Samer Hassan</name>
- <email>samer2004(a)gmail.com</email>
- </developer>
- <developer>
- <name>Vicente J. Ruiz Jurado</name>
- <email>vjrj(a)ourproject.org</email>
- </developer>
+ <developer>
+ <id>dani</id>
+ <name>Daniel Gómez Blasco</name>
+ <email>danigb(a)gmail.com</email>
+ </developer>
+ <developer>
+ <name>Samer Hassan</name>
+ <email>samer2004(a)gmail.com</email>
+ </developer>
+ <developer>
+ <name>Vicente J. Ruiz Jurado</name>
+ <email>vjrj(a)ourproject.org</email>
+ </developer>
</developers>
<scm>
<url>svn://scm.ourproject.org/svnroot/kune/trunk</url>
@@ -422,11 +442,11 @@
<configuration>
<source>1.5</source>
<target>1.5</target>
- <!-- Uncomment and run mvn with -X -e if we have same compile problems
- <compilerArgument>-verbose</compilerArgument>
- <fork>true</fork>
- <verbose>true</verbose>
- -->
+ <!--
+ Uncomment and run mvn with -X -e if we have same compile
+ problems <compilerArgument>-verbose</compilerArgument>
+ <fork>true</fork> <verbose>true</verbose>
+ -->
</configuration>
</plugin>
<plugin>
@@ -489,8 +509,8 @@
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.5</version>
<!--
- <artifactId>jetty-maven-plugin</artifactId>
- <version>7.0.0.pre5</version>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>7.0.0.pre5</version>
-->
<configuration>
<contextPath>/</contextPath>
@@ -498,26 +518,17 @@
<scanIntervalSeconds>0</scanIntervalSeconds>
</configuration>
</plugin>
- <!--
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
+ <!--
+ <plugin> <groupId>org.codehaus.mojo</groupId>
<artifactId>deb-maven-plugin</artifactId>
- <version>1.0-SNAPSHOT</version>
- <configuration>
- <description>kune free/open/libre collaboration platform</description>
- <maintainer>Kune Development Team <kune-devel(a)lists.ourproject.org></maintainer>
- <section>web</section>
- <priority>optional</priority>
- <architecture>all</architecture>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>deb</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <version>1.0-SNAPSHOT</version> <configuration>
+ <description>kune free/open/libre collaboration
+ platform</description> <maintainer>Kune Development Team
+ <kune-devel(a)lists.ourproject.org></maintainer>
+ <section>web</section> <priority>optional</priority>
+ <architecture>all</architecture> </configuration> <executions>
+ <execution> <goals> <goal>deb</goal> </goals> </execution>
+ </executions> </plugin>
-->
<plugin>
<groupId>org.liquibase</groupId>
@@ -538,8 +549,8 @@
</configuration>
<!--
<configuration> <verbose>true</verbose> <propertiesFile>
- src/main/resources/db/liquibase.properties </propertiesFile>
- </configuration>
+ src/main/resources/db/liquibase.properties
+ </propertiesFile> </configuration>
-->
<goals>
<goal>update</goal>
@@ -632,8 +643,8 @@
<configuration>
<forkMode>pertest</forkMode>
<!--
- Skip the normal tests, we'll run them in the integration-test
- phase
+ Skip the normal tests, we'll run them in the
+ integration-test phase
-->
<skip>true</skip>
</configuration>
Modified: trunk/script/generateBasicUIElements.sh
===================================================================
--- trunk/script/generateBasicUIElements.sh 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/script/generateBasicUIElements.sh 2009-03-17 01:18:55 UTC (rev 1080)
@@ -14,7 +14,7 @@
fi
# DO
-PACKAGE=`echo $DIR | cut -d "/" -f 4- | sed 's/\//\./g' | sed 's/.$//g'`
+PACKAGE=`echo $DIR | cut -d "/" -f 4- | sed 's/\//\./g' | sed 's/\.$//g'
if [[ ! -d $DIR ]]
then
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-17 01:18:55 UTC (rev 1080)
@@ -35,10 +35,10 @@
}
*/.kune-NavigationBar .topBar .gwt-Image{margin:0 2px 0 5px;}.kune-NavigationBar .Items{margin:2px 0;}.kune-NavigationBar .Items .gwt-Image{margin:2px 0;vertical-align:middle;}.kune-NavigationBar .Items .gwt-Hyperlink a{color:green;/* FIXME: other color */}.kune-NavigationBar .topBar .topBar-margin{margin-left:5px;}.kune-NavigationBar .pathMenu{vertical-align:middle;}.kune-NavigationBar .pathMenu .gwt-MenuItem{background:transparent url(img/button-bg-hard.gif) repeat-x 0 0;border-left:1px solid #AAA;border-right:1px solid #AAA;color:#999;cursor:pointer;white-space:nowrap;padding:3px 6px;}.kune-NavigationBar .pathMenu .gwt-MenuItem-selected{background:transparent url(img/button-bg-soft.gif) repeat-x 0 0;color:#000;}.kune-NavigationBar .kune-IconHyperlink{vertical-align:middle;margin-left:5px;}.kune-NavigationBar .kune-IconHyperlink a{color:green;text-decoration:none;}.kune-NavigationBar .kune-IconHyperlink .gwt-Image{margin-right:3px;vertical-align:middle;}/* Social Network */.kune-StackedDropDownPanel{}.kune-StackedDropDownPanel .gwt-StackPanelItem{border-top:1px solid #CCC;border-bottom:1px solid #CCC;background-color:#EFA;cursor:pointer;padding:1px 3px 0 6px;overflow:hidden;}.kune-StackedDropDownPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-StackedDropDownPanel .kune-DropDownInner table{width:100%;}.kune-StackedDropDownPanel .gwt-StackPanelItem-selected{}.kune-StackedDropDownPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-StackedDropDownPanel .kune-DropDownInner{padding:0;}/* StackedDropDownPanel Members */.kune-StackSubItemLabel{overflow:hidden;}.kune-StackSubItemLabel .gwt-MenuItem{white-space:nowrap;cursor:pointer;border-bottom:1px solid #F2F2F2;}.kune-StackSubItemLabel table{width:100%;}.kune-StackSubItemLabel .gwt-MenuItem img{vertical-align:middle;margin-top:1px;margin-bottom:1px;margin-left:5px;margin-right:3px;}.kune-StackSubItemLabel .gwt-MenuItem-selected{background-color:#FFE6D5;}.kune-StackSubItemActions{background-color:#F2F2F2;border:1px solid #999;vertical-align:middle;padding:5px 0;margin-left:-120px;margin-top:-2px;}.kune-StackSubItemActions .gwt-MenuItem{cursor:pointer;padding:1px 10px;white-space:nowrap;}.kune-StackSubItemActions .gwt-MenuItem img{vertical-align:middle;margin-right:3px;}.kune-StackSubItemActions .gwt-MenuItem-selected{background-color:#FFB958;}/* AccessList */.kune-AccessListSubLabel{font-style:italic;}.kune-AccessList{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel-open{width:100%;}.kune-AccessList .gwt-DisclosurePanel-closed{width:100%;}.kune-AccessList .header{margin:0 0 3px;text-decoration:none;width:100%;background-color:#8DD35F;}.kune-AccessList .header table{margin:0 5px 0 0;width:100%;color:#FFF;}.kune-AccessList .header img{margin:0 3px 0 0;}.kune-AccessList .content{margin:0 0 0 7px;width:100%;}.kune-AccessList .content table{margin-bottom:5px;width:100%;}/* Rate */.kune-RatePanel-Label{white-space:nowrap;vertical-align:middle;}.kune-RatePanel-Stars{margin-left:5px;vertical-align:middle;}.kune-RatePanel-Stars-RateIt{cursor:pointer;}/* Licenses */.kune-License-CC-Header{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}.kune-License-CC-Header .gwt-Label{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}/* Theme */.kune-IconBottomPanel .gwt-MenuItem{cursor:pointer;background-color:#FFF;margin:2px 2px 2px 5px;}.kune-IconBottomPanel .gwt-MenuItem-selected{background-color:#F2F2F2;}.gwt-MenuBar-bottomMenu{margin-left:-60px;margin-top:-120px;}/* i18n */.kune-I18nTranslatorCell{white-space:normal;}.kune-i18nTranslator-recommend{margin:10px;}.kune-i18nTranslator-recommend h1{font-size:131%;font-weight:700;}.kune-i18nTranslator-recommend h2{font-size:116%;font-weight:700;}.kune-i18nTranslator-recommend h3{font-size:108%;font-weight:700;font-style:italic;}.kune-i18nTranslator-recommend em{font-weight:700;}.kune-i18nTranslator-recommend strong{font-weight:700;}/* Admin Context */.kune-AdminContextPanel{margin:6px;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem{background:transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;cursor:pointer;padding:3px 10px 1px 20px;overflow:hidden;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-AdminContextPanel .gwt-StackPanelItem-selected{background:transparent url(img/arrow-down-white.gif) no-repeat scroll 3px 2px;background-color:#DEE3DB;}.kune-AdminContextPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-AdminContextPanel-inner{background-color:#FFF;}.kune-AdminContextPanel-inner-wrap{margin:5px;}.kune-EditableLabel{}.kune-EditableLabel .kune-EditableLabel-editable{}.kune-EditableLabel-high{background-color:#FFFBC1;cursor:pointer;}.kune-EditableLabel-high span{background-color:#FFFBC1;}.kune-EditableLabel a{margin-left:5px;}.kune-EditableLabel a:link{color:green;}.kune-EditableLabel a:hover{text-decoration:underline;}.kune-EditableLabel a:visited{color:olive;}.kune-EditableLabel img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable span{margin:3px;}.kune-EditableLabel span{margin:3px;}.kune-BottomIconsTrayPanel{width:165px;height:21px;vertical-align:middle;background-color:#EFEFEF;}.kune-Content-Main{margin:5px;}/* Yahoo ui base.css */.kune-Content-Main h1{font-size:138.5%;}.kune-Content-Main h2{font-size:123.099998%;}.kune-Content-Main h3{font-size:108%;}.kune-Content-Main h1{margin:1em 0;}.kune-Content-Main h2{margin:1em 0;}.kune-Content-Main h3{margin:1em 0;}.kune-Content-Main h1{font-weight:700;}.kune-Content-Main h2{font-weight:700;}.kune-Content-Main h3{font-weight:700;}.kune-Content-Main h4{font-weight:700;}.kune-Content-Main h5{font-weight:700;}.kune-Content-Main h6{font-weight:700;}.kune-Content-Main strong{font-weight:700;}.kune-Content-Main abbr{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main acronym{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main em{font-style:italic;}.kune-Content-Main blockquote{margin:1em;}.kune-Content-Main ul{margin:1em;}.kune-Content-Main ol{margin:1em;}.kune-Content-Main dl{margin:1em;}.kune-Content-Main ol{margin-left:2em;}.kune-Content-Main ul{margin-left:2em;}.kune-Content-Main dl{margin-left:2em;}.kune-Content-Main ol{list-style:decimal outside;}.kune-Content-Main li{list-style:decimal outside;}.kune-Content-Main li{list-style:disc outside;}.kune-Content-Main ul{list-style:disc outside;}.kune-Content-Main dl{margin-left:1em;}.kune-Content-Main dd{margin-left:1em;}.kune-Content-Main th{border:1px solid #000;padding:.5em;font-weight:700;text-align:center;}.kune-Content-Main td{border:1px solid #000;padding:.5em;}.kune-Content-Main caption{margin-bottom:.5em;text-align:center;}.kune-Content-Main p{margin-bottom:1em;}.kune-Content-Main fieldset{margin-bottom:1em;}.kune-Content-Main table{margin-bottom:1em;}.kune-Content-Main pre{margin-bottom:1em;}.kune-Content-Main input[type=text]{width:12.25em;width:11.9em;}.kune-Content-Main input[type=password]{width:12.25em;width:11.9em;}.kune-Content-Main textarea{width:12.25em;width:11.9em;}.search-icon{background-image:url(img/search.gif)!important;}.i18n-icon{background-image:url(img/language.gif)!important;}/* RTE Text editor */.kune-TexEditorPanel-TextArea{margin:3px;}.gwt-RichTextArea{/* border: 1px solid #000;
background-color: #FFF; */border:1px solid #4D4D4D;background-color:#FFF;margin:5px 0 5px 10px;}.gwt-RichTextToolbar{/* background-color: #F2F2F2;
- padding: 5px; */height:24px;vertical-align:middle;}.gwt-RichTextToolbar table{vertical-align:middle;}.gwt-RichTextToolbar .gwt-ToggleButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-PushButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-PushButton-down{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-PushButton-down-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-ToggleButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-ToggleButton-down{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-down-hovering{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .x-btn{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lSpace{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lrSpace{float:left;}.RichTextToolbar-menu{float:left;margin-top:2px;z-index:4;}.RichTextToolbar-menu table{border-collapse:collapse;border-spacing:0;margin:0;z-index:4;}.RichTextToolbar-menu .gwt-MenuItem{margin-right:2px;border:1px solid #F2F2F2;}.RichTextToolbar-menu .gwt-MenuItem-selected{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.RichTextToolbar-submenu{background-color:#FFFCD5;border:1px solid #D38D5F;cursor:default;z-index:4;}.RichTextToolbar-submenu .gwt-MenuItem{cursor:default;white-space:nowrap;border:1px solid #FFFCD5;padding:0 4px;}.RichTextToolbar-submenu .gwt-MenuItem-selected{background-color:#FFB958;border:1px solid #C83737;}.kune-WebSafePalette{background-color:#FFF;border:1px solid #AAA;margin:1px;}.kune-WebSafePalette-popup{z-index:9999!important;background-color:#FFF;}.kune-WebSafePalette td{width:12px;height:10px;}.k-site-traybar{background:#FFF none repeat scroll 0 50%;}.k-blank-toolbar{background:#FFF none repeat scroll 0 50%;}.k-sitebar .kune-IconHyperlink{white-space:nowrap;}.k-sitebar .kune-IconHyperlink a:link{cursor:pointer;text-decoration:underline;color:#B3B3B3;}.k-sitebar .kune-IconHyperlink a:hover{text-decoration:underline;}.k-sitebar .kune-IconHyperlink a:visited{color:#B3B3B3;}.k-sitebar-labellink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-sitebar{margin-right:10px;height:16px;background:#FFF;}.k-sitebar .gwt-TextBox{border:1px solid #E4A374;margin:0 15px 0 3px;padding-left:1px;color:#B3B3B3;}.k-sitebar .gwt-Hyperlink a{white-space:nowrap;color:#B3B3B3;text-decoration:underline;cursor:pointer;}.k-sitebar .gwt-PushButton{cursor:pointer;}.k-sitebar-LabelLink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-entity-summary{border-left-color:#FFF;border-left-width:5px;border-bottom-color:#FFF;border-bottom-width:5px;}.k-entitytextlogo-border{border:2px solid #F2F2F2;}.k-entitytextlogo-no-border{border:none;}.k-entitytextlogo{height:60px;margin:0 0 4px;overflow:hidden;width:468px;}.k-entitytextlogo table{vertical-align:middle;}.k-elogo-l-l{font-size:272%;}.k-elogo-l-m{font-size:167%;}.k-elogo-l-s{font-size:108%;}.k-entitytextlogo .gwt-Label{font-weight:700;margin:5px;height:27px;}.k-entitytextlogo-default .gwt-Label{color:#69312F;}.k-entitytextlogo-green .gwt-Label{color:#250;}.k-entitytextlogo-blue .gwt-Label{color:navy;}.k-entitytextlogo-grey .gwt-Label{color:#1A1A1A;}.k-entitytextlogo-purple .gwt-Label{color:#405;}.k-entitytextlogo-red .gwt-Label{color:maroon;}.k-elogo-plink{color:#CCC;font-size:85%;margin:5px;text-decoration:underline;white-space:nowrap;background-color:#FFF;}.k-elogop-expand{background-color:transparent;}.k-entity-default .x-layout-split,.k-entity-default .x-layout-collapsed{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-green .x-layout-split,.k-entity-green .x-layout-collapsed{background:#5FD35F none repeat scroll 0 50%;}.k-entity-blue .x-layout-split,.k-entity-blue .x-layout-collapsed{background:#06F none repeat scroll 0 50%;}.k-entity-grey .x-layout-split,.k-entity-grey .x-layout-collapsed{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-purple .x-layout-split,.k-entity-purple .x-layout-collapsed{background:#660080 none repeat scroll 0 50%;}.k-entity-red .x-layout-split,.k-entity-red .x-layout-collapsed{background:#D40000 none repeat scroll 0 50%;}.k-entityworkspace .x-layout-split,.k-entityworkspace .x-layout-collapsed{background:transparent none repeat scroll 0 50%;}.k-entityworkspace-default .x-layout-split,.k-entityworkspace-default .x-layout-collapsed{background:#DEAA87 none repeat scroll 0 50%;}.k-entityworkspace-green .x-layout-split,.k-entityworkspace-green .x-layout-collapsed{background:#DCE8AB none repeat scroll 0 50%;}.k-entityworkspace-blue .x-layout-split,.k-entityworkspace-blue .x-layout-collapsed{background:#D5D5FF none repeat scroll 0 50%;}.k-entityworkspace-grey .x-layout-split,.k-entityworkspace-grey .x-layout-collapsed{background:#999 none repeat scroll 0 50%;}.k-entityworkspace-purple .x-layout-split,.k-entityworkspace-purple .x-layout-collapsed{background:#A793AC none repeat scroll 0 50%;}.k-entityworkspace-red .x-layout-split,.k-entityworkspace-red .x-layout-collapsed{background:#F55 none repeat scroll 0 50%;}.k-entity-title{border-left-style:solid;border-left-width:2px;}.k-entity-title div{line-height:22px;white-space:nowrap;}.k-entity-subtitle{}.k-entity-subtitle div{line-height:22px;white-space:nowrap;}.k-entity-title-rd-default{background:#DD8A3D;}.k-entity-title-rd-green{background:#5FD35F;}.k-entity-title-rd-blue{background:#06F;}.k-entity-title-rd-grey{background:#4D4D4D;}.k-entity-title-rd-purple{background:#660080;}.k-entity-title-rd-red{background:#D40000;}.k-entity-title-default{background:#F1BB59 none repeat scroll 0 50%;border-left-color:#DD8A3D;}.k-entity-title-green{background:#AFA none repeat scroll 0 50%;border-left-color:#5FD35F;}.k-entity-title-blue{background:#AFDDE9 none repeat scroll 0 50%;border-left-color:#06F;}.k-entity-title-grey{background:#CCC none repeat scroll 0 50%;border-left-color:#4D4D4D;}.k-entity-title-purple{background:#DDAFE9 none repeat scroll 0 50%;border-left-color:#660080;}.k-entity-title-red{background:#FF8080 none repeat scroll 0 50%;border-left-color:#D40000;}.k-entity-title-default div{color:#69312F;}.k-entity-title-green div{color:#250;}.k-entity-title-blue div{color:navy;}.k-entity-title-grey div{color:#1A1A1A;}.k-entity-title-purple div{color:#405;}.k-entity-title-red div{color:maroon;}.k-entity-subtitle-default{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-subtitle-green{background:#5FD35F none repeat scroll 0 50%;}.k-entity-subtitle-blue{background:#06F none repeat scroll 0 50%;}.k-entity-subtitle-grey{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-subtitle-purple{background:#660080 none repeat scroll 0 50%;}.k-entity-subtitle-red{background:#D40000 none repeat scroll 0 50%;}.k-entity-subtitle-default div{color:#FFF;}.k-entity-subtitle-green div{color:#FFF;}.k-entity-subtitle-blue div{color:#FFF;}.k-entity-subtitle-grey div{color:#FFF;}.k-entity-subtitle-purple div{color:#FFF;}.k-entity-subtitle-red div{color:#FFF;}.k-entity-bottom-rd-default,.k-entity-bottom-default,.k-toolselectoritem-sel-default{background:#DD8A3D;}.k-entity-bottom-rd-green,.k-entity-bottom-green,.k-toolselectoritem-sel-green{background:#5FD35F;}.k-entity-bottom-rd-blue,.k-entity-bottom-blue,.k-toolselectoritem-sel-blue{background:#06F;}.k-entity-bottom-rd-grey,.k-entity-bottom-grey,.k-toolselectoritem-sel-grey{background:#4D4D4D;}.k-entity-bottom-rd-purple,.k-entity-bottom-purple,.k-toolselectoritem-sel-purple{background:#660080;}.k-entity-bottom-rd-red,.k-entity-bottom-red,.k-toolselectoritem-sel-red{background:#D40000;}.k-entity-context-default div,.k-entity-context-default .x-tree .x-panel-body{background:#FFD09D none repeat scroll 0 50%;}.k-entity-context-green div,.k-entity-context-green .x-tree .x-panel-body{background:#CFA none repeat scroll 0 50%;}.k-entity-context-blue div,.k-entity-context-blue .x-tree .x-panel-body{background:#ACF none repeat scroll 0 50%;}.k-entity-context-grey div,.k-entity-context-grey .x-tree .x-panel-body{background:#B3B3B3 none repeat scroll 0 50%;}.k-entity-context-purple div,.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-context-red div,.k-entity-context-red .x-tree .x-panel-body{background:#FAA none repeat scroll 0 50%;}.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-bottom div{/* line-height: 24px; */color:#FFF;}.k-toolbar-top-line{border-top-color:#d0d0d0;border-top-style:solid;border-top-width:1px;}.k-toolbar-bottom-line{border-bottom-color:#d0d0d0;border-bottom-style:solid;border-bottom-width:1px;}.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{white-space:nowrap;font:normal 100% arial, sans;line-height:19px;}.k-toolbar-sep{padding-top:4px;padding-left:5px;}/* Custom gwt-ext styles */.ytb-sep{background-image:url(../js/ext/resources/images/default/grid/grid-split.gif);background-position:center;background-repeat:no-repeat;display:block;font-size:1px;height:16px;width:4px;overflow:hidden;cursor:default;margin:0 2px;border:0;}.ytb-spacer{width:2px;}.x-grid-group-hd{border-bottom:2px solid grey;cursor:pointer;padding-top:3px;}/* Drop down */.k-dropdownouter{background-color:grey;}.k-dropdownouter-members{}.k-dropdownouter-members-default{background-color:#DF5244;}.k-dropdownouter-members-green{background-color:green;}.k-dropdownouter-members-blue{background-color:#5500D4;}.k-dropdownouter-members-grey{background-color:#4D4D4D;}.k-dropdownouter-members-purple{background-color:#672178;}.k-dropdownouter-members-red{background-color:#A02C2C;}.k-dropdownouter-part{}.k-dropdownouter-part-default{background-color:#CA5842;}.k-dropdownouter-part-green{background-color:#0A0;}.k-dropdownouter-part-blue{background-color:#60F;}.k-dropdownouter-part-grey{background-color:#666;}.k-dropdownouter-part-purple{background-color:#892CA0;}.k-dropdownouter-part-red{background-color:#C83737;}.k-dropdownouter-tags{}.k-dropdownouter-tags-default{background-color:#87501E;}.k-dropdownouter-tags-green{background-color:#00D400;}.k-dropdownouter-tags-blue{background-color:#95F;}.k-dropdownouter-tags-grey{background-color:gray;}.k-dropdownouter-tags-purple{background-color:#AB37C8;}.k-dropdownouter-tags-red{background-color:#D35F5F;}.k-dropdownouter-summary{}.k-dropdownouter-summary-default{background-color:#9F734B;}.k-dropdownouter-summary-green{background-color:#4CE14C;}.k-dropdownouter-summary-blue{background-color:#69A5FF;}.k-dropdownouter-summary-grey{background-color:#A6A6A6;}.k-dropdownouter-summary-purple{background-color:#C473D8;}.k-dropdownouter-summary-red{background-color:#E08F8F;}.k-dropdowninner{margin:0 3px 1px;background:green;background-color:#FFF;/* padding: 3px; */}.k-dropdownlabel{color:#FFF;cursor:pointer;}.k-dropdownlabel .gwt-Label{margin:0 5px 0 0;width:100%;}.k-dropdownlabel img{margin:0 3px 0 1px;}/* WsTheme */.k-wstheme-icon-default{background:#FF8C00;}.k-wstheme-icon-green{background:green;}.k-wstheme-icon-blue{background:blue;}.k-wstheme-icon-grey{background:grey;}.k-wstheme-icon-purple{background:purple;}.k-wstheme-icon-red{background:red;}/* Tool selector items */.k-toolselectoritem{width:auto;margin-bottom:5px;cursor:pointer;}.k-toolselectoritem-sel{}.k-toolselectoritem-notsel-default{background:#FFE9A5;}.k-toolselectoritem-notsel-green{background:#D6F4D6;}.k-toolselectoritem-notsel-blue{background:#D7D7F4;}.k-toolselectoritem-notsel-grey{background:#E6E6E6;}.k-toolselectoritem-notsel-purple{background:#EED7F4;}.k-toolselectoritem-notsel-red{background:#FFD5D5;}.k-toolselectoritem-sel a{color:#FFF;padding:0 9px;text-decoration:none;}.k-toolselectoritem-sel a:hover{text-decoration:none;}.k-toolselectoritem-notsel{}.k-toolselectoritem-notsel a{color:#00F;padding:0 9px;text-decoration:none;}.k-toolselectoritem-notsel a:hover{text-decoration:underline;}/* others *//*
+ padding: 5px; */height:24px;vertical-align:middle;}.gwt-RichTextToolbar table{vertical-align:middle;}.gwt-RichTextToolbar .gwt-ToggleButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-PushButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-PushButton-down{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-PushButton-down-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-ToggleButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-ToggleButton-down{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-down-hovering{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .x-btn{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lSpace{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lrSpace{float:left;}.RichTextToolbar-menu{float:left;margin-top:2px;z-index:4;}.RichTextToolbar-menu table{border-collapse:collapse;border-spacing:0;margin:0;z-index:4;}.RichTextToolbar-menu .gwt-MenuItem{margin-right:2px;border:1px solid #F2F2F2;}.RichTextToolbar-menu .gwt-MenuItem-selected{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.RichTextToolbar-submenu{background-color:#FFFCD5;border:1px solid #D38D5F;cursor:default;z-index:4;}.RichTextToolbar-submenu .gwt-MenuItem{cursor:default;white-space:nowrap;border:1px solid #FFFCD5;padding:0 4px;}.RichTextToolbar-submenu .gwt-MenuItem-selected{background-color:#FFB958;border:1px solid #C83737;}.kune-WebSafePalette{background-color:#FFF;border:1px solid #AAA;margin:1px;}.kune-WebSafePalette-popup{z-index:9999!important;background-color:#FFF;border:1px solid gray;}.kune-WebSafePalette td{width:12px;height:10px;}.k-site-traybar{background:#FFF none repeat scroll 0 50%;}.k-blank-toolbar{background:#FFF none repeat scroll 0 50%;}.k-sitebar .kune-IconHyperlink{white-space:nowrap;}.k-sitebar .kune-IconHyperlink a:link{cursor:pointer;text-decoration:underline;color:#B3B3B3;}.k-sitebar .kune-IconHyperlink a:hover{text-decoration:underline;}.k-sitebar .kune-IconHyperlink a:visited{color:#B3B3B3;}.k-sitebar-labellink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-sitebar{margin-right:10px;height:16px;background:#FFF;}.k-sitebar .gwt-TextBox{border:1px solid #E4A374;margin:0 15px 0 3px;padding-left:1px;color:#B3B3B3;}.k-sitebar .gwt-Hyperlink a{white-space:nowrap;color:#B3B3B3;text-decoration:underline;cursor:pointer;}.k-sitebar .gwt-PushButton{cursor:pointer;}.k-sitebar-LabelLink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-entity-summary{border-left-color:#FFF;border-left-width:5px;border-bottom-color:#FFF;border-bottom-width:5px;}.k-entitytextlogo-border{border:2px solid #F2F2F2;}.k-entitytextlogo-no-border{border:none;}.k-entitytextlogo{height:60px;margin:0 0 4px;overflow:hidden;width:468px;}.k-entitytextlogo table{vertical-align:middle;}.k-elogo-l-l{font-size:272%;}.k-elogo-l-m{font-size:167%;}.k-elogo-l-s{font-size:108%;}.k-entitytextlogo .gwt-Label{font-weight:700;margin:5px;height:27px;}.k-entitytextlogo-default .gwt-Label{color:#69312F;}.k-entitytextlogo-green .gwt-Label{color:#250;}.k-entitytextlogo-blue .gwt-Label{color:navy;}.k-entitytextlogo-grey .gwt-Label{color:#1A1A1A;}.k-entitytextlogo-purple .gwt-Label{color:#405;}.k-entitytextlogo-red .gwt-Label{color:maroon;}.k-elogo-plink{color:#CCC;font-size:85%;margin:5px;text-decoration:underline;white-space:nowrap;background-color:#FFF;}.k-elogop-expand{background-color:transparent;}.k-entity-default .x-layout-split,.k-entity-default .x-layout-collapsed{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-green .x-layout-split,.k-entity-green .x-layout-collapsed{background:#5FD35F none repeat scroll 0 50%;}.k-entity-blue .x-layout-split,.k-entity-blue .x-layout-collapsed{background:#06F none repeat scroll 0 50%;}.k-entity-grey .x-layout-split,.k-entity-grey .x-layout-collapsed{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-purple .x-layout-split,.k-entity-purple .x-layout-collapsed{background:#660080 none repeat scroll 0 50%;}.k-entity-red .x-layout-split,.k-entity-red .x-layout-collapsed{background:#D40000 none repeat scroll 0 50%;}.k-entityworkspace .x-layout-split,.k-entityworkspace .x-layout-collapsed{background:transparent none repeat scroll 0 50%;}.k-entityworkspace-default .x-layout-split,.k-entityworkspace-default .x-layout-collapsed{background:#DEAA87 none repeat scroll 0 50%;}.k-entityworkspace-green .x-layout-split,.k-entityworkspace-green .x-layout-collapsed{background:#DCE8AB none repeat scroll 0 50%;}.k-entityworkspace-blue .x-layout-split,.k-entityworkspace-blue .x-layout-collapsed{background:#D5D5FF none repeat scroll 0 50%;}.k-entityworkspace-grey .x-layout-split,.k-entityworkspace-grey .x-layout-collapsed{background:#999 none repeat scroll 0 50%;}.k-entityworkspace-purple .x-layout-split,.k-entityworkspace-purple .x-layout-collapsed{background:#A793AC none repeat scroll 0 50%;}.k-entityworkspace-red .x-layout-split,.k-entityworkspace-red .x-layout-collapsed{background:#F55 none repeat scroll 0 50%;}.k-entity-title{border-left-style:solid;border-left-width:2px;}.k-entity-title div{line-height:22px;white-space:nowrap;}.k-entity-subtitle{}.k-entity-subtitle div{line-height:22px;white-space:nowrap;}.k-entity-title-rd-default{background:#DD8A3D;}.k-entity-title-rd-green{background:#5FD35F;}.k-entity-title-rd-blue{background:#06F;}.k-entity-title-rd-grey{background:#4D4D4D;}.k-entity-title-rd-purple{background:#660080;}.k-entity-title-rd-red{background:#D40000;}.k-entity-title-default{background:#F1BB59 none repeat scroll 0 50%;border-left-color:#DD8A3D;}.k-entity-title-green{background:#AFA none repeat scroll 0 50%;border-left-color:#5FD35F;}.k-entity-title-blue{background:#AFDDE9 none repeat scroll 0 50%;border-left-color:#06F;}.k-entity-title-grey{background:#CCC none repeat scroll 0 50%;border-left-color:#4D4D4D;}.k-entity-title-purple{background:#DDAFE9 none repeat scroll 0 50%;border-left-color:#660080;}.k-entity-title-red{background:#FF8080 none repeat scroll 0 50%;border-left-color:#D40000;}.k-entity-title-default div{color:#69312F;}.k-entity-title-green div{color:#250;}.k-entity-title-blue div{color:navy;}.k-entity-title-grey div{color:#1A1A1A;}.k-entity-title-purple div{color:#405;}.k-entity-title-red div{color:maroon;}.k-entity-subtitle-default{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-subtitle-green{background:#5FD35F none repeat scroll 0 50%;}.k-entity-subtitle-blue{background:#06F none repeat scroll 0 50%;}.k-entity-subtitle-grey{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-subtitle-purple{background:#660080 none repeat scroll 0 50%;}.k-entity-subtitle-red{background:#D40000 none repeat scroll 0 50%;}.k-entity-subtitle-default div{color:#FFF;}.k-entity-subtitle-green div{color:#FFF;}.k-entity-subtitle-blue div{color:#FFF;}.k-entity-subtitle-grey div{color:#FFF;}.k-entity-subtitle-purple div{color:#FFF;}.k-entity-subtitle-red div{color:#FFF;}.k-entity-bottom-rd-default,.k-entity-bottom-default,.k-toolselectoritem-sel-default{background:#DD8A3D;}.k-entity-bottom-rd-green,.k-entity-bottom-green,.k-toolselectoritem-sel-green{background:#5FD35F;}.k-entity-bottom-rd-blue,.k-entity-bottom-blue,.k-toolselectoritem-sel-blue{background:#06F;}.k-entity-bottom-rd-grey,.k-entity-bottom-grey,.k-toolselectoritem-sel-grey{background:#4D4D4D;}.k-entity-bottom-rd-purple,.k-entity-bottom-purple,.k-toolselectoritem-sel-purple{background:#660080;}.k-entity-bottom-rd-red,.k-entity-bottom-red,.k-toolselectoritem-sel-red{background:#D40000;}.k-entity-context-default div,.k-entity-context-default .x-tree .x-panel-body{background:#FFD09D none repeat scroll 0 50%;}.k-entity-context-green div,.k-entity-context-green .x-tree .x-panel-body{background:#CFA none repeat scroll 0 50%;}.k-entity-context-blue div,.k-entity-context-blue .x-tree .x-panel-body{background:#ACF none repeat scroll 0 50%;}.k-entity-context-grey div,.k-entity-context-grey .x-tree .x-panel-body{background:#B3B3B3 none repeat scroll 0 50%;}.k-entity-context-purple div,.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-context-red div,.k-entity-context-red .x-tree .x-panel-body{background:#FAA none repeat scroll 0 50%;}.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-bottom div{/* line-height: 24px; */color:#FFF;}.k-toolbar-top-line{border-top-color:#d0d0d0;border-top-style:solid;border-top-width:1px;}.k-toolbar-bottom-line{border-bottom-color:#d0d0d0;border-bottom-style:solid;border-bottom-width:1px;}.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{white-space:nowrap;font:normal 100% arial, sans;line-height:19px;}.k-toolbar-sep{padding-top:4px;padding-left:5px;}/* Custom gwt-ext styles */.ytb-sep{background-image:url(../js/ext/resources/images/default/grid/grid-split.gif);background-position:center;background-repeat:no-repeat;display:block;font-size:1px;height:16px;width:4px;overflow:hidden;cursor:default;margin:0 2px;border:0;}.ytb-spacer{width:2px;}.x-grid-group-hd{border-bottom:2px solid grey;cursor:pointer;padding-top:3px;}/* Drop down */.k-dropdownouter{background-color:grey;}.k-dropdownouter-members{}.k-dropdownouter-members-default{background-color:#DF5244;}.k-dropdownouter-members-green{background-color:green;}.k-dropdownouter-members-blue{background-color:#5500D4;}.k-dropdownouter-members-grey{background-color:#4D4D4D;}.k-dropdownouter-members-purple{background-color:#672178;}.k-dropdownouter-members-red{background-color:#A02C2C;}.k-dropdownouter-part{}.k-dropdownouter-part-default{background-color:#CA5842;}.k-dropdownouter-part-green{background-color:#0A0;}.k-dropdownouter-part-blue{background-color:#60F;}.k-dropdownouter-part-grey{background-color:#666;}.k-dropdownouter-part-purple{background-color:#892CA0;}.k-dropdownouter-part-red{background-color:#C83737;}.k-dropdownouter-tags{}.k-dropdownouter-tags-default{background-color:#87501E;}.k-dropdownouter-tags-green{background-color:#00D400;}.k-dropdownouter-tags-blue{background-color:#95F;}.k-dropdownouter-tags-grey{background-color:gray;}.k-dropdownouter-tags-purple{background-color:#AB37C8;}.k-dropdownouter-tags-red{background-color:#D35F5F;}.k-dropdownouter-summary{}.k-dropdownouter-summary-default{background-color:#9F734B;}.k-dropdownouter-summary-green{background-color:#4CE14C;}.k-dropdownouter-summary-blue{background-color:#69A5FF;}.k-dropdownouter-summary-grey{background-color:#A6A6A6;}.k-dropdownouter-summary-purple{background-color:#C473D8;}.k-dropdownouter-summary-red{background-color:#E08F8F;}.k-dropdowninner{margin:0 3px 1px;background:green;background-color:#FFF;/* padding: 3px; */}.k-dropdownlabel{color:#FFF;cursor:pointer;}.k-dropdownlabel .gwt-Label{margin:0 5px 0 0;width:100%;}.k-dropdownlabel img{margin:0 3px 0 1px;}/* WsTheme */.k-wstheme-icon-default{background:#FF8C00;}.k-wstheme-icon-green{background:green;}.k-wstheme-icon-blue{background:blue;}.k-wstheme-icon-grey{background:grey;}.k-wstheme-icon-purple{background:purple;}.k-wstheme-icon-red{background:red;}/* Tool selector items */.k-toolselectoritem{width:auto;margin-bottom:5px;cursor:pointer;}.k-toolselectoritem-sel{}.k-toolselectoritem-notsel-default{background:#FFE9A5;}.k-toolselectoritem-notsel-green{background:#D6F4D6;}.k-toolselectoritem-notsel-blue{background:#D7D7F4;}.k-toolselectoritem-notsel-grey{background:#E6E6E6;}.k-toolselectoritem-notsel-purple{background:#EED7F4;}.k-toolselectoritem-notsel-red{background:#FFD5D5;}.k-toolselectoritem-sel a{color:#FFF;padding:0 9px;text-decoration:none;}.k-toolselectoritem-sel a:hover{text-decoration:none;}.k-toolselectoritem-notsel{}.k-toolselectoritem-notsel a{color:#00F;padding:0 9px;text-decoration:none;}.k-toolselectoritem-notsel a:hover{text-decoration:underline;}/* others *//*
.x-tree-node a span, .x-dd-drag-ghost a span {
color:#000000;
padding: 1px 0px 1px 1px;
text-decoration:none;
}
-*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}
\ No newline at end of file
+*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}.k-specialchar-grid{border:1px solid #ACA899;}.k-specialchar-grid table{}.k-specialchar-grid div{line-height:22px;}.k-specialchar-grid td{padding:1px;}.k-specialchar-pb{border:1px solid #EBE8D7;cursor:pointer;font-size:108%!important;text-align:center;vertical-align:middle;width:18px;height:18px;}.k-specialchar-pb-up{}.k-specialchar-pb-down{color:#161616;}.k-specialchar-pb-up-hovering{border:thin solid #ACA899;}.k-specialchar-pb-down-hovering{color:#161616;}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css 2009-03-17 01:18:55 UTC (rev 1080)
@@ -144,6 +144,7 @@
.kune-WebSafePalette-popup {
z-index: 9999 !important;
background-color: #FFF;
+ border: 1px solid gray;
}
.kune-WebSafePalette td {
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-03-17 01:18:55 UTC (rev 1080)
@@ -1,215 +1,216 @@
.k-site-traybar {
- background: #FFF none repeat scroll 0% 50%;
+ background: #FFF none repeat scroll 0% 50%;
}
.k-blank-toolbar {
- background: #FFF none repeat scroll 0% 50%;
+ background: #FFF none repeat scroll 0% 50%;
}
.k-sitebar .kune-IconHyperlink {
- white-space: nowrap;
+ white-space: nowrap;
}
.k-sitebar .kune-IconHyperlink a:link {
- cursor: pointer;
- text-decoration: underline;
- color: #B3B3B3;
+ cursor: pointer;
+ text-decoration: underline;
+ color: #B3B3B3;
}
.k-sitebar .kune-IconHyperlink a:hover {
- text-decoration: underline;
+ text-decoration: underline;
}
.k-sitebar .kune-IconHyperlink a:visited {
- color: #B3B3B3;
+ color: #B3B3B3;
}
.k-sitebar-labellink {
- white-space: nowrap;
- color: #B3B3B3;
- cursor: pointer;
- text-decoration: underline;
+ white-space: nowrap;
+ color: #B3B3B3;
+ cursor: pointer;
+ text-decoration: underline;
}
.k-sitebar {
- margin-right: 10px;
- height: 16px;
- background: #FFF;
+ margin-right: 10px;
+ height: 16px;
+ background: #FFF;
}
.k-sitebar .gwt-TextBox {
- border: 1px solid #E4A374;
- margin: 0 15px 0 3px;
- padding-left: 1px;
- color: #B3B3B3;
+ border: 1px solid #E4A374;
+ margin: 0 15px 0 3px;
+ padding-left: 1px;
+ color: #B3B3B3;
}
.k-sitebar .gwt-Hyperlink a {
- white-space: nowrap;
- color: #B3B3B3;
- text-decoration: underline;
- cursor: pointer;
+ white-space: nowrap;
+ color: #B3B3B3;
+ text-decoration: underline;
+ cursor: pointer;
}
.k-sitebar .gwt-PushButton {
- cursor: pointer;
+ cursor: pointer;
}
.k-sitebar-LabelLink {
- white-space: nowrap;
- color: #B3B3B3;
- cursor: pointer;
- text-decoration: underline;
+ white-space: nowrap;
+ color: #B3B3B3;
+ cursor: pointer;
+ text-decoration: underline;
}
.k-entity-summary {
- border-left-color: #FFF;
- border-left-width: 5px;
- border-bottom-color: #FFF;
- border-bottom-width: 5px;
- }
+ border-left-color: #FFF;
+ border-left-width: 5px;
+ border-bottom-color: #FFF;
+ border-bottom-width: 5px;
+}
.k-entitytextlogo-border {
- border: 2px solid #F2F2F2;
+ border: 2px solid #F2F2F2;
}
.k-entitytextlogo-no-border {
- border: none;
+ border: none;
}
.k-entitytextlogo {
- height: 60px;
- margin: 0 0 4px 0;
- overflow: hidden;
- width: 468px;
+ height: 60px;
+ margin: 0 0 4px 0;
+ overflow: hidden;
+ width: 468px;
}
.k-entitytextlogo table {
- vertical-align: middle;
+ vertical-align: middle;
}
.k-elogo-l-l {
- font-size: 272%;
+ font-size: 272%;
}
.k-elogo-l-m {
- font-size: 167%;
+ font-size: 167%;
}
.k-elogo-l-s {
- font-size: 108%;
+ font-size: 108%;
}
.k-entitytextlogo .gwt-Label {
- font-weight: 700;
- margin: 5px;
- height: 27px;
+ font-weight: 700;
+ margin: 5px;
+ height: 27px;
}
.k-entitytextlogo-default .gwt-Label {
- color: #69312F;
+ color: #69312F;
}
.k-entitytextlogo-green .gwt-Label {
- color: #250;
+ color: #250;
}
.k-entitytextlogo-blue .gwt-Label {
- color: #000080;
+ color: #000080;
}
.k-entitytextlogo-grey .gwt-Label {
- color: #1A1A1A;
+ color: #1A1A1A;
}
.k-entitytextlogo-purple .gwt-Label {
- color: #440055;
+ color: #440055;
}
.k-entitytextlogo-red .gwt-Label {
- color: #800000;
+ color: #800000;
}
.k-elogo-plink {
- color: #CCC;
- font-size: 85%;
- margin: 5px;
- text-decoration: underline;
- white-space: nowrap;
- background-color: #FFF;
+ color: #CCC;
+ font-size: 85%;
+ margin: 5px;
+ text-decoration: underline;
+ white-space: nowrap;
+ background-color: #FFF;
}
.k-elogop-expand {
- background-color: transparent;
+ background-color: transparent;
}
-.k-entity-default .x-layout-split,.k-entity-default .x-layout-collapsed {
- background: #DD8A3D none repeat scroll 0% 50%;
+.k-entity-default .x-layout-split,.k-entity-default .x-layout-collapsed
+ {
+ background: #DD8A3D none repeat scroll 0% 50%;
}
.k-entity-green .x-layout-split,.k-entity-green .x-layout-collapsed {
- background: #5FD35F none repeat scroll 0% 50%;
+ background: #5FD35F none repeat scroll 0% 50%;
}
.k-entity-blue .x-layout-split,.k-entity-blue .x-layout-collapsed {
- background: #0066FF none repeat scroll 0% 50%;
+ background: #0066FF none repeat scroll 0% 50%;
}
.k-entity-grey .x-layout-split,.k-entity-grey .x-layout-collapsed {
- background: #4D4D4D none repeat scroll 0% 50%;
+ background: #4D4D4D none repeat scroll 0% 50%;
}
.k-entity-purple .x-layout-split,.k-entity-purple .x-layout-collapsed {
- background: #660080 none repeat scroll 0% 50%;
+ background: #660080 none repeat scroll 0% 50%;
}
.k-entity-red .x-layout-split,.k-entity-red .x-layout-collapsed {
- background: #D40000 none repeat scroll 0% 50%;
+ background: #D40000 none repeat scroll 0% 50%;
}
.k-entityworkspace .x-layout-split,.k-entityworkspace .x-layout-collapsed
- {
- background: transparent none repeat scroll 0% 50%;
+ {
+ background: transparent none repeat scroll 0% 50%;
}
.k-entityworkspace-default .x-layout-split,.k-entityworkspace-default .x-layout-collapsed
- {
- background: #DEAA87 none repeat scroll 0% 50%;
+ {
+ background: #DEAA87 none repeat scroll 0% 50%;
}
.k-entityworkspace-green .x-layout-split,.k-entityworkspace-green .x-layout-collapsed
- {
- background: #DCE8AB none repeat scroll 0% 50%;
+ {
+ background: #DCE8AB none repeat scroll 0% 50%;
}
.k-entityworkspace-blue .x-layout-split,.k-entityworkspace-blue .x-layout-collapsed
- {
- background: #D5D5FF none repeat scroll 0% 50%;
+ {
+ background: #D5D5FF none repeat scroll 0% 50%;
}
.k-entityworkspace-grey .x-layout-split,.k-entityworkspace-grey .x-layout-collapsed
- {
- background: #999999 none repeat scroll 0% 50%;
+ {
+ background: #999999 none repeat scroll 0% 50%;
}
.k-entityworkspace-purple .x-layout-split,.k-entityworkspace-purple .x-layout-collapsed
- {
- background: #A793AC none repeat scroll 0% 50%;
+ {
+ background: #A793AC none repeat scroll 0% 50%;
}
.k-entityworkspace-red .x-layout-split,.k-entityworkspace-red .x-layout-collapsed
- {
- background: #FF5555 none repeat scroll 0% 50%;
+ {
+ background: #FF5555 none repeat scroll 0% 50%;
}
.k-entity-title {
- border-left-style: solid;
- border-left-width: 2px;
+ border-left-style: solid;
+ border-left-width: 2px;
}
.k-entity-title div {
- line-height: 22px;
- white-space: nowrap;
+ line-height: 22px;
+ white-space: nowrap;
}
.k-entity-subtitle {
@@ -217,257 +218,256 @@
}
.k-entity-subtitle div {
- line-height: 22px;
- white-space: nowrap;
+ line-height: 22px;
+ white-space: nowrap;
}
.k-entity-title-rd-default {
- background: #DD8A3D;
+ background: #DD8A3D;
}
.k-entity-title-rd-green {
- background: #5FD35F;
+ background: #5FD35F;
}
.k-entity-title-rd-blue {
- background: #0066FF;
+ background: #0066FF;
}
.k-entity-title-rd-grey {
- background: #4D4D4D;
+ background: #4D4D4D;
}
.k-entity-title-rd-purple {
- background: #660080;
+ background: #660080;
}
.k-entity-title-rd-red {
- background: #D40000;
+ background: #D40000;
}
.k-entity-title-default {
- background: #F1BB59 none repeat scroll 0% 50%;
- border-left-color: #DD8A3D;
+ background: #F1BB59 none repeat scroll 0% 50%;
+ border-left-color: #DD8A3D;
}
.k-entity-title-green {
- background: #AFA none repeat scroll 0% 50%;
- border-left-color: #5FD35F;
+ background: #AFA none repeat scroll 0% 50%;
+ border-left-color: #5FD35F;
}
.k-entity-title-blue {
- background: #AFDDE9 none repeat scroll 0% 50%;
- border-left-color: #0066FF;
+ background: #AFDDE9 none repeat scroll 0% 50%;
+ border-left-color: #0066FF;
}
.k-entity-title-grey {
- background: #CCCCCC none repeat scroll 0% 50%;
- border-left-color: #4D4D4D;
+ background: #CCCCCC none repeat scroll 0% 50%;
+ border-left-color: #4D4D4D;
}
.k-entity-title-purple {
- background: #DDAFE9 none repeat scroll 0% 50%;
- border-left-color: #660080;
+ background: #DDAFE9 none repeat scroll 0% 50%;
+ border-left-color: #660080;
}
.k-entity-title-red {
- background: #FF8080 none repeat scroll 0% 50%;
- border-left-color: #D40000;
+ background: #FF8080 none repeat scroll 0% 50%;
+ border-left-color: #D40000;
}
.k-entity-title-default div {
- color: #69312F;
+ color: #69312F;
}
.k-entity-title-green div {
- color: #250;
+ color: #250;
}
.k-entity-title-blue div {
- color: #000080;
+ color: #000080;
}
.k-entity-title-grey div {
- color: #1A1A1A;
+ color: #1A1A1A;
}
.k-entity-title-purple div {
- color: #440055;
+ color: #440055;
}
.k-entity-title-red div {
- color: #800000;
+ color: #800000;
}
.k-entity-subtitle-default {
- background: #DD8A3D none repeat scroll 0% 50%;
+ background: #DD8A3D none repeat scroll 0% 50%;
}
.k-entity-subtitle-green {
- background: #5FD35F none repeat scroll 0% 50%;
+ background: #5FD35F none repeat scroll 0% 50%;
}
.k-entity-subtitle-blue {
- background: #0066FF none repeat scroll 0% 50%;
+ background: #0066FF none repeat scroll 0% 50%;
}
.k-entity-subtitle-grey {
- background: #4D4D4D none repeat scroll 0% 50%;
+ background: #4D4D4D none repeat scroll 0% 50%;
}
.k-entity-subtitle-purple {
- background: #660080 none repeat scroll 0% 50%;
+ background: #660080 none repeat scroll 0% 50%;
}
.k-entity-subtitle-red {
- background: #D40000 none repeat scroll 0% 50%;
+ background: #D40000 none repeat scroll 0% 50%;
}
.k-entity-subtitle-default div {
- color: #FFF;
+ color: #FFF;
}
.k-entity-subtitle-green div {
- color: #FFF;
+ color: #FFF;
}
.k-entity-subtitle-blue div {
- color: #FFF;
+ color: #FFF;
}
.k-entity-subtitle-grey div {
- color: #FFF;
+ color: #FFF;
}
.k-entity-subtitle-purple div {
- color: #FFF;
+ color: #FFF;
}
.k-entity-subtitle-red div {
- color: #FFF;
+ color: #FFF;
}
.k-entity-bottom-rd-default,.k-entity-bottom-default,.k-toolselectoritem-sel-default
- {
- background: #DD8A3D;
+ {
+ background: #DD8A3D;
}
.k-entity-bottom-rd-green,.k-entity-bottom-green,.k-toolselectoritem-sel-green
- {
- background: #5FD35F;
+ {
+ background: #5FD35F;
}
.k-entity-bottom-rd-blue,.k-entity-bottom-blue,.k-toolselectoritem-sel-blue
- {
- background: #0066FF;
+ {
+ background: #0066FF;
}
.k-entity-bottom-rd-grey,.k-entity-bottom-grey,.k-toolselectoritem-sel-grey
- {
- background: #4D4D4D;
+ {
+ background: #4D4D4D;
}
.k-entity-bottom-rd-purple,.k-entity-bottom-purple,.k-toolselectoritem-sel-purple
- {
- background: #660080;
+ {
+ background: #660080;
}
.k-entity-bottom-rd-red,.k-entity-bottom-red,.k-toolselectoritem-sel-red
- {
- background: #D40000;
+ {
+ background: #D40000;
}
.k-entity-context-default div,.k-entity-context-default .x-tree .x-panel-body
- {
- background: #FFD09D none repeat scroll 0% 50%;
+ {
+ background: #FFD09D none repeat scroll 0% 50%;
}
.k-entity-context-green div,.k-entity-context-green .x-tree .x-panel-body
- {
- background: #CFA none repeat scroll 0% 50%;
+ {
+ background: #CFA none repeat scroll 0% 50%;
}
.k-entity-context-blue div,.k-entity-context-blue .x-tree .x-panel-body
- {
- background: #AACCFF none repeat scroll 0% 50%;
+ {
+ background: #AACCFF none repeat scroll 0% 50%;
}
.k-entity-context-grey div,.k-entity-context-grey .x-tree .x-panel-body
- {
- background: #B3B3B3 none repeat scroll 0% 50%;
+ {
+ background: #B3B3B3 none repeat scroll 0% 50%;
}
.k-entity-context-purple div,.k-entity-context-purple .x-tree .x-panel-body
- {
- background: #DDAFE9 none repeat scroll 0% 50%;
+ {
+ background: #DDAFE9 none repeat scroll 0% 50%;
}
.k-entity-context-red div,.k-entity-context-red .x-tree .x-panel-body {
- background: #FFAAAA none repeat scroll 0% 50%;
+ background: #FFAAAA none repeat scroll 0% 50%;
}
.k-entity-context-purple .x-tree .x-panel-body {
- background: #DDAFE9 none repeat scroll 0% 50%;
+ background: #DDAFE9 none repeat scroll 0% 50%;
}
-.k-entity-bottom div {
- /* line-height: 24px; */
- color: #FFF;
+.k-entity-bottom div { /* line-height: 24px; */
+ color: #FFF;
}
.k-toolbar-top-line {
- border-top-color: rgb(208, 208, 208);
- border-top-style: solid;
- border-top-width: 1px;
+ border-top-color: rgb(208, 208, 208);
+ border-top-style: solid;
+ border-top-width: 1px;
}
.k-toolbar-bottom-line {
- border-bottom-color: rgb(208, 208, 208);
- border-bottom-style: solid;
- border-bottom-width: 1px;
+ border-bottom-color: rgb(208, 208, 208);
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
}
.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label
- {
- white-space: nowrap;
- font: normal 100% arial, sans;
- line-height: 19px;
+ {
+ white-space: nowrap;
+ font: normal 100% arial, sans;
+ line-height: 19px;
}
.k-toolbar-sep {
- padding-top: 4px;
- padding-left: 5px;
+ padding-top: 4px;
+ padding-left: 5px;
}
/* Custom gwt-ext styles */
.ytb-sep {
- background-image:
- url(../js/ext/resources/images/default/grid/grid-split.gif);
- background-position: center;
- background-repeat: no-repeat;
- display: block;
- font-size: 1px;
- height: 16px;
- width: 4px;
- overflow: hidden;
- cursor: default;
- margin: 0 2px 0;
- border: 0;
+ background-image:
+ url(../js/ext/resources/images/default/grid/grid-split.gif);
+ background-position: center;
+ background-repeat: no-repeat;
+ display: block;
+ font-size: 1px;
+ height: 16px;
+ width: 4px;
+ overflow: hidden;
+ cursor: default;
+ margin: 0 2px 0;
+ border: 0;
}
.ytb-spacer {
- width: 2px;
+ width: 2px;
}
.x-grid-group-hd {
- border-bottom: 2px solid grey;
- cursor: pointer;
- padding-top: 3px;
+ border-bottom: 2px solid grey;
+ cursor: pointer;
+ padding-top: 3px;
}
/* Drop down */
.k-dropdownouter {
- background-color: grey;
+ background-color: grey;
}
.k-dropdownouter-members {
@@ -475,27 +475,27 @@
}
.k-dropdownouter-members-default {
- background-color: #DF5244;
+ background-color: #DF5244;
}
.k-dropdownouter-members-green {
- background-color: #008000;
+ background-color: #008000;
}
.k-dropdownouter-members-blue {
- background-color: #5500D4;
+ background-color: #5500D4;
}
.k-dropdownouter-members-grey {
- background-color: #4D4D4D;
+ background-color: #4D4D4D;
}
.k-dropdownouter-members-purple {
- background-color: #672178;
+ background-color: #672178;
}
.k-dropdownouter-members-red {
- background-color: #A02C2C;
+ background-color: #A02C2C;
}
.k-dropdownouter-part {
@@ -503,27 +503,27 @@
}
.k-dropdownouter-part-default {
- background-color: #CA5842;
+ background-color: #CA5842;
}
.k-dropdownouter-part-green {
- background-color: #00AA00;
+ background-color: #00AA00;
}
.k-dropdownouter-part-blue {
- background-color: #6600FF;
+ background-color: #6600FF;
}
.k-dropdownouter-part-grey {
- background-color: #666666;
+ background-color: #666666;
}
.k-dropdownouter-part-purple {
- background-color: #892CA0;
+ background-color: #892CA0;
}
.k-dropdownouter-part-red {
- background-color: #C83737;
+ background-color: #C83737;
}
.k-dropdownouter-tags {
@@ -531,27 +531,27 @@
}
.k-dropdownouter-tags-default {
- background-color: #87501E;
+ background-color: #87501E;
}
.k-dropdownouter-tags-green {
- background-color: #00D400;
+ background-color: #00D400;
}
.k-dropdownouter-tags-blue {
- background-color: #9955FF;
+ background-color: #9955FF;
}
.k-dropdownouter-tags-grey {
- background-color: #808080;
+ background-color: #808080;
}
.k-dropdownouter-tags-purple {
- background-color: #AB37C8;
+ background-color: #AB37C8;
}
.k-dropdownouter-tags-red {
- background-color: #D35F5F;
+ background-color: #D35F5F;
}
.k-dropdownouter-summary {
@@ -559,80 +559,80 @@
}
.k-dropdownouter-summary-default {
- background-color: #9F734B;
+ background-color: #9F734B;
}
.k-dropdownouter-summary-green {
- background-color: #4CE14C;
+ background-color: #4CE14C;
}
.k-dropdownouter-summary-blue {
- background-color: #69A5FF;
+ background-color: #69A5FF;
}
.k-dropdownouter-summary-grey {
- background-color: #A6A6A6;
+ background-color: #A6A6A6;
}
.k-dropdownouter-summary-purple {
- background-color: #C473D8;
+ background-color: #C473D8;
}
.k-dropdownouter-summary-red {
- background-color: #E08F8F;
+ background-color: #E08F8F;
}
.k-dropdowninner {
- margin: 0 3px 1px 3px;
- background: green;
- background-color: #FFF;
- /* padding: 3px; */
+ margin: 0 3px 1px 3px;
+ background: green;
+ background-color: #FFF;
+ /* padding: 3px; */
}
.k-dropdownlabel {
- color: #FFF;
- cursor: pointer;
+ color: #FFF;
+ cursor: pointer;
}
.k-dropdownlabel .gwt-Label {
- margin: 0 5px 0 0;
- width: 100%;
+ margin: 0 5px 0 0;
+ width: 100%;
}
.k-dropdownlabel img {
- margin: 0 3px 0 1px;
+ margin: 0 3px 0 1px;
}
/* WsTheme */
.k-wstheme-icon-default {
- background: #FF8C00;
+ background: #FF8C00;
}
.k-wstheme-icon-green {
- background: green;
+ background: green;
}
.k-wstheme-icon-blue {
- background: blue;
+ background: blue;
}
.k-wstheme-icon-grey {
- background: grey;
+ background: grey;
}
.k-wstheme-icon-purple {
- background: purple;
+ background: purple;
}
.k-wstheme-icon-red {
- background: red;
+ background: red;
}
/* Tool selector items */
.k-toolselectoritem {
- width: auto;
- margin-bottom: 5px;
- cursor: pointer;
+ width: auto;
+ margin-bottom: 5px;
+ cursor: pointer;
}
.k-toolselectoritem-sel {
@@ -640,37 +640,37 @@
}
.k-toolselectoritem-notsel-default {
- background: #FFE9A5;
+ background: #FFE9A5;
}
.k-toolselectoritem-notsel-green {
- background: #D6F4D6;
+ background: #D6F4D6;
}
.k-toolselectoritem-notsel-blue {
- background: #D7D7F4;
+ background: #D7D7F4;
}
.k-toolselectoritem-notsel-grey {
- background: #E6E6E6;
+ background: #E6E6E6;
}
.k-toolselectoritem-notsel-purple {
- background: #EED7F4;
+ background: #EED7F4;
}
.k-toolselectoritem-notsel-red {
- background: #FFD5D5;
+ background: #FFD5D5;
}
.k-toolselectoritem-sel a {
- color: #FFF;
- padding: 0 9px;
- text-decoration: none;
+ color: #FFF;
+ padding: 0 9px;
+ text-decoration: none;
}
.k-toolselectoritem-sel a:hover {
- text-decoration: none;
+ text-decoration: none;
}
.k-toolselectoritem-notsel {
@@ -678,71 +678,67 @@
}
.k-toolselectoritem-notsel a {
- color: #0000FF;
- padding: 0 9px;
- text-decoration: none;
+ color: #0000FF;
+ padding: 0 9px;
+ text-decoration: none;
}
.k-toolselectoritem-notsel a:hover {
- text-decoration: underline;
+ text-decoration: underline;
}
-/* others */
-
-/*
+/* others */ /*
.x-tree-node a span, .x-dd-drag-ghost a span {
color:#000000;
padding: 1px 0px 1px 1px;
text-decoration:none;
}
*/
+.x-tree-node .k-ctn-status-normal a span {
-.x-tree-node .k-ctn-status-normal a span {
}
.x-tree-node .k-ctn-status-deleted a span {
- text-decoration: line-through;
- color: gray;
+ text-decoration: line-through;
+ color: gray;
}
.x-tree-node .k-ctn-status-rejected a span {
- text-decoration: line-through;
- /* color: #FF6633; */
- color: #FF3300;
-
+ text-decoration: line-through;
+ /* color: #FF6633; */
+ color: #FF3300;
}
.x-tree-node .k-ctn-status-editing a span {
- font-style: italic;
- color: gray;
+ font-style: italic;
+ color: gray;
}
.x-tree-node .k-ctn-status-submitted a span {
- color: green;
+ color: green;
}
.k-info-links {
- text-decoration: underline;
- color:gray;
- cursor: pointer;
+ text-decoration: underline;
+ color: gray;
+ cursor: pointer;
}
.x-tool-kmenu {
- background-position: 0 -75px;
+ background-position: 0 -75px;
}
.x-tool-kmenu-over {
- background-position: -15px -75px;
+ background-position: -15px -75px;
}
.k-border-openbox {
- border-bottom: 1px #D0D0D0 solid;
- border-right: 1px #D0D0D0 solid;
- border-left: 1px #D0D0D0 solid;
+ border-bottom: 1px #D0D0D0 solid;
+ border-right: 1px #D0D0D0 solid;
+ border-left: 1px #D0D0D0 solid;
}
/* SiteToastMessages */
-
.k-stm-info-icon {
background-image: url(img/info.gif) !important;
}
@@ -770,18 +766,20 @@
}
.gwt-DisclosurePanel {
+
}
.gwt-DisclosurePanel-open {
+
}
.gwt-DisclosurePanel-closed {
+
}
-.gwt-DisclosurePanel .header,
-.gwt-DisclosurePanel .header a,
-.gwt-DisclosurePanel .header td {
- text-decoration: none; /* Remove underline from header */
+.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td
+ {
+ text-decoration: none; /* Remove underline from header */
color: black;
cursor: pointer;
cursor: hand;
@@ -794,10 +792,10 @@
}
.k-basic-thumb {
- background: #FAFAFA none repeat scroll 0% 50%;
- border: 1px solid #EBEBEB;
- padding: 3px;
- margin: 3px;
+ background: #FAFAFA none repeat scroll 0% 50%;
+ border: 1px solid #EBEBEB;
+ padding: 3px;
+ margin: 3px;
}
.k-basic-thumb td {
@@ -806,7 +804,7 @@
}
.k-text-gray {
- color: gray;
+ color: gray;
}
.k-elp-limg {
@@ -855,28 +853,68 @@
background-image: url(img/colors.gif) !important;
}
-.x-toolbar-body table {
- /* width: 100%; */
+.x-toolbar-body table { /* width: 100%; */
+
}
-.k-preview-msg
- {
- background: #FFCCAA;
+.k-preview-msg {
+ background: #FFCCAA;
}
-.k-preview-msg-lab
- {
- background: #FFCCAA;
- padding: 0 5px;
+
+.k-preview-msg-lab {
+ background: #FFCCAA;
+ padding: 0 5px;
}
.k-eil-edit {
- border: thin solid black;
+ border: thin solid black;
}
/* duplicated in rte.css */
.k-rte-comment {
- border:1px dashed #C0C0C0;
- line-height:1.4;
- padding:1px;
- background-color:#D7FFD7;
+ border: 1px dashed #C0C0C0;
+ line-height: 1.4;
+ padding: 1px;
+ background-color: #D7FFD7;
+}
+
+.k-specialchar-grid {
+ border: 1px solid #ACA899;
+}
+
+.k-specialchar-grid table {
+
+}
+
+.k-specialchar-grid div {
+ line-height: 22px;
+}
+
+.k-specialchar-grid td {
+ padding: 1px;
+}
+
+.k-specialchar-pb {
+ border: 1px solid #EBE8D7;
+ cursor: pointer;
+ font-size: 108% !important;
+ text-align: center;
+ vertical-align: middle;
+ width: 18px;
+ height: 18px;
+}
+
+.k-specialchar-pb-up {
+}
+
+.k-specialchar-pb-down {
+ color: #161616;
+}
+
+.k-specialchar-pb-up-hovering {
+ border: thin solid #ACA899;
+}
+
+.k-specialchar-pb-down-hovering {
+ color: #161616;
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -24,6 +24,7 @@
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharGroup;
import com.calclab.suco.client.ioc.module.AbstractModule;
@@ -36,5 +37,6 @@
registerDecorator(EntityOptionsGroup.class, new EntityOptionsGroup(container));
registerDecorator(InsertImageGroup.class, new InsertImageGroup(container));
registerDecorator(InsertLinkGroup.class, new InsertLinkGroup(container));
+ registerDecorator(InsertSpecialCharGroup.class, new InsertSpecialCharGroup(container));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -87,6 +87,16 @@
import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.InsertLinkExtPanel;
import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.InsertLinkExtPresenter;
import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.InsertLinkExtView;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogPresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.asian.InsertSpecialAsianChar;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.asian.InsertSpecialAsianCharPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.asian.InsertSpecialAsianCharPresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental.InsertSpecialOccChar;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental.InsertSpecialOccCharPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental.InsertSpecialOccCharPresenter;
import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialogPanel;
import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialogPresenter;
@@ -298,7 +308,7 @@
final RTEditorPresenter presenter = new RTEditorPresenter($(I18nTranslationService.class),
$(Session.class), topBar, sndBar, $(RTEImgResources.class), $(InsertLinkDialog.class),
$(ColorWebSafePalette.class), $$(EditHtmlDialog.class), $$(InsertImageDialog.class),
- $$(InsertTableDialog.class), $(DeferredCommandWrapper.class));
+ $$(InsertTableDialog.class), $$(InsertSpecialCharDialog.class), $(DeferredCommandWrapper.class));
final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class),
$(ActionManager.class), $(GlobalShortcutRegister.class));
presenter.init(panel);
@@ -433,6 +443,35 @@
}
});
+ register(InsertSpecialCharGroup.class, new Factory<InsertSpecialCharDialog>(InsertSpecialCharDialog.class) {
+ @Override
+ public InsertSpecialCharDialog create() {
+ final InsertSpecialCharDialogPresenter presenter = new InsertSpecialCharDialogPresenter();
+ final InsertSpecialCharDialogPanel panel = new InsertSpecialCharDialogPanel(presenter, $(Images.class),
+ $(I18nTranslationService.class), $(InsertSpecialCharGroup.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ }, new Factory<InsertSpecialOccChar>(InsertSpecialOccChar.class) {
+ @Override
+ public InsertSpecialOccChar create() {
+ final InsertSpecialOccCharPresenter presenter = new InsertSpecialOccCharPresenter();
+ final InsertSpecialOccCharPanel panel = new InsertSpecialOccCharPanel($(InsertSpecialCharDialog.class),
+ i18n);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, new Factory<InsertSpecialAsianChar>(InsertSpecialAsianChar.class) {
+ @Override
+ public InsertSpecialAsianChar create() {
+ final InsertSpecialAsianCharPresenter presenter = new InsertSpecialAsianCharPresenter();
+ final InsertSpecialAsianCharPanel panel = new InsertSpecialAsianCharPanel(
+ $(InsertSpecialCharDialog.class), i18n);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
$(ApplicationComponentGroup.class).createAll();
$(ToolGroup.class).createAll();
$(Application.class).start();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -24,6 +24,7 @@
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
@@ -73,12 +74,14 @@
private Listener2<String, String> insertLinkListener;
private Listener<String> updateHtmlListener;
private ActionToolbarButtonDescriptor<Object> insertTableBtn;
+ private final Provider<InsertSpecialCharDialog> insertSpecialCharDialog;
+ protected Listener<String> insertSpecialCharListener;
public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
RTEActionSndToolbar sndBar, RTEImgResources imgResources, InsertLinkDialog textEditorInsertElement,
ColorWebSafePalette palette, Provider<EditHtmlDialog> editHtmlDialog,
Provider<InsertImageDialog> insertImageDialog, Provider<InsertTableDialog> insertTableDialog,
- DeferredCommandWrapper deferred) {
+ Provider<InsertSpecialCharDialog> insertSpecialCharDialog, DeferredCommandWrapper deferred) {
this.i18n = i18n;
this.session = session;
this.topBar = topBar;
@@ -88,6 +91,7 @@
this.editHtmlDialog = editHtmlDialog;
this.insertImageDialog = insertImageDialog;
this.insertTableDialog = insertTableDialog;
+ this.insertSpecialCharDialog = insertSpecialCharDialog;
this.deferred = deferred;
styleToolbar(sndBar);
sndBar.attach();
@@ -467,7 +471,7 @@
}
});
comment.setShortcut(new ActionShortcut(true, 'M'));
- comment.setTextDescription(i18n.t("Comment..."));
+ comment.setTextDescription(i18n.t("Comment"));
comment.setParentMenuTitle(i18n.t(INSERT_MENU));
comment.setEnableCondition(isInsertHtmlSupported());
comment.setAddCondition(canBeExtended);
@@ -615,6 +619,26 @@
removeFormat.setAddCondition(canBeExtended);
removeFormat.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ final ActionToolbarMenuDescriptor<Object> insertSpecialChar = new ActionToolbarMenuDescriptor<Object>(
+ accessRol, topbar, new Listener0() {
+ public void onEvent() {
+ if (insertSpecialCharListener == null) {
+ insertSpecialCharListener = new Listener<String>() {
+ public void onEvent(String character) {
+ view.insertHtml(character);
+ }
+ };
+ }
+ insertSpecialCharDialog.get().setOnInsertSpecialChar(insertSpecialCharListener);
+ insertSpecialCharDialog.get().show();
+ }
+ });
+ insertSpecialChar.setIconCls(getCssName(imgResources.specialchars()));
+ insertSpecialChar.setTextDescription(i18n.t("Special characters..."));
+ insertSpecialChar.setAddCondition(canBeExtended);
+ insertSpecialChar.setParentMenuTitle(i18n.t(INSERT_MENU));
+ insertSpecialChar.setTopSeparator(true);
+
final ActionToolbarMenuDescriptor<Object> insertMedia = new ActionToolbarMenuDescriptor<Object>(accessRol,
topbar, new Listener0() {
public void onEvent() {
@@ -622,7 +646,7 @@
}
});
insertMedia.setIconCls(getCssName(imgResources.film()));
- insertMedia.setTextDescription(i18n.t("Insert Media ..."));
+ insertMedia.setTextDescription(i18n.t("Media..."));
insertMedia.setAddCondition(canBeExtended);
insertMedia.setParentMenuTitle(i18n.t(INSERT_MENU));
@@ -633,7 +657,7 @@
}
});
insertTable.setIconCls(getCssName(imgResources.inserttable()));
- insertTable.setTextDescription(i18n.t("Insert Table ..."));
+ insertTable.setTextDescription(i18n.t("Table ..."));
insertTable.setAddCondition(canBeExtended);
insertTable.setParentMenuTitle(i18n.t(INSERT_MENU));
@@ -722,7 +746,6 @@
actions.add(withNoItem(paste));
actions.add(withNoItem(selectAll));
actions.add(withNoItem(editHtml));
- actions.add(withNoItem(hr));
actions.add(withNoItem(subscript));
actions.add(withNoItem(superscript));
actions.add(withNoItem(decreaseIndent));
@@ -730,14 +753,16 @@
actions.add(withNoItem(ol));
actions.add(withNoItem(ul));
actions.add(withNoItem(removeFormat));
- // topActions.add(withNoItem(hrButton));
+ actions.add(withNoItem(hrButton));
actions.add(withNoItem(img));
actions.add(withNoItem(createLink));
actions.add(withNoItem(removeLink));
actions.add(withNoItem(insertTableBtn));
actions.add(withNoItem(insertTable));
actions.add(withNoItem(insertMedia));
+ actions.add(withNoItem(insertSpecialChar));
actions.add(withNoItem(comment));
+ actions.add(withNoItem(hr));
actions.add(withNoItem(undoBtn));
actions.add(withNoItem(redoBtn));
// actions.add(withNoItem(devInfo));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -1,8 +1,7 @@
package org.ourproject.kune.platf.client.ui.rte.insertimg;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogView;
-public interface InsertImageDialogView extends AbstractTabbedDialogView, View {
+public interface InsertImageDialogView extends AbstractTabbedDialogView {
int HEIGHT = 225;
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,18 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
+
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialog;
+
+import com.calclab.suco.client.events.Listener;
+
+public interface InsertSpecialCharDialog extends AbstractTabbedDialog {
+
+ String DEF_LABEL = "Click on a character below to insert it into the document.";
+
+ void hide();
+
+ void onInsert(char character);
+
+ void setOnInsertSpecialChar(Listener<String> listener);
+
+ void show();
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,38 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
+
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+
+public class InsertSpecialCharDialogPanel extends AbstractTabbedDialogPanel implements InsertSpecialCharDialogView {
+
+ private static final String INSERT_SPECIAL_CHAR_DIALOG = "iscdp-dial";
+ private static final String INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID = "iscdp-err";
+ private final InsertSpecialCharGroup insertSpecialCharGroup;
+
+ public InsertSpecialCharDialogPanel(final InsertSpecialCharDialogPresenter presenter, Images images,
+ I18nTranslationService i18n, InsertSpecialCharGroup insertSpecialCharGroup) {
+ super(INSERT_SPECIAL_CHAR_DIALOG, i18n.t("Insert Special Character"), 500, HEIGHT + 90, 500, HEIGHT + 90, true,
+ images, INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID);
+ // super.setIconCls("k-picture-icon");
+ this.insertSpecialCharGroup = insertSpecialCharGroup;
+ Button close = new Button(i18n.t("Close"));
+ close.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ hide();
+ }
+ });
+ addButton(close);
+ }
+
+ @Override
+ public void createAndShow() {
+ insertSpecialCharGroup.createAll();
+ super.createAndShow();
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,21 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
+
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
+
+import com.calclab.suco.client.events.Listener;
+
+public class InsertSpecialCharDialogPresenter extends AbstractTabbedDialogPresenter implements InsertSpecialCharDialog {
+
+ private Listener<String> onInsertSpecialChar;
+
+ public void onInsert(char character) {
+ hide();
+ if (onInsertSpecialChar != null) {
+ onInsertSpecialChar.onEvent("" + character);
+ }
+ }
+
+ public void setOnInsertSpecialChar(Listener<String> listener) {
+ this.onInsertSpecialChar = listener;
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
+
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogView;
+
+public interface InsertSpecialCharDialogView extends AbstractTabbedDialogView {
+ int HEIGHT = 315;
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,19 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
+
+import com.calclab.suco.client.ioc.Container;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.ioc.decorator.ProviderCollection;
+import com.calclab.suco.client.ioc.decorator.Singleton;
+
+public class InsertSpecialCharGroup extends ProviderCollection {
+
+ public InsertSpecialCharGroup(final Container container) {
+ super(container, Singleton.instance);
+ }
+
+ public void createAll() {
+ for (final Provider<?> p : getProviders()) {
+ p.get();
+ }
+ }
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianChar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianChar.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianChar.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.asian;
+
+public interface InsertSpecialAsianChar {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPanel.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPanel.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,22 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.asian;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental.AbstractInsertCharPanel;
+
+public class InsertSpecialAsianCharPanel extends AbstractInsertCharPanel implements InsertSpecialAsianCharView {
+
+ private static char[] SPECIAL_CHARS = { '・', '×', '【', '】', '『', '』', '《', '》', '“', '”', '「', '」', '〈', '〉', '≪',
+ '≫', '「', '」', '<', '>', '‘', '’', '〔', '〕', '㈱', '㏍', '~', '㌍', ',', '〃', '仝', 'ゝ', 'ゞ', '々', '〒', '※',
+ '″', '㌔', '㎏', '㎞', '≒', '㌘', '★', '●', '㊦', '※', '▲', '▽', '△', '▼', '⊿', '◇', '◆', '□', '■', '↓', '〆',
+ '♯', '/', '\', '㍼', '㊤', '☆', '○', '§', '㎝', '㌢', '㎝', '¢', '㌣', '㍽', '㈹', '†', '゛', '∥', '|', '′', '″',
+ '℃', '¥', 'Å', '¢', '£', '%', '‰', '$', '°', '㊥', '℡', '°', '℃', '㌧', '∵', '‥', '№', '◎', '%', '㌫', '×',
+ '゜', '㊧', '㍻', '㎡', '㎡', '㌶', '㌻', '㌻', '※', '.', '。', '。', '㊨', '㎜', '㍉', '㎎', '㍊', '㎜', '∞', '㍍', '㍾',
+ '㈲', '∴', '~', '㍑', '㍗', '㈀', '㈁', '㈂', '㈃', '㈄', '㈅', '㈆', '㈇', '㈈', '㈎', '㈏', '㈐', '㈑', '㈒', '㈓' };
+
+ public InsertSpecialAsianCharPanel(InsertSpecialCharDialog insertSpecialCharDialog, I18nTranslationService i18n) {
+ super(insertSpecialCharDialog, i18n.t("Asian characters"), i18n.t(InsertSpecialCharDialog.DEF_LABEL),
+ SPECIAL_CHARS, 7, 20);
+ insertSpecialCharDialog.addOptionTab(this);
+ }
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPresenter.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharPresenter.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,19 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.asian;
+
+import org.ourproject.kune.platf.client.View;
+
+public class InsertSpecialAsianCharPresenter implements InsertSpecialAsianChar {
+
+ private InsertSpecialAsianCharView view;
+
+ public InsertSpecialAsianCharPresenter() {
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(InsertSpecialAsianCharView view) {
+ this.view = view;
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharView.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/InsertSpecialAsianCharView.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.asian;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface InsertSpecialAsianCharView extends View {
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/AbstractInsertCharPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/AbstractInsertCharPanel.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/AbstractInsertCharPanel.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,55 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental;
+
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogView;
+
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.SourcesTableEvents;
+import com.google.gwt.user.client.ui.TableListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+
+public class AbstractInsertCharPanel extends Panel {
+
+ public AbstractInsertCharPanel(final InsertSpecialCharDialog insertSpecialCharDialog, String title,
+ String initialLabel, final char[] specialChars, int rows, final int cols) {
+ super(title);
+ setAutoWidth(true);
+ setHeight(InsertSpecialCharDialogView.HEIGHT - 10);
+ setPaddings(20);
+ Label label = new Label(initialLabel);
+ label.addStyleName("kune-Margin-Medium-b");
+ add(label);
+ final Grid grid = new Grid(rows, cols);
+ grid.setCellSpacing(1);
+
+ int row;
+ int col;
+ int n = 0;
+ for (char c : specialChars) {
+ row = n / cols;
+ col = n % cols;
+ grid.setWidget(row, col, createButton(c));
+ n++;
+ }
+ grid.addTableListener(new TableListener() {
+ public void onCellClicked(SourcesTableEvents sender, int row, int cell) {
+ if (sender == grid) {
+ insertSpecialCharDialog.onInsert(specialChars[row * cols + cell]);
+ }
+ }
+ });
+ grid.addStyleName("k-specialchar-grid");
+ add(grid);
+ }
+
+ private Widget createButton(char c) {
+ PushButton button = new PushButton();
+ button.setText("" + c);
+ button.setStyleName("k-specialchar-pb");
+ return button;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccChar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccChar.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccChar.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental;
+
+public interface InsertSpecialOccChar {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPanel.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPanel.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,25 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
+
+public class InsertSpecialOccCharPanel extends AbstractInsertCharPanel implements InsertSpecialOccCharView {
+
+ private static char[] SPECIAL_CHARS = { '¡', '¢', '£', '¤', '¥', '¦', '§', '¨', '©', 'ª', '«', '¬', '', '®', '¯',
+ '°', '±', '²', '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', '½', '¾', '¿', 'À', 'Á', 'Â', 'Ã', 'Ä',
+ 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', 'Ø', 'Ù',
+ 'Ú', 'Û', 'Ü', 'Ý', 'Þ', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î',
+ 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ', 'Ā', 'ā', 'Ă', 'ă',
+ 'Ą', 'ą', 'Ć', 'ć', 'Ĉ', 'ĉ', 'Ċ', 'ċ', 'Č', 'č', 'Ď', 'ď', 'Đ', 'đ', 'Ē', 'ē', 'Ĕ', 'ĕ', 'Ė', 'ė', 'Ę',
+ 'ę', 'Ě', 'ě', 'Ĝ', 'ĝ', 'Ğ', 'ğ', 'Ġ', 'ġ', 'Ģ', 'ģ', 'Ĥ', 'ĥ', 'Ħ', 'ħ', 'Ĩ', 'ĩ', 'Ī', 'ī', 'Ĭ', 'ĭ',
+ 'Į', 'į', 'İ', 'ı', 'IJ', 'ij', 'Ĵ', 'ĵ', 'Ķ', 'ķ', 'ĸ', 'Ĺ', 'ĺ', 'Ļ', 'ļ', 'Ľ', 'ľ', 'Ŀ', 'ŀ', 'Ł', 'ł',
+ 'Ń', 'ń', 'Ņ', 'ņ', 'Ň', 'ň', 'ʼn', 'Ŋ', 'ŋ', 'Ō', 'ō', 'Ŏ', 'ŏ', 'Ő', 'ő', 'Œ', 'œ', 'Ŕ', 'ŕ', 'Ŗ', 'ŗ',
+ 'Ř', 'ř', 'Ś', 'ś', 'Ŝ', 'ŝ', 'Ş', 'ş', 'Š', 'š', 'Ţ', 'ţ', 'Ť', 'ť', 'Ŧ', 'ŧ', 'Ũ', 'ũ', 'Ū', 'ū', 'Ŭ',
+ 'ŭ', 'Ů', 'ů', 'Ű', 'ű', 'Ų', 'ų', 'Ŵ', 'ŵ', 'Ŷ', 'ŷ', 'Ÿ', 'Ź', 'ź', 'Ż', 'ż' };
+
+ public InsertSpecialOccCharPanel(InsertSpecialCharDialog insertSpecialCharDialog, I18nTranslationService i18n) {
+ super(insertSpecialCharDialog, i18n.t("Special characters"), i18n.t(InsertSpecialCharDialog.DEF_LABEL),
+ SPECIAL_CHARS, 11, 20);
+ insertSpecialCharDialog.addOptionTab(this);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPresenter.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharPresenter.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,19 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental;
+
+import org.ourproject.kune.platf.client.View;
+
+public class InsertSpecialOccCharPresenter implements InsertSpecialOccChar {
+
+ private InsertSpecialOccCharView view;
+
+ public InsertSpecialOccCharPresenter() {
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(InsertSpecialOccCharView view) {
+ this.view = view;
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharView.java 2009-03-16 04:17:06 UTC (rev 1079)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/InsertSpecialOccCharView.java 2009-03-17 01:18:55 UTC (rev 1080)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.platf.client.ui.rte.insertspecialchar.occidental;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface InsertSpecialOccCharView extends View {
+}
1
0