mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 11:50:49 +08:00
init project
This commit is contained in:
490
public/javascripts/download/jquery.fileDownload.js
Normal file
490
public/javascripts/download/jquery.fileDownload.js
Normal file
@@ -0,0 +1,490 @@
|
||||
/*
|
||||
* jQuery File Download Plugin v1.4.5
|
||||
*
|
||||
* http://www.johnculviner.com
|
||||
*
|
||||
* Copyright (c) 2013 - John Culviner
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* !!!!NOTE!!!!
|
||||
* You must also write a cookie in conjunction with using this plugin in the server's response headers containing the file download:
|
||||
* Set-Cookie: fileDownload=true; path=/"
|
||||
* !!!!NOTE!!!!
|
||||
*/
|
||||
|
||||
(function($, window){
|
||||
// i'll just put them here to get evaluated on script load
|
||||
var htmlSpecialCharsRegEx = /[<>&\r\n"']/gm;
|
||||
var htmlSpecialCharsPlaceHolders = {
|
||||
'<': 'lt;',
|
||||
'>': 'gt;',
|
||||
'&': 'amp;',
|
||||
'\r': "#13;",
|
||||
'\n': "#10;",
|
||||
'"': 'quot;',
|
||||
"'": '#39;' /*single quotes just to be safe, IE8 doesn't support ', so use ' instead */
|
||||
};
|
||||
|
||||
$.extend({
|
||||
//
|
||||
//$.fileDownload('/path/to/url/', options)
|
||||
// see directly below for possible 'options'
|
||||
fileDownload: function (fileUrl, options) {
|
||||
|
||||
//provide some reasonable defaults to any unspecified options below
|
||||
var settings = $.extend({
|
||||
|
||||
//
|
||||
//Requires jQuery UI: provide a message to display to the user when the file download is being prepared before the browser's dialog appears
|
||||
//
|
||||
preparingMessageHtml: null,
|
||||
|
||||
//
|
||||
//Requires jQuery UI: provide a message to display to the user when a file download fails
|
||||
//
|
||||
failMessageHtml: null,
|
||||
|
||||
//
|
||||
//the stock android browser straight up doesn't support file downloads initiated by a non GET: http://code.google.com/p/android/issues/detail?id=1780
|
||||
//specify a message here to display if a user tries with an android browser
|
||||
//if jQuery UI is installed this will be a dialog, otherwise it will be an alert
|
||||
//Set to null to disable the message and attempt to download anyway
|
||||
//
|
||||
androidPostUnsupportedMessageHtml: "Unfortunately your Android browser doesn't support this type of file download. Please try again with a different browser.",
|
||||
|
||||
//
|
||||
//Requires jQuery UI: options to pass into jQuery UI Dialog
|
||||
//
|
||||
dialogOptions: { modal: true },
|
||||
|
||||
//
|
||||
//a function to call while the dowload is being prepared before the browser's dialog appears
|
||||
//Args:
|
||||
// url - the original url attempted
|
||||
//
|
||||
prepareCallback: function (url) { },
|
||||
|
||||
//
|
||||
//a function to call after a file download successfully completed
|
||||
//Args:
|
||||
// url - the original url attempted
|
||||
//
|
||||
successCallback: function (url) { },
|
||||
|
||||
//
|
||||
//a function to call after a file download request was canceled
|
||||
//Args:
|
||||
// url - the original url attempted
|
||||
//
|
||||
abortCallback: function (url) { },
|
||||
|
||||
//
|
||||
//a function to call after a file download failed
|
||||
//Args:
|
||||
// responseHtml - the html that came back in response to the file download. this won't necessarily come back depending on the browser.
|
||||
// in less than IE9 a cross domain error occurs because 500+ errors cause a cross domain issue due to IE subbing out the
|
||||
// server's error message with a "helpful" IE built in message
|
||||
// url - the original url attempted
|
||||
// error - original error cautch from exception
|
||||
//
|
||||
failCallback: function (responseHtml, url, error) { },
|
||||
|
||||
//
|
||||
// the HTTP method to use. Defaults to "GET".
|
||||
//
|
||||
httpMethod: "GET",
|
||||
|
||||
//
|
||||
// if specified will perform a "httpMethod" request to the specified 'fileUrl' using the specified data.
|
||||
// data must be an object (which will be $.param serialized) or already a key=value param string
|
||||
//
|
||||
data: null,
|
||||
|
||||
//
|
||||
//a period in milliseconds to poll to determine if a successful file download has occured or not
|
||||
//
|
||||
checkInterval: 100,
|
||||
|
||||
//
|
||||
//the cookie name to indicate if a file download has occured
|
||||
//
|
||||
cookieName: "fileDownload",
|
||||
|
||||
//
|
||||
//the cookie value for the above name to indicate that a file download has occured
|
||||
//
|
||||
cookieValue: "true",
|
||||
|
||||
//
|
||||
//the cookie path for above name value pair
|
||||
//
|
||||
cookiePath: "/",
|
||||
|
||||
//
|
||||
//if specified it will be used when attempting to clear the above name value pair
|
||||
//useful for when downloads are being served on a subdomain (e.g. downloads.example.com)
|
||||
//
|
||||
cookieDomain: null,
|
||||
|
||||
//
|
||||
//the title for the popup second window as a download is processing in the case of a mobile browser
|
||||
//
|
||||
popupWindowTitle: "Initiating file download...",
|
||||
|
||||
//
|
||||
//Functionality to encode HTML entities for a POST, need this if data is an object with properties whose values contains strings with quotation marks.
|
||||
//HTML entity encoding is done by replacing all &,<,>,',",\r,\n characters.
|
||||
//Note that some browsers will POST the string htmlentity-encoded whilst others will decode it before POSTing.
|
||||
//It is recommended that on the server, htmlentity decoding is done irrespective.
|
||||
//
|
||||
encodeHTMLEntities: true
|
||||
|
||||
}, options);
|
||||
|
||||
var deferred = new $.Deferred();
|
||||
|
||||
//Setup mobile browser detection: Partial credit: http://detectmobilebrowser.com/
|
||||
var userAgent = (navigator.userAgent || navigator.vendor || window.opera).toLowerCase();
|
||||
|
||||
var isIos; //has full support of features in iOS 4.0+, uses a new window to accomplish this.
|
||||
var isAndroid; //has full support of GET features in 4.0+ by using a new window. Non-GET is completely unsupported by the browser. See above for specifying a message.
|
||||
var isOtherMobileBrowser; //there is no way to reliably guess here so all other mobile devices will GET and POST to the current window.
|
||||
|
||||
if (/ip(ad|hone|od)/.test(userAgent)) {
|
||||
|
||||
isIos = true;
|
||||
|
||||
} else if (userAgent.indexOf('android') !== -1) {
|
||||
|
||||
isAndroid = true;
|
||||
|
||||
} else {
|
||||
|
||||
isOtherMobileBrowser = /avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|playbook|silk|iemobile|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(userAgent.substr(0, 4));
|
||||
|
||||
}
|
||||
|
||||
var httpMethodUpper = settings.httpMethod.toUpperCase();
|
||||
|
||||
if (isAndroid && httpMethodUpper !== "GET" && settings.androidPostUnsupportedMessageHtml) {
|
||||
//the stock android browser straight up doesn't support file downloads initiated by non GET requests: http://code.google.com/p/android/issues/detail?id=1780
|
||||
|
||||
if ($().dialog) {
|
||||
$("<div>").html(settings.androidPostUnsupportedMessageHtml).dialog(settings.dialogOptions);
|
||||
} else {
|
||||
alert(settings.androidPostUnsupportedMessageHtml);
|
||||
}
|
||||
|
||||
return deferred.reject();
|
||||
}
|
||||
|
||||
var $preparingDialog = null;
|
||||
|
||||
var internalCallbacks = {
|
||||
|
||||
onPrepare: function (url) {
|
||||
|
||||
//wire up a jquery dialog to display the preparing message if specified
|
||||
if (settings.preparingMessageHtml) {
|
||||
|
||||
$preparingDialog = $("<div>").html(settings.preparingMessageHtml).dialog(settings.dialogOptions);
|
||||
|
||||
} else if (settings.prepareCallback) {
|
||||
|
||||
settings.prepareCallback(url);
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onSuccess: function (url) {
|
||||
|
||||
//remove the perparing message if it was specified
|
||||
if ($preparingDialog) {
|
||||
$preparingDialog.dialog('close');
|
||||
}
|
||||
|
||||
settings.successCallback(url);
|
||||
|
||||
deferred.resolve(url);
|
||||
},
|
||||
|
||||
onAbort: function (url) {
|
||||
|
||||
//remove the perparing message if it was specified
|
||||
if ($preparingDialog) {
|
||||
$preparingDialog.dialog('close');
|
||||
};
|
||||
|
||||
settings.abortCallback(url);
|
||||
|
||||
deferred.reject(url);
|
||||
},
|
||||
|
||||
onFail: function (responseHtml, url, error) {
|
||||
|
||||
//remove the perparing message if it was specified
|
||||
if ($preparingDialog) {
|
||||
$preparingDialog.dialog('close');
|
||||
}
|
||||
|
||||
//wire up a jquery dialog to display the fail message if specified
|
||||
if (settings.failMessageHtml) {
|
||||
$("<div>").html(settings.failMessageHtml).dialog(settings.dialogOptions);
|
||||
}
|
||||
|
||||
settings.failCallback(responseHtml, url, error);
|
||||
|
||||
deferred.reject(responseHtml, url);
|
||||
}
|
||||
};
|
||||
|
||||
internalCallbacks.onPrepare(fileUrl);
|
||||
|
||||
//make settings.data a param string if it exists and isn't already
|
||||
if (settings.data !== null && typeof settings.data !== "string") {
|
||||
settings.data = $.param(settings.data);
|
||||
}
|
||||
|
||||
|
||||
var $iframe,
|
||||
downloadWindow,
|
||||
formDoc,
|
||||
$form;
|
||||
|
||||
if (httpMethodUpper === "GET") {
|
||||
|
||||
if (settings.data !== null) {
|
||||
//need to merge any fileUrl params with the data object
|
||||
|
||||
var qsStart = fileUrl.indexOf('?');
|
||||
|
||||
if (qsStart !== -1) {
|
||||
//we have a querystring in the url
|
||||
|
||||
if (fileUrl.substring(fileUrl.length - 1) !== "&") {
|
||||
fileUrl = fileUrl + "&";
|
||||
}
|
||||
} else {
|
||||
|
||||
fileUrl = fileUrl + "?";
|
||||
}
|
||||
|
||||
fileUrl = fileUrl + settings.data;
|
||||
}
|
||||
|
||||
if (isIos || isAndroid) {
|
||||
|
||||
downloadWindow = window.open(fileUrl);
|
||||
downloadWindow.document.title = settings.popupWindowTitle;
|
||||
window.focus();
|
||||
|
||||
} else if (isOtherMobileBrowser) {
|
||||
|
||||
window.location(fileUrl);
|
||||
|
||||
} else {
|
||||
|
||||
//create a temporary iframe that is used to request the fileUrl as a GET request
|
||||
$iframe = $("<iframe style='display: none' src='"+fileUrl+"'></iframe>").appendTo("body");
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
var formInnerHtml = "";
|
||||
|
||||
if (settings.data !== null) {
|
||||
|
||||
$.each(settings.data.replace(/\+/g, ' ').split("&"), function () {
|
||||
|
||||
var kvp = this.split("=");
|
||||
|
||||
//Issue: When value contains sign '=' then the kvp array does have more than 2 items. We have to join value back
|
||||
var k = kvp[0];
|
||||
kvp.shift();
|
||||
var v = kvp.join("=");
|
||||
kvp = [k, v];
|
||||
|
||||
var key = settings.encodeHTMLEntities ? htmlSpecialCharsEntityEncode(decodeURIComponent(kvp[0])) : decodeURIComponent(kvp[0]);
|
||||
if (key) {
|
||||
var value = settings.encodeHTMLEntities ? htmlSpecialCharsEntityEncode(decodeURIComponent(kvp[1])) : decodeURIComponent(kvp[1]);
|
||||
formInnerHtml += '<input type="hidden" name="' + key + '" value="' + value + '" />';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (isOtherMobileBrowser) {
|
||||
|
||||
$form = $("<form>").appendTo("body");
|
||||
$form.hide()
|
||||
.prop('method', settings.httpMethod)
|
||||
.prop('action', fileUrl)
|
||||
.html(formInnerHtml);
|
||||
|
||||
} else {
|
||||
|
||||
if (isIos) {
|
||||
|
||||
downloadWindow = window.open("about:blank");
|
||||
downloadWindow.document.title = settings.popupWindowTitle;
|
||||
formDoc = downloadWindow.document;
|
||||
window.focus();
|
||||
|
||||
} else {
|
||||
|
||||
$iframe = $("<iframe style='display: none' src='about:blank'></iframe>").appendTo("body");
|
||||
formDoc = getiframeDocument($iframe);
|
||||
}
|
||||
|
||||
formDoc.write("<html><head></head><body><form method='" + settings.httpMethod + "' action='" + fileUrl + "'>" + formInnerHtml + "</form>" + settings.popupWindowTitle + "</body></html>");
|
||||
$form = $(formDoc).find('form');
|
||||
}
|
||||
|
||||
$form.submit();
|
||||
}
|
||||
|
||||
|
||||
//check if the file download has completed every checkInterval ms
|
||||
setTimeout(checkFileDownloadComplete, settings.checkInterval);
|
||||
|
||||
|
||||
function checkFileDownloadComplete() {
|
||||
//has the cookie been written due to a file download occuring?
|
||||
|
||||
var cookieValue = settings.cookieValue;
|
||||
if(typeof cookieValue == 'string') {
|
||||
cookieValue = cookieValue.toLowerCase();
|
||||
}
|
||||
|
||||
var lowerCaseCookie = settings.cookieName.toLowerCase() + "=" + cookieValue;
|
||||
|
||||
if (document.cookie.toLowerCase().indexOf(lowerCaseCookie) > -1) {
|
||||
|
||||
//execute specified callback
|
||||
internalCallbacks.onSuccess(fileUrl);
|
||||
|
||||
//remove cookie
|
||||
var cookieData = settings.cookieName + "=; path=" + settings.cookiePath + "; expires=" + new Date(0).toUTCString() + ";";
|
||||
if (settings.cookieDomain) cookieData += " domain=" + settings.cookieDomain + ";";
|
||||
document.cookie = cookieData;
|
||||
|
||||
//remove iframe
|
||||
cleanUp(false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//has an error occured?
|
||||
//if neither containers exist below then the file download is occuring on the current window
|
||||
if (downloadWindow || $iframe) {
|
||||
|
||||
//has an error occured?
|
||||
try {
|
||||
|
||||
var formDoc = downloadWindow ? downloadWindow.document : getiframeDocument($iframe);
|
||||
|
||||
if (formDoc && formDoc.body !== null && formDoc.body.innerHTML.length) {
|
||||
|
||||
var isFailure = true;
|
||||
|
||||
if ($form && $form.length) {
|
||||
var $contents = $(formDoc.body).contents().first();
|
||||
|
||||
try {
|
||||
if ($contents.length && $contents[0] === $form[0]) {
|
||||
isFailure = false;
|
||||
}
|
||||
} catch (e) {
|
||||
if (e && e.number == -2146828218) {
|
||||
// IE 8-10 throw a permission denied after the form reloads on the "$contents[0] === $form[0]" comparison
|
||||
isFailure = true;
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isFailure) {
|
||||
// IE 8-10 don't always have the full content available right away, they need a litle bit to finish
|
||||
setTimeout(function () {
|
||||
internalCallbacks.onFail(formDoc.body.innerHTML, fileUrl);
|
||||
cleanUp(true);
|
||||
}, 100);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
//500 error less than IE9
|
||||
internalCallbacks.onFail('', fileUrl, err);
|
||||
|
||||
cleanUp(true);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//keep checking...
|
||||
setTimeout(checkFileDownloadComplete, settings.checkInterval);
|
||||
}
|
||||
|
||||
//gets an iframes document in a cross browser compatible manner
|
||||
function getiframeDocument($iframe) {
|
||||
var iframeDoc = $iframe[0].contentWindow || $iframe[0].contentDocument;
|
||||
if (iframeDoc.document) {
|
||||
iframeDoc = iframeDoc.document;
|
||||
}
|
||||
return iframeDoc;
|
||||
}
|
||||
|
||||
function cleanUp(isFailure) {
|
||||
|
||||
setTimeout(function() {
|
||||
|
||||
if (downloadWindow) {
|
||||
|
||||
if (isAndroid) {
|
||||
downloadWindow.close();
|
||||
}
|
||||
|
||||
if (isIos) {
|
||||
if (downloadWindow.focus) {
|
||||
downloadWindow.focus(); //ios safari bug doesn't allow a window to be closed unless it is focused
|
||||
if (isFailure) {
|
||||
downloadWindow.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//iframe cleanup appears to randomly cause the download to fail
|
||||
//not doing it seems better than failure...
|
||||
//if ($iframe) {
|
||||
// $iframe.remove();
|
||||
//}
|
||||
|
||||
}, 0);
|
||||
}
|
||||
|
||||
|
||||
function htmlSpecialCharsEntityEncode(str) {
|
||||
return str.replace(htmlSpecialCharsRegEx, function(match) {
|
||||
return '&' + htmlSpecialCharsPlaceHolders[match];
|
||||
});
|
||||
}
|
||||
var promise = deferred.promise();
|
||||
promise.abort = function() {
|
||||
cleanUp();
|
||||
$iframe.attr('src', '').html('');
|
||||
internalCallbacks.onAbort(fileUrl);
|
||||
};
|
||||
return promise;
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery, this || window);
|
||||
1
public/javascripts/download/jquery.fileDownload.min.js
vendored
Normal file
1
public/javascripts/download/jquery.fileDownload.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1288
public/javascripts/educoder/edu_application.js
Normal file
1288
public/javascripts/educoder/edu_application.js
Normal file
File diff suppressed because it is too large
Load Diff
254
public/javascripts/educoder/province-data.json
Normal file
254
public/javascripts/educoder/province-data.json
Normal file
@@ -0,0 +1,254 @@
|
||||
[
|
||||
{
|
||||
"n": "北京",
|
||||
"s": [
|
||||
{ "n": "东城" },
|
||||
{ "n": "西城" },
|
||||
{ "n": "朝阳" },
|
||||
{ "n": "丰台" },
|
||||
{ "n": "石景山" },
|
||||
{ "n": "海淀" },
|
||||
{ "n": "门头沟" },
|
||||
{ "n": "房山" },
|
||||
{ "n": "通州" },
|
||||
{ "n": "顺义" },
|
||||
{ "n": "昌平" },
|
||||
{ "n": "大兴" },
|
||||
{ "n": "平谷" },
|
||||
{ "n": "怀柔" },
|
||||
{ "n": "密云" },
|
||||
{ "n": "延庆" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "上海",
|
||||
"s": [
|
||||
{ "n": "崇明" }, { "n": "黄浦" }, { "n": "卢湾" }, { "n": "徐汇" }, { "n": "长宁" }, { "n": "静安" }, { "n": "普陀" }, { "n": "闸北" }, { "n": "虹口" }, { "n": "杨浦" }, { "n": "闵行" },
|
||||
{ "n": "宝山" }, { "n": "嘉定" }, { "n": "浦东" }, { "n": "金山" }, { "n": "松江" }, { "n": "青浦" }, { "n": "南汇" }, { "n": "奉贤" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "广东",
|
||||
"s": [
|
||||
{ "n": "广州" }, { "n": "深圳" }, { "n": "珠海" }, { "n": "东莞" }, { "n": "中山" }, { "n": "佛山" }, { "n": "惠州" }, { "n": "河源" }, { "n": "潮州" }, { "n": "江门" }, { "n": "揭阳" }, { "n": "茂名" },
|
||||
{ "n": "梅州" }, { "n": "清远" }, { "n": "汕头" }, { "n": "汕尾" }, { "n": "韶关" }, { "n": "顺德" }, { "n": "阳江" }, { "n": "云浮" }, { "n": "湛江" }, { "n": "肇庆" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "江苏",
|
||||
"s": [
|
||||
{ "n": "南京" }, { "n": "常熟" }, { "n": "常州" }, { "n": "海门" }, { "n": "淮安" }, { "n": "江都" }, { "n": "江阴" }, { "n": "昆山" }, { "n": "连云港" }, { "n": "南通" },
|
||||
{ "n": "启东" }, { "n": "沭阳" }, { "n": "宿迁" }, { "n": "苏州" }, { "n": "太仓" }, { "n": "泰州" }, { "n": "同里" }, { "n": "无锡" }, { "n": "徐州" }, { "n": "盐城" },
|
||||
{ "n": "扬州" }, { "n": "宜兴" }, { "n": "仪征" }, { "n": "张家港" }, { "n": "镇江" }, { "n": "周庄" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "浙江",
|
||||
"s": [
|
||||
{ "n": "杭州" }, { "n": "安吉" }, { "n": "慈溪" }, { "n": "定海" }, { "n": "奉化" }, { "n": "海盐" }, { "n": "黄岩" }, { "n": "湖州" }, { "n": "嘉兴" }, { "n": "金华" }, { "n": "临安" },
|
||||
{ "n": "临海" }, { "n": "丽水" }, { "n": "宁波" }, { "n": "瓯海" }, { "n": "平湖" }, { "n": "千岛湖" }, { "n": "衢州" }, { "n": "江山" }, { "n": "瑞安" }, { "n": "绍兴" }, { "n": "嵊州" },
|
||||
{ "n": "台州" }, { "n": "温岭" }, { "n": "温州" }, { "n": "余姚" }, { "n": "舟山" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "重庆",
|
||||
"s": [
|
||||
{ "n": "万州" }, { "n": "涪陵" }, { "n": "渝中" }, { "n": "大渡口" }, { "n": "江北" }, { "n": "沙坪坝" }, { "n": "九龙坡" }, { "n": "南岸" }, { "n": "北碚" }, { "n": "万盛" },
|
||||
{ "n": "双挢" }, { "n": "渝北" }, { "n": "巴南" }, { "n": "黔江" }, { "n": "长寿" }, { "n": "綦江" }, { "n": "潼南" }, { "n": "铜梁" }, { "n": "大足" }, { "n": "荣昌" }, { "n": "壁山" },
|
||||
{ "n": "梁平" }, { "n": "城口" }, { "n": "丰都" }, { "n": "垫江" }, { "n": "武隆" }, { "n": "忠县" }, { "n": "开县" }, { "n": "云阳" }, { "n": "奉节" }, { "n": "巫山" }, { "n": "巫溪" },
|
||||
{ "n": "石柱" }, { "n": "秀山" }, { "n": "酉阳" }, { "n": "彭水" }, { "n": "江津" }, { "n": "合川" }, { "n": "永川" }, { "n": "南川" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "安徽",
|
||||
"s": [
|
||||
{ "n": "合肥" }, { "n": "安庆" }, { "n": "蚌埠" }, { "n": "亳州" }, { "n": "巢湖" }, { "n": "滁州" }, { "n": "阜阳" }, { "n": "贵池" }, { "n": "淮北" }, { "n": "淮化" }, { "n": "淮南" },
|
||||
{ "n": "黄山" }, { "n": "九华山" }, { "n": "六安" }, { "n": "马鞍山" }, { "n": "宿州" }, { "n": "铜陵" }, { "n": "屯溪" }, { "n": "芜湖" }, { "n": "宣城" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "福建",
|
||||
"s": [
|
||||
{ "n": "福州" }, { "n": "厦门" }, { "n": "泉州" }, { "n": "漳州" }, { "n": "龙岩" }, { "n": "南平" }, { "n": "宁德" }, { "n": "莆田" }, { "n": "三明" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "甘肃",
|
||||
"s": [
|
||||
{ "n": "兰州" }, { "n": "白银" }, { "n": "定西" }, { "n": "敦煌" }, { "n": "甘南" }, { "n": "金昌" }, { "n": "酒泉" }, { "n": "临夏" }, { "n": "平凉" }, { "n": "天水" },
|
||||
{ "n": "武都" }, { "n": "武威" }, { "n": "西峰" }, { "n": "张掖" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "广西",
|
||||
"s": [
|
||||
{ "n": "南宁" }, { "n": "百色" }, { "n": "北海" }, { "n": "桂林" }, { "n": "防城港" }, { "n": "贵港" }, { "n": "河池" }, { "n": "贺州" }, { "n": "柳州" }, { "n": "钦州" }, { "n": "梧州" }, { "n": "玉林" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "贵州",
|
||||
"s": [
|
||||
{ "n": "贵阳" }, { "n": "安顺" }, { "n": "毕节" }, { "n": "都匀" }, { "n": "凯里" }, { "n": "六盘水" }, { "n": "铜仁" }, { "n": "兴义" }, { "n": "玉屏" }, { "n": "遵义" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "海南",
|
||||
"s": [
|
||||
{ "n": "海口" }, { "n": "儋县" }, { "n": "陵水" }, { "n": "琼海" }, { "n": "三亚" }, { "n": "通什" }, { "n": "万宁" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "河北",
|
||||
"s": [
|
||||
{ "n": "石家庄" }, { "n": "保定" }, { "n": "北戴河" }, { "n": "沧州" }, { "n": "承德" }, { "n": "丰润" }, { "n": "邯郸" }, { "n": "衡水" }, { "n": "廊坊" }, { "n": "南戴河" }, { "n": "秦皇岛" },
|
||||
{ "n": "唐山" }, { "n": "新城" }, { "n": "邢台" }, { "n": "张家口" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "黑龙江",
|
||||
"s": [
|
||||
{ "n": "哈尔滨" }, { "n": "北安" }, { "n": "大庆" }, { "n": "大兴安岭" }, { "n": "鹤岗" }, { "n": "黑河" }, { "n": "佳木斯" }, { "n": "鸡西" }, { "n": "牡丹江" }, { "n": "齐齐哈尔" },
|
||||
{ "n": "七台河" }, { "n": "双鸭山" }, { "n": "绥化" }, { "n": "伊春" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "河南",
|
||||
"s": [
|
||||
{ "n": "郑州" }, { "n": "安阳" }, { "n": "鹤壁" }, { "n": "潢川" }, { "n": "焦作" }, { "n": "济源" }, { "n": "开封" }, { "n": "漯河" }, { "n": "洛阳" }, { "n": "南阳" }, { "n": "平顶山" },
|
||||
{ "n": "濮阳" }, { "n": "三门峡" }, { "n": "商丘" }, { "n": "新乡" }, { "n": "信阳" }, { "n": "许昌" }, { "n": "周口" }, { "n": "驻马店" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "湖北",
|
||||
"s": [
|
||||
{ "n": "武汉" }, { "n": "恩施" }, { "n": "鄂州" }, { "n": "黄冈" }, { "n": "黄石" }, { "n": "荆门" }, { "n": "荆州" }, { "n": "潜江" }, { "n": "十堰" }, { "n": "随州" }, { "n": "武穴" },
|
||||
{ "n": "仙桃" }, { "n": "咸宁" }, { "n": "襄阳" }, { "n": "襄樊" }, { "n": "孝感" }, { "n": "宜昌" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "湖南",
|
||||
"s": [
|
||||
{ "n": "长沙" }, { "n": "常德" }, { "n": "郴州" }, { "n": "衡阳" }, { "n": "怀化" }, { "n": "吉首" }, { "n": "娄底" }, { "n": "邵阳" }, { "n": "湘潭" }, { "n": "益阳" }, { "n": "岳阳" },
|
||||
{ "n": "永州" }, { "n": "张家界" }, { "n": "株洲" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "江西",
|
||||
"s": [
|
||||
{ "n": "南昌" }, { "n": "抚州" }, { "n": "赣州" }, { "n": "吉安" }, { "n": "景德镇" }, { "n": "井冈山" }, { "n": "九江" }, { "n": "庐山" }, { "n": "萍乡" },
|
||||
{ "n": "上饶" }, { "n": "新余" }, { "n": "宜春" }, { "n": "鹰潭" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "吉林",
|
||||
"s": [
|
||||
{ "n": "长春" }, { "n": "吉林" }, { "n": "白城" }, { "n": "白山" }, { "n": "珲春" }, { "n": "辽源" }, { "n": "梅河" }, { "n": "四平" }, { "n": "松原" }, { "n": "通化" }, { "n": "延吉" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "辽宁",
|
||||
"s": [
|
||||
{ "n": "沈阳" }, { "n": "鞍山" }, { "n": "本溪" }, { "n": "朝阳" }, { "n": "大连" }, { "n": "丹东" }, { "n": "抚顺" }, { "n": "阜新" }, { "n": "葫芦岛" }, { "n": "锦州" },
|
||||
{ "n": "辽阳" }, { "n": "盘锦" }, { "n": "铁岭" }, { "n": "营口" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "内蒙古",
|
||||
"s": [
|
||||
{ "n": "呼和浩特" }, { "n": "阿拉善盟" }, { "n": "包头" }, { "n": "赤峰" }, { "n": "东胜" }, { "n": "海拉尔" }, { "n": "集宁" }, { "n": "临河" }, { "n": "通辽" }, { "n": "乌海" },
|
||||
{ "n": "乌兰浩特" }, { "n": "锡林浩特" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "宁夏",
|
||||
"s": [
|
||||
{ "n": "银川" }, { "n": "固源" }, { "n": "石嘴山" }, { "n": "吴忠" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "青海",
|
||||
"s": [
|
||||
{ "n": "西宁" }, { "n": "德令哈" }, { "n": "格尔木" }, { "n": "共和" }, { "n": "海东" }, { "n": "海晏" }, { "n": "玛沁" }, { "n": "同仁" }, { "n": "玉树" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "山东",
|
||||
"s": [
|
||||
{ "n": "济南" }, { "n": "滨州" }, { "n": "兖州" }, { "n": "德州" }, { "n": "东营" }, { "n": "菏泽" }, { "n": "济宁" }, { "n": "莱芜" }, { "n": "聊城" }, { "n": "临沂" },
|
||||
{ "n": "蓬莱" }, { "n": "青岛" }, { "n": "曲阜" }, { "n": "日照" }, { "n": "泰安" }, { "n": "潍坊" }, { "n": "威海" }, { "n": "烟台" }, { "n": "枣庄" }, { "n": "淄博" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "山西",
|
||||
"s": [
|
||||
{ "n": "太原" }, { "n": "长治" }, { "n": "大同" }, { "n": "候马" }, { "n": "晋城" }, { "n": "离石" }, { "n": "临汾" }, { "n": "宁武" }, { "n": "朔州" }, { "n": "忻州" },
|
||||
{ "n": "阳泉" }, { "n": "榆次" }, { "n": "运城" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "陕西",
|
||||
"s": [
|
||||
{ "n": "西安" }, { "n": "安康" }, { "n": "宝鸡" }, { "n": "汉中" }, { "n": "渭南" }, { "n": "商州" }, { "n": "绥德" }, { "n": "铜川" }, { "n": "咸阳" }, { "n": "延安" }, { "n": "榆林" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "四川",
|
||||
"s": [
|
||||
{ "n": "成都" }, { "n": "巴中" }, { "n": "达川" }, { "n": "德阳" }, { "n": "都江堰" }, { "n": "峨眉山" }, { "n": "涪陵" }, { "n": "广安" }, { "n": "广元" }, { "n": "九寨沟" },
|
||||
{ "n": "康定" }, { "n": "乐山" }, { "n": "泸州" }, { "n": "马尔康" }, { "n": "绵阳" }, { "n": "眉山" }, { "n": "南充" }, { "n": "内江" }, { "n": "攀枝花" }, { "n": "遂宁" },
|
||||
{ "n": "汶川" }, { "n": "西昌" }, { "n": "雅安" }, { "n": "宜宾" }, { "n": "自贡" }, { "n": "资阳" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "天津",
|
||||
"s": [
|
||||
{ "n": "天津" }, { "n": "和平" }, { "n": "东丽" }, { "n": "河东" }, { "n": "西青" }, { "n": "河西" }, { "n": "津南" }, { "n": "南开" }, { "n": "北辰" }, { "n": "河北" }, { "n": "武清" }, { "n": "红挢" },
|
||||
{ "n": "塘沽" }, { "n": "汉沽" }, { "n": "大港" }, { "n": "宁河" }, { "n": "静海" }, { "n": "宝坻" }, { "n": "蓟县" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "新疆",
|
||||
"s": [
|
||||
{ "n": "乌鲁木齐" }, { "n": "阿克苏" }, { "n": "阿勒泰" }, { "n": "阿图什" }, { "n": "博乐" }, { "n": "昌吉" }, { "n": "东山" }, { "n": "哈密" }, { "n": "和田" }, { "n": "喀什" },
|
||||
{ "n": "克拉玛依" }, { "n": "库车" }, { "n": "库尔勒" }, { "n": "奎屯" }, { "n": "石河子" }, { "n": "塔城" }, { "n": "吐鲁番" }, { "n": "伊宁" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "西藏",
|
||||
"s": [
|
||||
{ "n": "拉萨" }, { "n": "阿里" }, { "n": "昌都" }, { "n": "林芝" }, { "n": "那曲" }, { "n": "日喀则" }, { "n": "山南" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "云南",
|
||||
"s": [
|
||||
{ "n": "昆明" }, { "n": "大理" }, { "n": "保山" }, { "n": "楚雄" }, { "n": "大理" }, { "n": "东川" }, { "n": "个旧" }, { "n": "景洪" }, { "n": "开远" }, { "n": "临沧" }, { "n": "丽江" },
|
||||
{ "n": "六库" }, { "n": "潞西" }, { "n": "曲靖" }, { "n": "思茅" }, { "n": "文山" }, { "n": "西双版纳" }, { "n": "玉溪" }, { "n": "中甸" }, { "n": "昭通" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "香港特别行政区",
|
||||
"s": [
|
||||
{ "n": "香港" }, { "n": "九龙" }, { "n": "新界" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "澳门特别行政区",
|
||||
"s": [
|
||||
{ "n": { "n": "澳门" } }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "台湾",
|
||||
"s": [
|
||||
{ "n": "台北" }, { "n": "基隆" }, { "n": "台南" }, { "n": "台中" }, { "n": "高雄" }, { "n": "屏东" }, { "n": "南投" }, { "n": "云林" }, { "n": "新竹" }, { "n": "彰化" }, { "n": "苗栗" },
|
||||
{ "n": "嘉义" }, { "n": "花莲" }, { "n": "桃园" }, { "n": "宜兰" }, { "n": "台东" }, { "n": "金门" }, { "n": "马祖" }, { "n": "澎湖" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"n": "海外",
|
||||
"s": [
|
||||
{ "n": "美国" }, { "n": "日本" }, { "n": "英国" }, { "n": "法国" }, { "n": "德国" }, { "n": "其他" }
|
||||
]
|
||||
}
|
||||
]
|
||||
11
public/javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js
Normal file
11
public/javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js
Normal file
File diff suppressed because one or more lines are too long
51
public/javascripts/jupyter.js
Normal file
51
public/javascripts/jupyter.js
Normal file
@@ -0,0 +1,51 @@
|
||||
//用于嵌入到jupyter pod中的js
|
||||
//guange 2019.12.18
|
||||
|
||||
var timebool=false;
|
||||
window.onload=function(){
|
||||
console.log("开始发送消息了");
|
||||
timebool=true;
|
||||
// runEvery10Sec();
|
||||
}
|
||||
|
||||
function runEvery10Sec() {
|
||||
// 1000 * 10 = 10 秒钟
|
||||
// console.log("每隔10秒中一次");
|
||||
require(["base/js/namespace"],function(Jupyter) {
|
||||
Jupyter.notebook.save_checkpoint();
|
||||
});
|
||||
window.parent.postMessage('jupytermessage','*');
|
||||
// if(timebool===true){
|
||||
// setTimeout( runEvery10Sec, 1000 * 10 );
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
window.onload=function(){
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)){
|
||||
e.preventDefault();
|
||||
console.log("ctrl+s");
|
||||
window.parent.postMessage('jupytermessage','*');
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('message', (e) => {
|
||||
if(e){
|
||||
if(e.data){
|
||||
if(e.data==="stopParent"){
|
||||
//重置停止
|
||||
timebool=false;
|
||||
// console.log("父窗口调用停止");
|
||||
}else if(e.data==="clonsParent"){
|
||||
// console.log("父窗口调用启动");
|
||||
//取消启动
|
||||
timebool=true;
|
||||
// runEvery10Sec();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
1
public/javascripts/media/clappr-playback-rate-plugin.min.js
vendored
Normal file
1
public/javascripts/media/clappr-playback-rate-plugin.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/javascripts/media/clappr-thumbnails-plugin.js
Normal file
1
public/javascripts/media/clappr-thumbnails-plugin.js
Normal file
File diff suppressed because one or more lines are too long
38289
public/javascripts/media/clappr.js
Normal file
38289
public/javascripts/media/clappr.js
Normal file
File diff suppressed because one or more lines are too long
1
public/javascripts/media/clappr.min.js
vendored
Normal file
1
public/javascripts/media/clappr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/javascripts/wx/jweixin-1.3.0.js
Normal file
2
public/javascripts/wx/jweixin-1.3.0.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user