diff --git a/media/javascript/websupport2-bundle.js b/media/javascript/websupport2-bundle.js deleted file mode 100644 index 962305616c0..00000000000 --- a/media/javascript/websupport2-bundle.js +++ /dev/null @@ -1,459 +0,0 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 ? settings.opts.commentBrightImage : settings.opts.commentImage; - var addcls = count == 0 ? ' nocomment' : ''; - addCommentIcon(id, title, image, addcls) - } - $.each($('.sphinx-has-comment'), function () { - count = 0 - id = $(this).attr('id') - if (!(id in settings.metadata)) { - var title = count + ' comment' + (count == 1 ? '' : 's'); - var image = count > 0 ? settings.opts.commentBrightImage : settings.opts.commentImage; - var addcls = count == 0 ? ' nocomment' : ''; - addCommentIcon(id, title, image, addcls) - } - }) -} - -function addCommentIcon(id, title, image, addcls) { - $("#" + id) - .append( - $(document.createElement('a')).attr({ - href: '#', - 'class': 'sphinx-comment-open' + addcls, - id: 'comment-open-' + id - }) - .append($(document.createElement('img')).attr({ - src: image, - alt: 'comment', - title: title - })) - - ) - .append( - $(document.createElement('a')).attr({ - href: '#', - 'class': 'sphinx-comment-close hidden', - id: 'comment-close-' + id - }) - .append($(document.createElement('img')).attr({ - src: settings.opts.closeCommentImage, - alt: 'close', - title: 'close' - })) - ); -} - - -function addComment(form) { - var node_id = form.find('input[name="node"]').val(); - var text = form.find('textarea[name="comment"]').val(); - - if (text == '') { - display.showError('Please enter a comment.'); - return; - } - - // Disable the form that is being submitted. - form.find('textarea,input').attr('disabled', 'disabled'); - - - var server_data = getServerData(); - var comment_data = { - node: node_id, - text: text, - }; - var post_data = $.extend(server_data, comment_data) - - - // Send the comment to the server. - $.ajax({ - type: "POST", - url: settings.opts.addCommentURL, - dataType: 'json', - data: post_data, - success: function(data, textStatus, error) { - form.find('textarea') - .val('') - .add(form.find('input')) - .removeAttr('disabled'); - display.showOneComment($(".comment-list"), data) - var comment_element = $('#' + node_id); - comment_element.find('img').attr({'src': settings.opts.commentBrightImage}); - comment_element.find('a').removeClass('nocomment'); - }, - error: function(request, textStatus, error) { - form.find('textarea,input').removeAttr('disabled'); - display.showError('Oops, there was a problem adding the comment.'); - } - }); -} - - -function attachComment(form) { - var node_id = form.find('input[name="node"]').val(); - var comment_id = form.find('input[name="comment"]').val(); - - var server_data = getServerData(); - var comment_data = { - node: node_id, - comment: comment_id - }; - var post_data = $.extend(server_data, comment_data) - - - // Send the comment to the server. - $.ajax({ - type: "POST", - url: settings.opts.attachCommentURL, - dataType: 'json', - data: post_data, - success: function(data, textStatus, error) { - form.find('textarea') - .val('') - .add(form.find('input')) - .removeAttr('disabled'); - display.showOneComment($(".comment-list"), data) - var comment_element = $('#' + node_id); - comment_element.find('img').attr({'src': settings.opts.commentBrightImage}); - comment_element.find('a').removeClass('nocomment'); - }, - error: function(request, textStatus, error) { - form.find('textarea,input').removeAttr('disabled'); - display.showError('Oops, there was a problem adding the comment.'); - } - }); -} - - - -},{"./display":3,"./docpage":4,"./settings":6}],3:[function(require,module,exports){ -module.exports = { - initDisplay: initDisplay, - displayComments: displayComments, - showOneComment: showOneComment, - closeComments: closeComments -} - -comm = require('./comm') - -function initDisplay() { - $('body').append("
"); - $('body').append("
"); -} - -function closeComments() { - $.pageslide.close() -} - -function displayComments(id) { - server_data = comm.getServerData() - get_data = { - 'node': id - } - var post_data = $.extend(get_data, server_data) - delete post_data['page'] - - $.ajax({ - type: 'GET', - url: settings.opts.getCommentsURL, - data: post_data, - crossDomain: true, - xhrFields: { - withCredentials: true, - }, - success: function(data) { - handleComments(id, data) - - }, - error: function(request, textStatus, error) { - showError('Oops, there was a problem retrieving the comments.'); - }, - dataType: 'json' - }); -} - - -function handleComments(id, data) { - showComments(id, data.results) -} - - -function showComments(id, comment_data) { - element = $('#current-comment').html("

Comments

") - element.append("
") - for (index in comment_data) { - obj = comment_data[index] - showOneComment($(".comment-list"), obj) - } - element.append("
") - var reply = '\ -
\ -
\ - \ - \ - \ -
\ -
' - - element.append("
") - $(".comment-div").append(reply) - element.append("
") - - element.append("


") - element.append("
") - element.append("


") - element.append("

Floating Comments

") - element.append("
") - for (index in comment_data) { - obj = comment_data[index] - showOneComment($(".floating-comment-list"), obj) - var attach = '\ -
\ -
\ - \ - \ - \ -
\ -
' - - } - element.append("
") - $(".floating-comment-div").append(attach) - element.append("
") - - element.append("
") - element.append("") - - $.pageslide({direction: 'left', href:'#current-comment' }) -} - -function showOneComment(element, comment) { - console.log("Displaying") - console.log(comment) - to_append = "" - to_append += comment['date'] + "
" - to_append += comment['text'] - to_append += "
" - element.append(to_append) -} - - function showError(message) { - $(document.createElement('div')).attr({'class': 'popup-error'}) - .append($(document.createElement('div')) - .attr({'class': 'error-message'}).text(message)) - .appendTo('body') - .fadeIn("slow") - .delay(2000) - .fadeOut("slow"); - } - -// Don't need this since its in the page. - -/* -function setUpPageslide() { - $.ajax({ - url: "https://api.grokthedocs.com/static/javascript/pageslide/jquery.pageslide.js", - crossDomain: true, - dataType: "script", - cache: true, - success: function () { - console.log("Loaded pageslide") - $('head').append(''); - $('body').append("
"); - }, - error: function (e) { - console.log("OMG FAIL:" + e) - } - - }); -} -*/ -},{"./comm":2}],4:[function(require,module,exports){ -// Module exporting page-level variables for easy use -module.exports = { - project: READTHEDOCS_DATA['project'], - version: READTHEDOCS_DATA['version'], - page: getPageName(), - commit: getCommit() -} - -function getPageName() { - if ('page' in READTHEDOCS_DATA) { - return READTHEDOCS_DATA['page'] - } else { - stripped = window.location.pathname.substring(1) - stripped = stripped.replace(".html", "") - stripped = stripped.replace(/\/$/, "") - return stripped - } -} - -function getCommit() { - if ('commit' in READTHEDOCS_DATA) { - return READTHEDOCS_DATA['commit'] - } else { - return "unknown-commit" - } -} - -},{}],5:[function(require,module,exports){ -module.exports = { - initEvents: initEvents -} - -display = require('./display') - -function initEvents() { - $(document).on("click", "a.sphinx-comment-open", function(event) { - event.preventDefault(); - display.displayComments($(this).attr('id').substring('comment-open-'.length)); - }) - $(document).on("click", "a.sphinx-comment-close", function(event) { - event.preventDefault(); - display.closeComments($(this).attr('id').substring('comment-close-'.length)); - }) - - $(document).on("submit", ".comment-reply-form", function(event) { - event.preventDefault(); - comm.addComment($(this)); - }) - - $(document).on("submit", ".comment-attach-form", function(event) { - event.preventDefault(); - comm.attachComment($(this)); - }) -} - - -},{"./display":3}],6:[function(require,module,exports){ -var baseURL = "{{ websupport2_base_url }}"; -var staticURL = "{{ websupport2_static_url }}"; - -// Template rendering failed -if (baseURL.lastIndexOf("{{", 0) === 0) { - var rootURL = "http://localhost:8000"; - var baseURL = "http://localhost:8000/websupport"; - var staticURL = "http://localhost:8000/static"; -} - -var metadata = {} - -var opts = { - // Dynamic Content - processVoteURL: baseURL + '/_process_vote', - addCommentURL: rootURL + '/api/v2/comments/', - attachCommentURL: baseURL + '/_attach_comment', - getCommentsURL: rootURL + '/api/v2/comments/', - acceptCommentURL: baseURL + '/_accept_comment', - deleteCommentURL: baseURL + '/_delete_comment', - metadataURL: baseURL + '/_get_metadata', - optionsURL: baseURL + '/_get_options', - - // Static Content - commentImage: staticURL + '/_static/comment.png', - closeCommentImage: staticURL + '/_static/comment-close.png', - loadingImage: staticURL + '/_static/ajax-loader.gif', - commentBrightImage: staticURL + '/_static/comment-bright.png', - upArrow: staticURL + '/_static/up.png', - downArrow: staticURL + '/_static/down.png', - upArrowPressed: staticURL + '/_static/up-pressed.png', - downArrowPressed: staticURL + '/_static/down-pressed.png', - - voting: false, - moderator: false -}; - - -module.exports = { - metadata: metadata, - opts: opts, - staticURL: staticURL, - baseURL: baseURL -} - - -},{}]},{},[1]); diff --git a/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl b/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl index b4738a81fd0..f59c0d58c32 100644 --- a/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl +++ b/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl @@ -48,12 +48,6 @@ if not 'html_static_path' in globals(): if os.path.exists('_static'): html_static_path.append('_static') -# Define websupport2_base_url and websupport2_static_url -if globals().get('websupport2_base_url', False): - websupport2_base_url = '{{ api_host }}/websupport' - websupport2_static_url = '{{ settings.STATIC_URL }}' - - #Add project information to the template context. context = { 'using_theme': using_rtd_theme,