Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matefun
Frontend
Commits
2df07227
Commit
2df07227
authored
Nov 12, 2017
by
Gonzalo Fabian Cameto Hernandez
Browse files
Elimino carpeta functions no utilizada
parent
7f27693c
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Frontend Angular 4/src/app/layout/functions/function.services.result.ts
deleted
100644 → 0
View file @
7f27693c
export
class
FunctionServicesResult
{
code
:
number
;
msg
:
string
;
}
\ No newline at end of file
Frontend Angular 4/src/app/layout/functions/function.ts
deleted
100644 → 0
View file @
7f27693c
export
class
Function
{
id
:
number
;
name
:
string
;
str
:
string
;
}
\ No newline at end of file
Frontend Angular 4/src/app/layout/functions/functions.component.html
deleted
100644 → 0
View file @
7f27693c
<div
class=
"panel panel-success"
>
<div
class=
"card"
>
<h4
class=
"card-header"
>
Mis funciones
</h4>
<div
class=
"card-block"
>
<ul
class=
"list-group list-group-flush"
>
<li
*ngFor=
"let f of _funcs"
class=
"list-group-item"
>
<div
class=
"card-block"
>
<div
class=
"checkbox"
>
<label
for=
"checkbox"
>
{{f.str}}
</label>
</div>
<div
class=
"pull-right action-buttons"
>
<button
(click)=
"modifyFunc(f.name)"
class=
"btn btn-success"
>
<i
class=
"fa fa-pencil"
></i>
</button>
<button
(click)=
"removeFunc(f.name)"
class=
"btn btn-success"
>
<i
class=
"fa fa-remove"
></i>
</button>
</div>
</div>
</li>
</ul>
</div>
</div>
<div
class=
"panel-footer"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"input-group input-group"
>
<input
[(ngModel)]=
"_newFunction.str"
placeholder=
"nueva función"
class=
"form-control"
>
<span
class=
"input-group-btn"
>
<button
class=
"btn btn-primary"
[disabled]=
"this._newFunction.str==''"
type=
"button"
(click)=
"handleAddFunction()"
>
Cargar función
</button>
</span>
</div>
</div>
</div>
<!-- <button (click)="popToast()">pop toast</button> -->
</div>
</div>
Frontend Angular 4/src/app/layout/functions/functions.component.ts
deleted
100644 → 0
View file @
7f27693c
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Function
}
from
'
./function
'
;
import
{
FunctionServices
}
from
'
./functions.service
'
;
import
{
FunctionServicesResult
}
from
'
./function.services.result
'
;
//import {ToasterModule, ToasterService,ToasterConfig} from 'angular2-toaster';
@
Component
({
selector
:
'
functions
'
,
templateUrl
:
'
./functions.component.html
'
,
styleUrls
:
[
'
./functions.css
'
],
providers
:
[]
})
export
class
FunctionsComponent
implements
OnInit
{
title
=
'
Módulo de funciones
'
;
_funcs
:
Function
[];
_newFunction
:
Function
=
{
'
id
'
:
2
,
'
name
'
:
'
g
'
,
'
str
'
:
'
g(x)=x+41
'
};
//_toasterService: ToasterService;
//
constructor
(
private
functionServices
:
FunctionServices
)
{
// this._toasterService = toasterService;
}
getFuncs
():
void
{
this
.
functionServices
.
getAll
().
then
(
result
=>
this
.
_funcs
=
result
);
}
removeFunc
(
name
:
string
):
void
{
this
.
functionServices
.
delete
(
name
);
this
.
getFuncs
();
}
modifyFunc
(
name
:
string
):
void
{
var
f
=
this
.
functionServices
.
get
(
name
);
console
.
log
(
f
);
this
.
_newFunction
=
f
;
}
ngOnInit
():
void
{
this
.
getFuncs
();
}
handleAddFunction
():
void
{
if
(
this
.
_newFunction
.
str
.
length
>
4
){
this
.
_newFunction
.
id
=
1
;
}
var
_f
:
Function
=
{
'
id
'
:
this
.
_newFunction
.
id
,
'
name
'
:
this
.
_newFunction
.
str
.
split
(
'
(
'
)[
0
],
'
str
'
:
this
.
_newFunction
.
str
};
var
response
=
this
.
functionServices
.
add
(
_f
);
this
.
_newFunction
.
id
=
0
;
this
.
_newFunction
.
name
=
''
;
this
.
_newFunction
.
str
=
''
;
}
}
Frontend Angular 4/src/app/layout/functions/functions.css
deleted
100644 → 0
View file @
7f27693c
.trash
{
color
:
rgb
(
209
,
91
,
71
);
}
.flag
{
color
:
rgb
(
248
,
148
,
6
);
}
.panel-body
{
padding
:
0px
;
}
.panel-footer
.pagination
{
margin
:
0
;
}
.panel
.glyphicon
,
.list-group-item
.glyphicon
{
margin-right
:
5px
;
}
.panel-body
.radio
,
.checkbox
{
display
:
inline-block
;
margin
:
0px
;
}
.panel-body
input
[
type
=
checkbox
]
:checked
+
label
{
text-decoration
:
line-through
;
color
:
rgb
(
128
,
144
,
160
);
}
.list-group-item
:hover
,
a
.list-group-item
:focus
{
text-decoration
:
none
;
background-color
:
rgb
(
245
,
245
,
245
);}
.list-group
{
margin-bottom
:
0px
;
}
\ No newline at end of file
Frontend Angular 4/src/app/layout/functions/functions.module.ts
deleted
100644 → 0
View file @
7f27693c
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
FormsModule
}
from
'
@angular/forms
'
;
import
{
FunctionsComponent
}
from
'
./functions.component
'
;
//import {ToasterModule, ToasterService} from 'angular2-toaster';
@
NgModule
({
imports
:
[
CommonModule
,
FormsModule
//,ToasterModule
],
declarations
:
[
FunctionsComponent
],
exports
:[
FunctionsComponent
]
})
export
class
FunctionsModule
{
}
Frontend Angular 4/src/app/layout/functions/functions.routes.ts
deleted
100644 → 0
View file @
7f27693c
import
{
Route
}
from
'
@angular/router
'
;
import
{
FunctionsComponent
}
from
'
./index
'
;
export
const
FunctionsRoutes
:
Route
[]
=
[
{
path
:
'
functions
'
,
component
:
FunctionsComponent
}
];
Frontend Angular 4/src/app/layout/functions/functions.service.ts
deleted
100644 → 0
View file @
7f27693c
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Function
}
from
'
./function
'
;
import
{
FunctionServicesResult
}
from
'
./function.services.result
'
;
const
regex
=
/^
\w
+
\(((\w
+
(\s)
*
)?
|
((\w
+
(\s)
*
)
,
(\s)
*
)
*
(\w
+
(\s)
*
))\)(\s)
*=
(\s)
*$/g
;
@
Injectable
()
export
class
FunctionServices
{
getAll
():
Promise
<
Function
[]
>
{
return
Promise
.
resolve
(
this
.
allfunctions
);
};
delete
(
functionName
:
String
):
void
{
console
.
log
(
"
deleting
"
+
functionName
);
this
.
allfunctions
=
this
.
allfunctions
.
filter
(
function
(
f
){
return
f
.
name
!=
functionName
});
};
add
(
f
:
Function
):
FunctionServicesResult
{
console
.
log
(
f
);
if
(
f
.
id
!=
0
){
this
.
allfunctions
.
push
(
f
);
var
result
:
FunctionServicesResult
=
{
'
code
'
:
200
,
'
msg
'
:
''
};
}
else
{
var
result
:
FunctionServicesResult
=
{
'
code
'
:
500
,
'
msg
'
:
'
Función no válida
'
};
}
return
result
;
};
get
(
name
:
string
){
try
{
return
this
.
allfunctions
.
filter
(
function
(
f
){
return
f
.
name
===
name
})[
0
];
}
catch
(
err
){
return
null
;
}
};
getToPlot
(
name
:
string
){
console
.
log
(
"
Functions:
"
);
console
.
log
(
this
.
allfunctions
);
try
{
return
this
.
allfunctions
.
filter
(
function
(
f
){
return
f
.
name
===
name
})[
0
].
str
.
split
(
"
=
"
)[
1
];
}
catch
(
err
){
return
null
;
}
};
private
allfunctions
:
Function
[]
=
[{
'
id
'
:
12
,
'
name
'
:
'
f
'
,
'
str
'
:
'
f(x)=x+5
'
}];
}
\ No newline at end of file
Frontend Angular 4/src/app/layout/functions/index.ts
deleted
100644 → 0
View file @
7f27693c
/**
* This barrel file provides the export for the lazy loaded BlankpageComponent.
*/
export
*
from
'
./functions.component
'
;
export
*
from
'
./functions.routes
'
;
Frontend Angular 4/src/app/layout/matefun/matefun.component.ts
View file @
2df07227
This diff is collapsed.
Click to expand it.
Frontend Angular 4/src/app/layout/matefun/matefun.module.ts
View file @
2df07227
...
...
@@ -2,7 +2,6 @@ import { NgModule } from '@angular/core';
import
{
FormsModule
}
from
'
@angular/forms
'
;
import
{
CanvasModule
}
from
'
../canvas/canvas.module
'
import
{
MateFunComponent
}
from
'
./matefun.component
'
;
import
{
FunctionsModule
}
from
'
../functions/functions.module
'
import
{
BootstrapModalModule
}
from
'
ng2-bootstrap-modal
'
;
import
{
ConfirmComponent
}
from
'
./confirm.component
'
;
import
{
SeleccionarDirectorioComp
}
from
'
./seleccionarDirectorio.component
'
;
...
...
@@ -17,7 +16,6 @@ import { NotificacionModule } from '../../notificacion/notificacion.module';
FormsModule
,
CanvasModule
,
NotificacionModule
,
FunctionsModule
,
MateFunRoutingModule
,
CodemirrorModule
,
NgbModule
,
...
...
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