This repository was archived by the owner on Mar 4, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +47
-0
lines changed
Expand file tree Collapse file tree 6 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ < div data-role ="collapsible " data-inset ="false " data-content-theme ="false " data-mini ="true " data-collapsed-icon ="carat-l " data-expanded-icon ="carat-d " data-iconpos ="right ">
2+ < h4 > Disqus</ h4 >
3+ < div id ="disqus_thread " class ="disqus-wrap disqus-active "> </ div >
4+ </ div >
Original file line number Diff line number Diff line change 2828 < link rel ="stylesheet " href ="css/app.css ">
2929 < script src ="js/config.js "> </ script >
3030 < script src ="js/user.js "> </ script >
31+ < script src ="js/disqus.js "> </ script >
3132 < script src ="js/app.js "> </ script >
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ <h1>Fjalori ICT</h1>
3131
3232 {% include _html/translation_details.html %}
3333
34+ {% include _html/disqus.html %}
35+
3436 </ div > <!-- /content -->
3537
3638 <!-- messages -->
Original file line number Diff line number Diff line change 3131 < link rel ="stylesheet " href ="css/app.css ">
3232 < script src ="js/config.js "> </ script >
3333 < script src ="js/user.js "> </ script >
34+ < script src ="js/disqus.js "> </ script >
3435 < script src ="js/app.js "> </ script >
3536
3637 </ head >
@@ -153,6 +154,12 @@ <h4>Voters ({{nr}})</h4>
153154</ script >
154155
155156
157+ < div data-role ="collapsible " data-inset ="false " data-content-theme ="false " data-mini ="true " data-collapsed-icon ="carat-l " data-expanded-icon ="carat-d " data-iconpos ="right ">
158+ < h4 > Disqus</ h4 >
159+ < div id ="disqus_thread " class ="disqus-wrap disqus-active "> </ div >
160+ </ div >
161+
162+
156163 </ div > <!-- /content -->
157164
158165 <!-- messages -->
Original file line number Diff line number Diff line change @@ -264,8 +264,29 @@ var $app = (function () {
264264 // Sending a new translation to the server.
265265 $ ( '#new-translation-form' ) . on ( 'submit' , send_new_translation ) ;
266266 $ ( '#send-new-translation' ) . on ( 'click' , send_new_translation ) ;
267+
268+ // Get the disqus comments for this term.
269+ reload_disqus ( sguid , term ) ;
267270 } ) ;
268271 } ;
272+
273+ var reload_disqus = function ( sguid , term ) {
274+ //var term = $('#search-term')[0].value;
275+ //var sguid = $('#new-translation').data('sguid');
276+ if ( $ ( '.disqus-wrap' ) . length == 1 ) {
277+ $ ( '.disqus-inactive' ) . addClass ( 'disqus-active' ) . removeClass ( 'disqus-inactive' ) . attr ( 'id' , 'disqus_thread' ) ;
278+ }
279+ if ( typeof ( DISQUS ) !== 'undefined' ) {
280+ DISQUS . reset ( {
281+ reload : true ,
282+ config : function ( ) {
283+ this . page . identifier = 'translations/sq/' + sguid ;
284+ this . page . url = 'http://fjalori.fs.al/#' + term ;
285+ this . page . title = term ;
286+ }
287+ } ) ;
288+ }
289+ } ;
269290
270291 /**
271292 * When a translation from the list is clicked, display
Original file line number Diff line number Diff line change 1+
2+ $ ( document ) . ready ( function ( ) {
3+ var disqus_shortname = 'l10n-sq' ;
4+
5+ if ( typeof ( DISQUS ) == 'undefined' ) {
6+ ( function ( ) {
7+ var dsq = document . createElement ( 'script' ) ; dsq . type = 'text/javascript' ; dsq . async = true ;
8+ dsq . src = 'http://' + disqus_shortname + '.disqus.com/embed.js' ;
9+ ( document . getElementsByTagName ( 'head' ) [ 0 ] || document . getElementsByTagName ( 'body' ) [ 0 ] ) . appendChild ( dsq ) ;
10+ } ) ( ) ;
11+ }
12+ } ) ;
You can’t perform that action at this time.
0 commit comments