Commit 58129222fd0a63b5810f3b987d248bfcf06406bc
- Diff rendering mode:
- inline
- side by side
alipi/alipi.py
(45 / 9)
  | |||
17 | 17 | import requests | |
18 | 18 | from flask import jsonify | |
19 | 19 | import json | |
20 | from flask import url_for | ||
20 | 21 | ||
21 | |||
22 | 22 | app = Flask(__name__) | |
23 | 23 | @app.before_request | |
24 | 24 | def first(): | |
25 | 25 | g.connection = pymongo.MongoClient('localhost',27017) #Create the object once and use it. | |
26 | 26 | g.db = g.connection[conf.MONGODB[0]] | |
27 | |||
28 | # @app.after_request | ||
29 | # def set_secret(response): | ||
30 | # response.set_cookie("key", conf.SWEET_SECRET_KEY[0]) | ||
31 | |||
32 | |||
27 | 33 | @app.teardown_request | |
28 | 34 | def close(exception): | |
29 | 35 | g.connection.disconnect() | |
36 | |||
37 | |||
30 | 38 | @app.route('/') | |
31 | 39 | def start_page() : | |
32 | 40 | d = {} | |
… | … | ||
69 | 69 | i[0].attrib['href'] = '{0}?foruri={1}'.format(conf.DEPLOYURL[0],quote_plus(i[0].attrib['href'].encode('utf-8'))) | |
70 | 70 | setScripts() | |
71 | 71 | g.root.body.set("onload","a11ypi.loadOverlay();") | |
72 | return lxml.html.tostring(g.root) | ||
72 | response = make_response() | ||
73 | response.set_cookie("key", conf.SWEET_SECRET_KEY[0]) | ||
74 | response.data = lxml.html.tostring(g.root) | ||
75 | return response | ||
73 | 76 | ||
74 | 77 | elif request.args.has_key('lang') == True and request.args.has_key('interactive') == True and request.args.has_key('blog') == False: | |
75 | 78 | setScripts() | |
76 | 79 | setSocialScript() | |
77 | 80 | g.root.body.set("onload","a11ypi.ren();a11ypi.tweet(); a11ypi.facebook(); a11ypi.loadOverlay();") | |
78 | 81 | g.root.make_links_absolute(d['foruri'], resolve_base_href = True) | |
79 | return lxml.html.tostring(g.root) | ||
82 | response = make_response() | ||
83 | response.set_cookie("key", conf.SWEET_SECRET_KEY[0]) | ||
84 | response.data = lxml.html.tostring(g.root) | ||
85 | return response | ||
80 | 86 | ||
87 | |||
81 | 88 | elif request.args.has_key('lang') == True and request.args.has_key('blog') == False: | |
82 | 89 | script_jq_mini = g.root.makeelement('script') | |
83 | 90 | g.root.body.append(script_jq_mini) | |
… | … | ||
96 | 96 | script_test.set("src", conf.APPURL[0] + "/alipi/ui.js") | |
97 | 97 | script_test.set("type", "text/javascript") | |
98 | 98 | g.root.body.set("onload","a11ypi.ren()"); | |
99 | return lxml.html.tostring(g.root) | ||
99 | response = make_response() | ||
100 | response.set_cookie("key", conf.SWEET_SECRET_KEY[0]) | ||
101 | response.data = lxml.html.tostring(g.root) | ||
102 | return response | ||
100 | 103 | ||
104 | |||
101 | 105 | elif request.args.has_key('interactive') == True and request.args.has_key('blog') == True and request.args.has_key('lang') == True: | |
102 | 106 | setScripts() | |
103 | 107 | setSocialScript() | |
104 | 108 | g.root.body.set("onload","a11ypi.filter(); a11ypi.tweet(); a11ypi.facebook(); a11ypi.loadOverlay();"); | |
105 | 109 | g.root.make_links_absolute(d['foruri'], resolve_base_href = True) | |
106 | return lxml.html.tostring(g.root) | ||
110 | response = make_response() | ||
111 | response.set_cookie("key", conf.SWEET_SECRET_KEY[0]) | ||
112 | response.data = lxml.html.tostring(g.root) | ||
113 | return response | ||
107 | 114 | ||
108 | 115 | elif request.args.has_key('interactive') == False and request.args.has_key('blog') == True: | |
109 | 116 | setScripts() | |
110 | 117 | g.root.make_links_absolute(d['foruri'], resolve_base_href = True) | |
111 | 118 | g.root.body.set('onload', 'a11ypi.loadOverlay();') | |
112 | return lxml.html.tostring(g.root) | ||
119 | response = make_response() | ||
120 | response.set_cookie("key", conf.SWEET_SECRET_KEY[0]) | ||
121 | response.data = lxml.html.tostring(g.root) | ||
122 | return response | ||
113 | 123 | ||
124 | |||
114 | 125 | def setScripts(): | |
115 | 126 | script_test = g.root.makeelement('script') | |
116 | 127 | script_edit = g.root.makeelement('script') | |
128 | script_auth = g.root.makeelement('script') | ||
129 | script_cookie_reader = g.root.makeelement('script') | ||
117 | 130 | g.root.body.append(script_test) | |
118 | 131 | g.root.body.append(script_edit) | |
132 | g.root.body.append(script_auth) | ||
133 | g.root.body.append(script_cookie_reader) | ||
119 | 134 | script_test.set("src", conf.APPURL[0] + "/alipi/ui.js") | |
120 | 135 | script_test.set("type", "text/javascript") | |
121 | 136 | script_edit.set("src", conf.APPURL[0] + "/alipi/wsgi/pageEditor.js") | |
… | … | ||
139 | 139 | g.root.body.append(script_config) | |
140 | 140 | script_config.set("src", conf.APPURL[0] + "/alipi/config.js") | |
141 | 141 | script_config.set("type", "text/javascript") | |
142 | script_auth.set("src", conf.SWEETURL[0] + "/authenticate") | ||
143 | script_auth.set("type","text/javascript") | ||
144 | script_cookie_reader.set("src", url_for("static", filename="cookieReader.js")) | ||
145 | script_cookie_reader.set("type","text/javascript") | ||
142 | 146 | ||
143 | |||
144 | 147 | script_jq_mini = g.root.makeelement('script') | |
145 | 148 | g.root.body.append(script_jq_mini) | |
146 | 149 | script_jq_mini.set("src", conf.JQUERYURL[0] + "/jquery.min.js") | |
… | … | ||
407 | 407 | """ A function to sweet the data that is inserted. Accepts a <list of dicts>. """ | |
408 | 408 | for i in data: | |
409 | 409 | del(i['_id']) | |
410 | sweet = sweetmaker.make(i['type'], i['author'], i['about']+i['xpath'], i['data']) | ||
411 | sweetmaker.send(sweet) | ||
410 | sweetmaker.sweet(conf.SWEET_STORE_ADD[0], i['type'], i['author'], i['about']+i['xpath'], i['data']) | ||
412 | 411 | return True | |
413 | 412 | # data = json.dumps(data) | |
414 | 413 | # req = requests.api.post(conf.SWEETURL[0]+"/add",{'data':data}) | |
… | … | ||
476 | 476 | response = jsonify(d) | |
477 | 477 | response.headers['Access-Control-Allow-Origin'] = '*' | |
478 | 478 | return response | |
479 | |||
480 | @app.route('/secret') | ||
481 | def serve_secret(): | ||
482 | return jsonify({"key":conf.SWEET_SECRET_KEY[0]}) | ||
479 | 483 | ||
480 | 484 | ||
481 | 485 | import logging,os |
alipi/stylesheet.css
(23 / 22)
  | |||
5 | 5 | #edit-current { font-size:17px; font-weight:400; font-style:italic; text-align:justify; display:none; } | |
6 | 6 | #see-narration { font-size:17px; font-weight:400; font-style:italic; text-align:justify; display:none; } | |
7 | 7 | #see-links { font-size:17px; font-weight:400; font-style:italic; text-align:justify; display:none; } | |
8 | #blog-filter { right:-3px; min-width:225px; max-width:225px; font-size:17px; font-weight:400; font-style:italic; | ||
9 | -moz-border-radius-bottomright:0px; -webkit-border-bottom-right-radius:0px; border-bottom-right-radius:0px; | ||
10 | -moz-border-radius-topright:0px; -webkit-border-top-right-radius:0px; border-top-right-radius:0px; -moz-margin-start:7px; | ||
8 | #blog-filter { right:-3px; min-width:225px; max-width:225px; font-size:17px; font-weight:400; font-style:italic; | ||
9 | -moz-border-radius-bottomright:0px; -webkit-border-bottom-right-radius:0px; border-bottom-right-radius:0px; | ||
10 | -moz-border-radius-topright:0px; -webkit-border-top-right-radius:0px; border-top-right-radius:0px; -moz-margin-start:7px; | ||
11 | 11 | text-align:center; display:none; } | |
12 | 12 | @-moz-document domain(127.0.0.1), domain(dev.a11y.in), domain(y.a11y.in) { | |
13 | 13 | #go { top:11px !important; } | |
14 | 14 | } | |
15 | 15 | #go { top:6px; height:25px; text-align:justify; display:none; | |
16 | -moz-border-radius-bottomleft:0px; -webkit-border-bottom-left-radius:0px; border-bottom-left-radius:0px; | ||
16 | -moz-border-radius-bottomleft:0px; -webkit-border-bottom-left-radius:0px; border-bottom-left-radius:0px; | ||
17 | 17 | -moz-border-radius-topleft:0px; -webkit-border-top-left-radius:0px; -khtml-border-top-left-radius:0px; border-top-left-radius:0px; } | |
18 | 18 | ||
19 | 19 | #share { font-size:17px; font-weight:400; font-style:italic; text-align:justify; display:none; } | |
… | … | ||
31 | 31 | #exit-mode { font-size:17px; font-weight:400; font-style:italic; text-align:justify; } | |
32 | 32 | #help-window { font-size:17px; font-weight:400; font-style:italic; text-align:justify; } | |
33 | 33 | #undo-button { font-size:17px; font-weight:400; font-style:italic; text-align:justify; } | |
34 | #publish-button { font-size:17px; font-weight:400; font-style:italic; text-align:justify; } | ||
34 | #publish-button { font-size:17px; font-weight:400; font-style:italic; text-align:justify; } | ||
35 | 35 | ||
36 | #element_edit_overlay { position:fixed; text-align:center; z-index:2147483645; display:none; } | ||
36 | #element_edit_overlay { position:fixed; text-align:center; z-index:2147483645; display:none; } | ||
37 | 37 | ||
38 | 38 | #edit-text { font-size:17px; font-weight:400; font-style:italic; text-align:justify; display:none; } | |
39 | 39 | #add-audio { font-size:17px; font-weight:400; font-style:italic; text-align:justify; display:none; } | |
… | … | ||
45 | 45 | #editoroverlay { min-width:90%; text-align:justify; display: none; } | |
46 | 46 | #editoroverlay a { color:#1C94C4; } | |
47 | 47 | ||
48 | #adv-reference { position: absolute; top:15%; left:2%; min-width:48%; max-width:48%; border:solid 3px; padding:10px; font-size:16px; | ||
48 | #adv-reference { position: absolute; top:15%; left:2%; min-width:48%; max-width:48%; border:solid 3px; padding:10px; font-size:16px; | ||
49 | 49 | font-weight:400; font-style:normal; color:#aaa; overflow:show; background:none; text-align:justify; display:none; } | |
50 | 50 | ||
51 | #reference { position: absolute; top: 15%; left:2%; min-width:46%; max-width:46%; min-height:10%; border:solid 3px; padding:10px; font-size:17px; | ||
51 | #reference { position: absolute; top: 15%; left:2%; min-width:46%; max-width:46%; min-height:10%; border:solid 3px; padding:10px; font-size:17px; | ||
52 | 52 | font-weight:400; font-style:normal; text-align:justify; color:#aaa; overflow:show; background:none; text-align:justify; } | |
53 | 53 | ||
54 | 54 | #editor { position:absolute; top:15%; left:52%; min-width:45%; max-width:45%; min-height:10%; border:3px solid #aaa; padding:10px; font-size:17px; | |
… | … | ||
79 | 79 | #tar-lab4 { position:absolute; top:50%; left:125px; font-size:17px; font-weight:400; font-style:italic; color:#aaa; text-align:justify; } | |
80 | 80 | #tar-lab5 { position:absolute; top:65%; left:125px; font-size:17px; font-weight:400; font-style:italic; color:#aaa; text-align:justify; } | |
81 | 81 | #tar-lab6 { position:relative; font-size:17px; font-weight:400; font-style:italic; color:#aaa; text-align:justify; } | |
82 | #tar-pass { position:absolute; top:77%; left:210px; width:256px; font-size:17px; font-weight:400; font-style:italic; color:#000; text-align:justify; } | ||
82 | 83 | #tar-lab7 { position:relative; font-size:17px; font-weight:400; font-style:italic; color:#aaa; text-align:justify; } | |
83 | #tar-p { position:absolute; top:90%; left:210px; font-size:17px; font-weight:400; font-style:italic; text-align:justify; } | ||
84 | #blogset { position:absolute; top:80%; right:100px; left:125px; font-size:17px; font-weight:400; font-style:italic; color:#aaa; text-align:justify; } | ||
84 | #tar-p { position:absolute; top:95%; left:210px; font-size:17px; font-weight:400; font-style:italic; text-align:justify; } | ||
85 | #blogset { position:absolute; top:85%; right:100px; left:125px; font-size:17px; font-weight:400; font-style:italic; color:#aaa; text-align:justify; } | ||
85 | 86 | ||
86 | 87 | ||
87 | 88 | #loc-select { position:absolute; top:25%; left:210px; width:256px; font-size:17px; font-weight:400; font-style:italic; color:#000; text-align:justify; } | |
88 | #loc-img { position:absolute; top:25.5%; left:440px; height:20px; width:25px; font-size:17px; font-weight:400; font-style:italic; | ||
89 | #loc-img { position:absolute; top:25.5%; left:440px; height:20px; width:25px; font-size:17px; font-weight:400; font-style:italic; | ||
89 | 90 | color:#000; text-align:justify; display:none; } | |
90 | 91 | #lang-select { position:absolute; top:40%; left:210px; width:256px; font-size:17px; font-weight:400; font-style:italic; color:#000; text-align:justify; } | |
91 | #lang-img { position:absolute; top:41%; left:440px; height:18px; width:25px; font-size:17px; font-weight:400; font-style:italic; | ||
92 | #lang-img { position:absolute; top:41%; left:440px; height:18px; width:25px; font-size:17px; font-weight:400; font-style:italic; | ||
92 | 93 | color:#000; text-align:justify; display:none; } | |
93 | 94 | #style-select { position:absolute; top:55%; left:210px; width:256px; font-size:17px; font-weight:400; font-style:italic; color:#000; text-align:justify; } | |
94 | 95 | #auth-select { position:absolute; top:70%; left:210px; width:256px; font-size:17px; font-weight:400; font-style:italic; color:#000; text-align:justify; } | |
… | … | ||
109 | 109 | #see-narration { font-size:14px; font-weight:200; font-style:italic; text-align:justify; display:none; } | |
110 | 110 | #see-links { font-size:14px; font-weight:200; font-style:italic; text-align:justify; display:none; } | |
111 | 111 | #blog-filter { right:-3px; min-width:150px; max-width:150px; font-weight:200; font-style:italic; text-align:justify; display:none; | |
112 | -moz-border-radius-bottomright:0px; -webkit-border-bottom-right-radius:0px; border-bottom-right-radius:0px; | ||
112 | -moz-border-radius-bottomright:0px; -webkit-border-bottom-right-radius:0px; border-bottom-right-radius:0px; | ||
113 | 113 | -moz-border-radius-topright:0px; -webkit-border-top-right-radius:0px; border-top-right-radius:0px; } | |
114 | #go { top:5px; height:18px; -moz-border-radius-bottomleft:0px; -webkit-border-bottom-left-radius:0px; -khtml-border-bottom-left-radius:0px; | ||
115 | border-bottom-left-radius:0px; -moz-border-radius-topleft:0px; -webkit-border-top-left-radius:0px; -khtml-border-top-left-radius:0px; | ||
114 | #go { top:5px; height:18px; -moz-border-radius-bottomleft:0px; -webkit-border-bottom-left-radius:0px; -khtml-border-bottom-left-radius:0px; | ||
115 | border-bottom-left-radius:0px; -moz-border-radius-topleft:0px; -webkit-border-top-left-radius:0px; -khtml-border-top-left-radius:0px; | ||
116 | 116 | border-top-left-radius:0px; font-size:14px; font-weight:200; font-style:italic; text-align:justify; display:none; } | |
117 | 117 | @-moz-document domain(127.0.0.1), domain(dev.a11y.in), domain(y.a11y.in) { | |
118 | 118 | #go { height:23px !important; top:4px !important; } | |
… | … | ||
125 | 125 | #outter-up-button { font-size:14px; font-weight:200; font-style:italic; text-align:justify; display:none; } | |
126 | 126 | ||
127 | 127 | ||
128 | #pub_overlay { position:fixed; left:3%; width:96%; text-align:center; z-index:2147483645; font-size:14px; font-weight:200; font-style:italic; | ||
128 | #pub_overlay { position:fixed; left:3%; width:96%; text-align:center; z-index:2147483645; font-size:14px; font-weight:200; font-style:italic; | ||
129 | 129 | display:none; } | |
130 | 130 | #pub_overlay .ui-button { margin-left:10px; } | |
131 | 131 | #icon-down { font-size:14px; font-weight:200; font-style:italic; text-align:justify; display:none; } | |
… | … | ||
133 | 133 | #exit-mode { font-size:14px; font-weight:200; font-style:italic; text-align:justify; } | |
134 | 134 | #help-window { font-size:14px; font-weight:200; font-style:italic; text-align:justify; } | |
135 | 135 | #undo-button { font-size:14px; font-weight:200; font-style:italic; text-align:justify; } | |
136 | #publish-button { font-size:14px; font-weight:200; font-style:italic; text-align:justify; } | ||
136 | #publish-button { font-size:14px; font-weight:200; font-style:italic; text-align:justify; } | ||
137 | 137 | ||
138 | #element_edit_overlay { position:fixed; text-align:center; z-index:2147483645; font-size:14px; font-weight:200; font-style:italic; | ||
138 | #element_edit_overlay { position:fixed; text-align:center; z-index:2147483645; font-size:14px; font-weight:200; font-style:italic; | ||
139 | 139 | text-align:justify; display:none; } | |
140 | 140 | #element_edit_overlay .ui-button { text-align:justify; font-size:14px; font-weight:200; font-style:italic; } | |
141 | 141 | ||
… | … | ||
154 | 154 | #reference { position: absolute; top: 24%; left:2%; min-width:46%; max-width:46%; min-height:10%; border:solid 2px; padding:10px; font-size:14px; | |
155 | 155 | text-align:justify; color:#aaa; font-weight:normal; overflow:show; background:none; } | |
156 | 156 | ||
157 | #editor { position:absolute; top:15%; left:52%; min-width:45%; max-width:45%; min-height:10%; border:2px solid; padding:10px; color:#000; | ||
157 | #editor { position:absolute; top:15%; left:52%; min-width:45%; max-width:45%; min-height:10%; border:2px solid; padding:10px; color:#000; | ||
158 | 158 | background-color:#ffe; font-size:14px; font-weight:200; font-style:normal; text-align:justify; } | |
159 | 159 | ||
160 | 160 | #ref-lab { position:absolute; top:5%; font-size:14px; font-weight:200; font-style:italic; text-align:justify; color:#aaa; } | |
… | … | ||
187 | 187 | #blogset { position:absolute; top:80%; left:125px; right:80px; color:#aaa; font-size:14px; font-weight:200; font-style:italic; text-align:justify; } | |
188 | 188 | ||
189 | 189 | #loc-select { position:absolute; top:25%; left:210px; width:256px; color:#000; font-size:14px; font-weight:200; font-style:italic; text-align:justify; } | |
190 | #loc-img { position:absolute; top:25.5%; left:440px; height:20px; width:25px; color:#000; font-size:14px; font-weight:200; font-style:italic; | ||
190 | #loc-img { position:absolute; top:25.5%; left:440px; height:20px; width:25px; color:#000; font-size:14px; font-weight:200; font-style:italic; | ||
191 | 191 | text-align:justify; display:none; } | |
192 | 192 | #lang-select { position:absolute; top:40%; left:210px; width:256px; color:#000; font-size:14px; font-weight:200; font-style:italic; text-align:justify; } | |
193 | #lang-img { position:absolute; top:41%; left:440px; height:18px; width:25px; color:#000; font-size:14px; font-weight:200; font-style:italic; | ||
193 | #lang-img { position:absolute; top:41%; left:440px; height:18px; width:25px; color:#000; font-size:14px; font-weight:200; font-style:italic; | ||
194 | 194 | text-align:justify; display:none; } | |
195 | 195 | #style-select { position:absolute; top:55%; left:210px; width:256px; color:#000; font-size:14px; font-weight:200; font-style:italic; text-align:justify; } | |
196 | 196 | #auth-select { position:absolute; top:70%; left:210px; width:256px; color:#000; font-size:14px; font-weight:200; font-style:italic; text-align:justify; } | |
… | … | ||
210 | 210 | #narrations-div { position:fixed; top:5%; bottom:2%; right:0.1%; width:30%; height:93%; overflow:show; background-color: rgba(0,0,0,0.5); | |
211 | 211 | z-index:999999999; } | |
212 | 212 | /*TOOLTIPS*/ | |
213 | .tip { color: #fff; width: 140px; background-color: rgba(0,0,0,1); border:1px solid #ccc; -moz-box-shadow:#555 2px 2px 8px; | ||
213 | .tip { color: #fff; width: 140px; background-color: rgba(0,0,0,1); border:1px solid #ccc; -moz-box-shadow:#555 2px 2px 8px; | ||
214 | 214 | -webkit-box-shadow:#555 2px 2px 8px; -o-box-shadow:#555 2px 2px 8px; box-shadow:#555 2px 2px 8px; opacity:1; font-size:12px; | |
215 | 215 | font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; padding:7px; } |
alipi/sweetmaker.py
(3 / 8)
  | |||
1 | 1 | import requests | |
2 | 2 | import json | |
3 | import conf | ||
4 | def make(what, who, where, how): | ||
3 | |||
4 | def sweet(sweet_url, what, who, where, how): | ||
5 | 5 | sweet = {} | |
6 | 6 | sweet['what'] = what | |
7 | 7 | sweet['who'] = who | |
8 | 8 | sweet['where'] = where | |
9 | 9 | sweet['how'] = how | |
10 | print sweet | ||
11 | 10 | sweet_list = [] | |
12 | 11 | sweet_list.append(sweet) | |
13 | return sweet_list | ||
14 | |||
15 | |||
16 | def send(sweet): | ||
17 | request = requests.api.post(conf.SWEET_STORE_ADD[0],{'data':json.dumps(sweet)}) | ||
12 | request = requests.api.post(sweet_url, {'data':json.dumps(sweet_list)}) | ||
18 | 13 | if request.status_code == 200: | |
19 | 14 | return True | |
20 | 15 | else: |
alipi/ui.js
(14 / 5)
  | |||
72 | 72 | $("#go").show(); | |
73 | 73 | }); | |
74 | 74 | ||
75 | req = {"about":decodeURIComponent(a['foruri']), "lang":a['lang']}; | ||
75 | if(a['lang']) | ||
76 | {req = {"about":decodeURIComponent(a['foruri']), "lang":a['lang']}; | ||
76 | 77 | $.getJSON(config.deploy+'/info?', req, function(data) | |
77 | 78 | { | |
78 | 79 | a11ypi.responseJSON = data; | |
79 | 80 | }); | |
81 | } | ||
80 | 82 | } | |
81 | 83 | }, | |
82 | 84 | ajax1: function() { | |
… | … | ||
116 | 116 | ren: function() | |
117 | 117 | { | |
118 | 118 | a = a11ypi.getParams(); | |
119 | var url = decodeURIComponent(a['foruri']); | ||
119 | var url = a['foruri']; | ||
120 | // var url = decodeURIComponent(a['foruri']); | ||
120 | 121 | var type; | |
121 | 122 | if(a['type']) | |
122 | 123 | type = a['type']; | |
… | … | ||
554 | 554 | '<option>Correction</option><option>Evolution</option><option>Other</option></select>'+ | |
555 | 555 | '<label id="tar-lab5" class="alipi" >Enter an author name for your contribution: </label> '+ | |
556 | 556 | '<input id="auth-select" class="alipi" type="text" placeholder="John" /> '+ | |
557 | '<div id="blogset" > You can choose to post this in your own blog or in the default Alipi blog</div> '+ | ||
557 | '<input id="tar-pass" class="alipi" type="password" placeholder="password"/>'+ | ||
558 | '<div id="blogset" > We are having issues with posting to a personal Google blog. Please use demo.swtr.us to publish.</div> '+ | ||
558 | 559 | '<p id="tar-p" ><input id="our-check" class="alipi" type="radio"name="blog" /> '+ | |
559 | '<label id="tar-lab6" class="alipi" > Alipi Blog</label><input id="your-check" class="alipi" type="radio" name="blog" /> '+ | ||
560 | '<label id="tar-lab6" class="alipi" > demo.swtr.us </label><input id="your-check" class="alipi" type="radio" name="blog" /> '+ | ||
560 | 561 | '<label id="tar-lab7" class="alipi">Personal Blog</label></p></div>'; | |
561 | 562 | ||
562 | 563 | $('body').append(publish_template); | |
… | … | ||
581 | 581 | buttons: { | |
582 | 582 | Publish: function() { | |
583 | 583 | util.publish(); | |
584 | }, | ||
585 | Authenticate: function() { | ||
586 | var reply = sweet.authenticate($("#auth-select").val(), $("#tar-pass").val()); | ||
587 | if(reply === true) | ||
588 | alert("authenticated"); | ||
584 | 589 | } | |
585 | 590 | }, | |
586 | 591 | close: function() { | |
… | … | ||
1015 | 1015 | getParams: function() | |
1016 | 1016 | { | |
1017 | 1017 | var a = []; | |
1018 | if(window.location.hostname == config.hostname) | ||
1018 | if(window.location.hostname == config.hostname || "localhost" ) | ||
1019 | 1019 | { | |
1020 | 1020 | d = window.location.search.split('?')[1]; | |
1021 | 1021 | for (var i = 0;i<d.split('&').length;i++){ |
alipi/wsgi/pageEditor.js
(1 / 1)
  | |||
449 | 449 | dict['lang'] = $('#lang-select').val(); | |
450 | 450 | dict["location"] = $('#loc-select').val(); | |
451 | 451 | dict["style"] = $('#style-select').val(); | |
452 | dict["blog"] = "blog"; | ||
452 | dict["blog"] = config.sweet; | ||
453 | 453 | dict["elementtype"] = command.elementType; | |
454 | 454 | dict["xpath"] = command.xpath; | |
455 | 455 | dict["data"] = command.data; |