mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
remove jquery
This commit is contained in:
parent
06ed27011c
commit
b177bf634d
2182
3rdparty/closure-compiler/jquery-1.9.js
vendored
2182
3rdparty/closure-compiler/jquery-1.9.js
vendored
File diff suppressed because it is too large
Load Diff
21
3rdparty/jQuery/MIT-LICENSE.txt
vendored
21
3rdparty/jQuery/MIT-LICENSE.txt
vendored
@ -1,21 +0,0 @@
|
|||||||
Copyright 2013 jQuery Foundation and other contributors
|
|
||||||
http://jquery.com/
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
4
3rdparty/jQuery/jquery-1.9.1.min.js
vendored
4
3rdparty/jQuery/jquery-1.9.1.min.js
vendored
File diff suppressed because one or more lines are too long
@ -253,7 +253,6 @@ add_custom_command(OUTPUT
|
|||||||
install (TARGETS pdf2htmlEX DESTINATION bin)
|
install (TARGETS pdf2htmlEX DESTINATION bin)
|
||||||
|
|
||||||
set(PDF2HTMLEX_RESOURCE
|
set(PDF2HTMLEX_RESOURCE
|
||||||
${CMAKE_SOURCE_DIR}/3rdparty/jQuery/jquery-1.9.1.min.js
|
|
||||||
${CMAKE_SOURCE_DIR}/3rdparty/PDF.js/compatibility.min.js
|
${CMAKE_SOURCE_DIR}/3rdparty/PDF.js/compatibility.min.js
|
||||||
${CMAKE_SOURCE_DIR}/share/base.css
|
${CMAKE_SOURCE_DIR}/share/base.css
|
||||||
${CMAKE_SOURCE_DIR}/share/fancy.css
|
${CMAKE_SOURCE_DIR}/share/fancy.css
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
BASEDIR=$(dirname $0)
|
BASEDIR=$(dirname $0)
|
||||||
CLOSURE_COMPILER_DIR="$BASEDIR/../3rdparty/closure-compiler"
|
CLOSURE_COMPILER_DIR="$BASEDIR/../3rdparty/closure-compiler"
|
||||||
CLOSURE_COMPILER_JAR="$CLOSURE_COMPILER_DIR/compiler.jar"
|
CLOSURE_COMPILER_JAR="$CLOSURE_COMPILER_DIR/compiler.jar"
|
||||||
EXTERNS="$CLOSURE_COMPILER_DIR/jquery-1.9.js"
|
|
||||||
INPUT="$BASEDIR/pdf2htmlEX.js"
|
INPUT="$BASEDIR/pdf2htmlEX.js"
|
||||||
OUTPUT_FN="pdf2htmlEX.min.js"
|
OUTPUT_FN="pdf2htmlEX.min.js"
|
||||||
OUTPUT="$BASEDIR/$OUTPUT_FN"
|
OUTPUT="$BASEDIR/$OUTPUT_FN"
|
||||||
@ -19,7 +18,6 @@ OUTPUT="$BASEDIR/$OUTPUT_FN"
|
|||||||
--compilation_level ADVANCED_OPTIMIZATIONS \
|
--compilation_level ADVANCED_OPTIMIZATIONS \
|
||||||
--warning_level VERBOSE \
|
--warning_level VERBOSE \
|
||||||
--process_jquery_primitives \
|
--process_jquery_primitives \
|
||||||
--externs "$EXTERNS" \
|
|
||||||
--js "$INPUT" \
|
--js "$INPUT" \
|
||||||
--js_output_file "$OUTPUT" && \
|
--js_output_file "$OUTPUT" && \
|
||||||
echo 'Done.') || \
|
echo 'Done.') || \
|
||||||
|
@ -6,11 +6,6 @@
|
|||||||
* https://github.com/coolwanglu/pdf2htmlEX/blob/master/share/LICENSE
|
* https://github.com/coolwanglu/pdf2htmlEX/blob/master/share/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* Dependencies:
|
|
||||||
* jQuery - use it only when necessary
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Attention:
|
* Attention:
|
||||||
* This files is to be optimized by closure-compiler,
|
* This files is to be optimized by closure-compiler,
|
||||||
@ -239,9 +234,6 @@
|
|||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function Viewer(config) {
|
function Viewer(config) {
|
||||||
/* do nothing if jQuery is not ready */
|
|
||||||
if(!jQuery) return;
|
|
||||||
|
|
||||||
this.config = clone_and_extend_objs(DEFAULT_CONFIG, config);
|
this.config = clone_and_extend_objs(DEFAULT_CONFIG, config);
|
||||||
this.pages_loading = [];
|
this.pages_loading = [];
|
||||||
this.init_before_loading_content();
|
this.init_before_loading_content();
|
||||||
@ -364,48 +356,51 @@
|
|||||||
var _ = this;
|
var _ = this;
|
||||||
var _idx = idx;
|
var _idx = idx;
|
||||||
|
|
||||||
$.ajax({
|
// load data
|
||||||
url: url,
|
{
|
||||||
dataType: 'text'
|
var xhr = new XMLHttpRequest();
|
||||||
}).done(function(data){
|
xhr.open('GET', url, true);
|
||||||
// find the page element in the data
|
xhr.onreadystatechange = function(){
|
||||||
var div = document.createElement('div');
|
if(xhr.readyState != 4) return;
|
||||||
div.innerHTML = data;
|
// Reset loading token
|
||||||
|
delete _.pages_loading[idx];
|
||||||
|
|
||||||
var new_page = null;
|
if(xhr.status == 200) {
|
||||||
var nodes = div.childNodes;
|
// find the page element in the data
|
||||||
for(var i = 0, l = nodes.length; i < l; ++i) {
|
var div = document.createElement('div');
|
||||||
var cur_node = nodes[i];
|
div.innerHTML = xhr.responseText;
|
||||||
if((cur_node.nodeType == Node.ELEMENT_NODE)
|
|
||||||
&& cur_node.classList.contains(CSS_CLASS_NAMES.page_frame)) {
|
var new_page = null;
|
||||||
new_page = cur_node;
|
var nodes = div.childNodes;
|
||||||
break;
|
for(var i = 0, l = nodes.length; i < l; ++i) {
|
||||||
|
var cur_node = nodes[i];
|
||||||
|
if((cur_node.nodeType == Node.ELEMENT_NODE)
|
||||||
|
&& cur_node.classList.contains(CSS_CLASS_NAMES.page_frame)) {
|
||||||
|
new_page = cur_node;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// replace the old page with loaded data
|
||||||
|
// the loading indicator on this page should also be destroyed
|
||||||
|
var p = _.pages[_idx];
|
||||||
|
_.container.replaceChild(new_page, p.p);
|
||||||
|
p = new Page(new_page);
|
||||||
|
_.pages[_idx] = p;
|
||||||
|
|
||||||
|
p.hide();
|
||||||
|
p.rescale(_.scale);
|
||||||
|
|
||||||
|
// disable background image dragging
|
||||||
|
disable_dragstart(new_page.getElementsByClassName(CSS_CLASS_NAMES.background_image));
|
||||||
|
|
||||||
|
_.schedule_render(false);
|
||||||
|
|
||||||
|
if(callback){ callback(p); }
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
xhr.send(null);
|
||||||
// replace the old page with loaded data
|
}
|
||||||
// the loading indicator on this page should also be destroyed
|
|
||||||
var p = _.pages[_idx];
|
|
||||||
_.container.replaceChild(new_page, p.p);
|
|
||||||
p = new Page(new_page);
|
|
||||||
_.pages[_idx] = p;
|
|
||||||
|
|
||||||
p.hide();
|
|
||||||
p.rescale(_.scale);
|
|
||||||
|
|
||||||
// disable background image dragging
|
|
||||||
disable_dragstart(new_page.getElementsByClassName(CSS_CLASS_NAMES.background_image));
|
|
||||||
|
|
||||||
_.schedule_render(false);
|
|
||||||
|
|
||||||
// Reset loading token
|
|
||||||
delete _.pages_loading[idx];
|
|
||||||
|
|
||||||
if(callback){ callback(p); }
|
|
||||||
}).fail(function(jqXHR, textStatus, errorThrown){
|
|
||||||
// Reset loading token
|
|
||||||
delete _.pages_loading[_idx];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
// Concurrent prefetch of the next pages
|
// Concurrent prefetch of the next pages
|
||||||
if (pages_to_preload === undefined)
|
if (pages_to_preload === undefined)
|
||||||
|
Loading…
Reference in New Issue
Block a user