Commit f4ec218fa527381b22e0409fc851e26b2250cc67

  • avatar
  • arvind
  • Mon Jan 30 17:34:43 IST 2012
Fixes for drop down
  
1function page_edit( boltSlug, pageSlug, uploadSlug, editMode, hasEditPermission, successUrl)
1function page_edit_client( boltSlug, pageSlug, uploadSlug, editMode, hasEditPermission, successUrl)
22{
33
44 var console, PopupControl, M4ImageElement,locName='',langName = '',styleName='',authorValue;
11201120 path = "/" + xname + path;
11211121 }
11221122 }
1123 console.log(path);
11231124 return path;
11241125 };
11251126
11761176 path = DOM.makePath(currentNode.parentNode);
11771177 }
11781178
1179
1179 console.log(path);
11801180 return path;
11811181 };
11821182
17491749 author.setAttribute("style","position:absolute;top:65%;left:40%;width:250px;");
17501750 target.appendChild(author);
17511751
1752 ourcheck = document.createElement("input");
1753 ourcheck.setAttribute("id","your-check");
1754 ourcheck.setAttribute("type","radio");
1755 ourcheck.setAttribute("name", "blog");
1756 ourcheck.setAttribute("alipielements", "alipi");
1757 ourcheck.setAttribute("style","position:absolute;top:85%;left:40%;");
1758 target.appendChild(ourcheck);
1759
17601752 yourcheck = document.createElement("input");
1761 yourcheck.setAttribute("id","our-check");
1753 yourcheck.setAttribute("id","your-check");
17621754 yourcheck.setAttribute("type","radio");
17631755 yourcheck.setAttribute("name", "blog");
17641756 yourcheck.setAttribute("alipielements", "alipi");
1765 yourcheck.setAttribute("style","position:absolute;top:85%;left:70%;");
1757 yourcheck.setAttribute("style","position:absolute;top:85%;left:40%;");
17661758 target.appendChild(yourcheck);
1759 yourcheck.disabled = true;
1760
1761 ourcheck = document.createElement("input");
1762 ourcheck.setAttribute("id","our-check");
1763 ourcheck.setAttribute("type","radio");
1764 ourcheck.setAttribute("name", "blog");
1765 ourcheck.setAttribute("alipielements", "alipi");
1766 ourcheck.setAttribute("style","position:absolute;top:85%;left:70%;");
1767 target.appendChild(ourcheck);
17671768
17681769 yourLabel = document.createElement('label');
17691770 yourLabel.textContent = "Your blog";
17811781 locButton.setAttribute("title","Set your preferred location");
17821782 locButton.value="+";
17831783 locButton.setAttribute("type","button");
1784 locButton.setAttribute("style","position:absolute;top:5%;left:90%;width:20px;");
1784 locButton.setAttribute("style","position:absolute;top:6%;right:4%;width:20px;");
17851785 locButton.setAttribute("alipielements", "alipi");
17861786 //locButton.setAttribute("type","button");
17871787 if (window.location.hostname != '127.0.0.1') {
17931793 langButton.setAttribute("title","Set your preferred location");
17941794 langButton.value="+";
17951795 langButton.setAttribute("type","button");
1796 langButton.setAttribute("style","position:absolute;top:25%;left:90%;width:20px;");
1796 langButton.setAttribute("style","position:absolute;top:26%;right:4%;width:20px;");
17971797 langButton.setAttribute("alipielements", "alipi");
17981798 //locButton.setAttribute("type","button");
17991799 if (window.location.hostname != '127.0.0.1') {
18231823 if(document.getElementById('loc-bt').value == '+'){
18241824 //remove input field and create a combo box
18251825 $('#loc-select').hide();
1826 var def_loc = ['Srilanka','su','sa'];
1827 locSel = document.createElement("select");
1826 locSel = document.createElement("select");
18281827 locSel.setAttribute("id","loct-select");
18291828 locSel.setAttribute("type","text");
18301829 locSel.setAttribute("alipielements", "alipi");
18311830 locSel.setAttribute("style","position:absolute;top:5%;left:40%;width:250px;");
1832 for(i=0;i<def_loc.length;i++){
1831 for(i=0;i<client_json.def_loc.length;i++){
18331832 locopt = document.createElement("option");
1834 theText=document.createTextNode(def_loc[i]);
1833 theText=document.createTextNode(client_json.def_loc[i]);
18351834 locopt.appendChild(theText);
18361835 locSel.appendChild(locopt);
18371836 }
18511851 if(document.getElementById('lang-bt').value == '+'){
18521852 //remove input field and create a combo box
18531853 $('#lang-select').hide();
1854 var def_lang = ['Srilanka','su','sa'];
18551854 langSel= document.createElement("select");
18561855 langSel.setAttribute("id","langs-select");
18571856 langSel.setAttribute("type","text");
18581857 langSel.setAttribute("alipielements", "alipi");
18591858 langSel.setAttribute("style","position:absolute;top:25%;left:40%;width:250px;");
1860 for(i=0;i<def_lang.length;i++){
1859 for(i=0;i<client_json.def_lang.length;i++){
18611860 langopt = document.createElement("option");
1862 theText=document.createTextNode(def_lang[i]);
1861 theText=document.createTextNode(client_json.def_lang[i]);
18631862 langopt.appendChild(theText);
18641863 langSel.appendChild(langopt);
18651864 }
18781878
18791879
18801880 $( "#loc-select" ).autocomplete({
1881 source: function(req, add){
1881 source: function(req, add){
18821882
1883 //pass request to server
1884 $.getJSON("http://localhost/getData?", req, function(data) {
1885 //create array for response objects
1886 var suggestions = [];
1883 //pass request to server
1884 $.getJSON("http://y.a11y.in/loc?", req, function(data) {
1885 //create array for response objects
1886 var suggestions = [];
18871887
1888 //process response
1889 $.each(data, function(i, val){
1890 //suggestions.push(val.country);
1891 for(i=0;i<val.length;i++){
1892 suggestions.push(val[i]+', '+val[i+1]+', '+val[i+2]);
1893 i +=2;
1894 }
1895 });
1888 //process response
1889 $.each(data, function(i, val){
1890 for(i=0;i<val.length;i++){
1891 suggestions.push(val[i]);
1892 }
1893 });
18961894
1897 //pass array to callback
1898 add(suggestions);
1899 });
1900 },
1901 });
1895 //pass array to callback
1896 add(suggestions);
1897 });
1898 },
1899 });
19021900
19031901 $( "#lang-select" ).autocomplete({
1904 source: function(req, add){
1902 source: function(req, add){
19051903
1906 //pass request to server
1907 $.getJSON("http://localhost/getLang?", req, function(data) {
1904 //pass request to server
1905 $.getJSON("http://y.a11y.in/lang?", req, function(data) {
19081906
1909 //create array for response objects
1910 var suggestions = [];
1907 //create array for response objects
1908 var suggestions = [];
19111909
1912 //process response
1913 $.each(data, function(i, val){
1914 //suggestions.push(val.country);
1915 for(i=0;i<val.length;i++){
1916 suggestions.push(val[i]);
1917 }
1918 });
1910 //process response
1911 $.each(data, function(i, val){
1912 //suggestions.push(val.country);
1913 for(i=0;i<val.length;i++){
1914 suggestions.push(val[i]);
1915 }
1916 });
19191917
1920 //pass array to callback
1921 add(suggestions);
1922 });
1923 },
1924 });
1918 //pass array to callback
1919 add(suggestions);
1920 });
1921 },
1922 });
19251923
19261924
19271925
22632263 }
22642264 }
22652265 }
2266 xmlhttp.open("POST","http://localhost/narration",true);
2266 xmlhttp.open("POST","http://y.a11y.in/narration",true);
22672267 xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
22682268 xmlhttp.send(data);
22692269
33463346
33473347 this.publish = function publish() {
33483348 var result;
3349 if(document.getElementById('our-check').checked)
3349 if(document.getElementById('your-check').checked)
33503350 {
33513351 localStorage.myContent = buildDataString();
3352 window.location.href = "http://localhost/test.html";
3352 window.location.href = "http://y.a11y.in/test.html";
33533353 window.reload();
33543354 }
33553355 else
33563356 {
3357 AJAX.post('http://localhost/test', buildDataString(), function(result) {
3357 AJAX.post('http://y.a11y.in/test', buildDataString(), function(result) {
33583358 ajaxResultProcessor.processPublishedResponse(result);
33593359 });
33603360 }
34083408 UTIL.forEach(history, function(index, command) {
34093409 buffer.append('###'); //separates the commands
34103410 buffer.append('about='); //url=about //removed '&' on purpose
3411 buffer.append(window.location.search.split('=')[1]);
3411 buffer.append(window.location.href);
34123412 buffer.append('&lang=');//lang
34133413 if (langName.value != "" )
34143414 buffer.append(encodeURIComponent(langName.value));