How to use Init method in wpt

Best JavaScript code snippet using wpt

init-events.js

Source:init-events.js Github

copy

Full Screen

1description("This tests the init functions for all the event DOM classes that have them.");2function testInitEvent(prefix, argumentString)3{4 var event = document.createEvent(prefix + "Event");5 var initExpression = "event.init" + prefix + "Event(" + argumentString + ")";6 eval(initExpression);7 return event;8}9var event = document.createEvent("Event");10event.initEvent("type", false, false);11shouldBe("testInitEvent('', '\"a\", false, false').type", "'a'");12shouldBe("testInitEvent('', 'null, false, false').type", "'null'");13shouldBe("testInitEvent('', '\"a\", false, false').bubbles", "false");14shouldBe("testInitEvent('', '\"a\", true, false').bubbles", "true");15shouldBe("testInitEvent('', '\"a\", false, false').cancelable", "false");16shouldBe("testInitEvent('', '\"a\", false, true').cancelable", "true");17shouldBe("testInitEvent('Keyboard', '\"a\", false, false, window, \"b\", 1001, false, false, false, false, false').type", "'a'");18shouldBe("testInitEvent('Keyboard', 'null, false, false, window, \"b\", 1001, false, false, false, false, false').type", "'null'");19shouldBe("testInitEvent('Keyboard', '\"a\", false, false, window, \"b\", 1001, false, false, false, false, false').bubbles", "false");20shouldBe("testInitEvent('Keyboard', '\"a\", true, false, window, \"b\", 1001, false, false, false, false, false').bubbles", "true");21shouldBe("testInitEvent('Keyboard', '\"a\", false, false, window, \"b\", 1001, false, false, false, false, false').cancelable", "false");22shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').cancelable", "true");23shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').view", "window");24shouldBe("testInitEvent('Keyboard', '\"a\", false, true, null, \"b\", 1001, false, false, false, false, false').view", "null");25shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').keyIdentifier", "'b'");26shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, null, 1001, false, false, false, false, false').keyIdentifier", "'null'");27shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').keyLocation", "1001");28shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').ctrlKey", "false");29shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, true, false, false, false, false').ctrlKey", "true");30shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').altKey", "false");31shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, true, false, false, false').altKey", "true");32shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').shiftKey", "false");33shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, true, false, false').shiftKey", "true");34shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').metaKey", "false");35shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, true, false').metaKey", "true");36shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').altGraphKey", "false");37shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, true').altGraphKey", "true");38shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, true').detail", "0");39shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').keyCode", "0");40shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').charCode", "0");41shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').layerX", "0");42shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').layerY", "0");43shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').pageX", "0");44shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').pageY", "0");45shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').which", "0");46shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').type", "'a'");47shouldBe("testInitEvent('Message', 'null, false, false, \"b\", \"c\", \"d\", window, null').type", "'null'");48shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').bubbles", "false");49shouldBe("testInitEvent('Message', '\"a\", true, false, \"b\", \"c\", \"d\", window, null').bubbles", "true");50shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').cancelable", "false");51shouldBe("testInitEvent('Message', '\"a\", false, true, \"b\", \"c\", \"d\", window, null').cancelable", "true");52shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').data", "'b'");53shouldBe("testInitEvent('Message', '\"a\", false, false, null, \"c\", \"d\", window, null').data", "null");54shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').origin", "'c'");55shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", null, \"d\", window, null').origin", "'null'");56shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').lastEventId", "'d'");57shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", null, window, null').lastEventId", "'null'");58shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').source", "window");59shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", null, null').source", "null");60var channel = new MessageChannel;61var channelArray = [channel.port1, channel.port2];62shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", null, channelArray').ports[0]", "channel.port1");63shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", null, channelArray').ports[1]", "channel.port2");64shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').type", "'a'");65shouldBe("testInitEvent('Mouse', 'null, false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').type", "'null'");66shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').bubbles", "false");67shouldBe("testInitEvent('Mouse', '\"a\", true, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').bubbles", "true");68shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').cancelable", "false");69shouldBe("testInitEvent('Mouse', '\"a\", false, true, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').cancelable", "true");70shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').view", "window");71shouldBe("testInitEvent('Mouse', '\"a\", false, false, null, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').view", "null");72shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').detail", "1001");73shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').screenX", "1002");74shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').screenY", "1003");75shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').clientX", "1004");76shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').clientY", "1005");77shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').ctrlKey", "false");78shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, true, false, false, false, 1006, null').ctrlKey", "true");79shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').altKey", "false");80shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, true, false, false, 1006, null').altKey", "true");81shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').shiftKey", "false");82shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, true, false, 1006, null').shiftKey", "true");83shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').metaKey", "false");84shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, true, 1006, null').metaKey", "true");85shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').button", "1006");86shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').relatedTarget", "null");87shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, document').relatedTarget", "document");88shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').offsetX", "1004");89shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').offsetY", "1005");90shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').x", "1004");91shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').y", "1005");92shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').fromElement", "null");93shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, document').fromElement", "document");94shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').toElement", "null");95shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').dataTransfer", "null");96shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').keyCode", "0");97shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').charCode", "0");98shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').layerX", "1004");99shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').layerY", "1005");100shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').pageX", "1004");101shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').pageY", "1005");102shouldBe("testInitEvent('Mouse', '\"a\", false, false, window, 1001, 1002, 1003, 1004, 1005, false, false, false, false, 1006, null').which", "1007");103shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, \"b\", \"c\", \"d\", 1001').type", "'a'");104shouldBe("testInitEvent('Mutation', 'null, false, false, null, \"b\", \"c\", \"d\", 1001').type", "'null'");105shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, \"b\", \"c\", \"d\", 1001').bubbles", "false");106shouldBe("testInitEvent('Mutation', '\"a\", true, false, null, \"b\", \"c\", \"d\", 1001').bubbles", "true");107shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, \"b\", \"c\", \"d\", 1001').cancelable", "false");108shouldBe("testInitEvent('Mutation', '\"a\", false, true, null, \"b\", \"c\", \"d\", 1001').cancelable", "true");109shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, \"b\", \"c\", \"d\", 1001').relatedNode", "null");110shouldBe("testInitEvent('Mutation', '\"a\", false, false, document, \"b\", \"c\", \"d\", 1001').relatedNode", "document");111shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, \"b\", \"c\", \"d\", 1001').prevValue", "'b'");112shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, null, \"c\", \"d\", 1001').prevValue", "'null'");113shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, \"b\", \"c\", \"d\", 1001').newValue", "'c'");114shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, \"b\", null, \"d\", 1001').newValue", "'null'");115shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, \"b\", \"c\", \"d\", 1001').attrName", "'d'");116shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, \"b\", \"c\", null, 1001').attrName", "'null'");117shouldBe("testInitEvent('Mutation', '\"a\", false, false, null, \"b\", \"c\", \"d\", 1001').attrChange", "1001");118// initOverflowEvent has an interface that has an design that's inconsistent with the init functions from other events.119shouldBe("testInitEvent('Overflow', '1001, false, false').type", "'overflowchanged'");120shouldBe("testInitEvent('Overflow', '1001, false, false').bubbles", "false");121shouldBe("testInitEvent('Overflow', '1001, false, false').cancelable", "false");122shouldBe("testInitEvent('Overflow', '1001, false, false').orient", "1001");123shouldBe("testInitEvent('Overflow', '1001, false, false').horizontalOverflow", "false");124shouldBe("testInitEvent('Overflow', '1001, true, false').horizontalOverflow", "true");125shouldBe("testInitEvent('Overflow', '1001, false, false').verticalOverflow", "false");126shouldBe("testInitEvent('Overflow', '1001, false, true').verticalOverflow", "true");127shouldBe("testInitEvent('Progress', '\"a\", false, false, false, 1001, 1002').type", "'a'");128shouldBe("testInitEvent('Progress', 'null, false, false, false, 1001, 1002').type", "'null'");129shouldBe("testInitEvent('Progress', '\"a\", false, false, false, 1001, 1002').bubbles", "false");130shouldBe("testInitEvent('Progress', '\"a\", true, false, false, 1001, 1002').bubbles", "true");131shouldBe("testInitEvent('Progress', '\"a\", false, false, false, 1001, 1002').cancelable", "false");132shouldBe("testInitEvent('Progress', '\"a\", false, true, false, 1001, 1002').cancelable", "true");133shouldBe("testInitEvent('Progress', '\"a\", false, false, false, 1001, 1002').lengthComputable", "false");134shouldBe("testInitEvent('Progress', '\"a\", false, false, true, 1001, 1002').lengthComputable", "true");135shouldBe("testInitEvent('Progress', '\"a\", false, false, false, 1001, 1002').loaded", "1001");136shouldBe("testInitEvent('Progress', '\"a\", false, false, false, 1001, 1002').total", "1002");137shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').type", "'a'");138shouldBe("testInitEvent('Storage', 'null, false, false, \"b\", \"c\", \"d\", \"e\"').type", "'null'");139shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').bubbles", "false");140shouldBe("testInitEvent('Storage', '\"a\", true, false, \"b\", \"c\", \"d\", \"e\"').bubbles", "true");141shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').cancelable", "false");142shouldBe("testInitEvent('Storage', '\"a\", false, true, \"b\", \"c\", \"d\", \"e\"').cancelable", "true");143shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').key", "'b'");144shouldBe("testInitEvent('Storage', '\"a\", false, false, null, \"c\", \"d\", \"e\"').key", "'null'");145shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').oldValue", "'c'");146shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", null, \"d\", \"e\"').oldValue", "null");147shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').newValue", "'d'");148shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", null, \"e\"').newValue", "null");149shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').url", "'e'");150shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", null').url", "'null'");151shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').type", "'a'");152shouldBe("testInitEvent('Text', 'null, false, false, window, \"b\"').type", "'null'");153shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').bubbles", "false");154shouldBe("testInitEvent('Text', '\"a\", true, false, window, \"b\"').bubbles", "true");155shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').cancelable", "false");156shouldBe("testInitEvent('Text', '\"a\", false, true, window, \"b\"').cancelable", "true");157shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').view", "window");158shouldBe("testInitEvent('Text', '\"a\", false, false, null, \"b\"').view", "null");159shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').data", "'b'");160shouldBe("testInitEvent('Text', '\"a\", false, false, window, null').data", "'null'");161shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').detail", "0");162shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').keyCode", "0");163shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').charCode", "0");164shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').layerX", "0");165shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').layerY", "0");166shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').pageX", "0");167shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').pageY", "0");168shouldBe("testInitEvent('Text', '\"a\", false, false, window, \"b\"').which", "0");169shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').type", "'a'");170shouldBe("testInitEvent('UI', 'null, false, false, window, 1001').type", "'null'");171shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').bubbles", "false");172shouldBe("testInitEvent('UI', '\"a\", true, false, window, 1001').bubbles", "true");173shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').cancelable", "false");174shouldBe("testInitEvent('UI', '\"a\", false, true, window, 1001').cancelable", "true");175shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').view", "window");176shouldBe("testInitEvent('UI', '\"a\", false, false, null, 1001').view", "null");177shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').detail", "1001");178shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').keyCode", "0");179shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').charCode", "0");180shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').layerX", "0");181shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').layerY", "0");182shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').pageX", "0");183shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').pageY", "0");184shouldBe("testInitEvent('UI', '\"a\", false, false, window, 1001').which", "0");185shouldBe("testInitEvent('WebKitAnimation', '\"a\", false, false, \"b\", 1001').type", "'a'");186shouldBe("testInitEvent('WebKitAnimation', 'null, false, false, \"b\", 1001').type", "'null'");187shouldBe("testInitEvent('WebKitAnimation', '\"a\", false, false, \"b\", 1001').bubbles", "false");188shouldBe("testInitEvent('WebKitAnimation', '\"a\", true, false, \"b\", 1001').bubbles", "true");189shouldBe("testInitEvent('WebKitAnimation', '\"a\", false, false, \"b\", 1001').cancelable", "false");190shouldBe("testInitEvent('WebKitAnimation', '\"a\", false, true, \"b\", 1001').cancelable", "true");191shouldBe("testInitEvent('WebKitAnimation', '\"a\", false, false, \"b\", 1001').animationName", "'b'");192shouldBe("testInitEvent('WebKitAnimation', '\"a\", false, false, null, 1001').animationName", "'null'");193shouldBe("testInitEvent('WebKitAnimation', '\"a\", false, false, \"b\", 1001').elapsedTime", "1001");194shouldBe("testInitEvent('WebKitTransition', '\"a\", false, false, \"b\", 1001').type", "'a'");195shouldBe("testInitEvent('WebKitTransition', 'null, false, false, \"b\", 1001').type", "'null'");196shouldBe("testInitEvent('WebKitTransition', '\"a\", false, false, \"b\", 1001').bubbles", "false");197shouldBe("testInitEvent('WebKitTransition', '\"a\", true, false, \"b\", 1001').bubbles", "true");198shouldBe("testInitEvent('WebKitTransition', '\"a\", false, false, \"b\", 1001').cancelable", "false");199shouldBe("testInitEvent('WebKitTransition', '\"a\", false, true, \"b\", 1001').cancelable", "true");200shouldBe("testInitEvent('WebKitTransition', '\"a\", false, false, \"b\", 1001').propertyName", "'b'");201shouldBe("testInitEvent('WebKitTransition', '\"a\", false, false, null, 1001').propertyName", "'null'");202shouldBe("testInitEvent('WebKitTransition', '\"a\", false, false, \"b\", 1001').elapsedTime", "1001");203// WheelEvent has no init function yet; roughly speaking, we are waiting for that part of DOM 3 to stabilize....

Full Screen

Full Screen

Card.jsx

Source:Card.jsx Github

copy

Full Screen

1import React,{useEffect,useState} from 'react'2import Avatar from '@material-ui/core/Avatar';3import DoneIcon from '@material-ui/icons/Done'4import Grid from "@material-ui/core/Grid"5import firebaseDb from './firebase';6import ProductCarousel from "./ProductCarousel"7import {useHistory} from "react-router-dom";8import {makeStyles} from '@material-ui/core/styles';9const useStyles = makeStyles((theme) => ({10 gridy: {11 [theme.breakpoints.down('sm')]: {12 margin:'20px 0 0 50%',13 transform:"translate(-50%,0)"14 },15 "&:hover": {16 transform:"scale(1.001)",17 transition:"all 0.5s"18 },19 }20 }));21 22export default function Card(props) {23 const classes = useStyles();24 const history=useHistory();25 const[init,upda]=useState({});26 useEffect(()=>{27 firebaseDb.child('products').on("value",snapshot=>{28 29 if(snapshot.val() !=null){30 // upda({...snapshot.val()})31 // setOpen(true);32 33 upda({...snapshot.val()}); 34 }35 })36 },[props.categoryAction])37 // click event38 const clicki=(a)=>{39 a.valll="products"40 history.push("/insideproduct",a);41 }42 // slider arr43 return (44 <>45 <Grid container style={{marginBottom:"50px",paddingLeft:"20px"}}>46 47{/* ternary start */}48 {49 Object.keys(init) && Object.keys(init).length > 0 && Array.isArray(Object.keys(init))?50 props.categoryAction == "LowHigh" ?51//ternary start52 Object.keys(init).sort((a, b) => init[a].price - init[b].price).map((row) => (53 <>54 <Grid className={classes.gridy} item lg={3} md={4} xs={12} style={{marginBottom:"20px"}}>55 <div style={{width:"300px"}}>56 <div style={{backgroundColor:"rgb(240, 240, 240)",height:"355px",width:"290px",overflow:"hidden"}}>57 <div style={{height:"50px",marginBottom:"8px"}}>58{59 ( 100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0)) ) > 0 ?60 <Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>61 :62 <></>63} 64 </div>65 <div style={{position:"relative",right:"28px"}}>66 <ProductCarousel67 width="220px!important"68 image1={init[row].image}69 image2={init[row].image2}70 />71 </div>72 <p onClick={()=>clicki({73 id:row,74 image:init[row].image,75 image2:init[row].image2,76 item:init[row].item,77 writer:init[row].writer,78 price: init[row].price,79 off:init[row].off,80 description:init[row].description,81 author:init[row].author82 })} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>83 </div> 84 <span style={{color:"silver",marginTop:"0px"}}>{init[row].writer}</span>85 <h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>86<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> April {new Date().getDate()+1}</b> </p>87 <span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>88 </div>89 </Grid>90 </>91 ))92 :93//trenery Start94props.categoryAction == "HighLow" ?95 Object.keys(init).sort((a, b) => init[a].price - init[b].price).reverse().map((row) => (96<>97<Grid className={classes.gridy} item lg={3} md={4} xs={12} style={{marginBottom:"20px"}}>98<div style={{width:"300px"}}>99<div style={{backgroundColor:"rgb(240, 240, 240)",height:"355px",width:"290px",overflow:"hidden"}}>100<div style={{height:"50px",marginBottom:"8px"}}>101{102 ( 100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0)) ) > 0 ?103 <Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>104 :105 <></>106} 107</div>108<div style={{position:"relative",right:"28px"}}>109<ProductCarousel110width="220px!important"111image1={init[row].image}112image2={init[row].image2}113/>114</div>115<p onClick={()=>clicki({116id:row,117image:init[row].image,118image2:init[row].image2,119item:init[row].item,120writer:init[row].writer,121price: init[row].price,122off:init[row].off,123description:init[row].description,124author:init[row].author125})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>126</div> 127<span style={{color:"silver",marginTop:"0px"}}>{init[row].writer}</span>128<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>129<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> April {new Date().getDate()+1}</b> </p>130<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>131</div>132</Grid>133</>134))135:136//trenery Start137props.categoryAction == "OlderFirst" ?138Object.keys(init).map((row) => (139<>140<Grid className={classes.gridy} item lg={3} md={4} xs={12} style={{marginBottom:"20px"}}>141<div style={{width:"300px"}}>142<div style={{backgroundColor:"rgb(240, 240, 240)",height:"355px",width:"290px",overflow:"hidden"}}>143<div style={{height:"50px",marginBottom:"8px"}}>144{145 ( 100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0)) ) > 0 ?146 <Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>147 :148 <></>149} 150</div>151<div style={{position:"relative",right:"28px"}}>152<ProductCarousel153width="220px!important"154image1={init[row].image}155image2={init[row].image2}156/>157</div>158<p onClick={()=>clicki({159id:row,160image:init[row].image,161image2:init[row].image2,162item:init[row].item,163writer:init[row].writer,164price: init[row].price,165off:init[row].off,166description:init[row].description,167author:init[row].author168})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>169</div> 170<span style={{color:"silver",marginTop:"0px"}}>{init[row].writer}</span>171<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>172<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> April {new Date().getDate()+1}</b> </p>173<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>174</div>175</Grid>176</>177))178:179// TERNARY START180props.categoryAction == "NewerFirst" ?181Object.keys(init).reverse().map((row) => (182<>183<Grid className={classes.gridy} item lg={3} md={4} xs={12} style={{marginBottom:"20px"}}>184<div style={{width:"300px"}}>185<div style={{backgroundColor:"rgb(240, 240, 240)",height:"355px",width:"290px",overflow:"hidden"}}>186<div style={{height:"50px",marginBottom:"8px"}}>187{188 ( 100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0)) ) > 0 ?189 <Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>190 :191 <></>192} 193</div>194<div style={{position:"relative",right:"28px"}}>195<ProductCarousel196width="220px!important"197image1={init[row].image}198image2={init[row].image2}199/>200</div>201<p onClick={()=>clicki({202id:row,203image:init[row].image,204image2:init[row].image2,205item:init[row].item,206writer:init[row].writer,207price: init[row].price,208off:init[row].off,209description:init[row].description,210author:init[row].author211})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>212</div> 213<span style={{color:"silver",marginTop:"0px"}}>{init[row].writer}</span>214<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>215<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> April {new Date().getDate()+1}</b> </p>216<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>217</div>218</Grid>219</>220))221:222console.log("false")223 :224 "Loading Items..."225 }226</Grid>227 </>228 )...

Full Screen

Full Screen

ClothesCard.jsx

Source:ClothesCard.jsx Github

copy

Full Screen

1import React,{useEffect,useState} from 'react'2import Avatar from '@material-ui/core/Avatar';3import DoneIcon from '@material-ui/icons/Done'4import Grid from "@material-ui/core/Grid"5import firebaseDb from './firebase';6import ProductCarousel from "./ProductCarousel"7import {useHistory} from "react-router-dom";8import {makeStyles} from '@material-ui/core/styles';9const useStyles = makeStyles((theme) => ({10 gridy: {11 [theme.breakpoints.down('sm')]: {12 margin:'20px 0 0 50%',13 transform:"translate(-50%,0)"14 },15 "&:hover": {16 transform:"scale(1.001)",17 transition:"all 0.5s"18 },19 }20 }));21export default function ClothesCard(props) {22 const classes = useStyles();23 const history=useHistory();24 const[init,upda]=useState({});25 useEffect(()=>{26 firebaseDb.child('Cothes').on("value",snapshot=>{27 28 if(snapshot.val() !=null){29 // upda({...snapshot.val()})30 // setOpen(true);31 32 upda({...snapshot.val()}); 33 }34 })35},[])36 const clicki=(a)=>{37 a.valll="Cothes"38 history.push("/insideproduct",a);39 }40 return (41 <>42 <Grid container style={{marginBottom:"50px",paddingLeft:"20px"}}>43 44 45 46{/* ternary start */}47{48 Object.keys(init) && Object.keys(init).length > 0 && Array.isArray(Object.keys(init))?49 props.categoryAction == "LowHigh" ?50//ternary start51 Object.keys(init).sort((a, b) => init[a].price - init[b].price).map((row) => (52 <>53 <Grid className={classes.gridy} item lg={3} md={4} xs={6} style={{marginBottom:"20px"}}>54 <div style={{width:"300px"}}>55 <div style={{backgroundColor:"white",height:"355px",width:"290px",overflow:"hidden"}}>56 <div style={{height:"50px",marginBottom:"8px"}}>57 <Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>58 </div>59 <div style={{position:"relative",right:"28px"}}>60 <ProductCarousel61 width="220px!important"62 height="220px"63 image1={init[row].image}64 image2={init[row].image2}65 />66 </div>67 <p onClick={()=>clicki({68 id:row,69 image:init[row].image,70 image2:init[row].image2,71 item:init[row].item,72 sellers:init[row].sellers,73 price: init[row].price,74 off:init[row].off,75 description:init[row].description,76 about_seller:init[row].about_seller77 })} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>78 </div> 79 <span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>80 <h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>81<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>82 <span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>83 </div>84 </Grid>85 </>86 ))87 :88//trenery Start89props.categoryAction == "HighLow" ?90 Object.keys(init).sort((a, b) => init[a].price - init[b].price).reverse().map((row) => (91<>92<Grid className={classes.gridy} item lg={3} md={4} xs={6} style={{marginBottom:"20px"}}>93<div style={{width:"300px"}}>94<div style={{backgroundColor:"white",height:"355px",width:"290px",overflow:"hidden"}}>95<div style={{height:"50px",marginBottom:"8px"}}>96<Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>97</div>98<div style={{position:"relative",right:"28px"}}>99<ProductCarousel100width="220px!important"101height="220px"102image1={init[row].image}103image2={init[row].image2}104/>105</div>106<p onClick={()=>clicki({107id:row,108image:init[row].image,109image2:init[row].image2,110item:init[row].item,111sellers:init[row].sellers,112price: init[row].price,113off:init[row].off,114description:init[row].description,115about_seller:init[row].about_seller116})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>117</div> 118<span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>119<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>120<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>121<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>122</div>123</Grid>124</>125))126:127//trenery Start128props.categoryAction == "OlderFirst" ?129Object.keys(init).map((row) => (130<>131<Grid className={classes.gridy} item lg={3} md={4} xs={6} style={{marginBottom:"20px"}}>132<div style={{width:"300px"}}>133<div style={{backgroundColor:"white",height:"355px",width:"290px",overflow:"hidden"}}>134<div style={{height:"50px",marginBottom:"8px"}}>135<Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>136</div>137<div style={{position:"relative",right:"28px"}}>138<ProductCarousel139width="220px!important"140height="220px"141image1={init[row].image}142image2={init[row].image2}143/>144</div>145<p onClick={()=>clicki({146id:row,147image:init[row].image,148image2:init[row].image2,149item:init[row].item,150sellers:init[row].sellers,151price: init[row].price,152off:init[row].off,153description:init[row].description,154about_seller:init[row].about_seller155})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>156</div> 157<span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>158<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>159<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>160<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>161</div>162</Grid>163</>164))165:166// TERNARY START167props.categoryAction == "NewerFirst" ?168Object.keys(init).reverse().map((row) => (169<>170<Grid className={classes.gridy} item lg={3} md={4} xs={6} style={{marginBottom:"20px"}}>171<div style={{width:"300px"}}>172<div style={{backgroundColor:"white",height:"355px",width:"290px",overflow:"hidden"}}>173<div style={{height:"50px",marginBottom:"8px"}}>174<Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>175</div>176<div style={{position:"relative",right:"28px"}}>177<ProductCarousel178width="220px!important"179height="220px"180image1={init[row].image}181image2={init[row].image2}182/>183</div>184<p onClick={()=>clicki({185id:row,186image:init[row].image,187image2:init[row].image2,188item:init[row].item,189sellers:init[row].sellers,190price: init[row].price,191off:init[row].off,192description:init[row].description,193about_seller:init[row].about_seller194})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>195</div> 196<span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>197<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>198<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>199<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>200</div>201</Grid>202</>203))204:205alert("select some category")206 :207 "Loading Items..."208 }209</Grid>210 </>211 )...

Full Screen

Full Screen

TelivisionCard.jsx

Source:TelivisionCard.jsx Github

copy

Full Screen

1import React,{useEffect,useState} from 'react'2import Avatar from '@material-ui/core/Avatar';3import DoneIcon from '@material-ui/icons/Done'4import Grid from "@material-ui/core/Grid"5import firebaseDb from './firebase';6import ProductCarousel from "./ProductCarousel"7import {useHistory} from "react-router-dom";8import {makeStyles} from '@material-ui/core/styles';9const useStyles = makeStyles((theme) => ({10 gridy: {11 [theme.breakpoints.down('sm')]: {12 margin:'20px 0 0 50%',13 transform:"translate(-50%,0)"14 },15 "&:hover": {16 transform:"scale(1.001)",17 transition:"all 0.5s"18 },19 }20 }));21export default function TelivisionCard(props) {22 const classes = useStyles();23 const history=useHistory();24 const[init,upda]=useState({});25 useEffect(()=>{26 firebaseDb.child('Television').on("value",snapshot=>{27 28 if(snapshot.val() !=null){29 // upda({...snapshot.val()})30 // setOpen(true);31 32 upda({...snapshot.val()}); 33 }34 })35},[])36 const clicki=(a)=>{37 a.valll="Television"38 history.push("/insideproduct",a);39 }40 return (41 <>42 <Grid container style={{marginBottom:"50px",paddingLeft:"20px"}}>43 44 45{/* ternary start */}46{47 Object.keys(init) && Object.keys(init).length > 0 && Array.isArray(Object.keys(init))?48 props.categoryAction == "LowHigh" ?49//ternary start50 Object.keys(init).sort((a, b) => init[a].price - init[b].price).map((row) => (51 <>52 <Grid className={classes.gridy} item lg={4} sm={6} xs={12} style={{marginBottom:"20px"}}>53 <div style={{width:"300px"}}>54 <div style={{backgroundColor:"white",height:"355px",width:"380px",overflow:"hidden"}}>55 <div style={{height:"50px",marginBottom:"8px"}}>56 <Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>57 </div>58 <div style={{position:"relative",right:"28px"}}>59 <ProductCarousel60 width="310px!important"61 image1={init[row].image}62 image2={init[row].image2}63 />64 </div>65 <p onClick={()=>clicki({66 id:row,67 image:init[row].image,68 image2:init[row].image2,69 item:init[row].item,70 sellers:init[row].sellers,71 price: init[row].price,72 off:init[row].off,73 description:init[row].description,74 about_seller:init[row].about_seller75 })} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>76 </div> 77 <span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>78 <h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>79<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>80 <span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>81 </div>82 </Grid>83 </>84 ))85 :86//trenery Start87props.categoryAction == "HighLow" ?88 Object.keys(init).sort((a, b) => init[a].price - init[b].price).reverse().map((row) => (89<>90<Grid className={classes.gridy} item lg={4} sm={6} xs={12} style={{marginBottom:"20px"}}>91<div style={{width:"300px"}}>92<div style={{backgroundColor:"white",height:"355px",width:"380px",overflow:"hidden"}}>93<div style={{height:"50px",marginBottom:"8px"}}>94<Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>95</div>96<div style={{position:"relative",right:"28px"}}>97<ProductCarousel98width="310px!important"99image1={init[row].image}100image2={init[row].image2}101/>102</div>103<p onClick={()=>clicki({104id:row,105image:init[row].image,106image2:init[row].image2,107item:init[row].item,108sellers:init[row].sellers,109price: init[row].price,110off:init[row].off,111description:init[row].description,112about_seller:init[row].about_seller113})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>114</div> 115<span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>116<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>117<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>118<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>119</div>120</Grid>121</>122))123:124//trenery Start125props.categoryAction == "OlderFirst" ?126Object.keys(init).map((row) => (127<>128<Grid className={classes.gridy} item lg={4} sm={6} xs={12} style={{marginBottom:"20px"}}>129<div style={{width:"300px"}}>130<div style={{backgroundColor:"white",height:"355px",width:"380px",overflow:"hidden"}}>131<div style={{height:"50px",marginBottom:"8px"}}>132<Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>133</div>134<div style={{position:"relative",right:"28px"}}>135<ProductCarousel136width="310px!important"137image1={init[row].image}138image2={init[row].image2}139/>140</div>141<p onClick={()=>clicki({142id:row,143image:init[row].image,144image2:init[row].image2,145item:init[row].item,146sellers:init[row].sellers,147price: init[row].price,148off:init[row].off,149description:init[row].description,150about_seller:init[row].about_seller151})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>152</div> 153<span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>154<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>155<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>156<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>157</div>158</Grid>159</>160))161:162// TERNARY START163props.categoryAction == "NewerFirst" ?164Object.keys(init).reverse().map((row) => (165<>166<Grid className={classes.gridy} item lg={4} sm={6} xs={12} style={{marginBottom:"20px"}}>167<div style={{width:"300px"}}>168<div style={{backgroundColor:"white",height:"355px",width:"380px",overflow:"hidden"}}>169<div style={{height:"50px",marginBottom:"8px"}}>170<Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>171</div>172<div style={{position:"relative",right:"28px"}}>173<ProductCarousel174width="310px!important"175image1={init[row].image}176image2={init[row].image2}177/>178</div>179<p onClick={()=>clicki({180id:row,181image:init[row].image,182image2:init[row].image2,183item:init[row].item,184sellers:init[row].sellers,185price: init[row].price,186off:init[row].off,187description:init[row].description,188about_seller:init[row].about_seller189})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>190</div> 191<span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>192<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>193<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>194<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>195</div>196</Grid>197</>198))199:200alert("select some category")201 :202 "Loading Items..."203 }204</Grid>205 </>206 )...

Full Screen

Full Screen

MobileCard.jsx

Source:MobileCard.jsx Github

copy

Full Screen

1import React,{useEffect,useState} from 'react'2import Avatar from '@material-ui/core/Avatar';3import DoneIcon from '@material-ui/icons/Done'4import Grid from "@material-ui/core/Grid"5import firebaseDb from './firebase';6import ProductCarousel from "./ProductCarousel"7import {useHistory} from "react-router-dom";8import {makeStyles} from '@material-ui/core/styles';9const useStyles = makeStyles((theme) => ({10 gridy: {11 [theme.breakpoints.down('sm')]: {12 margin:'20px 0 0 50%',13 transform:"translate(-50%,0)"14 },15 "&:hover": {16 transform:"scale(1.001)",17 transition:"all 0.5s"18 },19 }20 }));21export default function MobileCard(props) {22 const classes = useStyles();23 const history=useHistory();24 const[init,upda]=useState({});25 useEffect(()=>{26 firebaseDb.child('Mobile').on("value",snapshot=>{27 28 if(snapshot.val() !=null){29 // upda({...snapshot.val()})30 // setOpen(true);31 32 upda({...snapshot.val()}); 33 }34 })35},[])36 const clicki=(a)=>{37 a.valll="Mobile"38 history.push("/insideproduct",a);39 }40 return (41 <>42 <Grid container style={{marginBottom:"50px",paddingLeft:"20px"}}>43 44 45{/* ternary start */}46{47 Object.keys(init) && Object.keys(init).length > 0 && Array.isArray(Object.keys(init))?48 props.categoryAction == "LowHigh" ?49//ternary start50 Object.keys(init).sort((a, b) => init[a].price - init[b].price).map((row) => (51 <>52 <Grid className={classes.gridy} item lg={3} md={4} xs={12} style={{marginBottom:"20px"}}>53 <div style={{width:"300px"}}>54 <div style={{backgroundColor:"white",height:"355px",width:"290px",overflow:"hidden"}}>55 <div style={{height:"50px",marginBottom:"8px"}}>56 <Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>57 </div>58 <div style={{position:"relative",right:"28px"}}>59 <ProductCarousel60 width="220px!important"61 image1={init[row].image}62 image2={init[row].image2}63 />64 </div>65 <p onClick={()=>clicki({66 id:row,67 image:init[row].image,68 image2:init[row].image2,69 item:init[row].item,70 sellers:init[row].sellers,71 price: init[row].price,72 off:init[row].off,73 description:init[row].description,74 about_seller:init[row].about_seller75 })} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>76 </div> 77 <span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>78 <h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>79<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>80 <span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>81 </div>82 </Grid>83 </>84 ))85 :86//trenery Start87props.categoryAction == "HighLow" ?88 Object.keys(init).sort((a, b) => init[a].price - init[b].price).reverse().map((row) => (89<>90<Grid className={classes.gridy} item lg={3} md={4} xs={12} style={{marginBottom:"20px"}}>91<div style={{width:"300px"}}>92<div style={{backgroundColor:"white",height:"355px",width:"290px",overflow:"hidden"}}>93<div style={{height:"50px",marginBottom:"8px"}}>94<Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>95</div>96<div style={{position:"relative",right:"28px"}}>97<ProductCarousel98width="220px!important"99image1={init[row].image}100image2={init[row].image2}101/>102</div>103<p onClick={()=>clicki({104id:row,105image:init[row].image,106image2:init[row].image2,107item:init[row].item,108sellers:init[row].sellers,109price: init[row].price,110off:init[row].off,111description:init[row].description,112about_seller:init[row].about_seller113})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>114</div> 115<span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>116<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>117<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>118<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>119</div>120</Grid>121</>122))123:124//trenery Start125props.categoryAction == "OlderFirst" ?126Object.keys(init).map((row) => (127<>128<Grid className={classes.gridy} item lg={3} md={4} xs={12} style={{marginBottom:"20px"}}>129<div style={{width:"300px"}}>130<div style={{backgroundColor:"white",height:"355px",width:"290px",overflow:"hidden"}}>131<div style={{height:"50px",marginBottom:"8px"}}>132<Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>133</div>134<div style={{position:"relative",right:"28px"}}>135<ProductCarousel136width="220px!important"137image1={init[row].image}138image2={init[row].image2}139/>140</div>141<p onClick={()=>clicki({142id:row,143image:init[row].image,144image2:init[row].image2,145item:init[row].item,146sellers:init[row].sellers,147price: init[row].price,148off:init[row].off,149description:init[row].description,150about_seller:init[row].about_seller151})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>152</div> 153<span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>154<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>155<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>156<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>157</div>158</Grid>159</>160))161:162// TERNARY START163props.categoryAction == "NewerFirst" ?164Object.keys(init).reverse().map((row) => (165<>166<Grid className={classes.gridy} item lg={3} md={4} xs={12} style={{marginBottom:"20px"}}>167<div style={{width:"300px"}}>168<div style={{backgroundColor:"white",height:"355px",width:"290px",overflow:"hidden"}}>169<div style={{height:"50px",marginBottom:"8px"}}>170<Avatar style={{position:"relative",top:"6px",left:"20px",backgroundColor:"red"}}><span style={{fontSize:"12px"}}>-{100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}% </span></Avatar>171</div>172<div style={{position:"relative",right:"28px"}}>173<ProductCarousel174width="220px!important"175image1={init[row].image}176image2={init[row].image2}177/>178</div>179<p onClick={()=>clicki({180id:row,181image:init[row].image,182image2:init[row].image2,183item:init[row].item,184sellers:init[row].sellers,185price: init[row].price,186off:init[row].off,187description:init[row].description,188about_seller:init[row].about_seller189})} className="jjj" style={{margin:"16px 0 0 0",cursor:"pointer"}}>{init[row].item}</p>190</div> 191<span style={{color:"silver",marginTop:"0px"}}>{init[row].sellers}</span>192<h3 style={{color:"#B12704",margin:"10px 0 0 0px"}}><sup>₹</sup>{init[row].price} <span style={{color:"silver",fontSize:"16px",textDecoration:"line-through"}}> ₹{Number(init[row].price)+Number(init[row].off)} </span> <span style={{color:"silver",fontSize:"16px",textDecoration:"none",marginLeft:"10px"}}> save({init[row].off}) {100-((Number(init[row].price)/(Number(init[row].price)+Number(init[row].off))*100).toFixed(0))}%</span></h3>193<p style={{marginTop:"10px"}}> <DoneIcon style={{color:"#B12704"}}/> <span style={{color:"#B12704"}}><b>Express</b></span> Get it by Tomorrow, <b> March {new Date().getDate()+1}</b> </p>194<span style={{color:"silver",marginTop:"0px"}}>FREE Delivery over ₹499.Fulfilled by PerfectLegal.</span>195</div>196</Grid>197</>198))199:200alert("select some category")201 :202 203 "Loading Items..."204 }205</Grid>206 </>207 )...

Full Screen

Full Screen

core.googlemap.js

Source:core.googlemap.js Github

copy

Full Screen

1function jacqueline_googlemap_init(dom_obj, coords) {2 "use strict";3 if (typeof JACQUELINE_STORAGE['googlemap_init_obj'] == 'undefined') jacqueline_googlemap_init_styles();4 JACQUELINE_STORAGE['googlemap_init_obj'].geocoder = '';5 try {6 var id = dom_obj.id;7 JACQUELINE_STORAGE['googlemap_init_obj'][id] = {8 dom: dom_obj,9 markers: coords.markers,10 geocoder_request: false,11 opt: {12 zoom: coords.zoom,13 center: null,14 scrollwheel: false,15 scaleControl: false,16 disableDefaultUI: false,17 panControl: true,18 zoomControl: true, //zoom19 mapTypeControl: false,20 streetViewControl: false,21 overviewMapControl: false,22 styles: JACQUELINE_STORAGE['googlemap_styles'][coords.style ? coords.style : 'default'],23 mapTypeId: google.maps.MapTypeId.ROADMAP24 }25 };26 27 jacqueline_googlemap_create(id);28 } catch (e) {29 30 dcl(JACQUELINE_STORAGE['strings']['googlemap_not_avail']);31 };32}33function jacqueline_googlemap_create(id) {34 "use strict";35 // Create map36 JACQUELINE_STORAGE['googlemap_init_obj'][id].map = new google.maps.Map(JACQUELINE_STORAGE['googlemap_init_obj'][id].dom, JACQUELINE_STORAGE['googlemap_init_obj'][id].opt);37 // Add markers38 for (var i in JACQUELINE_STORAGE['googlemap_init_obj'][id].markers)39 JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].inited = false;40 jacqueline_googlemap_add_markers(id);41 42 // Add resize listener43 jQuery(window).resize(function() {44 if (JACQUELINE_STORAGE['googlemap_init_obj'][id].map)45 JACQUELINE_STORAGE['googlemap_init_obj'][id].map.setCenter(JACQUELINE_STORAGE['googlemap_init_obj'][id].opt.center);46 });47}48function jacqueline_googlemap_add_markers(id) {49 "use strict";50 for (var i in JACQUELINE_STORAGE['googlemap_init_obj'][id].markers) {51 52 if (JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].inited) continue;53 54 if (JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].latlng == '') {55 56 if (JACQUELINE_STORAGE['googlemap_init_obj'][id].geocoder_request!==false) continue;57 58 if (JACQUELINE_STORAGE['googlemap_init_obj'].geocoder == '') JACQUELINE_STORAGE['googlemap_init_obj'].geocoder = new google.maps.Geocoder();59 JACQUELINE_STORAGE['googlemap_init_obj'][id].geocoder_request = i;60 JACQUELINE_STORAGE['googlemap_init_obj'].geocoder.geocode({address: JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].address}, function(results, status) {61 "use strict";62 if (status == google.maps.GeocoderStatus.OK) {63 var idx = JACQUELINE_STORAGE['googlemap_init_obj'][id].geocoder_request;64 if (results[0].geometry.location.lat && results[0].geometry.location.lng) {65 JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[idx].latlng = '' + results[0].geometry.location.lat() + ',' + results[0].geometry.location.lng();66 } else {67 JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[idx].latlng = results[0].geometry.location.toString().replace(/\(\)/g, '');68 }69 JACQUELINE_STORAGE['googlemap_init_obj'][id].geocoder_request = false;70 setTimeout(function() { 71 jacqueline_googlemap_add_markers(id); 72 }, 200);73 } else74 dcl(JACQUELINE_STORAGE['strings']['geocode_error'] + ' ' + status);75 });76 77 } else {78 79 // Prepare marker object80 var latlngStr = JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].latlng.split(',');81 var markerInit = {82 map: JACQUELINE_STORAGE['googlemap_init_obj'][id].map,83 position: new google.maps.LatLng(latlngStr[0], latlngStr[1]),84 clickable: JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].description!=''85 };86 if (JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].point) markerInit.icon = JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].point;87 if (JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].title) markerInit.title = JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].title;88 JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].marker = new google.maps.Marker(markerInit);89 90 // Set Map center91 if (JACQUELINE_STORAGE['googlemap_init_obj'][id].opt.center == null) {92 JACQUELINE_STORAGE['googlemap_init_obj'][id].opt.center = markerInit.position;93 JACQUELINE_STORAGE['googlemap_init_obj'][id].map.setCenter(JACQUELINE_STORAGE['googlemap_init_obj'][id].opt.center); 94 }95 96 // Add description window97 if (JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].description!='') {98 JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].infowindow = new google.maps.InfoWindow({99 content: JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].description100 });101 google.maps.event.addListener(JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].marker, "click", function(e) {102 var latlng = e.latLng.toString().replace("(", '').replace(")", "").replace(" ", "");103 for (var i in JACQUELINE_STORAGE['googlemap_init_obj'][id].markers) {104 if (latlng == JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].latlng) {105 JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].infowindow.open(106 JACQUELINE_STORAGE['googlemap_init_obj'][id].map,107 JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].marker108 );109 break;110 }111 }112 });113 }114 115 JACQUELINE_STORAGE['googlemap_init_obj'][id].markers[i].inited = true;116 }117 }118}119function jacqueline_googlemap_refresh() {120 "use strict";121 for (id in JACQUELINE_STORAGE['googlemap_init_obj']) {122 jacqueline_googlemap_create(id);123 }124}125function jacqueline_googlemap_init_styles() {126 // Init Google map127 JACQUELINE_STORAGE['googlemap_init_obj'] = {};128 JACQUELINE_STORAGE['googlemap_styles'] = {129 'default': []130 };131 if (window.jacqueline_theme_googlemap_styles!==undefined)132 JACQUELINE_STORAGE['googlemap_styles'] = jacqueline_theme_googlemap_styles(JACQUELINE_STORAGE['googlemap_styles']);...

Full Screen

Full Screen

main.js

Source:main.js Github

copy

Full Screen

1/*! main.js | Bulkit | CSS Ninja */2/* ==========================================================================3Website core JS file (see function.js for complete function reference)4========================================================================== */5"use strict";6initPageLoader();7$(document).ready(function ($) {8 var el = document.querySelectorAll('[data-lazy-load]');9 var observer = lozad(el, {10 loaded: function loaded(el) {11 // Custom implementation on a loaded element12 el.parentNode.classList.add('loaded');13 }14 });15 observer.observe(); //Global functions16 if (env === 'development') {17 changeDemoImages();18 }19 initThemeSwitcher();20 initSlider();21 initBackgroundImages(); //Layout functions22 initNavbar();23 initLandingNavbar();24 initMobileMenu();25 initLandingMobileMenu();26 initNavbarDropdown();27 initSidebar();28 feather.replace(); //Tabs29 initTabsNav();30 initNavigationTabs();31 initVerticalTabs(); //Cards32 initMediaCards();33 initTiltCards(); //Form controls34 initDatepicker();35 initTimepicker();36 initDatepickerAlt();37 initChosenSelects();38 initMaterialSelect();39 initAutocompletes();40 initFileInputs();41 initRangeInput();42 initRangeInputs();43 initJqueryTagInput();44 initBulmaTags();45 initBulmaSteps();46 initBulmaIconpicker();47 initBulmaCalendar();48 initComboBox();49 initImageComboBox();50 initStackedComboBox(); //4. Popups51 initPopovers();52 initTooltips();53 initModals(); //5. Carousels54 initBasicCarousel();55 initVerticalCarousel();56 initFlatCarousel();57 initImageCarousel();58 initSingleImageCarousel();59 initMultipleImagesCarousel(); //6. Video60 initVideoEmbed();61 initBackgroundVideo();62 initPlayers(); //7. Counters63 initCounters(); //8. Accordions64 initSimpleAccordion();65 initAccordions(); //9. File uploader66 initFileUploader(); //10. Toasts67 initToasts(); //11. Demo68 initDemo();69 initScrollspyNav();70 initParallax();71 initBackToTop(); //12. Utility functions72 initGitem();73 initAnchorScroll();74 initQuickview();75 initScrollReveal(); //13. Landing pages functions76 initMockup();77 initClientsCarousel();78 initPeopleCarousel();79 initCustomCarousel();80 initCarousel();81 initLandingCarousel();82 initTestimonials();83 initCharacterTestimonials();84 initPricing();85 initPricingCarousel();86 initTabbedPricing();87 initFreelancerPricing();88 initSwitchPricing();89 initBoxedPricing();90 initOnePagePricing();91 initBlog();92 initSearchBox();93 initNavigationDots();94 initFaq();95 initAuth();96 initAnimations();97 initCanvas();98 initParticles();99 initAnimatedSvg();100 initChatWidget();101 initContactToggler();102 initMapBox();103 initCodeTabs();...

Full Screen

Full Screen

plugin_init.js

Source:plugin_init.js Github

copy

Full Screen

...27 preInit: sinon.spy(),28 requiredIds: []29 }30 };31 await pluginInit(getPluginCollection(plugins));32 expect(plugins.foo.preInit.calledBefore(plugins.foo.init)).to.be.ok();33 expect(plugins.foo.preInit.calledBefore(plugins.bar.init)).to.be.ok();34 expect(plugins.foo.preInit.calledBefore(plugins.baz.init)).to.be.ok();35 expect(plugins.bar.preInit.calledBefore(plugins.foo.init)).to.be.ok();36 expect(plugins.bar.preInit.calledBefore(plugins.bar.init)).to.be.ok();37 expect(plugins.bar.preInit.calledBefore(plugins.baz.init)).to.be.ok();38 expect(plugins.baz.preInit.calledBefore(plugins.foo.init)).to.be.ok();39 expect(plugins.baz.preInit.calledBefore(plugins.bar.init)).to.be.ok();40 expect(plugins.baz.preInit.calledBefore(plugins.baz.init)).to.be.ok();41 });42 it('should call preInits in correct order based on requirements', async () => {43 const plugins = {44 foo: {45 id: 'foo',46 init: sinon.spy(),47 preInit: sinon.spy(),48 requiredIds: ['bar', 'baz']49 },50 bar: {51 id: 'bar',52 init: sinon.spy(),53 preInit: sinon.spy(),54 requiredIds: []55 },56 baz: {57 id: 'baz',58 init: sinon.spy(),59 preInit: sinon.spy(),60 requiredIds: ['bar']61 }62 };63 await pluginInit(getPluginCollection(plugins));64 expect(plugins.bar.preInit.firstCall.calledBefore(plugins.foo.init.firstCall)).to.be.ok();65 expect(plugins.bar.preInit.firstCall.calledBefore(plugins.baz.init.firstCall)).to.be.ok();66 expect(plugins.baz.preInit.firstCall.calledBefore(plugins.foo.init.firstCall)).to.be.ok();67 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2var wpt = new WebPageTest('www.webpagetest.org');3wpt.init(function(err, data) {4 console.log(data);5});6var wpt = require('wpt');7var wpt = new WebPageTest('www.webpagetest.org');8wpt.init(function(err, data) {9 console.log(data);10});11var wpt = require('wpt');12var wpt = new WebPageTest('www.webpagetest.org');13wpt.init(function(err, data) {14 console.log(data);15});16var wpt = require('wpt');17var wpt = new WebPageTest('www.webpagetest.org');18wpt.init(function(err, data) {19 console.log(data);20});21var wpt = require('wpt');22var wpt = new WebPageTest('www.webpagetest.org');23wpt.init(function(err, data) {24 console.log(data);25});26var wpt = require('wpt');27var wpt = new WebPageTest('www.webpagetest.org');28wpt.init(function(err, data) {29 console.log(data);30});31var wpt = require('wpt');32var wpt = new WebPageTest('www.webpagetest.org');33wpt.init(function(err, data) {34 console.log(data);35});36var wpt = require('wpt');37var wpt = new WebPageTest('www.webpagetest.org');38wpt.init(function(err, data) {39 console.log(data);40});41var wpt = require('wpt');42var wpt = new WebPageTest('www.webpagetest.org');43wpt.init(function(err, data) {44 console.log(data);45});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2wpt.init('your_api_key');3var wpt = require('wpt');4});5var wpt = require('wpt');6});7var wpt = require('wpt');8wpt.getTestResults( { testId: '12345' }, function( err, data ) {9});10var wpt = require('wpt');11wpt.getTestResults( { testId: '12345', breakDown: 1, requests: 1, pagespeed: 1 }, function( err, data ) {12});13var wpt = require('wpt');14wpt.getLocations( function( err, data ) {15});16var wpt = require('wpt');17wpt.getLocations( { f: 'xml' }, function( err, data ) {18});19var wpt = require('wpt');20wpt.getTesters( function( err, data ) {21});22var wpt = require('wpt');23wpt.getTesters( { f: 'xml' }, function( err, data ) {24});25var wpt = require('wpt');26wpt.getStatus( function( err, data ) {27});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2var wpt = new wpt('API_KEY');3wpt.init(url, function(err, data){4 if (err) {5 console.log(err);6 } else {7 console.log(data);8 }9});10var wpt = require('wpt');11var wpt = new wpt('API_KEY');12wpt.runTest(url, function(err, data){13 if (err) {14 console.log(err);15 } else {16 console.log(data);17 }18});19var wpt = require('wpt');20var wpt = new wpt('API_KEY');21var testId = '140430_6Q_1';22wpt.getTestResults(testId, function(err, data){23 if (err) {24 console.log(err);25 } else {26 console.log(data);27 }28});29var wpt = require('wpt');30var wpt = new wpt('API_KEY');31wpt.getLocations(function(err, data){32 if (err) {33 console.log(err);34 } else {35 console.log(data);36 }37});38var wpt = require('wpt');39var wpt = new wpt('API_KEY');40wpt.getTesters(function(err, data){41 if (err) {42 console.log(err);43 } else {44 console.log(data);45 }46});47var wpt = require('wpt');48var wpt = new wpt('API_KEY');49var testId = '140430_6Q_1';50wpt.getTestStatus(testId, function(err, data){51 if (err) {52 console.log(err);53 } else {54 console.log(data);55 }56});57var wpt = require('wpt');58var wpt = new wpt('API_KEY');59var testId = '140430_6Q_1';60wpt.getVideo(testId, function(err, data){61 if (

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptool = require('wptool');2wptool.init();3wptool.method1();4wptool.method2();5var wptool = require('wptool');6wptool.init();7wptool.method1();8wptool.method2();9var wptool = require('wptool');10wptool.init();11var wptool2 = require('wptool');12wptool2.init();13I’m not sure I understand the problem. You are using the same module in two different files, and you are calling the init() method in each of them. So, the init() method is called twice. What happens when you do that?14What do you mean by that? What do you mean by “use the init() method”?15I’m not sure I understand the problem. You are using the same module in two different files, and you are calling the init() method in each of them. So, the init() method is called twice. What happens when you do that?16What do you mean by that? What do you mean by “use the init() method”?17I mean that the init() method is required to use

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 wpt 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