Commit 9d080aa6dc521f86c2165936eb365b6978821c6d
- Diff rendering mode:
- inline
- side by side
server/wsgi/page_edit.js
(42 / 33)
  | |||
1665 | 1665 | loadingDiv = DOM.BUILDER.DIV(normalFontAttributes.addStyle('position: relative; width: auto; height: auto; display: block; text-align: left;').values(), loadingImage, loadingText); | |
1666 | 1666 | backgroundDiv.appendChild(loadingDiv); | |
1667 | 1667 | ||
1668 | 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; position:fixed; left:0px; top:0px; width:640px; height:325px; background:#000xs; display: none;background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(#000), to(#202020)); background: -moz-linear-gradient(bottom, #000, #202020);').values()); | ||
1668 | 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()); | ||
1669 | 1669 | ||
1670 | 1670 | 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'); | |
1671 | 1671 | ||
… | … | ||
1691 | 1691 | messageOverlay.appendChild(editButton); | |
1692 | 1692 | ||
1693 | 1693 | ||
1694 | hideOverlayCheckbox = DOM.BUILDER.INPUT(editAttributes.put({ name : 'Loading Checkbox', type : 'checkbox'}).addStyle('position:relative; margin-left: 34px; background: transparent; float:left; margin-top: 0px; padding-top: 0px; display: inline-block;').values()); | ||
1694 | hideOverlayCheckbox = DOM.BUILDER.INPUT(editAttributes.put({ name : 'Loading Checkbox', type : 'checkbox'}).addStyle('position:relative; top:5%; left:-23%; background: transparent; display: inline-block;').values()); | ||
1695 | 1695 | ||
1696 | var checkboxLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:relative; font-size: 10px; font-weight: bold; float:left; margin-left: 5px; margin-right: 5px; background: transparent; color: #FFF;display: inline-block;').values()); | ||
1696 | var checkboxLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:relative; left:-22%; font-size: 10px; font-weight: bold; transparent; color: #FFF;display: inline-block;').values()); | ||
1697 | 1697 | checkboxLabel.innerHTML = 'Don\'t show this again.'; | |
1698 | 1698 | ||
1699 | 1699 | // var redHelpLink = DOM.BUILDER.A(normalFontAttributes.put({ href : 'http://bo.lt/editor'}).addStyle('z-index: 2147483647; float: right; margin-right: 34px; display: inline-block;text-decoration: none; color: #FFF; font-size: 10px; font-weight: bold; ').values(), 'Need Help?') | |
1700 | 1700 | ||
1701 | messageOverlay.appendChild(DOM.BUILDER.DIV(elementAttributes.addStyle('margin-left: 10px; margin-right: 10px;').values(),hideOverlayCheckbox, checkboxLabel// , redHelpLink | ||
1701 | messageOverlay.appendChild(DOM.BUILDER.DIV(elementAttributes.addStyle('margin-left: 10px; margin-right: 10px;').values()//,hideOverlayCheckbox, checkboxLabel// , redHelpLink | ||
1702 | 1702 | )); | |
1703 | 1703 | editButton.appendChild(text); | |
1704 | 1704 | messageOverlay.appendChild(editButton); | |
1705 | 1705 | ||
1706 | 1706 | document.body.appendChild(backgroundDiv); | |
1707 | if(editMode!='HTML'){ | ||
1708 | 1707 | document.body.appendChild(messageOverlay); | |
1709 | } | ||
1710 | else if(EditCommandHistory(pageEditor).history.length > 0){ | ||
1711 | alert("hello"); | ||
1712 | } | ||
1713 | 1708 | ||
1714 | 1709 | ||
1715 | 1710 | this.show = function show( textToDisplay) { | |
… | … | ||
1740 | 1740 | ||
1741 | 1741 | messageOverlay.style.display = 'block'; | |
1742 | 1742 | backgroundDiv.style.display = 'block'; | |
1743 | }; | ||
1743 | } | ||
1744 | 1744 | ||
1745 | 1745 | this.activate = function activate() { | |
1746 | 1746 | /* | |
… | … | ||
1749 | 1749 | * created for this purpose. | |
1750 | 1750 | */ | |
1751 | 1751 | var allCookies = document.cookie; | |
1752 | if (editMode != 'HTML' && allCookies && allCookies.indexOf('m4.show.redbar.overlay=no') == -1) { | ||
1752 | if (editMode != 'HTML' && allCookies.indexOf('m4.show.redbar.overlay=no') == -1) { | ||
1753 | 1753 | messageOverlay.style.display = 'block'; | |
1754 | backgroundDiv.style.display = 'block'; | ||
1754 | 1755 | // if (DOM.isIEBrowser() && DOM.isQuirksMode()) { | |
1755 | 1756 | // messageDescription.style.marginLeft = (DOM.findSize(messageOverlay).width - DOM.findSize(messageDescription).width )/2 + 'px'; | |
1756 | 1757 | // editButton.style.marginLeft = (DOM.findSize(messageOverlay).width - DOM.findSize(editButton).width )/2 + 'px'; | |
1757 | 1758 | // } | |
1758 | 1759 | } else { | |
1760 | // messageOverlay.style.display = 'none'; | ||
1761 | // backgroundDiv.style.display = 'none'; | ||
1759 | 1762 | self.hide(); | |
1760 | 1763 | } | |
1761 | 1764 | }; | |
… | … | ||
1792 | 1792 | messageOverlay.appendChild(step2); | |
1793 | 1793 | messageOverlay.appendChild(step3); | |
1794 | 1794 | ||
1795 | 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(), ''); | ||
1796 | messageOverlay.appendChild(messageDescription); | ||
1795 | // 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(), 'HELLO'); | ||
1796 | // messageOverlay.appendChild(messageDescription); | ||
1797 | 1797 | ||
1798 | 1798 | 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()); | |
1799 | 1799 | 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'); | |
1800 | 1800 | ||
1801 | 1801 | //---------------------------- state & language target -------------------------- | |
1802 | 1802 | locSelectAttributes = panelButtonAttributes.addStyle('position:absolute; top:25%; left:05%; width:23%; color:#FFF; text-align:center; font-weight:bold; font-size:18px; background: #AAA; border: 1px solid #777; border-radius: 3px; -moz-border-radius:10px; -webkit-border-radius:3px; border: 1px solid #777; border-radius: 3px; -moz-border-radius:10px; -webkit-border-radius:3px; border: 1px solid #777;border-radius:2px; -moz-border-radius:2px; -webkit-border-radius:2px; border:5px solid #2f6270; font-size:14px; height:35px;').values(); | |
1803 | locSelectLabel = DOM.BUILDER.LABEL(normalFontAttributes.addStyle('position:absolute; top:24%; left:05%; font-size: 14px; font-weight: bold; background: transparent; color: #FFF;display: inline-block;').values()); | ||
1803 | // step2 = DOM.BUILDER.H1(normalFontAttributes.addStyle('position: relative; color:#FFF; width:auto; float:left; margin:30px 0 0 200px; font-size: 30px; line-height: 36px; text-align: center; font-weight: normal; display: block; ').values(), 'STEP - 2'); | ||
1804 | 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()); | ||
1804 | 1805 | locSelectLabel.innerHTML = 'Select any state'; | |
1805 | 1806 | ||
1806 | 1807 | langSelectAttributes = panelButtonAttributes.addStyle('position:absolute; top:50%; left:05%; width:23%; color:#FFF; text-align:center; font-weight:bold; font-size:18px; background: #AAA; border: 1px solid #777; border-radius: 3px; -moz-border-radius:10px; -webkit-border-radius:3px; border: 1px solid #777;border-radius: 3px; -moz-border-radius:10px; -webkit-border-radius:3px; border: 1px solid #777;border-radius:2px; -moz-border-radius:2px; -webkit-border-radius:2px; border:5px solid #2f6270; font-size:14px; height:35px;').values(); | |
1807 | 1808 | 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()); | |
1808 | langSelectLabel.innerHTML = 'Languages of selected state'; | ||
1809 | langSelectLabel.innerHTML = 'Languages of selected/all state(s)'; | ||
1809 | 1810 | ||
1810 | 1811 | enterBlogAttributes = panelButtonAttributes.put({placeholder : 'http://abc.blogspot.com/', type : 'text'}).addStyle('position:absolute; top:25%; left:36%; width:23%; color:#FFF; text-align:center; font-weight:bold; font-size:18px; background: #aaa; border: 1px solid #777; border-radius: 3px; -moz-border-radius:10px; -webkit-border-radius:3px; border: 1px solid #777; border-radius: 3px; -moz-border-radius:10px; -webkit-border-radius:3px; border: 1px solid #777;border-radius:2px; -moz-border-radius:2px; -webkit-border-radius:2px; border:5px solid #2f6270; font-size:14px; height:35px;').values(); | |
1811 | 1812 | 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()); | |
… | … | ||
1895 | 1895 | ||
1896 | 1896 | }//end if | |
1897 | 1897 | else{ | |
1898 | var texts = []; | ||
1898 | 1899 | while(langSelect.firstChild!=null){ | |
1899 | 1900 | langSelect.removeChild(langSelect.firstChild); | |
1900 | 1901 | }//end while | |
1901 | 1902 | for(var i=0;i<locations.length;i++) | |
1902 | { | ||
1903 | for(var j=0;j<locations[i].lang.length;j++){ | ||
1904 | var op = document.createElement('option'); | ||
1905 | // var count = locations[i].lang[j]; | ||
1906 | // counts[item] = counts[item] >= 1 ? counts[item] + 1 : 1; | ||
1907 | op.text=locations[i].lang[j]; | ||
1908 | langSelect.appendChild(op); | ||
1903 | { for (var j=0; j<locations[i].lang.length; j++) | ||
1904 | { | ||
1905 | texts.push(locations[i].lang[j]); | ||
1906 | texts.sort(); | ||
1907 | for(var k=1;k<texts.length;k++){ | ||
1908 | if (texts[k] === texts[k-1]){ | ||
1909 | texts.splice(k, 1); | ||
1910 | k--; | ||
1911 | } | ||
1912 | } | ||
1913 | |||
1909 | 1914 | }//end inner for | |
1910 | 1915 | }//end main for | |
1916 | for(var z=0; z<texts.length; z++) | ||
1917 | { | ||
1918 | var op = document.createElement('option'); | ||
1919 | op.text=texts[z]; | ||
1920 | langSelect.appendChild(op); | ||
1921 | } | ||
1911 | 1922 | }//end else | |
1912 | 1923 | ||
1913 | 1924 | }//end onchange | |
1914 | } | ||
1915 | |||
1925 | } | ||
1916 | 1926 | /* end parsing json response*/ | |
1917 | 1927 | ||
1918 | 1928 | else { | |
… | … | ||
2999 | 2999 | DOM.BUILDER.IMG(editAttributes.put({ src : 'https://bo.lt/app/asset/page-edit/bo_square.png?p=622fd096a39f5c36a6e06e41a9963dafaad61079' }).addStyle('border: 0 none; margin-left: 16px; display:inline; box-shadow: 0 3px 1px rgba(0, 0, 0, 0.24); -webkit-box-shadow: 0 3px 1px rgba(0, 0, 0, 0.24); -moz-box-shadow:0 3px 1px rgba(0, 0, 0, 0.24);').values())); */ //Ajay | |
3000 | 3000 | ||
3001 | 3001 | // Ajay - Below message display bar | |
3002 | messageDiv = DOM.BUILDER.DIV(editAttributes.addStyle('font-weight:italic; font-size:20px; font-family: Helvetica Neue,Helvetica,Arial,Sans-serif; position:absolute; margin: 0px auto; width:100%; display:inline-block; text-align:center; color:#fff;').values()); | ||
3002 | 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()); | ||
3003 | 3003 | ||
3004 | 3004 | // Ajay - background-color & rgba changed | |
3005 | 3005 | redButtonStyleAttributes = panelButtonAttributes.addStyle('position:absolute; top:-13px; right:04%; 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(); | |
… | … | ||
3033 | 3033 | //pageEditor.saveAndClose(); | |
3034 | 3034 | publishButton.onclick = function publishButtonOnClick() { | |
3035 | 3035 | ||
3036 | if (pageEditor.hasChangesPending() && (pageEditor.formUncomplete() ==false)) { | ||
3036 | if (pageEditor.hasChangesPending() /* && (pageEditor.formUncomplete() ==false) */ ) { | ||
3037 | 3037 | pageEditor.commandPublish(); | |
3038 | 3038 | this.disabled=true; | |
3039 | pageEditor.showMessage("...Please Wait, your blog is being posted"); | ||
3039 | pageEditor.showMessage("... Please wait, your blog is being posted"); | ||
3040 | 3040 | } | |
3041 | else if ((pageEditor.hasChangesPending() ==false)&& (pageEditor.formUncomplete() == false)){ | ||
3042 | pageEditor.showMessage("you need to re-narrate before you can save & publish !"); | ||
3043 | } | ||
3044 | else if (pageEditor.hasChangesPending()&& (pageEditor.formUncomplete() ==true)){ | ||
3045 | pageEditor.showMessage("you need to choose at least a language, a location or a style before you can save & publish !"); | ||
3046 | } | ||
3041 | // else if ((pageEditor.hasChangesPending() ==false)&& (pageEditor.formUncomplete() == false)){ | ||
3042 | // pageEditor.showMessage(" Nothing to publish !"); | ||
3043 | // } | ||
3044 | // else if (pageEditor.hasChangesPending()&& (pageEditor.formUncomplete() ==true)){ | ||
3045 | // pageEditor.showMessage("you need to choose at least a language, a location or a style before you can save & publish !"); | ||
3046 | // } | ||
3047 | 3047 | else{ | |
3048 | 3048 | pageEditor.showMessage("Nothing to publish"); | |
3049 | 3049 | } |