Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
1d1ddcf8
Commit
1d1ddcf8
authored
Apr 06, 2016
by
d11e9
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove logs
parent
a8a879fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
77 deletions
+77
-77
app.js
assets/js/app.js
+77
-77
No files found.
assets/js/app.js
View file @
1d1ddcf8
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
var
files
=
getFiles
();
var
files
=
getFiles
();
for
(
var
x
in
files
)
for
(
var
x
in
files
)
{
sessions
[
files
[
x
]]
=
newEditorSession
(
files
[
x
])
sessions
[
files
[
x
]]
=
newEditorSession
(
files
[
x
])
editor
.
setSession
(
sessions
[
SOL_CACHE_FILE
]
);
editor
.
setSession
(
sessions
[
SOL_CACHE_FILE
]
);
...
@@ -226,24 +226,24 @@
...
@@ -226,24 +226,24 @@
});
});
// ----------------- file selector-------------
// ----------------- file selector-------------
var
$filesEl
=
$
(
'#files'
);
var
$filesEl
=
$
(
'#files'
);
var
FILE_SCROLL_DELTA
=
300
;
var
FILE_SCROLL_DELTA
=
300
;
$
(
'.newFile'
).
on
(
'click'
,
function
()
{
$
(
'.newFile'
).
on
(
'click'
,
function
()
{
while
(
window
.
localStorage
[
SOL_CACHE_UNTITLED
+
untitledCount
])
while
(
window
.
localStorage
[
SOL_CACHE_UNTITLED
+
untitledCount
])
untitledCount
=
(
untitledCount
-
0
)
+
1
;
untitledCount
=
(
untitledCount
-
0
)
+
1
;
SOL_CACHE_FILE
=
SOL_CACHE_UNTITLED
+
untitledCount
;
SOL_CACHE_FILE
=
SOL_CACHE_UNTITLED
+
untitledCount
;
window
.
localStorage
[
SOL_CACHE_FILE
]
=
''
;
window
.
localStorage
[
SOL_CACHE_FILE
]
=
''
;
updateFiles
();
updateFiles
();
$filesEl
.
animate
({
left
:
(
0
-
activeFilePos
()
+
(
FILE_SCROLL_DELTA
/
2
))
+
"px"
},
"slow"
,
function
(){
$filesEl
.
animate
({
left
:
(
0
-
activeFilePos
()
+
(
FILE_SCROLL_DELTA
/
2
))
+
"px"
},
"slow"
,
function
(){
reAdjust
();
reAdjust
();
})
})
});
});
$filesEl
.
on
(
'click'
,
'.file:not(.active)'
,
showFileHandler
);
$filesEl
.
on
(
'click'
,
'.file:not(.active)'
,
showFileHandler
);
$filesEl
.
on
(
'click'
,
'.file.active'
,
function
(
ev
)
{
$filesEl
.
on
(
'click'
,
'.file.active'
,
function
(
ev
)
{
var
$fileTabEl
=
$
(
this
);
var
$fileTabEl
=
$
(
this
);
...
@@ -350,9 +350,9 @@
...
@@ -350,9 +350,9 @@
}
}
$filesWrapper
=
$
(
'.files-wrapper'
);
$filesWrapper
=
$
(
'.files-wrapper'
);
$scrollerRight
=
$
(
'.scroller-right'
);
$scrollerRight
=
$
(
'.scroller-right'
);
$scrollerLeft
=
$
(
'.scroller-left'
);
$scrollerLeft
=
$
(
'.scroller-left'
);
function
widthOfList
(){
function
widthOfList
(){
var
itemsWidth
=
0
;
var
itemsWidth
=
0
;
...
@@ -361,61 +361,61 @@
...
@@ -361,61 +361,61 @@
itemsWidth
+=
itemWidth
;
itemsWidth
+=
itemWidth
;
});
});
return
itemsWidth
;
return
itemsWidth
;
};
};
function
widthOfHidden
(){
function
widthOfHidden
(){
return
((
$filesWrapper
.
outerWidth
())
-
widthOfList
()
-
getLeftPosi
());
return
((
$filesWrapper
.
outerWidth
())
-
widthOfList
()
-
getLeftPosi
());
};
};
function
widthOfVisible
(){
function
widthOfVisible
(){
return
$filesWrapper
.
outerWidth
();
return
$filesWrapper
.
outerWidth
();
};
};
function
getLeftPosi
(){
function
getLeftPosi
(){
return
$filesEl
.
position
().
left
;
return
$filesEl
.
position
().
left
;
};
};
function
activeFilePos
()
{
function
activeFilePos
()
{
var
el
=
$filesEl
.
find
(
'.active'
);
var
el
=
$filesEl
.
find
(
'.active'
);
var
l
=
el
.
position
().
left
;
var
l
=
el
.
position
().
left
;
console
.
log
(
"active file left"
,
l
,
el
)
return
l
;
return
l
;
}
}
function
reAdjust
(){
function
reAdjust
(){
if
(
widthOfList
()
+
getLeftPosi
()
>
+
widthOfVisible
())
{
if
(
widthOfList
()
+
getLeftPosi
()
>
+
widthOfVisible
())
{
$scrollerRight
.
fadeIn
(
'fast'
);
$scrollerRight
.
fadeIn
(
'fast'
);
}
else
{
}
else
{
$scrollerRight
.
fadeOut
(
'fast'
);
$scrollerRight
.
fadeOut
(
'fast'
);
}
}
if
(
getLeftPosi
()
<
0
)
{
if
(
getLeftPosi
()
<
0
)
{
$scrollerLeft
.
fadeIn
(
'fast'
);
$scrollerLeft
.
fadeIn
(
'fast'
);
}
else
{
}
else
{
$scrollerLeft
.
fadeOut
(
'fast'
);
$
scrollerLeft
.
fadeOut
(
'fast'
);
$
filesEl
.
animate
({
left
:
getLeftPosi
()
+
"px"
},
'slow'
);
$filesEl
.
animate
({
left
:
getLeftPosi
()
+
"px"
},
'slow'
);
}
}
}
}
$scrollerRight
.
click
(
function
()
{
$scrollerRight
.
click
(
function
()
{
var
delta
=
(
getLeftPosi
()
-
FILE_SCROLL_DELTA
)
var
delta
=
(
getLeftPosi
()
-
FILE_SCROLL_DELTA
)
$filesEl
.
animate
({
left
:
delta
+
"px"
},
'slow'
,
function
(){
$filesEl
.
animate
({
left
:
delta
+
"px"
},
'slow'
,
function
(){
reAdjust
();
reAdjust
();
});
});
});
});
$scrollerLeft
.
click
(
function
()
{
$scrollerLeft
.
click
(
function
()
{
var
delta
=
Math
.
min
(
(
getLeftPosi
()
+
FILE_SCROLL_DELTA
),
0
)
var
delta
=
Math
.
min
(
(
getLeftPosi
()
+
FILE_SCROLL_DELTA
),
0
)
$filesEl
.
animate
({
left
:
delta
+
"px"
},
'slow'
,
function
(){
$filesEl
.
animate
({
left
:
delta
+
"px"
},
'slow'
,
function
(){
reAdjust
();
reAdjust
();
});
});
});
});
updateFiles
();
updateFiles
();
// ----------------- version selector-------------
// ----------------- version selector-------------
// var soljsonSources is provided by bin/list.js
// var soljsonSources is provided by bin/list.js
$
(
'option'
,
'#versionSelector'
).
remove
();
$
(
'option'
,
'#versionSelector'
).
remove
();
$
.
each
(
soljsonSources
,
function
(
i
,
file
)
{
$
.
each
(
soljsonSources
,
function
(
i
,
file
)
{
if
(
file
)
{
if
(
file
)
{
...
...
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