Commit d587cda314f762da80d856dfeab34f40b88dd4dc
- Diff rendering mode:
- inline
- side by side
server/wsgi/page_edit.js
(60 / 74)
  | |||
2751 | 2751 | doneButton = createActionButton(doneImage, 'Editor', 'border-right: none;' + leftBorderStyle); | |
2752 | 2752 | doneButton.onclick = function doneButtonOnClick(elements) { | |
2753 | 2753 | editWindow = new EditWindow(pageEditor); | |
2754 | console.log(selectedElement.children); | ||
2754 | 2755 | document.getElementById('reference').value = selectedElement.textContent; | |
2755 | 2756 | document.getElementById('editor').value = selectedElement.textContent; | |
2756 | 2757 | selectedElement.setAttribute('id', 'alipiSelectedElement'); | |
… | … | ||
2864 | 2864 | var moveDiv, editModeChangeOverlayDiv, buttonDiv, editModeChangeButtonDiv, editModeChangeSaveButton, editModeChangeDiscardButton; | |
2865 | 2865 | var redButtonStyleAttributes, fillUpButtonStyleAttributes, firstRowDivOffset, calculateScrollPositionY, wrapperDiv,showKeepOriginalOverlay, publishOptions = new PublishOptions(); | |
2866 | 2866 | ||
2867 | // 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()); | ||
2868 | 2867 | ||
2868 | overlayDiv = document.createElement("div"); | ||
2869 | overlayDiv.setAttribute("id", "overlay-div"); | ||
2870 | overlayDiv.setAttribute("alipielements", "alipi"); | ||
2871 | overlayDiv.setAttribute("style", "overflow:inherit; overflow-x:visible; position:fixed; z-index:2147483645; left:0; top:0; min-width:800px; width:100%; height:30px; background-color:rgba(0, 0, 0, 0.5);"); | ||
2872 | document.body.appendChild(overlayDiv); | ||
2873 | |||
2874 | |||
2875 | image = document.createElement("img"); | ||
2876 | image.setAttribute("id", "close-image"); | ||
2877 | image.setAttribute("alipielements", "alipi"); | ||
2878 | image.setAttribute("src", "http://dev.a11y.in/alipi/images/close_button.png"); | ||
2879 | image.setAttribute("style", "position:relative;width:25px;height:28px;"); | ||
2880 | overlayDiv.appendChild(image); | ||
2881 | image.onclick=function(){ | ||
2882 | answer = confirm("Do you really want to exit the editor?") | ||
2883 | if (answer !=0) | ||
2884 | { | ||
2885 | window.location.reload(); | ||
2886 | } | ||
2887 | } | ||
2888 | |||
2889 | |||
2869 | 2890 | messageDiv = document.createElement("div"); | |
2870 | 2891 | messageDiv.setAttribute("id", "message-div"); | |
2871 | 2892 | messageDiv.setAttribute("alipielements", "alipi"); | |
2872 | messageDiv.setAttribute("style", "position:relative;left:150px;bottom:25px;font-size:25px;font-weight:bold;"); | ||
2893 | messageDiv.setAttribute("style", "position:relative;left:150px;bottom:26px;font-size:23px;font-weight:bold;color:#ffe;"); | ||
2894 | overlayDiv.appendChild(messageDiv); | ||
2873 | 2895 | ||
2874 | publishButton = document.createElement("input"); | ||
2875 | publishButton.setAttribute("id", "publish"); | ||
2876 | publishButton.setAttribute("alipielements", "alipi"); | ||
2877 | publishButton.setAttribute("type", "submit"); | ||
2878 | publishButton.setAttribute("Value", "Publish"); | ||
2879 | publishButton.setAttribute("style", "position:relative;left:950px;bottom:50px;font-size:18px;font-weight:bold;"); | ||
2896 | helpLink = document.createElement("input"); | ||
2897 | helpLink.setAttribute("id", "help"); | ||
2898 | helpLink.setAttribute("alipielements", "alipi"); | ||
2899 | helpLink.setAttribute("type", "submit"); | ||
2900 | helpLink.setAttribute("Value", "Help"); | ||
2901 | helpLink.setAttribute("style", "position:relative;top:-55px;left:750px;font-size:18px;font-weight:bold;width:100px;height:30px;"); | ||
2902 | overlayDiv.appendChild(helpLink); | ||
2903 | helpLink.onclick = function helpLinkOnClick() { | ||
2904 | helpWindow = new HelpWindow(pageEditor); | ||
2905 | helpWindow.createLabels(); | ||
2906 | helpWindow.activate(); | ||
2880 | 2907 | ||
2881 | undoButton = document.createElement("input"); | ||
2882 | undoButton.setAttribute("id", "undo"); | ||
2883 | undoButton.setAttribute("alipielements", "alipi"); | ||
2884 | undoButton.setAttribute("type", "submit"); | ||
2885 | undoButton.setAttribute("Value", "Undo"); | ||
2886 | undoButton.setAttribute("style", "position:relative;left:850px;bottom:50px;font-size:18px;font-weight:bold;"); | ||
2908 | }; | ||
2887 | 2909 | ||
2888 | helpLink = document.createElement("input"); | ||
2889 | helpLink.setAttribute("id", "help"); | ||
2890 | helpLink.setAttribute("alipielements", "alipi"); | ||
2891 | helpLink.setAttribute("type", "submit"); | ||
2892 | helpLink.setAttribute("Value", "Help"); | ||
2893 | helpLink.setAttribute("style", "position:relative;bottom:50px;left:750px;font-size:18px;font-weight:bold;"); | ||
2894 | 2910 | ||
2895 | // redButtonStyleAttributes = panelButtonAttributes.put({id : 'publish'}).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(); | ||
2911 | undoButton = document.createElement("input"); | ||
2912 | undoButton.setAttribute("id", "undo"); | ||
2913 | undoButton.setAttribute("alipielements", "alipi"); | ||
2914 | undoButton.setAttribute("type", "submit"); | ||
2915 | undoButton.setAttribute("Value", "Undo"); | ||
2916 | undoButton.setAttribute("style", "position:relative;top:-55px;left:825px;font-size:18px;font-weight:bold;width:100px;height:30px;"); | ||
2917 | overlayDiv.appendChild(undoButton); | ||
2918 | undoButton.onclick = function undoButtonOnClick() { | ||
2919 | pageEditor.commandUndo(); | ||
2920 | return false; | ||
2921 | }; | ||
2896 | 2922 | ||
2897 | // undoButtonStyleAttributes = panelButtonAttributes.addStyle('position:absolute; left:35%; top:-13px; width:15%; 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(); | ||
2898 | 2923 | ||
2899 | // helpLinkStyleAttributes = panelButtonAttributes.addStyle('position:absolute; left:0%; top:-13px; width:15%; 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(); | ||
2900 | |||
2901 | // publishButton = DOM.BUILDER.BUTTON(redButtonStyleAttributes, 'Publish'); | ||
2902 | |||
2924 | publishButton = document.createElement("input"); | ||
2925 | publishButton.setAttribute("id", "publish"); | ||
2926 | publishButton.setAttribute("alipielements", "alipi"); | ||
2927 | publishButton.setAttribute("type", "submit"); | ||
2928 | publishButton.setAttribute("Value", "Publish"); | ||
2929 | publishButton.setAttribute("style", "position:relative;top:-55px;left:900px;font-size:18px;font-weight:bold;width:100px;height:30px;"); | ||
2930 | overlayDiv.appendChild(publishButton); | ||
2903 | 2931 | var dialog = 0; | |
2904 | 2932 | publishButton.onclick = function publishButtonOnClick() { | |
2905 | 2933 | if (pageEditor.hasChangesPending() /* && (pageEditor.formUncomplete() ==false) */ ) { | |
… | … | ||
2941 | 2941 | pageEditor.showMessage("Nothing to post"); | |
2942 | 2942 | } | |
2943 | 2943 | }; | |
2944 | |||
2944 | |||
2945 | |||
2945 | 2946 | ||
2946 | 2947 | this.blogpost = function blogpost() { | |
2947 | 2948 | if (locName.value == "" || langName.value == "" || styleSelect.value == "" || author.value == "" || (ourcheck.checked == false && yourcheck.checked == false)) { | |
2948 | 2949 | alert("Please give all the details, it will be used further"); | |
2949 | 2950 | } else { | |
2950 | pageEditor.commandPublish(); | ||
2951 | pageEditor.showMessage("... Please wait, your blog is being posted"); | ||
2952 | $('#targetoverlay').remove(); | ||
2951 | pageEditor.commandPublish(); | ||
2952 | pageEditor.showMessage("... Please wait, your blog is being posted"); | ||
2953 | $('#targetoverlay').remove(); | ||
2953 | 2954 | } | |
2954 | 2955 | }; | |
2955 | 2956 | // End of okButton function | |
2956 | |||
2957 | // undoButton = DOM.BUILDER.BUTTON(undoButtonStyleAttributes, 'Undo'); | ||
2958 | undoButton.onclick = function undoButtonOnClick() { | ||
2959 | pageEditor.commandUndo(); | ||
2960 | return false; | ||
2961 | }; | ||
2962 | |||
2963 | // helpLink = DOM.BUILDER.BUTTON(helpLinkStyleAttributes, 'Help'); | ||
2964 | helpLink.onclick = function helpLinkOnClick() { | ||
2965 | helpWindow = new HelpWindow(pageEditor); | ||
2966 | helpWindow.createLabels(); | ||
2967 | helpWindow.activate(); | ||
2968 | |||
2969 | }; | ||
2970 | |||
2971 | |||
2972 | // editModeChangeButtonDiv = DOM.BUILDER.DIV(editAttributes.addStyle('width: 500px; position: relative; float: right; margin-right: 8px;').values(), editModeChangeSaveButton, editModeChangeDiscardButton); | ||
2973 | |||
2974 | // buttonDiv = DOM.BUILDER.DIV(editAttributes.addStyle('width: 500px; position: relative; float: right; margin-right: 8px;').values(), helpLink, undoButton, publishButton); | ||
2975 | |||
2976 | // firstRowDiv = DOM.BUILDER.DIV(DOM.BUILDER.DIV(editAttributes.addStyle('width:500px; position: absolute; top: 0; left: 1%;').values(), messageDiv), buttonDiv); | ||
2977 | image = document.createElement("img"); | ||
2978 | image.setAttribute("id", "close-image"); | ||
2979 | image.setAttribute("alipielements", "alipi"); | ||
2980 | image.setAttribute("src", "http://dev.a11y.in/alipi/images/close_button.png"); | ||
2981 | image.setAttribute("style", "position:relative;width:25px;height:28px;"); | ||
2982 | |||
2983 | // var image = DOM.BUILDER.IMG(normalFontAttributes.put({src: 'http://dev.a11y.in/alipi/images/close_button.png'}).addStyle('position:fixed; top:0.5%; width:25px; height:25px;').values()); | ||
2984 | |||
2985 | wrapperDiv = DOM.BUILDER.DIV(fontTypeAttributes.addStyle('overflow: inherit; overflow-x: visible; position: fixed; z-index: 2147483645; left: 0; top: 0;min-width:800px; width: 100%; height:30px;; background-color: rgba(0, 0, 0, 0.5);').values(), image, messageDiv, helpLink, undoButton, publishButton // firstRowDiv | ||
2986 | ); | ||
2987 | |||
2988 | |||
2989 | overlayDiv = DOM.BUILDER.DIV(fontTypeAttributes.addStyle('overflow: inherit;').values(), wrapperDiv); | ||
2990 | |||
2991 | document.body.appendChild(overlayDiv); | ||
2992 | |||
2993 | image.onclick=function(){ | ||
2994 | answer = confirm("Do you really want to exit the editor?") | ||
2995 | if (answer !=0) | ||
2996 | { | ||
2997 | window.location.reload(); | ||
2998 | } | ||
2999 | } | ||
3000 | 2957 | ||
3001 | 2958 | this.show = function show(activate) { | |
3002 | 2959 | // overlayDiv.style.display = 'block'; |