Best JavaScript code snippet using storybook-root
services.js
Source:services.js
...61 return this.menuItems;62 };63 this.prepareSidebarMenu = function()64 {65 var dashboard = this.addItem('Dashboard', '/app/dashboard', 'fa-th');66 if($rootScope.user.userRole == '0' || $rootScope.user.userRole == '1'|| $rootScope.user.userRole == '4' || $rootScope.user.userRole == '5') {67 var users = this.addItem('Users', '/app/patients', 'fa-user');68 }69 if($rootScope.user.userRole == '0' || $rootScope.user.userRole == '1') {70 var vendors = this.addItem('Vendors', '/app/customers', 'fa-users');71 //var users = this.addItem('Users', '/app/doctors', 'fa-stethoscope');72 //var fos = this.addItem('FOS', '/app/fos', 'fa-medkit');73 var secretary = this.addItem('secretary', '/app/users', 'fa-building-o');74 //var serviceLocation = this.addItem('Service Location', '/app/service-locations', 'fa-location-arrow');75 //var specialization = this.addItem('Specialization', '/app/specialization', 'fa-medkit');76 //var chart = this.addItem('Charts', '/app/chart-list', 'fa-pie-chart');77 }78 if($rootScope.user.userRole == '3') {79 var Ticketrising = this.addItem('Ticket Rising', '/app/tenant-dashboard', 'fa-paper-plane');80 //var tenantMonitoring = this.addItem('Monitoring tickets', '/app/ticket-monitoring', 'fa-inbox');81 //var fosInteraction = this.addItem('FOS Interaction', '/app/fos-interaction', 'fa-hospital-o');82 //var doctorAnalysis = this.addItem('Doctor Analysis', '/app/doctor-analysis', 'fa-stethoscope');83 // var medications = this.addItem('Medications', '/app/medications', 'fa-plus-square');84 }85 if($rootScope.user.userRole == '2') {86 var Vendor = this.addItem('Assigned ticket', '/app/assignedtickets', 'fa-paper-plane');87 //var tenantMonitoring = this.addItem('Monitoring tickets', '/app/', 'fa-inbox');88 //var fosInteraction = this.addItem('FOS Interaction', '/app/fos-interaction', 'fa-hospital-o');89 //var doctorAnalysis = this.addItem('Doctor Analysis', '/app/doctor-analysis', 'fa-stethoscope');90 // var medications = this.addItem('Medications', '/app/medications', 'fa-plus-square');91 }92 // var layouts = this.addItem('Layout & Skins', '/app/layout-and-skins', 'linecons-desktop');93 // var ui_elements = this.addItem('UI Elements', '/app/ui', 'linecons-note');94 // var widgets = this.addItem('Widgets', '/app/widgets', 'linecons-star');95 // var mailbox = this.addItem('Mailbox', '/app/mailbox', 'linecons-mail').setLabel('5', 'secondary', false);96 // var tables = this.addItem('Tables', '/app/tables', 'linecons-database');97 // var forms = this.addItem('Forms', '/app/forms', 'linecons-params');98 var extra = this.addItem('Extra', '/app/extra', 'linecons-beaker').setLabel('New Items', 'purple');99 // var charts = this.addItem('Charts', '/app/charts', 'linecons-globe');100 // var menu_lvls = this.addItem('Menu Levels', '', 'linecons-cloud');101 // Subitems of Dashboard102 // dashboard.addItem('Dashboard 1', '-/variant-1'); // "-/" will append parents link103 // dashboard.addItem('Dashboard 2', '-/variant-2');104 // dashboard.addItem('Dashboard 3', '-/variant-3');105 // dashboard.addItem('Dashboard 4', '-/variant-4');106 // dashboard.addItem('Update Hightlights', '/app/update-highlights').setLabel('v1.3', 'pink');107 // Subitems of UI Elements108 // ui_elements.addItem('Panels', '-/panels');109 // ui_elements.addItem('Buttons', '-/buttons');110 // ui_elements.addItem('Tabs & Accordions', '-/tabs-accordions');111 // ui_elements.addItem('Modals', '-/modals');112 // ui_elements.addItem('Breadcrumbs', '-/breadcrumbs');113 // ui_elements.addItem('Blockquotes', '-/blockquotes');114 // ui_elements.addItem('Progress Bars', '-/progress-bars');115 // ui_elements.addItem('Navbars', '-/navbars');116 // ui_elements.addItem('Alerts', '-/alerts');117 // ui_elements.addItem('Pagination', '-/pagination');118 // ui_elements.addItem('Typography', '-/typography');119 // ui_elements.addItem('Other Elements', '-/other-elements');120 // Subitems of Mailbox121 // mailbox.addItem('Inbox', '-/inbox');122 // mailbox.addItem('Compose Message', '-/compose');123 // mailbox.addItem('View Message', '-/message');124 // Subitems of Tables125 // tables.addItem('Basic Tables', '-/basic');126 // tables.addItem('Responsive Tables', '-/responsive');127 // tables.addItem('Data Tables', '-/datatables');128 // Subitems of Forms129 // forms.addItem('Native Elements', '-/native');130 // forms.addItem('Advanced Plugins', '-/advanced');131 // forms.addItem('Form Wizard', '-/wizard');132 // forms.addItem('Form Validation', '-/validation');133 // forms.addItem('Input Masks', '-/input-masks');134 // forms.addItem('File Upload', '-/file-upload');135 // forms.addItem('Editors', '-/wysiwyg');136 // forms.addItem('Sliders', '-/sliders');137 // Subitems of Extra138 var extra_icons = extra.addItem('Icons', '-/icons');139 // var extra_maps = extra.addItem('Maps', '-/maps');140 // var members = extra.addItem('Members', '-/members').setLabel('New', 'warning');141 // extra.addItem('Gallery', '-/gallery');142 // extra.addItem('Calendar', '-/calendar');143 // extra.addItem('Profile', '-/profile');144 // extra.addItem('Login', '/login');145 // extra.addItem('Lockscreen', '/lockscreen');146 // extra.addItem('Login Light', '/login-light');147 // extra.addItem('Timeline', '-/timeline');148 // extra.addItem('Timeline Centered', '-/timeline-centered');149 // extra.addItem('Notes', '-/notes');150 // extra.addItem('Image Crop', '-/image-crop');151 // extra.addItem('Portlets', '-/portlets');152 // extra.addItem('Blank Page', '-/blank-page');153 // extra.addItem('Search', '-/search');154 // extra.addItem('Invoice', '-/invoice');155 // extra.addItem('404 Page', '-/page-404');156 // extra.addItem('Tocify', '-/tocify');157 // extra.addItem('Loading Progress', '-/loading-progress');158 //extra.addItem('Page Loading Overlay', '-/page-loading-overlay'); NOT SUPPORTED IN ANGULAR159 // extra.addItem('Notifications', '-/notifications');160 // extra.addItem('Nestable Lists', '-/nestable-lists');161 // extra.addItem('Scrollable', '-/scrollable');162 // Submenu of Extra/Icons163 extra_icons.addItem('Font Awesome', '-/font-awesome');164 extra_icons.addItem('Linecons', '-/linecons');165 extra_icons.addItem('Elusive', '-/elusive');166 extra_icons.addItem('Meteocons', '-/meteocons');167 // Submenu of Extra/Maps168 // extra_maps.addItem('Google Maps', '-/google');169 // extra_maps.addItem('Advanced Map', '-/advanced');170 // extra_maps.addItem('Vector Map', '-/vector');171 // Submenu of Members172 // members.addItem('Members List', '-/list');173 // members.addItem('Add Member', '-/add');174 // Subitems of Charts175 // charts.addItem('Chart Variants', '-/variants');176 // charts.addItem('Range Selector', '-/range-selector');177 // charts.addItem('Sparklines', '-/sparklines');178 // charts.addItem('Map Charts', '-/map-charts');179 // charts.addItem('Circular Gauges', '-/gauges');180 // charts.addItem('Bar Gauges', '-/bar-gauges');181 // Subitems of Menu Levels182 // var menu_lvl1 = menu_lvls.addItem('Menu Item 1.1'); // has to be referenced to add sub menu elements183 // menu_lvls.addItem('Menu Item 1.2');184 // menu_lvls.addItem('Menu Item 1.3');185 // Sub Level 2186 // menu_lvl1.addItem('Menu Item 2.1');187 // var menu_lvl2 = menu_lvl1.addItem('Menu Item 2.2'); // has to be referenced to add sub menu elements188 // menu_lvl1.addItem('Menu Item 2.3');189 // Sub Level 3190 // menu_lvl2.addItem('Menu Item 3.1');191 // menu_lvl2.addItem('Menu Item 3.2');192 return this;193 };194 this.prepareHorizontalMenu = function()195 {196 var dashboard = this.addItem('Dashboard', '/app/dashboard', 'linecons-cog');197 var layouts = this.addItem('Layout', '/app/layout-and-skins', 'linecons-desktop');198 var ui_elements = this.addItem('UI Elements', '/app/ui', 'linecons-note');199 var forms = this.addItem('Forms', '/app/forms', 'linecons-params');200 var other = this.addItem('Other', '/app/extra', 'linecons-beaker');201 // Subitems of Dashboard202 dashboard.addItem('Dashboard 1', '-/variant-1'); // "-/" will append parents link203 dashboard.addItem('Dashboard 2', '-/variant-2');204 dashboard.addItem('Dashboard 3', '-/variant-3');205 dashboard.addItem('Dashboard 4', '-/variant-4');206 // Subitems of UI Elements207 ui_elements.addItem('Panels', '-/panels');208 ui_elements.addItem('Buttons', '-/buttons');209 ui_elements.addItem('Tabs & Accordions', '-/tabs-accordions');210 ui_elements.addItem('Modals', '-/modals');211 ui_elements.addItem('Breadcrumbs', '-/breadcrumbs');212 ui_elements.addItem('Blockquotes', '-/blockquotes');213 ui_elements.addItem('Progress Bars', '-/progress-bars');214 ui_elements.addItem('Navbars', '-/navbars');215 ui_elements.addItem('Alerts', '-/alerts');216 ui_elements.addItem('Pagination', '-/pagination');217 ui_elements.addItem('Typography', '-/typography');218 ui_elements.addItem('Other Elements', '-/other-elements');219 // Subitems of Forms220 forms.addItem('Native Elements', '-/native');221 forms.addItem('Advanced Plugins', '-/advanced');222 forms.addItem('Form Wizard', '-/wizard');223 forms.addItem('Form Validation', '-/validation');224 forms.addItem('Input Masks', '-/input-masks');225 forms.addItem('File Upload', '-/file-upload');226 forms.addItem('Editors', '-/wysiwyg');227 forms.addItem('Sliders', '-/sliders');228 // Subitems of Others229 var widgets = other.addItem('Widgets', '/app/widgets', 'linecons-star');230 var mailbox = other.addItem('Mailbox', '/app/mailbox', 'linecons-mail').setLabel('5', 'secondary', false);231 var tables = other.addItem('Tables', '/app/tables', 'linecons-database');232 var extra = other.addItem('Extra', '/app/extra', 'linecons-beaker').setLabel('New Items', 'purple');233 var charts = other.addItem('Charts', '/app/charts', 'linecons-globe');234 var menu_lvls = other.addItem('Menu Levels', '', 'linecons-cloud');235 // Subitems of Mailbox236 mailbox.addItem('Inbox', '-/inbox');237 mailbox.addItem('Compose Message', '-/compose');238 mailbox.addItem('View Message', '-/message');239 // Subitems of Tables240 tables.addItem('Basic Tables', '-/basic');241 tables.addItem('Responsive Tables', '-/responsive');242 tables.addItem('Data Tables', '-/datatables');243 // Subitems of Extra244 var extra_icons = extra.addItem('Icons', '-/icons').setLabel(4, 'warning');245 var extra_maps = extra.addItem('Maps', '-/maps');246 extra.addItem('Gallery', '-/gallery');247 extra.addItem('Calendar', '-/calendar');248 extra.addItem('Profile', '-/profile');249 extra.addItem('Login', '/login');250 extra.addItem('Lockscreen', '/lockscreen');251 extra.addItem('Login Light', '/login-light');252 extra.addItem('Timeline', '-/timeline');253 extra.addItem('Timeline Centered', '-/timeline-centered');254 extra.addItem('Notes', '-/notes');255 extra.addItem('Image Crop', '-/image-crop');256 extra.addItem('Portlets', '-/portlets');257 extra.addItem('Blank Page', '-/blank-page');258 extra.addItem('Search', '-/search');259 extra.addItem('Invoice', '-/invoice');260 extra.addItem('404 Page', '-/page-404');261 extra.addItem('Tocify', '-/tocify');262 extra.addItem('Loading Progress', '-/loading-progress');263 //extra.addItem('Page Loading Overlay', '-/page-loading-overlay'); NOT SUPPORTED IN ANGULAR264 extra.addItem('Notifications', '-/notifications');265 extra.addItem('Nestable Lists', '-/nestable-lists');266 extra.addItem('Scrollable', '-/scrollable');267 // Submenu of Extra/Icons268 extra_icons.addItem('Font Awesome', '-/font-awesome');269 extra_icons.addItem('Linecons', '-/linecons');270 extra_icons.addItem('Elusive', '-/elusive');271 extra_icons.addItem('Meteocons', '-/meteocons');272 // Submenu of Extra/Maps273 extra_maps.addItem('Google Maps', '-/google');274 extra_maps.addItem('Advanced Map', '-/advanced');275 extra_maps.addItem('Vector Map', '-/vector');276 // Subitems of Charts277 charts.addItem('Chart Variants', '-/variants');278 charts.addItem('Range Selector', '-/range-selector');279 charts.addItem('Sparklines', '-/sparklines');280 charts.addItem('Map Charts', '-/map-charts');281 charts.addItem('Circular Gauges', '-/gauges');282 charts.addItem('Bar Gauges', '-/bar-gauges');283 // Subitems of Menu Levels284 var menu_lvl1 = menu_lvls.addItem('Menu Item 1.1'); // has to be referenced to add sub menu elements285 menu_lvls.addItem('Menu Item 1.2');286 menu_lvls.addItem('Menu Item 1.3');287 // Sub Level 2288 menu_lvl1.addItem('Menu Item 2.1');289 var menu_lvl2 = menu_lvl1.addItem('Menu Item 2.2'); // has to be referenced to add sub menu elements290 menu_lvl1.addItem('Menu Item 2.3');291 // Sub Level 3292 menu_lvl2.addItem('Menu Item 3.1');293 menu_lvl2.addItem('Menu Item 3.2');294 return this;295 }296 this.instantiate = function()297 {298 return angular.copy( this );299 }300 this.toStatePath = function(path)301 {302 return path.replace(/\//g, '.').replace(/^\./, '');303 };304 this.setActive = function(path)305 {306 this.iterateCheck(this.menuItems, this.toStatePath(path));307 };...
fck_contextmenu.js
Source:fck_contextmenu.js
1/*2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net3 * Copyright (C) 2003-2008 Frederico Caldeira Knabben4 *5 * == BEGIN LICENSE ==6 *7 * Licensed under the terms of any of the following licenses at your8 * choice:9 *10 * - GNU General Public License Version 2 or later (the "GPL")11 * http://www.gnu.org/licenses/gpl.html12 *13 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")14 * http://www.gnu.org/licenses/lgpl.html15 *16 * - Mozilla Public License Version 1.1 or later (the "MPL")17 * http://www.mozilla.org/MPL/MPL-1.1.html18 *19 * == END LICENSE ==20 *21 * Defines the FCK.ContextMenu object that is responsible for all22 * Context Menu operations in the editing area.23 */24FCK.ContextMenu = new Object() ;25FCK.ContextMenu.Listeners = new Array() ;26FCK.ContextMenu.RegisterListener = function( listener )27{28 if ( listener )29 this.Listeners.push( listener ) ;30}31function FCK_ContextMenu_Init()32{33 var oInnerContextMenu = FCK.ContextMenu._InnerContextMenu = new FCKContextMenu( FCKBrowserInfo.IsIE ? window : window.parent, FCKLang.Dir ) ;34 oInnerContextMenu.CtrlDisable = FCKConfig.BrowserContextMenuOnCtrl ;35 oInnerContextMenu.OnBeforeOpen = FCK_ContextMenu_OnBeforeOpen ;36 oInnerContextMenu.OnItemClick = FCK_ContextMenu_OnItemClick ;37 // Get the registering function.38 var oMenu = FCK.ContextMenu ;39 // Register all configured context menu listeners.40 for ( var i = 0 ; i < FCKConfig.ContextMenu.length ; i++ )41 oMenu.RegisterListener( FCK_ContextMenu_GetListener( FCKConfig.ContextMenu[i] ) ) ;42}43function FCK_ContextMenu_GetListener( listenerName )44{45 switch ( listenerName )46 {47 case 'Generic' :48 return {49 AddItems : function( menu, tag, tagName )50 {51 menu.AddItem( 'Cut' , FCKLang.Cut , 7, FCKCommands.GetCommand( 'Cut' ).GetState() == FCK_TRISTATE_DISABLED ) ;52 menu.AddItem( 'Copy' , FCKLang.Copy , 8, FCKCommands.GetCommand( 'Copy' ).GetState() == FCK_TRISTATE_DISABLED ) ;53 menu.AddItem( 'Paste' , FCKLang.Paste , 9, FCKCommands.GetCommand( 'Paste' ).GetState() == FCK_TRISTATE_DISABLED ) ;54 }} ;55 case 'Table' :56 return {57 AddItems : function( menu, tag, tagName )58 {59 var bIsTable = ( tagName == 'TABLE' ) ;60 var bIsCell = ( !bIsTable && FCKSelection.HasAncestorNode( 'TABLE' ) ) ;61 if ( bIsCell )62 {63 menu.AddSeparator() ;64 var oItem = menu.AddItem( 'Cell' , FCKLang.CellCM ) ;65 oItem.AddItem( 'TableInsertCellBefore' , FCKLang.InsertCellBefore, 69 ) ;66 oItem.AddItem( 'TableInsertCellAfter' , FCKLang.InsertCellAfter, 58 ) ;67 oItem.AddItem( 'TableDeleteCells' , FCKLang.DeleteCells, 59 ) ;68 if ( FCKBrowserInfo.IsGecko )69 oItem.AddItem( 'TableMergeCells' , FCKLang.MergeCells, 60,70 FCKCommands.GetCommand( 'TableMergeCells' ).GetState() == FCK_TRISTATE_DISABLED ) ;71 else72 {73 oItem.AddItem( 'TableMergeRight' , FCKLang.MergeRight, 60,74 FCKCommands.GetCommand( 'TableMergeRight' ).GetState() == FCK_TRISTATE_DISABLED ) ;75 oItem.AddItem( 'TableMergeDown' , FCKLang.MergeDown, 60,76 FCKCommands.GetCommand( 'TableMergeDown' ).GetState() == FCK_TRISTATE_DISABLED ) ;77 }78 oItem.AddItem( 'TableHorizontalSplitCell' , FCKLang.HorizontalSplitCell, 61,79 FCKCommands.GetCommand( 'TableHorizontalSplitCell' ).GetState() == FCK_TRISTATE_DISABLED ) ;80 oItem.AddItem( 'TableVerticalSplitCell' , FCKLang.VerticalSplitCell, 61,81 FCKCommands.GetCommand( 'TableVerticalSplitCell' ).GetState() == FCK_TRISTATE_DISABLED ) ;82 oItem.AddSeparator() ;83 oItem.AddItem( 'TableCellProp' , FCKLang.CellProperties, 57,84 FCKCommands.GetCommand( 'TableCellProp' ).GetState() == FCK_TRISTATE_DISABLED ) ;85 menu.AddSeparator() ;86 oItem = menu.AddItem( 'Row' , FCKLang.RowCM ) ;87 oItem.AddItem( 'TableInsertRowBefore' , FCKLang.InsertRowBefore, 70 ) ;88 oItem.AddItem( 'TableInsertRowAfter' , FCKLang.InsertRowAfter, 62 ) ;89 oItem.AddItem( 'TableDeleteRows' , FCKLang.DeleteRows, 63 ) ;90 menu.AddSeparator() ;91 oItem = menu.AddItem( 'Column' , FCKLang.ColumnCM ) ;92 oItem.AddItem( 'TableInsertColumnBefore', FCKLang.InsertColumnBefore, 71 ) ;93 oItem.AddItem( 'TableInsertColumnAfter' , FCKLang.InsertColumnAfter, 64 ) ;94 oItem.AddItem( 'TableDeleteColumns' , FCKLang.DeleteColumns, 65 ) ;95 }96 if ( bIsTable || bIsCell )97 {98 menu.AddSeparator() ;99 menu.AddItem( 'TableDelete' , FCKLang.TableDelete ) ;100 menu.AddItem( 'TableProp' , FCKLang.TableProperties, 39 ) ;101 }102 }} ;103 case 'Link' :104 return {105 AddItems : function( menu, tag, tagName )106 {107 var bInsideLink = ( tagName == 'A' || FCKSelection.HasAncestorNode( 'A' ) ) ;108 if ( bInsideLink || FCK.GetNamedCommandState( 'Unlink' ) != FCK_TRISTATE_DISABLED )109 {110 // Go up to the anchor to test its properties111 var oLink = FCKSelection.MoveToAncestorNode( 'A' ) ;112 var bIsAnchor = ( oLink && oLink.name.length > 0 && oLink.href.length == 0 ) ;113 // If it isn't a link then don't add the Link context menu114 if ( bIsAnchor )115 return ;116 menu.AddSeparator() ;117 menu.AddItem( 'VisitLink', FCKLang.VisitLink ) ;118 menu.AddSeparator() ;119 if ( bInsideLink )120 menu.AddItem( 'Link', FCKLang.EditLink , 34 ) ;121 menu.AddItem( 'Unlink' , FCKLang.RemoveLink , 35 ) ;122 }123 }} ;124 case 'Image' :125 return {126 AddItems : function( menu, tag, tagName )127 {128 if ( tagName == 'IMG' && !tag.getAttribute( '_fckfakelement' ) )129 {130 menu.AddSeparator() ;131 menu.AddItem( 'Image', FCKLang.ImageProperties, 37 ) ;132 }133 }} ;134 case 'Anchor' :135 return {136 AddItems : function( menu, tag, tagName )137 {138 // Go up to the anchor to test its properties139 var oLink = FCKSelection.MoveToAncestorNode( 'A' ) ;140 var bIsAnchor = ( oLink && oLink.name.length > 0 ) ;141 if ( bIsAnchor || ( tagName == 'IMG' && tag.getAttribute( '_fckanchor' ) ) )142 {143 menu.AddSeparator() ;144 menu.AddItem( 'Anchor', FCKLang.AnchorProp, 36 ) ;145 menu.AddItem( 'AnchorDelete', FCKLang.AnchorDelete ) ;146 }147 }} ;148 case 'Flash' :149 return {150 AddItems : function( menu, tag, tagName )151 {152 if ( tagName == 'IMG' && tag.getAttribute( '_fckflash' ) )153 {154 menu.AddSeparator() ;155 menu.AddItem( 'Flash', FCKLang.FlashProperties, 38 ) ;156 }157 }} ;158 case 'Form' :159 return {160 AddItems : function( menu, tag, tagName )161 {162 if ( FCKSelection.HasAncestorNode('FORM') )163 {164 menu.AddSeparator() ;165 menu.AddItem( 'Form', FCKLang.FormProp, 48 ) ;166 }167 }} ;168 case 'Checkbox' :169 return {170 AddItems : function( menu, tag, tagName )171 {172 if ( tagName == 'INPUT' && tag.type == 'checkbox' )173 {174 menu.AddSeparator() ;175 menu.AddItem( 'Checkbox', FCKLang.CheckboxProp, 49 ) ;176 }177 }} ;178 case 'Radio' :179 return {180 AddItems : function( menu, tag, tagName )181 {182 if ( tagName == 'INPUT' && tag.type == 'radio' )183 {184 menu.AddSeparator() ;185 menu.AddItem( 'Radio', FCKLang.RadioButtonProp, 50 ) ;186 }187 }} ;188 case 'TextField' :189 return {190 AddItems : function( menu, tag, tagName )191 {192 if ( tagName == 'INPUT' && ( tag.type == 'text' || tag.type == 'password' ) )193 {194 menu.AddSeparator() ;195 menu.AddItem( 'TextField', FCKLang.TextFieldProp, 51 ) ;196 }197 }} ;198 case 'HiddenField' :199 return {200 AddItems : function( menu, tag, tagName )201 {202 if ( tagName == 'IMG' && tag.getAttribute( '_fckinputhidden' ) )203 {204 menu.AddSeparator() ;205 menu.AddItem( 'HiddenField', FCKLang.HiddenFieldProp, 56 ) ;206 }207 }} ;208 case 'ImageButton' :209 return {210 AddItems : function( menu, tag, tagName )211 {212 if ( tagName == 'INPUT' && tag.type == 'image' )213 {214 menu.AddSeparator() ;215 menu.AddItem( 'ImageButton', FCKLang.ImageButtonProp, 55 ) ;216 }217 }} ;218 case 'Button' :219 return {220 AddItems : function( menu, tag, tagName )221 {222 if ( tagName == 'INPUT' && ( tag.type == 'button' || tag.type == 'submit' || tag.type == 'reset' ) )223 {224 menu.AddSeparator() ;225 menu.AddItem( 'Button', FCKLang.ButtonProp, 54 ) ;226 }227 }} ;228 case 'Select' :229 return {230 AddItems : function( menu, tag, tagName )231 {232 if ( tagName == 'SELECT' )233 {234 menu.AddSeparator() ;235 menu.AddItem( 'Select', FCKLang.SelectionFieldProp, 53 ) ;236 }237 }} ;238 case 'Textarea' :239 return {240 AddItems : function( menu, tag, tagName )241 {242 if ( tagName == 'TEXTAREA' )243 {244 menu.AddSeparator() ;245 menu.AddItem( 'Textarea', FCKLang.TextareaProp, 52 ) ;246 }247 }} ;248 case 'BulletedList' :249 return {250 AddItems : function( menu, tag, tagName )251 {252 if ( FCKSelection.HasAncestorNode('UL') )253 {254 menu.AddSeparator() ;255 menu.AddItem( 'BulletedList', FCKLang.BulletedListProp, 27 ) ;256 }257 }} ;258 case 'NumberedList' :259 return {260 AddItems : function( menu, tag, tagName )261 {262 if ( FCKSelection.HasAncestorNode('OL') )263 {264 menu.AddSeparator() ;265 menu.AddItem( 'NumberedList', FCKLang.NumberedListProp, 26 ) ;266 }267 }} ;268 case 'DivContainer':269 return {270 AddItems : function( menu, tag, tagName )271 {272 var currentBlocks = FCKDomTools.GetSelectedDivContainers() ;273 if ( currentBlocks.length > 0 )274 {275 menu.AddSeparator() ;276 menu.AddItem( 'EditDiv', FCKLang.EditDiv, 75 ) ;277 menu.AddItem( 'DeleteDiv', FCKLang.DeleteDiv, 76 ) ;278 }279 }} ;280 }281 return null ;282}283function FCK_ContextMenu_OnBeforeOpen()284{285 // Update the UI.286 FCK.Events.FireEvent( 'OnSelectionChange' ) ;287 // Get the actual selected tag (if any).288 var oTag, sTagName ;289 // The extra () is to avoid a warning with strict error checking. This is ok.290 if ( (oTag = FCKSelection.GetSelectedElement()) )291 sTagName = oTag.tagName ;292 // Cleanup the current menu items.293 var oMenu = FCK.ContextMenu._InnerContextMenu ;294 oMenu.RemoveAllItems() ;295 // Loop through the listeners.296 var aListeners = FCK.ContextMenu.Listeners ;297 for ( var i = 0 ; i < aListeners.length ; i++ )298 aListeners[i].AddItems( oMenu, oTag, sTagName ) ;299}300function FCK_ContextMenu_OnItemClick( item )301{302 FCK.Focus() ;303 FCKCommands.GetCommand( item.Name ).Execute( item.CustomData ) ;...
Using AI Code Generation
1import { addItem } from 'storybook-root';2import { storiesOf } from '@storybook/react';3import React from 'react';4import { Button } from 'storybook-root';5storiesOf('Button', module).add('with text', () => <Button onClick={addItem('hello')}>Hello Button</Button>);6import { addItem } from 'storybook-root';7import { storiesOf } from '@storybook/react';8import React from 'react';9import { Button } from 'storybook-root';10storiesOf('Button', module).add('with text', () => <Button onClick={addItem('hello')}>Hello Button</Button>);11I am not sure if this is a bug or expected behavior. If it is expected behavior, is there any way to use the same import statement in different components?12<Table columns={columns} data={data} />13const columns = React.useMemo(() => [14 {15 },16 {17 },18 {19 },20 {21 Cell: ({ row }) => (22 <button onClick={() => deleteRow(row.original)}>Delete</button>23 }24], []);25const data = React.useMemo(() => [26 {
Using AI Code Generation
1import { addItem } from 'storybook-root';2addItem('test');3import { storiesOf } from '@storybook/react';4export const addItem = (name) => {5 storiesOf('test', module).add(name, () => <div>test</div>);6};7import { configure } from '@storybook/react';8import { addItem } from 'storybook-root';9configure(() => {10 require('../test');11 addItem('test2');12}, module);13const path = require('path');14module.exports = (baseConfig, env, defaultConfig) => {15 defaultConfig.resolve.modules.push(path.resolve(__dirname, '../'));16 return defaultConfig;17};18{19}20{21 "dependencies": {22 },23 "devDependencies": {24 }25}26{27}28{29}
Using AI Code Generation
1import { addItem } from 'storybook-root';2addItem('story1', () => <div>story1</div>);3addItem('story2', () => <div>story2</div>);4import { addItem } from 'storybook-root';5addItem('story1', () => <div>story1</div>);6addItem('story2', () => <div>story2</div>);7import { addItem } from 'storybook-root';8addItem('story1', () => <div>story1</div>);9addItem('story2', () => <div>story2</div>);10import { addItem } from 'storybook-root';11addItem('story1', () => <div>story1</div>);12addItem('story2', () => <div>story2</div>);13import { addItem } from 'storybook-root';14addItem('story1', () => <div>story1</div>);15addItem('story2', () => <div>story2</div>);16import { addItem } from 'storybook-root';17addItem('story1', () => <div>story1</div>);18addItem('story2', () => <div>story2</div>);19import { addItem } from 'storybook-root';20addItem('story1', () => <div>story1</div>);21addItem('story2', () => <div>story2</div>);22import { addItem } from 'storybook-root';23addItem('story1', () => <div>story1</div>);24addItem('story2', () => <div>story2</div>);25import { addItem } from 'storybook-root';26addItem('story1', () => <div>story1</div>);27addItem('story2', () => <div>story2</div>);28import { addItem } from 'storybook-root';29addItem('story1', () => <div>story1</div>);30addItem('story2', ()
Using AI Code Generation
1import { addItem } from 'storybook-root';2addItem('test', () => {3 return (4 );5});6import React from 'react';7import ReactDOM from 'react-dom';8import './index.css';9const addItem = (name, story) => {10};11const root = document.getElementById('root');12const render = () => {13 ReactDOM.render(14 );15};16render();17export { addItem };18{19}20{21 "dependencies": {22 }23}24import { configure } from '@storybook/react';25import { addItem } from 'storybook-root';26function loadStories() {27 addItem('test', () => {28 return (29 );30 });31}32configure(loadStories, module);33import { configure }
Using AI Code Generation
1import { addItem } from 'storybook-root'2addItem('foo', 'bar')3export const addItem = (id, name) => {4 console.log(id, name)5}6"scripts": {7}8import { configure } from '@storybook/react';9import { addItem } from 'storybook-root'10function loadStories() {11 require('../src/stories');12 addItem('foo', 'bar')13}14configure(loadStories, module);15import { configure } from '@storybook/react';16import { addItem } from 'storybook-root'17function loadStories() {18 require('../src/stories');19 addItem('foo', 'bar')20}21configure(loadStories, module);22import { configure } from '@storybook/react';23import { addItem } from 'storybook-root'24function loadStories() {25 require('../src/stories');26 addItem('foo', 'bar')27}28configure(loadStories, module);29import { configure } from '@storybook/react';30import { addItem } from 'storybook-root'31function loadStories() {32 require('../src/stories');33 addItem('foo', 'bar')34}35configure(loadStories, module);36import { configure } from '@storybook/react';37import { addItem } from 'storybook-root'38function loadStories() {39 require('../src/stories');40 addItem('foo', 'bar')41}42configure(loadStories, module);43import { configure } from '@storybook/react';44import { addItem } from 'storybook-root'45function loadStories() {46 require('../src/stories');47 addItem('foo', 'bar')48}49configure(loadStories, module);50import { configure } from '@storybook/react
Using AI Code Generation
1import { addItem } from 'storybook-root';2addItem('Item Name', 'Item Description', 10);3import { addItem } from 'storybook-root';4addItem('Item Name', 'Item Description', 10);5import { addItem } from 'storybook-root';6addItem('Item Name', 'Item Description', 10);7import { addItem } from 'storybook-root';8addItem('Item Name', 'Item Description', 10);9import { addItem } from 'storybook-root';10addItem('Item Name', 'Item Description', 10);11import { addItem } from 'storybook-root';12addItem('Item Name', 'Item Description', 10);13import { addItem } from 'storybook-root';14addItem('Item Name', 'Item Description', 10);15import { addItem } from 'storybook-root';16addItem('Item Name', 'Item Description', 10);17import { addItem } from 'storybook-root';18addItem('Item Name', 'Item Description', 10);19import { addItem } from 'storybook-root';20addItem('Item Name', 'Item Description', 10);21import { addItem } from 'storybook-root';
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!