Commit 9d080aa6dc521f86c2165936eb365b6978821c6d

  • avatar
  • Ajay Kulkarni <ajaykools @gm…l.com>
  • Mon Oct 10 20:49:27 IST 2011
UI - dont show this again
  
16651665 loadingDiv = DOM.BUILDER.DIV(normalFontAttributes.addStyle('position: relative; width: auto; height: auto; display: block; text-align: left;').values(), loadingImage, loadingText);
16661666 backgroundDiv.appendChild(loadingDiv);
16671667
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());
16691669
16701670 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');
16711671
16911691 messageOverlay.appendChild(editButton);
16921692
16931693
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());
16951695
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());
16971697 checkboxLabel.innerHTML = 'Don\'t show this again.';
16981698
16991699 // 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?')
17001700
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
17021702 ));
17031703 editButton.appendChild(text);
17041704 messageOverlay.appendChild(editButton);
17051705
17061706 document.body.appendChild(backgroundDiv);
1707 if(editMode!='HTML'){
17081707 document.body.appendChild(messageOverlay);
1709 }
1710 else if(EditCommandHistory(pageEditor).history.length > 0){
1711 alert("hello");
1712 }
17131708
17141709
17151710 this.show = function show( textToDisplay) {
17401740
17411741 messageOverlay.style.display = 'block';
17421742 backgroundDiv.style.display = 'block';
1743 };
1743 }
17441744
17451745 this.activate = function activate() {
17461746 /*
17491749 * created for this purpose.
17501750 */
17511751 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) {
17531753 messageOverlay.style.display = 'block';
1754 backgroundDiv.style.display = 'block';
17541755 // if (DOM.isIEBrowser() && DOM.isQuirksMode()) {
17551756 // messageDescription.style.marginLeft = (DOM.findSize(messageOverlay).width - DOM.findSize(messageDescription).width )/2 + 'px';
17561757 // editButton.style.marginLeft = (DOM.findSize(messageOverlay).width - DOM.findSize(editButton).width )/2 + 'px';
17571758 // }
17581759 } else {
1760// messageOverlay.style.display = 'none';
1761// backgroundDiv.style.display = 'none';
17591762 self.hide();
17601763 }
17611764 };
17921792 messageOverlay.appendChild(step2);
17931793 messageOverlay.appendChild(step3);
17941794
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);
17971797
17981798 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());
17991799 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');
18001800
18011801 //---------------------------- state & language target --------------------------
18021802 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());
18041805 locSelectLabel.innerHTML = 'Select any state';
18051806
18061807 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();
18071808 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)';
18091810
18101811 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();
18111812 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());
18951895
18961896 }//end if
18971897 else{
1898 var texts = [];
18981899 while(langSelect.firstChild!=null){
18991900 langSelect.removeChild(langSelect.firstChild);
19001901 }//end while
19011902 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
19091914 }//end inner for
19101915 }//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 }
19111922 }//end else
19121923
19131924 }//end onchange
1914 }
1915
1925 }
19161926 /* end parsing json response*/
19171927
19181928 else {
29992999 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
30003000
30013001 // 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());
30033003
30043004 // Ajay - background-color & rgba changed
30053005 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();
30333033 //pageEditor.saveAndClose();
30343034 publishButton.onclick = function publishButtonOnClick() {
30353035
3036 if (pageEditor.hasChangesPending() && (pageEditor.formUncomplete() ==false)) {
3036 if (pageEditor.hasChangesPending() /* && (pageEditor.formUncomplete() ==false) */ ) {
30373037 pageEditor.commandPublish();
30383038 this.disabled=true;
3039 pageEditor.showMessage("...Please Wait, your blog is being posted");
3039 pageEditor.showMessage("... Please wait, your blog is being posted");
30403040 }
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// }
30473047 else{
30483048 pageEditor.showMessage("Nothing to publish");
30493049 }