Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
0e8dacc7
Commit
0e8dacc7
authored
Nov 01, 2016
by
Mushtaq Ali
Committed by
Mushtaq Ali
Nov 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "format xml before displaying"
parent
6c37e282
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
133 deletions
+5
-133
cms/djangoapps/pipeline_js/templates/xmodule.js
+3
-2
cms/static/cms/js/require-config.js
+0
-1
common/lib/xmodule/xmodule/js/karma_xmodule.conf.js
+1
-2
common/static/js/lib/pretty-print.js
+0
-106
common/static/js/spec/pretty_print_xml_spec.js
+0
-20
common/static/karma_common.conf.js
+0
-1
lms/static/karma_lms_coffee.conf.js
+1
-1
No files found.
cms/djangoapps/pipeline_js/templates/xmodule.js
View file @
0e8dacc7
...
...
@@ -6,8 +6,9 @@
##
and
attach
them
to
the
global
context
manually
.
define
([
"jquery"
,
"underscore"
,
"codemirror"
,
"tinymce"
,
"jquery.tinymce"
,
"jquery.qtip"
,
"jquery.scrollTo"
,
"jquery.flot"
,
"jquery.cookie"
,
"pretty-print"
,
"utility"
],
function
(
$
,
_
,
CodeMirror
)
{
"jquery.cookie"
,
"utility"
],
function
(
$
,
_
,
CodeMirror
,
tinymce
)
{
window
.
$
=
$
;
window
.
_
=
_
;
require
([
'mathjax'
]);
...
...
cms/static/cms/js/require-config.js
View file @
0e8dacc7
...
...
@@ -28,7 +28,6 @@
'mustache'
:
'js/vendor/mustache'
,
'codemirror'
:
'js/vendor/codemirror-compressed'
,
'codemirror/stex'
:
'js/vendor/CodeMirror/stex'
,
'pretty-print'
:
'js/lib/pretty-print'
,
'jquery'
:
'common/js/vendor/jquery'
,
'jquery-migrate'
:
'common/js/vendor/jquery-migrate'
,
'jquery.ui'
:
'js/vendor/jquery-ui.min'
,
...
...
common/lib/xmodule/xmodule/js/karma_xmodule.conf.js
View file @
0e8dacc7
...
...
@@ -21,8 +21,7 @@ var options = {
{
pattern
:
'common_static/coffee/src/ajax_prefix.js'
,
included
:
true
},
{
pattern
:
'common_static/common/js/vendor/underscore.js'
,
included
:
true
},
{
pattern
:
'common_static/common/js/vendor/backbone.js'
,
included
:
true
},
{
pattern
:
'common_static/js/vendor/codemirror-compressed.js'
,
included
:
true
},
{
pattern
:
'common_static/js/lib/pretty-print.js'
,
included
:
true
},
{
pattern
:
'common_static/js/vendor/CodeMirror/codemirror.js'
,
included
:
true
},
{
pattern
:
'common_static/js/vendor/draggabilly.js'
},
{
pattern
:
'common_static/common/js/vendor/jquery.js'
,
included
:
true
},
{
pattern
:
'common_static/common/js/vendor/jquery-migrate.js'
,
included
:
true
},
...
...
common/static/js/lib/pretty-print.js
deleted
100644 → 0
View file @
6c37e282
/**
* pretty-data - nodejs plugin to pretty-print or minify data in XML, JSON and CSS formats.
*
* Version - 0.40.0
* Copyright (c) 2012 Vadim Kiryukhin
* vkiryukhin @ gmail.com
* http://www.eslinstructor.net/pretty-data/
*
*
* Code extracted for xml formatting only
*/
/* eslint-disable */
(
function
(
root
,
factory
){
if
(
typeof
define
===
'function'
&&
define
.
amd
)
{
// AMD. Register as an anonymous module.
define
([],
function
(){
return
(
root
.
PrettyPrint
=
factory
());
});
}
else
{
// Browser globals
root
.
PrettyPrint
=
factory
();
}
}(
this
,
function
()
{
function
PrettyPrint
(){
var
maxdeep
=
100
,
// nesting level
ix
=
0
;
this
.
shift
=
[
'
\
n'
];
// array of shifts
this
.
step
=
' '
;
// 2 spaces
// initialize array with shifts //
for
(
ix
=
0
;
ix
<
maxdeep
;
ix
++
)
{
this
.
shift
.
push
(
this
.
shift
[
ix
]
+
this
.
step
);
}
}
PrettyPrint
.
prototype
.
xml
=
function
(
text
)
{
var
ar
=
text
.
replace
(
/>
\s{0,}
</g
,
"><"
)
.
replace
(
/</g
,
"~::~<"
)
.
replace
(
/xmlns
\:
/g
,
"~::~xmlns:"
)
.
replace
(
/xmlns
\=
/g
,
"~::~xmlns="
)
.
split
(
'~::~'
),
len
=
ar
.
length
,
inComment
=
false
,
deep
=
0
,
str
=
''
,
ix
=
0
;
for
(
ix
=
0
;
ix
<
len
;
ix
++
)
{
// start comment or <![CDATA[...]]> or <!DOCTYPE //
if
(
ar
[
ix
].
search
(
/<!/
)
>
-
1
)
{
str
+=
this
.
shift
[
deep
]
+
ar
[
ix
];
inComment
=
true
;
// end comment or <![CDATA[...]]> //
if
(
ar
[
ix
].
search
(
/-->/
)
>
-
1
||
ar
[
ix
].
search
(
/
\]
>/
)
>
-
1
||
ar
[
ix
].
search
(
/!DOCTYPE/
)
>
-
1
)
{
inComment
=
false
;
}
}
else
// end comment or <![CDATA[...]]> //
if
(
ar
[
ix
].
search
(
/-->/
)
>
-
1
||
ar
[
ix
].
search
(
/
\]
>/
)
>
-
1
)
{
str
+=
ar
[
ix
];
inComment
=
false
;
}
else
// <elm></elm> //
if
(
/^<
\w
/
.
exec
(
ar
[
ix
-
1
])
&&
/^<
\/\w
/
.
exec
(
ar
[
ix
])
&&
/^<
[\w
:
\-\.\,]
+/
.
exec
(
ar
[
ix
-
1
])
==
/^<
\/[\w
:
\-\.\,]
+/
.
exec
(
ar
[
ix
])[
0
].
replace
(
'/'
,
''
))
{
str
+=
ar
[
ix
];
if
(
!
inComment
)
deep
--
;
}
else
// <elm> //
if
(
ar
[
ix
].
search
(
/<
\w
/
)
>
-
1
&&
ar
[
ix
].
search
(
/<
\/
/
)
==
-
1
&&
ar
[
ix
].
search
(
/
\/
>/
)
==
-
1
)
{
str
=
!
inComment
?
str
+=
this
.
shift
[
deep
++
]
+
ar
[
ix
]
:
str
+=
ar
[
ix
];
}
else
// <elm>...</elm> //
if
(
ar
[
ix
].
search
(
/<
\w
/
)
>
-
1
&&
ar
[
ix
].
search
(
/<
\/
/
)
>
-
1
)
{
str
=
!
inComment
?
str
+=
this
.
shift
[
deep
]
+
ar
[
ix
]
:
str
+=
ar
[
ix
];
}
else
// </elm> //
if
(
ar
[
ix
].
search
(
/<
\/
/
)
>
-
1
)
{
str
=
!
inComment
?
str
+=
this
.
shift
[
--
deep
]
+
ar
[
ix
]
:
str
+=
ar
[
ix
];
}
else
// <elm/> //
if
(
ar
[
ix
].
search
(
/
\/
>/
)
>
-
1
)
{
str
=
!
inComment
?
str
+=
this
.
shift
[
deep
]
+
ar
[
ix
]
:
str
+=
ar
[
ix
];
}
else
// <? xml ... ?> //
if
(
ar
[
ix
].
search
(
/<
\?
/
)
>
-
1
)
{
str
+=
this
.
shift
[
deep
]
+
ar
[
ix
];
}
else
// xmlns //
if
(
ar
[
ix
].
search
(
/xmlns
\:
/
)
>
-
1
||
ar
[
ix
].
search
(
/xmlns
\=
/
)
>
-
1
)
{
str
+=
this
.
shift
[
deep
]
+
ar
[
ix
];
}
else
{
str
+=
ar
[
ix
];
}
}
return
(
str
[
0
]
==
'
\
n'
)
?
str
.
slice
(
1
)
:
str
;
};
return
new
PrettyPrint
();
}));
common/static/js/spec/pretty_print_xml_spec.js
deleted
100644 → 0
View file @
6c37e282
describe
(
'XML Formatting Lib'
,
function
()
{
'use strict'
;
it
(
'correctly format the xml'
,
function
()
{
var
rawXml
=
'<breakfast><food><name>Belgian Waffles</name><price>$5.95</price></food></breakfast>'
,
expectedXml
=
'<breakfast>
\
n <food>
\
n <name>Belgian Waffles</name>'
+
'
\
n <price>$5.95</price>
\
n </food>
\
n</breakfast>'
;
expect
(
window
.
PrettyPrint
.
xml
(
rawXml
)).
toEqual
(
expectedXml
);
});
it
(
'correctly handles the whitespaces and newlines'
,
function
()
{
var
rawXml
=
'<breakfast> <food> <name>Belgian Waffles</name>'
+
'
\
n
\
n
\
n<price>$5.95</price></food> </breakfast>'
,
expectedXml
=
'<breakfast>
\
n <food>
\
n <name>Belgian Waffles</name>'
+
'
\
n <price>$5.95</price>
\
n </food>
\
n</breakfast>'
;
expect
(
window
.
PrettyPrint
.
xml
(
rawXml
)).
toEqual
(
expectedXml
);
});
});
common/static/karma_common.conf.js
View file @
0e8dacc7
...
...
@@ -28,7 +28,6 @@ var options = {
{
pattern
:
'js/vendor/URI.min.js'
,
included
:
true
},
{
pattern
:
'js/test/add_ajax_prefix.js'
,
included
:
true
},
{
pattern
:
'js/test/i18n.js'
,
included
:
true
},
{
pattern
:
'js/lib/pretty-print.js'
,
included
:
true
},
{
pattern
:
'common/js/vendor/underscore.js'
,
included
:
true
},
{
pattern
:
'common/js/vendor/underscore.string.js'
,
included
:
true
},
...
...
lms/static/karma_lms_coffee.conf.js
View file @
0e8dacc7
...
...
@@ -31,7 +31,7 @@ var options = {
{
pattern
:
'common/js/xblock/*.js'
,
included
:
true
},
{
pattern
:
'xmodule_js/common_static/js/src/logger.js'
,
included
:
true
},
{
pattern
:
'xmodule_js/common_static/js/test/i18n.js'
,
included
:
true
},
{
pattern
:
'xmodule_js/common_static/js/vendor/
codemirror-compressed
.js'
,
included
:
true
},
{
pattern
:
'xmodule_js/common_static/js/vendor/
CodeMirror/codemirror
.js'
,
included
:
true
},
{
pattern
:
'xmodule_js/common_static/js/vendor/jquery.cookie.js'
,
included
:
true
},
{
pattern
:
'xmodule_js/common_static/js/vendor/flot/jquery.flot.js'
,
included
:
true
},
{
pattern
:
'xmodule_js/common_static/coffee/src/jquery.immediateDescendents.js'
,
included
:
true
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment