How to use contentType method in storybook-root

Best JavaScript code snippet using storybook-root

ribbon.js

Source:ribbon.js Github

copy

Full Screen

1var fontFamily = ['Segoe UI', 'Times New Roman', 'Arial', 'Times New Roman', 'Tahoma', 'Helvetica'];2var fontSize = ['1pt', '2pt', '3pt', '4pt', '5pt'];3var tabs = [{4 id: 'home',5 text: 'Home',6 groups: [{7 text: 'Clipboard',8 alignType: ej.Ribbon.AlignType.Rows,9 content: [{10 groups: [{11 id: 'copy',12 text: 'Copy',13 toolTip: 'Copy',14 buttonSettings: {15 contentType: ej.ContentType.TextAndImage,16 imagePosition: ej.ImagePosition.ImageTop,17 prefixIcon: 'e-icon flaticon-copy'18 }19 }, {20 id: 'paste',21 text: 'Paste',22 toolTip: 'Paste',23 buttonSettings: {24 contentType: ej.ContentType.TextAndImage,25 imagePosition: ej.ImagePosition.ImageTop,26 prefixIcon: 'e-icon flaticon-paste'27 }28 }, {29 id: 'cut',30 text: 'Cut',31 toolTip: 'Cut',32 buttonSettings: {33 contentType: ej.ContentType.TextAndImage,34 imagePosition: ej.ImagePosition.ImageTop,35 prefixIcon: 'e-icon flaticon-scissors'36 }37 }, {38 id: 'delete',39 text: 'Delete',40 toolTip: 'Delete',41 buttonSettings: {42 contentType: ej.ContentType.TextAndImage,43 imagePosition: ej.ImagePosition.ImageTop,44 prefixIcon: 'e-icon flaticon-delete'45 }46 }, {47 id: 'export',48 text: 'Export',49 toolTip: 'Export',50 buttonSettings: {51 contentType: ej.ContentType.TextAndImage,52 imagePosition: ej.ImagePosition.ImageTop,53 prefixIcon: 'e-icon flaticon-share'54 }55 }]56 }],57 enableGroupExpander: true,58 }, {59 text: 'Undo Action',60 alignType: ej.Ribbon.AlignType.Columns,61 width: 80,62 content: [63 {64 groups: [{65 id: 'undo',66 text: 'Undo Last Action',67 toolTip: 'Undo',68 buttonSettings: {69 contentType: ej.ContentType.TextAndImage,70 imagePosition: ej.ImagePosition.ImageTop,71 prefixIcon: 'e-icon flaticon-back-arrow'72 }73 }]74 }]75 }, {76 text: 'Format',77 alignType: ej.Ribbon.AlignType.Rows,78 content: [{79 groups: [{80 id: 'fontFamily',81 toolTip: 'Font',82 dropdownSettings: {83 dataSource: fontFamily,84 text: 'Segoe UI',85 width: 100,86 }87 }, {88 id: 'fontSize',89 toolTip: 'FontSize',90 dropdownSettings: {91 dataSource: fontSize,92 text: '1pt',93 width: 6094 }95 }],96 defaults: {97 type: ej.Ribbon.type.dropDownList,98 height: 2899 }100 }, {101 groups: [{102 id: 'bold',103 toolTip: 'Bold',104 type: ej.Ribbon.type.toggleButton,105 toggleButtonSettings: {106 contentType: ej.ContentType.ImageOnly,107 defaultText: 'Bold',108 activeText: 'Bold',109 defaultPrefixIcon: 'e-icon flaticon-bold',110 activePrefixIcon: 'e-icon flaticon-bold'111 }112 }, {113 id: 'italics',114 toolTip: 'Italics',115 type: ej.Ribbon.type.toggleButton,116 toggleButtonSettings: {117 contentType: ej.ContentType.ImageOnly,118 defaultText: 'Italics',119 activeText: 'Italics',120 defaultPrefixIcon: 'e-icon flaticon-italic',121 activePrefixIcon: 'e-icon flaticon-italic'122 }123 }, {124 id: 'underLine',125 toolTip: 'Underline',126 type: ej.Ribbon.type.toggleButton,127 toggleButtonSettings: {128 contentType: ej.ContentType.ImageOnly,129 defaultText: 'Underline',130 activeText: 'Underline',131 defaultPrefixIcon: 'e-icon flaticon-underlined-text',132 activePrefixIcon: 'e-icon flaticon-underlined-text'133 }134 }, {135 id: 'strikeThrough',136 toolTip: 'Strike Through',137 type: ej.Ribbon.type.toggleButton,138 toggleButtonSettings: {139 contentType: ej.ContentType.ImageOnly,140 defaultText: 'Strike Thorugh',141 activeText: 'Strike Through',142 defaultPrefixIcon: 'e-icon flaticon-strikethrough',143 activePrefixIcon: 'e-icon flaticon-strikethrough'144 }145 }, {146 id: 'leftalign',147 toolTip: 'Left align',148 buttonSettings: {149 contentType: ej.ContentType.ImageOnly,150 prefixIcon: 'e-icon flaticon-left-align'151 }152 }, {153 id: 'centeralign',154 toolTip: 'Center align',155 buttonSettings: {156 contentType: ej.ContentType.ImageOnly,157 prefixIcon: 'e-icon flaticon-center-align'158 }159 }, {160 id: 'rightalign',161 toolTip: 'Right align',162 buttonSettings: {163 contentType: ej.ContentType.ImageOnly,164 prefixIcon: 'e-icon flaticon-right-align'165 }166 }],167 }]168 },169 {170 text: 'Style',171 alignType: ej.Ribbon.AlignType.Rows,172 content: [{173 groups: [{174 id: 'fill',175 text: 'Fill',176 toolTip: 'Fill',177 width: 40,178 buttonSettings: {179 contentType: ej.ContentType.TextAndImage,180 imagePosition: ej.ImagePosition.ImageTop,181 prefixIcon: 'flaticon-bucket-large'182 }183 }, {184 id: 'line',185 text: 'Line',186 toolTip: 'Line',187 width: 40,188 buttonSettings: {189 contentType: ej.ContentType.TextAndImage,190 imagePosition: ej.ImagePosition.ImageTop,191 prefixIcon: 'flaticon-pencil-drawing-a-line-large'192 }193 }, {194 id: 'text',195 text: 'Text',196 toolTip: 'Text',197 width: 40,198 buttonSettings: {199 contentType: ej.ContentType.TextAndImage,200 imagePosition: ej.ImagePosition.ImageTop,201 prefixIcon: 'flaticon-text-box-large'202 }203 }, {204 id: 'start',205 text: 'Start',206 toolTip: 'Start',207 width: 40,208 buttonSettings: {209 contentType: ej.ContentType.TextAndImage,210 imagePosition: ej.ImagePosition.ImageTop,211 prefixIcon: 'flaticon-double-arrow-large'212 }213 }, {214 id: 'end',215 text: 'End',216 toolTip: 'End',217 width: 40,218 buttonSettings: {219 contentType: ej.ContentType.TextAndImage,220 imagePosition: ej.ImagePosition.ImageTop,221 prefixIcon: 'flaticon-double-arrow-large'222 }223 }]224 }]225 }, {226 text: 'Annotation',227 alignType: ej.Ribbon.AlignType.Columns,228 content: [{229 groups: [{230 id: 'pointer',231 text: 'Pointer',232 toolTip: 'Pointer',233 buttonSettings: {234 contentType: ej.ContentType.TextAndImage,235 imagePosition: ej.ImagePosition.ImageTop,236 prefixIcon: 'flaticon-cursor'237 }238 }]239 }, {240 groups: [{241 id: 'textBox',242 text: 'Text',243 toolTip: 'Text Box',244 buttonSettings: {245 contentType: ej.ContentType.TextAndImage,246 imagePosition: ej.ImagePosition.ImageTop,247 prefixIcon: 'flaticon-capital-a'248 }249 }]250 }, {251 groups: [{252 id: 'line',253 text: 'Line',254 toolTip: 'Line',255 buttonSettings: {256 contentType: ej.ContentType.TextAndImage,257 imagePosition: ej.ImagePosition.ImageTop,258 prefixIcon: 'flaticon-diagonal-line'259 }260 }]261 }, {262 groups: [{263 id: 'rectangle',264 text: 'Rectangle',265 toolTip: 'Rectangle',266 buttonSettings: {267 contentType: ej.ContentType.ImageOnly,268 prefixIcon: 'flaticon-rectangular-shape-outline'269 }270 }, {271 id: 'arc',272 text: 'Arc',273 toolTip: 'Arc',274 buttonSettings: {275 contentType: ej.ContentType.ImageOnly,276 prefixIcon: 'flaticon-curved-line'277 }278 }]279 }, {280 groups: [{281 id: 'ellipse',282 text: 'Ellipse',283 toolTip: 'Ellipse',284 buttonSettings: {285 contentType: ej.ContentType.ImageOnly,286 prefixIcon: 'flaticon-ellipse-outline-shape-variant'287 }288 }, {289 id: 'polyline',290 text: 'Polyline',291 toolTip: 'Polyline',292 buttonSettings: {293 contentType: ej.ContentType.ImageOnly,294 prefixIcon: 'flaticon-business-ascendant-graphic-line'295 }296 }]297 }]298 }, {299 text: 'Communication Link',300 alignType: ej.Ribbon.AlignType.Columns,301 content: [{302 groups: [{303 id: 'straight',304 text: 'Straight',305 toolTip: 'Straight',306 buttonSettings: {307 contentType: ej.ContentType.TextAndImage,308 imagePosition: ej.ImagePosition.ImageTop,309 prefixIcon: 'flaticon-line'310 }311 }]312 }, {313 groups: [{314 id: 'sidetoside',315 toolTip: 'Side to Side Communication Link',316 buttonSettings: {317 contentType: ej.ContentType.ImageOnly,318 prefixIcon: 'flaticon-line'319 }320 }, {321 id: 'toptobottomside',322 toolTip: 'Top to Bottom Side to Side',323 buttonSettings: {324 contentType: ej.ContentType.ImageOnly,325 prefixIcon: 'flaticon-line'326 }327 }]328 }, {329 groups: [{330 id: 'lefttoptobottom',331 toolTip: 'Left Top to Bottom Communication Link',332 buttonSettings: {333 contentType: ej.ContentType.ImageOnly,334 prefixIcon: 'flaticon-line'335 }336 }, {337 id: 'singledirection',338 toolTip: 'Single Direction Communication Link',339 buttonSettings: {340 contentType: ej.ContentType.ImageOnly,341 prefixIcon: 'flaticon-right-arrow'342 }343 }]344 }, {345 groups: [{346 id: 'toptobottomright',347 toolTip: 'Top to Bottom right Communication Link',348 buttonSettings: {349 contentType: ej.ContentType.ImageOnly,350 prefixIcon: 'flaticon-line'351 }352 }, {353 id: 'doubledirection',354 toolTip: 'Double Direction Communication Link',355 buttonSettings: {356 contentType: ej.ContentType.ImageOnly,357 prefixIcon: 'flaticon-double-arrows'358 }359 }]360 }]361 }, {362 text: 'Node Item',363 content: [{364 groups: [{365 id: 'node',366 text: 'Node',367 toolTip: 'Node',368 buttonSettings: {369 contentType: ej.ContentType.TextAndImage,370 imagePosition: ej.ImagePosition.ImageTop,371 prefixIcon: 'flaticon-website-1'372 }373 }]374 }]375 }, {376 text: 'View Site',377 content: [{378 groups: [{379 id: 'viewSite',380 text: 'View Site',381 toolTip: 'View Site',382 buttonSettings: {383 contentType: ej.ContentType.TextAndImage,384 imagePosition: ej.ImagePosition.ImageTop,385 prefixIcon: 'flaticon-home-icon-silhouette'386 }387 }]388 }]389 }]390}, {391 id: 'edit',392 text: 'Edit',393 groups: [{394 text: 'Entity',395 content: [{396 groups: [{397 id: 'selectedEntity',398 text: 'Selected Entity',399 toolTip: 'Selected Entity',400 width: '75px',401 buttonSettings: {402 contentType: ej.ContentType.TextAndImage,403 imagePosition: ej.ImagePosition.ImageTop,404 prefixIcon: 'flaticon-click'405 }406 }]407 }]408 }, {409 text: 'Undo Action',410 content: [{411 groups: [{412 id: 'undoLastAction1',413 text: 'Undo Last Action',414 toolTip: 'Undo Last Action',415 width: '100px',416 buttonSettings: {417 contentType: ej.ContentType.TextAndImage,418 imagePosition: ej.ImagePosition.ImageTop,419 prefixIcon: 'flaticon-back-arrow-large'420 }421 }]422 }]423 }, {424 text: 'Project Element',425 content: [{426 groups: [{427 id: 'projectInformation',428 text: 'Project Information',429 toolTip: 'Project Information',430 width: '100px',431 buttonSettings: {432 contentType: ej.ContentType.TextAndImage,433 imagePosition: ej.ImagePosition.ImageTop,434 prefixIcon: 'flaticon-website-1'435 }436 }]437 }]438 }]439}, {440 id: 'view',441 text: 'View',442 groups: [{443 text: 'Project Element',444 content: [{445 groups: [{446 id: 'projectInformation',447 text: 'Project Information',448 toolTip: 'Project Information',449 width: '100px',450 buttonSettings: {451 contentType: ej.ContentType.TextAndImage,452 imagePosition: ej.ImagePosition.ImageTop,453 prefixIcon: 'flaticon-website-1'454 }455 }]456 }]457 }, {458 text: 'Open',459 content: [{460 groups: [{461 id: 'subFunction',462 text: 'Sub Function',463 toolTip: 'Sub Function',464 width: '100px',465 buttonSettings: {466 contentType: ej.ContentType.TextAndImage,467 imagePosition: ej.ImagePosition.ImageTop,468 prefixIcon: 'flaticon-letter-f'469 }470 }, {471 id: 'subApplication',472 text: 'Sub Application',473 toolTip: 'Sub Application',474 width: '100px',475 buttonSettings: {476 contentType: ej.ContentType.TextAndImage,477 imagePosition: ej.ImagePosition.ImageTop,478 prefixIcon: 'flaticon-letter-a'479 }480 }, {481 id: 'subResult',482 text: 'Sub Result',483 toolTip: 'Sub Result',484 width: '100px',485 buttonSettings: {486 contentType: ej.ContentType.TextAndImage,487 imagePosition: ej.ImagePosition.ImageTop,488 prefixIcon: 'flaticon-letter-r'489 }490 }]491 }]492 }, {493 text: 'Show Hide Zoom',494 content: [{495 groups: [{496 id: 'showHide&Setting',497 text: 'Show Hide & Setting',498 toolTip: 'Show Hide & Setting',499 width: '100px',500 buttonSettings: {501 contentType: ej.ContentType.TextAndImage,502 imagePosition: ej.ImagePosition.ImageTop,503 prefixIcon: 'flaticon-view',504 click: 'showHideDialog'505 }506 }, {507 id: 'indow',508 text: 'Window',509 toolTip: 'Window',510 width: '100px',511 buttonSettings: {512 contentType: ej.ContentType.TextAndImage,513 imagePosition: ej.ImagePosition.ImageTop,514 prefixIcon: 'flaticon-windows-couple'515 }516 }, {517 id: 'zoom',518 text: 'Zoom',519 toolTip: 'Zoom',520 width: '100px',521 buttonSettings: {522 contentType: ej.ContentType.TextAndImage,523 imagePosition: ej.ImagePosition.ImageTop,524 prefixIcon: 'flaticon-loupe'525 }526 }]527 }]528 }]529}, {530 id: 'project',531 text: 'Project',532 groups: [{533 text: 'Start',534 content: [{535 groups: [{536 id: 'startAProject',537 text: 'Start a Project',538 toolTip: 'Start a Project',539 width: '80px',540 buttonSettings: {541 contentType: ej.ContentType.TextAndImage,542 imagePosition: ej.ImagePosition.ImageTop,543 prefixIcon: 'flaticon-tools'544 }545 546 }, {547 id: 'configureWarningMessage',548 text: 'Configure Warning Message',549 toolTip: 'Configure Warning Message',550 width: '150px',551 buttonSettings: {552 contentType: ej.ContentType.TextAndImage,553 imagePosition: ej.ImagePosition.ImageTop,554 prefixIcon: 'flaticon-exclamation'555 }556 }]557 }]558 }, {559 text: 'Finish',560 content: [{561 groups: [{562 id: 'closeProject',563 text: 'Close Project',564 toolTip: 'Close Project',565 width: '80px',566 buttonSettings: {567 contentType: ej.ContentType.TextAndImage,568 imagePosition: ej.ImagePosition.ImageTop,569 prefixIcon: 'flaticon-tools'570 }571 }, {572 id: 'reOpenProject',573 text: 'Reopen Project',574 toolTip: 'Reopen Project',575 width: '80px',576 buttonSettings: {577 contentType: ej.ContentType.TextAndImage,578 imagePosition: ej.ImagePosition.ImageTop,579 prefixIcon: 'flaticon-open'580 }581 }]582 }]583 }]584}, {585 id: 'action',586 text: 'Action',587 groups: [{588 text: 'Entity',589 alignType: ej.Ribbon.AlignType.Rows,590 content: [{591 groups: [{592 id: 'showRelationship',593 text: 'Show Relationship of Entities',594 toolTip: 'Show Relationship of Entities',595 width: '100px',596 buttonSettings: {597 contentType: ej.ContentType.TextAndImage,598 imagePosition: ej.ImagePosition.ImageTop,599 prefixIcon: 'flaticon-relation'600 },601 }, {602 id: 'identifySimilarities',603 text: 'Identify Similarity of Entities',604 width: '100px',605 buttonSettings: {606 contentType: ej.ContentType.TextAndImage,607 imagePosition: ej.ImagePosition.ImageTop,608 prefixIcon: 'flaticon-relation'609 }610 }, {611 id: 'identifyRelationship',612 text: 'Identify Relationship as Entity',613 width: '100px',614 buttonSettings: {615 contentType: ej.ContentType.TextAndImage,616 imagePosition: ej.ImagePosition.ImageTop,617 prefixIcon: 'flaticon-relation'618 }619 }, {620 id: 'attachselected',621 text: 'Attach Selected Entities',622 width: '100px',623 buttonSettings: {624 contentType: ej.ContentType.TextAndImage,625 imagePosition: ej.ImagePosition.ImageTop,626 prefixIcon: 'flaticon-relation'627 }628 }]629 }]630 }, {631 text: 'Entity',632 content: [{633 groups: [{634 id: 'compareSlected',635 text: 'Compare Selected Entities',636 toolTip: 'Compare Selected Entities',637 width: '100px',638 buttonSettings: {639 contentType: ej.ContentType.TextAndImage,640 imagePosition: ej.ImagePosition.ImageTop,641 prefixIcon: 'flaticon-compare'642 }643 }, {644 id: 'identiftDifference',645 text: 'Identify Difference of Entities',646 toolTip: 'Identify Difference of Entities',647 width: '100px',648 buttonSettings: {649 contentType: ej.ContentType.TextAndImage,650 imagePosition: ej.ImagePosition.ImageTop,651 prefixIcon: 'flaticon-is-not-equal-to-mathematical-symbol'652 }653 }, {654 id: 'identifyPart',655 text: 'Identify Part of Entity',656 toolTip: 'Identify Part of Entity',657 width: '100px',658 buttonSettings: {659 contentType: ej.ContentType.TextAndImage,660 imagePosition: ej.ImagePosition.ImageTop,661 prefixIcon: 'flaticon-puzzle'662 }663 }, {664 id: 'identifyEntities',665 text: 'Identify Entities as One',666 toolTip: 'Identify Entities as One',667 width: '100px',668 buttonSettings: {669 contentType: ej.ContentType.TextAndImage,670 imagePosition: ej.ImagePosition.ImageTop,671 prefixIcon: 'flaticon-group'672 }673 }, {674 id: 'Other Action',675 text: 'Other Action',676 toolTip: 'Other Action',677 type: ej.Ribbon.type.splitButton,678 splitButtonSettings: {679 targetID: "other-action",680 buttonMode: "dropdown",681 arrowPosition: "right"682 }683 }, {684 id: 'additionalAction',685 text: 'Additional Actions',686 toolTip: 'Additional Action',687 type: ej.Ribbon.type.splitButton,688 splitButtonSettings: {689 targetID: "additional-action",690 buttonMode: "dropdown",691 arrowPosition: "right"692 }693 }]694 }]695 }, {696 text: 'Group',697 alignType: ej.Ribbon.AlignType.Columns,698 content: [{699 groups: [{700 id: 'groupSelected',701 text: 'Group Selected Entity',702 toolTip: 'Group Selected Entity',703 width: '100px',704 buttonSettings: {705 contentType: ej.ContentType.TextAndImage,706 imagePosition: ej.ImagePosition.ImageTop,707 prefixIcon: 'flaticon-group'708 }709 }]710 }, {711 groups: [{712 id: 'ungroupSelected',713 text: 'Ungroup Selected Entity',714 toolTip: 'Ungroup Selected Entity',715 width: '100px',716 buttonSettings: {717 contentType: ej.ContentType.TextAndImage,718 imagePosition: ej.ImagePosition.ImageTop,719 prefixIcon: 'flaticon-tile'720 }721 }]722 }, {723 groups: [{724 id: 'groupPeople',725 buttonSettings: {726 contentType: ej.ContentType.ImageOnly,727 prefixIcon: 'flaticon-group-1'728 }729 }, {730 id: 'ungroupApplication',731 buttonSettings: {732 contentType: ej.ContentType.ImageOnly,733 prefixIcon: 'flaticon-user'734 }735 }]736 }, {737 groups: [{738 id: 'ungroupPeople',739 buttonSettings: {740 contentType: ej.ContentType.ImageOnly,741 prefixIcon: 'e-icon flaticon-left-align'742 }743 }, {744 id: 'ungroupApplication',745 buttonSettings: {746 contentType: ej.ContentType.ImageOnly,747 prefixIcon: 'e-icon flaticon-left-align'748 }749 }]750 }, {751 groups: [{752 id: 'groupFunction',753 buttonSettings: {754 contentType: ej.ContentType.ImageOnly,755 prefixIcon: 'e-icon flaticon-left-align'756 }757 }, {758 id: 'groupResult',759 buttonSettings: {760 contentType: ej.ContentType.ImageOnly,761 prefixIcon: 'e-icon flaticon-left-align',762 }763 }]764 }, {765 groups: [{766 id: 'ungroupFunction',767 buttonSettings: {768 contentType: ej.ContentType.ImageOnly,769 prefixIcon: 'e-icon flaticon-left-align'770 }771 }, {772 id: 'ungroupResult',773 buttonSettings: {774 contentType: ej.ContentType.ImageOnly,775 prefixIcon: 'e-icon flaticon-left-align',776 }777 }]778 }]779 }, {780 text: 'Compose and Rotate',781 content: [{782 groups: [{783 id: 'compose',784 text: 'Compose',785 toolTip: 'Compose',786 width: '70px',787 height: '50px',788 type: ej.Ribbon.type.splitButton,789 splitButtonSettings: {790 contentType: ej.ContentType.ImageOnly,791 targetID: "compose-list",792 buttonMode: "dropdown",793 arrowPosition: "bottom",794 prefixIcon: 'flaticon-tile'795 }796 }, {797 id: 'rotate',798 text: 'Rotate',799 toolTip: 'Rotate',800 width: '70px',801 height: '50px',802 type: ej.Ribbon.type.splitButton,803 splitButtonSettings: {804 contentType: ej.ContentType.ImageOnly,805 targetID: "rotate-list",806 buttonMode: 'dropdown',807 arrowPosition: 'bottom',808 prefixIcon: 'flaticon-redo-arrow-large'809 }810 }]811 }]812 }]813}, {814 id: 'layout',815 text: 'Layout',816 groups: [{817 text: 'Nudge and Pan',818 alignType: ej.Ribbon.AlignType.Columns,819 content: [{820 groups: [{821 id: 'panTool',822 text: 'Pan Tool',823 toolTip: 'Pan Tool',824 width: '100px',825 buttonSettings: {826 contentType: ej.ContentType.TextAndImage,827 imagePosition: ej.ImagePosition.ImageTop,828 prefixIcon: 'flaticon-select'829 }830 }]831 }, {832 groups: [{833 id: 'nudegeLeft',834 buttonSettings: {835 contentType: ej.ContentType.ImageOnly,836 prefixIcon: 'e-icon flaticon-left-arrow',837 }838 }, {839 id: 'nudegeUp',840 buttonSettings: {841 contentType: ej.ContentType.ImageOnly,842 prefixIcon: 'e-icon flaticon-up-arrow',843 }844 }]845 }, {846 groups: [{847 id: 'nudgeRight',848 buttonSettings: {849 contentType: ej.ContentType.ImageOnly,850 prefixIcon: 'e-icon flaticon-left-arrow',851 }852 }, {853 id: 'nudgeDown',854 buttonSettings: {855 contentType: ej.ContentType.ImageOnly,856 prefixIcon: 'e-icon flaticon-down-arrow'857 }858 }]859 }]860 }, {861 text: 'Align',862 content: [{863 groups: [{864 id: 'alignLeft',865 buttonSettings: {866 contentType: ej.ContentType.ImageOnly,867 prefixIcon: 'e-icon flaticon-align-left'868 }869 }, {870 id: 'align Center',871 buttonSettings: {872 contentType: ej.ContentType.ImageOnly,873 prefixIcon: 'e-icon flaticon-align-center'874 }875 }, {876 id: 'align Right',877 buttonSettings: {878 contentType: ej.ContentType.ImageOnly,879 prefixIcon: 'e-icon flaticon-align-left'880 }881 }]882 }, {883 groups: [{884 id: 'alignBottom',885 buttonSettings: {886 contentType: ej.ContentType.ImageOnly,887 prefixIcon: 'e-icon flaticon-sort'888 }889 }, {890 id: 'alignMiddle',891 buttonSettings: {892 contentType: ej.ContentType.ImageOnly,893 prefixIcon: 'e-icon flaticon-align'894 }895 }, {896 id: 'alignTop',897 buttonSettings: {898 contentType: ej.ContentType.ImageOnly,899 prefixIcon: 'e-icon flaticon-top-alignment'900 }901 }]902 }]903 }, {904 text: 'Size',905 content: [{906 groups: [{907 id: 'equalhorizontalspace',908 buttonSettings: {909 contentType: ej.ContentType.ImageOnly,910 prefixIcon: 'e-icon flaticon-width'911 }912 }, {913 id: 'increaseHorizontal',914 buttonSettings: {915 contentType: ej.ContentType.ImageOnly,916 prefixIcon: 'e-icon flaticon-width'917 }918 }, {919 id: 'decreaseHorizontal',920 buttonSettings: {921 contentType: ej.ContentType.ImageOnly,922 prefixIcon: 'e-icon flaticon-width'923 }924 }]925 }, {926 groups: [{927 id: 'equalVerticalSpace',928 buttonSettings: {929 contentType: ej.ContentType.ImageOnly,930 prefixIcon: 'e-icon flaticon-height'931 }932 }, {933 id: 'increaseVertical',934 buttonSettings: {935 contentType: ej.ContentType.ImageOnly,936 prefixIcon: 'e-icon flaticon-height'937 }938 }, {939 id: 'decreaseVertical',940 buttonSettings: {941 contentType: ej.ContentType.ImageOnly,942 prefixIcon: 'e-icon flaticon-height'943 }944 }]945 }]946 }, {947 text: 'Size',948 alignType: ej.Ribbon.AlignType.Columns,949 content: [{950 groups: [{951 id: 'sameWidth',952 text: 'Same Width',953 toolTip: 'Same Width',954 buttonSettings: {955 contentType: ej.ContentType.TextAndImage,956 prefixIcon: 'e-icon flaticon-width'957 }958 959 }, {960 id: 'sameheight',961 text: 'Same Height',962 toolTip: 'Same Height',963 buttonSettings: {964 contentType: ej.ContentType.TextAndImage,965 prefixIcon: 'e-icon flaticon-height'966 }967 }, {968 id: 'sameSize',969 text: 'Same Size',970 toolTip: 'Same Size',971 buttonSettings: {972 contentType: ej.ContentType.TextAndImage,973 prefixIcon: 'e-icon flaticon-size-square'974 }975 }]976 }]977 }, {978 text: 'Snap',979 content: [{980 groups: [{981 id: 'snapToGrid',982 buttonSettings: {983 contentType: ej.ContentType.ImageOnly,984 prefixIcon: 'e-icon flaticon-grid'985 }986 }, {987 id: 'snapToRuler',988 buttonSettings: {989 contentType: ej.ContentType.ImageOnly,990 prefixIcon: 'e-icon flaticon-scale'991 }992 }]993 }, {994 groups: [{995 id: 'snapToGuidelines',996 buttonSettings: {997 contentType: ej.ContentType.ImageOnly,998 prefixIcon: 'e-icon flaticon-axis'999 }1000 }, {1001 id: 'snapRotation',1002 buttonSettings: {1003 contentType: ej.ContentType.ImageOnly,1004 prefixIcon: 'e-icon flaticon-redo-arrow'1005 }1006 }]1007 }]1008 }, {1009 text: 'Center',1010 content: [{1011 groups: [{1012 id: 'modelHorizontal',1013 text: 'Model Horizontal',1014 toolTip: 'Model Horizontal',1015 width: '100px',1016 buttonSettings: {1017 contentType: ej.ContentType.TextAndImage,1018 imagePosition: ej.ImagePosition.ImageTop,1019 prefixIcon: 'flaticon-left-alignment'1020 }1021 }, {1022 id: 'modelVertical',1023 text: 'Model Vertical',1024 toolTip: 'Model Vertical',1025 width: '100px',1026 buttonSettings: {1027 contentType: ej.ContentType.TextAndImage,1028 imagePosition: ej.ImagePosition.ImageTop,1029 prefixIcon: 'flaticon-top-alignment-large'1030 }1031 }, {1032 id: 'sizeToWindow',1033 text: 'Size To Window',1034 toolTip: 'Size To Window',1035 width: '100px',1036 buttonSettings: {1037 contentType: ej.ContentType.TextAndImage,1038 imagePosition: ej.ImagePosition.ImageTop,1039 prefixIcon: 'flaticon-website'1040 }1041 }]1042 }]1043 }]1044}, {1045 id: 'domain',1046 text: 'Domain',1047 groups: [{1048 text: 'Identification',1049 content: [{1050 groups: [{1051 id: 'toCommunicationDomain',1052 text: 'Switch to Communication Domain',1053 width: '135px',1054 buttonSettings: {1055 contentType: ej.ContentType.TextAndImage,1056 imagePosition: ej.ImagePosition.ImageTop,1057 prefixIcon: 'flaticon-user',1058 click: 'switchToComm'1059 }1060 }, {1061 id: 'toTheoryDomain',1062 text: 'Switch to Theory Domain',1063 width: '135px',1064 buttonSettings: {1065 contentType: ej.ContentType.TextAndImage,1066 imagePosition: ej.ImagePosition.ImageTop,1067 prefixIcon: 'flaticon-user',1068 click: 'switchToTheory'1069 }1070 }]1071 }]1072 }]1073}];1074$(function () {1075 $('#Ribbon').ejRibbon({1076 height: 155,1077 expandPinSettings: {1078 toolTip: 'Collapse the Ribbon'1079 },1080 // application tab1081 allowResizing: true,1082 applicationTab: {1083 type: ej.Ribbon.applicationTabType.menu,1084 menuItemID: 'ribbon',1085 menuSettings: {1086 openOnClick: true1087 }1088 },1089 tabs: tabs,1090 groupExpand: function (args) {1091 alert('Expanded')1092 },1093 });...

Full Screen

Full Screen

resize.js

Source:resize.js Github

copy

Full Screen

1import Ember from 'ember';2export default Ember.Route.extend({3 model(){4 return {5 expandPinSettings:{ toolTip: "Collapse the Ribbon" },6 collapsePinSettings:{toolTip: "Pin the Ribbon" },7 allowResizing : true,8 applicationTab : {9 type: ej.Ribbon.ApplicationTabType.Menu,10 menuItemID: "ribbonmenu", 11 menuSettings: { openOnClick: false }12 },13 tabs: [{14 id: "home", text: "HOME", groups: [{15 text: "New", alignType: ej.Ribbon.AlignType.Rows, content: [{16 groups: [{17 id: "new",18 text: "New",19 toolTip: "New",20 isMobileOnly: true,21 buttonSettings: {22 contentType: ej.ContentType.ImageOnly,23 imagePosition: ej.ImagePosition.ImageTop,24 prefixIcon: "e-icon e-ribbon e-new",25 }26 }27 ],28 defaults: {29 type: ej.Ribbon.Type.Button,30 width: 60,31 height: 7032 }33 }]34 },35 {36 text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{37 groups: [{38 id: "paste",39 text: "paste",40 toolTip: "Paste",41 splitButtonSettings: {42 contentType: ej.ContentType.ImageOnly,43 prefixIcon: "e-icon e-ribbon e-ribbonpaste",44 targetID: "pasteSplit",45 buttonMode: "dropdown",46 arrowPosition: ej.ArrowPosition.Bottom,47 }48 }49 ],50 defaults: {51 type: ej.Ribbon.Type.SplitButton,52 width: 50,53 height: 7054 }55 },56 {57 groups: [{58 id: "cut",59 text: "Cut",60 toolTip: "Cut",61 buttonSettings: {62 contentType: ej.ContentType.TextAndImage,63 prefixIcon: "e-icon e-ribbon e-ribboncut",64 }65 },66 {67 id: "copy",68 text: "Copy",69 toolTip: "Copy",70 buttonSettings: {71 contentType: ej.ContentType.TextAndImage,72 prefixIcon: "e-icon e-ribbon e-ribboncopy",73 }74 },75 {76 id: "clear",77 text: "Clear",78 toolTip: "Clear All",79 buttonSettings: {80 contentType: ej.ContentType.TextAndImage,81 prefixIcon: "e-icon e-ribbon clearAll",82 }83 }],84 defaults: {85 type: ej.Ribbon.Type.Button,86 width: 60,87 isBig: false88 }89 }]90 },91 {92 text: "Font", alignType: "rows", content: [{93 groups: [{94 id: "fontfamily",95 toolTip: "Font",96 dropdownSettings: {97 dataSource: ["Segoe UI", "Arial", "Times New Roman", "Tahoma", "Helvetica"],98 text: "Segoe UI",99 width: 150100 }101 },102 {103 id: "fontsize",104 toolTip: "FontSize",105 dropdownSettings: {106 dataSource: ["1pt", "2pt", "3pt", "4pt", "5pt"],107 text: "1pt",108 width: 65109 }110 }],111 defaults: {112 type: ej.Ribbon.Type.DropDownList,113 height: 28114 }115 },116 {117 groups: [{118 id: "bold",119 toolTip: "Bold",120 type: ej.Ribbon.Type.ToggleButton,121 toggleButtonSettings: {122 contentType: ej.ContentType.ImageOnly,123 defaultText: "Bold",124 activeText: "Bold",125 defaultPrefixIcon: "e-icon e-ribbon bold",126 activePrefixIcon: "e-icon e-ribbon bold",127 }128 },129 {130 id: "italic",131 toolTip: "Italic",132 type: ej.Ribbon.Type.ToggleButton,133 toggleButtonSettings: {134 contentType: ej.ContentType.ImageOnly,135 defaultText: "Italic",136 activeText: "Italic",137 defaultPrefixIcon: "e-icon e-ribbon e-ribbonitalic",138 activePrefixIcon: "e-icon e-ribbon e-ribbonitalic",139 }140 },141 {142 id: "underline",143 text: "Underline",144 toolTip: "Underline",145 type: ej.Ribbon.Type.ToggleButton,146 toggleButtonSettings: {147 contentType: ej.ContentType.ImageOnly,148 defaultText: "Underline",149 activeText: "Underline",150 defaultPrefixIcon: "e-icon e-ribbon e-ribbonunderline",151 activePrefixIcon: "e-icon e-ribbon e-ribbonunderline",152 }153 },154 {155 id: "strikethrough",156 text: "strikethrough",157 toolTip: "Strikethrough",158 type: ej.Ribbon.Type.ToggleButton,159 toggleButtonSettings: {160 contentType: ej.ContentType.ImageOnly,161 defaultText: "Strikethrough",162 activeText: "Strikethrough",163 defaultPrefixIcon: "e-icon e-ribbon strikethrough",164 activePrefixIcon: "e-icon e-ribbon strikethrough",165 }166 },167 {168 id: "superscript",169 text: "superscript",170 toolTip: "Superscript",171 buttonSettings: {172 contentType: ej.ContentType.ImageOnly,173 prefixIcon: "e-icon e-ribbon e-superscripticon",174 }175 },176 {177 id: "subscript",178 text: "subscript",179 toolTip: "Subscript",180 enableSeparator: true,181 buttonSettings: {182 contentType: ej.ContentType.ImageOnly,183 prefixIcon: "e-icon e-ribbon e-subscripticon",184 }185 },186 {187 id: "fontcolor",188 text: "Font Color",189 toolTip: "Font Color",190 type: ej.Ribbon.type.custom,191 contentID: "fontcolor"192 },193 {194 id: "fillcolor",195 text: "Fill Color",196 toolTip: "Fill Color",197 type: ej.Ribbon.type.custom,198 contentID: "fillcolor"199 }200 ],201 defaults: {202 isBig: false,203 }204 }]205 },206 {207 text: "Alignment", alignType: ej.Ribbon.AlignType.Rows, content: [208 {209 groups: [{210 id: "bullet",211 text: "Bullet Format",212 toolTip: "Bullets",213 buttonSettings: {214 contentType: ej.ContentType.ImageOnly,215 prefixIcon: "e-icon e-ribbon e-bullet",216 }217 },218 {219 id: "number",220 text: "Number Format",221 toolTip: "Numbering",222 enableSeparator: true,223 buttonSettings: {224 contentType: ej.ContentType.ImageOnly,225 prefixIcon: "e-icon e-ribbon e-numbericon",226 }227 },228 {229 id: "textindent",230 text: "Indent",231 toolTip: "Text Indent",232 buttonSettings: {233 contentType: ej.ContentType.ImageOnly,234 prefixIcon: "e-icon e-ribbon e-indent",235 }236 },237 {238 id: "textoudent",239 text: "Outdent",240 toolTip: "Text Outdent",241 enableSeparator: true,242 buttonSettings: {243 contentType: ej.ContentType.ImageOnly,244 prefixIcon: "e-icon e-ribbon e-outdent",245 }246 },247 {248 id: "sortascending",249 text: "Sort",250 toolTip: "Sort",251 enableSeparator: true,252 buttonSettings: {253 contentType: ej.ContentType.ImageOnly,254 prefixIcon: "e-icon e-ribbon e-sort",255 }256 },257 {258 id: "border",259 text: "Border",260 toolTip: "Border",261 buttonSettings: {262 contentType: ej.ContentType.ImageOnly,263 prefixIcon: "e-icon e-ribbon e-border",264 }265 }],266 defaults: {267 type: ej.Ribbon.Type.Button,268 isBig: false269 }270 },271 {272 groups: [{273 id: "alignleft",274 text: "JustifyLeft",275 toolTip: "Align Left",276 buttonSettings: {277 contentType: ej.ContentType.ImageOnly,278 prefixIcon: "e-icon e-ribbon alignleft",279 }280 },281 {282 id: "aligncenter",283 text: "JustifyCenter",284 toolTip: "Align Center",285 buttonSettings: {286 contentType: ej.ContentType.ImageOnly,287 prefixIcon: "e-icon e-ribbon aligncenter",288 }289 },290 {291 id: "alignright",292 text: "JustifyRight",293 toolTip: "Align Right",294 buttonSettings: {295 contentType: ej.ContentType.ImageOnly,296 prefixIcon: "e-icon e-ribbon alignright",297 }298 },299 {300 id: "justify",301 text: "JustifyFull",302 toolTip: "Justify",303 enableSeparator: true,304 buttonSettings: {305 contentType: ej.ContentType.ImageOnly,306 prefixIcon: "e-icon e-ribbon justify",307 }308 },309 {310 id: "uppercase",311 text: "Upper Case",312 toolTip: "Upper Case",313 buttonSettings: {314 contentType: ej.ContentType.ImageOnly,315 prefixIcon: "e-icon e-ribbon e-uppercase",316 }317 },318 {319 id: "lowercase",320 text: "Lower Case",321 toolTip: "Lower Case",322 buttonSettings: {323 contentType: ej.ContentType.ImageOnly,324 prefixIcon: "e-icon e-ribbon e-lowercase",325 }326 }],327 defaults: {328 type: ej.Ribbon.Type.Button,329 isBig: false330 }331 }]332 },333 {334 text: "Actions", alignType: ej.Ribbon.AlignType.Rows, content: [{335 groups: [{336 id: "undo",337 text: "Undo",338 toolTip: "Undo",339 buttonSettings: {340 contentType: ej.ContentType.TextAndImage,341 imagePosition: ej.ImagePosition.ImageTop,342 prefixIcon: "e-icon e-ribbon e-undo",343 }344 },345 {346 id: "redo",347 text: "Redo",348 toolTip: "Redo",349 buttonSettings: {350 contentType: ej.ContentType.TextAndImage,351 imagePosition: ej.ImagePosition.ImageTop,352 prefixIcon: "e-icon e-ribbon e-redo",353 }354 }355 ],356 defaults: {357 type: ej.Ribbon.Type.Button,358 width: 40,359 height: 70360 }361 }]362 },363 {364 text: "View", alignType: ej.Ribbon.AlignType.Rows, content: [{365 groups: [{366 id: "zoomin",367 text: "Zoom In",368 toolTip: "Zoom In",369 width: 58,370 buttonSettings: {371 contentType: ej.ContentType.TextAndImage,372 imagePosition: ej.ImagePosition.ImageTop,373 prefixIcon: "e-icon e-ribbon e-zoomin",374 }375 },376 {377 id: "zoomout",378 text: "Zoom Out",379 toolTip: "Zoom Out",380 width: 70,381 buttonSettings: {382 contentType: ej.ContentType.TextAndImage,383 imagePosition: ej.ImagePosition.ImageTop,384 prefixIcon: "e-icon e-ribbon e-zoomout",385 }386 },387 {388 id: "fullscreen",389 text: "Full Screen",390 toolTip: "Full Screen",391 width: 73,392 buttonSettings: {393 contentType: ej.ContentType.TextAndImage,394 imagePosition: ej.ImagePosition.ImageTop,395 prefixIcon: "e-icon e-ribbon e-fullscreen",396 }397 }398 ],399 defaults: {400 type: ej.Ribbon.Type.Button,401 height: 70402 }403 }]404 }]405 },406 {407 id: "insert", text: "INSERT", groups: [{408 text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{409 groups: [{410 id: "tables",411 text: "Tables",412 isMobileOnly: true,413 toolTip: "Tables",414 buttonSettings: {415 contentType: ej.ContentType.TextAndImage,416 imagePosition: ej.ImagePosition.ImageTop,417 prefixIcon: "e-icon e-ribbon e-table",418 }419 }420 ],421 defaults: {422 type: ej.Ribbon.Type.Button,423 width: 50,424 height: 70425 }426 }]427 },428 {429 text: "Illustrations", alignType: ej.Ribbon.AlignType.Rows, content: [{430 groups: [{431 id: "pictures",432 text: "Pictures",433 toolTip: "Pictures",434 buttonSettings: {435 contentType: ej.ContentType.TextAndImage,436 imagePosition: ej.ImagePosition.ImageTop,437 prefixIcon: "e-icon e-ribbon e-picture",438 }439 },440 {441 id: "videos",442 text: "Videos",443 toolTip: "Videos",444 buttonSettings: {445 contentType: ej.ContentType.TextAndImage,446 imagePosition: ej.ImagePosition.ImageTop,447 prefixIcon: "e-icon e-ribbon e-video",448 }449 },450 {451 id: "shapes",452 text: "Shapes",453 toolTip: "Shapes",454 buttonSettings: {455 contentType: ej.ContentType.TextAndImage,456 imagePosition: ej.ImagePosition.ImageTop,457 prefixIcon: "e-icon e-ribbon e-shape",458 }459 },460 {461 id: "charts",462 text: "Charts",463 toolTip: "Charts",464 buttonSettings: {465 contentType: ej.ContentType.TextAndImage,466 imagePosition: ej.ImagePosition.ImageTop,467 prefixIcon: "e-icon e-ribbon e-chart",468 }469 }470 ],471 defaults: {472 type: ej.Ribbon.Type.Button,473 width: 56,474 height: 70475 }476 }]477 },478 {479 text: "Comments", alignType: ej.Ribbon.AlignType.Rows, content: [{480 groups: [{481 id: "comments",482 text: "Comments",483 toolTip: "Comments",484 buttonSettings: {485 contentType: ej.ContentType.TextAndImage,486 imagePosition: ej.ImagePosition.ImageTop,487 prefixIcon: "e-icon e-ribbon e-comment",488 }489 }490 ],491 defaults: {492 type: ej.Ribbon.Type.Button,493 width: 70,494 height: 70495 }496 }]497 },498 {499 text: "Text", alignType: ej.Ribbon.AlignType.Rows, content: [{500 groups: [{501 id: "text",502 text: "Text",503 toolTip: "Text",504 buttonSettings: {505 contentType: ej.ContentType.TextAndImage,506 imagePosition: ej.ImagePosition.ImageTop,507 prefixIcon: "e-icon e-ribbon e-text",508 width: 50,509 }510 },511 {512 id: "datetime",513 text: "Date Time",514 toolTip: "DateTime",515 buttonSettings: {516 contentType: ej.ContentType.TextAndImage,517 imagePosition: ej.ImagePosition.ImageTop,518 prefixIcon: "e-icon e-ribbon e-datetimenew",519 }520 }521 ],522 defaults: {523 type: ej.Ribbon.Type.Button,524 width: 70,525 height: 70526 }527 }]528 },529 {530 text: "Hyperlink", alignType: ej.Ribbon.AlignType.Rows, content: [{531 groups: [{532 id: "hyperlink",533 text: "Hyperlink",534 toolTip: "Hyperlink",535 buttonSettings: {536 contentType: ej.ContentType.TextAndImage,537 imagePosition: ej.ImagePosition.ImageTop,538 prefixIcon: "e-icon e-ribbon e-hyperlink",539 }540 }541 ],542 defaults: {543 type: ej.Ribbon.Type.Button,544 width: 70,545 height: 70546 }547 }]548 },549 {550 text: "Equation", alignType: ej.Ribbon.AlignType.Rows, content: [{551 groups: [{552 id: "equation",553 text: "Equation",554 toolTip: "Equation",555 buttonSettings: {556 contentType: ej.ContentType.TextAndImage,557 imagePosition: ej.ImagePosition.ImageTop,558 prefixIcon: "e-icon e-ribbon e-equation",559 }560 }561 ],562 defaults: {563 type: ej.Ribbon.Type.Button,564 width: 60,565 height: 70566 }567 }]568 },569 {570 text: "Print Layout", alignType: ej.Ribbon.AlignType.Rows, content: [{571 groups: [{572 id: "printlayout",573 text: "Print Layout",574 toolTip: "Print Layout",575 buttonSettings: {576 contentType: ej.ContentType.TextAndImage,577 imagePosition: ej.ImagePosition.ImageTop,578 prefixIcon: "e-icon e-ribbon e-printlayout",579 }580 }581 ],582 defaults: {583 type: ej.Ribbon.Type.Button,584 width: 80,585 height: 70586 }587 }]588 },589 {590 text: "Save", alignType: ej.Ribbon.AlignType.Rows, content: [{591 groups: [{592 id: "print",593 text: "Print",594 toolTip: "Print",595 buttonSettings: {596 contentType: ej.ContentType.TextAndImage,597 imagePosition: ej.ImagePosition.ImageTop,598 prefixIcon: "e-icon e-ribbon e-print",599 }600 },601 {602 id: "save",603 text: "Save",604 toolTip: "Save",605 buttonSettings: {606 contentType: ej.ContentType.TextAndImage,607 imagePosition: ej.ImagePosition.ImageTop,608 prefixIcon: "e-icon e-ribbon e-save",609 }610 }], 611 defaults: 612 {613 type: ej.Ribbon.Type.Button,614 width: 50,615 height: 70616 }617 }]618 }619 ]620 }],621 onCreate: function(){622 Ember.$("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon" });623 Ember.$("#fillcolor").ejColorPicker({ value: "#FF0000", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fillcoloricon" });624 }625 }626 }...

Full Screen

Full Screen

default.js

Source:default.js Github

copy

Full Screen

1import Ember from 'ember';2export default Ember.Route.extend({3 model(){4 return {5 expandPinSettings:{ toolTip: "Collapse the Ribbon" },6 collapsePinSettings:{toolTip: "Pin the Ribbon" },7 allowResizing : true,8 applicationTab : {9 type: ej.Ribbon.ApplicationTabType.Menu,10 menuItemID: "ribbonmenu", 11 menuSettings: { openOnClick: false }12 },13 tabs: [{14 id: "home", text: "HOME", groups: [{15 text: "New", alignType: ej.Ribbon.AlignType.Rows, content: [{16 groups: [{17 id: "new",18 text: "New",19 toolTip: "New",20 isMobileOnly: true,21 buttonSettings: {22 contentType: ej.ContentType.ImageOnly,23 imagePosition: ej.ImagePosition.ImageTop,24 prefixIcon: "e-icon e-ribbon e-new",25 }26 }27 ],28 defaults: {29 type: ej.Ribbon.Type.Button,30 width: 60,31 height: 7032 }33 }]34 },35 {36 text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{37 groups: [{38 id: "paste",39 text: "paste",40 toolTip: "Paste",41 splitButtonSettings: {42 contentType: ej.ContentType.ImageOnly,43 prefixIcon: "e-icon e-ribbon e-ribbonpaste",44 targetID: "pasteSplit",45 buttonMode: "dropdown",46 arrowPosition: ej.ArrowPosition.Bottom,47 }48 }49 ],50 defaults: {51 type: ej.Ribbon.Type.SplitButton,52 width: 50,53 height: 7054 }55 },56 {57 groups: [{58 id: "cut",59 text: "Cut",60 toolTip: "Cut",61 buttonSettings: {62 contentType: ej.ContentType.TextAndImage,63 prefixIcon: "e-icon e-ribbon e-ribboncut",64 }65 },66 {67 id: "copy",68 text: "Copy",69 toolTip: "Copy",70 buttonSettings: {71 contentType: ej.ContentType.TextAndImage,72 prefixIcon: "e-icon e-ribbon e-ribboncopy",73 }74 },75 {76 id: "clear",77 text: "Clear",78 toolTip: "Clear All",79 buttonSettings: {80 contentType: ej.ContentType.TextAndImage,81 prefixIcon: "e-icon e-ribbon clearAll",82 }83 }],84 defaults: {85 type: ej.Ribbon.Type.Button,86 width: 60,87 isBig: false88 }89 }]90 },91 {92 text: "Font", alignType: "rows", content: [{93 groups: [{94 id: "fontfamily",95 toolTip: "Font",96 dropdownSettings: {97 dataSource: ["Segoe UI", "Arial", "Times New Roman", "Tahoma", "Helvetica"],98 text: "Segoe UI",99 width: 150100 }101 },102 {103 id: "fontsize",104 toolTip: "FontSize",105 dropdownSettings: {106 dataSource: ["1pt", "2pt", "3pt", "4pt", "5pt"],107 text: "1pt",108 width: 65109 }110 }],111 defaults: {112 type: ej.Ribbon.Type.DropDownList,113 height: 28114 }115 },116 {117 groups: [{118 id: "bold",119 toolTip: "Bold",120 type: ej.Ribbon.Type.ToggleButton,121 toggleButtonSettings: {122 contentType: ej.ContentType.ImageOnly,123 defaultText: "Bold",124 activeText: "Bold",125 defaultPrefixIcon: "e-icon e-ribbon bold",126 activePrefixIcon: "e-icon e-ribbon bold",127 }128 },129 {130 id: "italic",131 toolTip: "Italic",132 type: ej.Ribbon.Type.ToggleButton,133 toggleButtonSettings: {134 contentType: ej.ContentType.ImageOnly,135 defaultText: "Italic",136 activeText: "Italic",137 defaultPrefixIcon: "e-icon e-ribbon e-ribbonitalic",138 activePrefixIcon: "e-icon e-ribbon e-ribbonitalic",139 }140 },141 {142 id: "underline",143 text: "Underline",144 toolTip: "Underline",145 type: ej.Ribbon.Type.ToggleButton,146 toggleButtonSettings: {147 contentType: ej.ContentType.ImageOnly,148 defaultText: "Underline",149 activeText: "Underline",150 defaultPrefixIcon: "e-icon e-ribbon e-ribbonunderline",151 activePrefixIcon: "e-icon e-ribbon e-ribbonunderline",152 }153 },154 {155 id: "strikethrough",156 text: "strikethrough",157 toolTip: "Strikethrough",158 type: ej.Ribbon.Type.ToggleButton,159 toggleButtonSettings: {160 contentType: ej.ContentType.ImageOnly,161 defaultText: "Strikethrough",162 activeText: "Strikethrough",163 defaultPrefixIcon: "e-icon e-ribbon strikethrough",164 activePrefixIcon: "e-icon e-ribbon strikethrough",165 }166 },167 {168 id: "superscript",169 text: "superscript",170 toolTip: "Superscript",171 buttonSettings: {172 contentType: ej.ContentType.ImageOnly,173 prefixIcon: "e-icon e-ribbon e-superscripticon",174 }175 },176 {177 id: "subscript",178 text: "subscript",179 toolTip: "Subscript",180 enableSeparator: true,181 buttonSettings: {182 contentType: ej.ContentType.ImageOnly,183 prefixIcon: "e-icon e-ribbon e-subscripticon",184 }185 },186 {187 id: "fontcolor",188 text: "Font Color",189 toolTip: "Font Color",190 type: ej.Ribbon.type.custom,191 contentID: "fontcolor"192 },193 {194 id: "fillcolor",195 text: "Fill Color",196 toolTip: "Fill Color",197 type: ej.Ribbon.type.custom,198 contentID: "fillcolor"199 }200 ],201 defaults: {202 isBig: false,203 }204 }]205 },206 {207 text: "Alignment", alignType: ej.Ribbon.AlignType.Rows, content: [208 {209 groups: [{210 id: "bullet",211 text: "Bullet Format",212 toolTip: "Bullets",213 buttonSettings: {214 contentType: ej.ContentType.ImageOnly,215 prefixIcon: "e-icon e-ribbon e-bullet",216 }217 },218 {219 id: "number",220 text: "Number Format",221 toolTip: "Numbering",222 enableSeparator: true,223 buttonSettings: {224 contentType: ej.ContentType.ImageOnly,225 prefixIcon: "e-icon e-ribbon e-numbericon",226 }227 },228 {229 id: "textindent",230 text: "Indent",231 toolTip: "Text Indent",232 buttonSettings: {233 contentType: ej.ContentType.ImageOnly,234 prefixIcon: "e-icon e-ribbon e-indent",235 }236 },237 {238 id: "textoudent",239 text: "Outdent",240 toolTip: "Text Outdent",241 enableSeparator: true,242 buttonSettings: {243 contentType: ej.ContentType.ImageOnly,244 prefixIcon: "e-icon e-ribbon e-outdent",245 }246 },247 {248 id: "sortascending",249 text: "Sort",250 toolTip: "Sort",251 enableSeparator: true,252 buttonSettings: {253 contentType: ej.ContentType.ImageOnly,254 prefixIcon: "e-icon e-ribbon e-sort",255 }256 },257 {258 id: "border",259 text: "Border",260 toolTip: "Border",261 buttonSettings: {262 contentType: ej.ContentType.ImageOnly,263 prefixIcon: "e-icon e-ribbon e-border",264 }265 }],266 defaults: {267 type: ej.Ribbon.Type.Button,268 isBig: false269 }270 },271 {272 groups: [{273 id: "alignleft",274 text: "JustifyLeft",275 toolTip: "Align Left",276 buttonSettings: {277 contentType: ej.ContentType.ImageOnly,278 prefixIcon: "e-icon e-ribbon alignleft",279 }280 },281 {282 id: "aligncenter",283 text: "JustifyCenter",284 toolTip: "Align Center",285 buttonSettings: {286 contentType: ej.ContentType.ImageOnly,287 prefixIcon: "e-icon e-ribbon aligncenter",288 }289 },290 {291 id: "alignright",292 text: "JustifyRight",293 toolTip: "Align Right",294 buttonSettings: {295 contentType: ej.ContentType.ImageOnly,296 prefixIcon: "e-icon e-ribbon alignright",297 }298 },299 {300 id: "justify",301 text: "JustifyFull",302 toolTip: "Justify",303 enableSeparator: true,304 buttonSettings: {305 contentType: ej.ContentType.ImageOnly,306 prefixIcon: "e-icon e-ribbon justify",307 }308 },309 {310 id: "uppercase",311 text: "Upper Case",312 toolTip: "Upper Case",313 buttonSettings: {314 contentType: ej.ContentType.ImageOnly,315 prefixIcon: "e-icon e-ribbon e-uppercase",316 }317 },318 {319 id: "lowercase",320 text: "Lower Case",321 toolTip: "Lower Case",322 buttonSettings: {323 contentType: ej.ContentType.ImageOnly,324 prefixIcon: "e-icon e-ribbon e-lowercase",325 }326 }],327 defaults: {328 type: ej.Ribbon.Type.Button,329 isBig: false330 }331 }]332 },333 {334 text: "Actions", alignType: ej.Ribbon.AlignType.Rows, content: [{335 groups: [{336 id: "undo",337 text: "Undo",338 toolTip: "Undo",339 buttonSettings: {340 contentType: ej.ContentType.TextAndImage,341 imagePosition: ej.ImagePosition.ImageTop,342 prefixIcon: "e-icon e-ribbon e-undo",343 }344 },345 {346 id: "redo",347 text: "Redo",348 toolTip: "Redo",349 buttonSettings: {350 contentType: ej.ContentType.TextAndImage,351 imagePosition: ej.ImagePosition.ImageTop,352 prefixIcon: "e-icon e-ribbon e-redo",353 }354 }355 ],356 defaults: {357 type: ej.Ribbon.Type.Button,358 width: 40,359 height: 70360 }361 }]362 },363 {364 text: "View", alignType: ej.Ribbon.AlignType.Rows, content: [{365 groups: [{366 id: "zoomin",367 text: "Zoom In",368 toolTip: "Zoom In",369 width: 58,370 buttonSettings: {371 contentType: ej.ContentType.TextAndImage,372 imagePosition: ej.ImagePosition.ImageTop,373 prefixIcon: "e-icon e-ribbon e-zoomin",374 }375 },376 {377 id: "zoomout",378 text: "Zoom Out",379 toolTip: "Zoom Out",380 width: 70,381 buttonSettings: {382 contentType: ej.ContentType.TextAndImage,383 imagePosition: ej.ImagePosition.ImageTop,384 prefixIcon: "e-icon e-ribbon e-zoomout",385 }386 },387 {388 id: "fullscreen",389 text: "Full Screen",390 toolTip: "Full Screen",391 width: 73,392 buttonSettings: {393 contentType: ej.ContentType.TextAndImage,394 imagePosition: ej.ImagePosition.ImageTop,395 prefixIcon: "e-icon e-ribbon e-fullscreen",396 }397 }398 ],399 defaults: {400 type: ej.Ribbon.Type.Button,401 height: 70402 }403 }]404 }]405 },406 {407 id: "insert", text: "INSERT", groups: [{408 text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{409 groups: [{410 id: "tables",411 text: "Tables",412 isMobileOnly: true,413 toolTip: "Tables",414 buttonSettings: {415 contentType: ej.ContentType.TextAndImage,416 imagePosition: ej.ImagePosition.ImageTop,417 prefixIcon: "e-icon e-ribbon e-table",418 }419 }420 ],421 defaults: {422 type: ej.Ribbon.Type.Button,423 width: 50,424 height: 70425 }426 }]427 },428 {429 text: "Illustrations", alignType: ej.Ribbon.AlignType.Rows, content: [{430 groups: [{431 id: "pictures",432 text: "Pictures",433 toolTip: "Pictures",434 buttonSettings: {435 contentType: ej.ContentType.TextAndImage,436 imagePosition: ej.ImagePosition.ImageTop,437 prefixIcon: "e-icon e-ribbon e-picture",438 }439 },440 {441 id: "videos",442 text: "Videos",443 toolTip: "Videos",444 buttonSettings: {445 contentType: ej.ContentType.TextAndImage,446 imagePosition: ej.ImagePosition.ImageTop,447 prefixIcon: "e-icon e-ribbon e-video",448 }449 },450 {451 id: "shapes",452 text: "Shapes",453 toolTip: "Shapes",454 buttonSettings: {455 contentType: ej.ContentType.TextAndImage,456 imagePosition: ej.ImagePosition.ImageTop,457 prefixIcon: "e-icon e-ribbon e-shape",458 }459 },460 {461 id: "charts",462 text: "Charts",463 toolTip: "Charts",464 buttonSettings: {465 contentType: ej.ContentType.TextAndImage,466 imagePosition: ej.ImagePosition.ImageTop,467 prefixIcon: "e-icon e-ribbon e-chart",468 }469 }470 ],471 defaults: {472 type: ej.Ribbon.Type.Button,473 width: 56,474 height: 70475 }476 }]477 },478 {479 text: "Comments", alignType: ej.Ribbon.AlignType.Rows, content: [{480 groups: [{481 id: "comments",482 text: "Comments",483 toolTip: "Comments",484 buttonSettings: {485 contentType: ej.ContentType.TextAndImage,486 imagePosition: ej.ImagePosition.ImageTop,487 prefixIcon: "e-icon e-ribbon e-comment",488 }489 }490 ],491 defaults: {492 type: ej.Ribbon.Type.Button,493 width: 70,494 height: 70495 }496 }]497 },498 {499 text: "Text", alignType: ej.Ribbon.AlignType.Rows, content: [{500 groups: [{501 id: "text",502 text: "Text",503 toolTip: "Text",504 buttonSettings: {505 contentType: ej.ContentType.TextAndImage,506 imagePosition: ej.ImagePosition.ImageTop,507 prefixIcon: "e-icon e-ribbon e-text",508 width: 50,509 }510 },511 {512 id: "datetime",513 text: "Date Time",514 toolTip: "DateTime",515 buttonSettings: {516 contentType: ej.ContentType.TextAndImage,517 imagePosition: ej.ImagePosition.ImageTop,518 prefixIcon: "e-icon e-ribbon e-datetimenew",519 }520 }521 ],522 defaults: {523 type: ej.Ribbon.Type.Button,524 width: 70,525 height: 70526 }527 }]528 },529 {530 text: "Hyperlink", alignType: ej.Ribbon.AlignType.Rows, content: [{531 groups: [{532 id: "hyperlink",533 text: "Hyperlink",534 toolTip: "Hyperlink",535 buttonSettings: {536 contentType: ej.ContentType.TextAndImage,537 imagePosition: ej.ImagePosition.ImageTop,538 prefixIcon: "e-icon e-ribbon e-hyperlink",539 }540 }541 ],542 defaults: {543 type: ej.Ribbon.Type.Button,544 width: 70,545 height: 70546 }547 }]548 },549 {550 text: "Equation", alignType: ej.Ribbon.AlignType.Rows, content: [{551 groups: [{552 id: "equation",553 text: "Equation",554 toolTip: "Equation",555 buttonSettings: {556 contentType: ej.ContentType.TextAndImage,557 imagePosition: ej.ImagePosition.ImageTop,558 prefixIcon: "e-icon e-ribbon e-equation",559 }560 }561 ],562 defaults: {563 type: ej.Ribbon.Type.Button,564 width: 60,565 height: 70566 }567 }]568 },569 {570 text: "Print Layout", alignType: ej.Ribbon.AlignType.Rows, content: [{571 groups: [{572 id: "printlayout",573 text: "Print Layout",574 toolTip: "Print Layout",575 buttonSettings: {576 contentType: ej.ContentType.TextAndImage,577 imagePosition: ej.ImagePosition.ImageTop,578 prefixIcon: "e-icon e-ribbon e-printlayout",579 }580 }581 ],582 defaults: {583 type: ej.Ribbon.Type.Button,584 width: 80,585 height: 70586 }587 }]588 },589 {590 text: "Save", alignType: ej.Ribbon.AlignType.Rows, content: [{591 groups: [{592 id: "print",593 text: "Print",594 toolTip: "Print",595 buttonSettings: {596 contentType: ej.ContentType.TextAndImage,597 imagePosition: ej.ImagePosition.ImageTop,598 prefixIcon: "e-icon e-ribbon e-print",599 }600 },601 {602 id: "save",603 text: "Save",604 toolTip: "Save",605 buttonSettings: {606 contentType: ej.ContentType.TextAndImage,607 imagePosition: ej.ImagePosition.ImageTop,608 prefixIcon: "e-icon e-ribbon e-save",609 }610 }], 611 defaults: 612 {613 type: ej.Ribbon.Type.Button,614 width: 50,615 height: 70616 }617 }]618 }619 ]620 }],621 onCreate: function(){622 Ember.$("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon" });623 Ember.$("#fillcolor").ejColorPicker({ value: "#FF0000", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fillcoloricon" });624 }625 }626 }...

Full Screen

Full Screen

requestmediakeysystemaccess.js

Source:requestmediakeysystemaccess.js Github

copy

Full Screen

1function runTest(config, qualifier) {2 var prefix = testnamePrefix(qualifier, config.keysystem) + ', requestMediaKeySystemAccess: ';3 function expect_error(keySystem, configurations, expectedError, testname) {4 var audioCapabilities = configurations.length ? configurations[0].audioCapabilities : undefined,5 videoCapabilities = configurations.length ? configurations[0].videoCapabilities : undefined,6 audiocontenttypes = audioCapabilities ? audioCapabilities.map( function(ac) { return "'" + ac.contentType + "'"; } ).join(',') : '',7 videocontenttypes = videoCapabilities ? videoCapabilities.map( function(ac) { return "'" + ac.contentType + "'"; } ).join(',') : '',8 modifiedtestname = testname.replace( '%audiocontenttype', audiocontenttypes ).replace( '%videocontenttype', videocontenttypes );9 promise_test(function(test) {10 return navigator.requestMediaKeySystemAccess(keySystem, configurations).then(function(a) {11 assert_unreached('Unexpected requestMediaKeySystemAccess() success.');12 }, function(e) {13 assert_equals(e.name, expectedError);14 });15 }, prefix + modifiedtestname + ' should result in ' + expectedError );16 }17 function assert_subset(actual, expected, path) {18 if (typeof expected == 'string') {19 assert_equals(actual, expected, path);20 } else {21 if (expected.hasOwnProperty('length')) {22 assert_equals(actual.length, expected.length, path + '.length');23 }24 for (property in expected) {25 assert_subset(actual[property], expected[property], path + '.' + property);26 }27 }28 }29 function expect_config(keySystem, configurations, expectedConfiguration, testname) {30 promise_test(function(test) {31 return navigator.requestMediaKeySystemAccess(keySystem, configurations).then(function(a) {32 assert_subset(a.getConfiguration(), expectedConfiguration, testname + ': ');33 });34 }, testname);35 }36 // Tests for Key System.37 expect_error('', [{}], 'TypeError', 'Empty Key System');38 expect_error('com.example.unsupported', [{}], 'NotSupportedError', 'Unsupported Key System');39 expect_error(config.keysystem + '.', [{}], 'NotSupportedError', 'Key System ending in "."');40 expect_error(config.keysystem.toUpperCase(), [{}], 'NotSupportedError', 'Capitalized Key System');41 expect_error(config.keysystem + '\u028F', [{}], 'NotSupportedError', 'Non-ASCII Key System');42 // Parent of Clear Key not supported.43 expect_error(config.keysystem.match(/^(.*?)\./)[1], [{}], 'NotSupportedError', 'Root domain of Key System alone');44 expect_error(config.keysystem.match(/^(.*?)\./)[0], [{}], 'NotSupportedError', 'Root domain of Key System, with dot');45 expect_error(config.keysystem.match(/^(.*?\..*?)\./)[1], [{}], 'NotSupportedError', 'Domain of Key System along');46 expect_error(config.keysystem.match(/^(.*?\..*?)\./)[0], [{}], 'NotSupportedError', 'Domain of Key System, with dot');47 // Child of Clear Key not supported.48 expect_error(config.keysystem+'.foo', [{}], 'NotSupportedError', 'Child of Key System');49 // Prefixed Clear Key not supported.50 expect_error('webkit-'+config.keysystem, [{}], 'NotSupportedError', 'Prefixed Key System');51 // Incomplete names.52 expect_error(config.keysystem.substr(0,7)+config.keysystem.substr(8), [{}], 'NotSupportedError', 'Missing characters in middle of Key System name');53 expect_error(config.keysystem.substr(0,config.keysystem.length-1), [{}], 'NotSupportedError', 'Missing characters at end of Key System name');54 // Spaces in key system name not supported.55 expect_error(' '+config.keysystem, [{}], 'NotSupportedError', 'Leading space in Key System name');56 expect_error(config.keysystem.substr(0,6) + ' ' + config.keysystem.substr(6), [{}], 'NotSupportedError', 'Extra space in Key System name');57 expect_error(config.keysystem + ' ', [{}], 'NotSupportedError', 'Trailing space in Key System name');58 // Extra dots in key systems names not supported.59 expect_error('.' + config.keysystem, [{}], 'NotSupportedError', 'Leading dot in Key System name');60 expect_error(config.keysystem.substr(0,6) + '.' + config.keysystem.substr(6), [{}], 'NotSupportedError', 'Extra dot in middle of Key System name');61 expect_error(config.keysystem + '.', [{}], 'NotSupportedError', 'Trailing dot in Key System name');62 // Key system name is case sensitive.63 if (config.keysystem !== config.keysystem.toUpperCase()) {64 expect_error(config.keysystem.toUpperCase(), [{}], 'NotSupportedError', 'Key System name is case sensitive');65 }66 if (config.keysystem !== config.keysystem.toLowerCase()) {67 expect_error(config.keysystem.toLowerCase(), [{}], 'NotSupportedError', 'Key System name is case sensitive');68 }69 // Tests for trivial configurations.70 expect_error(config.keysystem, [], 'TypeError', 'Empty supportedConfigurations');71 expect_config(config.keysystem, [{}], {}, 'Empty configuration');72 // Various combinations of supportedConfigurations.73 expect_config(config.keysystem, [{74 initDataTypes: [config.initDataType],75 audioCapabilities: [{contentType: config.audioType}],76 videoCapabilities: [{contentType: config.videoType}],77 }], {78 initDataTypes: [config.initDataType],79 audioCapabilities: [{contentType: config.audioType}],80 videoCapabilities: [{contentType: config.videoType}],81 }, 'Basic supported configuration');82 expect_config(config.keysystem, [{83 initDataTypes: ['fakeidt', config.initDataType],84 audioCapabilities: [{contentType: 'audio/fake'}, {contentType: config.audioType}],85 videoCapabilities: [{contentType: 'video/fake'}, {contentType: config.videoType}],86 }], {87 initDataTypes: [config.initDataType],88 audioCapabilities: [{contentType: config.audioType}],89 videoCapabilities: [{contentType: config.videoType}],90 }, 'Partially supported configuration');91 expect_config(config.keysystem, [{92 audioCapabilities: [{contentType: config.audioType}],93 }], {94 audioCapabilities: [{contentType: config.audioType}],95 }, 'Supported audio codec');96 expect_config(config.keysystem, [{97 audioCapabilities: [{contentType: config.audioType.replace(/^(.*?);(.*)/, "$1; $2")}],98 }], {99 audioCapabilities: [{contentType: config.audioType.replace(/^(.*?);(.*)/, "$1; $2")}],100 }, 'ContentType formatting must be preserved');101 expect_error(config.keysystem, [{102 audioCapabilities: [{contentType: 'audio/webm; codecs=fake'}],103 }], 'NotSupportedError', 'Unsupported audio codec (%audiocontenttype)');104 expect_error(config.keysystem, [{105 audioCapabilities: [{contentType: 'video/webm; codecs=fake'}],106 }], 'NotSupportedError', 'Unsupported video codec (%videocontenttype)');107 expect_error(config.keysystem, [{108 audioCapabilities: [109 {contentType: 'audio/webm; codecs=mp4a'},110 {contentType: 'audio/webm; codecs=mp4a.40.2'}111 ],112 }], 'NotSupportedError', 'Mismatched audio container/codec (%audiocontenttype)');113 expect_error(config.keysystem, [{114 audioCapabilities: [{contentType: config.videoType}],115 }], 'NotSupportedError', 'Video codec specified in audio field (%audiocontenttype)');116 expect_error(config.keysystem, [{117 videoCapabilities: [{contentType: config.audioType}],118 }], 'NotSupportedError', 'Audio codec specified in video field (%videocontenttype)');119 expect_error(config.keysystem, [{120 audioCapabilities: [121 {contentType: 'audio/webm; codecs=avc1'},122 {contentType: 'audio/webm; codecs=avc1.42e01e'}123 ],124 }], 'NotSupportedError', 'Mismatched audio container/codec (%audiocontenttype)');125 expect_error(config.keysystem, [{126 audioCapabilities: [127 {contentType: 'audio/mp4; codecs=vorbis'}128 ],129 }], 'NotSupportedError', 'Mismatched audio container/codec (%audiocontenttype)');130 expect_config(config.keysystem, [131 {initDataTypes: ['fakeidt']},132 {initDataTypes: [config.initDataType]}133 ], {initDataTypes: [config.initDataType]}, 'Two configurations, one supported');134 expect_config(config.keysystem, [135 {initDataTypes: [config.initDataType]},136 {}137 ], {initDataTypes: [config.initDataType]}, 'Two configurations, both supported');138 // Audio MIME type does not support video codecs.139 expect_error(config.keysystem, [{140 audioCapabilities: [141 {contentType: 'audio/webm; codecs="vp8,vorbis"'},142 {contentType: 'audio/webm; codecs="vorbis, vp8"'},143 {contentType: 'audio/webm; codecs="vp8"'}144 ],145 }], 'NotSupportedError', 'Audio MIME type does not support video codecs (webm) (%audiocontenttype)');146 expect_error(config.keysystem, [{147 audioCapabilities: [148 {contentType: 'audio/mp4; codecs="avc1"'},149 {contentType: 'audio/mp4; codecs="avc1.4d401e"'},150 ],151 }], 'NotSupportedError', 'Audio MIME type does not support video codecs (mp4) (%audiocontenttype)');152 // Video MIME type does not support audio codecs.153 expect_error(config.keysystem, [{154 videoCapabilities: [155 {contentType: 'video/webm; codecs="vp8,vorbis"'},156 {contentType: 'video/webm; codecs="vorbis, vp8"'},157 {contentType: 'video/webm; codecs="vorbis"'}158 ],159 }], 'NotSupportedError', 'Video MIME type does not support audio codecs (webm) (%videocontenttype)');160 expect_error(config.keysystem, [{161 videoCapabilities: [162 {contentType: 'video/mp4; codecs="mp4a"'},163 {contentType: 'video/mp4; codecs="mp4a.40.2"'}164 ],165 }], 'NotSupportedError', 'Video MIME type does not support audio codecs (mp4) (%videocontenttype)');166 // WebM does not support AVC1/AAC.167 expect_error(config.keysystem, [{168 audioCapabilities: [169 {contentType: 'audio/webm; codecs="aac"'},170 {contentType: 'audio/webm; codecs="avc1"'},171 {contentType: 'audio/webm; codecs="vp8,aac"'}172 ],173 }], 'NotSupportedError', 'WebM audio does not support AVC1/AAC (%audiocontenttype)');174 expect_error(config.keysystem, [{175 videoCapabilities: [176 {contentType: 'video/webm; codecs="aac"'},177 {contentType: 'video/webm; codecs="avc1"'},178 {contentType: 'video/webm; codecs="vp8,aac"'}179 ],180 }], 'NotSupportedError', 'WebM video does not support AVC1/AAC (%videocontenttype)');181 // Extra space is allowed in contentType.182 expect_config(config.keysystem, [{183 videoCapabilities: [{contentType: ' ' + config.videoType}],184 }], {185 videoCapabilities: [{contentType: ' ' + config.videoType}],186 }, 'Leading space in contentType');187 expect_config(config.keysystem, [{188 videoCapabilities: [{contentType: config.videoType.replace( /^(.*?);(.*)/, "$1 ;$2")}],189 }], {190 videoCapabilities: [{contentType: config.videoType.replace( /^(.*?);(.*)/, "$1 ;$2")}],191 }, 'Space before ; in contentType');192 expect_config(config.keysystem, [{193 videoCapabilities: [{contentType: config.videoType + ' '}],194 }], {195 videoCapabilities: [{contentType: config.videoType + ' '}],196 }, 'Trailing space in contentType');197 expect_config(config.keysystem, [{198 videoCapabilities: [{contentType: config.videoType.replace( /^(.*?codecs=\")(.*)/, "$1 $2")}],199 }], {200 videoCapabilities: [{contentType: config.videoType.replace( /^(.*?codecs=\")(.*)/, "$1 $2")}],201 }, 'Space at start of codecs parameter');202 expect_config(config.keysystem, [{203 videoCapabilities: [{contentType: config.videoType.replace( /^(.*?codecs=\".*)\"/, "$1 \"")}],204 }], {205 videoCapabilities: [{contentType: config.videoType.replace( /^(.*?codecs=\".*)\"/, "$1 \"")}],206 }, 'Space at end of codecs parameter');207 // contentType is not case sensitive (except the codec names).208 expect_config(config.keysystem, [{209 videoCapabilities: [{contentType: 'V' + config.videoType.substr(1)}],210 }], {211 videoCapabilities: [{contentType: 'V' + config.videoType.substr(1)}],212 }, 'Video/' );213 expect_config(config.keysystem, [{214 videoCapabilities: [{contentType: config.videoType.replace( /^(.*?)c(odecs.*)/, "$1C$2")}],215 }], {216 videoCapabilities: [{contentType: config.videoType.replace( /^(.*?)c(odecs.*)/, "$1C$2")}],217 }, 'Codecs=');218 var t = config.videoType.match(/(.*?)(;.*)/);219 expect_config(config.keysystem, [{220 videoCapabilities: [{contentType: t[1].toUpperCase() + t[2]}],221 }], {222 videoCapabilities: [{contentType: t[1].toUpperCase() + t[2]}],223 }, 'Upper case MIME type');224 t = config.videoType.match(/(.*?)codecs(.*)/);225 expect_config(config.keysystem, [{226 videoCapabilities: [{contentType: t[1] + 'CODECS' + t[2]}],227 }], {228 videoCapabilities: [{contentType: t[1] + 'CODECS' + t[2]}],229 }, 'CODECS=');230 // Unrecognized attributes are not allowed.231 expect_error(config.keysystem, [{232 videoCapabilities: [{contentType: 'video/webm; foo="bar"'}],233 }], 'NotSupportedError', 'Unrecognized foo with webm (%videocontenttype)');234 expect_error(config.keysystem, [{235 videoCapabilities: [{contentType: 'video/mp4; foo="bar"'}],236 }], 'NotSupportedError', 'Unrecognized foo with mp4 (%videocontenttype)');237 expect_error(config.keysystem, [{238 videoCapabilities: [{contentType: config.videoType + '; foo="bar"'}],239 }], 'NotSupportedError', 'Unrecognized foo with codecs (%videocontenttype)');240 // Invalid contentTypes.241 expect_error(config.keysystem, [{242 videoCapabilities: [{contentType: 'fake'}],243 }], 'NotSupportedError', 'contentType: %videocontenttype');244 expect_error(config.keysystem, [{245 audioCapabilities: [{contentType: 'audio/fake'}],246 }], 'NotSupportedError', 'contentType: %audiocontenttype');247 expect_error(config.keysystem, [{248 videoCapabilities: [{contentType: 'video/fake'}],249 }], 'NotSupportedError', 'contentType: %videocontenttype');250 // The actual codec names are case sensitive.251 t = config.videoType.match( /(.*?codecs=\")(.*?\")(.*)/ );252 if (t[2] !== t[2].toUpperCase()) {253 expect_error(config.keysystem, [{254 videoCapabilities: [{contentType: t[1] + t[2].toUpperCase() + t[3] }],255 }], 'NotSupportedError', 'contentType: %videocontenttype');256 }257 if (t[2] !== t[2].toLowerCase()) {258 expect_error(config.keysystem, [{259 videoCapabilities: [{contentType: t[1] + t[2].toLowerCase() + t[3] }],260 }], 'NotSupportedError', 'contentType: %videocontenttype');261 }262 // Extra comma is not allowed in codecs.263 expect_error(config.keysystem, [{264 videoCapabilities: [{contentType: t[1] + ',' + t[2] + t[3] }],265 }], 'NotSupportedError', 'contentType: %videocontenttype');...

Full Screen

Full Screen

storage.js

Source:storage.js Github

copy

Full Screen

1/**2 * Copyright © 2013-2017 Magento, Inc. All rights reserved.3 * See COPYING.txt for license details.4 */5define(['jquery', 'mage/url'], function ($, urlBuilder) {6 'use strict';7 return {8 /**9 * Perform asynchronous GET request to server.10 * @param {String} url11 * @param {Boolean} global12 * @param {String} contentType13 * @returns {Deferred}14 */15 get: function (url, global, contentType) {16 global = global === undefined ? true : global;17 contentType = contentType || 'application/json';18 return $.ajax({19 url: urlBuilder.build(url),20 type: 'GET',21 global: global,22 contentType: contentType23 });24 },25 /**26 * Perform asynchronous POST request to server.27 * @param {String} url28 * @param {String} data29 * @param {Boolean} global30 * @param {String} contentType31 * @returns {Deferred}32 */33 post: function (url, data, global, contentType) {34 global = global === undefined ? true : global;35 contentType = contentType || 'application/json';36 return $.ajax({37 url: urlBuilder.build(url),38 type: 'POST',39 data: data,40 global: global,41 contentType: contentType42 });43 },44 /**45 * Perform asynchronous PUT request to server.46 * @param {String} url47 * @param {String} data48 * @param {Boolean} global49 * @param {String} contentType50 * @returns {Deferred}51 */52 put: function(url, data, global, contentType) {53 global = global === undefined ? true : global;54 contentType = contentType || 'application/json';55 return $.ajax({56 url: urlBuilder.build(url),57 type: 'PUT',58 data: data,59 global: global,60 contentType: contentType61 });62 },63 /**64 * Perform asynchronous DELETE request to server.65 * @param {String} url66 * @param {Boolean} global67 * @param {String} contentType68 * @returns {Deferred}69 */70 delete: function(url, global, contentType) {71 global = global === undefined ? true : global;72 contentType = contentType || 'application/json';73 return $.ajax({74 url: urlBuilder.build(url),75 type: 'DELETE',76 global: global,77 contentType: contentType78 });79 }80 };...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { contentType } from '@storybook/addon-docs/blocks';2import { StorybookRootProvider } from 'storybook-root-provider';3import { StorybookRootProvider } from 'storybook-root-provider';4export const Default = () => (5);6import { StorybookRootProvider } from 'storybook-root-provider';7export const Default = () => (8);9import { StorybookRootProvider } from 'storybook-root-provider';10export const Default = () => (11);12import { StorybookRootProvider } from 'storybook-root-provider';13export const Default = () => (14);15import { StorybookRootProvider } from 'storybook-root-provider';16export const Default = () => (17);18import { StorybookRootProvider } from 'storybook-root-provider';19export const Default = () => (20);21import { StorybookRootProvider } from 'storybook-root-provider';22export const Default = () => (23);24import { StorybookRootProvider } from 'storybook-root-provider';25export const Default = () => (26);27import { StorybookRootProvider } from 'storybook-root-provider';28export const Default = () => (29);30import

Full Screen

Using AI Code Generation

copy

Full Screen

1import { contentType } from 'storybook-root';2function test() {3 contentType();4}5export function contentType() {6 console.log('contentType method called');7}

Full Screen

Using AI Code Generation

copy

Full Screen

1import { contentType } from 'storybook-root';2export default contentType('foo');3export const contentType = (type) => {4 return {5 };6};7import { contentType } from './storybook-root';8export const contentType = (type) => {9 return {10 };11};12import { contentType } from 'storybook-root';13export default contentType('foo');14export const contentType = (type) => {15 return {16 };17};18import { contentType } from './storybook-root';19export const contentType = (type) => {20 return {21 };22};23import { contentType } from 'storybook-root';24export default contentType('foo');25export const contentType = (type) => {26 return {27 };28};29import { contentType } from './storybook-root';30export const contentType = (type) => {31 return {32 };33};34import { contentType } from 'storybook-root';35export default contentType('foo');36export const contentType = (type) => {37 return {38 };39};

Full Screen

Using AI Code Generation

copy

Full Screen

1var contentType = require('storybook-root').contentType;2var contentTypeOfStorybook = contentType('storybook-name');3console.log(contentTypeOfStorybook);4var content = require('storybook-root').content;5var contentOfStorybook = content('storybook-name');6console.log(contentOfStorybook);7var allStorybooks = require('storybook-root').allStorybooks;8var listOfStorybooks = allStorybooks();9console.log(listOfStorybooks);10var allStorybooks = require('storybook-root').allStorybooks;11var listOfStorybooks = allStorybooks();12console.log(listOfStorybooks);13var allStorybooks = require('storybook-root').allStorybooks;14var listOfStorybooks = allStorybooks();15console.log(listOfStorybooks);

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run storybook-root automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful