Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
9f983e4f
Commit
9f983e4f
authored
May 24, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugins
parent
50707df3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
26 deletions
+82
-26
common/commonDefines.js
common/commonDefines.js
+75
-2
common/plugins.js
common/plugins.js
+7
-24
No files found.
common/commonDefines.js
View file @
9f983e4f
...
@@ -1494,8 +1494,6 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
...
@@ -1494,8 +1494,6 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
CPluginVariation
.
prototype
[
"
set_Description
"
]
=
function
(
value
)
{
this
.
description
=
value
;
}
;
CPluginVariation
.
prototype
[
"
set_Description
"
]
=
function
(
value
)
{
this
.
description
=
value
;
}
;
CPluginVariation
.
prototype
[
"
get_Url
"
]
=
function
()
{
return
this
.
url
;
};
CPluginVariation
.
prototype
[
"
get_Url
"
]
=
function
()
{
return
this
.
url
;
};
CPluginVariation
.
prototype
[
"
set_Url
"
]
=
function
(
value
)
{
this
.
url
=
value
;
};
CPluginVariation
.
prototype
[
"
set_Url
"
]
=
function
(
value
)
{
this
.
url
=
value
;
};
CPluginVariation
.
prototype
[
"
get_BaseUrl
"
]
=
function
()
{
return
this
.
baseUrl
;
};
CPluginVariation
.
prototype
[
"
set_BaseUrl
"
]
=
function
(
value
)
{
this
.
baseUrl
=
value
;
};
CPluginVariation
.
prototype
[
"
get_Icons
"
]
=
function
()
{
return
this
.
icons
;
};
CPluginVariation
.
prototype
[
"
get_Icons
"
]
=
function
()
{
return
this
.
icons
;
};
CPluginVariation
.
prototype
[
"
set_Icons
"
]
=
function
(
value
)
{
this
.
icons
=
value
;
};
CPluginVariation
.
prototype
[
"
set_Icons
"
]
=
function
(
value
)
{
this
.
icons
=
value
;
};
...
@@ -1523,10 +1521,56 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
...
@@ -1523,10 +1521,56 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
CPluginVariation
.
prototype
[
"
get_Buttons
"
]
=
function
()
{
return
this
.
buttons
;
};
CPluginVariation
.
prototype
[
"
get_Buttons
"
]
=
function
()
{
return
this
.
buttons
;
};
CPluginVariation
.
prototype
[
"
set_Buttons
"
]
=
function
(
value
)
{
this
.
buttons
=
value
;
};
CPluginVariation
.
prototype
[
"
set_Buttons
"
]
=
function
(
value
)
{
this
.
buttons
=
value
;
};
CPluginVariation
.
prototype
[
"
serialize
"
]
=
function
()
{
var
_object
=
{};
_object
[
"
description
"
]
=
this
.
description
;
_object
[
"
url
"
]
=
this
.
url
;
_object
[
"
index
"
]
=
this
.
index
;
_object
[
"
icons
"
]
=
this
.
icons
;
_object
[
"
isViewer
"
]
=
this
.
isViewer
;
_object
[
"
EditorsSupport
"
]
=
this
.
EditorsSupport
;
_object
[
"
isVisual
"
]
=
this
.
isVisual
;
_object
[
"
isModal
"
]
=
this
.
isModal
;
_object
[
"
isInsideMode
"
]
=
this
.
isInsideMode
;
_object
[
"
initDataType
"
]
=
this
.
initDataType
;
_object
[
"
initData
"
]
=
this
.
initData
;
_object
[
"
isUpdateOleOnResize
"
]
=
this
.
isUpdateOleOnResize
;
_object
[
"
buttons
"
]
=
this
.
buttons
;
return
_object
;
}
CPluginVariation
.
prototype
[
"
deserialize
"
]
=
function
(
_object
)
{
this
.
description
=
_object
[
"
description
"
];
this
.
url
=
_object
[
"
url
"
];
this
.
index
=
_object
[
"
index
"
];
this
.
icons
=
_object
[
"
icons
"
];
this
.
isViewer
=
_object
[
"
isViewer
"
];
this
.
EditorsSupport
=
_object
[
"
EditorsSupport
"
];
this
.
isVisual
=
_object
[
"
isVisual
"
];
this
.
isModal
=
_object
[
"
isModal
"
];
this
.
isInsideMode
=
_object
[
"
isInsideMode
"
];
this
.
initDataType
=
_object
[
"
initDataType
"
];
this
.
initData
=
_object
[
"
initData
"
];
this
.
isUpdateOleOnResize
=
_object
[
"
isUpdateOleOnResize
"
];
this
.
buttons
=
_object
[
"
buttons
"
];
}
function
CPlugin
()
function
CPlugin
()
{
{
this
.
name
=
""
;
this
.
name
=
""
;
this
.
guid
=
""
;
this
.
guid
=
""
;
this
.
baseUrl
=
""
;
this
.
variations
=
[];
this
.
variations
=
[];
}
}
...
@@ -1535,10 +1579,39 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
...
@@ -1535,10 +1579,39 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
CPlugin
.
prototype
[
"
set_Name
"
]
=
function
(
value
)
{
this
.
name
=
value
;
}
;
CPlugin
.
prototype
[
"
set_Name
"
]
=
function
(
value
)
{
this
.
name
=
value
;
}
;
CPlugin
.
prototype
[
"
get_Guid
"
]
=
function
()
{
return
this
.
guid
;
};
CPlugin
.
prototype
[
"
get_Guid
"
]
=
function
()
{
return
this
.
guid
;
};
CPlugin
.
prototype
[
"
set_Guid
"
]
=
function
(
value
)
{
this
.
guid
=
value
;
};
CPlugin
.
prototype
[
"
set_Guid
"
]
=
function
(
value
)
{
this
.
guid
=
value
;
};
CPlugin
.
prototype
[
"
get_BaseUrl
"
]
=
function
()
{
return
this
.
baseUrl
;
};
CPlugin
.
prototype
[
"
set_BaseUrl
"
]
=
function
(
value
)
{
this
.
baseUrl
=
value
;
};
CPlugin
.
prototype
[
"
get_Variations
"
]
=
function
()
{
return
this
.
variations
;
};
CPlugin
.
prototype
[
"
get_Variations
"
]
=
function
()
{
return
this
.
variations
;
};
CPlugin
.
prototype
[
"
set_Variations
"
]
=
function
(
value
)
{
this
.
variations
=
value
;
};
CPlugin
.
prototype
[
"
set_Variations
"
]
=
function
(
value
)
{
this
.
variations
=
value
;
};
CPlugin
.
prototype
[
"
serialize
"
]
=
function
()
{
var
_object
=
{};
_object
[
"
name
"
]
=
this
.
name
;
_object
[
"
guid
"
]
=
this
.
guid
;
_object
[
"
baseUrl
"
]
=
this
.
baseUrl
;
_object
[
"
variations
"
]
=
this
.
variations
;
for
(
var
i
=
0
;
i
<
this
.
variations
;
i
++
)
{
_object
[
"
variations
"
].
push
(
this
.
variations
[
i
].
serialize
());
}
return
_object
;
}
CPlugin
.
prototype
[
"
deserialize
"
]
=
function
(
_object
)
{
this
.
name
=
_object
[
"
name
"
];
this
.
guid
=
_object
[
"
guid
"
];
this
.
baseUrl
=
_object
[
"
baseUrl
"
];
this
.
variations
=
[];
for
(
var
i
=
0
;
i
<
_object
[
"
variations
"
].
length
;
i
++
)
{
var
_variation
=
new
CPluginVariation
();
_variation
[
"
deserialize
"
](
_object
[
"
variations
"
][
i
]);
this
.
variations
.
push
(
_variation
);
}
}
window
[
"
Asc
"
][
"
CPluginVariation
"
]
=
CPluginVariation
;
window
[
"
Asc
"
][
"
CPluginVariation
"
]
=
CPluginVariation
;
window
[
"
Asc
"
][
"
CPlugin
"
]
=
CPlugin
;
window
[
"
Asc
"
][
"
CPlugin
"
]
=
CPlugin
;
// --------------------------------------------------------------------- //
// --------------------------------------------------------------------- //
...
...
common/plugins.js
View file @
9f983e4f
...
@@ -129,7 +129,7 @@
...
@@ -129,7 +129,7 @@
var
ifr
=
document
.
createElement
(
"
iframe
"
);
var
ifr
=
document
.
createElement
(
"
iframe
"
);
ifr
.
name
=
"
plugin_iframe
"
;
ifr
.
name
=
"
plugin_iframe
"
;
ifr
.
id
=
"
plugin_iframe
"
;
ifr
.
id
=
"
plugin_iframe
"
;
var
_add
=
this
.
current
.
variations
[
0
].
baseUrl
==
""
?
this
.
path
:
this
.
current
.
variations
[
0
]
.
baseUrl
;
var
_add
=
this
.
current
.
baseUrl
==
""
?
this
.
path
:
this
.
current
.
baseUrl
;
ifr
.
src
=
_add
+
this
.
current
.
variations
[
0
].
url
;
ifr
.
src
=
_add
+
this
.
current
.
variations
[
0
].
url
;
ifr
.
style
.
position
=
'
absolute
'
;
ifr
.
style
.
position
=
'
absolute
'
;
ifr
.
style
.
top
=
'
-100px
'
;
ifr
.
style
.
top
=
'
-100px
'
;
...
@@ -209,38 +209,21 @@
...
@@ -209,38 +209,21 @@
for
(
var
i
=
0
;
i
<
_plugins
.
length
;
i
++
)
for
(
var
i
=
0
;
i
<
_plugins
.
length
;
i
++
)
{
{
var
_p
=
new
Asc
.
CPlugin
();
var
_p
=
new
Asc
.
CPlugin
();
_p
[
"
deserialize
"
](
_plugins
[
i
]);
_p
.
name
=
_plugins
[
i
].
name
;
_p
.
guid
=
_plugins
[
i
].
guid
;
if
(
_map
[
_p
.
guid
]
===
true
)
if
(
_map
[
_p
.
guid
]
===
true
)
continue
;
continue
;
for
(
var
j
=
0
;
j
<
_plugins
[
i
].
variations
.
length
;
j
++
)
{
var
_pv
=
new
Asc
.
CPluginVariation
();
for
(
var
k
in
_plugins
[
i
].
variations
[
j
])
{
_pv
[
k
]
=
_plugins
[
i
].
variations
[
j
][
k
];
}
_p
.
variations
.
push
(
_pv
);
}
this
.
plugins
.
push
(
_p
);
this
.
plugins
.
push
(
_p
);
}
}
// добавляем кнопки (тест)
var
_pluginsInstall
=
{
"
url
"
:
this
.
path
,
"
pluginsData
"
:
[]
};
var
_elem
=
document
.
getElementById
(
"
view-left-menu
"
).
childNodes
[
1
];
for
(
var
i
=
0
;
i
<
this
.
plugins
.
length
;
i
++
)
for
(
var
i
=
0
;
i
<
_plugins
.
length
;
i
++
)
{
{
var
_button
=
"
<button class='btn btn-category' content-target='' data-toggle='tooltip' data-original-title='' title=''
"
+
_pluginsInstall
[
"
pluginsData
"
].
push
(
this
.
plugins
[
i
].
serialize
());
"
onclick='window.g_asc_plugins.run(
\"
"
+
_plugins
[
i
].
guid
+
"
\"
)'><span>
"
+
(
i
+
1
)
+
"
</span></button>
"
;
_elem
.
innerHTML
+=
_button
;
}
}
this
.
api
.
asc_fireCallback
(
"
asc_onPluginsInit
"
,
_pluginsInstall
);
}
}
};
};
...
...
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