Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
711ec228
Commit
711ec228
authored
Nov 25, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beautify HTML ans javascript.
parent
cc4b1072
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
20 deletions
+27
-20
dream/platform/static/index.html
dream/platform/static/index.html
+6
-2
dream/platform/static/src/dream_launcher.js
dream/platform/static/src/dream_launcher.js
+15
-12
dream/platform/static/src/jsonPlumb.js
dream/platform/static/src/jsonPlumb.js
+6
-6
No files found.
dream/platform/static/index.html
View file @
711ec228
...
...
@@ -27,9 +27,13 @@
<a
id=
"zoom_in"
>
Zoom +
</a>
<a
id=
"zoom_out"
>
Zoom -
</a>
<a
id=
"export"
>
Export
</a>
<form
id=
"export_form"
style=
"display:none"
method=
"post"
action=
"/postJSONData"
><textarea
id=
"export_json"
name=
"data"
></textarea></form>
<form
id=
"export_form"
style=
"display:none"
method=
"post"
action=
"/postJSONData"
>
<textarea
id=
"export_json"
name=
"data"
></textarea>
</form>
<a
id=
"import"
>
Import
</a>
<form
id=
"import_form"
style=
"display:none"
><input
id=
"import_file"
name=
"file"
type=
"file"
></input></form>
<form
id=
"import_form"
style=
"display:none"
>
<input
id=
"import_file"
name=
"file"
type=
"file"
></input>
</form>
</div>
</div>
...
...
dream/platform/static/src/dream_launcher.js
View file @
711ec228
...
...
@@ -247,7 +247,7 @@
box_left
,
box_top
);
// find an unused ID
var
n
=
1
;
while
(
$
(
'
#
'
+
tool
.
target
.
id
+
'
_
'
+
n
).
length
>
0
)
{
while
(
$
(
'
#
'
+
tool
.
target
.
id
+
'
_
'
+
n
).
length
>
0
)
{
n
+=
1
;
}
_class
=
tool
.
target
.
id
.
replace
(
'
-
'
,
'
.
'
);
// XXX - vs .
...
...
@@ -262,7 +262,7 @@
}
});
var
loadData
=
function
(
data
)
{
var
loadData
=
function
(
data
)
{
var
preference
=
data
.
preference
!==
undefined
?
data
.
preference
:
{};
dream_instance
.
setPreferences
(
preference
);
...
...
@@ -271,7 +271,10 @@
var
coordinates
=
preference
[
'
coordinates
'
];
$
.
each
(
data
.
nodes
,
function
(
key
,
value
)
{
if
(
coordinates
===
undefined
||
coordinates
[
key
]
===
undefined
)
{
value
[
'
coordinate
'
]
=
{
'
top
'
:
0.0
,
'
left
'
:
0.0
};
value
[
'
coordinate
'
]
=
{
'
top
'
:
0.0
,
'
left
'
:
0.0
};
}
else
{
value
[
'
coordinate
'
]
=
coordinates
[
key
];
}
...
...
@@ -367,8 +370,8 @@
otherwise we have a mapping avg, min max */
if
(
obj
.
results
.
blockage_ratio
!==
undefined
)
{
blockage_data
.
push
([
counter
,
obj
.
results
.
blockage_ratio
.
avg
||
obj
.
results
.
blockage_ratio
]);
.
avg
||
obj
.
results
.
blockage_ratio
]);
}
else
{
blockage_data
.
push
([
counter
,
0.0
]);
}
...
...
@@ -377,8 +380,8 @@
]);
if
(
obj
.
results
.
failure_ratio
!==
undefined
)
{
failure_data
.
push
([
counter
,
obj
.
results
.
failure_ratio
.
avg
||
obj
.
results
.
failure_ratio
]);
.
avg
||
obj
.
results
.
failure_ratio
]);
}
else
{
failure_data
.
push
([
counter
,
0.0
]);
}
...
...
@@ -471,7 +474,7 @@
function
(
e
)
{
$
(
'
#import_file
'
).
click
();
});
$
(
"
#import_file
"
).
change
(
function
()
{
$
(
"
#import_file
"
).
change
(
function
()
{
var
form
=
$
(
this
).
parent
(
'
form
'
)[
0
];
var
form_data
=
new
FormData
(
form
);
$
.
ajax
(
'
/postJSONFile
'
,
{
...
...
@@ -480,10 +483,10 @@
processData
:
false
,
data
:
form_data
,
dataType
:
'
json
'
,
error
:
function
()
{
console
.
log
(
'
error
'
);
error
:
function
()
{
console
.
log
(
'
error
'
);
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
form
.
reset
();
dream_instance
.
clearAll
();
$
(
"
#json_output
"
).
val
(
JSON
.
stringify
(
data
));
...
...
@@ -507,7 +510,7 @@
loadData
(
JSON
.
parse
(
$
(
"
#json_output
"
).
val
()));
});
$
(
"
#graph_zone
"
).
hide
();
$
(
"
#graph_zone
"
).
hide
();
});
})(
jQuery
);
dream/platform/static/src/jsonPlumb.js
View file @
711ec228
...
...
@@ -89,8 +89,7 @@
}
else
{
priv
.
edge_container
[
connection
.
id
]
=
[
connection
.
sourceId
,
connection
.
targetId
,
{}
connection
.
targetId
,
{}
];
}
priv
.
onDataChange
();
...
...
@@ -137,7 +136,7 @@
}
};
priv
.
convertToAbsolutePosition
=
function
(
x
,
y
)
{
priv
.
convertToAbsolutePosition
=
function
(
x
,
y
)
{
var
canvas_size_x
=
$
(
'
#main
'
).
width
();
var
canvas_size_y
=
$
(
'
#main
'
).
height
();
var
node_style
=
priv
.
preference_container
[
'
node_style
'
];
...
...
@@ -154,7 +153,7 @@
return
[
left
,
top
];
};
that
.
convertToRelativePosition
=
function
(
x
,
y
)
{
that
.
convertToRelativePosition
=
function
(
x
,
y
)
{
var
canvas_size_x
=
$
(
'
#main
'
).
width
();
var
canvas_size_y
=
$
(
'
#main
'
).
height
();
var
size_x
=
$
(
'
.window
'
).
width
();
...
...
@@ -199,7 +198,8 @@
};
priv
.
style_attr_list
=
[
'
width
'
,
'
height
'
,
'
font-size
'
,
'
padding-top
'
,
'
line-height
'
];
'
line-height
'
];
that
.
positionGraph
=
function
()
{
$
.
ajax
(
...
...
@@ -264,7 +264,7 @@
"
general
"
:
priv
.
general_container
};
if
(
$
.
sheet
.
instance
!==
undefined
)
{
data
[
'
spreadsheet
'
]
=
$
.
sheet
.
instance
[
0
].
exportSheet
.
json
();
data
[
'
spreadsheet
'
]
=
$
.
sheet
.
instance
[
0
].
exportSheet
.
json
();
}
return
data
;
};
...
...
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