Example #1
0
        public override string Build()
        {
            if (className is string)
            {
                return(string.Format(".removeClass({0})", JQueryUtility.EncodeJsString(className.ToString())));
            }

            return(string.Format(".removeClass({0})", className));
        }
        public override string Build()
        {
            if (newContent is string)
            {
                return(string.Format(".replaceWith(\"{0}\")", JQueryUtility.EncodeJsString(newContent.ToString())));
            }

            return(string.Format(".replaceWith({0})", newContent));
        }
Example #3
0
        public override string Build()
        {
            if (content is string)
            {
                return(string.Format(".append(\"{0}\")", JQueryUtility.EncodeJsString(content.ToString())));
            }

            return(string.Format(".append({0})", content));
        }
        public override string Build()
        {
            if (target is string)
            {
                return(string.Format(".replaceAll(\"{0}\")", JQueryUtility.EncodeJsString(target.ToString())));
            }

            return(string.Format(".replaceAll({0})", target));
        }
Example #5
0
        public override string Build()
        {
            if (wrappingElement is string)
            {
                return(string.Format(".wrap(\"{0}\")", JQueryUtility.EncodeJsString(wrappingElement.ToString())));
            }

            return(string.Format(".wrap({0})", wrappingElement));
        }
Example #6
0
        public override string Build()
        {
            if (value == null)
            {
                return(string.Format(".css(\"{0}\")", JQueryUtility.EncodeJsString(propertyName)));
            }

            return(string.Format(".css(\"{0}\", \"{1}\")", JQueryUtility.EncodeJsString(propertyName), JQueryUtility.EncodeJsString(value)));
        }
Example #7
0
        public override string Build()
        {
            if (content == null)
            {
                return(".before()");
            }

            if (content is string)
            {
                return(string.Format(".before(\"{0}\")", JQueryUtility.EncodeJsString(content.ToString())));
            }

            return(string.Format(".before({0})", content));
        }
Example #8
0
        public override string Build()
        {
            if (selector == null)
            {
                return(".remove()");
            }

            if (selector is string)
            {
                return(string.Format(".remove(\"{0}\")", JQueryUtility.EncodeJsString(selector.ToString())));
            }

            return(string.Format(".remove({0})", selector));
        }
Example #9
0
        public override string Build()
        {
            if (htmlString == null)
            {
                return(".html()");
            }

            if (htmlString is string)
            {
                return(string.Format(".html(\"{0}\")", JQueryUtility.EncodeJsString(htmlString.ToString())));
            }

            return(string.Format(".html({0})", htmlString));
        }
Example #10
0
        public override string Build()
        {
            if (textString == null)
            {
                return(".text()");
            }

            if (textString is string)
            {
                return(string.Format(".text(\"{0}\")", JQueryUtility.EncodeJsString(textString.ToString())));
            }

            return(string.Format(".text({0})", textString));
        }
Example #11
0
        public override string Build()
        {
            if (value == null)
            {
                return(string.Format(".attr(\"{0}\")", JQueryUtility.EncodeJsString(attributeName)));
            }

            if (value is string)
            {
                return(string.Format(".attr(\"{0}\",\"{1}\")", JQueryUtility.EncodeJsString(attributeName), JQueryUtility.EncodeJsString(value.ToString())));
            }

            return(string.Format(".attr(\"{0}\",{1})", JQueryUtility.EncodeJsString(attributeName), value));
        }
Example #12
0
        public override string Build()
        {
            if (coordinates == null)
            {
                return(".offset()");
            }

            if (coordinates is string)
            {
                return(string.Format(".offset(\"{0}\")", JQueryUtility.EncodeJsString(coordinates.ToString())));
            }

            return(string.Format(".offset({0})", coordinates));
        }
Example #13
0
        public override string Build()
        {
            if (value == null)
            {
                return(".val()");
            }

            if (value is string)
            {
                return(string.Format(".val(\"{0}\")", JQueryUtility.EncodeJsString(value.ToString())));
            }

            return(string.Format(".val({0})", value));
        }
        public override string Build()
        {
            if (includeMargin == null)
            {
                return(".outerWidth()");
            }

            if (includeMargin is string)
            {
                return(string.Format(".outerWidth(\"{0}\")", JQueryUtility.EncodeJsString(includeMargin.ToString())));
            }

            return(string.Format(".outerWidth({0})", includeMargin));
        }
Example #15
0
        public override string Build()
        {
            if (value == null)
            {
                return(string.Format(".data('{0}')", name));
            }

            if (value is string)
            {
                return(string.Format(".data('{0}', \"{1}\")", name, JQueryUtility.EncodeJsString(value.ToString())));
            }

            return(string.Format(".data('{0}', {1})", name, value));
        }
        public void AddCustomVar(string name, object value, bool isFunction = false)
        {
            if (value == null)
            {
                throw new NullReferenceException();
            }

            if (isFunction || !(value is string))
            {
                customrVars.Add(name, value.ToString());
            }
            else
            {
                customrVars.Add(name, JQueryUtility.EncodeJsString(value.ToString()));
            }
        }
Example #17
0
        public override object RenderField(object value, object[] args)
        {
            var model = value as List <PictureTooltip>;

            if (model == null || model.Count == 0)
            {
                return(null);
            }

            var sb = new StringBuilder();

            sb.AppendLine("<script type=\"text/javascript\">");
            sb.AppendLine("$(document).ready(function(){");

            var pictures = model.GroupBy(x => x.PictureId);

            foreach (var picture in pictures)
            {
                sb.AppendLine(string.Format("var picture = $('#{0}').wrap('<div class=\"ip_slide\" />');", picture.Key));
                foreach (var tooltip in picture)
                {
                    sb.AppendLine(string.Format("picture.after(\"<div class=\\\"ip_tooltip ip_img16\\\" style=\\\"top: {1}px; left: {2}px;\\\" data-button=\\\"{3}\\\" data-tooltipbg=\\\"{4}\\\" data-round=\\\"{5}\\\" data-animationtype=\\\"{6}\\\">{0}</div>\");",
                                                JQueryUtility.EncodeJsString(tooltip.Content, false),
                                                tooltip.Top,
                                                tooltip.Left,
                                                tooltip.Button,
                                                tooltip.Background,
                                                tooltip.Round,
                                                tooltip.AnimationType));
                }
                sb.AppendLine("picture.parent().iPicture();");
            }

            sb.AppendLine("});");
            sb.AppendLine("</script>");

            return(MvcHtmlString.Create(sb.ToString()));
        }
 public override string Build()
 {
     return(string.Format(".removeProp(\"{0}\")", JQueryUtility.EncodeJsString(propertyName)));
 }
Example #19
0
 public override void ExecuteResult(ControllerContext context, StringBuilder scriptBuilder)
 {
     if (string.IsNullOrEmpty(redirectUrl))
     {
         scriptBuilder.AppendLine(parentTarget
                                     ? "window.parent.location.reload();"
                                     : "window.location.reload();");
     }
     else
     {
         scriptBuilder.AppendLine(parentTarget
                                      ? string.Format("window.parent.location = {0};", JQueryUtility.EncodeJsString(redirectUrl))
                                      : string.Format("window.location = {0};", JQueryUtility.EncodeJsString(redirectUrl)));
     }
 }
Example #20
0
 public override void ExecuteResult(ControllerContext context, StringBuilder scriptBuilder)
 {
     scriptBuilder.AppendLine(string.Format("alert({0});", JQueryUtility.EncodeJsString(message)));
 }
 public void NotifyError(string message)
 {
     Callbacks.Add(string.Format("$('body').trigger({{ type: 'SystemMessageEvent', SystemMessage: 'NOTIFY_ERROR', Data: {{ Message: {0} }} }});", JQueryUtility.EncodeJsString(message)));
 }
Example #22
0
 public override string Build()
 {
     return(string.Format(".toggleClass(\"{0}\",{1})", JQueryUtility.EncodeJsString(className), switchs));
 }
Example #23
0
 public override void ExecuteResult(ControllerContext context, StringBuilder scriptBuilder)
 {
     scriptBuilder.AppendLine(string.Format("if(self != top){{ parent.$('body').trigger({{ type: 'SystemMessageEvent', SystemMessage: {0}, Data: {1} }}); }} $('body').trigger({{ type: 'SystemMessageEvent', SystemMessage: {0}, Data: {1} }});", JQueryUtility.EncodeJsString(systemMessage), data != null ? JObject.FromObject(data).ToString() : "{}"));
 }
Example #24
0
 public override string Build()
 {
     return(string.Format(".hasClass(\"{0}\")", JQueryUtility.EncodeJsString(className)));
 }
 public override string Build()
 {
     return(string.Format(".removeAttr(\"{0}\")", JQueryUtility.EncodeJsString(attributeName)));
 }