Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
8c58d494
Commit
8c58d494
authored
Jun 16, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set a variable file instead of calling every time jquery
parent
f3136070
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+16
-14
No files found.
debomatic-webui/public/javascripts/page_distribution.js
View file @
8c58d494
...
@@ -323,27 +323,28 @@ function Page_Distrubion(socket) {
...
@@ -323,27 +323,28 @@ function Page_Distrubion(socket) {
var
file
=
{
var
file
=
{
set
:
function
(
socket_data
)
{
set
:
function
(
socket_data
)
{
var
file
=
$
(
'
#file pre
'
);
view
.
file
=
Utils
.
clone
(
socket_data
.
file
);
view
.
file
=
Utils
.
clone
(
socket_data
.
file
);
$
(
'
#file pre
'
)
.
text
(
socket_data
.
file
.
content
);
file
.
text
(
socket_data
.
file
.
content
);
$
(
'
#file
'
)
.
show
();
file
.
show
();
if
(
current_file_in_preview
)
if
(
current_file_in_preview
)
$
(
'
#file pre
'
).
scrollTop
(
$
(
'
#file pre
'
)
[
0
].
scrollHeight
);
file
.
scrollTop
(
file
[
0
].
scrollHeight
);
},
},
clean
:
function
()
{
clean
:
function
()
{
$
(
'
#file pre
'
).
html
(
''
);
$
(
'
#file pre
'
).
html
(
''
);
$
(
'
#file
'
).
hide
();
$
(
'
#file
'
).
hide
();
},
},
append
:
function
(
new_content
)
{
append
:
function
(
new_content
)
{
var
content
=
$
(
'
#file pre
'
);
var
file
=
$
(
'
#file pre
'
);
if
(
!
current_file_in_preview
)
{
if
(
!
current_file_in_preview
)
{
content
.
append
(
new_content
);
file
.
append
(
new_content
);
}
else
{
}
else
{
// always show only config.file.num_lines lines in preview
// always show only config.file.num_lines lines in preview
content
=
content
.
html
().
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
);
var
content
=
content
.
html
().
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
);
content
=
content
.
concat
(
new_content
.
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
));
content
=
content
.
concat
(
new_content
.
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
));
content
=
content
.
slice
(
-
config
.
file
.
num_lines
).
join
(
'
\n
'
);
content
=
content
.
slice
(
-
config
.
file
.
num_lines
).
join
(
'
\n
'
);
$
(
'
#file pre
'
)
.
html
(
content
);
file
.
html
(
content
);
$
(
'
#file pre
'
).
scrollTop
(
$
(
'
#file pre
'
)
[
0
].
scrollHeight
);
file
.
scrollTop
(
file
[
0
].
scrollHeight
);
}
}
if
(
config
.
preferences
.
autoscroll
)
{
if
(
config
.
preferences
.
autoscroll
)
{
...
@@ -384,16 +385,17 @@ function Page_Distrubion(socket) {
...
@@ -384,16 +385,17 @@ function Page_Distrubion(socket) {
}
}
debug
(
2
,
"
file set preview
"
,
preview
);
debug
(
2
,
"
file set preview
"
,
preview
);
current_file_in_preview
=
preview
;
current_file_in_preview
=
preview
;
var
file
=
$
(
'
#file pre
'
);
if
(
preview
)
{
if
(
preview
)
{
$
(
'
#file pre
'
).
addClass
(
'
preview
'
);
$
(
'
#file pre
'
).
addClass
(
'
preview
'
);
var
height
=
(
config
.
file
.
num_lines
)
*
var
height
=
(
config
.
file
.
num_lines
)
*
parseInt
(
$
(
'
#file pre
'
)
.
css
(
'
line-height
'
).
replace
(
/
[^
-
\d\.]
/g
,
''
))
+
parseInt
(
file
.
css
(
'
line-height
'
).
replace
(
/
[^
-
\d\.]
/g
,
''
))
+
parseInt
(
$
(
'
#file pre
'
)
.
css
(
'
padding-top
'
).
replace
(
/
[^
-
\d\.]
/g
,
''
))
+
parseInt
(
file
.
css
(
'
padding-top
'
).
replace
(
/
[^
-
\d\.]
/g
,
''
))
+
parseInt
(
$
(
'
#file pre
'
)
.
css
(
'
padding-bottom
'
).
replace
(
/
[^
-
\d\.]
/g
,
''
));
parseInt
(
file
.
css
(
'
padding-bottom
'
).
replace
(
/
[^
-
\d\.]
/g
,
''
));
$
(
'
#file pre
'
)
.
css
(
'
max-height
'
,
height
);
file
.
css
(
'
max-height
'
,
height
);
}
else
{
}
else
{
$
(
'
#file pre
'
)
.
removeClass
(
'
preview
'
);
file
.
removeClass
(
'
preview
'
);
$
(
'
#file pre
'
)
.
css
(
'
max-height
'
,
'
auto
'
);
file
.
css
(
'
max-height
'
,
'
auto
'
);
}
}
}
}
...
...
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