I'm trying to place a Markdown Editor inside jQuery-UI Tabs, but the editor is not being shown.
<% Using Html.BeginForm()%>
<div id="AddEventWizard">
<ul>
<li>Event Title</li>
<li>Event Description</li>
</ul>
<div id="tabs-1">
<%: Html.LabelFor(Function(model) model.Name)%>
<%: Html.TextBoxFor(Function(model) model.Name, New With{.class = "full-width-input"})%>
<%: Html.ValidationMessage("Name", "*")%>
</div>
<div id="tabs-2">
<noscript><h3>Please use
<%: Html.ActionLink("Markdown", "Markdown", "About")%>
to style your input.</h3></noscript>
<div id="wmd-button-bar" class="wmd-panel">
</div>
<%: Html.TextAreaFor(Function(model) model.Description, 5, 10, New With {.id = "wmd-input", .class = "wmd-panel"})%>
<div id="wmd-preview" class="wmd-panel">
</div>
<div class="clear">
</div>
</div>
</div>
<% End Using%>
<script type="text/javascript">
$(document).ready(function () {
$('textarea#wmd-input:not(.processed)').TextAreaResizer();
$("#AddEventWizard").tabs({
});
}); // closes document.ready
</script>
There is space where the editor buttons "should" be, but they're not there. Does anyone know if the jQuery-UI stuff somehow blocks WMD Markdown?
Edit:
I'm using the version from Github
HTML Markup
<form action="/events/addevent" method="post">
<div id="AddEventWizard">
<ul>
<li>Event Title</li>
<li>Event Details</li>
<li>Event Description</li>
</ul>
<div id="tabs-1">
<label for="Name">Name</label>
<input class="full-width-input" id="Name" name="Name" type="text" value="" />
</div>
<div id="tabs-2"></div>
<div id="tabs-3">
<noscript><h3>Please use
Markdown
to style your input.</h3></noscript>
<div id="wmd-button-bar" class="wmd-panel">
</div>
<textarea class="wmd-panel" cols="10" id="wmd-input" name="Description" rows="5">
</textarea>
<div id="wmd-preview" class="wmd-panel">
</div>
<div class="clear">
</div>
</div>
</div>
</form>
<script type="text/javascript">
$(document).ready(function () {
$('textarea#wmd-input:not(.processed)').TextAreaResizer();
$("#AddEventWizard").tabs({
});
}); // closes document.ready
</script>
<script src="../../Assets/Scripts/wmd.js" type="text/javascript"></script>
<script src="../../Assets/Scripts/showdown.js" type="text/javascript"></script>
<script src="../../Assets/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="../../Assets/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script src="../../Assets/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
<script src="../../Assets/Scripts/jquery.textarearesizer.compressed.js" type="text/javascript"></script>
Maybe you can bind the editor
$('textarea#wmd-input:not(.processed)').TextAreaResizer();
not on $(document).ready but on the click of tab3?
in that way, the editor gets loaded when the textbox is visible.
Related
I want to use Bootstrap DateTimePicker in my web application.
I used this tutorial but it does not work for me.
This is my code (all libraries are imported)
<head>
<script type="text/javascript" src="/scripts/jquery.min.js"></script>
<script type="text/javascript" src="/scripts/moment.min.js"></script>
<script type="text/javascript" src="/scripts/bootstrap.min.js"></script>
<script type="text/javascript" src="/scripts/bootstrap-datetimepicker.*js"></script>
<link rel="stylesheet" href="/Content/bootstrap-datetimepicker.css" />
</head>
<body>
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</div>
</div>
</body>
thank you
I have been tryng to use this datetimepicker for the last few days and no matter what i try the best i can get is the calendar appearing in the top left hand corner. I cannot find any real tutorials on how to implement the control and past answers on this site havent helped either.
Here is what i have now:
View
#Scripts.Render("~/Scripts/knockout-3.4.0.js")
#Scripts.Render("~/Scripts/jquery-1.10.2.js")
#Scripts.Render("~/bundles/bootstrap")
#Styles.Render("~/Content/css")
<script type="text/javascript" src="/Scripts/jquery.min.js"></script>
<script type="text/javascript" src="/Scripts/moment.min.js"></script>
<script type="text/javascript" src="/Scripts/bootstrap.min.js"></script>
<script type="text/javascript" src="/Scripts/bootstrap-datetimepicker.js"></script>
<link rel="stylesheet" href="/Content/bootstrap-datetimepicker.css" />
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
</div>
<script>
$(function() {
$('#datetimepicker1').datetimepicker();
});
</script>
In reference to addressing your second issue with the calendar glyphicon being spaced apart from the input you need to do either of these (your preference):
<div class="row">
<div class='col-sm-6' /*change this to col-sm-3 or any that is below 6*/>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar></span>
</span>
</div>
</div>
</div>
OR:
<div class="row">
<div style="width: 25%;/*or something close to that*/" class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
Also just a nit picky thing.. try to keep your Scripts and Styles together and not mixed between each other.. makes for easier reading.
The js script "bootstrap-datetimepicker"
requires Moment.js and Jquery.js to be loaded first.
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/bootstrap.js",
"~/Scripts/bootstrap.min.js",
"~/Scripts/moment.js",
"~/Scripts/moment.min.js",
"~/Scripts/modernizr-2.6.2.js",
"~/Scripts/bootstrap-datetimepicker.js"));
When I run this project from the terminal like so
cd to AppointmentScheduler
node index.js
I am now receiving the following erorr in the console
Uncaught TypeError: undefined is not a functionangular-route.js:26 (anonymous function)angular-route.js:6 (anonymous function)
This is the index.html
<html>
<head ng-app="appointments">
<title>Appointments</title>
<script type="text/javascript" src="js/lib/angular.min.js"></script>
<script type="text/javascript" src="js/lib/angular-resource.min.js"></script>
<script type="text/javascript" src="js/controllers/app.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/lib/angular-route.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.min.css">
</head>
<body>
<div class="container">
<h1>Piar Appointments Scheduler</h1>
<div ng-view></div>
</div>
</body>
</html>
This is the login.html
<div class="row-fluid">
<form class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label" required>Email</label>
<div class="col-sm-8">
<input type="email" class="form-control" id="inputEmail3" placeholder="Email" required>
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Password</label>
<div class="col-sm-8">
<input type="password" class="form-control" id="inputPassword3" placeholder="Password">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox"> Remember me
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Sign in</button>
</div>
</div>
</form>
</div>
This is the public/js/app.js
var appointments = angular.module('appointments', ['ngRoute']);
appointments.config(function ($routeProvider) {
$routeProvider
.when('/',
{templateUrl: 'partials/login.html'})
})
This is the public/js/controllers/app.js That has been edited, sorry about the error of repeating the content of the public/js/app.js here
function LoginCtrl ($scope)
{
}
currently watching up and running with angularjs by Joseph LeBlanc from Lynda.com
Your js/app.js and js/controllers/app.js seems to be exactly the same - but I think the problem is that you are trying to use ngRoute without loading it
<script type="text/javascript" src="js/lib/angular-route.min.js"></script>
Also, put ng-app to <html> or <body> element, if you have in on <head>, that will be the root element of your application so it won't even touch <body>
I want to add "back button" panel for my app but only for iphones.
I am using vs2013 Multi Device Hybrid Apps plugin to develope mobile app. After a lot errors and problems I managed to start coding phase, the thing is android devices have panel to "back" or other stuff. But I need to set it also for iphones. Project has "merges" folder, I believe that part using for it. (I dont want to add that extra button for whole project, only iphone is enough for me as you know android devices have panel to "back" or other stuff.)
If its possible; how can I do that? Here is one of my page example ;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Föy</title>
<link href="css/index.css" rel="stylesheet" />
<script src="scripts/jquery-1.8.3.min.js"></script>
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/login.css" rel="stylesheet" />
<script>
$(document).ready(function () {
$("#btnLogin").click(function () {
window.location = "main.html";
})
});
</script>
</head>
<body>
<div class="container" id="login-block">
<div class="row">
<div class="col-sm-6 col-md-4 col-sm-offset-3 col-md-offset-4">
<h3 class="animated bounceInDown">FÖY Fatura Ödeme Sistemleri</h3>
<div class="login-box clearfix animated flipInY">
<div class="login-logo">
<img src="images/logo.png" alt="Company Logo" />
</div>
<hr />
<div class="login-form">
<div class="alert alert-error hide">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4>Hata!</h4>
İşlem Sırasında Hata Oluştu
</div>
<div>
<input type="text" class="form-control" id="txtUser" placeholder="Bayi Kodu" required />
<input type="password" class="form-control" id="txtPassword" placeholder="Şifre" required />
<button type="button" id="btnLogin" class="btn btn-red">GİRİŞ</button>
</div>
<div class="login-links">
<a href="forgot-password.html">
Şifremi Unuttum?
</a>
<br />
<a href="sign-up.html">
Bayi Değilim? <strong>Bayi Ol!</strong>
</a>
</div>
</div>
</div>
<div class="social-login row">
<div class="fb-login col-lg-6 col-md-12 animated flipInX">
<strong>Facebook</strong> ile bağlan
</div>
<div class="twit-login col-lg-6 col-md-12 animated flipInX">
<strong>Twitter</strong> ile bağlan
</div>
</div>
</div>
</div>
</div>
<script src="cordova.js"></script>
<script src="scripts/platformOverrides.js"></script>
<script src="scripts/index.js"></script>
</body>
</html>
Thank You , Best Regards
Put your platform specific file within the merges\ios\ folder and it should get picked up during build. More information and guidance can be found here
I have the following code. What I am doing is to show data and then I have a delete button.
I cannot get the jquery dialog box to come up. I am not sure what I am doing wrong.
#model data_Input
<script src="#Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="#Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div data-role="page" data-theme="b">
<div id="main" data-role="content">
<div style = "padding-bottom: 10px; padding-top: 20px" class="editor-label">
#Html.Label("Type"): #Html.DisplayFor(m => m.data_Name)
</div>
<div class="editor-label">
#Html.Label("Value"): #Html.DisplayFor(m => m.Date)
</div>
<p>
Open dialog
</p>
</div>
</div>
<!-- Start of second page -->
<div data-role="page" id="dialog">
<div data-role="header">
<h1>
Bar
</h1>
</div><!-- /header -->
<div data-role="content">
<p>
I'm second in the source order so I'm not shown as the page initally.
</p>
<p>
Back to foo
</p>
</div><!-- /content -->
<div data-role="footer">
<h4>
Page Footer
</h4>
</div><!-- /footer -->