Merge pull request #1791 from ONLYOFFICE/fix/form-search
Fix/form search
This commit is contained in:
commit
b188798121
|
@ -1,4 +1,4 @@
|
||||||
<svg width="440" height="40" viewBox="0 0 440 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="580" height="40" viewBox="0 0 580 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<g id="icon-menu-sprite Embedded Viewer">
|
<g id="icon-menu-sprite Embedded Viewer">
|
||||||
<g id="view-settings">
|
<g id="view-settings">
|
||||||
<path id="Vector" d="M17 26H3V27H17V26Z" fill="white"/>
|
<path id="Vector" d="M17 26H3V27H17V26Z" fill="white"/>
|
||||||
|
@ -148,23 +148,73 @@
|
||||||
<g id="close_2">
|
<g id="close_2">
|
||||||
<path id="Vector 73_2" d="M366 5L375 14M375 5L366 14" stroke="black" stroke-width="1.5"/>
|
<path id="Vector 73_2" d="M366 5L375 14M375 5L366 14" stroke="black" stroke-width="1.5"/>
|
||||||
</g>
|
</g>
|
||||||
|
<g id="сut">
|
||||||
|
<circle id="Ellipse 103" cx="385.5" cy="13.5" r="2" stroke="black"/>
|
||||||
|
<circle id="Ellipse 104" cx="385.5" cy="6.5" r="2" stroke="black"/>
|
||||||
|
<path id="Rectangle 1552" d="M387.188 7.56689L398.446 14.0669V14.0669C398.17 14.5452 397.559 14.7091 397.08 14.4329L386.688 8.43292L387.188 7.56689Z" fill="black"/>
|
||||||
|
<path id="Rectangle 1553" d="M386.688 11.5669L397.08 5.56689C397.558 5.29075 398.17 5.45463 398.446 5.93292V5.93292L387.188 12.4329L386.688 11.5669Z" fill="black"/>
|
||||||
|
</g>
|
||||||
|
<g id="сut_2">
|
||||||
|
<circle id="Ellipse 103_2" cx="385.5" cy="33.5" r="2" stroke="white"/>
|
||||||
|
<circle id="Ellipse 104_2" cx="385.5" cy="26.5" r="2" stroke="white"/>
|
||||||
|
<path id="Rectangle 1552_2" d="M387.188 27.5669L398.446 34.0669V34.0669C398.17 34.5452 397.559 34.7091 397.08 34.4329L386.688 28.4329L387.188 27.5669Z" fill="white"/>
|
||||||
|
<path id="Rectangle 1553_2" d="M386.688 31.5669L397.08 25.5669C397.558 25.2908 398.17 25.4546 398.446 25.9329V25.9329L387.188 32.4329L386.688 31.5669Z" fill="white"/>
|
||||||
|
</g>
|
||||||
|
<g id="copy">
|
||||||
|
<path id="Union_27" fill-rule="evenodd" clip-rule="evenodd" d="M404 5H412V7H413V5C413 4.44772 412.552 4 412 4H404C403.448 4 403 4.44772 403 5V12C403 12.5523 403.448 13 404 13H406V12H404V5ZM411 6H405V7H411V6ZM408 9V16H416V9H408ZM408 8C407.448 8 407 8.44772 407 9V16C407 16.5523 407.448 17 408 17H416C416.552 17 417 16.5523 417 16V9C417 8.44772 416.552 8 416 8H408ZM406 8H405V9H406V8ZM405 10H406V11H405V10ZM415 11V10H409V11H415ZM415 12V13H409V12H415ZM415 15V14H409V15H415Z" fill="black"/>
|
||||||
|
</g>
|
||||||
|
<g id="copy_2">
|
||||||
|
<path id="Union_28" fill-rule="evenodd" clip-rule="evenodd" d="M404 25H412V27H413V25C413 24.4477 412.552 24 412 24H404C403.448 24 403 24.4477 403 25V32C403 32.5523 403.448 33 404 33H406V32H404V25ZM411 26H405V27H411V26ZM408 29V36H416V29H408ZM408 28C407.448 28 407 28.4477 407 29V36C407 36.5523 407.448 37 408 37H416C416.552 37 417 36.5523 417 36V29C417 28.4477 416.552 28 416 28H408ZM406 28H405V29H406V28ZM405 30H406V31H405V30ZM415 31V30H409V31H415ZM415 32V33H409V32H415ZM415 35V34H409V35H415Z" fill="white"/>
|
||||||
|
</g>
|
||||||
|
<g id="paste">
|
||||||
|
<path id="Union_29" fill-rule="evenodd" clip-rule="evenodd" d="M426 3H432V4H434C434.552 4 435 4.44772 435 5V7H434V5H432V6H426V5H424V12H426V13H424C423.448 13 423 12.5523 423 12V5C423 4.44772 423.448 4 424 4H426V3ZM436 16V9H428V16H436ZM428 8C427.448 8 427 8.44772 427 9V16C427 16.5523 427.448 17 428 17H436C436.552 17 437 16.5523 437 16V9C437 8.44772 436.552 8 436 8H428ZM429 11V10H435V11H429ZM435 12H429V13H435V12ZM429 15V14H435V15H429Z" fill="black"/>
|
||||||
|
</g>
|
||||||
|
<g id="paste_2">
|
||||||
|
<path id="Union_30" fill-rule="evenodd" clip-rule="evenodd" d="M426 23H432V24H434C434.552 24 435 24.4477 435 25V27H434V25H432V26H426V25H424V32H426V33H424C423.448 33 423 32.5523 423 32V25C423 24.4477 423.448 24 424 24H426V23ZM436 36V29H428V36H436ZM428 28C427.448 28 427 28.4477 427 29V36C427 36.5523 427.448 37 428 37H436C436.552 37 437 36.5523 437 36V29C437 28.4477 436.552 28 436 28H428ZM429 31V30H435V31H429ZM435 32H429V33H435V32ZM429 35V34H435V35H429Z" fill="white"/>
|
||||||
|
</g>
|
||||||
|
<g id="redo">
|
||||||
|
<path id="Vector" d="M469.1 7C471.1 7 473.2 8.3 474.5 9.5L477 7V14H470L472.5 11.5C471.7 10.2 469.9 9.1 468.2 9.1C465.7 9.1 462.8 10.8 462.5 13.2C462.9 9.7 465.5 7 469.1 7Z" fill="black"/>
|
||||||
|
</g>
|
||||||
|
<g id="redo_2">
|
||||||
|
<path id="Vector_2" d="M469.1 27C471.1 27 473.2 28.3 474.5 29.5L477 27V34H470L472.5 31.5C471.7 30.2 469.9 29.1 468.2 29.1C465.7 29.1 462.8 30.8 462.5 33.2C462.9 29.7 465.5 27 469.1 27Z" fill="white"/>
|
||||||
|
</g>
|
||||||
|
<g id="undo">
|
||||||
|
<path id="Vector_3" d="M450.9 7C448.9 7 446.8 8.3 445.5 9.5L443 7V14H450L447.5 11.5C448.3 10.2 450.1 9.1 451.8 9.1C454.3 9.1 457.2 10.8 457.5 13.2C457.1 9.7 454.5 7 450.9 7Z" fill="black"/>
|
||||||
|
</g>
|
||||||
|
<g id="undo_2">
|
||||||
|
<path id="Vector_4" d="M450.9 27C448.9 27 446.8 28.3 445.5 29.5L443 27V34H450L447.5 31.5C448.3 30.2 450.1 29.1 451.8 29.1C454.3 29.1 457.2 30.8 457.5 33.2C457.1 29.7 454.5 27 450.9 27Z" fill="white"/>
|
||||||
|
</g>
|
||||||
<g id="search">
|
<g id="search">
|
||||||
<path id="Union_27" fill-rule="evenodd" clip-rule="evenodd" d="M393 8.5C393 10.9853 390.985 13 388.5 13C386.015 13 384 10.9853 384 8.5C384 6.01472 386.015 4 388.5 4C390.985 4 393 6.01472 393 8.5ZM392.02 12.7266C391.066 13.5217 389.839 14 388.5 14C385.462 14 383 11.5376 383 8.5C383 5.46243 385.462 3 388.5 3C391.538 3 394 5.46243 394 8.5C394 9.83875 393.522 11.0658 392.727 12.0195L396.854 16.1465L396.146 16.8536L392.02 12.7266Z" fill="black"/>
|
<path id="Union_31" fill-rule="evenodd" clip-rule="evenodd" d="M493 8.5C493 10.9853 490.985 13 488.5 13C486.015 13 484 10.9853 484 8.5C484 6.01472 486.015 4 488.5 4C490.985 4 493 6.01472 493 8.5ZM492.02 12.7266C491.066 13.5217 489.839 14 488.5 14C485.462 14 483 11.5376 483 8.5C483 5.46243 485.462 3 488.5 3C491.538 3 494 5.46243 494 8.5C494 9.83875 493.522 11.0658 492.727 12.0195L496.854 16.1465L496.146 16.8536L492.02 12.7266Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="search_2">
|
<g id="search_2">
|
||||||
<path id="Union_28" fill-rule="evenodd" clip-rule="evenodd" d="M393 28.5C393 30.9853 390.985 33 388.5 33C386.015 33 384 30.9853 384 28.5C384 26.0147 386.015 24 388.5 24C390.985 24 393 26.0147 393 28.5ZM392.02 32.7266C391.066 33.5217 389.839 34 388.5 34C385.462 34 383 31.5376 383 28.5C383 25.4624 385.462 23 388.5 23C391.538 23 394 25.4624 394 28.5C394 29.8387 393.522 31.0658 392.727 32.0195L396.854 36.1465L396.146 36.8536L392.02 32.7266Z" fill="white"/>
|
<path id="Union_32" fill-rule="evenodd" clip-rule="evenodd" d="M493 28.5C493 30.9853 490.985 33 488.5 33C486.015 33 484 30.9853 484 28.5C484 26.0147 486.015 24 488.5 24C490.985 24 493 26.0147 493 28.5ZM492.02 32.7266C491.066 33.5217 489.839 34 488.5 34C485.462 34 483 31.5376 483 28.5C483 25.4624 485.462 23 488.5 23C491.538 23 494 25.4624 494 28.5C494 29.8387 493.522 31.0658 492.727 32.0195L496.854 36.1465L496.146 36.8536L492.02 32.7266Z" fill="white"/>
|
||||||
|
</g>
|
||||||
|
<g id="btn-sheet-view">
|
||||||
|
<path id="Union_33" fill-rule="evenodd" clip-rule="evenodd" d="M509.93 13C507.552 13 505.45 11.8151 504.184 10C505.45 8.18485 507.552 7 509.93 7C512.307 7 514.409 8.18486 515.675 10C514.409 11.8151 512.307 13 509.93 13ZM509.93 6C512.891 6 515.476 7.6088 516.859 10C515.476 12.3912 512.891 14 509.93 14C506.969 14 504.383 12.3912 503 10C504.383 7.60879 506.969 6 509.93 6ZM509.93 12C511.034 12 511.93 11.1046 511.93 10C511.93 8.89543 511.034 8 509.93 8C508.825 8 507.93 8.89543 507.93 10C507.93 11.1046 508.825 12 509.93 12Z" fill="black"/>
|
||||||
|
</g>
|
||||||
|
<g id="btn-sheet-view_2">
|
||||||
|
<path id="Union_34" fill-rule="evenodd" clip-rule="evenodd" d="M509.93 33C507.552 33 505.45 31.8151 504.184 30C505.45 28.1849 507.552 27 509.93 27C512.307 27 514.409 28.1849 515.675 30C514.409 31.8151 512.307 33 509.93 33ZM509.93 26C512.891 26 515.476 27.6088 516.859 30C515.476 32.3912 512.891 34 509.93 34C506.969 34 504.383 32.3912 503 30C504.383 27.6088 506.969 26 509.93 26ZM509.93 32C511.034 32 511.93 31.1046 511.93 30C511.93 28.8954 511.034 28 509.93 28C508.825 28 507.93 28.8954 507.93 30C507.93 31.1046 508.825 32 509.93 32Z" fill="white"/>
|
||||||
|
</g>
|
||||||
|
<g id="hide-password">
|
||||||
|
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M530.948 6.05196C530.638 6.01766 530.321 6 530 6C526.91 6 524.243 7.63505 523 10C523.439 10.8356 524.056 11.5801 524.807 12.1935L525.518 11.4821C524.979 11.055 524.519 10.5539 524.158 10C525.311 8.23092 527.473 7 530 7C530 7 530 7 530 7L530.948 6.05196ZM530 13C532.527 12.9999 534.689 11.769 535.842 10C535.481 9.44626 535.021 8.94525 534.482 8.51821L535.194 7.80682C535.944 8.42019 536.561 9.16455 537 10C535.757 12.3649 533.09 14 530 14C529.679 14 529.363 13.9824 529.052 13.9481L530 13Z" fill="black"/>
|
||||||
|
<path id="Vector 169" d="M525 15L535 5" stroke="black"/>
|
||||||
|
</g>
|
||||||
|
<g id="hide-password_2">
|
||||||
|
<path id="Subtract_2" fill-rule="evenodd" clip-rule="evenodd" d="M530.948 26.052C530.638 26.0177 530.321 26 530 26C526.91 26 524.243 27.6351 523 30C523.439 30.8356 524.056 31.5801 524.807 32.1935L525.518 31.4821C524.979 31.055 524.519 30.5539 524.158 30C525.311 28.2309 527.473 27 530 27C530 27 530 27 530 27L530.948 26.052ZM530 33C532.527 32.9999 534.689 31.769 535.842 30C535.481 29.4463 535.021 28.9453 534.482 28.5182L535.194 27.8068C535.944 28.4202 536.561 29.1646 537 30C535.757 32.3649 533.09 34 530 34C529.679 34 529.363 33.9824 529.052 33.9481L530 33Z" fill="white"/>
|
||||||
|
<path id="Vector 169_2" d="M525 35L535 25" stroke="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="arrow-up">
|
<g id="arrow-up">
|
||||||
<path id="Union_29" fill-rule="evenodd" clip-rule="evenodd" d="M410 6.29297L410.354 6.64652L415.854 12.1465L415.146 12.8536L410 7.70718L404.854 12.8536L404.146 12.1465L409.646 6.64652L410 6.29297Z" fill="black"/>
|
<path id="Union_4" fill-rule="evenodd" clip-rule="evenodd" d="M550 6.29297L550.354 6.64652L555.854 12.1465L555.146 12.8536L550 7.70718L544.854 12.8536L544.146 12.1465L549.646 6.64652L550 6.29297Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="arrow-up_2">
|
<g id="arrow-up_2">
|
||||||
<path id="Union_30" fill-rule="evenodd" clip-rule="evenodd" d="M410 26.293L410.354 26.6465L415.854 32.1465L415.146 32.8536L410 27.7072L404.854 32.8536L404.146 32.1465L409.646 26.6465L410 26.293Z" fill="white"/>
|
<path id="Union_3" fill-rule="evenodd" clip-rule="evenodd" d="M550 26.293L550.354 26.6465L555.854 32.1465L555.146 32.8536L550 27.7072L544.854 32.8536L544.146 32.1465L549.646 26.6465L550 26.293Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="arrow-down">
|
<g id="arrow-down">
|
||||||
<path id="Union_31" fill-rule="evenodd" clip-rule="evenodd" d="M430 13.7071L430.354 13.3536L435.854 7.85359L435.146 7.14648L430 12.2929L424.854 7.14648L424.146 7.85359L429.646 13.3536L430 13.7071Z" fill="black"/>
|
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M570 13.7071L570.354 13.3536L575.854 7.85359L575.146 7.14648L570 12.2929L564.854 7.14648L564.146 7.85359L569.646 13.3536L570 13.7071Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="arrow-down_2">
|
<g id="arrow-down_2">
|
||||||
<path id="Union_32" fill-rule="evenodd" clip-rule="evenodd" d="M430 33.7071L430.354 33.3536L435.854 27.8536L435.146 27.1465L430 32.2929L424.854 27.1465L424.146 27.8536L429.646 33.3536L430 33.7071Z" fill="white"/>
|
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M570 33.7071L570.354 33.3536L575.854 27.8536L575.146 27.1465L570 32.2929L564.854 27.1465L564.146 27.8536L569.646 33.3536L570 33.7071Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 22 KiB |
|
@ -503,7 +503,7 @@
|
||||||
@icon-height: 20px;
|
@icon-height: 20px;
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
background: data-uri('../../../../common/embed/resources/img/icon-menu-sprite.svg') no-repeat;
|
background: data-uri('../../../../common/embed/resources/img/icon-menu-sprite.svg') no-repeat;
|
||||||
background-size: @icon-width*22 @icon-height*2;
|
background-size: @icon-width*29 @icon-height*2;
|
||||||
|
|
||||||
&.download {
|
&.download {
|
||||||
background-position: -@icon-width 0;
|
background-position: -@icon-width 0;
|
||||||
|
@ -561,13 +561,13 @@
|
||||||
background-position: -@icon-width*18 0;
|
background-position: -@icon-width*18 0;
|
||||||
}
|
}
|
||||||
&.search {
|
&.search {
|
||||||
background-position: -@icon-width*19 0;
|
background-position: -@icon-width*24 0;
|
||||||
}
|
}
|
||||||
&.search-arrow-up {
|
&.search-arrow-up {
|
||||||
background-position: -@icon-width*20 0;
|
background-position: -@icon-width*27 0;
|
||||||
}
|
}
|
||||||
&.search-arrow-down {
|
&.search-arrow-down {
|
||||||
background-position: -@icon-width*21 0;
|
background-position: -@icon-width*28 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<svg width="540" height="40" viewBox="0 0 540 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="580" height="40" viewBox="0 0 580 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<g id="icon-menu-sprite Embedded Viewer">
|
<g id="icon-menu-sprite Embedded Viewer">
|
||||||
<g id="view-settings">
|
<g id="view-settings">
|
||||||
<path id="Vector" d="M17 26H3V27H17V26Z" fill="white"/>
|
<path id="Vector" d="M17 26H3V27H17V26Z" fill="white"/>
|
||||||
|
@ -204,5 +204,17 @@
|
||||||
<path id="Subtract_2" fill-rule="evenodd" clip-rule="evenodd" d="M530.948 26.052C530.638 26.0177 530.321 26 530 26C526.91 26 524.243 27.6351 523 30C523.439 30.8356 524.056 31.5801 524.807 32.1935L525.518 31.4821C524.979 31.055 524.519 30.5539 524.158 30C525.311 28.2309 527.473 27 530 27C530 27 530 27 530 27L530.948 26.052ZM530 33C532.527 32.9999 534.689 31.769 535.842 30C535.481 29.4463 535.021 28.9453 534.482 28.5182L535.194 27.8068C535.944 28.4202 536.561 29.1646 537 30C535.757 32.3649 533.09 34 530 34C529.679 34 529.363 33.9824 529.052 33.9481L530 33Z" fill="white"/>
|
<path id="Subtract_2" fill-rule="evenodd" clip-rule="evenodd" d="M530.948 26.052C530.638 26.0177 530.321 26 530 26C526.91 26 524.243 27.6351 523 30C523.439 30.8356 524.056 31.5801 524.807 32.1935L525.518 31.4821C524.979 31.055 524.519 30.5539 524.158 30C525.311 28.2309 527.473 27 530 27C530 27 530 27 530 27L530.948 26.052ZM530 33C532.527 32.9999 534.689 31.769 535.842 30C535.481 29.4463 535.021 28.9453 534.482 28.5182L535.194 27.8068C535.944 28.4202 536.561 29.1646 537 30C535.757 32.3649 533.09 34 530 34C529.679 34 529.363 33.9824 529.052 33.9481L530 33Z" fill="white"/>
|
||||||
<path id="Vector 169_2" d="M525 35L535 25" stroke="white"/>
|
<path id="Vector 169_2" d="M525 35L535 25" stroke="white"/>
|
||||||
</g>
|
</g>
|
||||||
|
<g id="arrow-up">
|
||||||
|
<path id="Union_4" fill-rule="evenodd" clip-rule="evenodd" d="M550 6.29297L550.354 6.64652L555.854 12.1465L555.146 12.8536L550 7.70718L544.854 12.8536L544.146 12.1465L549.646 6.64652L550 6.29297Z" fill="black"/>
|
||||||
|
</g>
|
||||||
|
<g id="arrow-up_2">
|
||||||
|
<path id="Union_3" fill-rule="evenodd" clip-rule="evenodd" d="M550 26.293L550.354 26.6465L555.854 32.1465L555.146 32.8536L550 27.7072L544.854 32.8536L544.146 32.1465L549.646 26.6465L550 26.293Z" fill="white"/>
|
||||||
|
</g>
|
||||||
|
<g id="arrow-down">
|
||||||
|
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M570 13.7071L570.354 13.3536L575.854 7.85359L575.146 7.14648L570 12.2929L564.854 7.14648L564.146 7.85359L569.646 13.3536L570 13.7071Z" fill="black"/>
|
||||||
|
</g>
|
||||||
|
<g id="arrow-down_2">
|
||||||
|
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M570 33.7071L570.354 33.3536L575.854 27.8536L575.146 27.1465L570 32.2929L564.854 27.1465L564.146 27.8536L569.646 33.3536L570 33.7071Z" fill="white"/>
|
||||||
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 20 KiB |
|
@ -81,6 +81,7 @@
|
||||||
@import "../../../../common/main/resources/less/checkbox.less";
|
@import "../../../../common/main/resources/less/checkbox.less";
|
||||||
@import "../../../../common/main/resources/less/opendialog.less";
|
@import "../../../../common/main/resources/less/opendialog.less";
|
||||||
@import "../../../../common/main/resources/less/advanced-settings-window.less";
|
@import "../../../../common/main/resources/less/advanced-settings-window.less";
|
||||||
|
@import "../../../../common/main/resources/less/searchdialog.less";
|
||||||
|
|
||||||
@toolbarBorderColor: @border-toolbar-ie;
|
@toolbarBorderColor: @border-toolbar-ie;
|
||||||
@toolbarBorderColor: @border-toolbar;
|
@toolbarBorderColor: @border-toolbar;
|
||||||
|
@ -439,7 +440,7 @@
|
||||||
|
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
background: data-uri('../../../../common/forms/resources/img/icon-menu-sprite.svg') no-repeat;
|
background: data-uri('../../../../common/forms/resources/img/icon-menu-sprite.svg') no-repeat;
|
||||||
background-size: @icon-width*27 @icon-height*2;
|
background-size: @icon-width*29 @icon-height*2;
|
||||||
|
|
||||||
&.download {
|
&.download {
|
||||||
background-position: -@icon-width 0;
|
background-position: -@icon-width 0;
|
||||||
|
@ -543,6 +544,18 @@
|
||||||
background-position: -@icon-width*26 0;
|
background-position: -@icon-width*26 0;
|
||||||
background-position: -@icon-width*26 @icon-normal-top;
|
background-position: -@icon-width*26 @icon-normal-top;
|
||||||
}
|
}
|
||||||
|
&.search-close {
|
||||||
|
background-position: -@icon-width*18 0;
|
||||||
|
}
|
||||||
|
&.search {
|
||||||
|
background-position: -@icon-width*24 0;
|
||||||
|
}
|
||||||
|
&.search-arrow-up {
|
||||||
|
background-position: -@icon-width*27 0;
|
||||||
|
}
|
||||||
|
&.search-arrow-down {
|
||||||
|
background-position: -@icon-width*28 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
|
@ -682,3 +695,7 @@
|
||||||
.font-size-large {
|
.font-size-large {
|
||||||
.fontsize(@font-size-large);
|
.fontsize(@font-size-large);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-bar {
|
||||||
|
z-index: 50;
|
||||||
|
}
|
|
@ -39,7 +39,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'common/main/lib/component/Window'
|
'common/main/lib/component/Window',
|
||||||
|
'common/main/lib/component/Button'
|
||||||
], function () {
|
], function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -70,6 +71,7 @@ define([
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
this.options.tpl = _.template(this.template)(this.options);
|
this.options.tpl = _.template(this.template)(this.options);
|
||||||
|
this.iconType = this.options.iconType;
|
||||||
|
|
||||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||||
|
|
||||||
|
@ -91,7 +93,7 @@ define([
|
||||||
this.btnBack = new Common.UI.Button({
|
this.btnBack = new Common.UI.Button({
|
||||||
parentEl: $('#search-bar-back'),
|
parentEl: $('#search-bar-back'),
|
||||||
cls: 'btn-toolbar',
|
cls: 'btn-toolbar',
|
||||||
iconCls: 'toolbar__icon btn-arrow-up',
|
iconCls: this.iconType === 'svg' ? 'svg-icon search-arrow-up' : 'toolbar__icon btn-arrow-up',
|
||||||
hint: this.tipPreviousResult
|
hint: this.tipPreviousResult
|
||||||
});
|
});
|
||||||
this.btnBack.on('click', _.bind(this.onBtnNextClick, this, 'back'));
|
this.btnBack.on('click', _.bind(this.onBtnNextClick, this, 'back'));
|
||||||
|
@ -99,7 +101,7 @@ define([
|
||||||
this.btnNext = new Common.UI.Button({
|
this.btnNext = new Common.UI.Button({
|
||||||
parentEl: $('#search-bar-next'),
|
parentEl: $('#search-bar-next'),
|
||||||
cls: 'btn-toolbar',
|
cls: 'btn-toolbar',
|
||||||
iconCls: 'toolbar__icon btn-arrow-down',
|
iconCls: this.iconType === 'svg' ? 'svg-icon search-arrow-down' : 'toolbar__icon btn-arrow-down',
|
||||||
hint: this.tipNextResult
|
hint: this.tipNextResult
|
||||||
});
|
});
|
||||||
this.btnNext.on('click', _.bind(this.onBtnNextClick, this, 'next'));
|
this.btnNext.on('click', _.bind(this.onBtnNextClick, this, 'next'));
|
||||||
|
@ -117,7 +119,7 @@ define([
|
||||||
this.btnClose = new Common.UI.Button({
|
this.btnClose = new Common.UI.Button({
|
||||||
parentEl: $('#search-bar-close'),
|
parentEl: $('#search-bar-close'),
|
||||||
cls: 'btn-toolbar',
|
cls: 'btn-toolbar',
|
||||||
iconCls: 'toolbar__icon btn-close',
|
iconCls: this.iconType === 'svg' ? 'svg-icon search-close' : 'toolbar__icon btn-close',
|
||||||
hint: this.tipCloseSearch
|
hint: this.tipCloseSearch
|
||||||
});
|
});
|
||||||
this.btnClose.on('click', _.bind(function () {
|
this.btnClose.on('click', _.bind(function () {
|
||||||
|
@ -132,7 +134,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
show: function(text) {
|
show: function(text) {
|
||||||
var top = $('#app-title').height() + $('#toolbar').height() + 2,
|
var top = ($('#app-title').length > 0 ? $('#app-title').height() : 0) + $('#toolbar').height() + 2,
|
||||||
left = Common.Utils.innerWidth() - ($('#right-menu').is(':visible') ? $('#right-menu').width() : 0) - this.options.width - 32;
|
left = Common.Utils.innerWidth() - ($('#right-menu').is(':visible') ? $('#right-menu').width() : 0) - this.options.width - 32;
|
||||||
Common.UI.Window.prototype.show.call(this, left, top);
|
Common.UI.Window.prototype.show.call(this, left, top);
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
.search-bar {
|
.search-bar {
|
||||||
z-index: 950;
|
z-index: 950;
|
||||||
.box {
|
.box {
|
||||||
padding: 16px;
|
padding: 15px;
|
||||||
display: flex;
|
display: flex;
|
||||||
input[type=text] {
|
input[type=text] {
|
||||||
width: 192px;
|
width: 192px;
|
||||||
|
|
|
@ -198,7 +198,6 @@
|
||||||
<span id="title-doc-name"></span>
|
<span id="title-doc-name"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="group right">
|
<div class="group right">
|
||||||
<div id="id-search" style="display: inline-block;"><button class="control-btn svg-icon search"></button></div>
|
|
||||||
<div id="id-pages" class="item margin-right-small" style="vertical-align: middle;"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
|
<div id="id-pages" class="item margin-right-small" style="vertical-align: middle;"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
|
||||||
<div id="id-submit-group" style="display: inline-block;"><button id="id-btn-submit" class="control-btn has-caption margin-left-small margin-right-small colored"><span class="caption"></span></button></div>
|
<div id="id-submit-group" style="display: inline-block;"><button id="id-btn-submit" class="control-btn has-caption margin-left-small margin-right-small colored"><span class="caption"></span></button></div>
|
||||||
<div id="box-tools" class="dropdown">
|
<div id="box-tools" class="dropdown">
|
||||||
|
|
|
@ -190,7 +190,6 @@
|
||||||
<span id="title-doc-name"></span>
|
<span id="title-doc-name"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="group right">
|
<div class="group right">
|
||||||
<div id="id-search" style="display: inline-block;"><button class="control-btn svg-icon search"></button></div>
|
|
||||||
<div id="id-pages" class="item margin-right-small" style="vertical-align: middle;"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
|
<div id="id-pages" class="item margin-right-small" style="vertical-align: middle;"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
|
||||||
<div id="id-submit-group" style="display: inline-block;"><button id="id-btn-submit" class="control-btn has-caption margin-right-small margin-left-small colored"><span class="caption"></span></button></div>
|
<div id="id-submit-group" style="display: inline-block;"><button id="id-btn-submit" class="control-btn has-caption margin-right-small margin-left-small colored"><span class="caption"></span></button></div>
|
||||||
<div id="box-tools" class="dropdown">
|
<div id="box-tools" class="dropdown">
|
||||||
|
|
|
@ -401,7 +401,6 @@ DE.ApplicationController = new(function(){
|
||||||
|
|
||||||
if ( permissions.print === false) {
|
if ( permissions.print === false) {
|
||||||
$('#idt-print').hide();
|
$('#idt-print').hide();
|
||||||
$(dividers[0]).hide();
|
|
||||||
itemsCount--;
|
itemsCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,8 +412,6 @@ DE.ApplicationController = new(function(){
|
||||||
if ( !appOptions.canFillForms || permissions.download === false) {
|
if ( !appOptions.canFillForms || permissions.download === false) {
|
||||||
$('#idt-download-docx').hide();
|
$('#idt-download-docx').hide();
|
||||||
$('#idt-download-pdf').hide();
|
$('#idt-download-pdf').hide();
|
||||||
$(dividers[0]).hide();
|
|
||||||
$(dividers[1]).hide();
|
|
||||||
itemsCount -= 2;
|
itemsCount -= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,8 +425,10 @@ DE.ApplicationController = new(function(){
|
||||||
itemsCount--;
|
itemsCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemsCount<3)
|
if (itemsCount < 7) {
|
||||||
$(dividers[2]).hide();
|
$(dividers[0]).hide();
|
||||||
|
$(dividers[1]).hide();
|
||||||
|
}
|
||||||
|
|
||||||
if ( !embedConfig.embedUrl || appOptions.canFillForms) {
|
if ( !embedConfig.embedUrl || appOptions.canFillForms) {
|
||||||
$('#idt-embed').hide();
|
$('#idt-embed').hide();
|
||||||
|
@ -451,10 +450,6 @@ DE.ApplicationController = new(function(){
|
||||||
embed: '#idt-embed'
|
embed: '#idt-embed'
|
||||||
});
|
});
|
||||||
|
|
||||||
common.controller.SearchBar.attach({
|
|
||||||
search: '#id-search'
|
|
||||||
});
|
|
||||||
|
|
||||||
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
|
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
|
||||||
api.asc_registerCallback('asc_onEndAction', onLongActionEnd);
|
api.asc_registerCallback('asc_onEndAction', onLongActionEnd);
|
||||||
api.asc_registerCallback('asc_onMouseMoveStart', onDocMouseMoveStart);
|
api.asc_registerCallback('asc_onMouseMoveStart', onDocMouseMoveStart);
|
||||||
|
@ -524,6 +519,11 @@ DE.ApplicationController = new(function(){
|
||||||
downloadAs(Asc.c_oAscFileType.PDF);
|
downloadAs(Asc.c_oAscFileType.PDF);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
DE.ApplicationView.tools.get('#idt-search')
|
||||||
|
.on('click', function(){
|
||||||
|
common.controller.SearchBar.show();
|
||||||
|
});
|
||||||
|
|
||||||
$('#id-btn-zoom-in').on('click', api.zoomIn.bind(this));
|
$('#id-btn-zoom-in').on('click', api.zoomIn.bind(this));
|
||||||
$('#id-btn-zoom-out').on('click', api.zoomOut.bind(this));
|
$('#id-btn-zoom-out').on('click', api.zoomOut.bind(this));
|
||||||
|
|
||||||
|
|
|
@ -46,11 +46,12 @@ DE.ApplicationView = new(function(){
|
||||||
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
|
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
|
||||||
$btnTools.parent().append(
|
$btnTools.parent().append(
|
||||||
'<ul class="dropdown-menu pull-right">' +
|
'<ul class="dropdown-menu pull-right">' +
|
||||||
'<li><a id="idt-print"><span class="mi-icon svg-icon print"></span>' + this.txtPrint + '</a></li>' +
|
|
||||||
'<li class="divider"></li>' +
|
|
||||||
'<li><a id="idt-download"><span class="mi-icon svg-icon download"></span>' + this.txtDownload + '</a></li>' +
|
'<li><a id="idt-download"><span class="mi-icon svg-icon download"></span>' + this.txtDownload + '</a></li>' +
|
||||||
'<li><a id="idt-download-docx"><span class="mi-icon svg-icon download"></span>' + this.txtDownloadDocx + '</a></li>' +
|
'<li><a id="idt-download-docx"><span class="mi-icon svg-icon download"></span>' + this.txtDownloadDocx + '</a></li>' +
|
||||||
'<li><a id="idt-download-pdf"><span class="mi-icon"></span>' + this.txtDownloadPdf + '</a></li>' +
|
'<li><a id="idt-download-pdf"><span class="mi-icon"></span>' + this.txtDownloadPdf + '</a></li>' +
|
||||||
|
'<li><a id="idt-print"><span class="mi-icon svg-icon print"></span>' + this.txtPrint + '</a></li>' +
|
||||||
|
'<li class="divider"></li>' +
|
||||||
|
'<li><a id="idt-search"><span class="mi-icon svg-icon search"></span>' + this.txtSearch + '</a></li>' +
|
||||||
'<li class="divider"></li>' +
|
'<li class="divider"></li>' +
|
||||||
'<li><a id="idt-share" data-toggle="modal"><span class="mi-icon svg-icon share"></span>' + this.txtShare + '</a></li>' +
|
'<li><a id="idt-share" data-toggle="modal"><span class="mi-icon svg-icon share"></span>' + this.txtShare + '</a></li>' +
|
||||||
'<li><a id="idt-close" data-toggle="modal"><span class="mi-icon svg-icon go-to-location"></span>' + this.txtFileLocation + '</a></li>' +
|
'<li><a id="idt-close" data-toggle="modal"><span class="mi-icon svg-icon go-to-location"></span>' + this.txtFileLocation + '</a></li>' +
|
||||||
|
@ -89,6 +90,7 @@ DE.ApplicationView = new(function(){
|
||||||
txtFullScreen: 'Full Screen',
|
txtFullScreen: 'Full Screen',
|
||||||
txtFileLocation: 'Open file location',
|
txtFileLocation: 'Open file location',
|
||||||
txtDownloadDocx: 'Download as docx',
|
txtDownloadDocx: 'Download as docx',
|
||||||
txtDownloadPdf: 'Download as pdf'
|
txtDownloadPdf: 'Download as pdf',
|
||||||
|
txtSearch: 'Search'
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
|
|
||||||
common.controller.SearchBar = new(function() {
|
common.controller.SearchBar = new(function() {
|
||||||
var $searchBar,
|
var $searchBar,
|
||||||
$searchBtn,
|
|
||||||
$searchInput,
|
$searchInput,
|
||||||
appConfig,
|
appConfig,
|
||||||
api,
|
api,
|
||||||
|
@ -86,34 +85,27 @@
|
||||||
$searchBar.find('#search-bar-close').on('click', function(e){
|
$searchBar.find('#search-bar-close').on('click', function(e){
|
||||||
highlightResults(false);
|
highlightResults(false);
|
||||||
$searchBar.hide();
|
$searchBar.hide();
|
||||||
$searchBtn.find('button').button('toggle');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
common.view.SearchBar.disableNavButtons();
|
common.view.SearchBar.disableNavButtons();
|
||||||
};
|
};
|
||||||
|
|
||||||
var attachToView = function(config) {
|
var onShow = function () {
|
||||||
if ( !$searchBar ) {
|
if ( !$searchBar ) {
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
if (!$searchBar.is(':visible')) {
|
||||||
$searchBtn = $(config.search);
|
|
||||||
$searchBtn.on('click', function(e){
|
|
||||||
if ($searchBar.is(':visible')) {
|
|
||||||
highlightResults(false);
|
|
||||||
$searchBar.hide();
|
|
||||||
} else {
|
|
||||||
highlightResults(true);
|
highlightResults(true);
|
||||||
var text = (api && api.asc_GetSelectedText()) || _state.searchText;
|
var text = (api && api.asc_GetSelectedText()) || _state.searchText;
|
||||||
$searchInput.val(text);
|
$searchInput.val(text);
|
||||||
(text.length > 0) && onInputSearchChange(text);
|
(text.length > 0) && onInputSearchChange(text);
|
||||||
|
|
||||||
$searchBar.show();
|
$searchBar.show();
|
||||||
|
setTimeout(function () {
|
||||||
$searchInput.focus();
|
$searchInput.focus();
|
||||||
$searchInput.select();
|
$searchInput.select();
|
||||||
|
}, 10);
|
||||||
}
|
}
|
||||||
$searchBtn.find('button').button('toggle');
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var onInputSearchChange = function (text) {
|
var onInputSearchChange = function (text) {
|
||||||
|
@ -168,8 +160,8 @@
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init: function(config) { appConfig = config; },
|
init: function(config) { appConfig = config; },
|
||||||
attach: attachToView,
|
setApi: setApi,
|
||||||
setApi: setApi
|
show: onShow
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}();
|
}();
|
|
@ -47,5 +47,6 @@
|
||||||
"DE.ApplicationView.txtFileLocation": "Open file location",
|
"DE.ApplicationView.txtFileLocation": "Open file location",
|
||||||
"DE.ApplicationView.txtFullScreen": "Full Screen",
|
"DE.ApplicationView.txtFullScreen": "Full Screen",
|
||||||
"DE.ApplicationView.txtPrint": "Print",
|
"DE.ApplicationView.txtPrint": "Print",
|
||||||
"DE.ApplicationView.txtShare": "Share"
|
"DE.ApplicationView.txtShare": "Share",
|
||||||
|
"DE.ApplicationView.txtSearch": "Search"
|
||||||
}
|
}
|
|
@ -140,7 +140,8 @@ require([
|
||||||
autoCreate: false,
|
autoCreate: false,
|
||||||
controllers : [
|
controllers : [
|
||||||
'ApplicationController',
|
'ApplicationController',
|
||||||
'Plugins'
|
'Plugins',
|
||||||
|
'SearchBar'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -149,11 +150,13 @@ require([
|
||||||
require([
|
require([
|
||||||
'documenteditor/forms/app/controller/ApplicationController',
|
'documenteditor/forms/app/controller/ApplicationController',
|
||||||
'documenteditor/forms/app/controller/Plugins',
|
'documenteditor/forms/app/controller/Plugins',
|
||||||
|
'documenteditor/forms/app/controller/SearchBar',
|
||||||
'documenteditor/forms/app/view/ApplicationView',
|
'documenteditor/forms/app/view/ApplicationView',
|
||||||
'common/main/lib/util/utils',
|
'common/main/lib/util/utils',
|
||||||
'common/main/lib/util/LocalStorage',
|
'common/main/lib/util/LocalStorage',
|
||||||
'common/main/lib/controller/Themes',
|
'common/main/lib/controller/Themes',
|
||||||
'common/main/lib/view/PluginDlg',
|
'common/main/lib/view/PluginDlg',
|
||||||
|
'common/main/lib/view/SearchBar',
|
||||||
'common/forms/lib/view/modals'
|
'common/forms/lib/view/modals'
|
||||||
], function() {
|
], function() {
|
||||||
app.start();
|
app.start();
|
||||||
|
|
|
@ -1348,6 +1348,7 @@ define([
|
||||||
Common.NotificationCenter.on('storage:image-insert', _.bind(this.insertImageFromStorage, this)); // set loaded image to control
|
Common.NotificationCenter.on('storage:image-insert', _.bind(this.insertImageFromStorage, this)); // set loaded image to control
|
||||||
}
|
}
|
||||||
DE.getController('Plugins').setApi(this.api);
|
DE.getController('Plugins').setApi(this.api);
|
||||||
|
DE.getController('SearchBar').setApi(this.api);
|
||||||
|
|
||||||
this.updateWindowTitle(true);
|
this.updateWindowTitle(true);
|
||||||
|
|
||||||
|
@ -1414,6 +1415,9 @@ define([
|
||||||
embedConfig: this.embedConfig
|
embedConfig: this.embedConfig
|
||||||
})).show();
|
})).show();
|
||||||
break;
|
break;
|
||||||
|
case 'search':
|
||||||
|
Common.NotificationCenter.trigger('search:show');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1477,51 +1481,46 @@ define([
|
||||||
menuItems = this.view.btnOptions.menu.items,
|
menuItems = this.view.btnOptions.menu.items,
|
||||||
itemsCount = menuItems.length-4;
|
itemsCount = menuItems.length-4;
|
||||||
var initMenu = function(menu) {
|
var initMenu = function(menu) {
|
||||||
var last;
|
var last; // divider item
|
||||||
// print
|
|
||||||
if (!menuItems[0].isVisible())
|
|
||||||
menuItems[1].setVisible(false);
|
|
||||||
else
|
|
||||||
last = menuItems[1];
|
|
||||||
|
|
||||||
// download
|
// download and print
|
||||||
if (!menuItems[2].isVisible() && !menuItems[3].isVisible() && !menuItems[4].isVisible())
|
if (!menuItems[0].isVisible() && !menuItems[1].isVisible() && !menuItems[2].isVisible() && !menuItems[3].isVisible())
|
||||||
menuItems[5].setVisible(false);
|
menuItems[4].setVisible(false);
|
||||||
else
|
else
|
||||||
last = menuItems[5];
|
last = menuItems[4];
|
||||||
|
|
||||||
// theme and zoom
|
// theme and zoom
|
||||||
if (!menuItems[6].isVisible() && !menuItems[7].isVisible())
|
if (!menuItems[7].isVisible() && !menuItems[8].isVisible())
|
||||||
menuItems[8].setVisible(false);
|
menuItems[9].setVisible(false);
|
||||||
else
|
else
|
||||||
last = menuItems[8];
|
last = menuItems[9];
|
||||||
|
|
||||||
// share, location
|
// share, location
|
||||||
if (!menuItems[9].isVisible() && !menuItems[10].isVisible())
|
if (!menuItems[10].isVisible() && !menuItems[11].isVisible())
|
||||||
menuItems[11].setVisible(false);
|
menuItems[12].setVisible(false);
|
||||||
else
|
else
|
||||||
last = menuItems[11];
|
last = menuItems[12];
|
||||||
|
|
||||||
// embed, fullscreen
|
// embed, fullscreen
|
||||||
if (!menuItems[12].isVisible() && !menuItems[13].isVisible())
|
if (!menuItems[13].isVisible() && !menuItems[14].isVisible())
|
||||||
last && last.setVisible(false);
|
last && last.setVisible(false);
|
||||||
|
|
||||||
menu.off('show:after', initMenu);
|
menu.off('show:after', initMenu);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!this.appOptions.canPrint) {
|
if (!this.appOptions.canPrint) {
|
||||||
menuItems[0].setVisible(false);
|
menuItems[3].setVisible(false);
|
||||||
itemsCount--;
|
itemsCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !this.embedConfig.saveUrl || !this.appOptions.canDownload || this.appOptions.isOFORM) {
|
if ( !this.embedConfig.saveUrl || !this.appOptions.canDownload || this.appOptions.isOFORM) {
|
||||||
menuItems[2].setVisible(false);
|
menuItems[0].setVisible(false);
|
||||||
itemsCount--;
|
itemsCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !this.appOptions.isOFORM || !this.appOptions.canDownload || this.appOptions.isOffline) {
|
if ( !this.appOptions.isOFORM || !this.appOptions.canDownload || this.appOptions.isOffline) {
|
||||||
menuItems[3].setVisible(false);
|
menuItems[1].setVisible(false);
|
||||||
menuItems[4].setVisible(false);
|
menuItems[2].setVisible(false);
|
||||||
itemsCount -= 2;
|
itemsCount -= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1538,7 +1537,7 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.view.mnuThemes.items.length<1) {
|
if (this.view.mnuThemes.items.length<1) {
|
||||||
menuItems[6].setVisible(false);
|
menuItems[7].setVisible(false);
|
||||||
itemsCount--;
|
itemsCount--;
|
||||||
} else {
|
} else {
|
||||||
this.view.menuItemsDarkMode = new Common.UI.MenuItem({
|
this.view.menuItemsDarkMode = new Common.UI.MenuItem({
|
||||||
|
@ -1556,22 +1555,22 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !this.embedConfig.shareUrl || this.appOptions.isOFORM) {
|
if ( !this.embedConfig.shareUrl || this.appOptions.isOFORM) {
|
||||||
menuItems[9].setVisible(false);
|
|
||||||
itemsCount--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.appOptions.canBackToFolder) {
|
|
||||||
menuItems[10].setVisible(false);
|
menuItems[10].setVisible(false);
|
||||||
itemsCount--;
|
itemsCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.appOptions.canBackToFolder) {
|
||||||
|
menuItems[11].setVisible(false);
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !this.embedConfig.embedUrl || this.appOptions.isOFORM) {
|
if ( !this.embedConfig.embedUrl || this.appOptions.isOFORM) {
|
||||||
menuItems[12].setVisible(false);
|
menuItems[13].setVisible(false);
|
||||||
itemsCount--;
|
itemsCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !this.embedConfig.fullscreenUrl || this.appOptions.isOFORM) {
|
if ( !this.embedConfig.fullscreenUrl || this.appOptions.isOFORM) {
|
||||||
menuItems[13].setVisible(false);
|
menuItems[14].setVisible(false);
|
||||||
itemsCount--;
|
itemsCount--;
|
||||||
}
|
}
|
||||||
if (itemsCount<1)
|
if (itemsCount<1)
|
||||||
|
@ -1824,10 +1823,10 @@ define([
|
||||||
this.view && this.view.btnDownload.setDisabled(true);
|
this.view && this.view.btnDownload.setDisabled(true);
|
||||||
this.view && this.view.btnSubmit.setDisabled(true);
|
this.view && this.view.btnSubmit.setDisabled(true);
|
||||||
if (this.view && this.view.btnOptions && this.view.btnOptions.menu) {
|
if (this.view && this.view.btnOptions && this.view.btnOptions.menu) {
|
||||||
this.view.btnOptions.menu.items[0].setDisabled(true); // print
|
this.view.btnOptions.menu.items[3].setDisabled(true); // print
|
||||||
this.view.btnOptions.menu.items[2].setDisabled(true); // download
|
this.view.btnOptions.menu.items[0].setDisabled(true); // download
|
||||||
this.view.btnOptions.menu.items[3].setDisabled(true); // download docx
|
this.view.btnOptions.menu.items[1].setDisabled(true); // download docx
|
||||||
this.view.btnOptions.menu.items[4].setDisabled(true); // download pdf
|
this.view.btnOptions.menu.items[2].setDisabled(true); // download pdf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
148
apps/documenteditor/forms/app/controller/SearchBar.js
Normal file
148
apps/documenteditor/forms/app/controller/SearchBar.js
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* (c) Copyright Ascensio System SIA 2010-2020
|
||||||
|
*
|
||||||
|
* This program is a free software product. You can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||||
|
* version 3 as published by the Free Software Foundation. In accordance with
|
||||||
|
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||||
|
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||||
|
* of any third-party rights.
|
||||||
|
*
|
||||||
|
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||||
|
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||||
|
*
|
||||||
|
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||||
|
* street, Riga, Latvia, EU, LV-1050.
|
||||||
|
*
|
||||||
|
* The interactive user interfaces in modified source and object code versions
|
||||||
|
* of the Program must display Appropriate Legal Notices, as required under
|
||||||
|
* Section 5 of the GNU AGPL version 3.
|
||||||
|
*
|
||||||
|
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||||
|
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||||
|
* grant you any rights under trademark law for use of our trademarks.
|
||||||
|
*
|
||||||
|
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||||
|
* well as technical writing content are licensed under the terms of the
|
||||||
|
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||||
|
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SearchBar.js
|
||||||
|
*
|
||||||
|
* Created by Julia Svinareva on 3.06.2022
|
||||||
|
* Copyright (c) 2022 Ascensio System SIA. All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
define([
|
||||||
|
'core',
|
||||||
|
'common/main/lib/view/SearchBar'
|
||||||
|
], function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
DE.Controllers.SearchBar = Backbone.Controller.extend(_.extend({
|
||||||
|
initialize: function() {
|
||||||
|
},
|
||||||
|
|
||||||
|
events: function() {
|
||||||
|
},
|
||||||
|
|
||||||
|
onLaunch: function() {
|
||||||
|
this._state = {
|
||||||
|
searchText: ''
|
||||||
|
};
|
||||||
|
Common.NotificationCenter.on('search:show', _.bind(this.onSearchShow, this));
|
||||||
|
},
|
||||||
|
|
||||||
|
setApi: function (api) {
|
||||||
|
this.api = api;
|
||||||
|
if (this.api) {
|
||||||
|
this.api.asc_registerCallback('asc_onSetSearchCurrent', _.bind(this.onApiUpdateSearchCurrent, this));
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
onSearchShow: function () {
|
||||||
|
if (!this.searchBar) {
|
||||||
|
this.searchBar = new Common.UI.SearchBar({
|
||||||
|
showOpenPanel: false,
|
||||||
|
width: 303,
|
||||||
|
iconType: 'svg',
|
||||||
|
});
|
||||||
|
this.searchBar.on({
|
||||||
|
'search:back': _.bind(this.onSearchNext, this, 'back'),
|
||||||
|
'search:next': _.bind(this.onSearchNext, this, 'next'),
|
||||||
|
'search:input': _.bind(this.onInputSearchChange, this),
|
||||||
|
'search:keydown': _.bind(this.onSearchNext, this, 'keydown'),
|
||||||
|
'show': _.bind(this.onSelectSearchingResults, this, true),
|
||||||
|
'hide': _.bind(this.onSelectSearchingResults, this, false)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!this.searchBar.isVisible()) {
|
||||||
|
this.searchBar.show(this.api.asc_GetSelectedText() || this._state.searchText);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onSelectSearchingResults: function (val) {
|
||||||
|
if (this._state.isHighlightedResults !== val) {
|
||||||
|
this.api.asc_selectSearchingResults(val);
|
||||||
|
this._state.isHighlightedResults = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onApiUpdateSearchCurrent: function (current, all) {
|
||||||
|
this.searchBar && this.searchBar.disableNavButtons(current, all);
|
||||||
|
},
|
||||||
|
|
||||||
|
onSearchNext: function (type, arg) {
|
||||||
|
var text = arg[0],
|
||||||
|
event = arg[1];
|
||||||
|
if (text && text.length > 0 && (type === 'keydown' && event.keyCode === 13 || type !== 'keydown')) {
|
||||||
|
this._state.searchText = text;
|
||||||
|
if (this.onQuerySearch(type) && this._searchTimer) {
|
||||||
|
if (this._searchTimer) {
|
||||||
|
clearInterval(this._searchTimer);
|
||||||
|
this._searchTimer = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onQuerySearch: function (d, w) {
|
||||||
|
var searchSettings = new AscCommon.CSearchSettings();
|
||||||
|
searchSettings.put_Text(this._state.searchText);
|
||||||
|
searchSettings.put_MatchCase(false);
|
||||||
|
searchSettings.put_WholeWords(false);
|
||||||
|
if (!this.api.asc_findText(searchSettings, d != 'back')) {
|
||||||
|
this.searchBar.disableNavButtons();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
onInputSearchChange: function (text) {
|
||||||
|
var text = text[0];
|
||||||
|
if (this._state.searchText !== text) {
|
||||||
|
this._state.newSearchText = text;
|
||||||
|
this._lastInputChange = (new Date());
|
||||||
|
if (this._searchTimer === undefined) {
|
||||||
|
var me = this;
|
||||||
|
this._searchTimer = setInterval(function() {
|
||||||
|
if ((new Date()) - me._lastInputChange < 400) return;
|
||||||
|
|
||||||
|
me._state.searchText = me._state.newSearchText;
|
||||||
|
(me._state.newSearchText !== '') && me.onQuerySearch();
|
||||||
|
clearInterval(me._searchTimer);
|
||||||
|
me._searchTimer = undefined;
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
}, DE.Controllers.SearchBar || {}));
|
||||||
|
});
|
|
@ -18,11 +18,12 @@ define([
|
||||||
menu: new Common.UI.Menu({
|
menu: new Common.UI.Menu({
|
||||||
cls: 'shifted-right',
|
cls: 'shifted-right',
|
||||||
items: [
|
items: [
|
||||||
{caption: this.txtPrint, value: 'print', iconCls: 'mi-icon svg-icon print'},
|
|
||||||
{caption: '--'},
|
|
||||||
{caption: this.txtDownload, value: 'download', iconCls: 'mi-icon svg-icon download'},
|
{caption: this.txtDownload, value: 'download', iconCls: 'mi-icon svg-icon download'},
|
||||||
{caption: this.txtDownloadDocx, value: 'download-docx', iconCls: 'mi-icon svg-icon download'},
|
{caption: this.txtDownloadDocx, value: 'download-docx', iconCls: 'mi-icon svg-icon download'},
|
||||||
{caption: this.txtDownloadPdf, value: 'download-pdf', iconCls: 'mi-icon'},
|
{caption: this.txtDownloadPdf, value: 'download-pdf', iconCls: 'mi-icon'},
|
||||||
|
{caption: this.txtPrint, value: 'print', iconCls: 'mi-icon svg-icon print'},
|
||||||
|
{caption: '--'},
|
||||||
|
{caption: this.txtSearch, value: 'search', iconCls: 'mi-icon svg-icon search'},
|
||||||
{caption: '--'},
|
{caption: '--'},
|
||||||
{caption: this.txtTheme, value: 'theme', iconCls: 'mi-icon',
|
{caption: this.txtTheme, value: 'theme', iconCls: 'mi-icon',
|
||||||
menu : this.mnuThemes = new Common.UI.Menu({
|
menu : this.mnuThemes = new Common.UI.Menu({
|
||||||
|
@ -148,7 +149,8 @@ define([
|
||||||
textRedo: 'Redo',
|
textRedo: 'Redo',
|
||||||
textZoom: 'Zoom',
|
textZoom: 'Zoom',
|
||||||
textFitToPage: 'Fit to Page',
|
textFitToPage: 'Fit to Page',
|
||||||
textFitToWidth: 'Fit to Width'
|
textFitToWidth: 'Fit to Width',
|
||||||
|
txtSearch: 'Search'
|
||||||
|
|
||||||
}, DE.Views.ApplicationView || {}));
|
}, DE.Views.ApplicationView || {}));
|
||||||
});
|
});
|
|
@ -130,7 +130,8 @@ require([
|
||||||
autoCreate: false,
|
autoCreate: false,
|
||||||
controllers : [
|
controllers : [
|
||||||
'ApplicationController',
|
'ApplicationController',
|
||||||
'Plugins'
|
'Plugins',
|
||||||
|
'SearchBar'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -139,11 +140,13 @@ require([
|
||||||
require([
|
require([
|
||||||
'documenteditor/forms/app/controller/ApplicationController',
|
'documenteditor/forms/app/controller/ApplicationController',
|
||||||
'documenteditor/forms/app/controller/Plugins',
|
'documenteditor/forms/app/controller/Plugins',
|
||||||
|
'documenteditor/forms/app/controller/SearchBar',
|
||||||
'documenteditor/forms/app/view/ApplicationView',
|
'documenteditor/forms/app/view/ApplicationView',
|
||||||
'common/main/lib/util/utils',
|
'common/main/lib/util/utils',
|
||||||
'common/main/lib/util/LocalStorage',
|
'common/main/lib/util/LocalStorage',
|
||||||
'common/main/lib/controller/Themes',
|
'common/main/lib/controller/Themes',
|
||||||
'common/main/lib/view/PluginDlg',
|
'common/main/lib/view/PluginDlg',
|
||||||
|
'common/main/lib/view/SearchBar',
|
||||||
'common/forms/lib/view/modals'
|
'common/forms/lib/view/modals'
|
||||||
], function() {
|
], function() {
|
||||||
window.compareVersions = true;
|
window.compareVersions = true;
|
||||||
|
|
|
@ -45,6 +45,10 @@
|
||||||
"Common.UI.Window.textInformation": "Information",
|
"Common.UI.Window.textInformation": "Information",
|
||||||
"Common.UI.Window.textWarning": "Warning",
|
"Common.UI.Window.textWarning": "Warning",
|
||||||
"Common.UI.Window.yesButtonText": "Yes",
|
"Common.UI.Window.yesButtonText": "Yes",
|
||||||
|
"Common.UI.SearchBar.textFind": "Find",
|
||||||
|
"Common.UI.SearchBar.tipPreviousResult": "Previous result",
|
||||||
|
"Common.UI.SearchBar.tipNextResult": "Next result",
|
||||||
|
"Common.UI.SearchBar.tipCloseSearch": "Close search",
|
||||||
"Common.Views.CopyWarningDialog.textDontShow": "Don't show this message again",
|
"Common.Views.CopyWarningDialog.textDontShow": "Don't show this message again",
|
||||||
"Common.Views.CopyWarningDialog.textMsg": "Copy, cut and paste actions using context menu actions will be performed within this editor tab only.<br><br>To copy or paste to or from applications outside the editor tab use the following keyboard combinations:",
|
"Common.Views.CopyWarningDialog.textMsg": "Copy, cut and paste actions using context menu actions will be performed within this editor tab only.<br><br>To copy or paste to or from applications outside the editor tab use the following keyboard combinations:",
|
||||||
"Common.Views.CopyWarningDialog.textTitle": "Copy, Cut and Paste Actions",
|
"Common.Views.CopyWarningDialog.textTitle": "Copy, Cut and Paste Actions",
|
||||||
|
@ -167,5 +171,6 @@
|
||||||
"DE.Views.ApplicationView.txtFullScreen": "Full Screen",
|
"DE.Views.ApplicationView.txtFullScreen": "Full Screen",
|
||||||
"DE.Views.ApplicationView.txtPrint": "Print",
|
"DE.Views.ApplicationView.txtPrint": "Print",
|
||||||
"DE.Views.ApplicationView.txtShare": "Share",
|
"DE.Views.ApplicationView.txtShare": "Share",
|
||||||
"DE.Views.ApplicationView.txtTheme": "Interface theme"
|
"DE.Views.ApplicationView.txtTheme": "Interface theme",
|
||||||
|
"DE.Views.ApplicationView.txtSearch": "Search"
|
||||||
}
|
}
|
|
@ -250,7 +250,6 @@
|
||||||
<span id="title-doc-name"></span>
|
<span id="title-doc-name"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="group right">
|
<div class="group right">
|
||||||
<!--<div id="id-search" style="display: inline-block;"><button class="control-btn svg-icon search"></button></div>-->
|
|
||||||
<div class="item margin-right-small"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
|
<div class="item margin-right-small"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
|
||||||
<div id="box-tools" class="dropdown">
|
<div id="box-tools" class="dropdown">
|
||||||
<button class="control-btn svg-icon more-vertical"></button>
|
<button class="control-btn svg-icon more-vertical"></button>
|
||||||
|
|
|
@ -244,7 +244,6 @@
|
||||||
<span id="title-doc-name"></span>
|
<span id="title-doc-name"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="group right">
|
<div class="group right">
|
||||||
<!--<div id="id-search" style="display: inline-block;"><button class="control-btn svg-icon search"></button></div>-->
|
|
||||||
<div class="item margin-right-small"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
|
<div class="item margin-right-small"><input id="page-number" class="form-control input-xs masked" type="text" value="0"><span class="text" id="pages" tabindex="-1">of 0</span></div>
|
||||||
<div id="box-tools" class="dropdown">
|
<div id="box-tools" class="dropdown">
|
||||||
<button class="control-btn svg-icon more-vertical"></button>
|
<button class="control-btn svg-icon more-vertical"></button>
|
||||||
|
|
|
@ -265,38 +265,57 @@ PE.ApplicationController = new(function(){
|
||||||
var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -1);
|
var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -1);
|
||||||
(zf == -1) ? api.zoomFitToPage() : ((zf == -2) ? api.zoomFitToWidth() : api.zoom(zf>0 ? zf : 100));
|
(zf == -1) ? api.zoomFitToPage() : ((zf == -2) ? api.zoomFitToWidth() : api.zoom(zf>0 ? zf : 100));
|
||||||
|
|
||||||
if ( permissions.print === false)
|
var dividers = $('#box-tools .divider');
|
||||||
|
var itemsCount = $('#box-tools a').length;
|
||||||
|
|
||||||
|
$('#idt-search').hide(); // TO DO: remove when search will be ready
|
||||||
|
itemsCount--;
|
||||||
|
|
||||||
|
if ( permissions.print === false) {
|
||||||
$('#idt-print').hide();
|
$('#idt-print').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if (!embedConfig.saveUrl || permissions.download === false)
|
if (!embedConfig.saveUrl || permissions.download === false) {
|
||||||
$('#idt-download').hide();
|
$('#idt-download').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !embedConfig.shareUrl )
|
if ( !embedConfig.shareUrl ) {
|
||||||
$('#idt-share').hide();
|
$('#idt-share').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if (!config.canBackToFolder)
|
if (!config.canBackToFolder) {
|
||||||
$('#idt-close').hide();
|
$('#idt-close').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !embedConfig.embedUrl )
|
if (itemsCount < 7) {
|
||||||
|
$(dividers[0]).hide();
|
||||||
|
$(dividers[1]).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !embedConfig.embedUrl ) {
|
||||||
$('#idt-embed').hide();
|
$('#idt-embed').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !embedConfig.fullscreenUrl )
|
if ( !embedConfig.fullscreenUrl ) {
|
||||||
$('#idt-fullscreen').hide();
|
$('#idt-fullscreen').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if ( (!embedConfig.saveUrl || permissions.download === false) && permissions.print === false && !embedConfig.shareUrl && !embedConfig.embedUrl && !embedConfig.fullscreenUrl && !config.canBackToFolder)
|
if (itemsCount < 1)
|
||||||
$('#box-tools').addClass('hidden');
|
$('#box-tools').addClass('hidden');
|
||||||
else if (!embedConfig.embedUrl && !embedConfig.fullscreenUrl)
|
else if (!embedConfig.embedUrl && !embedConfig.fullscreenUrl)
|
||||||
$('#box-tools .divider').hide();
|
$(dividers[2]).hide();
|
||||||
|
|
||||||
common.controller.modals.attach({
|
common.controller.modals.attach({
|
||||||
share: '#idt-share',
|
share: '#idt-share',
|
||||||
embed: '#idt-embed'
|
embed: '#idt-embed'
|
||||||
});
|
});
|
||||||
|
|
||||||
common.controller.SearchBar.attach({
|
|
||||||
search: '#id-search'
|
|
||||||
});
|
|
||||||
|
|
||||||
api.asc_registerCallback('asc_onMouseMoveStart', onDocMouseMoveStart);
|
api.asc_registerCallback('asc_onMouseMoveStart', onDocMouseMoveStart);
|
||||||
api.asc_registerCallback('asc_onMouseMoveEnd', onDocMouseMoveEnd);
|
api.asc_registerCallback('asc_onMouseMoveEnd', onDocMouseMoveEnd);
|
||||||
api.asc_registerCallback('asc_onMouseMove', onDocMouseMove);
|
api.asc_registerCallback('asc_onMouseMove', onDocMouseMove);
|
||||||
|
@ -350,6 +369,11 @@ PE.ApplicationController = new(function(){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
PE.ApplicationView.tools.get('#idt-search')
|
||||||
|
.on('click', function(){
|
||||||
|
common.controller.SearchBar.show();
|
||||||
|
});
|
||||||
|
|
||||||
var $pagenum = $('#page-number');
|
var $pagenum = $('#page-number');
|
||||||
$pagenum.on({
|
$pagenum.on({
|
||||||
'keyup': function(e){
|
'keyup': function(e){
|
||||||
|
|
|
@ -45,8 +45,11 @@ PE.ApplicationView = new(function(){
|
||||||
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
|
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
|
||||||
$btnTools.parent().append(
|
$btnTools.parent().append(
|
||||||
'<ul class="dropdown-menu pull-right">' +
|
'<ul class="dropdown-menu pull-right">' +
|
||||||
'<li><a id="idt-print"><span class="mi-icon svg-icon print"></span>' + this.txtPrint + '</a></li>' +
|
|
||||||
'<li><a id="idt-download"><span class="mi-icon svg-icon download"></span>' + this.txtDownload + '</a></li>' +
|
'<li><a id="idt-download"><span class="mi-icon svg-icon download"></span>' + this.txtDownload + '</a></li>' +
|
||||||
|
'<li><a id="idt-print"><span class="mi-icon svg-icon print"></span>' + this.txtPrint + '</a></li>' +
|
||||||
|
'<li class="divider"></li>' +
|
||||||
|
'<li><a id="idt-search"><span class="mi-icon svg-icon search"></span>' + this.txtSearch + '</a></li>' +
|
||||||
|
'<li class="divider"></li>' +
|
||||||
'<li><a id="idt-share" data-toggle="modal"><span class="mi-icon svg-icon share"></span>' + this.txtShare + '</a></li>' +
|
'<li><a id="idt-share" data-toggle="modal"><span class="mi-icon svg-icon share"></span>' + this.txtShare + '</a></li>' +
|
||||||
'<li><a id="idt-close" data-toggle="modal"><span class="mi-icon svg-icon go-to-location"></span>' + this.txtFileLocation + '</a></li>' +
|
'<li><a id="idt-close" data-toggle="modal"><span class="mi-icon svg-icon go-to-location"></span>' + this.txtFileLocation + '</a></li>' +
|
||||||
'<li class="divider"></li>' +
|
'<li class="divider"></li>' +
|
||||||
|
@ -70,6 +73,7 @@ PE.ApplicationView = new(function(){
|
||||||
txtShare: 'Share',
|
txtShare: 'Share',
|
||||||
txtEmbed: 'Embed',
|
txtEmbed: 'Embed',
|
||||||
txtFullScreen: 'Full Screen',
|
txtFullScreen: 'Full Screen',
|
||||||
txtFileLocation: 'Open file location'
|
txtFileLocation: 'Open file location',
|
||||||
|
txtSearch: 'Search'
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
|
|
||||||
common.controller.SearchBar = new(function() {
|
common.controller.SearchBar = new(function() {
|
||||||
var $searchBar,
|
var $searchBar,
|
||||||
$searchBtn,
|
|
||||||
$searchInput,
|
$searchInput,
|
||||||
appConfig,
|
appConfig,
|
||||||
api,
|
api,
|
||||||
|
@ -85,32 +84,26 @@
|
||||||
});
|
});
|
||||||
$searchBar.find('#search-bar-close').on('click', function(e){
|
$searchBar.find('#search-bar-close').on('click', function(e){
|
||||||
$searchBar.hide();
|
$searchBar.hide();
|
||||||
$searchBtn.find('button').button('toggle');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
common.view.SearchBar.disableNavButtons();
|
common.view.SearchBar.disableNavButtons();
|
||||||
};
|
};
|
||||||
|
|
||||||
var attachToView = function(config) {
|
var onShow = function () {
|
||||||
if ( !$searchBar ) {
|
if ( !$searchBar ) {
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
if (!$searchBar.is(':visible')) {
|
||||||
$searchBtn = $(config.search);
|
|
||||||
$searchBtn.on('click', function(e){
|
|
||||||
if ($searchBar.is(':visible')) {
|
|
||||||
$searchBar.hide();
|
|
||||||
} else {
|
|
||||||
var text = (api && api.asc_GetSelectedText()) || _state.searchText;
|
var text = (api && api.asc_GetSelectedText()) || _state.searchText;
|
||||||
$searchInput.val(text);
|
$searchInput.val(text);
|
||||||
(text.length > 0) && onInputSearchChange(text);
|
(text.length > 0) && onInputSearchChange(text);
|
||||||
|
|
||||||
$searchBar.show();
|
$searchBar.show();
|
||||||
|
setTimeout(function () {
|
||||||
$searchInput.focus();
|
$searchInput.focus();
|
||||||
$searchInput.select();
|
$searchInput.select();
|
||||||
|
}, 10);
|
||||||
}
|
}
|
||||||
$searchBtn.find('button').button('toggle');
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var onInputSearchChange = function (text) {
|
var onInputSearchChange = function (text) {
|
||||||
|
@ -158,8 +151,8 @@
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init: function(config) { appConfig = config; },
|
init: function(config) { appConfig = config; },
|
||||||
attach: attachToView,
|
setApi: setApi,
|
||||||
setApi: setApi
|
show: onShow
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}();
|
}();
|
|
@ -35,5 +35,6 @@
|
||||||
"PE.ApplicationView.txtFileLocation": "Open file location",
|
"PE.ApplicationView.txtFileLocation": "Open file location",
|
||||||
"PE.ApplicationView.txtFullScreen": "Full Screen",
|
"PE.ApplicationView.txtFullScreen": "Full Screen",
|
||||||
"PE.ApplicationView.txtPrint": "Print",
|
"PE.ApplicationView.txtPrint": "Print",
|
||||||
"PE.ApplicationView.txtShare": "Share"
|
"PE.ApplicationView.txtShare": "Share",
|
||||||
|
"PE.ApplicationView.txtSearch": "Search"
|
||||||
}
|
}
|
|
@ -145,7 +145,7 @@
|
||||||
|
|
||||||
<!-- debug begin -->
|
<!-- debug begin -->
|
||||||
<script type="text/javascript">var less=less||{};less.env='development';</script>
|
<script type="text/javascript">var less=less||{};less.env='development';</script>
|
||||||
<script src="../../../vendor/less/dist/less-2.7.1.js" type="text/javascript"></script>
|
<script src="../../../vendor/less/dist/less.js" type="text/javascript"></script>
|
||||||
<!-- debug end -->
|
<!-- debug end -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -224,7 +224,6 @@
|
||||||
<span id="title-doc-name"></span>
|
<span id="title-doc-name"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="group right">
|
<div class="group right">
|
||||||
<div id="id-search" style="display: inline-block;"><button class="control-btn svg-icon search"></button></div>
|
|
||||||
<div id="box-tools" class="dropdown">
|
<div id="box-tools" class="dropdown">
|
||||||
<button class="control-btn svg-icon more-vertical"></button>
|
<button class="control-btn svg-icon more-vertical"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -216,7 +216,6 @@
|
||||||
<span id="title-doc-name"></span>
|
<span id="title-doc-name"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="group right">
|
<div class="group right">
|
||||||
<div id="id-search" style="display: inline-block;"><button class="control-btn svg-icon search"></button></div>
|
|
||||||
<div id="box-tools" class="dropdown">
|
<div id="box-tools" class="dropdown">
|
||||||
<button class="control-btn svg-icon more-vertical"></button>
|
<button class="control-btn svg-icon more-vertical"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -211,38 +211,54 @@ SSE.ApplicationController = new(function(){
|
||||||
hidePreloader();
|
hidePreloader();
|
||||||
onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
|
||||||
|
|
||||||
if ( permissions.print === false)
|
var dividers = $('#box-tools .divider');
|
||||||
|
var itemsCount = $('#box-tools a').length;
|
||||||
|
|
||||||
|
if ( permissions.print === false) {
|
||||||
$('#idt-print').hide();
|
$('#idt-print').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !embedConfig.saveUrl || permissions.download === false)
|
if ( !embedConfig.saveUrl || permissions.download === false) {
|
||||||
$('#idt-download').hide();
|
$('#idt-download').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !embedConfig.shareUrl )
|
if ( !embedConfig.shareUrl ) {
|
||||||
$('#idt-share').hide();
|
$('#idt-share').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if (!config.canBackToFolder)
|
if (!config.canBackToFolder) {
|
||||||
$('#idt-close').hide();
|
$('#idt-close').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !embedConfig.embedUrl )
|
if (itemsCount < 7) {
|
||||||
|
$(dividers[0]).hide();
|
||||||
|
$(dividers[1]).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !embedConfig.embedUrl ) {
|
||||||
$('#idt-embed').hide();
|
$('#idt-embed').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !embedConfig.fullscreenUrl )
|
if ( !embedConfig.fullscreenUrl ) {
|
||||||
$('#idt-fullscreen').hide();
|
$('#idt-fullscreen').hide();
|
||||||
|
itemsCount--;
|
||||||
|
}
|
||||||
|
|
||||||
if ( (!embedConfig.saveUrl || permissions.download === false) && permissions.print === false && !embedConfig.shareUrl && !embedConfig.embedUrl && !embedConfig.fullscreenUrl && !config.canBackToFolder)
|
if (itemsCount < 1)
|
||||||
$('#box-tools').addClass('hidden');
|
$('#box-tools').addClass('hidden');
|
||||||
else if (!embedConfig.embedUrl && !embedConfig.fullscreenUrl)
|
else if (!embedConfig.embedUrl && !embedConfig.fullscreenUrl)
|
||||||
$('#box-tools .divider').hide();
|
$(dividers[2]).hide();
|
||||||
|
|
||||||
common.controller.modals.attach({
|
common.controller.modals.attach({
|
||||||
share: '#idt-share',
|
share: '#idt-share',
|
||||||
embed: '#idt-embed'
|
embed: '#idt-embed'
|
||||||
});
|
});
|
||||||
|
|
||||||
common.controller.SearchBar.attach({
|
|
||||||
search: '#id-search'
|
|
||||||
});
|
|
||||||
|
|
||||||
api.asc_registerCallback('asc_onMouseMove', onApiMouseMove);
|
api.asc_registerCallback('asc_onMouseMove', onApiMouseMove);
|
||||||
api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink);
|
api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink);
|
||||||
api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl);
|
api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl);
|
||||||
|
@ -289,6 +305,11 @@ SSE.ApplicationController = new(function(){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
SSE.ApplicationView.tools.get('#idt-search')
|
||||||
|
.on('click', function(){
|
||||||
|
common.controller.SearchBar.show();
|
||||||
|
});
|
||||||
|
|
||||||
$('#id-btn-zoom-in').on('click', function () {
|
$('#id-btn-zoom-in').on('click', function () {
|
||||||
if (api){
|
if (api){
|
||||||
var f = Math.floor(api.asc_getZoom() * 10)/10;
|
var f = Math.floor(api.asc_getZoom() * 10)/10;
|
||||||
|
|
|
@ -46,8 +46,11 @@ SSE.ApplicationView = new(function(){
|
||||||
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
|
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
|
||||||
$btnTools.parent().append(
|
$btnTools.parent().append(
|
||||||
'<ul class="dropdown-menu pull-right">' +
|
'<ul class="dropdown-menu pull-right">' +
|
||||||
'<li><a id="idt-print"><span class="mi-icon svg-icon print"></span>' + this.txtPrint + '</a></li>' +
|
|
||||||
'<li><a id="idt-download"><span class="mi-icon svg-icon download"></span>' + this.txtDownload + '</a></li>' +
|
'<li><a id="idt-download"><span class="mi-icon svg-icon download"></span>' + this.txtDownload + '</a></li>' +
|
||||||
|
'<li><a id="idt-print"><span class="mi-icon svg-icon print"></span>' + this.txtPrint + '</a></li>' +
|
||||||
|
'<li class="divider"></li>' +
|
||||||
|
'<li><a id="idt-search"><span class="mi-icon svg-icon search"></span>' + this.txtSearch + '</a></li>' +
|
||||||
|
'<li class="divider"></li>' +
|
||||||
'<li><a id="idt-share" data-toggle="modal"><span class="mi-icon svg-icon share"></span>' + this.txtShare + '</a></li>' +
|
'<li><a id="idt-share" data-toggle="modal"><span class="mi-icon svg-icon share"></span>' + this.txtShare + '</a></li>' +
|
||||||
'<li><a id="idt-close" data-toggle="modal"><span class="mi-icon svg-icon go-to-location"></span>' + this.txtFileLocation + '</a></li>' +
|
'<li><a id="idt-close" data-toggle="modal"><span class="mi-icon svg-icon go-to-location"></span>' + this.txtFileLocation + '</a></li>' +
|
||||||
'<li class="divider"></li>' +
|
'<li class="divider"></li>' +
|
||||||
|
@ -71,6 +74,7 @@ SSE.ApplicationView = new(function(){
|
||||||
txtShare: 'Share',
|
txtShare: 'Share',
|
||||||
txtEmbed: 'Embed',
|
txtEmbed: 'Embed',
|
||||||
txtFullScreen: 'Full Screen',
|
txtFullScreen: 'Full Screen',
|
||||||
txtFileLocation: 'Open file location'
|
txtFileLocation: 'Open file location',
|
||||||
|
txtSearch: 'Search'
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
|
|
||||||
common.controller.SearchBar = new(function() {
|
common.controller.SearchBar = new(function() {
|
||||||
var $searchBar,
|
var $searchBar,
|
||||||
$searchBtn,
|
|
||||||
$searchInput,
|
$searchInput,
|
||||||
appConfig,
|
appConfig,
|
||||||
api,
|
api,
|
||||||
|
@ -86,34 +85,27 @@
|
||||||
$searchBar.find('#search-bar-close').on('click', function(e){
|
$searchBar.find('#search-bar-close').on('click', function(e){
|
||||||
highlightResults(false);
|
highlightResults(false);
|
||||||
$searchBar.hide();
|
$searchBar.hide();
|
||||||
$searchBtn.find('button').button('toggle');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
common.view.SearchBar.disableNavButtons();
|
common.view.SearchBar.disableNavButtons();
|
||||||
};
|
};
|
||||||
|
|
||||||
var attachToView = function(config) {
|
var onShow = function () {
|
||||||
if ( !$searchBar ) {
|
if ( !$searchBar ) {
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
if (!$searchBar.is(':visible')) {
|
||||||
$searchBtn = $(config.search);
|
|
||||||
$searchBtn.on('click', function(e){
|
|
||||||
if ($searchBar.is(':visible')) {
|
|
||||||
highlightResults(false);
|
|
||||||
$searchBar.hide();
|
|
||||||
} else {
|
|
||||||
highlightResults(true);
|
highlightResults(true);
|
||||||
var text = (api && api.asc_GetSelectedText()) || _state.searchText;
|
var text = (api && api.asc_GetSelectedText()) || _state.searchText;
|
||||||
$searchInput.val(text);
|
$searchInput.val(text);
|
||||||
(text.length > 0) && onInputSearchChange(text);
|
(text.length > 0) && onInputSearchChange(text);
|
||||||
|
|
||||||
$searchBar.show();
|
$searchBar.show();
|
||||||
|
setTimeout(function () {
|
||||||
$searchInput.focus();
|
$searchInput.focus();
|
||||||
$searchInput.select();
|
$searchInput.select();
|
||||||
|
}, 10);
|
||||||
}
|
}
|
||||||
$searchBtn.find('button').button('toggle');
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var onInputSearchChange = function (text) {
|
var onInputSearchChange = function (text) {
|
||||||
|
@ -172,8 +164,8 @@
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init: function(config) { appConfig = config; },
|
init: function(config) { appConfig = config; },
|
||||||
attach: attachToView,
|
setApi: setApi,
|
||||||
setApi: setApi
|
show: onShow
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}();
|
}();
|
|
@ -35,5 +35,6 @@
|
||||||
"SSE.ApplicationView.txtFileLocation": "Open file location",
|
"SSE.ApplicationView.txtFileLocation": "Open file location",
|
||||||
"SSE.ApplicationView.txtFullScreen": "Full Screen",
|
"SSE.ApplicationView.txtFullScreen": "Full Screen",
|
||||||
"SSE.ApplicationView.txtPrint": "Print",
|
"SSE.ApplicationView.txtPrint": "Print",
|
||||||
"SSE.ApplicationView.txtShare": "Share"
|
"SSE.ApplicationView.txtShare": "Share",
|
||||||
|
"SSE.ApplicationView.txtSearch": "Search"
|
||||||
}
|
}
|
Loading…
Reference in a new issue