Commit 4c06cc44131838708fe25790ddd469276d5d970f
- Diff rendering mode:
- inline
- side by side
server/wsgi/page_edit.js
(96 / 77)
  | |||
1105 | 1105 | { | |
1106 | 1106 | if(sib.nodeType == 1 && sib.tagName == elt.tagName)count++ | |
1107 | 1107 | } | |
1108 | |||
1108 | |||
1109 | 1109 | return count; | |
1110 | 1110 | }; | |
1111 | 1111 | ||
… | … | ||
1118 | 1118 | if (idx > 1) xname += "[" + idx + "]"; | |
1119 | 1119 | path = "/" + xname + path; | |
1120 | 1120 | } | |
1121 | |||
1121 | |||
1122 | 1122 | return path; | |
1123 | 1123 | }; | |
1124 | 1124 | ||
… | … | ||
1486 | 1486 | panelButtonAttributes = fontTypeAttributes.addStyle('height:auto; cursor:pointer; float:right; font-weight:normal; font-size:14px; background-image:none; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; margin: 16px 16px 0 0; padding: 0 0 4px 0;-khtml-box-sizing: none;-webkit-box-sizing: none;-moz-box-sizing: none;box-sizing: none;text-shadow:none;'); | |
1487 | 1487 | editButtonAttributes = normalFontAttributes.addStyle(" height:45px;float:left; position:relative; cursor:pointer;border-top:1px solid #BDBDBD;border-left:1px solid #BDBDBD;border-right:1px solid #BDBDBD;border-bottom:1px solid #BDBDBD;color:#000;background-color:#FFF;margin: 0px;padding: 0px;"); | |
1488 | 1488 | ||
1489 | var closeButtonIconPath = './images/close_button.png'; | ||
1489 | var closeButtonIconPath = 'http://dev.a11y.in/alipi/images/close_button.png'; | ||
1490 | 1490 | closeButtonAttributes = editButtonAttributes.addStyle('top: -8px; left: -8px; position: absolute; border:none; background: url("' + closeButtonIconPath +'") no-repeat; width: 15px; height: 15px; z-index: 2;'); | |
1491 | 1491 | ||
1492 | 1492 | // Ajay - Redarrow is not using | |
… | … | ||
1666 | 1666 | ||
1667 | 1667 | // Ajay - This is ovelay for 'Saving and Loading' - changed rgba colors | |
1668 | 1668 | backgroundDiv = DOM.BUILDER.DIV(elementAttributes.addStyle(' z-index: 2147483646; width: 100%; height: 100%; min-height: 800px; min-width: 1024px; left: 0; top: 0; position: fixed; display: none; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=87)"; filter: alpha(opacity=87); background: #fff; background: -webkit-gradient(radial, center 40%, 900, center 40%, 0, from(rgba(0, 0, 0, 0.1)), to(rgba(0, 0, 0, 0.87))); background: -moz-radial-gradient( center 40%, circle , rgba(255, 255, 255, 0) 0px , rgba(255, 255, 255, 255) 900px);').values()); | |
1669 | loadingImage = DOM.BUILDER.IMG(normalFontAttributes.put({src: './images/loading.gif'}).addStyle('position: relative; width: 24px; height: 24px; display: inline; vertical-align: middle; ').values()); // Ajay - replaced loading.gif image | ||
1670 | loadingText = DOM.BUILDER.SPAN(normalFontAttributes.addStyle('position: relative; font-size: 14px; font-weight: bold; margin-left: 10px; color:#ECECEC; display: inline; vertical-align: middle;').values(), 'Loading'); | ||
1671 | loadingDiv = DOM.BUILDER.DIV(normalFontAttributes.addStyle('position: relative; width: auto; height: auto; display: block; text-align: left;').values(), loadingImage, loadingText); | ||
1672 | backgroundDiv.appendChild(loadingDiv); | ||
1669 | // loadingImage = DOM.BUILDER.IMG(normalFontAttributes.put({src: './images/loading.gif'}).addStyle('position: relative; width: 24px; height: 24px; display: inline; vertical-align: middle; ').values()); // Ajay - replaced loading.gif image | ||
1670 | // loadingText = DOM.BUILDER.SPAN(normalFontAttributes.addStyle('position: relative; font-size: 14px; font-weight: bold; margin-left: 10px; color:#ECECEC; display: inline; vertical-align: middle;').values(), 'Loading'); | ||
1671 | // loadingDiv = DOM.BUILDER.DIV(normalFontAttributes.addStyle('position: relative; width: auto; height: auto; display: block; text-align: left;').values()//, loadingImage, loadingText); | ||
1672 | // backgroundDiv.appendChild(loadingDiv); | ||
1673 | 1673 | ||
1674 | messageOverlay = DOM.BUILDER.DIV(elementAttributes.addStyle('z-index: 2147483647;opacity: 1.0; box-shadow: 0px 0px 5px #000; -webkit-box-shadow: 0px 0px 5px #000; -moz-box-shadow: 0px 0px 5px #000; -moz-border-radius-topright:10px;-moz-border-radius-bottomright:10px;-moz-border-radius-topleft:10px; -moz-border-radius-bottomleft:10px;-webkit-border-top-right-radius:10px; -webkit-border-bottom-right-radius:10px;-webkit-border-top-left-radius:10px; -webkit-border-bottom-left-radius:10px; text-align:center; position:fixed; left:0px; top:0px; width:700px; height:375px; background:#000xs; display: none;background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(#000), to(#202020)); background: -moz-linear-gradient(bottom, #000, #202020);').values()); | ||
1674 | messageOverlay = DOM.BUILDER.DIV(elementAttributes.addStyle('z-index: 2147483647;opacity: 1.0; box-shadow: 0px 0px 5px #000; -webkit-box-shadow: 0px 0px 5px #000; -moz-box-shadow: 0px 0px 5px #000; -moz-border-radius:10px; -webkit-border-radius:10px; position:fixed; left:20%; top:20%; bottom:20%; right:20%; background:#000; display:none;').values()); | ||
1675 | 1675 | ||
1676 | messageTitle = DOM.BUILDER.H1(normalFontAttributes.addStyle('position: relative; color:#FFF; width:auto; margin-top:50px; margin-bottom: 20px; font-size: 30px; line-height: 36px; text-align: center; font-weight: normal; display: block; ').values(), 'Page Editor'); | ||
1676 | messageTitle = DOM.BUILDER.H1(normalFontAttributes.addStyle('position:fixed; top:23%; left:44%; color:#FFF; font-size: 30px; line-height:36px; font-weight: normal; text-decoration:none;').values(), 'Page Editor'); | ||
1677 | 1677 | ||
1678 | 1678 | messageOverlay.appendChild(messageTitle); | |
1679 | 1679 | ||
1680 | messageDescription = DOM.BUILDER.P(normalFontAttributes.addStyle('color:#FFF; font-weight: normal; font-size: 14px; line-height: 22px; width:450px; margin-left: auto; margin-right: auto; text-align: center;').values(), 'Click on any part of the page, and you will activate buttons that allow you to modify text, replace images and add audio. Just refresh your page to exit from editing without saving your changes. Don\'t forget to hit "Publish" when you\'re finished editing so we can save your newly-crafted page.'); | ||
1680 | messageDescription = DOM.BUILDER.P(normalFontAttributes.addStyle('position:fixed; top:32%; left:22%; right:22%; text-align:justify; color:#FFF; font-weight: normal; font-size: 16px; line-height:24px;').values(), 'Click on any part of the page, and you will activate buttons that allow you to modify text, replace images and add audio. Just refresh your page to exit from editing without saving your changes. Don\'t forget to hit "Publish" when you\'re finished editing so we can save your newly-crafted page.'); | ||
1681 | 1681 | messageOverlay.appendChild(messageDescription); | |
1682 | 1682 | ||
1683 | var image = DOM.BUILDER.IMG(normalFontAttributes.put({src: 'https://bo.lt/app/asset/page-edit/pencil_white_16.png?p=622fd096a39f5c36a6e06e41a9963dafaad61079'}).addStyle('position: relative; margin-right: 10px; vertical-align: middle;').values()); | ||
1683 | // var image = DOM.BUILDER.IMG(normalFontAttributes.put({src: 'https://bo.lt/app/asset/page-edit/pencil_white_16.png?p=622fd096a39f5c36a6e06e41a9963dafaad61079'}).addStyle('position: relative; margin-right: 10px; vertical-align: middle;').values()); | ||
1684 | 1684 | var text = DOM.BUILDER.SPAN(normalFontAttributes.addStyle('position: relative; line-height: 18px; height: 18px; font-size: 18px; margin-right: auto; vertical-align: middle;display: inline-block; float: none; ').values(), 'OK'); | |
1685 | 1685 | ||
1686 | 1686 | // Ajay - Changed lot of colors - Not using, not sure | |
1687 | editButton = DOM.BUILDER.BUTTON(panelButtonAttributes.addStyle('color:#FFF; margin-left: auto; margin-right: auto; width: 100px; height: 36px; display: block; float: none; margin-top: 30px; margin-bottom: 30px; background: #777; background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #777), color-stop(1, #fff)); background: -moz-linear-gradient(center bottom, #777 0%, #fff 100%); border: 1px solid #777; border-radius: 3px; border: 1px solid #777; box-shadow: #fff 0px 0px 2px 0px inset, rgba(0, 0, 0, .5) 0px 0px 2px 0px; -moz-box-shadow:#fff 0px 0px 2px 0px inset, rgba(0, 0, 0, .5) 0px 0px 2px 0px; -webkit-box-shadow:#fff 0px 0px 2px 0px inset, rgba(0, 0, 0, .5) 0px 0px 2px 0px;').values()); | ||
1687 | editButton = DOM.BUILDER.BUTTON(panelButtonAttributes.addStyle('position:fixed; left:46%; bottom:23%; color:#FFF; margin-left: auto; margin-right: auto; width: 100px; height:36px; background: #777; background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #777), color-stop(1, #fff)); background: -moz-linear-gradient(center bottom, #777 0%, #fff 100%); border: 1px solid #777; border-radius: 3px; border: 1px solid #777; box-shadow: #fff 0px 0px 2px 0px inset, rgba(0, 0, 0, .5) 0px 0px 2px 0px; -moz-box-shadow:#fff 0px 0px 2px 0px inset, rgba(0, 0, 0, .5) 0px 0px 2px 0px; -webkit-box-shadow:#fff 0px 0px 2px 0px inset, rgba(0, 0, 0, .5) 0px 0px 2px 0px;').values()); | ||
1688 | 1688 | editButton.onclick = function loadingEditButtonOnClick() { | |
1689 | 1689 | messageOverlay.style.display = 'none'; | |
1690 | 1690 | backgroundDiv.style.display = 'none'; | |
… | … | ||
1718 | 1718 | if (textToDisplay) { | |
1719 | 1719 | DOM.textContent(textToDisplay); | |
1720 | 1720 | } | |
1721 | var screenSize = DOM.viewDimension(); | ||
1722 | backgroundDiv.style.minWidth = screenSize[0] + 'px'; | ||
1723 | backgroundDiv.style.minHeight = screenSize[1] + 'px'; | ||
1721 | // var screenSize = DOM.viewDimension(); | ||
1722 | // backgroundDiv.style.minWidth = screenSize[0] + 'px'; | ||
1723 | // backgroundDiv.style.minHeight = screenSize[1] + 'px'; | ||
1724 | 1724 | ||
1725 | messageOverlay.style.left = (screenSize[0] - parseInt(messageOverlay.style.width) ) / 2 + 'px'; | ||
1726 | messageOverlay.style.top = (screenSize[1] - parseInt(messageOverlay.style.height) ) / 2 + 'px'; | ||
1727 | loadingDiv.style.left = (screenSize[0] - parseInt(loadingImage.style.width) ) / 2 + 'px'; | ||
1728 | loadingDiv.style.top = (screenSize[1] - parseInt(loadingImage.style.height) ) / 2 + 'px'; | ||
1725 | // messageOverlay.style.left = (screenSize[0] - parseInt(messageOverlay.style.width) ) / 2 + 'px'; | ||
1726 | // messageOverlay.style.top = (screenSize[1] - parseInt(messageOverlay.style.height) ) / 2 + 'px'; | ||
1727 | // loadingDiv.style.left = (screenSize[0] - parseInt(loadingImage.style.width) ) / 2 + 'px'; | ||
1728 | // loadingDiv.style.top = (screenSize[1] - parseInt(loadingImage.style.height) ) / 2 + 'px'; | ||
1729 | 1729 | ||
1730 | 1730 | backgroundDiv.style.display = 'block'; | |
1731 | 1731 | ||
… | … | ||
1780 | 1780 | // slow to load. | |
1781 | 1781 | ||
1782 | 1782 | // Ajay - This is ovelay for 'Saving and Loading' - changed rgba colors | |
1783 | backgroundDiv = DOM.BUILDER.DIV(elementAttributes.put({id : 'bgdiv'}).addStyle(' z-index: 2147483646; width: 100%; height: 100%; min-height: 800px; min-width: 1024px; left: 0; top: 0; position: fixed; display: none; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=87)"; filter: alpha(opacity=87); background: #fff; background: -webkit-gradient(radial, center 40%, 900, center 40%, 0, from(rgba(0, 0, 0, 0.1)), to(rgba(0, 0, 0, 0.87))); background: -moz-radial-gradient( center 40%, circle , rgba(255, 255, 255, 0) 0px , rgba(255, 255, 255, 255) 900px);').values()); | ||
1784 | loadingText = DOM.BUILDER.SPAN(normalFontAttributes.addStyle('position: relative; font-size: 14px; font-weight: bold; margin-left: 10px; color:#ECECEC; display: inline; vertical-align: middle;').values(), 'Loading'); | ||
1785 | loadingDiv = DOM.BUILDER.DIV(normalFontAttributes.addStyle('position: relative; width: auto; height: auto; display: block; text-align: left;').values(), loadingText); | ||
1786 | backgroundDiv.appendChild(loadingDiv); | ||
1783 | backgroundDiv = DOM.BUILDER.DIV(elementAttributes.put({id : 'bgdiv'}).addStyle(' z-index: 2147483646; width: 100%; height: 100%; left: 0; top: 0; position: fixed; display: none; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=87)"; filter: alpha(opacity=87); background: #fff; background: -webkit-gradient(radial, center 40%, 900, center 40%, 0, from(rgba(0, 0, 0, 0.1)), to(rgba(0, 0, 0, 1))); background: -moz-radial-gradient( center 40%, circle , rgba(255, 255, 255, 0) 0px , rgba(255, 255, 255, 255) 900px);').values()); | ||
1784 | // loadingDiv = DOM.BUILDER.DIV(normalFontAttributes.addStyle('position: relative; width: auto; height: auto; display: block; text-align: left;').values()); | ||
1785 | // backgroundDiv.appendChild(loadingDiv); | ||
1787 | 1786 | ||
1788 | messageOverlay = DOM.BUILDER.DIV(elementAttributes.put({id : 'msgoverlay'}).addStyle('z-index: 2147483647;opacity: 1.0; box-shadow: 0px 0px 5px #000; -webkit-box-shadow: 0px 0px 5px #000; -moz-box-shadow: 0px 0px 5px #000; -moz-border-radius-topright:10px;-moz-border-radius-bottomright:10px;-moz-border-radius-topleft:10px; -moz-border-radius-bottomleft:10px;-webkit-border-top-right-radius:10px; -webkit-border-bottom-right-radius:10px;-webkit-border-top-left-radius:10px; -webkit-border-bottom-left-radius:10px; position:fixed; left:10px; top:10px; bottom:10px; right:10px; width:98%; height:98%; background:#000; display:none; background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(#000), to(#202020)); background: -moz-linear-gradient(bottom, #000, #202020);').values()); | ||
1787 | messageOverlay = DOM.BUILDER.DIV(elementAttributes.put({id : 'msgoverlay'}).addStyle('z-index: 2147483647;opacity: 1.0; box-shadow: 0px 0px 5px #000; -webkit-box-shadow: 0px 0px 5px #000; -moz-box-shadow: 0px 0px 5px #000; -moz-border-radius:10px; -webkit-border-radius:10px; position:fixed; left:5%; top:5%; bottom:5%; right:5%; background:#000; display:none; vertical-align:middle;').values()); | ||
1789 | 1788 | ||
1790 | 1789 | step1 = DOM.BUILDER.H1(normalFontAttributes.addStyle('position: relative; color:#FFF; width:auto; font-size: 22px; line-height: 36px; text-align: center; font-weight: normal; display: block; ').values(), 'Please provide all the details below'); | |
1791 | 1790 | ||
1792 | 1791 | messageOverlay.appendChild(step1); | |
1793 | 1792 | ||
1794 | var image = DOM.BUILDER.IMG(normalFontAttributes.put({src: '../images/close_button.png'}).addStyle('position: relative; margin-right: 10px; vertical-align: middle;').values()); | ||
1793 | var image = DOM.BUILDER.IMG(normalFontAttributes.put({src: 'http://dev.a11y.in/alipi/images/close_button.png'}).addStyle('position:fixed; top:3%; right:4%; width:25px; height:25px;').values()); | ||
1795 | 1794 | var text = DOM.BUILDER.SPAN(normalFontAttributes.addStyle('position: relative; line-height: 18px; height: 18px; font-size: 18px; margin-right: auto; vertical-align: middle;display: inline-block; float: none;').values(), 'OK'); | |
1796 | 1795 | ||
1797 | //---------------------------- state & language target -------------------------- | ||
1798 | locSelectAttributes = panelButtonAttributes.addStyle('position:absolute; top:25%; left:05%; width:23%; color:#FFF; text-align:center; background: #222; border:3px solid; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; font-size:14px;').values(); | ||
1799 | locSelectLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:absolute; top:24%; left:05%; width:auto; font-size: 14px; font-weight: bold; background: transparent; color: #FFF; display:inline-block;').values()); | ||
1800 | locSelectLabel.innerHTML = 'Select any state'; | ||
1796 | image.onclick=function(){ | ||
1797 | document.getElementById("msgoverlay").style.display = "none"; | ||
1798 | document.getElementById("bgdiv").style.display = "none"; | ||
1799 | } | ||
1801 | 1800 | ||
1802 | langSelectAttributes = panelButtonAttributes.addStyle('position:absolute; top:50%; left:05%; width:23%; color:#FFF; text-align:center; background: #222; border:3px solid; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; font-size:14px;').values(); | ||
1803 | langSelectLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:absolute; top:49%; left:05%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;display: inline-block;').values()); | ||
1804 | langSelectLabel.innerHTML = 'Languages of selected/all state(s)'; | ||
1805 | 1801 | ||
1806 | enterBlogAttributes = panelButtonAttributes.put({placeholder : 'http://abc.blogspot.com/', type : 'text'}).addStyle('position:absolute; top:25%; left:36%; width:23%; color:#FFF; text-align:center; background: #222; border:3px solid; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; font-size:14px;').values(); | ||
1807 | enterBlogLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:absolute; top:23%; left:36%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;display: inline-block;').values()); | ||
1802 | //---------------------------- state & language target -------------------------- | ||
1803 | locSelectLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:fixed; top:20%; left:10%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;').values()); | ||
1804 | locSelectLabel.innerHTML = 'Select any state'; | ||
1805 | enterBlogLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:fixed; top:20%; left:40%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;').values()); | ||
1808 | 1806 | enterBlogLabel.innerHTML = 'Enter your blog URL'; | |
1807 | enterMailIdLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:fixed; top:20%; left:70%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;').values()); | ||
1808 | enterMailIdLabel.innerHTML = 'USERNAME'; | ||
1809 | 1809 | ||
1810 | defaultBlogAttributes = DOM.BUILDER.INPUT(editAttributes.put({ name : 'Loading Checkbox', type : 'checkbox'}).addStyle('position:absolute; top:54%; left:36%; background: transparent; display: inline-block;').values()); | ||
1811 | defaultBlogLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:absolute; top:55%; left:39%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;display: inline-block;').values()); | ||
1812 | defaultBlogLabel.innerHTML = 'Default blog (Our blog)'; | ||
1813 | 1810 | ||
1814 | enterMailIdAttributes = panelButtonAttributes.put({placeholder : 'username@gmail.com', type : 'text'}).addStyle('position:absolute; top:25%; left:70%; width:23%; color:#FFF; text-align:center; background: #222; border:3px solid; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; font-size:14px;').values(); | ||
1815 | enterMailIdLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:absolute; top:23%; left:70%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;display: inline-block;').values()); | ||
1816 | enterMailIdLabel.innerHTML = 'USERNAME'; | ||
1811 | locSelectAttributes = panelButtonAttributes.put({ id : 'loc-select'}).addStyle('position:fixed; top:21%; left:10%; width:220px; color:#FFF; text-align:center; background: #222; border:3px solid; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; font-size:14px;').values(); | ||
1812 | enterBlogAttributes = panelButtonAttributes.put({id : 'enter-blog', placeholder : 'http://abc.blogspot.com/', type : 'text'}).addStyle('position:fixed; top:21%; left:40%; width:220px; color:#FFF; text-align:center; background: #222; border:3px solid; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; font-size:14px;').values(); | ||
1813 | enterMailIdAttributes = panelButtonAttributes.put({id : 'enter-mail', placeholder : 'username@gmail.com', type : 'text'}).addStyle('position:fixed; top:21%; left:70%; width:220px; color:#FFF; text-align:center; background: #222; border:3px solid; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; font-size:14px;').values(); | ||
1817 | 1814 | ||
1818 | 1815 | ||
1819 | enterPwdAttributes = panelButtonAttributes.put({placeholder : 'password', type : 'password'}).addStyle('position:absolute; top:50%; left:70%; width:23%; color:#FFF; text-align:center; background: #222; border:3px solid; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; font-size:14px;').values(); | ||
1820 | enterPwdLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:absolute; top:49%; left:70%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;display: inline-block;').values()); | ||
1816 | langSelectLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:fixed; top:50%; left:10%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;display: inline-block;').values()); | ||
1817 | langSelectLabel.innerHTML = 'Languages of selected/all state(s)'; | ||
1818 | enterPwdLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:fixed; top:50%; left:70%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;display: inline-block;').values()); | ||
1821 | 1819 | enterPwdLabel.innerHTML = 'PASSWORD'; | |
1822 | 1820 | ||
1821 | langSelectAttributes = panelButtonAttributes.put({ id : 'lang-select'}).addStyle('position:fixed; top:51%; left:10%; width:220px; color:#FFF; text-align:center; background: #222; border:3px solid; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; font-size:14px;').values(); | ||
1822 | defaultBlogAttributes = DOM.BUILDER.INPUT(editAttributes.put({id : 'defaultcheck', name : 'Loading Checkbox', type : 'checkbox'}).addStyle('position:fixed; top:51%; left:40%; background: transparent; display: inline-block;').values()); | ||
1823 | defaultBlogLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:fixed; top:51.5%; left:42%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;display: inline-block;').values()); | ||
1824 | defaultBlogLabel.innerHTML = 'Default blog (Our blog)'; | ||
1825 | enterPwdAttributes = panelButtonAttributes.put({id : 'enter-pwd', placeholder : 'password', type : 'password'}).addStyle('position:fixed; top:51%; left:70%;width:220px; color:#FFF; text-align:center; background: #222; border:3px solid; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; font-size:14px;').values(); | ||
1823 | 1826 | ||
1824 | 1827 | //-----------------------------End of state & language target ------------------- | |
1825 | 1828 | ||
… | … | ||
1830 | 1830 | okButton = DOM.BUILDER.BUTTON(panelButtonAttributes.addStyle('position:absolute; left:44%; bottom:5%; color:#FFF; margin:auto; width: 100px; height: 36px; display: block; background: #777; background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #777), color-stop(1, #fff)); background: -moz-linear-gradient(center bottom, #777 0%, #fff 100%); border: 1px solid #777; border-radius: 3px; border: 1px solid #777; box-shadow: #fff 0px 0px 2px 0px inset, rgba(0, 0, 0, .5) 0px 0px 2px 0px; -moz-box-shadow:#fff 0px 0px 2px 0px inset, rgba(0, 0, 0, .5) 0px 0px 2px 0px; -webkit-box-shadow:#fff 0px 0px 2px 0px inset, rgba(0, 0, 0, .5) 0px 0px 2px 0px;').values()); | |
1831 | 1831 | ||
1832 | 1832 | this.okClick = function okClick() { | |
1833 | messageOverlay.style.display = 'none'; | ||
1834 | backgroundDiv.style.display = 'none'; | ||
1833 | if(document.getElementById('loc-select').value == '--Locations--' || document.getElementById('lang-select').value == '---Languages---') { | ||
1834 | alert('Please select a Location & Language'); | ||
1835 | } | ||
1836 | else { | ||
1837 | overlayBar = new OverlayBar(pageEditor); | ||
1838 | overlayBar.blogpost(); | ||
1839 | messageOverlay.style.display = 'none'; | ||
1840 | backgroundDiv.style.display = 'none'; | ||
1841 | |||
1842 | } | ||
1835 | 1843 | // self.hide(); | |
1836 | 1844 | // return false; | |
1837 | 1845 | }; | |
1838 | // editButton.appendChild(image); | ||
1846 | // editButton.appendChild(image); | ||
1839 | 1847 | okButton.appendChild(text); | |
1840 | 1848 | messageOverlay.appendChild(okButton); | |
1849 | messageOverlay.appendChild(image); | ||
1841 | 1850 | ||
1851 | |||
1842 | 1852 | //---------------------------------------------start locLang & locSelect ----------------------- | |
1843 | 1853 | ||
1844 | 1854 | locSelect = DOM.BUILDER.SELECT(locSelectAttributes); | |
… | … | ||
1989 | 1989 | if (textToDisplay) { | |
1990 | 1990 | DOM.textContent(textToDisplay); | |
1991 | 1991 | } | |
1992 | var screenSize = DOM.viewDimension(); | ||
1993 | backgroundDiv.style.minWidth = screenSize[0] + 'px'; | ||
1994 | backgroundDiv.style.minHeight = screenSize[1] + 'px'; | ||
1992 | // var screenSize = DOM.viewDimension(); | ||
1993 | // backgroundDiv.style.minWidth = screenSize[0] + 'px'; | ||
1994 | // backgroundDiv.style.minHeight = screenSize[1] + 'px'; | ||
1995 | 1995 | ||
1996 | messageOverlay.style.left = (screenSize[0] - parseInt(messageOverlay.style.width) ) / 2 + 'px'; | ||
1997 | messageOverlay.style.top = (screenSize[1] - parseInt(messageOverlay.style.height) ) / 2 + 'px'; | ||
1998 | loadingDiv.style.left = (screenSize[0] - parseInt(loadingImage.style.width) ) / 2 + 'px'; | ||
1999 | loadingDiv.style.top = (screenSize[1] - parseInt(loadingImage.style.height) ) / 2 + 'px'; | ||
1996 | // messageOverlay.style.left = (screenSize[0] - parseInt(messageOverlay.style.width) ) / 2 + 'px'; | ||
1997 | // messageOverlay.style.top = (screenSize[1] - parseInt(messageOverlay.style.height) ) / 2 + 'px'; | ||
1998 | // loadingDiv.style.left = (screenSize[0] - parseInt(loadingImage.style.width) ) / 2 + 'px'; | ||
1999 | // loadingDiv.style.top = (screenSize[1] - parseInt(loadingImage.style.height) ) / 2 + 'px'; | ||
2000 | 2000 | ||
2001 | 2001 | backgroundDiv.style.display = 'block'; | |
2002 | 2002 | ||
… | … | ||
2822 | 2822 | ||
2823 | 2823 | ||
2824 | 2824 | var renImage = 'http://dev.a11y.in/alipi/images/renarration.png'; | |
2825 | renButton = createActionButton(renImage, 'Renarration', 'border-right: none;'); | ||
2825 | renButton = createActionButton(renImage, 'See narrations', 'border-right: none;'); | ||
2826 | 2826 | renButton.onclick = function renButtonOnClick() { | |
2827 | 2827 | popupControl.showAction(renUpdateAction); | |
2828 | 2828 | //self.popdown(true); | |
… | … | ||
2965 | 2965 | ||
2966 | 2966 | ||
2967 | 2967 | var renImage = 'http://dev.a11y.in/alipi/images/renarration.png'; | |
2968 | renButton = createActionButton(renImage, 'Renarration', 'border-right: none;'); | ||
2968 | renButton = createActionButton(renImage, 'See (other) narrations', 'border-right: none;'); | ||
2969 | 2969 | renButton.onclick = function renButtonOnClick() { | |
2970 | 2970 | popupControl.showAction(renUpdateAction); | |
2971 | 2971 | //self.popdown(true); | |
… | … | ||
2982 | 2982 | self.popdown(); | |
2983 | 2983 | }; | |
2984 | 2984 | ||
2985 | var audioImage = './images/audio.png'; | ||
2985 | var audioImage = 'http://dev.a11y.in/alipi/images/audio.png'; | ||
2986 | 2986 | audioButton = createActionButton(audioImage,'Audio','border-right:none;'); | |
2987 | 2987 | audioButton.onclick = function audioButtonOnClick() { | |
2988 | 2988 | popupControl.showAction(audioUpdateAction); | |
… | … | ||
3119 | 3119 | messageDiv = DOM.BUILDER.DIV(editAttributes.addStyle('font-weight:italic; font-size:20px; font-family: Helvetica Neue,Helvetica,Arial,Sans-serif; position:absolute; left:30%; width:100%; display:inline-block; color:#fff;').values()); | |
3120 | 3120 | ||
3121 | 3121 | // Ajay - background-color & rgba changed | |
3122 | redButtonStyleAttributes = panelButtonAttributes.addStyle('position:absolute; top:-13px; right:04%; width:30%; height:25px; color:#FFF; font-size:18px; text-align:center; background: #AAA; background: -moz-linear-gradient(center bottom, #000 0%, #FFF 100%); -webkit-linear-gradient(center bottom, #000 0%, #FFF 100%); border: 1px solid #777; border-radius: 3px; -moz-border-radius:10px; -webkit-border-radius:3px; border: 1px solid #777;').values(); | ||
3122 | redButtonStyleAttributes = panelButtonAttributes.addStyle('position:absolute; top:-13px; right:04%; width:22%; height:25px; color:#FFF; font-size:18px; text-align:center; background: #AAA; background: -moz-linear-gradient(center bottom, #000 0%, #FFF 100%); -webkit-linear-gradient(center bottom, #000 0%, #FFF 100%); border: 1px solid #777; border-radius: 3px; -moz-border-radius:10px; -webkit-border-radius:3px; border: 1px solid #777;').values(); | ||
3123 | 3123 | ||
3124 | 3124 | //Ajay - button for filling up the target and other detail | |
3125 | 3125 | // fillUpButtonStyleAttributes = panelButtonAttributes.addStyle('position:absolute; top:-13px; right:30%; width:20%; height:25px; color:#FFF; font-size:18px; text-align:center; background: #AAA; background: -moz-linear-gradient(center bottom, #000 0%, #FFF 100%); -webkit-linear-gradient(center bottom, #000 0%, #FFF 100%); border: 1px solid #777; border-radius: 3px; -moz-border-radius:10px; -webkit-border-radius:3px; border: 1px solid #777;').values(); | |
… | … | ||
3149 | 3149 | // } | |
3150 | 3150 | // }; | |
3151 | 3151 | ||
3152 | publishButton = DOM.BUILDER.BUTTON(redButtonStyleAttributes, 'Fill-up & Publish'); // Ajay - Done to Save Yass | ||
3152 | publishButton = DOM.BUILDER.BUTTON(redButtonStyleAttributes, 'Publish'); // Ajay - Done to Save Yass | ||
3153 | 3153 | //pageEditor.saveAndClose(); | |
3154 | |||
3154 | 3155 | publishButton.onclick = function publishButtonOnClick() { | |
3155 | ajayWindow = new AjayWindow(pageEditor); | ||
3156 | ajayWindow.activate(); | ||
3157 | okButton.onclick = function okButtonOnClick() { // Ajay | ||
3158 | ajayWindow.okClick(); | ||
3159 | 3156 | ||
3160 | if (pageEditor.hasChangesPending() /* && (pageEditor.formUncomplete() ==false) */ ) { | ||
3161 | pageEditor.commandPublish(); | ||
3162 | this.disabled=true; | ||
3163 | pageEditor.showMessage("... Please wait, your blog is being posted"); | ||
3157 | if (pageEditor.hasChangesPending() /* && (pageEditor.formUncomplete() ==false) */ ) { | ||
3158 | ajayWindow = new AjayWindow(pageEditor); | ||
3159 | ajayWindow.activate(); | ||
3160 | |||
3161 | okButton.onclick = function okButtonOnClick() { // Ajay | ||
3162 | ajayWindow.okClick(); | ||
3164 | 3163 | } | |
3165 | // else if ((pageEditor.hasChangesPending() ==false)&& (pageEditor.formUncomplete() == false)){ | ||
3166 | // pageEditor.showMessage(" Nothing to publish !"); | ||
3167 | // } | ||
3168 | // else if (pageEditor.hasChangesPending()&& (pageEditor.formUncomplete() ==true)){ | ||
3169 | // pageEditor.showMessage("you need to choose at least a language, a location or a style before you can save & publish !"); | ||
3170 | // } | ||
3171 | else{ | ||
3172 | pageEditor.showMessage("Nothing to publish"); | ||
3173 | } | ||
3174 | return false; | ||
3175 | }; | ||
3176 | }; // End of okButton function | ||
3164 | } | ||
3165 | // else if ((pageEditor.hasChangesPending() ==false)&& (pageEditor.formUncomplete() == false)){ | ||
3166 | // pageEditor.showMessage(" Nothing to publish !"); | ||
3167 | // } | ||
3168 | // else if (pageEditor.hasChangesPending()&& (pageEditor.formUncomplete() ==true)){ | ||
3169 | // pageEditor.showMessage("you need to choose at least a language, a location or a style before you can save & publish !"); | ||
3170 | // } | ||
3171 | else{ | ||
3172 | pageEditor.showMessage("Nothing to publish"); | ||
3173 | } | ||
3174 | return false; | ||
3175 | }; | ||
3176 | |||
3177 | this.blogpost = function blogpost() { | ||
3178 | pageEditor.commandPublish(); | ||
3179 | this.disabled=true; | ||
3180 | pageEditor.showMessage("... Please wait, your blog is being posted"); | ||
3181 | }; | ||
3182 | // End of okButton function | ||
3177 | 3183 | ||
3178 | 3184 | //shalini-Yass | |
3179 | 3185 | /* cancelButton = DOM.BUILDER.BUTTON(cancelButtonStyleAttributes, 'Cancel'); |