Add WebCms
@@ -0,0 +1,50 @@
|
||||
/// <reference name="MicrosoftAjax.js"/>
|
||||
/// <reference path="/umbraco_client/Application/NamespaceManager.js" />
|
||||
|
||||
Umbraco.Sys.registerNamespace("Umbraco.Controls");
|
||||
|
||||
Umbraco.Controls.NodeDefinition = function() {
|
||||
/// <summary>
|
||||
/// An object that defines the details of a current node selected in the tree.
|
||||
/// Contains the logic to modify the html markup of a node such as styles.
|
||||
/// </summary>
|
||||
return {
|
||||
jsTree: null,
|
||||
jsNode: null,
|
||||
nodeId: null,
|
||||
nodeName: null,
|
||||
nodeType: null,
|
||||
sourceUrl: null,
|
||||
menu: null,
|
||||
treeType: null,
|
||||
_isDebug: false,
|
||||
|
||||
updateDefinition: function(jsTree, jsNode, nodeId, nodeName, nodeType, sourceUrl, menu, treeType) {
|
||||
/// <summary>
|
||||
/// Updates the current objects properties at one time
|
||||
/// </summary>
|
||||
/// <param name="jsTree">A reference to the current node's jsTree</param>
|
||||
/// <param name="jsNode">A reference to the jquery li node</param>
|
||||
/// <param name="nodeId">The node id of the node</param>
|
||||
/// <param name="nodeName">The node name of the node</param>
|
||||
/// <param name="nodeType">The node type/tree type of the node</param>
|
||||
|
||||
this.jsTree = jsTree;
|
||||
this.jsNode = jsNode;
|
||||
this.nodeId = nodeId;
|
||||
this.nodeName = nodeName;
|
||||
this.nodeType = nodeType;
|
||||
this.sourceUrl = sourceUrl;
|
||||
this.menu = menu;
|
||||
this.treeType = treeType;
|
||||
|
||||
this._debug("updateDefinition: " + nodeId + ", " + nodeName + ", " + nodeType);
|
||||
},
|
||||
|
||||
_debug: function(strMsg) {
|
||||
if (this._isDebug) {
|
||||
Sys.Debug.trace("NodeDefinition: " + strMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 6.5 KiB |
@@ -0,0 +1,30 @@
|
||||
/* LOCKED */
|
||||
.tree-default .locked li a { color:gray; }
|
||||
/* DOTS */
|
||||
.tree-default ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); }
|
||||
.tree-default li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); }
|
||||
/* NO DOTS */
|
||||
.tree-default .no_dots, .tree-default .no_dots ul { background:transparent; }
|
||||
.tree-default .no_dots li.leaf { background-image:none; background-color:transparent; }
|
||||
/* OPEN or CLOSED */
|
||||
.tree-default li.open { background:url("icons.png") -32px -48px no-repeat; }
|
||||
.tree-default li.closed, #jstree-dragged.tree-default li li.open { background:url("icons.png") -48px -32px no-repeat; }
|
||||
#jstree-marker { background-image:url("icons.png"); }
|
||||
/* DEFAULT, HOVER, CLICKED, LOADING STATES */
|
||||
.tree-default li a, .tree-default li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; }
|
||||
.tree-default li a:hover, .tree-default li a.hover, .tree-default li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; }
|
||||
.tree-default li a.clicked, .tree-default li a.clicked:hover, .tree-default li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; }
|
||||
/* ICONS */
|
||||
.tree-default ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; }
|
||||
.tree-default ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */
|
||||
.tree-default li a ins.forbidden { background-position:-16px -16px; }
|
||||
.tree-default .locked li a ins { background-position:0 -48px; }
|
||||
.tree-default li span ins { background-position:-16px 0; }
|
||||
#jstree-dragged.tree-default ins { background:url("icons.png") -16px -32px no-repeat; }
|
||||
#jstree-dragged.tree-default ins.forbidden { background:url("icons.png") -16px -16px no-repeat; }
|
||||
|
||||
/* CONTEXT MENU */
|
||||
.tree-default-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; }
|
||||
.tree-default-context a ins.create { background-position:0 -16px; }
|
||||
.tree-default-context a ins.rename { background-position:-16px 0px; }
|
||||
.tree-default-context a ins.remove { background-position:0 -32px; }
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 35 B |
|
After Width: | Height: | Size: 54 B |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 60 B |
|
After Width: | Height: | Size: 59 B |
|
After Width: | Height: | Size: 108 B |
|
After Width: | Height: | Size: 108 B |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 55 B |
|
After Width: | Height: | Size: 54 B |
|
After Width: | Height: | Size: 47 B |
|
After Width: | Height: | Size: 381 B |
|
After Width: | Height: | Size: 282 B |
@@ -0,0 +1,206 @@
|
||||
/* OVERRIDE TREE_COMPONENT.css */
|
||||
.tree.tree-umbraco li
|
||||
{
|
||||
line-height: 20px;
|
||||
min-height: 20px;
|
||||
font: icon;
|
||||
position:relative;
|
||||
font-family: Arial,Lucida Grande;
|
||||
font-size: 12px;
|
||||
}
|
||||
.tree.tree-umbraco li a
|
||||
{
|
||||
background-image: url(../../../../umbraco/images/umbraco/sprites.png);
|
||||
/*background-color: #fff;*/
|
||||
padding: 0px 0px 2px 18px;
|
||||
border: 0;
|
||||
color: #2f2f2f;
|
||||
background-repeat:no-repeat !important;
|
||||
line-height: 18px;
|
||||
height: 18px;
|
||||
width: 100%;
|
||||
}
|
||||
.tree.tree-umbraco ul {margin-left:0px;}
|
||||
.tree.tree-umbraco ul li ul {padding-left:5px;}
|
||||
.tree.tree-umbraco li a ins { display:none;}
|
||||
/* LOADER */
|
||||
.tree.tree-umbraco ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important;display:inline-block; float:left;}
|
||||
.tree.tree-umbraco ul li a.loading {padding:0px !important;background:none;}
|
||||
/* OPEN or CLOSED */
|
||||
.tree.tree-umbraco li { padding-left:0px; }
|
||||
.tree.tree-umbraco li li { padding-left: 15px; }
|
||||
.tree.tree-umbraco li.open { background-image:none; }
|
||||
.tree.tree-umbraco li li.open { background:url("arrows.png") -18px -43px no-repeat; }
|
||||
.tree.tree-umbraco li li:hover.open { background-position: -2px -43px; }
|
||||
.tree.tree-umbraco li.closed, #jstree-dragged.tree-default li li.open { background:url("arrows.png") 0px -20px no-repeat; }
|
||||
.tree.tree-umbraco li:hover.closed, #jstree-dragged.tree-default li li:hover.open { background-position:0px 2px; }
|
||||
/* Ensure no sprite is loaded */
|
||||
.tree.tree-umbraco li a.noSpr, .tree.tree-umbraco li a.noSpr:hover
|
||||
{
|
||||
background-position:0px 0px;
|
||||
background:none;
|
||||
}
|
||||
/* Hover state */
|
||||
.tree.tree-umbraco li a:hover
|
||||
{
|
||||
text-decoration: underline;
|
||||
}
|
||||
/* Menu text styles */
|
||||
.tree.tree-umbraco li div
|
||||
{
|
||||
padding: 1px 3px 1px 3px;
|
||||
height:16px;
|
||||
line-height:16px;
|
||||
cursor:pointer;
|
||||
}
|
||||
/* highlight the selected element */
|
||||
.tree.tree-umbraco li .clicked div
|
||||
{
|
||||
padding: 0px 2px 0px 2px;
|
||||
background: #D5EFFC;
|
||||
border:1px solid #99DEFD;
|
||||
-moz-border-radius: 2px;
|
||||
display: inline;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
|
||||
/* renaming */
|
||||
.tree.tree-umbraco li div.renaming
|
||||
{
|
||||
padding: 0px 2px 0px 12px;
|
||||
background: #D5EFFC;
|
||||
border:1px solid #99DEFD;
|
||||
-moz-border-radius: 2px;
|
||||
}
|
||||
.tree-umbraco li div.renaming input
|
||||
{
|
||||
border:0px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Used for checkbox tree */
|
||||
|
||||
.tree.tree-umbraco.inheritedcheckbox li a,
|
||||
.tree.tree-umbraco.inheritedcheckbox li a.unchecked,
|
||||
.tree.tree-umbraco.checkbox li a,
|
||||
.tree.tree-umbraco.checkbox li a.unchecked
|
||||
{ background: url("check_0.png") no-repeat 0px 0px ! important; }
|
||||
.tree.tree-umbraco.inheritedcheckbox li a.undetermined,
|
||||
.tree.tree-umbraco.checkbox li a.undetermined
|
||||
{ background:url("check_1.png") no-repeat 0px 0px ! important; }
|
||||
.tree.tree-umbraco.inheritedcheckbox li a.checked,
|
||||
.tree.tree-umbraco.checkbox li a.checked
|
||||
{ background:url("check_2.png") no-repeat 0px 0px ! important; }
|
||||
|
||||
/* CONTEXT MENU (overriding default styles) */
|
||||
|
||||
#jstree-contextmenu.tree-umbraco-context
|
||||
{
|
||||
background: #f0f0f0 url(contextMenuBg.gif) repeat-y left;
|
||||
border: 1px solid #979797;
|
||||
padding: 3px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 0px;
|
||||
width: 180px;
|
||||
font-family: Arial,Lucida Grande;
|
||||
font-size: 11px;
|
||||
z-index: 1000;
|
||||
margin: 0px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
#jstree-contextmenu.tree-umbraco-context li
|
||||
{
|
||||
border-left:none;
|
||||
background:transparent;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
#jstree-contextmenu.tree-umbraco-context li a
|
||||
{
|
||||
border:0px;
|
||||
padding: 2px;
|
||||
height: 20px;
|
||||
line-height:20px;
|
||||
color: #1a1818;
|
||||
text-decoration: none;
|
||||
text-indent: 0px;
|
||||
margin-top: 1px !Important;
|
||||
margin-bottom: 3px !Important;
|
||||
}
|
||||
|
||||
#jstree-contextmenu.tree-umbraco-context li a:hover
|
||||
{
|
||||
border: 1px solid #a8d8eb;
|
||||
padding: 1px;
|
||||
background: #dcecf3;
|
||||
text-indent: 0px;
|
||||
}
|
||||
#jstree-contextmenu.tree-umbraco-context .separator
|
||||
{
|
||||
background: #FFFFFF;
|
||||
border-top: 1px solid #E0E0E0;
|
||||
font-size: 1px;
|
||||
height: 1px;
|
||||
line-height: 1px;
|
||||
margin: 0 2px 4px 29px;
|
||||
min-height: 1px;
|
||||
display: block;
|
||||
}
|
||||
#jstree-contextmenu.tree-umbraco-context .separator span {display:none;}
|
||||
#jstree-contextmenu.tree-umbraco-context img
|
||||
{
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
margin: 1px 10px 0 4px;
|
||||
}
|
||||
|
||||
#jstree-contextmenu.tree-umbraco-context li a ins {display:none;}
|
||||
#jstree-contextmenu.tree-umbraco-context li a span {margin:0;padding-left:1px;background:none;}
|
||||
#jstree-contextmenu.tree-umbraco-context li a span div.menuLabel{padding-left: 37px;}
|
||||
|
||||
/* Tree icons sprites */
|
||||
|
||||
.sprTree,
|
||||
.tree.tree-umbraco li a.sprTree.clicked:hover
|
||||
{
|
||||
background-image: 0px 0px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* tree node overlays / custom styles */
|
||||
|
||||
.tree.tree-umbraco li.dim a
|
||||
{
|
||||
color:#C0C0C0;
|
||||
}
|
||||
|
||||
.tree.tree-umbraco li div.overlay
|
||||
{
|
||||
position: absolute;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
.tree.tree-umbraco li div.overlay-new
|
||||
{
|
||||
z-index: 500;
|
||||
left: 11px;
|
||||
top: 0px;
|
||||
background: no-repeat url(newVersion_overlay.png);
|
||||
_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='protect_overlay.gif');
|
||||
}
|
||||
|
||||
.tree.tree-umbraco li div.overlay-protect
|
||||
{
|
||||
z-index: 501;
|
||||
left: 22px;
|
||||
top: 8px;
|
||||
background: no-repeat url(protect_overlay.gif);
|
||||
_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='protect_overlay.gif');
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 61 B |
|
After Width: | Height: | Size: 62 B |
|
After Width: | Height: | Size: 52 B |
|
After Width: | Height: | Size: 720 B |
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1,89 @@
|
||||
(function ($) {
|
||||
///<summary>Custom plugin to create the Umbraco context menu, this configures the context menu plugin before it's callbacks eecute</summary>
|
||||
|
||||
$.extend($.tree.plugins, {
|
||||
"UmbracoContext": {
|
||||
|
||||
settings: {
|
||||
fullMenu: [],
|
||||
onBeforeContext: false
|
||||
},
|
||||
|
||||
_getContextMenu: function (strMenu) {
|
||||
/// <summary>Builds a new context menu object (array) based on the string representation passed in</summary>
|
||||
|
||||
var newMenu = new Array();
|
||||
var separatorIndexes = new Array();
|
||||
for (var i = 0; i < strMenu.length; i++) {
|
||||
var letter = strMenu.charAt(i);
|
||||
//get a js menu item by letter
|
||||
var menuItem = this._getMenuItemByLetter(letter);
|
||||
if (menuItem == "separator") { separatorIndexes.push(newMenu.length); }
|
||||
else if (menuItem != null) newMenu.push(menuItem);
|
||||
}
|
||||
for (var i = 0; i < separatorIndexes.length; i++) {
|
||||
if (separatorIndexes[i] > 0) {
|
||||
newMenu[separatorIndexes[i] - 1].separator_after = true;
|
||||
}
|
||||
}
|
||||
return newMenu;
|
||||
},
|
||||
|
||||
_getMenuItemByLetter: function (letter) {
|
||||
|
||||
/// <summary>Finds the menu item in our full menu by the letter and returns object</summary>
|
||||
var fullMenu = $.tree.plugins.UmbracoContext.settings.fullMenu;
|
||||
//insert selector if it's a comma
|
||||
if (letter == ",") return "separator";
|
||||
for (var m in fullMenu) {
|
||||
if (fullMenu[m].id == letter) {
|
||||
return fullMenu[m];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
callbacks: {
|
||||
oninit: function (t) {
|
||||
$.tree.plugins.UmbracoContext.settings = t.settings.plugins.UmbracoContext;
|
||||
//need to remove the defaults
|
||||
$.tree.plugins.contextmenu.defaults.items = {};
|
||||
},
|
||||
onrgtclk: function (n, t, e) {
|
||||
///<summary>Need to set the context menu items for the context menu plugin for the current node</summary>
|
||||
var _this = $.tree.plugins.UmbracoContext;
|
||||
|
||||
var menu = _this.settings.onBeforeContext.call(this, n, t, e);
|
||||
if (menu != "") {
|
||||
t.settings.plugins.contextmenu.items = _this._getContextMenu(menu);
|
||||
}
|
||||
else {
|
||||
t.settings.plugins.contextmenu.items = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
//add events to auto hide the menu on a delay
|
||||
var pause = true;
|
||||
var timer = null;
|
||||
$("#jstree-contextmenu").bind("mouseenter", function () {
|
||||
pause = true;
|
||||
clearTimeout(timer);
|
||||
});
|
||||
$("#jstree-contextmenu").bind("mouseleave", function () {
|
||||
pause = false;
|
||||
timer = setTimeout(function () {
|
||||
if (!pause) {
|
||||
$.tree.plugins.contextmenu.hide();
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
//disable right clicking the context menu, this is for IE bug
|
||||
$("#jstree-contextmenu").bind("contextmenu", function (e) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,75 @@
|
||||
(function ($) {
|
||||
$.extend($.tree.plugins, {
|
||||
"checkbox" : {
|
||||
defaults : {
|
||||
three_state : true
|
||||
},
|
||||
get_checked : function (t) {
|
||||
if(!t) t = $.tree.focused();
|
||||
return t.container.find("a.checked").parent();
|
||||
},
|
||||
get_undeterminded : function (t) {
|
||||
if(!t) t = $.tree.focused();
|
||||
return t.container.find("a.undetermined").parent();
|
||||
},
|
||||
get_unchecked : function (t) {
|
||||
if(!t) t = $.tree.focused();
|
||||
return t.container.find("a:not(.checked, .undetermined)").parent();
|
||||
},
|
||||
|
||||
check : function (n) {
|
||||
if(!n) return false;
|
||||
var t = $.tree.reference(n);
|
||||
n = t.get_node(n);
|
||||
if(n.children("a").hasClass("checked")) return true;
|
||||
|
||||
var opts = $.extend(true, {}, $.tree.plugins.checkbox.defaults, t.settings.plugins.checkbox);
|
||||
if(opts.three_state) {
|
||||
n.find("li").andSelf().children("a").removeClass("unchecked undetermined").addClass("checked");
|
||||
n.parents("li").each(function () {
|
||||
if($(this).children("ul").find("a:not(.checked):eq(0)").size() > 0) {
|
||||
$(this).parents("li").andSelf().children("a").removeClass("unchecked checked").addClass("undetermined");
|
||||
return false;
|
||||
}
|
||||
else $(this).children("a").removeClass("unchecked undetermined").addClass("checked");
|
||||
});
|
||||
}
|
||||
else n.children("a").removeClass("unchecked").addClass("checked");
|
||||
return true;
|
||||
},
|
||||
uncheck : function (n) {
|
||||
if(!n) return false;
|
||||
var t = $.tree.reference(n);
|
||||
n = t.get_node(n);
|
||||
if(n.children("a").hasClass("unchecked")) return true;
|
||||
|
||||
var opts = $.extend(true, {}, $.tree.plugins.checkbox.defaults, t.settings.plugins.checkbox);
|
||||
if(opts.three_state) {
|
||||
n.find("li").andSelf().children("a").removeClass("checked undetermined").addClass("unchecked");
|
||||
n.parents("li").each(function () {
|
||||
if($(this).find("a.checked, a.undetermined").size() - 1 > 0) {
|
||||
$(this).parents("li").andSelf().children("a").removeClass("unchecked checked").addClass("undetermined");
|
||||
return false;
|
||||
}
|
||||
else $(this).children("a").removeClass("checked undetermined").addClass("unchecked");
|
||||
});
|
||||
}
|
||||
else n.children("a").removeClass("checked").addClass("unchecked");
|
||||
return true;
|
||||
},
|
||||
toggle : function (n) {
|
||||
if(!n) return false;
|
||||
var t = $.tree.reference(n);
|
||||
n = t.get_node(n);
|
||||
if(n.children("a").hasClass("checked")) $.tree.plugins.checkbox.uncheck(n);
|
||||
else $.tree.plugins.checkbox.check(n);
|
||||
},
|
||||
|
||||
callbacks : {
|
||||
onchange : function(n, t) {
|
||||
$.tree.plugins.checkbox.toggle(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,137 @@
|
||||
(function ($) {
|
||||
$.extend($.tree.plugins, {
|
||||
"contextmenu": {
|
||||
object: $("<ul id='jstree-contextmenu' class='tree-context' />"),
|
||||
data: {
|
||||
t: false,
|
||||
a: false,
|
||||
r: false
|
||||
},
|
||||
|
||||
defaults: {
|
||||
class_name: "hover",
|
||||
items: {
|
||||
create: {
|
||||
label: "Create",
|
||||
icon: "create",
|
||||
visible: function (NODE, TREE_OBJ) { if (NODE.length != 1) return 0; return TREE_OBJ.check("creatable", NODE); },
|
||||
action: function (NODE, TREE_OBJ) { TREE_OBJ.create(false, TREE_OBJ.get_node(NODE[0])); },
|
||||
separator_after: true
|
||||
},
|
||||
rename: {
|
||||
label: "Rename",
|
||||
icon: "rename",
|
||||
visible: function (NODE, TREE_OBJ) { if (NODE.length != 1) return false; return TREE_OBJ.check("renameable", NODE); },
|
||||
action: function (NODE, TREE_OBJ) { TREE_OBJ.rename(NODE); }
|
||||
},
|
||||
remove: {
|
||||
label: "Delete",
|
||||
icon: "remove",
|
||||
visible: function (NODE, TREE_OBJ) { var ok = true; $.each(NODE, function () { if (TREE_OBJ.check("deletable", this) == false) ok = false; return false; }); return ok; },
|
||||
action: function (NODE, TREE_OBJ) { $.each(NODE, function () { TREE_OBJ.remove(this); }); }
|
||||
}
|
||||
}
|
||||
},
|
||||
show: function (obj, t) {
|
||||
var opts = $.extend(true, {}, $.tree.plugins.contextmenu.defaults, t.settings.plugins.contextmenu);
|
||||
obj = $(obj);
|
||||
$.tree.plugins.contextmenu.object.empty();
|
||||
var str = "";
|
||||
var cnt = 0;
|
||||
for (var i in opts.items) {
|
||||
if (!opts.items.hasOwnProperty(i)) continue;
|
||||
if (opts.items[i] === false) continue;
|
||||
var r = 1;
|
||||
if (typeof opts.items[i].visible == "function") r = opts.items[i].visible.call(null, $.tree.plugins.contextmenu.data.a, t);
|
||||
if (r == -1) continue;
|
||||
else cnt++;
|
||||
if (opts.items[i].separator_before === true) str += "<li class='separator'><span> </span></li>";
|
||||
str += '<li><a href="#" rel="' + i + '" class="' + i + ' ' + (r == 0 ? 'disabled' : '') + '">';
|
||||
|
||||
// updated from patch by Matt Brailsford (http://our.umbraco.org/forum/using/ui-questions/6225-Custom-icon-in-Context-menu#comment39514)
|
||||
str += "<ins> </ins>"; str += "<span>";
|
||||
if (opts.items[i].icon && opts.items[i].icon.indexOf("/") >= 0) {
|
||||
str += "<div class=\"menuSpr\" style=\"background:transparent url('" + opts.items[i].icon + "') center center no-repeat;\"></div><div class='menuLabel'>" + opts.items[i].label + "</div>";
|
||||
} else {
|
||||
str += opts.items[i].label;
|
||||
}
|
||||
str += '</span></a></li>';
|
||||
|
||||
if (opts.items[i].separator_after === true) str += "<li class='separator'><span> </span></li>";
|
||||
}
|
||||
var tmp = obj.children("a:visible").offset();
|
||||
$.tree.plugins.contextmenu.object.attr("class", "tree-context tree-" + t.settings.ui.theme_name.toString() + "-context").html(str);
|
||||
var h = $.tree.plugins.contextmenu.object.height();
|
||||
var w = $.tree.plugins.contextmenu.object.width();
|
||||
var x = tmp.left;
|
||||
var y = tmp.top + parseInt(obj.children("a:visible").height()) + 2;
|
||||
var max_y = $(window).height() + $(window).scrollTop();
|
||||
var max_x = $(window).width() + $(window).scrollLeft();
|
||||
if (y + h > max_y) y = Math.max((max_y - h - 2), 0);
|
||||
if (x + w > max_x) x = Math.max((max_x - w - 2), 0);
|
||||
$.tree.plugins.contextmenu.object.css({ "left": (x), "top": (y) }).fadeIn("fast");
|
||||
},
|
||||
hide: function () {
|
||||
if (!$.tree.plugins.contextmenu.data.t) return;
|
||||
var opts = $.extend(true, {}, $.tree.plugins.contextmenu.defaults, $.tree.plugins.contextmenu.data.t.settings.plugins.contextmenu);
|
||||
if ($.tree.plugins.contextmenu.data.r && $.tree.plugins.contextmenu.data.a) {
|
||||
$.tree.plugins.contextmenu.data.a.children("a, span").removeClass(opts.class_name);
|
||||
}
|
||||
$.tree.plugins.contextmenu.data = { a: false, r: false, t: false };
|
||||
$.tree.plugins.contextmenu.object.fadeOut("fast");
|
||||
},
|
||||
exec: function (cmd) {
|
||||
if ($.tree.plugins.contextmenu.data.t == false) return;
|
||||
var opts = $.extend(true, {}, $.tree.plugins.contextmenu.defaults, $.tree.plugins.contextmenu.data.t.settings.plugins.contextmenu);
|
||||
try { opts.items[cmd].action.apply(null, [$.tree.plugins.contextmenu.data.a, $.tree.plugins.contextmenu.data.t]); } catch (e) { };
|
||||
},
|
||||
|
||||
callbacks: {
|
||||
oninit: function () {
|
||||
if (!$.tree.plugins.contextmenu.css) {
|
||||
var css = '#jstree-contextmenu { display:none; position:absolute; z-index:2000; list-style-type:none; margin:0; padding:0; left:-2000px; top:-2000px; } .tree-context { margin:20px; padding:0; width:180px; border:1px solid #979797; padding:2px; background:#f5f5f5; list-style-type:none; }.tree-context li { height:22px; margin:0 0 0 27px; padding:0; background:#ffffff; border-left:1px solid #e0e0e0; }.tree-context li a { position:relative; display:block; height:22px; line-height:22px; margin:0 0 0 -28px; text-decoration:none; color:black; padding:0; }.tree-context li a ins { text-decoration:none; float:left; width:16px; height:16px; margin:0 0 0 0; background-color:#f0f0f0; border:1px solid #f0f0f0; border-width:3px 5px 3px 6px; line-height:16px; }.tree-context li a span { display:block; background:#f0f0f0; margin:0 0 0 29px; padding-left:5px; }.tree-context li.separator { background:#f0f0f0; height:2px; line-height:2px; font-size:1px; border:0; margin:0; padding:0; }.tree-context li.separator span { display:block; margin:0px 0 0px 27px; height:1px; border-top:1px solid #e0e0e0; border-left:1px solid #e0e0e0; line-height:1px; font-size:1px; background:white; }.tree-context li a:hover { border:1px solid #d8f0fa; height:20px; line-height:20px; }.tree-context li a:hover span { background:#e7f4f9; margin-left:28px; }.tree-context li a:hover ins { background-color:#e7f4f9; border-color:#e7f4f9; border-width:2px 5px 2px 5px; }.tree-context li a.disabled { color:gray; }.tree-context li a.disabled ins { }.tree-context li a.disabled:hover { border:0; height:22px; line-height:22px; }.tree-context li a.disabled:hover span { background:#f0f0f0; margin-left:29px; }.tree-context li a.disabled:hover ins { border-color:#f0f0f0; background-color:#f0f0f0; border-width:3px 5px 3px 6px; }';
|
||||
$.tree.plugins.contextmenu.css = this.add_sheet({ str: css });
|
||||
}
|
||||
},
|
||||
onrgtclk: function (n, t, e) {
|
||||
var opts = $.extend(true, {}, $.tree.plugins.contextmenu.defaults, t.settings.plugins.contextmenu);
|
||||
n = $(n);
|
||||
if (n.size() == 0) return;
|
||||
$.tree.plugins.contextmenu.data.t = t;
|
||||
if (!n.children("a:eq(0)").hasClass("clicked")) {
|
||||
$.tree.plugins.contextmenu.data.a = n;
|
||||
$.tree.plugins.contextmenu.data.r = true;
|
||||
n.children("a").addClass(opts.class_name);
|
||||
e.target.blur();
|
||||
}
|
||||
else {
|
||||
$.tree.plugins.contextmenu.data.r = false;
|
||||
$.tree.plugins.contextmenu.data.a = (t.selected_arr && t.selected_arr.length > 1) ? t.selected_arr : t.selected;
|
||||
}
|
||||
$.tree.plugins.contextmenu.show(n, t);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
// return false; // commented out because you might want to do something in your own callback
|
||||
},
|
||||
onchange: function () { $.tree.plugins.contextmenu.hide(); },
|
||||
beforedata: function () { $.tree.plugins.contextmenu.hide(); },
|
||||
ondestroy: function () { $.tree.plugins.contextmenu.hide(); }
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
$.tree.plugins.contextmenu.object.hide().appendTo("body");
|
||||
$("a", $.tree.plugins.contextmenu.object[0])
|
||||
//has to be .live, do not change to .on, it doesn't work
|
||||
.live("click", function (event) {
|
||||
if (!$(this).hasClass("disabled")) {
|
||||
$.tree.plugins.contextmenu.exec.apply(null, [$(this).attr("rel")]);
|
||||
$.tree.plugins.contextmenu.hide();
|
||||
}
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
})
|
||||
$(document).bind("mousedown", function (event) { if ($(event.target).parents("#jstree-contextmenu").size() == 0) $.tree.plugins.contextmenu.hide(); });
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,17 @@
|
||||
(function ($) {
|
||||
if(typeof $.metadata == "undefined") throw "jsTree metadata: jQuery metadata plugin not included.";
|
||||
|
||||
$.extend($.tree.plugins, {
|
||||
"metadata" : {
|
||||
defaults : {
|
||||
attribute : "data"
|
||||
},
|
||||
callbacks : {
|
||||
check : function(rule, obj, value, tree) {
|
||||
var opts = $.extend(true, {}, $.tree.plugins.metadata.defaults, this.settings.plugins.metadata);
|
||||
if(typeof $(obj).metadata({ type : "attr", name : opts.attribute })[rule] != "undefined") return $(obj).metadata()[rule];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,115 @@
|
||||
.menuSpr
|
||||
{
|
||||
float: left;
|
||||
background-image: url(sprites.png);
|
||||
background-position: -7px -8px;
|
||||
margin-top: 1px;
|
||||
width: 17px;
|
||||
height: 16px;
|
||||
margin: 1px 13px 1px 0px;
|
||||
}
|
||||
|
||||
.sprNew
|
||||
{
|
||||
background-position: -7px -339px;
|
||||
}
|
||||
.sprCreateFolder
|
||||
{
|
||||
background-position: -7px -108px;
|
||||
}
|
||||
.sprSendToTranslate
|
||||
{
|
||||
background-position: -7px -636px;
|
||||
}
|
||||
.sprBinEmpty
|
||||
{
|
||||
background-position: -7px -42px;
|
||||
}
|
||||
.sprTranslate
|
||||
{
|
||||
background-position: -7px -636px;
|
||||
}
|
||||
.sprSave
|
||||
{
|
||||
background-position: -7px -603px;
|
||||
}
|
||||
.sprImportDocumentType
|
||||
{
|
||||
background-position: -7px -273px;
|
||||
}
|
||||
.sprExportDocumentType
|
||||
{
|
||||
background-position: -7px -240px;
|
||||
}
|
||||
.sprAudit
|
||||
{
|
||||
background-position: -7px -6px;
|
||||
}
|
||||
.sprPackage2
|
||||
{
|
||||
background-position: -7px -405px;
|
||||
}
|
||||
.sprDelete
|
||||
{
|
||||
background-position: -7px -174px;
|
||||
}
|
||||
.sprMove
|
||||
{
|
||||
background-position: -7px -141px;
|
||||
}
|
||||
.sprCopy
|
||||
{
|
||||
background-position: -7px -75px;
|
||||
}
|
||||
.sprSort
|
||||
{
|
||||
background-position: -7px -670px;
|
||||
}
|
||||
.sprPermission
|
||||
{
|
||||
background-position: -7px -438px;
|
||||
}
|
||||
.sprProtect
|
||||
{
|
||||
background-position: -7px -471px;
|
||||
}
|
||||
.sprRollback
|
||||
{
|
||||
background-position: -7px -570px;
|
||||
}
|
||||
.sprRefresh
|
||||
{
|
||||
background-position: -7px -537px;
|
||||
}
|
||||
.sprNotify
|
||||
{
|
||||
background-position: -7px -372px;
|
||||
}
|
||||
.sprUpdate
|
||||
{
|
||||
background-position: -7px -603px;
|
||||
}
|
||||
.sprPublish
|
||||
{
|
||||
background-position: -7px -504px;
|
||||
}
|
||||
.sprToPublish
|
||||
{
|
||||
background-position: -7px -504px;
|
||||
}
|
||||
.sprLogout
|
||||
{
|
||||
background-position: -7px -306px;
|
||||
}
|
||||
.sprDomain
|
||||
{
|
||||
background-position: -7px -207px;
|
||||
}
|
||||
.sprLiveEdit
|
||||
{
|
||||
background-position: -7px -706px;
|
||||
}
|
||||
.sprChangeDocType
|
||||
{
|
||||
background-position: -12px -741px;
|
||||
}
|
||||
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
@@ -0,0 +1,38 @@
|
||||
.sprTreeDeveloperCacheItem {background-position: -6px -8px ! important;}
|
||||
.sprTreeDeveloperCacheTypes {background-position: -6px -40px ! important;}
|
||||
.sprTreeDeveloperMacro {background-position: -6px -72px ! important;}
|
||||
.sprTreeDeveloperPython {background-position: -6px -104px ! important; width: 15px; height: 15px}
|
||||
.sprTreeDeveloperRegistry {background-position: -6px -135px ! important;}
|
||||
.sprTreeDoc {background-position: -6px -199px ! important;}
|
||||
.sprTreeDoc2 {background-position: -6px -231px ! important;}
|
||||
.sprTreeDoc3 {background-position: -6px -263px ! important;}
|
||||
.sprTreeDoc4 {background-position: -6px -295px ! important;}
|
||||
.sprTreeDoc5 {background-position: -6px -327px ! important;}
|
||||
.sprTreeDocPic {background-position: -6px -359px ! important;}
|
||||
.sprTreeFolder {background-position: -6px -391px ! important;}
|
||||
.sprTreeFolder_o {background-position: -6px -423px ! important;}
|
||||
.sprTreeMediaFile {background-position: -6px -455px ! important;}
|
||||
.sprTreeMediaMovie {background-position: -6px -487px ! important;}
|
||||
.sprTreemediaFile {background-position: -6px -519px ! important;}
|
||||
.sprTreeMediaPhoto {background-position: -6px -551px ! important;}
|
||||
.sprTreeMember {background-position: -6px -583px ! important;}
|
||||
.sprTreeMemberGroup {background-position: -6px -615px ! important;}
|
||||
.sprTreeMemberType {background-position: -6px -647px ! important;}
|
||||
.sprTreeNewsletter {background-position: -6px -679px ! important;}
|
||||
.sprTreePackage {background-position: -6px -711px ! important;}
|
||||
.sprTreeRepository {background-position: -6px -743px ! important;}
|
||||
.sprTreeSettingAgent {background-position: -6px -775px ! important;}
|
||||
.sprTreeSettingCss {background-position: -6px -807px ! important;}
|
||||
.sprTreeSettingCssItem {background-position: -6px -839px ! important;}
|
||||
.sprTreeSettingDataType {background-position: -6px -871px ! important;}
|
||||
.sprTreeSettingDataTypeChild {background-position: -6px -903px ! important;}
|
||||
.sprTreeSettingDomain {background-position: -6px -935px ! important;}
|
||||
.sprTreeSettingLanguage {background-position: -6px -967px ! important;}
|
||||
.sprTreeSettingScript {background-position: -6px -999px ! important;}
|
||||
.sprTreeSettingTemplate {background-position: -6px -1031px ! important;}
|
||||
.sprTreeSettingXml {background-position: -6px -1063px ! important;}
|
||||
.sprTreeStatistik {background-position: -6px -1095px ! important;}
|
||||
.sprTreeUser {background-position: -6px -1127px ! important;}
|
||||
.sprTreeUserGroup {background-position: -6px -1159px ! important;}
|
||||
.sprTreeUserType {background-position: -6px -1191px ! important;}
|
||||
.sprNew{background-position: -6px -339px;}
|
||||