MCPcopy
hub / github.com/pyload/pyload / Package

Function Package

module/web/media/js/pyplex/package.js:83–369  ·  view source on GitHub ↗
(ui, id, ele)

Source from the content-addressed store, hash-verified

81}
82
83function Package (ui, id, ele){
84 // private variables
85 var linksLoaded = false;
86 var thisObject;
87 var buttons;
88 var name;
89 var password;
90 var folder;
91
92 this.initialize = function () {
93 thisObject = this;
94 if (!ele) {
95 this.createElement();
96 } else {
97 jQuery.data(ele,"pid", id);
98 this.parseElement();
99 }
100
101 var pname = $(ele).find('.packagename');
102
103 buttons = $(ele).find('.buttons');
104 buttons.css("opacity", 0);
105
106 $(pname).mouseenter(function(e) {
107 $(this).find('.buttons').fadeTo('fast', 1)
108 });
109
110 $(pname).mouseleave( function(e) {
111 $(this).find('.buttons').fadeTo('fast', 0)
112 });
113 };
114
115 this.createElement = function () {
116 alert("create");
117 };
118
119 this.parseElement = function () {
120 var imgs = $(ele).find('span');
121
122 name = $(ele).find('.name');
123 folder = $(ele).find('.folder');
124 password = $(ele).find('.password');
125
126 $(imgs[3]).click(this.deletePackage);
127 $(imgs[4]).click(this.restartPackage);
128 $(imgs[5]).click(this.editPackage);
129 $(imgs[6]).click(this.movePackage);
130 $(imgs[7]).click(this.editOrder);
131
132 $(ele).find('.packagename').click(this.toggle);
133 };
134
135 this.loadLinks = function () {
136 indicateLoad();
137 $.get("{{'/json/package/'|url}}" + id, thisObject.createLinks)
138 .fail(function () {
139 indicateFail();
140 return false;

Callers

nothing calls this directly

Calls 15

attrMethod · 0.80
$Function · 0.70
indicateLoadFunction · 0.70
indicateFailFunction · 0.70
indicateFinishFunction · 0.70
indicateSuccessFunction · 0.70
dataMethod · 0.45
findMethod · 0.45
failMethod · 0.45
getMethod · 0.45
matchMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected