From ab375864d65a993289021ddd6607d4ccec0d7eb5 Mon Sep 17 00:00:00 2001 From: Peter Badida Date: Sat, 6 Aug 2016 15:23:51 +0200 Subject: [PATCH] Replace JS with links --- doc/sources/.static/kivy.js | 107 ------------------ .../installation/installation-windows.rst | 17 ++- 2 files changed, 13 insertions(+), 111 deletions(-) diff --git a/doc/sources/.static/kivy.js b/doc/sources/.static/kivy.js index b09f3abfc..3a532fb45 100644 --- a/doc/sources/.static/kivy.js +++ b/doc/sources/.static/kivy.js @@ -298,110 +298,3 @@ $(document).ready(function () { } }); - -// get url for nightly wheel -// ajax from https://github.com/padolsey-archive/jquery.fn/tree/master/cross-domain-ajax -// - -// leading zeros for date -function addZeros(num, size) { - var s = num + ''; - while (s.length < size) s = '0' + s; - return s; -} - -function wheelUrl(fromAjax, pyVer, arch) { - var prefixUrl = 'https://docs.google.com/uc?id='; - var fileID = 'entry-([a-zA-Z0-9\\-]*?)'; - var htmlGarbage = '(?:" role="link" tabindex="0">\ -
\ -
\ -Compressed Archive<\\/div>\ -<\\/div><\\/div>
<\\/div>
)'; - var wheel = '(Kivy-\\d\\.\\d\\.\\d)(\\.\\w{4}_$date$_git\\_?\\w\ -{7}-$pyVer$)(-none|_\\d{8}_git_\\w{7}-$pyVer$m)(-$arch$.whl)'; - var date = new Date(); - var yesterday = addZeros(date.getDate() - 1, 2); - var month = addZeros(date.getMonth() + 1, 2); - var year = date.getFullYear(); - date = yesterday + month + year; - wheel = wheel.replace("$date$", date).replace("$pyVer$", pyVer); - wheel = wheel.replace("$pyVer$", pyVer).replace("$arch$", arch); - var regex = fileID + htmlGarbage + wheel; - var text = fromAjax.responseText; - try { - whlUrl = prefixUrl + text.match(new RegExp(regex))[1]; - var win = window.open(whlUrl, '_blank'); - if (win) { - win.focus(); - } - else { - alert('Please allow pop-ups for this page!'); - } - } - catch (e) { - alert('No nightly wheel is available yet!'); - } -} - -// getNightly('cp27', 'win32'); for cpXY and win32, win_amd64 -function getNightly(pyVer, arch) { - var whlURL; - var driveUrl = 'https://drive.google.com/folderview?id=0B1_HB9J8\ -mZepOV81UHpDbmg5SWM&usp=sharing#list'; - jQuery.ajax = (function(_ajax) { - var protocol = location.protocol, - hostname = location.hostname, - exRegex = RegExp(protocol + '//' + hostname), - YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query\ -.yahooapis.com/v1/public/yql?callback=?', - query = 'select * from html where url="{URL}" and xpath="*"'; - function isExternal(url) { - return !exRegex.test(url) && /:\/\//.test(url); - } - return function(o) { - var url = o.url; - if (/get/i.test(o.type) && !/json/i.test(o.dataType) && - isExternal(url)) { - o.url = YQL; - o.dataType = 'json'; - o.data = { - q: query.replace( - '{URL}', - url + (o.data ? - (/\?/.test(url) ? '&' : '?') + jQuery.param(o.data) - : '') - ), - format: 'xml' - }; - if (!o.success && o.complete) { - o.success = o.complete; - delete o.complete; - } - o.success = (function(_success) { - return function(data) { - var rx = /]+?\/>|/gi; - if (_success) { - _success.call(this, { - responseText: data.results[0] - .replace(rx, '') - }, 'success'); - } - }; - })(o.success); - } - return _ajax.apply(this, arguments); - }; - })(jQuery.ajax); - $.ajax({ - url: driveUrl, - type: 'GET', - async: false, - success: function(res) { - wheelUrl(res, pyVer, arch); - } - }); -} diff --git a/doc/sources/installation/installation-windows.rst b/doc/sources/installation/installation-windows.rst index 6e4cb3fdb..9b68f4d0c 100644 --- a/doc/sources/installation/installation-windows.rst +++ b/doc/sources/installation/installation-windows.rst @@ -69,10 +69,19 @@ Snapshot wheels of current Kivy master are created every night. They can be foun To use them, instead of doing `python -m pip install kivy` we'll install one of these wheels as follows. -- `Python 2.7, 32bit `_ -- `Python 3.4, 32bit `_ -- `Python 2.7, 64bit `_ -- `Python 3.4, 64bit `_ +.. |cp27_win32| replace:: Python 2.7, 32bit +.. _cp27_win32: https://drive.google.com/uc?id=0B-080DPVLKs2amMxY3o1cHNzRjQ +.. |cp34_win32| replace:: Python 3.4, 32bit +.. _cp34_win32: https://drive.google.com/uc?id=0B-080DPVLKs2TnpLb25lcUh3d0U +.. |cp27_amd64| replace:: Python 2.7, 64bit +.. _cp27_amd64: https://drive.google.com/uc?id=0B-080DPVLKs2TmRrMExqLVJ1M28 +.. |cp34_amd64| replace:: Python 3.4, 64bit +.. _cp34_amd64: https://drive.google.com/uc?id=0B-080DPVLKs2eDlqQlJCRldkNE0 + +- |cp27_win32|_ +- |cp34_win32|_ +- |cp27_amd64|_ +- |cp34_amd64|_ #. Perform steps 1 and 2 of the above Installation section. #. Download the appropriate wheel for your system.