|
111
|
Programación / Desarrollo Web / BootStrap 3 sin Jquery [CODE]
|
en: 19 Abril 2015, 20:34 pm
|
Hola a todos, quiero usar las plantillas CSS sin jquery. Este es un ejemplo que encontre, lo estoy pasando a javascript. Creo que ya resolvi la parte del navbar, si tienen sugerencias o detectan errores lo apreciaria mucho. <!DOCTYPE html> <title>Bootstrap 3 Responsive Layout Example </title> <link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.min.css"> hasClass = function (el, cl) { var regex = new RegExp('(?:\\s|^)' + cl + '(?:\\s|$)'); return !!el.className.match(regex); } function hideMenu(ob){ var menuD = document.querySelector( ob.getAttribute('data-target') ); if( hasClass(menuD, 'in') ){ menuD.classList.remove('in'); menuD.style.display = 'none'; } } function hideSubMenu(ob){ var menuD = ob.parentNode; if( hasClass(menuD, 'open') ){ menuD.classList.remove('open'); } } function showMenu(e){ var ob = e.target; var menuD = document.querySelector( ob.getAttribute('data-target') ); if( hasClass(menuD, 'in') ){ menuD.classList.remove('in'); menuD.style.display = 'none'; } else { menuD.classList.add('in'); menuD.style.display = 'block'; } } function showSubMenu(e){ var ob = e.target; var menuD = ob.parentNode; if( hasClass(menuD, 'open') ){ menuD.classList.remove('open'); } else { menuD.classList.add('open'); } } <nav id="myNavbar" class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbarCollapse"> <span class="sr-only">Toggle navigation </span> <a class="navbar-brand" href="#">Tutorial Republic </a> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="navbarCollapse"> <ul class="nav navbar-nav"> <li class="active"><a href="http://www.tutorialrepublic.com" target="_blank">Home </a></li> <li><a href="http://www.tutorialrepublic.com/about-us.php" target="_blank">About </a></li> <li><a href="http://www.tutorialrepublic.com/contact-us.php" target="_blank">Contact </a></li> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button">Dropdown 1 <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="#">Components </a></li> <li><a href="#">javascript </a></li> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button">Dropdown 2 <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="#">Action </a></li> <li><a href="#">Another action </a></li> <li><a href="#">Something else here </a></li> <li class="divider"></li> <li class="dropdown-header">Nav header </li> <li><a href="#">Separated link </a></li> <li><a href="#">One more separated link </a></li> </nav> <h1>Learn to Create Websites </h1> <p>In today's world internet is the most popular way of connecting with the people. At <a href="http://www.tutorialrepublic.com" target="_blank">tutorialrepublic.com </a> you will learn the essential of web development technologies along with real life practice example, so that you can create your own website to connect with the people around the world. </p> <p><a href="http://www.tutorialrepublic.com" target="_blank" class="btn btn-success btn-lg">Get started today </a></p> <div class="col-sm-6 col-md-4 col-lg-2"> <p>HTML is a markup language that is used for creating web pages. The HTML tutorial section will help you understand the basics of HTML, so that you can create your own web pages or website. </p> <p><a href="http://www.tutorialrepublic.com/html-tutorial/" target="_blank" class="btn btn-success">Learn More »</a></p> <div class="col-sm-6 col-md-4 col-lg-2"> <p>CSS is used for describing the presentation of web pages. The CSS tutorial section will help you learn the essentials of CSS, so that you can fine control the style and layout of your HTML document. </p> <p><a href="http://www.tutorialrepublic.com/css-tutorial/" target="_blank" class="btn btn-success">Learn More »</a></p> <div class="clearfix visible-sm-block"></div> <div class="col-sm-6 col-md-4 col-lg-2"> <p>Bootstrap is a powerful front-end framework for faster and easier web development. The Bootstrap tutorial section will help you learn the techniques of Bootstrap so that you can create web your own website with much less efforts. </p> <p><a href="http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/" target="_blank" class="btn btn-success">Learn More »</a></p> <div class="clearfix visible-md-block"></div> <div class="col-sm-6 col-md-4 col-lg-2"> <p>The references section outlines all the standard HTML tags and CSS properties along with other useful references such as color names and values, symbols and character entities, web safe fonts, language codes, HTTP messages and much more. </p> <p><a href="http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/" target="_blank" class="btn btn-success">Learn More »</a></p> <div class="clearfix visible-sm-block"></div> <div class="col-sm-6 col-md-4 col-lg-2"> <p>The examples section encloses an extensive collection of examples on various topic that you can try and test yourself using online HTML editor. </p> <p><a href="http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/" target="_blank" class="btn btn-success">Learn More »</a></p> <div class="col-sm-6 col-md-4 col-lg-2"> <p>The collection of Frequently Asked Questions (FAQ) provides brief answers to many common questions related to web design and development. </p> <p><a href="http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/" target="_blank" class="btn btn-success">Learn More »</a></p> <footer> <p>© Copyright 2013 Tutorial Republic </p> </footer> document.addEventListener('click', function(e) { var oMenu = document.getElementById('collapse'); oMenu = document.querySelector('button.navbar-toggle'); if(e.target == oMenu ) showMenu(e); else if( hasClass(e.target, 'dropdown-toggle') ) showSubMenu(e); else { hideMenu( oMenu ); listaSub = document.getElementsByClassName('dropdown-toggle'); for (i= 0; i < listaSub.length; i++) { hideSubMenu(listaSub[i]); } /* Array.prototype.forEach.call(listaSub, function(el) { // Do stuff with the element hideSubMenu(el); });*/ } });
saludos.
|
|
|
114
|
Programación / .NET (C#, VB.NET, ASP) / Re: Agregar Recurso a un archivo EXE [F1]
|
en: 23 Marzo 2015, 17:42 pm
|
Gracias Elektro. Ya probe tu ultimo codigo y funciona! asi me libro de liarme más con el formato PE hice un pequeño cambio para el .net framework 2.0, ahora me agrega un recurso .resources, me toca leerlo desde el asembly gracias nuevamente Public Sub addResources(ByVal pathRecurso As String, ByVal pathDll As String) Try Dim resX As ResourceWriter resX = new ResourceWriter(pathRecurso) With resX .AddResource("String Resource", "Hello World!" ) End With resX.Close() ' Compile an assembly.dll that contains the ResX file as an embedded resource. Dim codeProvider As CodeDomProvider = CodeDomProvider.CreateProvider("VB") ' or New VBCodeProvider() Dim parameters As CompilerParameters = New CompilerParameters() With parameters .GenerateExecutable = False .OutputAssembly = pathDll .EmbeddedResources.Add(pathRecurso) End With Dim results As CompilerResults = codeProvider.CompileAssemblyFromSource(parameters, "Public class ResourceClass : End Class") msgbox("OK!") Catch ex As Exception msgbox(ex.Message) End Try End Sub
Una consulta sobre esta parte, entiendo que pasas los parametros de compilación, para que sirve "Public class..." o es que en este caso no es necesario? Dim results As CompilerResults = codeProvider.CompileAssemblyFromSource(parameters, "Public class ResourceClass : End Class")
Public Overridable Function CompileAssemblyFromSource ( _ options As CompilerParameters, _ ParamArray sources As String() _ ) As CompilerResults
Parámetros
options Tipo: System.CodeDom.Compiler.CompilerParameters Objeto CompilerParameters que indica la configuración de compilador para esta compilación.
sources Tipo: System.String() Matriz de cadenas de código fuente que se van a compilar.
Saludos.
|
|
|
115
|
Programación / .NET (C#, VB.NET, ASP) / Re: Agregar Recurso a un archivo EXE [F1]
|
en: 23 Marzo 2015, 16:00 pm
|
Hola, Eleкtro Muchas gracias por compartir. Tu codigo anterior esta bueno pero no era lo que buscaba. Lo último voy a probarlo si se acomoda a lo que busco. Toda la semana he estado averiguando sobre el formato PE de .NET, escasa información, pero ya logro leer la estructura PE desde VB.Net, lo malo es que no hay punteros o por lo menos no funcionan como en C++. Aqui un ejemplo para ilustrar mi problema, no puedo modificar los valores en memoria de "p" (Point) mediante punteros Public Sub example Dim p As Point p.x = 1 ' esto no puedo modificarlo mediante un puntero p.y = 1 ' Initialize unmanged memory to hold the struct. Dim pnt As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(p)) Try Dim msg As String = "" ' Copy the struct to unmanaged memory. Marshal.StructureToPtr(p, pnt, false) msg += ( "first point is " + p.x.ToString + " and " + p.y.ToString + "." & chr(10) ) Dim anotherP As Point ' Create another point ' Set this Point to the value of the ' Point in unmanaged memory. anotherP = Marshal.PtrToStructure(pnt,p.GetType) anotherP.X += 2 'modifico los valores pero en "p" no se alteran anotherP.Y += 2 msg += ( "New point is " + anotherP.x.ToString + " and " + anotherP.y.ToString + "." & chr(10) ) msg += ( "first point is " + p.x.ToString + " and " + p.y.ToString + "." ) msgbox(msg) Finally ' Free the unmanaged memory. Marshal.FreeHGlobal(pnt) End Try End Sub
Saludos y muchas gracias.
|
|
|
117
|
Programación / .NET (C#, VB.NET, ASP) / Re: Agregar Recurso a un archivo EXE [F1]
|
en: 15 Marzo 2015, 17:41 pm
|
Gracias Eleкtro, por responder, pero el método que busco es sin el source del EXE. Busco automatizar el proceso, es decir, crearme una aplicación que agregue recursos a un EXE .NET Voy a averiguar sobre ILMerge, si tienes algun info?. O sino voy a tener que meter mano al formato PE Saludos.
|
|
|
118
|
Programación / .NET (C#, VB.NET, ASP) / Agregar Recurso a un archivo EXE [F1]
|
en: 14 Marzo 2015, 23:59 pm
|
Estoy tratando de agregar un recurso a un ejecutable de vb.net, si alguien tiene info o sugerencia que compartir se lo agradeceria mucho. No estoy intentando agregar el recurso en un proyecto, aclaro. Según entiendo tendría que modificar el formato PE del exe, pero si hay algun otro método mejor . Saludos.
|
|
|
120
|
Programación / Desarrollo Web / Re: [HTML5] Reproductor MP3
|
en: 18 Febrero 2015, 16:32 pm
|
Lo probe en firefox 14 y la interfaz se desconfigura un poco, requiere algunos cambios en Css para que sea compatible. En chrome no hay problema. Por ahi tengo un codigo para reproducir mp3 o OGG por si el navegador no soporta mp3, lo malo es tener una copia de la musica en 2 formatos. Usé la libreria minim.js por si te interesa Saludos.
|
|
|
|
|
|
|