Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
360c83bf
Commit
360c83bf
authored
Dec 23, 2013
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added _getCommand&&getQuery
parent
8b8945db
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
27 deletions
+43
-27
.jshintrc
.jshintrc
+1
-1
configure.js
src/core/configure.js
+3
-0
minder.command.js
src/core/minder.command.js
+24
-23
minder.module.js
src/core/minder.module.js
+13
-2
minder.node.js
src/core/minder.node.js
+2
-1
No files found.
.jshintrc
View file @
360c83bf
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
"kity",
"kity",
"MinderNode",
"MinderNode",
"MinderEvent",
"MinderEvent",
"
Kity
Minder",
"Minder",
"require",
"require",
"km",
"km",
"console",
"console",
...
...
src/core/configure.js
0 → 100644
View file @
360c83bf
var
KITYMINDER_CONFIG
=
window
.
KITYMINDER_CONFIG
=
{
};
\ No newline at end of file
src/core/minder.command.js
View file @
360c83bf
kity
.
extendClass
(
Minder
,
{
kity
.
extendClass
(
Minder
,
{
_getCommand
:
function
(
name
)
{
return
this
.
_commands
[
name
.
toLowerCase
()
];
},
_getQuery
:
function
(
name
)
{
if
(
!
this
.
_query
[
name
]
)
{
var
Cmd
=
this
.
_getCommand
(
name
);
this
.
_query
[
name
]
=
new
Cmd
();
}
return
this
.
_query
[
name
];
},
_queryCommand
:
function
(
name
,
type
)
{
var
me
=
this
;
var
query
=
this
.
_getQuery
(
name
);
var
queryFunc
=
query
[
name
][
"state"
+
type
];
if
(
queryFunc
)
{
return
queryFunc
(
me
);
}
else
{
return
0
;
}
},
execCommand
:
function
(
name
)
{
execCommand
:
function
(
name
)
{
var
me
=
this
;
var
me
=
this
;
var
_commands
=
this
.
_commands
;
var
_action
=
new
_commands
[
name
.
toLowerCase
()
]();
var
_action
=
new
_commands
[
name
.
toLowerCase
()
]();
var
cmdArgs
=
Array
.
prototype
.
slice
.
call
(
arguments
,
1
);
var
cmdArgs
=
Array
.
prototype
.
slice
.
call
(
arguments
,
1
);
...
@@ -27,35 +48,15 @@ kity.extendClass( Minder, {
...
@@ -27,35 +48,15 @@ kity.extendClass( Minder, {
if
(
_action
.
isSelectionChanged
()
)
{
if
(
_action
.
isSelectionChanged
()
)
{
me
.
_firePharse
(
new
MinderEvent
(
'selectionchange'
)
);
me
.
_firePharse
(
new
MinderEvent
(
'selectionchange'
)
);
}
}
me
.
_firePharse
(
new
MinderEvent
(
'interactchange'
)
);
}
}
},
},
queryCommandState
:
function
(
name
)
{
queryCommandState
:
function
(
name
)
{
if
(
!
_commands
[
name
.
toLowerCase
()
]
)
{
return
this
.
_queryCommand
(
name
,
"State"
);
return
false
;
}
if
(
!
_query
[
name
]
)
{
_query
[
name
]
=
new
_commands
[
name
]();
}
if
(
_query
[
name
].
queryState
)
{
return
_query
[
name
].
queryState
(
this
);
}
else
{
return
0
;
}
},
},
queryCommandValue
:
function
(
name
)
{
queryCommandValue
:
function
(
name
)
{
if
(
!
_commands
[
name
.
toLowerCase
()
]
)
{
return
this
.
_queryCommand
(
name
,
"Value"
);
return
false
;
}
if
(
!
_query
[
name
]
)
{
_query
[
name
]
=
new
_commands
[
name
]();
}
if
(
_query
[
name
].
queryValue
)
{
return
_query
[
name
].
queryValue
(
this
);
}
else
{
return
0
;
}
}
}
}
);
}
);
\ No newline at end of file
src/core/minder.module.js
View file @
360c83bf
// 模块声明周期维护
// 模块声明周期维护
kity
.
extendClass
(
Minder
,
{
kity
.
extendClass
(
Minder
,
{
_initModules
:
function
()
{
_initModules
:
function
()
{
var
_modules
=
KityMinder
.
getModules
();
this
.
_commands
=
{};
this
.
_query
=
{};
var
_modules
=
Minder
.
getModules
();
var
_modulesList
=
(
function
()
{
var
_list
=
[];
for
(
var
key
in
_modules
)
{
_list
.
push
(
key
);
}
}
)();
var
_configModules
=
this
.
option
.
modules
||
_modulesList
;
var
_commands
=
this
.
_commands
;
if
(
_modules
)
{
if
(
_modules
)
{
var
me
=
this
;
var
me
=
this
;
for
(
var
key
in
_modules
)
{
for
(
var
i
=
0
;
i
<
_configModules
.
length
;
i
++
)
{
var
key
=
_configModules
[
i
];
//执行模块初始化,抛出后续处理对象
//执行模块初始化,抛出后续处理对象
var
moduleDeals
=
_modules
[
key
].
call
(
me
);
var
moduleDeals
=
_modules
[
key
].
call
(
me
);
...
...
src/core/minder.node.js
View file @
360c83bf
kity
.
extendClass
(
Kity
Minder
,
{
kity
.
extendClass
(
Minder
,
{
getRoot
:
function
()
{
getRoot
:
function
()
{
return
this
.
_root
;
return
this
.
_root
;
...
@@ -28,4 +28,5 @@ kity.extendClass( KityMinder, {
...
@@ -28,4 +28,5 @@ kity.extendClass( KityMinder, {
this
.
execCommand
(
'renderroot'
,
node
);
this
.
execCommand
(
'renderroot'
,
node
);
return
this
;
return
this
;
}
}
}
);
}
);
\ No newline at end of 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