From 14fb5f7c7658c6a8d6b04074df62d03422075d16 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Fri, 5 Dec 2014 22:56:15 +0000 Subject: [PATCH] rm git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@2077 2a923420-c742-0410-a762-8d5b09965624 --- .../images/ios-style-checkboxes/off.png | Bin 2577 -> 0 bytes .../images/ios-style-checkboxes/on.png | Bin 2496 -> 0 bytes .../images/ios-style-checkboxes/slider.png | Bin 1228 -> 0 bytes .../ios-style-checkboxes/slider_center.png | Bin 260 -> 0 bytes .../ios-style-checkboxes/slider_left.png | Bin 324 -> 0 bytes .../ios-style-checkboxes/slider_right.png | Bin 321 -> 0 bytes .../images/iphone-style-checkboxes | 1 - .../iphone-style-checkboxes.css | 146 ----------- .../iphone-style-checkboxes.js | 238 ------------------ 9 files changed, 385 deletions(-) delete mode 100644 webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/off.png delete mode 100644 webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/on.png delete mode 100644 webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/slider.png delete mode 100644 webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/slider_center.png delete mode 100644 webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/slider_left.png delete mode 100644 webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/slider_right.png delete mode 120000 webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/iphone-style-checkboxes delete mode 100644 webif/html/lib/jquery.plugin/iphone-style-checkboxes/iphone-style-checkboxes.css delete mode 100644 webif/html/lib/jquery.plugin/iphone-style-checkboxes/iphone-style-checkboxes.js diff --git a/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/off.png b/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/off.png deleted file mode 100644 index f414051ecc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}%G>wH@1&6~gI=H>;xeEI564?;iAzx?_u9oKOk*KvKu n>y`ih%>&T)*VorK{|GPu)`q)bTUQLr00000NkvXXu0mjfHH7I4 diff --git a/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/on.png b/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/on.png deleted file mode 100644 index 94425e5841c89fb0b226d987b1a6d9199c372b3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2496 zcmV;x2|xCUP)T_dK+_V#Eq* zk%)-+2_zyCGJb?FKt!ZSr2Gsa2|okLfB>eF@0^*Hvh zs?z7*{O}nO{p5eX^gm&LZEIWG+CIp}-T-~!KYx38^YPpJ*H7f`9{o`vW+n|6_&?!q z`cFDyw|q?7Ic2!29QNmxLu*|d;XdXQF|}T%Nut;am8SDi&HXWhOw1s}uxV_l$qu*J zy9Xz30UKI6Fw+6eyPWYU@-4hB!)p^KKR$l+$=ipI-jTSCL^dM-$t05on+!CEcPcxd z?9+wEdKpIT&1C7%>!h8detGa6y=H7^>A+M6_~bbkUdPvNPTbdzPw!}Zcunl?Nwz!h z2yN*m?-5m_9Y6M_t{xen9xdb%!sfoS3om#JljcSPQX2sVBS;t{0J+Ov%=KflbYS8X z6py28YvFYnUcnQ3+8*AJyMK(KSTIB^l9~uc2<#Z=&Zz!NL;Gm=2>zE^*!dE5w;y|H zFn%2QB4b$(qS2i>v7(Ibw@-0P*eo45(}8lI)&>?{=XeEAC>o&c{+0KF9!T!I5n`8( z5XIb3ve3y)TZ>=fPPXn|4J&ahXd-BCGhLWP9QuY?@!7_bXii&72KtIJB1mkpDbGSM z@??A74wg%`#_T8n=jY%X!6wPJbYP?daeo)D@WSgtyf)_?ZQH%~f_y0EJt2vn5byo4 zvpm?&onxDr>NT2Ze5@wN+Sq$+>Ge>~^1{)^^HCcI{aClPyyY9gX6e9G2Zqorye`Ho z8ljK}av>Qlo8K1_z8fU5w0cJ-VAN(s8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}cTsS_6me z@yVn^w$2Ye_qAg~yma792WC~Ih1VfoDID{bXOol<3i~WHhhEa&D7ty$re|Z1JG7)#dnc$pY5#vIIAS&C-D*9q1P3*x|A8n&Xw0 z^2iD4tusP4rM`zV1&6w?@@63$J6m!pe$&3Ozqb&U(9C9kVO(cOyNKP25D&TG6>e9K4elv!(@L29_v*IC}FFa&{>A>y1 zUTk>jz=;l+a{2nsT#Q#(WBS+Uf8Kv9kFWg6XaDnGbqS?Z$*M($S@p%5=S(+K;|z$} z$g~Xrcr?$IfeCW8IxyiG#EO7fX&Is4z<~~QnHV-+%);vouiy!N|NQS?U;X|5kGGFRku${Ps_E^gNbxW$22=W# zaNQ=83FFZ`5VbUL0{+1+AJ2UoHUKwN_8tE`%__!LXML2B3m13CyKo`%HdNgRHcJQg zI>6emSGK-0FTjgK?DpL+zlYzt`ZJ~9!1^hzZEb5?+XveI7hnKwWQ&MY#%uck0000< KMNUMnLSTYI@WUwp diff --git a/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/slider.png b/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/slider.png deleted file mode 100644 index 80e05ff2dde736f92872019c10e6e69e4caf7179..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1228 zcmV;-1T*`IP)+dQ(pVRYZe}Df92L}hw z(vL4YJ3DJzTU)feyi6o{Uit#+o8Z<<`XKbQep=Y;XN#NZ_fBsC{ki)?*Vor{c6RnH zb-tLVuXnq-6*2FZ%c6hiwcmG+9`Xw@hzw%7KDl>oB?6pVrE7-lDj`mNA$% zHa2K!X=&}` zQCo-(yXJ>%{)!*6?*U42UHdJeVXIAF(dqE(>fpTXl3gV_xwxjuEp09X5H17gps850 z;7J~8A%L!BRVIz(%?n`2VVL^dat1`@>I9ycw}MoIiQw!n-5IFID?(lo%JM5i8hoYPxPIQBFYBvs;dhdEUE$lHbtC}_``U&!bOl_1075lx|^f8 zQ2|%C=XSPzQQ8cQE>iatrI#il%N5ZBxI^csTaKB$T`O|fdx552$D|E7n>`fK?Ue9) zgM4s0w^jmF+Xqe$JgyN3h*^bVAUdmw1`CnJx#Q_6cguuwG$6RUl`6oS0xkXY-!S23 zfS?>|R63XDwVh&yfYLeA`UGYgM!TgK}I_0jsq-)@+}m5XY3{u!9NL@Fc~zIaXgt$F&3VG<_M*89xjmPh*A{IBh68 zC9t3NIjc1(|w#y1z zd%VchBEiPFH^{x4uQ@m7}Ahe9Ql! qH~!5>yzzh48~^LQy}hgd0t^6MQ^T06mz3!M0000i zsd#E)vfFS1BxGB=t^*+idJkfZ#1b$8KILp>BJa=w*2e?R>ZFMr>$0Q)(&OAKtjW_Y z7&ietEH)YwgPhX%g*-G9LB+&@qsN5Yd7g*sloBy>vw@sHXlja-Qu+#5mTzAH>$*|n z$S~AehuXgH)*(iI$Dy&P3-3J7LA$QYwvnOteUGo2rm55Z0t^6tOGp^$Su~UY0000< KMNUMnLSTa9gK3li diff --git a/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/slider_left.png b/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/ios-style-checkboxes/slider_left.png deleted file mode 100644 index 51576ce351944e96229b04bfa03f8f03e907e9ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 324 zcmV-K0lWT*P)$+ma!JqEi%8`jz}$IH&>I5C#~pELZ9uqT21yUVFdi6z z&R`?^zg{I1Q|2Gz=NToC-jt`3*w$$wy(z^UGHz=CkE1&^mMKGpL-c=+J}C!hjHZPJ z8+EZ@!}t+^z~1!UeL9;Zfa--y(=_CqGoQdXR8@7W>zcamtuh^;EX(k7=kRl10R{jI W5i+_owTc4(0000b$oD9c+P3`xaMbu}n#PfH zPUd;WFbpRpcYHZtP!t8Ks(M#q&jP{idP7;3n&ZO~kq0owK=E55*4Hu*jd5&$_PNuK)u8EfzVU TqbKrS00000NkvXXu0mjf#?yy8 diff --git a/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/iphone-style-checkboxes b/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/iphone-style-checkboxes deleted file mode 120000 index 253829e..0000000 --- a/webif/html/lib/jquery.plugin/iphone-style-checkboxes/images/iphone-style-checkboxes +++ /dev/null @@ -1 +0,0 @@ -ios-style-checkboxes \ No newline at end of file diff --git a/webif/html/lib/jquery.plugin/iphone-style-checkboxes/iphone-style-checkboxes.css b/webif/html/lib/jquery.plugin/iphone-style-checkboxes/iphone-style-checkboxes.css deleted file mode 100644 index 6768f5e..0000000 --- a/webif/html/lib/jquery.plugin/iphone-style-checkboxes/iphone-style-checkboxes.css +++ /dev/null @@ -1,146 +0,0 @@ -.iPhoneCheckContainer { - -webkit-transform:translate3d(0,0,0); - position: relative; - height: 27px; - cursor: pointer; - overflow: hidden; } - .iPhoneCheckContainer input { - position: absolute; - top: 5px; - left: 30px; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); - opacity: 0; } - .iPhoneCheckContainer label { - white-space: nowrap; - font-size: 17px; - line-height: 17px; - font-weight: bold; - font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; - cursor: pointer; - display: block; - height: 27px; - position: absolute; - width: auto; - top: 0; - padding-top: 5px; - overflow: hidden; } - .iPhoneCheckContainer, .iPhoneCheckContainer label { - user-select: none; - -moz-user-select: none; - -khtml-user-select: none; } - -.iPhoneCheckDisabled { - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); - opacity: 0.5; } - -label.iPhoneCheckLabelOn { - color: white; - background: url('images/iphone-style-checkboxes/on.png?1284697268') no-repeat; - text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6); - left: 0; - padding-top: 5px; } - label.iPhoneCheckLabelOn span { - padding-left: 8px; } -label.iPhoneCheckLabelOff { - color: #8b8b8b; - background: url('images/iphone-style-checkboxes/off.png?1284697268') no-repeat right 0; - text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6); - text-align: right; - right: 0; } - label.iPhoneCheckLabelOff span { - padding-right: 8px; } - -.iPhoneCheckHandle { - display: block; - height: 27px; - cursor: pointer; - position: absolute; - top: 0; - left: 0; - width: 0; - background: url('images/iphone-style-checkboxes/slider_left.png?1284697268') no-repeat; - padding-left: 3px; } - -.iPhoneCheckHandleRight { - height: 100%; - width: 100%; - padding-right: 3px; - background: url('images/iphone-style-checkboxes/slider_right.png?1284697268') no-repeat right 0; } - -.iPhoneCheckHandleCenter { - height: 100%; - width: 100%; - background: url('images/iphone-style-checkboxes/slider_center.png?1284697268'); } - -.iOSCheckContainer { - position: relative; - height: 27px; - cursor: pointer; - overflow: hidden; } - .iOSCheckContainer input { - position: absolute; - top: 5px; - left: 30px; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); - opacity: 0; } - .iOSCheckContainer label { - white-space: nowrap; - font-size: 17px; - line-height: 17px; - font-weight: bold; - font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; - cursor: pointer; - display: block; - height: 27px; - position: absolute; - width: auto; - top: 0; - padding-top: 5px; - overflow: hidden; } - .iOSCheckContainer, .iOSCheckContainer label { - user-select: none; - -moz-user-select: none; - -khtml-user-select: none; } - -.iOSCheckDisabled { - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); - opacity: 0.5; } - -label.iOSCheckLabelOn { - color: white; - background: url('images/ios-style-checkboxes/on.png?1284697268') no-repeat; - text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6); - left: 0; - padding-top: 5px; } - label.iOSCheckLabelOn span { - padding-left: 8px; } -label.iOSCheckLabelOff { - color: #8b8b8b; - background: url('images/ios-style-checkboxes/off.png?1284697268') no-repeat right 0; - text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6); - text-align: right; - right: 0; } - label.iOSCheckLabelOff span { - padding-right: 8px; } - -.iOSCheckHandle { - display: block; - height: 27px; - cursor: pointer; - position: absolute; - top: 0; - left: 0; - width: 0; - background: url('images/ios-style-checkboxes/slider_left.png?1284697268') no-repeat; - padding-left: 3px; } - -.iOSCheckHandleRight { - height: 100%; - width: 100%; - padding-right: 3px; - background: url('images/ios-style-checkboxes/slider_right.png?1284697268') no-repeat right 0; } - -.iOSCheckHandleCenter { - height: 100%; - width: 100%; - background: url('images/ios-style-checkboxes/slider_center.png?1284697268'); } diff --git a/webif/html/lib/jquery.plugin/iphone-style-checkboxes/iphone-style-checkboxes.js b/webif/html/lib/jquery.plugin/iphone-style-checkboxes/iphone-style-checkboxes.js deleted file mode 100644 index 01b4888..0000000 --- a/webif/html/lib/jquery.plugin/iphone-style-checkboxes/iphone-style-checkboxes.js +++ /dev/null @@ -1,238 +0,0 @@ -/*! -// iPhone-style Checkboxes jQuery plugin -// Copyright Thomas Reynolds, licensed GPL & MIT -*/ -;(function($, iphoneStyle) { - -$.fn._width = function() -{ - if ($.fn.actual != null) - return $(this).actual('width'); - return $(this).width(); -}; - -// Constructor -$[iphoneStyle] = function(elem, options) { - this.$elem = $(elem); - - // Import options into instance variables - var obj = this; - $.each(options, function(key, value) { - obj[key] = value; - }); - - // Initialize the control - this.wrapCheckboxWithDivs(); - this.attachEvents(); - this.disableTextSelection(); - - if (this.resizeHandle) { this.optionallyResize('handle'); } - if (this.resizeContainer) { this.optionallyResize('container'); } - - this.initialPosition(); -}; - -$.extend($[iphoneStyle].prototype, { - // Wrap the existing input[type=checkbox] with divs for styling and grab DOM references to the created nodes - wrapCheckboxWithDivs: function() { - this.$elem.wrap('
'); - this.container = this.$elem.parent(); - - this.offLabel = $('').appendTo(this.container); - this.offSpan = this.offLabel.children('span'); - - this.onLabel = $('').appendTo(this.container); - this.onSpan = this.onLabel.children('span'); - - this.handle = $('
' + - '
' + - '
' + - '
' + - '
').appendTo(this.container); - }, - - // Disable IE text selection, other browsers are handled in CSS - disableTextSelection: function() { - return; -// if (!$.browser.msie) { return; } - - // Elements containing text should be unselectable - $.each([this.handle, this.offLabel, this.onLabel, this.container], function() { - $(this).attr("unselectable", "on"); - }); - }, - - // Automatically resize the handle or container - optionallyResize: function(mode) { - var onLabelWidth = this.onLabel._width(); - offLabelWidth = this.offLabel._width(); - - if (mode == 'container') { - var newWidth = (onLabelWidth > offLabelWidth) ? onLabelWidth : offLabelWidth; - newWidth += this.handle._width() + 15; - } else { - var newWidth = (onLabelWidth < offLabelWidth) ? onLabelWidth : offLabelWidth; - } - - this[mode].css({ width: newWidth }); - }, - - attachEvents: function() { - var obj = this; - - // A mousedown anywhere in the control will start tracking for dragging - this.container - .bind('mousedown touchstart', function(event) { - event.preventDefault(); - - if (obj.$elem.is(':disabled')) { return; } - - var x = event.pageX || event.originalEvent.changedTouches[0].pageX; - $[iphoneStyle].currentlyClicking = obj.handle; - $[iphoneStyle].dragStartPosition = x; - $[iphoneStyle].handleLeftOffset = parseInt(obj.handle.css('left'), 10) || 0; - $[iphoneStyle].dragStartedOn = obj.$elem; - }) - - // Utilize event bubbling to handle drag on any element beneath the container - .bind('iPhoneDrag', function(event, x) { - event.preventDefault(); - - if (obj.$elem.is(':disabled')) { return; } - if (obj.$elem != $[iphoneStyle].dragStartedOn) { return; } - - var p = (x + $[iphoneStyle].handleLeftOffset - $[iphoneStyle].dragStartPosition) / obj.rightSide; - if (p < 0) { p = 0; } - if (p > 1) { p = 1; } - obj.handle.css({ left: p * obj.rightSide }); - obj.onLabel.css({ width: p * obj.rightSide + 4 }); - obj.offSpan.css({ marginRight: -p * obj.rightSide }); - obj.onSpan.css({ marginLeft: -(1 - p) * obj.rightSide }); - }) - - // Utilize event bubbling to handle drag end on any element beneath the container - .bind('iPhoneDragEnd', function(event, x) { - if (obj.$elem.is(':disabled')) { return; } - - var checked; - if ($[iphoneStyle].dragging) { - var p = (x - $[iphoneStyle].dragStartPosition) / obj.rightSide; - checked = (p < 0) ? Math.abs(p) < 0.5 : p >= 0.5; - } else { - checked = !obj.$elem.prop('checked'); - } - - obj.$elem.prop('checked', checked); - - $[iphoneStyle].currentlyClicking = null; - $[iphoneStyle].dragging = null; - obj.$elem.change(); - }); - - // Animate when we get a change event - this.$elem.change(function() { - if (obj.$elem.is(':disabled')) { - obj.container.addClass(obj.disabledClass); - return false; - } else { - obj.container.removeClass(obj.disabledClass); - } - - var new_left = obj.$elem.prop('checked') ? obj.rightSide : 0; - - obj.handle.animate({ left: new_left }, obj.duration); - obj.onLabel.animate({ width: new_left + 4 }, obj.duration); - obj.offSpan.animate({ marginRight: -new_left }, obj.duration); - obj.onSpan.animate({ marginLeft: new_left - obj.rightSide }, obj.duration); - }); - }, - - // Setup the control's inital position - initialPosition: function() { - this.offLabel.css({ width: this.container._width() - 5 }); - -// var offset = ($.browser.msie && $.browser.version < 7) ? 3 : 6; - var offset = 6; - this.rightSide = this.container._width() - this.handle._width() - offset; - - if (this.$elem.is(':checked')) { - this.handle.css({ left: this.rightSide }); - this.onLabel.css({ width: this.rightSide + 4 }); - this.offSpan.css({ marginRight: -this.rightSide }); - } else { - this.onLabel.css({ width: 0 }); - this.onSpan.css({ marginLeft: -this.rightSide }); - } - - if (this.$elem.is(':disabled')) { - this.container.addClass(this.disabledClass); - } - } -}); - -// jQuery-specific code -$.fn[iphoneStyle] = function(options) { - var checkboxes = this.filter(':checkbox'); - - // Fail early if we don't have any checkboxes passed in - if (!checkboxes.length) { return this; } - - // Merge options passed in with global defaults - var opt = $.extend({}, $[iphoneStyle].defaults, options); - - checkboxes.each(function() { - $(this).data(iphoneStyle, new $[iphoneStyle](this, opt)); - }); - - if (!$[iphoneStyle].initComplete) { - // As the mouse moves on the page, animate if we are in a drag state - $(document) - .bind('mousemove touchmove', function(event) { - if (!$[iphoneStyle].currentlyClicking) { return; } - event.preventDefault(); - - var x = event.pageX || event.originalEvent.changedTouches[0].pageX; - if (!$[iphoneStyle].dragging && - (Math.abs($[iphoneStyle].dragStartPosition - x) > opt.dragThreshold)) { - $[iphoneStyle].dragging = true; - } - - $(event.target).trigger('iPhoneDrag', [x]); - }) - - // When the mouse comes up, leave drag state - .bind('mouseup touchend', function(event) { - if (!$[iphoneStyle].currentlyClicking) { return; } - event.preventDefault(); - - var x = event.pageX || event.originalEvent.changedTouches[0].pageX; - $($[iphoneStyle].currentlyClicking).trigger('iPhoneDragEnd', [x]); - }); - - $[iphoneStyle].initComplete = true; - } - - return this; -}; // End of $.fn[iphoneStyle] - -$[iphoneStyle].defaults = { - duration: 200, // Time spent during slide animation - checkedLabel: 'ON', // Text content of "on" state - uncheckedLabel: 'OFF', // Text content of "off" state - resizeHandle: true, // Automatically resize the handle to cover either label - resizeContainer: true, // Automatically resize the widget to contain the labels - disabledClass: 'iPhoneCheckDisabled', - containerClass: 'iPhoneCheckContainer', - labelOnClass: 'iPhoneCheckLabelOn', - labelOffClass: 'iPhoneCheckLabelOff', - handleClass: 'iPhoneCheckHandle', - handleCenterClass: 'iPhoneCheckHandleCenter', - handleRightClass: 'iPhoneCheckHandleRight', - dragThreshold: 5 // Pixels that must be dragged for a click to be ignored -}; - -})(jQuery, 'iphoneStyle');